diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/src/main/java/org/openecomp/sdcrests/action/rest/ActionsForSwaggerFileUpload.java b/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/src/main/java/org/openecomp/sdcrests/action/rest/ActionsForSwaggerFileUpload.java
index 5dc79eb..5a7232b 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/src/main/java/org/openecomp/sdcrests/action/rest/ActionsForSwaggerFileUpload.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/src/main/java/org/openecomp/sdcrests/action/rest/ActionsForSwaggerFileUpload.java
@@ -26,7 +26,6 @@
 import org.apache.cxf.jaxrs.ext.multipart.Multipart;
 import org.springframework.validation.annotation.Validated;
 
-import java.io.InputStream;
 import javax.servlet.http.HttpServletRequest;
 import javax.ws.rs.Consumes;
 import javax.ws.rs.HeaderParam;
@@ -38,6 +37,7 @@
 import javax.ws.rs.core.Context;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
+import java.io.InputStream;
 
 
 @Path("/workflow/v1.0/actions")
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/src/main/java/org/openecomp/sdcrests/action/rest/services/ActionsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/src/main/java/org/openecomp/sdcrests/action/rest/services/ActionsImpl.java
index 875b515..b186852 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/src/main/java/org/openecomp/sdcrests/action/rest/services/ActionsImpl.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/src/main/java/org/openecomp/sdcrests/action/rest/services/ActionsImpl.java
@@ -31,7 +31,11 @@
 import org.openecomp.sdc.action.errors.ActionException;
 import org.openecomp.sdc.action.logging.CategoryLogLevel;
 import org.openecomp.sdc.action.logging.StatusCode;
-import org.openecomp.sdc.action.types.*;
+import org.openecomp.sdc.action.types.Action;
+import org.openecomp.sdc.action.types.ActionArtifact;
+import org.openecomp.sdc.action.types.ActionArtifactProtection;
+import org.openecomp.sdc.action.types.ActionRequest;
+import org.openecomp.sdc.action.types.OpenEcompComponent;
 import org.openecomp.sdc.logging.api.Logger;
 import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.openecomp.sdcrests.action.rest.Actions;
@@ -53,11 +57,85 @@
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
 
-import static org.openecomp.sdc.action.ActionConstants.*;
-import static org.openecomp.sdc.action.errors.ActionErrorConstants.*;
-import static org.openecomp.sdc.action.util.ActionUtil.*;
+import static org.openecomp.sdc.action.ActionConstants.ACTION_REQUEST_PARAM_NAME;
+import static org.openecomp.sdc.action.ActionConstants.ACTION_REQUEST_PARAM_SUPPORTED_MODELS;
+import static org.openecomp.sdc.action.ActionConstants.ARTIFACT_FILE;
+import static org.openecomp.sdc.action.ActionConstants.ARTIFACT_NAME;
+import static org.openecomp.sdc.action.ActionConstants.BE_FQDN;
+import static org.openecomp.sdc.action.ActionConstants.CATEGORY_LOG_LEVEL;
+import static org.openecomp.sdc.action.ActionConstants.CLIENT_IP;
+import static org.openecomp.sdc.action.ActionConstants.ERROR_DESCRIPTION;
+import static org.openecomp.sdc.action.ActionConstants.FILTER_TYPE_CATEGORY;
+import static org.openecomp.sdc.action.ActionConstants.FILTER_TYPE_MODEL;
+import static org.openecomp.sdc.action.ActionConstants.FILTER_TYPE_NAME;
+import static org.openecomp.sdc.action.ActionConstants.FILTER_TYPE_NONE;
+import static org.openecomp.sdc.action.ActionConstants.FILTER_TYPE_OPEN_ECOMP_COMPONENT;
+import static org.openecomp.sdc.action.ActionConstants.FILTER_TYPE_VENDOR;
+import static org.openecomp.sdc.action.ActionConstants.INSTANCE_UUID;
+import static org.openecomp.sdc.action.ActionConstants.LOCAL_ADDR;
+import static org.openecomp.sdc.action.ActionConstants.MAX_ACTION_ARTIFACT_SIZE;
+import static org.openecomp.sdc.action.ActionConstants.MDC_ASDC_INSTANCE_UUID;
+import static org.openecomp.sdc.action.ActionConstants.PARTNER_NAME;
+import static org.openecomp.sdc.action.ActionConstants.REMOTE_HOST;
+import static org.openecomp.sdc.action.ActionConstants.REQUEST_EMPTY_BODY;
+import static org.openecomp.sdc.action.ActionConstants.REQUEST_ID;
+import static org.openecomp.sdc.action.ActionConstants.REQUEST_TYPE_CREATE_ACTION;
+import static org.openecomp.sdc.action.ActionConstants.REQUEST_TYPE_UPDATE_ACTION;
+import static org.openecomp.sdc.action.ActionConstants.REQUEST_TYPE_VERSION_ACTION;
+import static org.openecomp.sdc.action.ActionConstants.SERVICE_INSTANCE_ID;
+import static org.openecomp.sdc.action.ActionConstants.SERVICE_METRIC_BEGIN_TIMESTAMP;
+import static org.openecomp.sdc.action.ActionConstants.SERVICE_NAME;
+import static org.openecomp.sdc.action.ActionConstants.STATUS;
+import static org.openecomp.sdc.action.ActionConstants.STATUS_CODE;
+import static org.openecomp.sdc.action.ActionConstants.SUPPORTED_COMPONENTS_ID;
+import static org.openecomp.sdc.action.ActionConstants.SUPPORTED_MODELS_VERSION_ID;
+import static org.openecomp.sdc.action.ActionConstants.TARGET_ENTITY;
+import static org.openecomp.sdc.action.ActionConstants.TARGET_ENTITY_API;
+import static org.openecomp.sdc.action.ActionConstants.TARGET_SERVICE_NAME;
+import static org.openecomp.sdc.action.ActionConstants.TIMESTAMP;
+import static org.openecomp.sdc.action.ActionConstants.UPDATED_BY;
+import static org.openecomp.sdc.action.ActionConstants.X_OPEN_ECOMP_INSTANCE_ID_HEADER_PARAM;
+import static org.openecomp.sdc.action.ActionConstants.X_OPEN_ECOMP_REQUEST_ID_HEADER_PARAM;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_CHECKSUM_ERROR_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_INVALID_NAME;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_INVALID_NAME_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_INVALID_PROTECTION_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_READ_FILE_ERROR;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_TOO_BIG_ERROR;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_TOO_BIG_ERROR_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ENTITY_INTERNAL_SERVER_ERROR_MSG;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ENTITY_NOT_EXIST;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ENTITY_NOT_EXIST_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_FILTER_MULTIPLE_QUERY_PARAM_NOT_SUPPORTED;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_INTERNAL_SERVER_ERR_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_INVALID_INSTANCE_ID_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_INVALID_PARAM_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_INVALID_REQUEST_BODY_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_INVALID_REQUEST_ID_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_INVALID_SEARCH_CRITERIA;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_MULT_SEARCH_CRITERIA;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_REQUEST_ARTIFACT_CHECKSUM_ERROR;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_REQUEST_ARTIFACT_INVALID_PROTECTION_VALUE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_REQUEST_ARTIFACT_OPERATION_ALLOWED;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_REQUEST_BODY_EMPTY;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_REQUEST_CONTENT_TYPE_INVALID;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_REQUEST_FILTER_PARAM_INVALID;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_REQUEST_INVALID_GENERIC_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_REQUEST_INVALID_NAME;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_REQUEST_MISSING_MANDATORY_PARAM;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_REQUEST_OPEN_ECOMP_INSTANCE_ID_INVALID;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_REQUEST_OPEN_ECOMP_REQUEST_ID_INVALID;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_UNSUPPORTED_OPERATION;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_UPDATE_NOT_ALLOWED_CODE;
+import static org.openecomp.sdc.action.util.ActionUtil.actionErrorLogProcessor;
+import static org.openecomp.sdc.action.util.ActionUtil.actionLogPostProcessor;
+import static org.openecomp.sdc.action.util.ActionUtil.getUtcDateStringFromTimestamp;
 
 /**
  * Implements various CRUD API that can be performed on Action
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/activity-log-rest/activity-log-rest-services/src/main/java/org/openecomp/sdcrests/activitylog/rest/ActivityLog.java b/openecomp-be/api/openecomp-sdc-rest-webapp/activity-log-rest/activity-log-rest-services/src/main/java/org/openecomp/sdcrests/activitylog/rest/ActivityLog.java
deleted file mode 100644
index be4cc1b..0000000
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/activity-log-rest/activity-log-rest-services/src/main/java/org/openecomp/sdcrests/activitylog/rest/ActivityLog.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * 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=========================================================
- */
-
-package org.openecomp.sdcrests.activitylog.rest;
-
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
-import org.openecomp.sdcrests.activitylog.types.ActivityLogDto;
-import org.springframework.validation.annotation.Validated;
-
-import javax.validation.constraints.NotNull;
-import javax.ws.rs.*;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
-import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
-
-
-@Path("/v1.0/activity-logs")
-@Produces(MediaType.APPLICATION_JSON)
-@Consumes(MediaType.APPLICATION_JSON)
-@Api(value = "Item Activity Log")
-@Validated
-public interface ActivityLog {
-
-    @GET
-    @Path("/{itemId}/versions/{versionId}")
-    @ApiOperation(value = "List actions log of item",
-            response = ActivityLogDto.class,
-            responseContainer = "List")
-    Response getActivityLog(@ApiParam("Item Id") @PathParam("itemId") String itemId,
-                            @ApiParam("Version Id") @PathParam("versionId") String versionId,
-                            @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
-                            String user);
-
-}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/activity-log-rest/activity-log-rest-services/src/main/java/org/openecomp/sdcrests/activitylog/rest/services/ActivityLogImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/activity-log-rest/activity-log-rest-services/src/main/java/org/openecomp/sdcrests/activitylog/rest/services/ActivityLogImpl.java
deleted file mode 100644
index c42d72b..0000000
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/activity-log-rest/activity-log-rest-services/src/main/java/org/openecomp/sdcrests/activitylog/rest/services/ActivityLogImpl.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * 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=========================================================
- */
-
-package org.openecomp.sdcrests.activitylog.rest.services;
-
-import org.openecomp.sdc.activityLog.ActivityLogManager;
-import org.openecomp.sdc.activityLog.ActivityLogManagerFactory;
-import org.openecomp.sdc.activitylog.dao.type.ActivityLogEntity;
-import org.openecomp.sdc.logging.context.MdcUtil;
-import org.openecomp.sdc.logging.types.LoggerServiceName;
-import org.openecomp.sdc.versioning.dao.types.Version;
-import org.openecomp.sdcrests.activitylog.rest.ActivityLog;
-import org.openecomp.sdcrests.activitylog.rest.mapping.MapActivityLogEntityToActivityLogDto;
-import org.openecomp.sdcrests.activitylog.types.ActivityLogDto;
-import org.openecomp.sdcrests.wrappers.GenericCollectionWrapper;
-import org.springframework.context.annotation.Scope;
-import org.springframework.stereotype.Service;
-
-import javax.inject.Named;
-import javax.ws.rs.core.Response;
-import java.util.Collection;
-
-@Named
-@Service("activityLog")
-@Scope(value = "prototype")
-public class ActivityLogImpl implements ActivityLog {
-
-    private ActivityLogManager activityLogManager =
-            ActivityLogManagerFactory.getInstance().createInterface();
-
-
-    @Override
-    public Response getActivityLog(String vspId, String versionId, String user) {
-        MdcUtil.initMdc(LoggerServiceName.Get_List_Activity_Log.toString());
-
-        Collection<ActivityLogEntity> activityLogs =
-                activityLogManager.listActivityLogs(vspId, Version.valueOf(versionId), user);
-
-        MapActivityLogEntityToActivityLogDto mapper = new MapActivityLogEntityToActivityLogDto();
-        GenericCollectionWrapper<ActivityLogDto> results = new GenericCollectionWrapper<>();
-        for (ActivityLogEntity activityLog : activityLogs) {
-            results.add(mapper.applyMapping(activityLog, ActivityLogDto.class));
-        }
-
-        return Response.ok(results).build();
-    }
-}
-
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/activity-log-rest/activity-log-rest-types/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/activity-log-rest/activity-log-rest-types/pom.xml
deleted file mode 100644
index 70f029a..0000000
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/activity-log-rest/activity-log-rest-types/pom.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-
-    <artifactId>activity-log-rest-types</artifactId>
-    
-    <parent>
-        <groupId>org.openecomp.sdc</groupId>
-        <artifactId>activity-log-rest</artifactId>
-        <version>1.2.0-SNAPSHOT</version>
-    </parent>
-
-</project>
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/activity-log-rest/activity-log-rest-types/src/main/java/org/openecomp/sdcrests/activitylog/types/ActivityLogDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/activity-log-rest/activity-log-rest-types/src/main/java/org/openecomp/sdcrests/activitylog/types/ActivityLogDto.java
deleted file mode 100644
index dde5795..0000000
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/activity-log-rest/activity-log-rest-types/src/main/java/org/openecomp/sdcrests/activitylog/types/ActivityLogDto.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * 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=========================================================
- */
-
-package org.openecomp.sdcrests.activitylog.types;
-
-
-
-import java.util.Date;
-
-public class ActivityLogDto {
-
-    private String id;
-    private Date timestamp;
-    private String type;
-    private String comment;
-    private String user;
-    private ActivityStatus status;
-
-    public ActivityLogDto(){}
-
-    public String getId() { return id; }
-
-    public void setId(String id) { this.id = id; }
-
-    public Date getTimestamp() {
-        return timestamp;
-    }
-
-    public void setTimestamp(Date timestamp) {
-        this.timestamp = timestamp;
-    }
-
-    public String getType() {
-        return type;
-    }
-
-    public void setType(String type) {
-        this.type = type;
-    }
-
-    public String getComment() {
-        return comment;
-    }
-
-    public void setComment(String comment) {
-        this.comment = comment;
-    }
-
-    public String getUser() {
-        return user;
-    }
-
-    public void setUser(String user) {
-        this.user = user;
-    }
-
-    public ActivityStatus getStatus() {
-        return status;
-    }
-
-    public void setStatus(ActivityStatus status) {
-        this.status = status;
-    }
-}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/activity-log-rest/activity-log-rest-types/src/main/java/org/openecomp/sdcrests/activitylog/types/ActivityType.java b/openecomp-be/api/openecomp-sdc-rest-webapp/activity-log-rest/activity-log-rest-types/src/main/java/org/openecomp/sdcrests/activitylog/types/ActivityType.java
deleted file mode 100644
index 80160bc..0000000
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/activity-log-rest/activity-log-rest-types/src/main/java/org/openecomp/sdcrests/activitylog/types/ActivityType.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * 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=========================================================
- */
-
-package org.openecomp.sdcrests.activitylog.types;
-
-import java.io.Serializable;
-
-public enum ActivityType implements Serializable {
-
-  CREATE_NEW("Create New"),
-  CHECKOUT("Check Out"),
-  UNDO_CHECKOUT("Undo Check Out"),
-  CHECKIN("Check In"),
-  UPLOAD_HEAT("Upload Heat"),
-  UPLOAD_MONITORING_FILE("Upload Monitoring File"),
-  SUBMIT("Submit");
-
-  // after collaboration will be added - this will be added:
-    /*
-    CREATE_NEW,
-    COMMIT,
-    ADD_PERMISSION,
-    REMOVE_PERMISSION,
-    */
-
-  private String name;
-
-  ActivityType(String name) {
-    this.name = name;
-  }
-
-  @Override
-  public String toString() {
-    return name;
-  }
-}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-services/src/main/java/org/openecomp/sdcrests/applicationconfig/rest/ApplicationConfiguration.java b/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-services/src/main/java/org/openecomp/sdcrests/applicationconfig/rest/ApplicationConfiguration.java
index 6c95a14..6042060 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-services/src/main/java/org/openecomp/sdcrests/applicationconfig/rest/ApplicationConfiguration.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-services/src/main/java/org/openecomp/sdcrests/applicationconfig/rest/ApplicationConfiguration.java
@@ -26,7 +26,6 @@
 import org.openecomp.sdcrests.applicationconfiguration.types.ConfigurationDataDto;
 import org.springframework.validation.annotation.Validated;
 
-import java.io.InputStream;
 import javax.ws.rs.Consumes;
 import javax.ws.rs.GET;
 import javax.ws.rs.POST;
@@ -36,6 +35,7 @@
 import javax.ws.rs.QueryParam;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
+import java.io.InputStream;
 
 @Path("/v1.0/application-configuration")
 @Produces(MediaType.APPLICATION_JSON)
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-services/src/main/java/org/openecomp/sdcrests/applicationconfig/rest/services/ApplicationConfigurationImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-services/src/main/java/org/openecomp/sdcrests/applicationconfig/rest/services/ApplicationConfigurationImpl.java
index c7f3f25..27557e1 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-services/src/main/java/org/openecomp/sdcrests/applicationconfig/rest/services/ApplicationConfigurationImpl.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-services/src/main/java/org/openecomp/sdcrests/applicationconfig/rest/services/ApplicationConfigurationImpl.java
@@ -38,10 +38,10 @@
 import org.springframework.context.annotation.Scope;
 import org.springframework.stereotype.Service;
 
-import java.io.InputStream;
-import java.util.Collection;
 import javax.inject.Named;
 import javax.ws.rs.core.Response;
+import java.io.InputStream;
+import java.util.Collection;
 
 /**
  * Created by Talio on 8/8/2016.
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/activity-log-rest/activity-log-rest-services/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-services/pom.xml
similarity index 68%
copy from openecomp-be/api/openecomp-sdc-rest-webapp/activity-log-rest/activity-log-rest-services/pom.xml
copy to openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-services/pom.xml
index 10685db..534aea1 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/activity-log-rest/activity-log-rest-services/pom.xml
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-services/pom.xml
@@ -4,55 +4,55 @@
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
-    <artifactId>activity-log-rest-services</artifactId>
-
     <parent>
         <groupId>org.openecomp.sdc</groupId>
-        <artifactId>activity-log-rest</artifactId>
+        <artifactId>conflict-rest</artifactId>
         <version>1.2.0-SNAPSHOT</version>
     </parent>
 
+    <artifactId>conflict-rest-services</artifactId>
+
+
+
     <dependencies>
 
-
         <dependency>
-            <groupId>javax.ws.rs</groupId>
-            <artifactId>javax.ws.rs-api</artifactId>
-            <version>${ws.rs.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.springframework</groupId>
-            <artifactId>spring-context</artifactId>
-            <version>${spring.framework.version}</version>
+            <groupId>org.openecomp.sdc</groupId>
+            <artifactId>openecomp-sdc-common-rest</artifactId>
+            <version>${project.version}</version>
         </dependency>
         <dependency>
             <groupId>javax.inject</groupId>
             <artifactId>javax.inject</artifactId>
             <version>1</version>
         </dependency>
-        <dependency>
-            <groupId>org.openecomp.sdc</groupId>
-            <artifactId>openecomp-sdc-activity-log-manager</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-             <groupId>org.openecomp.sdc</groupId>
-            <artifactId>activity-log-rest-types</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.openecomp.sdc</groupId>
-            <artifactId>openecomp-sdc-common-rest</artifactId>
-            <version>${project.version}</version>
-        </dependency>
         <!-- CXF -->
         <dependency>
             <groupId>org.apache.cxf</groupId>
             <artifactId>cxf-rt-frontend-jaxrs</artifactId>
             <version>${cxf.version}</version>
         </dependency>
-
+        <dependency>
+            <groupId>org.openecomp.sdc</groupId>
+            <artifactId>openecomp-sdc-conflict-manager</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.openecomp.sdc</groupId>
+            <artifactId>conflict-rest-types</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.openecomp.sdc.onboarding</groupId>
+            <artifactId>vendor-software-products-rest-services</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.openecomp.sdc.onboarding</groupId>
+            <artifactId>vendor-license-rest-services</artifactId>
+            <version>${project.version}</version>
+        </dependency>
     </dependencies>
 
 
-</project>
+</project>
\ No newline at end of file
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-services/src/main/java/org/openecomp/sdcrests/conflict/rest/Conflicts.java b/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-services/src/main/java/org/openecomp/sdcrests/conflict/rest/Conflicts.java
new file mode 100644
index 0000000..396c4ee
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-services/src/main/java/org/openecomp/sdcrests/conflict/rest/Conflicts.java
@@ -0,0 +1,61 @@
+package org.openecomp.sdcrests.conflict.rest;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.openecomp.sdcrests.common.RestConstants;
+import org.openecomp.sdcrests.conflict.types.ConflictDto;
+import org.openecomp.sdcrests.conflict.types.ConflictResolutionDto;
+import org.openecomp.sdcrests.conflict.types.ItemVersionConflictDto;
+import org.springframework.validation.annotation.Validated;
+
+import javax.validation.constraints.NotNull;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+@Path("/v1.0/items/{itemId}/versions/{versionId}/conflicts")
+@Produces(MediaType.APPLICATION_JSON)
+@Consumes(MediaType.APPLICATION_JSON)
+@Api(value = "Item Version Conflicts")
+@Validated
+public interface Conflicts {
+
+  @GET
+  @Path("/")
+  @ApiOperation(value = "item version conflicts",
+      notes = "Item version private copy conflicts against its public copy",
+      response = ItemVersionConflictDto.class)
+  Response getConflict(@ApiParam("Item Id") @PathParam("itemId") String itemId,
+                       @ApiParam("Version Id") @PathParam("versionId") String versionId,
+                       @NotNull(message = RestConstants.USER_MISSING_ERROR_MSG)
+                        @HeaderParam(RestConstants.USER_ID_HEADER_PARAM) String user);
+
+  @GET
+  @Path("/{conflictId}")
+  @ApiOperation(value = "Gets item version conflict",
+      notes = "Gets an item version private copy conflict against its public copy",
+      response = ConflictDto.class)
+  Response getConflict(@ApiParam("Item Id") @PathParam("itemId") String itemId,
+                       @ApiParam("Version Id") @PathParam("versionId") String versionId,
+                       @ApiParam("Version Id") @PathParam("conflictId") String conflictId,
+                       @NotNull(message = RestConstants.USER_MISSING_ERROR_MSG)
+                       @HeaderParam(RestConstants.USER_ID_HEADER_PARAM) String user);
+
+  @PUT
+  @Path("/{conflictId}")
+  @ApiOperation(value = "Resolves item version conflict",
+      notes = "Resolves an item version private copy conflict against its public copy")
+  Response resolveConflict(ConflictResolutionDto conflictResolution,
+                           @ApiParam("Item Id") @PathParam("itemId") String itemId,
+                           @ApiParam("Version Id") @PathParam("versionId") String versionId,
+                           @ApiParam("Version Id") @PathParam("conflictId") String conflictId,
+                           @NotNull(message = RestConstants.USER_MISSING_ERROR_MSG)
+                           @HeaderParam(RestConstants.USER_ID_HEADER_PARAM) String user);
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-services/src/main/java/org/openecomp/sdcrests/conflict/rest/mapping/MapConflictInfoToDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-services/src/main/java/org/openecomp/sdcrests/conflict/rest/mapping/MapConflictInfoToDto.java
new file mode 100644
index 0000000..e80ef56
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-services/src/main/java/org/openecomp/sdcrests/conflict/rest/mapping/MapConflictInfoToDto.java
@@ -0,0 +1,14 @@
+package org.openecomp.sdcrests.conflict.rest.mapping;
+
+import org.openecomp.conflicts.types.ConflictInfo;
+import org.openecomp.sdcrests.conflict.types.ConflictInfoDto;
+import org.openecomp.sdcrests.mapping.MappingBase;
+
+public class MapConflictInfoToDto extends MappingBase<ConflictInfo, ConflictInfoDto> {
+  @Override
+  public void doMapping(ConflictInfo source, ConflictInfoDto target) {
+    target.setId(source.getId());
+    target.setType(source.getType());
+    target.setName(source.getName());
+  }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-services/src/main/java/org/openecomp/sdcrests/conflict/rest/mapping/MapConflictToDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-services/src/main/java/org/openecomp/sdcrests/conflict/rest/mapping/MapConflictToDto.java
new file mode 100644
index 0000000..83a0f52
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-services/src/main/java/org/openecomp/sdcrests/conflict/rest/mapping/MapConflictToDto.java
@@ -0,0 +1,134 @@
+package org.openecomp.sdcrests.conflict.rest.mapping;
+
+import org.openecomp.conflicts.types.Conflict;
+import org.openecomp.core.utilities.json.JsonUtil;
+import org.openecomp.sdc.datatypes.model.ElementType;
+import org.openecomp.sdcrests.conflict.types.ConflictDto;
+import org.openecomp.sdcrests.mapping.EchoMapMapping;
+import org.openecomp.sdcrests.mapping.MappingBase;
+import org.openecomp.sdcrests.vendorlicense.rest.mapping.MapEntitlementPoolEntityToEntitlementPoolEntityDto;
+import org.openecomp.sdcrests.vendorlicense.rest.mapping.MapFeatureGroupEntityToFeatureGroupDescriptorDto;
+import org.openecomp.sdcrests.vendorlicense.rest.mapping.MapLicenseAgreementEntityToLicenseAgreementDescriptorDto;
+import org.openecomp.sdcrests.vendorlicense.rest.mapping.MapLicenseKeyGroupEntityToLicenseKeyGroupEntityDto;
+import org.openecomp.sdcrests.vendorlicense.rest.mapping.MapLimitEntityToLimitDto;
+import org.openecomp.sdcrests.vendorlicense.rest.mapping.MapVendorLicenseModelEntityToDto;
+import org.openecomp.sdcrests.vendorlicense.types.EntitlementPoolEntityDto;
+import org.openecomp.sdcrests.vendorlicense.types.FeatureGroupDescriptorDto;
+import org.openecomp.sdcrests.vendorlicense.types.LicenseAgreementDescriptorDto;
+import org.openecomp.sdcrests.vendorlicense.types.LicenseKeyGroupEntityDto;
+import org.openecomp.sdcrests.vendorlicense.types.LimitEntityDto;
+import org.openecomp.sdcrests.vendorlicense.types.VendorLicenseModelEntityDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentDependencyModel;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.DeploymentFlavorDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.FileDataStructureDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.ImageDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.NetworkDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.NicDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.ProcessEntityDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.QuestionnaireDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.VspComputeDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.VspDetailsDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapComponentDependencyModelEntityToDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapComponentEntityToComponentDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapComputeEntityToVspComputeDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapDeploymentFlavorEntityToDeploymentFlavorDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapFilesDataStructureToDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapImageEntityToImageDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapNetworkEntityToNetworkDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapNicEntityToNicDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapProcessEntityToProcessEntityDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapQuestionnaireToQuestionnaireDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapVspDetailsToDto;
+
+import java.util.AbstractMap;
+import java.util.HashMap;
+import java.util.Map;
+
+public class MapConflictToDto extends MappingBase<Conflict, ConflictDto> {
+
+  @Override
+  public void doMapping(Conflict source, ConflictDto target) {
+    target.setId(source.getId());
+    target.setType(source.getType());
+    target.setName(source.getName());
+
+    Map.Entry<MappingBase, Class> mapperToTargetClass = getMapper(source.getType());
+    target.setTheirs(map(mapperToTargetClass, source.getTheirs()));
+    target.setYours(map(mapperToTargetClass, source.getYours()));
+  }
+
+  private Map map(Map.Entry<MappingBase, Class> mapperToTargetClass, Object object) {
+    return JsonUtil
+        .json2Object(JsonUtil.object2Json(
+            mapperToTargetClass.getKey().applyMapping(object, mapperToTargetClass.getValue())),
+            Map.class);
+  }
+
+  private Map.Entry<MappingBase, Class> getMapper(ElementType type) {
+    switch (type) {
+      case VendorLicenseModel:
+        return new AbstractMap.SimpleEntry<>(new MapVendorLicenseModelEntityToDto(),
+            VendorLicenseModelEntityDto.class);
+      case LicenseAgreement:
+        return new AbstractMap.SimpleEntry<>(
+            new MapLicenseAgreementEntityToLicenseAgreementDescriptorDto(),
+            LicenseAgreementDescriptorDto.class);
+      case FeatureGroup:
+        return new AbstractMap.SimpleEntry<>(new MapFeatureGroupEntityToFeatureGroupDescriptorDto(),
+            FeatureGroupDescriptorDto.class);
+      case LicenseKeyGroup:
+        return new AbstractMap.SimpleEntry<>(
+            new MapLicenseKeyGroupEntityToLicenseKeyGroupEntityDto(), LicenseKeyGroupEntityDto
+            .class);
+      case EntitlementPool:
+        return new AbstractMap.SimpleEntry<>(
+            new MapEntitlementPoolEntityToEntitlementPoolEntityDto(), EntitlementPoolEntityDto
+            .class);
+      case Limit:
+        return new AbstractMap.SimpleEntry<>(new MapLimitEntityToLimitDto(), LimitEntityDto.class);
+      case VendorSoftwareProduct:
+        return new AbstractMap.SimpleEntry<>(new MapVspDetailsToDto(), VspDetailsDto.class);
+      case Network:
+        return new AbstractMap.SimpleEntry<>(new MapNetworkEntityToNetworkDto(), NetworkDto.class);
+      case Component:
+        return new AbstractMap.SimpleEntry<>(new MapComponentEntityToComponentDto(),
+            ComponentDto.class);
+      case ComponentDependencies:
+        return new AbstractMap.SimpleEntry<>(new MapComponentDependencyModelEntityToDto(),
+            ComponentDependencyModel.class);
+      case Nic:
+        return new AbstractMap.SimpleEntry<>(new MapNicEntityToNicDto(), NicDto.class);
+      case Process:
+        return new AbstractMap.SimpleEntry<>(new MapProcessEntityToProcessEntityDto(),
+            ProcessEntityDto.class);
+      case DeploymentFlavor:
+        return new AbstractMap.SimpleEntry<>(new MapDeploymentFlavorEntityToDeploymentFlavorDto(),
+            DeploymentFlavorDto.class);
+      case Compute:
+        return new AbstractMap.SimpleEntry<>(new MapComputeEntityToVspComputeDto(),
+            VspComputeDto.class);
+      case Image:
+        return new AbstractMap.SimpleEntry<>(new MapImageEntityToImageDto(), ImageDto.class);
+      case VSPQuestionnaire:
+      case NicQuestionnaire:
+      case ComponentQuestionnaire:
+      case ImageQuestionnaire:
+      case ComputeQuestionnaire:
+        return new AbstractMap.SimpleEntry<>(new MapQuestionnaireToQuestionnaireDto(),
+            QuestionnaireDto.class);
+      case SNMP_POLL:
+      case SNMP_TRAP:
+      case VES_EVENTS:
+      case OrchestrationTemplateCandidate:
+        return new AbstractMap.SimpleEntry<>(new MapFilesDataStructureToDto(),
+            FileDataStructureDto.class);
+      case ServiceModel:
+      case NetworkPackage:
+        return new AbstractMap.SimpleEntry<>(new EchoMapMapping(), HashMap.class);
+      case itemVersion:
+        return new AbstractMap.SimpleEntry<>(new EchoMapMapping(), HashMap.class);
+    }
+    throw new RuntimeException("Get conflict does not support element type: " + type.name());
+  }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-services/src/main/java/org/openecomp/sdcrests/conflict/rest/mapping/MapDtoToConflictResolution.java b/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-services/src/main/java/org/openecomp/sdcrests/conflict/rest/mapping/MapDtoToConflictResolution.java
new file mode 100644
index 0000000..1a03a6b
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-services/src/main/java/org/openecomp/sdcrests/conflict/rest/mapping/MapDtoToConflictResolution.java
@@ -0,0 +1,15 @@
+package org.openecomp.sdcrests.conflict.rest.mapping;
+
+import org.openecomp.conflicts.types.ConflictResolution;
+import org.openecomp.sdcrests.conflict.types.ConflictResolutionDto;
+import org.openecomp.sdcrests.mapping.MappingBase;
+
+public class MapDtoToConflictResolution
+    extends MappingBase<ConflictResolutionDto, ConflictResolution> {
+
+  @Override
+  public void doMapping(ConflictResolutionDto source, ConflictResolution target) {
+    target.setResolution(source.getResolution());
+    target.setOtherResolution(source.getOtherResolution());
+  }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-services/src/main/java/org/openecomp/sdcrests/conflict/rest/mapping/MapItemVersionConflictToDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-services/src/main/java/org/openecomp/sdcrests/conflict/rest/mapping/MapItemVersionConflictToDto.java
new file mode 100644
index 0000000..fb5d013
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-services/src/main/java/org/openecomp/sdcrests/conflict/rest/mapping/MapItemVersionConflictToDto.java
@@ -0,0 +1,22 @@
+package org.openecomp.sdcrests.conflict.rest.mapping;
+
+
+import org.openecomp.conflicts.types.ItemVersionConflict;
+import org.openecomp.sdcrests.conflict.types.ConflictDto;
+import org.openecomp.sdcrests.conflict.types.ConflictInfoDto;
+import org.openecomp.sdcrests.conflict.types.ItemVersionConflictDto;
+import org.openecomp.sdcrests.mapping.MappingBase;
+
+public class MapItemVersionConflictToDto
+    extends MappingBase<ItemVersionConflict, ItemVersionConflictDto> {
+
+  @Override
+  public void doMapping(ItemVersionConflict source, ItemVersionConflictDto target) {
+    target
+        .setConflict(new MapConflictToDto().applyMapping(source.getVersionConflict(), ConflictDto.class));
+
+    MapConflictInfoToDto conflictInfoMapper = new MapConflictInfoToDto();
+    source.getElementConflicts().forEach(conflictInfo -> target
+        .addConflictInfo(conflictInfoMapper.applyMapping(conflictInfo, ConflictInfoDto.class)));
+  }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-services/src/main/java/org/openecomp/sdcrests/conflict/rest/services/ConflictsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-services/src/main/java/org/openecomp/sdcrests/conflict/rest/services/ConflictsImpl.java
new file mode 100644
index 0000000..fda12ef
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-services/src/main/java/org/openecomp/sdcrests/conflict/rest/services/ConflictsImpl.java
@@ -0,0 +1,62 @@
+package org.openecomp.sdcrests.conflict.rest.services;
+
+import org.openecomp.conflicts.types.Conflict;
+import org.openecomp.conflicts.types.ConflictResolution;
+import org.openecomp.conflicts.types.ItemVersionConflict;
+import org.openecomp.sdc.conflicts.ConflictsManager;
+import org.openecomp.sdc.conflicts.ConflictsManagerFactory;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdcrests.conflict.rest.Conflicts;
+import org.openecomp.sdcrests.conflict.rest.mapping.MapConflictToDto;
+import org.openecomp.sdcrests.conflict.rest.mapping.MapDtoToConflictResolution;
+import org.openecomp.sdcrests.conflict.rest.mapping.MapItemVersionConflictToDto;
+import org.openecomp.sdcrests.conflict.types.ConflictDto;
+import org.openecomp.sdcrests.conflict.types.ConflictResolutionDto;
+import org.openecomp.sdcrests.conflict.types.ItemVersionConflictDto;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Service;
+
+import javax.inject.Named;
+import javax.ws.rs.core.Response;
+
+@Named
+@Service("conflicts")
+@Scope(value = "prototype")
+public class ConflictsImpl implements Conflicts {
+
+  @Override
+  public Response getConflict(String itemId, String versionId, String user) {
+
+    ConflictsManager conflictsManager = ConflictsManagerFactory.getInstance().createInterface();
+    ItemVersionConflict itemVersionConflict = conflictsManager.getConflict
+        (itemId, new Version(versionId));
+    ItemVersionConflictDto result = (new MapItemVersionConflictToDto()).applyMapping
+        (itemVersionConflict, ItemVersionConflictDto.class);
+    return Response.ok(result).build();
+  }
+
+  @Override
+  public Response getConflict(String itemId, String versionId, String conflictId, String user) {
+    ConflictsManager conflictsManager = ConflictsManagerFactory.getInstance().createInterface();
+    Conflict conflict = conflictsManager.getConflict(itemId, new Version(versionId), conflictId);
+
+    ConflictDto result = new MapConflictToDto().applyMapping(conflict, ConflictDto.class);
+
+    return Response.ok(result).build();
+
+  }
+
+  @Override
+  public Response resolveConflict(ConflictResolutionDto conflictResolution, String itemId,
+                                  String versionId, String conflictId, String user) {
+    ConflictsManager conflictsManager = ConflictsManagerFactory.getInstance().createInterface();
+
+    Version version = new Version(versionId);
+    conflictsManager.resolveConflict(itemId, version, conflictId,
+        new MapDtoToConflictResolution()
+            .applyMapping(conflictResolution, ConflictResolution.class));
+    conflictsManager.finalizeMerge(itemId, version);
+
+    return Response.ok().build();
+  }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-types/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-types/pom.xml
new file mode 100644
index 0000000..e016933
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-types/pom.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.openecomp.sdc</groupId>
+        <artifactId>conflict-rest</artifactId>
+        <version>1.2.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>conflict-rest-types</artifactId>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.openecomp.sdc</groupId>
+            <artifactId>openecomp-sdc-conflict-manager</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
+</project>
\ No newline at end of file
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-types/src/main/java/org/openecomp/sdcrests/conflict/types/ConflictDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-types/src/main/java/org/openecomp/sdcrests/conflict/types/ConflictDto.java
new file mode 100644
index 0000000..47f0abd
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-types/src/main/java/org/openecomp/sdcrests/conflict/types/ConflictDto.java
@@ -0,0 +1,24 @@
+package org.openecomp.sdcrests.conflict.types;
+
+import java.util.Map;
+
+public class ConflictDto extends ConflictInfoDto {
+  private Map<String, Object> yours;
+  private Map<String, Object> theirs;
+
+  public Map<String, Object> getYours() {
+    return yours;
+  }
+
+  public void setYours(Map<String, Object> yours) {
+    this.yours = yours;
+  }
+
+  public Map<String, Object> getTheirs() {
+    return theirs;
+  }
+
+  public void setTheirs(Map<String, Object> theirs) {
+    this.theirs = theirs;
+  }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-types/src/main/java/org/openecomp/sdcrests/conflict/types/ConflictInfoDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-types/src/main/java/org/openecomp/sdcrests/conflict/types/ConflictInfoDto.java
new file mode 100644
index 0000000..e2e842a
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-types/src/main/java/org/openecomp/sdcrests/conflict/types/ConflictInfoDto.java
@@ -0,0 +1,33 @@
+package org.openecomp.sdcrests.conflict.types;
+
+import org.openecomp.sdc.datatypes.model.ElementType;
+
+public class ConflictInfoDto {
+  private String id;
+  private ElementType type;
+  private String name;
+
+  public String getId() {
+    return id;
+  }
+
+  public void setId(String id) {
+    this.id = id;
+  }
+
+  public ElementType getType() {
+    return type;
+  }
+
+  public void setType(ElementType type) {
+    this.type = type;
+  }
+
+  public String getName() {
+    return name;
+  }
+
+  public void setName(String name) {
+    this.name = name;
+  }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-types/src/main/java/org/openecomp/sdcrests/conflict/types/ConflictResolutionDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-types/src/main/java/org/openecomp/sdcrests/conflict/types/ConflictResolutionDto.java
new file mode 100644
index 0000000..1aaf18f
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-types/src/main/java/org/openecomp/sdcrests/conflict/types/ConflictResolutionDto.java
@@ -0,0 +1,27 @@
+package org.openecomp.sdcrests.conflict.types;
+
+import org.openecomp.conflicts.types.Resolution;
+
+import java.util.Map;
+
+public class ConflictResolutionDto {
+  private Resolution resolution;
+  // sits in lower level...
+  private Map<String, Object> otherResolution;
+
+  public Resolution getResolution() {
+    return resolution;
+  }
+
+  public void setResolution(Resolution resolution) {
+    this.resolution = resolution;
+  }
+
+  public Map<String, Object> getOtherResolution() {
+    return otherResolution;
+  }
+
+  public void setOtherResolution(Map<String, Object> otherResolution) {
+    this.otherResolution = otherResolution;
+  }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-types/src/main/java/org/openecomp/sdcrests/conflict/types/ItemVersionConflictDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-types/src/main/java/org/openecomp/sdcrests/conflict/types/ItemVersionConflictDto.java
new file mode 100644
index 0000000..3dbfcf0
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-types/src/main/java/org/openecomp/sdcrests/conflict/types/ItemVersionConflictDto.java
@@ -0,0 +1,29 @@
+package org.openecomp.sdcrests.conflict.types;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+public class ItemVersionConflictDto{
+  private ConflictDto conflict;
+  private Collection<ConflictInfoDto> conflictInfoList = new ArrayList<>();
+
+  public ConflictDto getConflict() {
+    return conflict;
+  }
+
+  public void setConflict(ConflictDto conflict) {
+    this.conflict = conflict;
+  }
+
+  public Collection<ConflictInfoDto> getConflictInfoList() {
+    return conflictInfoList;
+  }
+
+  public void setConflictInfoList(Collection<ConflictInfoDto> conflictInfoList) {
+    this.conflictInfoList = conflictInfoList;
+  }
+
+  public void addConflictInfo(ConflictInfoDto conflictInfo){
+    conflictInfoList.add(conflictInfo);
+  }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/pom.xml
new file mode 100644
index 0000000..d29b22a
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/pom.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <dependencies>
+        <dependency>
+            <groupId>org.openecomp.sdc</groupId>
+            <artifactId>openecomp-sdc-conflict-manager</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.openecomp.sdc</groupId>
+            <artifactId>openecomp-sdc-common-rest</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
+
+    <parent>
+        <groupId>org.openecomp.sdc</groupId>
+        <artifactId>openecomp-sdc-rest-webapp</artifactId>
+        <version>1.2.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>conflict-rest</artifactId>
+
+    <packaging>pom</packaging>
+
+
+    <modules>
+        <module>conflict-rest-services</module>
+        <module>conflict-rest-types</module>
+    </modules>
+
+</project>
\ No newline at end of file
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/healthcheck-rest/healthcheck-rest-services/src/main/java/org/openecomp/sdcrests/health/rest/HealthCheck.java b/openecomp-be/api/openecomp-sdc-rest-webapp/healthcheck-rest/healthcheck-rest-services/src/main/java/org/openecomp/sdcrests/health/rest/HealthCheck.java
index 446a80e..4be72a5 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/healthcheck-rest/healthcheck-rest-services/src/main/java/org/openecomp/sdcrests/health/rest/HealthCheck.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/healthcheck-rest/healthcheck-rest-services/src/main/java/org/openecomp/sdcrests/health/rest/HealthCheck.java
@@ -39,10 +39,10 @@
 @Validated
 public interface HealthCheck {
 
-    @GET
-    @ApiOperation(value = "Perform health check",
-            response = HealthInfoDtos.class,
-            responseContainer = "List")
-    Response checkHealth( );
+  @GET
+  @ApiOperation(value = "Perform health check",
+      response = HealthInfoDtos.class,
+      responseContainer = "List")
+  Response checkHealth();
 
 }
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/healthcheck-rest/healthcheck-rest-services/src/main/java/org/openecomp/sdcrests/health/rest/services/HealthCheckImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/healthcheck-rest/healthcheck-rest-services/src/main/java/org/openecomp/sdcrests/health/rest/services/HealthCheckImpl.java
index 38858c0..5bdc034 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/healthcheck-rest/healthcheck-rest-services/src/main/java/org/openecomp/sdcrests/health/rest/services/HealthCheckImpl.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/healthcheck-rest/healthcheck-rest-services/src/main/java/org/openecomp/sdcrests/health/rest/services/HealthCheckImpl.java
@@ -21,6 +21,7 @@
 package org.openecomp.sdcrests.health.rest.services;
 
 import org.apache.cxf.jaxrs.impl.ResponseBuilderImpl;
+import org.openecomp.sdc.common.session.SessionContextProviderFactory;
 import org.openecomp.sdc.health.HealthCheckManager;
 import org.openecomp.sdc.health.HealthCheckManagerFactory;
 import org.openecomp.sdc.health.data.HealthCheckResult;
@@ -35,58 +36,60 @@
 import org.springframework.context.annotation.Scope;
 import org.springframework.stereotype.Service;
 
-import java.util.Arrays;
-import java.util.Collection;
 import javax.inject.Named;
 import javax.ws.rs.core.Response;
+import java.util.Arrays;
+import java.util.Collection;
 
 @Named
 @Service("healthCheck")
 @Scope(value = "prototype")
 public class HealthCheckImpl implements org.openecomp.sdcrests.health.rest.HealthCheck {
 
-    private HealthCheckManager healthCheckManager;
-    private static final Logger logger = LoggerFactory.getLogger(HealthCheckImpl.class);
+  private HealthCheckManager healthCheckManager;
+  private static final Logger logger = LoggerFactory.getLogger(HealthCheckImpl.class);
 
-    public HealthCheckImpl() {
-        try {
-            healthCheckManager = HealthCheckManagerFactory.getInstance().createInterface();
-        } catch (Exception e){
-            logger.error(e.getMessage(),e);
-        }
+  public HealthCheckImpl() {
+    try {
+      healthCheckManager = HealthCheckManagerFactory.getInstance().createInterface();
+    } catch (Exception e) {
+      logger.error(e.getMessage(), e);
     }
+  }
 
-    @Override
-    public Response checkHealth() {
-        HealthCheckResult healthCheckResult = new HealthCheckResult();
+  @Override
+  public Response checkHealth() {
+    HealthCheckResult healthCheckResult = new HealthCheckResult();
+    SessionContextProviderFactory.getInstance().createInterface().create("public");
 
-        try {
-            MdcUtil.initMdc(LoggerServiceName.Health_check.toString());
-            Collection<HealthInfo> healthInfos = healthCheckManager.checkHealth();
-            healthCheckResult.setComponentsInfo(healthInfos);
-            boolean someIsDown = healthInfos.stream()
-                    .anyMatch(healthInfo -> healthInfo.getHealthCheckStatus().equals(HealthCheckStatus.DOWN));
-           healthInfos.stream().
-                   filter(healthInfo -> healthInfo.getHealthCheckComponent()
-                           .equals(org.openecomp.sdc.health.data.MonitoredModules.BE)).
-                   findFirst().ifPresent(healthInfo -> healthCheckResult.setSdcVersion(healthInfo.getVersion()));
-            if (someIsDown) {
-                Response.ResponseBuilder responseBuilder = new ResponseBuilderImpl();
-                return responseBuilder.entity(healthCheckResult).status(500).build();
-            }
-            return Response.ok(healthCheckResult).build();
-        } catch (Exception ex) {
-            logger.error("Health check failed", ex);
-            Response.ResponseBuilder responseBuilder = new ResponseBuilderImpl();
-            GenericCollectionWrapper<HealthInfoDtos> results = new GenericCollectionWrapper<>();
-             HealthInfo healthInfo = new HealthInfo(org.openecomp.sdc.health.data.MonitoredModules.BE ,
-                     HealthCheckStatus.DOWN,
-                    "", "Failed to perform Health Check");
-            Collection<HealthInfo> healthInfos = Arrays.asList(healthInfo);
-            healthCheckResult.setComponentsInfo(healthInfos);
-            return responseBuilder.entity(healthCheckResult).status(500).build();
-        }
+    try {
+      MdcUtil.initMdc(LoggerServiceName.Health_check.toString());
+      Collection<HealthInfo> healthInfos = healthCheckManager.checkHealth();
+      healthCheckResult.setComponentsInfo(healthInfos);
+      boolean someIsDown = healthInfos.stream()
+          .anyMatch(healthInfo -> healthInfo.getHealthCheckStatus().equals(HealthCheckStatus.DOWN));
+      healthInfos.stream().
+          filter(healthInfo -> healthInfo.getHealthCheckComponent()
+              .equals(org.openecomp.sdc.health.data.MonitoredModules.BE)).
+          findFirst()
+          .ifPresent(healthInfo -> healthCheckResult.setSdcVersion(healthInfo.getVersion()));
+      if (someIsDown) {
+        Response.ResponseBuilder responseBuilder = new ResponseBuilderImpl();
+        return responseBuilder.entity(healthCheckResult).status(500).build();
+      }
+      return Response.ok(healthCheckResult).build();
+    } catch (Exception ex) {
+      logger.error("Health check failed", ex);
+      Response.ResponseBuilder responseBuilder = new ResponseBuilderImpl();
+      GenericCollectionWrapper<HealthInfoDtos> results = new GenericCollectionWrapper<>();
+      HealthInfo healthInfo = new HealthInfo(org.openecomp.sdc.health.data.MonitoredModules.BE,
+          HealthCheckStatus.DOWN,
+          "", "Failed to perform Health Check");
+      Collection<HealthInfo> healthInfos = Arrays.asList(healthInfo);
+      healthCheckResult.setComponentsInfo(healthInfos);
+      return responseBuilder.entity(healthCheckResult).status(500).build();
     }
+  }
 
 
 }
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/item-permissions-rest/item-permissions-rest-services/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/item-permissions-rest/item-permissions-rest-services/pom.xml
new file mode 100644
index 0000000..cec27da
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/item-permissions-rest/item-permissions-rest-services/pom.xml
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.openecomp.sdc</groupId>
+        <artifactId>item-permissions-rest</artifactId>
+        <version>1.2.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>item-permissions-rest-services</artifactId>
+
+
+    <dependencies>
+
+        <dependency>
+            <groupId>org.openecomp.sdc</groupId>
+            <artifactId>item-permissions-rest-types</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.openecomp.sdc</groupId>
+            <artifactId>openecomp-sdc-common-rest</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.openecomp.sdc</groupId>
+            <artifactId>openecomp-sdc-item-permissions-manager</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>javax.inject</groupId>
+            <artifactId>javax.inject</artifactId>
+            <version>1</version>
+        </dependency>
+
+
+        <!--<dependency>-->
+            <!--<groupId>javax.ws.rs</groupId>-->
+            <!--<artifactId>javax.ws.rs-api</artifactId>-->
+            <!--<version>${ws.rs.version}</version>-->
+        <!--</dependency>-->
+
+        <!--<dependency>-->
+            <!--<groupId>org.apache.cxf</groupId>-->
+            <!--<artifactId>cxf-rt-frontend-jaxrs</artifactId>-->
+            <!--<version>${cxf.version}</version>-->
+        <!--</dependency>-->
+
+        <dependency>
+            <groupId>io.swagger</groupId>
+            <artifactId>swagger-models</artifactId>
+            <version>RELEASE</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-context</artifactId>
+            <version>${spring.framework.version}</version>
+        </dependency>
+    </dependencies>
+
+
+</project>
\ No newline at end of file
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/item-permissions-rest/item-permissions-rest-services/src/main/java/org/openecomp/sdcrests/itempermissions/rest/ItemPermissions.java b/openecomp-be/api/openecomp-sdc-rest-webapp/item-permissions-rest/item-permissions-rest-services/src/main/java/org/openecomp/sdcrests/itempermissions/rest/ItemPermissions.java
new file mode 100644
index 0000000..e73595c
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/item-permissions-rest/item-permissions-rest-services/src/main/java/org/openecomp/sdcrests/itempermissions/rest/ItemPermissions.java
@@ -0,0 +1,53 @@
+package org.openecomp.sdcrests.itempermissions.rest;
+
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.openecomp.sdcrests.itempermissions.types.ItemPermissionsDto;
+import org.openecomp.sdcrests.itempermissions.types.ItemPermissionsRequestDto;
+import org.springframework.validation.annotation.Validated;
+
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
+import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
+
+/**
+ * Created by ayalaben on 6/18/2017.
+ */
+@Path("/v1.0/items/{itemId}/permissions")
+@Produces(MediaType.APPLICATION_JSON)
+@Consumes(MediaType.APPLICATION_JSON)
+@Api(value = "Item Permissions")
+@Validated
+public interface ItemPermissions {
+
+  @GET
+  @Path("/")
+  @ApiOperation(value = "List users permissions assigned on item",
+      response = ItemPermissionsDto.class,
+      responseContainer = "List")
+
+  Response list(@PathParam("itemId") String itemId,
+                @HeaderParam(USER_ID_HEADER_PARAM) String user);
+
+  @PUT
+  @Path("/{permission}")
+  @ApiOperation(value = "Update useres permission on item")
+  Response updatePermissions(@Valid ItemPermissionsRequestDto request,
+                             @PathParam("itemId") String itemId,
+                             @PathParam("permission") String permission,
+                             @NotNull(message = USER_MISSING_ERROR_MSG)
+                             @HeaderParam(USER_ID_HEADER_PARAM) String user);
+
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/item-permissions-rest/item-permissions-rest-services/src/main/java/org/openecomp/sdcrests/itempermissions/rest/mapping/MapItemPermissionsToItemPermissionsDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/item-permissions-rest/item-permissions-rest-services/src/main/java/org/openecomp/sdcrests/itempermissions/rest/mapping/MapItemPermissionsToItemPermissionsDto.java
new file mode 100644
index 0000000..88c3d4d
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/item-permissions-rest/item-permissions-rest-services/src/main/java/org/openecomp/sdcrests/itempermissions/rest/mapping/MapItemPermissionsToItemPermissionsDto.java
@@ -0,0 +1,20 @@
+package org.openecomp.sdcrests.itempermissions.rest.mapping;
+
+import org.openecomp.sdc.itempermissions.type.ItemPermissionsEntity;
+import org.openecomp.sdcrests.itempermissions.types.ItemPermissionsDto;
+import org.openecomp.sdcrests.mapping.MappingBase;
+
+/**
+ * Created by ayalaben on 6/18/2017.
+ */
+
+public class MapItemPermissionsToItemPermissionsDto  extends
+    MappingBase<ItemPermissionsEntity, ItemPermissionsDto> {
+
+
+  @Override
+  public void doMapping(ItemPermissionsEntity source, ItemPermissionsDto target) {
+    target.setUserId(source.getUserId());
+    target.setPermission(source.getPermission());
+  }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/item-permissions-rest/item-permissions-rest-services/src/main/java/org/openecomp/sdcrests/itempermissions/rest/services/ItemPermissionsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/item-permissions-rest/item-permissions-rest-services/src/main/java/org/openecomp/sdcrests/itempermissions/rest/services/ItemPermissionsImpl.java
new file mode 100644
index 0000000..4fe93c2
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/item-permissions-rest/item-permissions-rest-services/src/main/java/org/openecomp/sdcrests/itempermissions/rest/services/ItemPermissionsImpl.java
@@ -0,0 +1,52 @@
+//package org.openecomp.sdcrests.itempermissions.rest.mapping.mapping.services;
+package org.openecomp.sdcrests.itempermissions.rest.services;
+
+
+import org.openecomp.sdc.itempermissions.ItemPermissionsManager;
+import org.openecomp.sdc.itempermissions.ItemPermissionsManagerFactory;
+import org.openecomp.sdcrests.itempermissions.rest.ItemPermissions;
+import org.openecomp.sdcrests.itempermissions.rest.mapping.MapItemPermissionsToItemPermissionsDto;
+import org.openecomp.sdcrests.itempermissions.types.ItemPermissionsDto;
+import org.openecomp.sdcrests.itempermissions.types.ItemPermissionsRequestDto;
+import org.openecomp.sdcrests.wrappers.GenericCollectionWrapper;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Service;
+
+import javax.inject.Named;
+import javax.ws.rs.core.Response;
+
+/**
+ * Created by ayalaben on 6/18/2017.
+ */
+
+@Named
+@Service("itemPermissions")
+@Scope(value = "prototype")
+public class ItemPermissionsImpl implements ItemPermissions {
+
+  private ItemPermissionsManager itemPermissionsManager =
+      ItemPermissionsManagerFactory.getInstance().createInterface();
+
+  @Override
+  public Response list(String itemId, String user) {
+
+    GenericCollectionWrapper<ItemPermissionsDto> results = new GenericCollectionWrapper<>();
+    MapItemPermissionsToItemPermissionsDto mapper = new MapItemPermissionsToItemPermissionsDto();
+
+    itemPermissionsManager.listItemPermissions(itemId)
+        .forEach(itemPermission -> results.add(mapper.applyMapping
+            (itemPermission, ItemPermissionsDto.class)));
+
+    return Response.ok(results).build();
+  }
+
+  @Override
+  public Response updatePermissions(ItemPermissionsRequestDto request, String itemId,
+                                    String permission, String user) {
+
+    itemPermissionsManager.updateItemPermissions(itemId,permission,request.getAddedUsersIds(),
+        request.getRemovedUsersIds());
+
+    return Response.ok().build();
+  }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/item-permissions-rest/item-permissions-rest-types/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/item-permissions-rest/item-permissions-rest-types/pom.xml
new file mode 100644
index 0000000..49f1f2b
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/item-permissions-rest/item-permissions-rest-types/pom.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <dependencies>
+        <dependency>
+            <groupId>io.swagger</groupId>
+            <artifactId>swagger-annotations</artifactId>
+            <version>1.5.3</version>
+        </dependency>
+
+    </dependencies>
+
+    <parent>
+        <groupId>org.openecomp.sdc</groupId>
+        <artifactId>item-permissions-rest</artifactId>
+        <version>1.2.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>item-permissions-rest-types</artifactId>
+
+
+</project>
\ No newline at end of file
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/item-permissions-rest/item-permissions-rest-types/src/main/java/org/openecomp/sdcrests/itempermissions/types/ItemPermissionsDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/item-permissions-rest/item-permissions-rest-types/src/main/java/org/openecomp/sdcrests/itempermissions/types/ItemPermissionsDto.java
new file mode 100644
index 0000000..d7f0b9f
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/item-permissions-rest/item-permissions-rest-types/src/main/java/org/openecomp/sdcrests/itempermissions/types/ItemPermissionsDto.java
@@ -0,0 +1,27 @@
+package org.openecomp.sdcrests.itempermissions.types;
+
+/**
+ * Created by ayalaben on 6/18/2017.
+ */
+public class ItemPermissionsDto {
+
+  private String userId;
+  private String permission;
+
+  public String getUserId() {
+    return userId;
+  }
+
+  public void setUserId(String id) {
+    this.userId = id;
+  }
+
+  public String getPermission() {
+    return permission;
+  }
+
+  public void setPermission(String permission) {
+    this.permission = permission;
+  }
+
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/item-permissions-rest/item-permissions-rest-types/src/main/java/org/openecomp/sdcrests/itempermissions/types/ItemPermissionsRequestDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/item-permissions-rest/item-permissions-rest-types/src/main/java/org/openecomp/sdcrests/itempermissions/types/ItemPermissionsRequestDto.java
new file mode 100644
index 0000000..82a960c
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/item-permissions-rest/item-permissions-rest-types/src/main/java/org/openecomp/sdcrests/itempermissions/types/ItemPermissionsRequestDto.java
@@ -0,0 +1,32 @@
+package org.openecomp.sdcrests.itempermissions.types;
+
+import io.swagger.annotations.ApiModel;
+
+import java.util.Set;
+
+/**
+ * Created by ayalaben on 6/20/2017.
+ */
+
+@ApiModel(value = "ItemPermissionsRequest")
+public class ItemPermissionsRequestDto {
+
+  private Set<String> addedUsersIds;
+  private Set<String> removedUsersIds;
+
+  public Set<String> getAddedUsersIds() {
+    return addedUsersIds;
+  }
+
+  public void setAddedUsersIds(Set<String> addedUsersIds) {
+    this.addedUsersIds = addedUsersIds;
+  }
+
+  public Set<String> getRemovedUsersIds() {
+    return removedUsersIds;
+  }
+
+  public void setRemovedUsersIds(Set<String> removedUsersIds) {
+    this.removedUsersIds = removedUsersIds;
+  }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/activity-log-rest/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/item-permissions-rest/pom.xml
similarity index 78%
rename from openecomp-be/api/openecomp-sdc-rest-webapp/activity-log-rest/pom.xml
rename to openecomp-be/api/openecomp-sdc-rest-webapp/item-permissions-rest/pom.xml
index 0b3c83c..f89fb07 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/activity-log-rest/pom.xml
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/item-permissions-rest/pom.xml
@@ -4,19 +4,21 @@
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
-    <groupId>org.openecomp.sdc</groupId>
-    <artifactId>activity-log-rest</artifactId>
-    <packaging>pom</packaging>
-
     <parent>
         <groupId>org.openecomp.sdc</groupId>
         <artifactId>openecomp-sdc-rest-webapp</artifactId>
         <version>1.2.0-SNAPSHOT</version>
     </parent>
 
+    <groupId>org.openecomp.sdc</groupId>
+    <artifactId>item-permissions-rest</artifactId>
+
+    <packaging>pom</packaging>
+
+
     <modules>
-        <module>activity-log-rest-services</module>
-        <module>activity-log-rest-types</module>
+        <module>item-permissions-rest-types</module>
+        <module>item-permissions-rest-services</module>
     </modules>
-    
-</project>
+
+</project>
\ No newline at end of file
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/activity-log-rest/activity-log-rest-services/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-services/pom.xml
similarity index 77%
rename from openecomp-be/api/openecomp-sdc-rest-webapp/activity-log-rest/activity-log-rest-services/pom.xml
rename to openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-services/pom.xml
index 10685db..6b96a4d 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/activity-log-rest/activity-log-rest-services/pom.xml
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-services/pom.xml
@@ -4,40 +4,23 @@
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
-    <artifactId>activity-log-rest-services</artifactId>
-
     <parent>
         <groupId>org.openecomp.sdc</groupId>
-        <artifactId>activity-log-rest</artifactId>
+        <artifactId>item-rest</artifactId>
         <version>1.2.0-SNAPSHOT</version>
     </parent>
 
+    <artifactId>item-rest-services</artifactId>
+
     <dependencies>
-
-
-        <dependency>
-            <groupId>javax.ws.rs</groupId>
-            <artifactId>javax.ws.rs-api</artifactId>
-            <version>${ws.rs.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.springframework</groupId>
-            <artifactId>spring-context</artifactId>
-            <version>${spring.framework.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>javax.inject</groupId>
-            <artifactId>javax.inject</artifactId>
-            <version>1</version>
-        </dependency>
         <dependency>
             <groupId>org.openecomp.sdc</groupId>
-            <artifactId>openecomp-sdc-activity-log-manager</artifactId>
+            <artifactId>openecomp-sdc-item-permissions-manager</artifactId>
             <version>${project.version}</version>
         </dependency>
         <dependency>
-             <groupId>org.openecomp.sdc</groupId>
-            <artifactId>activity-log-rest-types</artifactId>
+            <groupId>org.openecomp.sdc</groupId>
+            <artifactId>item-rest-types</artifactId>
             <version>${project.version}</version>
         </dependency>
         <dependency>
@@ -45,14 +28,28 @@
             <artifactId>openecomp-sdc-common-rest</artifactId>
             <version>${project.version}</version>
         </dependency>
+        <dependency>
+            <groupId>javax.inject</groupId>
+            <artifactId>javax.inject</artifactId>
+            <version>1</version>
+        </dependency>
         <!-- CXF -->
         <dependency>
             <groupId>org.apache.cxf</groupId>
             <artifactId>cxf-rt-frontend-jaxrs</artifactId>
             <version>${cxf.version}</version>
         </dependency>
-
+        <dependency>
+            <groupId>org.openecomp.sdc</groupId>
+            <artifactId>openecomp-sdc-conflict-manager</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-context</artifactId>
+            <version>${spring.framework.version}</version>
+        </dependency>
     </dependencies>
 
 
-</project>
+</project>
\ No newline at end of file
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-services/src/main/java/org/openecomp/sdcrests/item/rest/Versions.java b/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-services/src/main/java/org/openecomp/sdcrests/item/rest/Versions.java
new file mode 100644
index 0000000..7d7b085
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-services/src/main/java/org/openecomp/sdcrests/item/rest/Versions.java
@@ -0,0 +1,88 @@
+package org.openecomp.sdcrests.item.rest;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.openecomp.sdcrests.item.types.ActivityLogDto;
+import org.openecomp.sdcrests.item.types.RevisionDto;
+import org.openecomp.sdcrests.item.types.VersionActionRequestDto;
+import org.openecomp.sdcrests.item.types.VersionDto;
+import org.openecomp.sdcrests.item.types.VersionRequestDto;
+import org.springframework.validation.annotation.Validated;
+
+import javax.validation.constraints.NotNull;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
+import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
+
+@Path("/v1.0/items/{itemId}/versions")
+@Produces(MediaType.APPLICATION_JSON)
+@Consumes(MediaType.APPLICATION_JSON)
+@Api(value = "Item Versions")
+@Validated
+public interface Versions {
+
+  @GET
+  @Path("/")
+  @ApiOperation(value = "Lists item versions",
+      response = VersionDto.class,
+      responseContainer = "List")
+  Response list(@PathParam("itemId") String itemId,
+                @NotNull(message = USER_MISSING_ERROR_MSG)
+                @HeaderParam(USER_ID_HEADER_PARAM) String user);
+
+  @POST
+  @Path("/{versionId}")
+  @ApiOperation(value = "Creates a new item version")
+  Response create(VersionRequestDto request,
+                  @PathParam("itemId") String itemId,
+                  @PathParam("versionId") String versionId,
+                  @NotNull(message = USER_MISSING_ERROR_MSG)
+                  @HeaderParam(USER_ID_HEADER_PARAM) String user);
+
+  @GET
+  @Path("/{versionId}")
+  @ApiOperation(value = "Gets item version", response = VersionDto.class)
+  Response get(@PathParam("itemId") String itemId,
+               @PathParam("versionId") String versionId,
+               @NotNull(message = USER_MISSING_ERROR_MSG)
+               @HeaderParam(USER_ID_HEADER_PARAM) String user);
+
+  @GET
+  @Path("/{versionId}/activity-logs")
+  @ApiOperation(value = "Gets item version activity log",
+      response = ActivityLogDto.class,
+      responseContainer = "List")
+  Response getActivityLog(@ApiParam("Item Id") @PathParam("itemId") String itemId,
+                          @ApiParam("Version Id") @PathParam("versionId") String versionId,
+                          @NotNull(message = USER_MISSING_ERROR_MSG)
+                          @HeaderParam(USER_ID_HEADER_PARAM) String user);
+
+  @GET
+  @Path("/{versionId}/revisions")
+  @ApiOperation(value = "Gets item version revisions", response = RevisionDto.class,
+      responseContainer = "List")
+  Response listRevisions(@PathParam("itemId") String itemId,
+                         @PathParam("versionId") String versionId,
+                         @NotNull(message = USER_MISSING_ERROR_MSG)
+               @HeaderParam(USER_ID_HEADER_PARAM) String user);
+
+  @PUT
+  @Path("/{versionId}/actions")
+  @ApiOperation(value = "Acts on item version")
+  Response actOn(VersionActionRequestDto request,
+                 @PathParam("itemId") String itemId,
+                 @PathParam("versionId") String versionId,
+                 @NotNull(message = USER_MISSING_ERROR_MSG)
+                 @HeaderParam(USER_ID_HEADER_PARAM) String user);
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/activity-log-rest/activity-log-rest-services/src/main/java/org/openecomp/sdcrests/activitylog/rest/mapping/MapActivityLogEntityToActivityLogDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-services/src/main/java/org/openecomp/sdcrests/item/rest/mapping/MapActivityLogEntityToDto.java
similarity index 60%
rename from openecomp-be/api/openecomp-sdc-rest-webapp/activity-log-rest/activity-log-rest-services/src/main/java/org/openecomp/sdcrests/activitylog/rest/mapping/MapActivityLogEntityToActivityLogDto.java
rename to openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-services/src/main/java/org/openecomp/sdcrests/item/rest/mapping/MapActivityLogEntityToDto.java
index 023dedf..307b555 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/activity-log-rest/activity-log-rest-services/src/main/java/org/openecomp/sdcrests/activitylog/rest/mapping/MapActivityLogEntityToActivityLogDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-services/src/main/java/org/openecomp/sdcrests/item/rest/mapping/MapActivityLogEntityToDto.java
@@ -18,23 +18,24 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.sdcrests.activitylog.rest.mapping;
+package org.openecomp.sdcrests.item.rest.mapping;
 
 import org.openecomp.sdc.activitylog.dao.type.ActivityLogEntity;
-import org.openecomp.sdcrests.activitylog.types.ActivityLogDto;
-import org.openecomp.sdcrests.activitylog.types.ActivityStatus;
+import org.openecomp.sdcrests.item.types.ActivityLogDto;
+import org.openecomp.sdcrests.item.types.ActivityStatus;
 import org.openecomp.sdcrests.mapping.MappingBase;
 
-public class MapActivityLogEntityToActivityLogDto extends MappingBase<ActivityLogEntity, ActivityLogDto> {
+public class MapActivityLogEntityToDto
+    extends MappingBase<ActivityLogEntity, ActivityLogDto> {
 
 
-    @Override
-    public void doMapping(ActivityLogEntity source, ActivityLogDto target) {
-        target.setId(source.getId());
-        target.setTimestamp(source.getTimestamp());
-        target.setType(source.getType());
-        target.setComment(source.getComment());
-        target.setUser(source.getUser());
-        target.setStatus(new ActivityStatus(source.isSuccess(), source.getMessage()));
-    }
+  @Override
+  public void doMapping(ActivityLogEntity source, ActivityLogDto target) {
+    target.setId(source.getId());
+    target.setTimestamp(source.getTimestamp());
+    target.setType(source.getType().name());
+    target.setComment(source.getComment());
+    target.setUser(source.getUser());
+    target.setStatus(new ActivityStatus(source.isSuccess(), source.getMessage()));
+  }
 }
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-services/src/main/java/org/openecomp/sdcrests/item/rest/mapping/MapItemToDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-services/src/main/java/org/openecomp/sdcrests/item/rest/mapping/MapItemToDto.java
new file mode 100644
index 0000000..26bd58d
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-services/src/main/java/org/openecomp/sdcrests/item/rest/mapping/MapItemToDto.java
@@ -0,0 +1,15 @@
+package org.openecomp.sdcrests.item.rest.mapping;
+
+import org.openecomp.sdc.versioning.types.Item;
+import org.openecomp.sdcrests.item.types.ItemDto;
+import org.openecomp.sdcrests.mapping.MappingBase;
+
+public class MapItemToDto extends MappingBase<Item, ItemDto> {
+  @Override
+  public void doMapping(Item source, ItemDto target) {
+    target.setId(source.getId());
+    target.setType(source.getType());
+    target.setName(source.getName());
+    target.setDescription(source.getDescription());
+  }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-services/src/main/java/org/openecomp/sdcrests/item/rest/mapping/MapRevisionToDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-services/src/main/java/org/openecomp/sdcrests/item/rest/mapping/MapRevisionToDto.java
new file mode 100644
index 0000000..861f571
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-services/src/main/java/org/openecomp/sdcrests/item/rest/mapping/MapRevisionToDto.java
@@ -0,0 +1,15 @@
+package org.openecomp.sdcrests.item.rest.mapping;
+
+import org.openecomp.sdc.versioning.dao.types.Revision;
+import org.openecomp.sdcrests.item.types.RevisionDto;
+import org.openecomp.sdcrests.mapping.MappingBase;
+
+public class MapRevisionToDto extends MappingBase<Revision, RevisionDto> {
+  @Override
+  public void doMapping(Revision source, RevisionDto target) {
+    target.setId(source.getId());
+    target.setMessage(source.getMessage());
+    target.setUser(source.getUser());
+    target.setTime(source.getTime());
+  }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-services/src/main/java/org/openecomp/sdcrests/item/rest/mapping/MapVersionToDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-services/src/main/java/org/openecomp/sdcrests/item/rest/mapping/MapVersionToDto.java
new file mode 100644
index 0000000..5fbd9a9
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-services/src/main/java/org/openecomp/sdcrests/item/rest/mapping/MapVersionToDto.java
@@ -0,0 +1,20 @@
+package org.openecomp.sdcrests.item.rest.mapping;
+
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdcrests.item.types.VersionDto;
+import org.openecomp.sdcrests.mapping.MappingBase;
+
+public class MapVersionToDto extends MappingBase<Version, VersionDto> {
+  @Override
+  public void doMapping(Version source, VersionDto target) {
+    target.setId(source.getId());
+    target.setName(source.getName());
+    target.setDescription(source.getDescription());
+    target.setBaseId(source.getBaseId());
+    target.setStatus(source.getStatus());
+    target.setState(source.getState());
+    target.setCreationTime(source.getCreationTime());
+    target.setModificationTime(source.getModificationTime());
+    target.setAdditionalInfo(source.getAdditionalInfo());
+  }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-services/src/main/java/org/openecomp/sdcrests/item/rest/services/VersionsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-services/src/main/java/org/openecomp/sdcrests/item/rest/services/VersionsImpl.java
new file mode 100644
index 0000000..4667342
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-services/src/main/java/org/openecomp/sdcrests/item/rest/services/VersionsImpl.java
@@ -0,0 +1,270 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * 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=========================================================
+ */
+
+package org.openecomp.sdcrests.item.rest.services;
+
+import org.openecomp.sdc.activitylog.ActivityLogManager;
+import org.openecomp.sdc.activitylog.ActivityLogManagerFactory;
+import org.openecomp.sdc.activitylog.dao.type.ActivityLogEntity;
+import org.openecomp.sdc.activitylog.dao.type.ActivityType;
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.common.errors.Messages;
+import org.openecomp.sdc.conflicts.ConflictsManager;
+import org.openecomp.sdc.conflicts.ConflictsManagerFactory;
+import org.openecomp.sdc.itempermissions.ItemPermissionsManager;
+import org.openecomp.sdc.itempermissions.ItemPermissionsManagerFactory;
+import org.openecomp.sdc.logging.api.Logger;
+import org.openecomp.sdc.logging.api.LoggerFactory;
+import org.openecomp.sdc.logging.context.MdcUtil;
+import org.openecomp.sdc.logging.types.LoggerServiceName;
+import org.openecomp.sdc.notification.dtos.Event;
+import org.openecomp.sdc.notification.factories.NotificationPropagationManagerFactory;
+import org.openecomp.sdc.notification.services.NotificationPropagationManager;
+import org.openecomp.sdc.versioning.ItemManager;
+import org.openecomp.sdc.versioning.ItemManagerFactory;
+import org.openecomp.sdc.versioning.VersioningManager;
+import org.openecomp.sdc.versioning.VersioningManagerFactory;
+import org.openecomp.sdc.versioning.dao.types.SynchronizationState;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.versioning.errors.RevisionIdNotFoundErrorBuilder;
+import org.openecomp.sdc.versioning.types.NotificationEventTypes;
+import org.openecomp.sdcrests.item.rest.Versions;
+import org.openecomp.sdcrests.item.rest.mapping.MapActivityLogEntityToDto;
+import org.openecomp.sdcrests.item.rest.mapping.MapRevisionToDto;
+import org.openecomp.sdcrests.item.rest.mapping.MapVersionToDto;
+import org.openecomp.sdcrests.item.types.ActivityLogDto;
+import org.openecomp.sdcrests.item.types.CommitRequestDto;
+import org.openecomp.sdcrests.item.types.RevisionDto;
+import org.openecomp.sdcrests.item.types.RevisionRequestDto;
+import org.openecomp.sdcrests.item.types.VersionActionRequestDto;
+import org.openecomp.sdcrests.item.types.VersionDto;
+import org.openecomp.sdcrests.item.types.VersionRequestDto;
+import org.openecomp.sdcrests.wrappers.GenericCollectionWrapper;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Service;
+
+import javax.inject.Named;
+import javax.ws.rs.core.Response;
+import java.util.HashMap;
+import java.util.Map;
+
+import static org.openecomp.sdc.itempermissions.notifications.NotificationConstants.PERMISSION_USER;
+import static org.openecomp.sdc.versioning.VersioningNotificationConstansts.ITEM_ID;
+import static org.openecomp.sdc.versioning.VersioningNotificationConstansts.ITEM_NAME;
+import static org.openecomp.sdc.versioning.VersioningNotificationConstansts.SUBMIT_DESCRIPTION;
+import static org.openecomp.sdc.versioning.VersioningNotificationConstansts.VERSION_ID;
+import static org.openecomp.sdc.versioning.VersioningNotificationConstansts.VERSION_NAME;
+
+@Named
+@Service("versions")
+@Scope(value = "prototype")
+public class VersionsImpl implements Versions {
+
+  private static final String COMMIT_ITEM_ACTION = "Commit_Item";
+  private static final Logger LOGGER = LoggerFactory.getLogger(VersionsImpl.class);
+
+  private ItemPermissionsManager permissionsManager =
+      ItemPermissionsManagerFactory.getInstance().createInterface();
+  private ItemManager itemManager =
+      ItemManagerFactory.getInstance().createInterface();
+  private VersioningManager versioningManager =
+      VersioningManagerFactory.getInstance().createInterface();
+  private ConflictsManager conflictsManager =
+      ConflictsManagerFactory.getInstance().createInterface();
+  private ActivityLogManager activityLogManager =
+      ActivityLogManagerFactory.getInstance().createInterface();
+  private NotificationPropagationManager notifier =
+      NotificationPropagationManagerFactory.getInstance().createInterface();
+
+  @Override
+  public Response list(String itemId, String user) {
+    GenericCollectionWrapper<VersionDto> results = new GenericCollectionWrapper<>();
+    MapVersionToDto mapper = new MapVersionToDto();
+
+    versioningManager.list(itemId)
+        .forEach(version -> results.add(mapper.applyMapping(version, VersionDto.class)));
+    return Response.ok(results).build();
+  }
+
+  @Override
+  public Response create(VersionRequestDto request, String itemId, String baseVersionId,
+                         String user) {
+    Version version = new Version();
+    version.setBaseId(baseVersionId);
+    version.setDescription(request.getDescription());
+
+    version = versioningManager.create(itemId, version, request.getCreationMethod());
+
+    VersionDto versionDto = new MapVersionToDto().applyMapping(version, VersionDto.class);
+
+    activityLogManager.logActivity(new ActivityLogEntity(itemId, version,
+        ActivityType.Create_Version, user, true, "", ""));
+
+    return Response.ok(versionDto).build();
+  }
+
+  @Override
+  public Response get(String itemId, String versionId, String user) {
+    Version version = getVersion(itemId, new Version(versionId));
+    VersionDto versionDto = new MapVersionToDto().applyMapping(version, VersionDto.class);
+    return Response.ok(versionDto).build();
+  }
+
+  @Override
+  public Response getActivityLog(String itemId, String versionId, String user) {
+    MdcUtil.initMdc(LoggerServiceName.Get_List_Activity_Log.toString());
+
+    GenericCollectionWrapper<ActivityLogDto> results = new GenericCollectionWrapper<>();
+    MapActivityLogEntityToDto mapper = new MapActivityLogEntityToDto();
+
+    activityLogManager.listLoggedActivities(itemId, new Version(versionId))
+        .forEach(loggedActivity -> results
+            .add(mapper.applyMapping(loggedActivity, ActivityLogDto.class)));
+
+    return Response.ok(results).build();
+  }
+
+  @Override
+  public Response listRevisions(String itemId, String versionId, String user) {
+    GenericCollectionWrapper<RevisionDto> results = new GenericCollectionWrapper<>();
+    MapRevisionToDto mapper = new MapRevisionToDto();
+
+    versioningManager.listRevisions(itemId, new Version(versionId))
+        .forEach(revision -> results.add(mapper.applyMapping(revision, RevisionDto.class)));
+    return Response.ok(results).build();
+  }
+
+  @Override
+  public Response actOn(VersionActionRequestDto request, String itemId, String versionId,
+                        String user) {
+    Version version = new Version(versionId);
+    switch (request.getAction()) {
+      case Sync:
+        sync(itemId, version);
+        break;
+      case Commit:
+        if (!permissionsManager.isAllowed(itemId, user, COMMIT_ITEM_ACTION)) {
+          return Response.status(Response.Status.FORBIDDEN)
+              .entity(new Exception(Messages.PERMISSIONS_ERROR.getErrorMessage())).build();
+        }
+        commit(request.getCommitRequest(), itemId, version, user);
+        break;
+      case Revert:
+        revert(request.getRevisionRequest(), itemId, versionId);
+        break;
+      case Reset:
+        throw new UnsupportedOperationException("Action reset not supported.");
+      default:
+    }
+    return Response.ok().build();
+  }
+
+
+  private void revert(RevisionRequestDto request, String itemId, String versionId) {
+    if (request.getRevisionId() == null) {
+      throw new CoreException(new RevisionIdNotFoundErrorBuilder().build());
+    }
+
+    versioningManager.revert(itemId, new Version(versionId), request.getRevisionId());
+  }
+
+  private void sync(String itemId, Version version) {
+    versioningManager.sync(itemId, version);
+    conflictsManager.finalizeMerge(itemId, version);
+  }
+
+  private void commit(CommitRequestDto request, String itemId, Version version, String user) {
+
+    String message = request == null ? "" : request.getMessage();
+
+    versioningManager.publish(itemId, version, message);
+    notifyUsers(itemId, version, message, user, NotificationEventTypes.COMMIT);
+
+    activityLogManager.logActivity(new ActivityLogEntity(itemId, version,
+        ActivityType.Commit, user, true, "", message));
+  }
+
+  private void notifyUsers(String itemId, Version version, String message,
+                           String userName, NotificationEventTypes eventType) {
+    Map<String, Object> eventProperties = new HashMap<>();
+    eventProperties.put(ITEM_NAME, itemManager.get(itemId).getName());
+    eventProperties.put(ITEM_ID, itemId);
+
+    Version ver = versioningManager.get(itemId, version);
+    eventProperties.put(VERSION_NAME, ver.getName());
+    eventProperties.put(VERSION_ID, ver.getId());
+
+    eventProperties.put(SUBMIT_DESCRIPTION, message);
+    eventProperties.put(PERMISSION_USER, userName);
+
+    Event syncEvent = new SyncEvent(eventType.getEventName(), itemId, eventProperties, itemId);
+    try {
+      notifier.notifySubscribers(syncEvent, userName);
+    } catch (Exception e) {
+      LOGGER.error("Failed to send sync notification to users subscribed o item '" + itemId);
+    }
+  }
+
+  private class SyncEvent implements Event {
+
+    private String eventType;
+    private String originatorId;
+    private Map<String, Object> attributes;
+    private String entityId;
+
+    public SyncEvent(String eventType, String originatorId,
+                     Map<String, Object> attributes, String entityId) {
+      this.eventType = eventType;
+      this.originatorId = originatorId;
+      this.attributes = attributes;
+      this.entityId = entityId;
+    }
+
+    @Override
+    public String getEventType() {
+      return eventType;
+    }
+
+    @Override
+    public String getOriginatorId() {
+      return originatorId;
+    }
+
+    @Override
+    public Map<String, Object> getAttributes() {
+      return attributes;
+    }
+
+    @Override
+    public String getEntityId() {
+      return entityId;
+    }
+  }
+
+  private Version getVersion(String itemId, Version version) {
+    version = versioningManager.get(itemId, version);
+
+    if (version.getState().getSynchronizationState() != SynchronizationState.Merging &&
+        conflictsManager.isConflicted(itemId, version)) { // looks for sdc applicative conflicts
+      version.getState().setSynchronizationState(SynchronizationState.Merging);
+    }
+    return version;
+  }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-types/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-types/pom.xml
new file mode 100644
index 0000000..6b97480
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-types/pom.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.openecomp.sdc</groupId>
+        <artifactId>item-rest</artifactId>
+        <version>1.2.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>item-rest-types</artifactId>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.openecomp.sdc</groupId>
+            <artifactId>openecomp-sdc-versioning-api</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.openecomp.sdc</groupId>
+            <artifactId>openecomp-sdc-activity-log-manager</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.openecomp.sdc</groupId>
+            <artifactId>openecomp-sdc-conflict-manager</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
+
+
+</project>
\ No newline at end of file
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-types/src/main/java/org/openecomp/sdcrests/item/types/ActivityLogDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-types/src/main/java/org/openecomp/sdcrests/item/types/ActivityLogDto.java
new file mode 100644
index 0000000..40fb918
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-types/src/main/java/org/openecomp/sdcrests/item/types/ActivityLogDto.java
@@ -0,0 +1,85 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * 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=========================================================
+ */
+
+package org.openecomp.sdcrests.item.types;
+
+
+import java.util.Date;
+
+public class ActivityLogDto {
+
+  private String id;
+  private Date timestamp;
+  private String type;
+  private String comment;
+  private String user;
+  private ActivityStatus status;
+
+  public ActivityLogDto() {
+  }
+
+  public String getId() {
+    return id;
+  }
+
+  public void setId(String id) {
+    this.id = id;
+  }
+
+  public Date getTimestamp() {
+    return timestamp;
+  }
+
+  public void setTimestamp(Date timestamp) {
+    this.timestamp = timestamp;
+  }
+
+  public String getType() {
+    return type;
+  }
+
+  public void setType(String type) {
+    this.type = type;
+  }
+
+  public String getComment() {
+    return comment;
+  }
+
+  public void setComment(String comment) {
+    this.comment = comment;
+  }
+
+  public String getUser() {
+    return user;
+  }
+
+  public void setUser(String user) {
+    this.user = user;
+  }
+
+  public ActivityStatus getStatus() {
+    return status;
+  }
+
+  public void setStatus(ActivityStatus status) {
+    this.status = status;
+  }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/activity-log-rest/activity-log-rest-types/src/main/java/org/openecomp/sdcrests/activitylog/types/ActivityStatus.java b/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-types/src/main/java/org/openecomp/sdcrests/item/types/ActivityStatus.java
similarity index 96%
rename from openecomp-be/api/openecomp-sdc-rest-webapp/activity-log-rest/activity-log-rest-types/src/main/java/org/openecomp/sdcrests/activitylog/types/ActivityStatus.java
rename to openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-types/src/main/java/org/openecomp/sdcrests/item/types/ActivityStatus.java
index 326b1b6..601a211 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/activity-log-rest/activity-log-rest-types/src/main/java/org/openecomp/sdcrests/activitylog/types/ActivityStatus.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-types/src/main/java/org/openecomp/sdcrests/item/types/ActivityStatus.java
@@ -17,7 +17,7 @@
  * limitations under the License.
  * ============LICENSE_END=========================================================
  */
-package org.openecomp.sdcrests.activitylog.types;
+package org.openecomp.sdcrests.item.types;
 
 public class ActivityStatus {
 
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-types/src/main/java/org/openecomp/sdcrests/item/types/CommitRequestDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-types/src/main/java/org/openecomp/sdcrests/item/types/CommitRequestDto.java
new file mode 100644
index 0000000..a1d46cb
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-types/src/main/java/org/openecomp/sdcrests/item/types/CommitRequestDto.java
@@ -0,0 +1,13 @@
+package org.openecomp.sdcrests.item.types;
+
+public class CommitRequestDto {
+  private String message;
+
+  public String getMessage() {
+    return message;
+  }
+
+  public void setMessage(String message) {
+    this.message = message;
+  }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-types/src/main/java/org/openecomp/sdcrests/item/types/ItemCreationDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-types/src/main/java/org/openecomp/sdcrests/item/types/ItemCreationDto.java
new file mode 100644
index 0000000..afba96f
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-types/src/main/java/org/openecomp/sdcrests/item/types/ItemCreationDto.java
@@ -0,0 +1,22 @@
+package org.openecomp.sdcrests.item.types;
+
+public class ItemCreationDto {
+  private String itemId;
+  private VersionDto version;
+
+  public String getItemId() {
+    return itemId;
+  }
+
+  public void setItemId(String itemId) {
+    this.itemId = itemId;
+  }
+
+  public VersionDto getVersion() {
+    return version;
+  }
+
+  public void setVersion(VersionDto version) {
+    this.version = version;
+  }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-types/src/main/java/org/openecomp/sdcrests/item/types/ItemDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-types/src/main/java/org/openecomp/sdcrests/item/types/ItemDto.java
new file mode 100644
index 0000000..1eebf197
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-types/src/main/java/org/openecomp/sdcrests/item/types/ItemDto.java
@@ -0,0 +1,40 @@
+package org.openecomp.sdcrests.item.types;
+
+public class ItemDto {
+  private String id;
+  private String type;
+  private String name;
+  private String description;
+
+  public String getId() {
+    return id;
+  }
+
+  public void setId(String id) {
+    this.id = id;
+  }
+
+  public String getType() {
+    return type;
+  }
+
+  public void setType(String type) {
+    this.type = type;
+  }
+
+  public String getName() {
+    return name;
+  }
+
+  public void setName(String name) {
+    this.name = name;
+  }
+
+  public String getDescription() {
+    return description;
+  }
+
+  public void setDescription(String description) {
+    this.description = description;
+  }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-types/src/main/java/org/openecomp/sdcrests/item/types/RevisionDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-types/src/main/java/org/openecomp/sdcrests/item/types/RevisionDto.java
new file mode 100644
index 0000000..241d285
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-types/src/main/java/org/openecomp/sdcrests/item/types/RevisionDto.java
@@ -0,0 +1,43 @@
+package org.openecomp.sdcrests.item.types;
+
+import java.util.Date;
+
+public class RevisionDto {
+  private String id;
+  private String message;
+  private Date time;
+  private String user;
+
+  public String getId() {
+    return id;
+  }
+
+  public void setId(String id) {
+    this.id = id;
+  }
+
+  public void setMessage(String message) {
+    this.message = message;
+  }
+
+  public void setTime(Date time) {
+    this.time = time;
+  }
+
+  public String getMessage() {
+    return message;
+  }
+
+  public Date getTime() {
+    return time;
+  }
+
+  public String getUser() {
+    return user;
+  }
+
+  public void setUser(String user) {
+    this.user = user;
+  }
+
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-types/src/main/java/org/openecomp/sdcrests/item/types/RevisionRequestDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-types/src/main/java/org/openecomp/sdcrests/item/types/RevisionRequestDto.java
new file mode 100644
index 0000000..49ea9fc
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-types/src/main/java/org/openecomp/sdcrests/item/types/RevisionRequestDto.java
@@ -0,0 +1,14 @@
+package org.openecomp.sdcrests.item.types;
+
+public class RevisionRequestDto {
+
+  private String revisionId;
+
+  public String getRevisionId() {
+    return revisionId;
+  }
+
+  public void setRevisionId(String revisionId) {
+    this.revisionId = revisionId;
+  }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-types/src/main/java/org/openecomp/sdcrests/item/types/SubmitRequestDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-types/src/main/java/org/openecomp/sdcrests/item/types/SubmitRequestDto.java
new file mode 100644
index 0000000..2591560
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-types/src/main/java/org/openecomp/sdcrests/item/types/SubmitRequestDto.java
@@ -0,0 +1,13 @@
+package org.openecomp.sdcrests.item.types;
+
+public class SubmitRequestDto {
+  private String message;
+
+  public String getMessage() {
+    return message;
+  }
+
+  public void setMessage(String message) {
+    this.message = message;
+  }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspCreationDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-types/src/main/java/org/openecomp/sdcrests/item/types/VersionAction.java
similarity index 76%
copy from openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspCreationDto.java
copy to openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-types/src/main/java/org/openecomp/sdcrests/item/types/VersionAction.java
index f77005f..c9d6f4e 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspCreationDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-types/src/main/java/org/openecomp/sdcrests/item/types/VersionAction.java
@@ -7,9 +7,9 @@
  * 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.
@@ -18,19 +18,11 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.sdcrests.vendorsoftwareproducts.types;
+package org.openecomp.sdcrests.item.types;
 
-/**
- * Created by TALIO on 4/26/2016.
- */
-public class VspCreationDto {
-  private String vspId;
-
-  public String getVspId() {
-    return vspId;
-  }
-
-  public void setVspId(String vspId) {
-    this.vspId = vspId;
-  }
+public enum VersionAction {
+  Sync,
+  Commit,
+  Revert,
+  Reset
 }
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-types/src/main/java/org/openecomp/sdcrests/item/types/VersionActionRequestDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-types/src/main/java/org/openecomp/sdcrests/item/types/VersionActionRequestDto.java
new file mode 100644
index 0000000..98a5bb9
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-types/src/main/java/org/openecomp/sdcrests/item/types/VersionActionRequestDto.java
@@ -0,0 +1,52 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * 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=========================================================
+ */
+
+package org.openecomp.sdcrests.item.types;
+
+public class VersionActionRequestDto {
+  private VersionAction action;
+  private CommitRequestDto commitRequest;
+
+  private RevisionRequestDto revisionRequest;
+
+  public VersionAction getAction() {
+    return action;
+  }
+
+  public void setAction(VersionAction action) {
+    this.action = action;
+  }
+
+  public CommitRequestDto getCommitRequest() {
+    return commitRequest;
+  }
+
+  public void setCommitRequest(CommitRequestDto commitRequest) {
+    this.commitRequest = commitRequest;
+  }
+
+  public RevisionRequestDto getRevisionRequest() {
+    return revisionRequest;
+  }
+
+  public void setRevisionRequest(RevisionRequestDto revisionRequest) {
+    this.revisionRequest = revisionRequest;
+  }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-types/src/main/java/org/openecomp/sdcrests/item/types/VersionDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-types/src/main/java/org/openecomp/sdcrests/item/types/VersionDto.java
new file mode 100644
index 0000000..a0c1942
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-types/src/main/java/org/openecomp/sdcrests/item/types/VersionDto.java
@@ -0,0 +1,94 @@
+package org.openecomp.sdcrests.item.types;
+
+import org.openecomp.sdc.versioning.dao.types.VersionState;
+import org.openecomp.sdc.versioning.dao.types.VersionStatus;
+
+import java.util.Date;
+import java.util.Map;
+
+public class VersionDto {
+  private String id;
+  private String name;
+  private String description;
+  private String baseId;
+  private VersionStatus status;
+  private VersionState state;
+  private Date creationTime;
+  private Date modificationTime;
+  private Map<String,Object> additionalInfo;
+  public VersionDto() {
+
+  }
+
+  public String getId() {
+    return id;
+  }
+
+  public void setId(String id) {
+    this.id = id;
+  }
+
+  public String getName() {
+    return name;
+  }
+
+  public void setName(String name) {
+    this.name = name;
+  }
+
+  public String getDescription() {
+    return description;
+  }
+
+  public void setDescription(String description) {
+    this.description = description;
+  }
+
+  public String getBaseId() {
+    return baseId;
+  }
+
+  public void setBaseId(String baseId) {
+    this.baseId = baseId;
+  }
+
+  public VersionStatus getStatus() {
+    return status;
+  }
+
+  public void setStatus(VersionStatus status) {
+    this.status = status;
+  }
+
+  public VersionState getState() {
+    return state;
+  }
+
+  public void setState(VersionState state) {
+    this.state = state;
+  }
+
+  public Date getCreationTime() {
+    return creationTime;
+  }
+
+  public void setCreationTime(Date creationTime) {
+    this.creationTime = creationTime;
+  }
+
+  public Date getModificationTime() {
+    return modificationTime;
+  }
+
+  public void setModificationTime(Date modificationTime) {
+    this.modificationTime = modificationTime;
+  }
+
+  public Map<String, Object> getAdditionalInfo() {
+    return additionalInfo;
+  }
+
+  public void setAdditionalInfo(Map<String, Object> additionalInfo) {
+    this.additionalInfo = additionalInfo;
+  }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-types/src/main/java/org/openecomp/sdcrests/item/types/VersionRequestDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-types/src/main/java/org/openecomp/sdcrests/item/types/VersionRequestDto.java
new file mode 100644
index 0000000..629bc2d
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/item-rest-types/src/main/java/org/openecomp/sdcrests/item/types/VersionRequestDto.java
@@ -0,0 +1,24 @@
+package org.openecomp.sdcrests.item.types;
+
+import org.openecomp.sdc.versioning.types.VersionCreationMethod;
+
+public class VersionRequestDto {
+  private String description;
+  private VersionCreationMethod creationMethod;
+
+  public String getDescription() {
+    return description;
+  }
+
+  public void setDescription(String description) {
+    this.description = description;
+  }
+
+  public VersionCreationMethod getCreationMethod() {
+    return creationMethod;
+  }
+
+  public void setCreationMethod(VersionCreationMethod creationMethod) {
+    this.creationMethod = creationMethod;
+  }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/activity-log-rest/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/pom.xml
similarity index 73%
copy from openecomp-be/api/openecomp-sdc-rest-webapp/activity-log-rest/pom.xml
copy to openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/pom.xml
index 0b3c83c..6623de8 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/activity-log-rest/pom.xml
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/item-rest/pom.xml
@@ -4,19 +4,19 @@
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
-    <groupId>org.openecomp.sdc</groupId>
-    <artifactId>activity-log-rest</artifactId>
-    <packaging>pom</packaging>
-
     <parent>
         <groupId>org.openecomp.sdc</groupId>
         <artifactId>openecomp-sdc-rest-webapp</artifactId>
         <version>1.2.0-SNAPSHOT</version>
     </parent>
 
+    <artifactId>item-rest</artifactId>
+    <packaging>pom</packaging>
+
+
     <modules>
-        <module>activity-log-rest-services</module>
-        <module>activity-log-rest-types</module>
+        <module>item-rest-services</module>
+        <module>item-rest-types</module>
     </modules>
-    
-</project>
+
+</project>
\ No newline at end of file
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/notifications-fe/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/notifications-fe/pom.xml
new file mode 100644
index 0000000..319b028
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/notifications-fe/pom.xml
@@ -0,0 +1,161 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>org.openecomp.sdc.onboarding</groupId>
+    <artifactId>notifications-fe</artifactId>
+    <name>notification-war</name>
+    <packaging>war</packaging>
+
+    <parent>
+        <groupId>org.openecomp.sdc</groupId>
+        <artifactId>openecomp-sdc</artifactId>
+        <relativePath>../../..</relativePath>
+        <version>1.2.0-SNAPSHOT</version>
+    </parent>
+
+    <properties>
+        <spring.version>4.3.4.RELEASE</spring.version>
+        <jetty.version>9.3.6.v20151106</jetty.version>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.openecomp.sdc</groupId>
+            <artifactId>openecomp-sdc-notification-websocket</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>javax.servlet</groupId>
+            <artifactId>servlet-api</artifactId>
+            <version>${javax.servlet.version}</version>
+        </dependency>
+        <!-- JSON -->
+        <dependency>
+            <groupId>org.codehaus.jackson</groupId>
+            <artifactId>jackson-jaxrs</artifactId>
+            <version>${org.codehaus.jackson.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.codehaus.jackson</groupId>
+            <artifactId>jackson-core-asl</artifactId>
+            <version>${org.codehaus.jackson.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>javax.inject</groupId>
+            <artifactId>javax.inject</artifactId>
+            <version>1</version>
+        </dependency>
+        <dependency>
+            <groupId>org.eclipse.jetty</groupId>
+            <artifactId>jetty-servlets</artifactId>
+            <version>${jetty.version}</version>
+        </dependency>
+        <!-- START required for websocket -->
+        <dependency>
+            <groupId>org.eclipse.jetty</groupId>
+            <artifactId>jetty-util</artifactId>
+            <version>${jetty.version}</version>
+        </dependency>
+        <!-- END required for websocket -->
+        <dependency>
+            <groupId>javax.validation</groupId>
+            <artifactId>validation-api</artifactId>
+            <version>1.0.0.GA</version>
+        </dependency>
+        <dependency>
+            <groupId>org.hibernate</groupId>
+            <artifactId>hibernate-validator</artifactId>
+            <version>4.3.1.Final</version>
+        </dependency>
+        <dependency>
+            <groupId>javax.ws.rs</groupId>
+            <artifactId>javax.ws.rs-api</artifactId>
+            <version>2.0.1</version>
+        </dependency>
+        <dependency>
+            <groupId>org.codehaus.groovy</groupId>
+            <artifactId>groovy</artifactId>
+            <version>${groovy.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-classic</artifactId>
+            <version>${logback.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-core</artifactId>
+            <version>${logback.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.codehaus.janino</groupId>
+            <artifactId>janino</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-context</artifactId>
+            <version>${spring.framework.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-core</artifactId>
+            <version>${spring.framework.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-web</artifactId>
+            <version>${spring.framework.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-aop</artifactId>
+            <version>${spring.framework.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-webmvc</artifactId>
+            <version>${spring.framework.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.aspectj</groupId>
+            <artifactId>aspectjweaver</artifactId>
+            <version>1.8.9</version>
+        </dependency>
+        <dependency>
+            <groupId>org.aspectj</groupId>
+            <artifactId>aspectjrt</artifactId>
+            <version>1.8.9</version>
+        </dependency>
+        <dependency>
+            <groupId>org.aspectj</groupId>
+            <artifactId>aspectjtools</artifactId>
+            <version>1.8.9</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpclient</artifactId>
+            <version>4.3.6</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-transports-http</artifactId>
+            <version>2.2.2</version>
+        </dependency>
+    </dependencies>
+
+    <!-- Should be removed once TogglZ usage in pom files is fixed -->
+    <build>
+        <plugins>
+            <plugin>
+                <artifactId>maven-war-plugin</artifactId>
+                <version>3.0.0</version>
+                <configuration>
+                    <packagingExcludes>WEB-INF/lib/togglz*.jar</packagingExcludes>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/notifications-fe/src/main/java/org/openecomp/server/listeners/OnboardingAppStartupListener.java b/openecomp-be/api/openecomp-sdc-rest-webapp/notifications-fe/src/main/java/org/openecomp/server/listeners/OnboardingAppStartupListener.java
new file mode 100644
index 0000000..96300b5
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/notifications-fe/src/main/java/org/openecomp/server/listeners/OnboardingAppStartupListener.java
@@ -0,0 +1,43 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * 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=========================================================
+ */
+
+package org.openecomp.server.listeners;
+
+
+import org.springframework.web.context.ContextLoaderListener;
+
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+
+public class OnboardingAppStartupListener implements ServletContextListener {
+
+  ContextLoaderListener springListener;
+
+  @Override
+  public void contextInitialized(ServletContextEvent servletContextEvent) {
+    springListener = new ContextLoaderListener();
+    springListener.initWebApplicationContext(servletContextEvent.getServletContext());
+  }
+
+  @Override
+  public void contextDestroyed(ServletContextEvent servletContextEvent) {
+    springListener.closeWebApplicationContext(servletContextEvent.getServletContext());
+  }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/notifications-fe/src/main/resources/keyfile.txt b/openecomp-be/api/openecomp-sdc-rest-webapp/notifications-fe/src/main/resources/keyfile.txt
new file mode 100644
index 0000000..d6c2c25
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/notifications-fe/src/main/resources/keyfile.txt
@@ -0,0 +1,27 @@
+hfLSGGYWU2SyTlltV0HVwU6o3GtrtccAU8aFwq65OHsl6JeEAirXaNl73xz2uTrfiFqVJD7GTxXr
+_qlY4BnLFZ7q3KNRZ0VQssjF_REjB8p7YMkEiTzbJL0pSaI6s0GRotuM432Jbsoksh8WZeui7svx
+I_KD124t73d1EpIAQwHldZXRZEoDrLjfJUSCAcmsXSu5OlIMZDKOy7vR0aXPw6Dpn9sZBcpFHFQL
+Xkp63yTf81snlVBGXApwS852_u4nEYmQrGQo9u6iLRg4dodOUD7wG7jbNB_KtmIspxL87i75hJ_0
+PXkLN8H2K14Rvk9ILYjdASpPOyVMK8avylRRyRy5HFBUJfeWk4YJEPus79Ol-j3QefWxX2hEOe_Y
+AcA5xYgwsYylSARWcQ7aZ8M781-CNaM1yDkFCBRNLQoOo3k_yyspfHC0fOwIOPZdh9YiXIop3MAM
+FC0SdPTUQrQxlF3IOC7tfEp7Wu2XezkcbIBe8mDy7dcYa87KqrL0zRju80R_gl-UCkxMLZpEKhnB
+zWxjDNOGCC4VaLMrW6uREFlanw2yg3XAXZD2vl60r1WNUrRUJcYRs9FwNkdVhKH7o_D7GLXCxlEF
+ltapyC4i1xgeXiEH35WrqlmS1PexaWkRloFmpLXY56D3iqg9RYrZnqQAift20LLQ_ZMFS_fOlb8w
+pu-VqjifrOthE9B375Nq-_YdMCLRAdAXf5wiMC1AlimLE6gmE6cl0SopHpmtmLX--4jy8IUSOceG
+xhTKpfO_7Gnn-V5m-ourtkj_UivEiM3eIyzilamlEtac50e-mg1sEHjPvAQd7p_oqaGd4NveSUeG
+_WsLUZJgKI6Nu0545J1tDmlgZ4atd1b4Mkutl1CbijYg9c6Nu_zxMs9RwN9_-C3JJJxQpBUieXFY
+f38PD62P8Ihb8VmNmBhOT8abRmH7Zx1adz6fcjFtaO0wSsfWr8M04W_GrbrGO_yr7GeJwqdYEP8r
+rUoQWkNRuapL09KUHhHTdc8hQoCNUx4p2H2_ADA8j6gp62z54LUQDaTOHJI3Vs6mdfP7oDr2H_VK
+LLWR7fHcDzS89opwtp7NO56jpmmq4q-U9kxpY1lMYJhKBuVMCm038l_eMGL35jD6OcgOCC2GL9U9
+wfyjwumJMNIND8I3viuyouMy_B5q00v27M2im6Q814Mg5Cw-RCiKy4kjhutkqTw8hXh7RLkm-QeJ
+KlsrH98snwWLaw9LBeGoMbqzHzWl93inEsTyLutMPA8xSIj5kySLIcJCXq9-RMp8cnOYy8TY9Jix
+oaB2u4ofHDDrrMzKY88ZPdMiGQX2BNdsOG6o4ifSVyyYwIWBtQvtO7SDvGhRUGEV1JHloBdIos0M
+87SMERYd_UPKK_yl2RaqloQZRlDSgUR7i0hoqrhtPe5Ef4cJFX_CSt_oQnEu0JatwAuwybkLLPbO
+mArd3rtrOh-uR_0Y77zb7Uw4H5_oX_ANIecH0sgRcvQESaq-ioYrvS94VqvxU8ByuxqxJLMo90Rc
+oOAk3pq0b-16x_WRxWTfbnnNLDSQ_DwS-Xeav1nPwm-ELy1AVEQdpgbjONThjkZp3AuljaH_1Fs4
+u0A8HeCgIa4g7jsvIRxw6zLKspYENdvoHvQLWGRpaA-vfT3i3lR0MEu53v8M9hI8U8MqJo_J0xe6
+z2mtQWPiCLtW99vTqhKOm621_GNYmp10TEXVMkXumEk2rTgLBDaFEFwpgS5LqkEOObVChd9jx9oa
+DW4LjhzO1EE5twGvbTiRAJsO6j5UNTonGFLLttYKq9CMvDiBZ8-whFGOM8D2qAWYiwDCI-dLqwat
+jxQP1cYKGHMS2-VJ5QJa6EINEx2zo3VmnHYCE9gM71fC26018Y2T-sQfE1MRE9SU_Xma7Qbl5OBp
+IflyJCTyhZfgFlqU9f2cq12bjoNuMrgOlKwap6325LGZK1XsmsHuHmASRE4-E-qmQY7GI9oJLmbl
+425swlxRA-mr1eGZU0hK3ZFjz_4clBMLJBYMFYhdGzi4VYGPzaO0z0wNJzOQf3V5NbReFjxl
\ No newline at end of file
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/notifications-fe/src/main/webapp/WEB-INF/beans-services.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/notifications-fe/src/main/webapp/WEB-INF/beans-services.xml
new file mode 100644
index 0000000..c41bc03
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/notifications-fe/src/main/webapp/WEB-INF/beans-services.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:jaxrs="http://cxf.apache.org/jaxrs"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:websocket="http://www.springframework.org/schema/websocket"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+       http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd
+       http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
+        http://www.springframework.org/schema/websocket
+       http://www.springframework.org/schema/websocket/spring-websocket.xsd">
+
+
+    <!-- CXF -->
+    <context:component-scan base-package="org.openecomp.sdcrests"/>
+
+    <!-- Needed for JSR-303 validations. May be removed when moving to JAX-RS 2.0 -->
+    <bean class="org.springframework.validation.beanvalidation.MethodValidationPostProcessor"/>
+
+    <bean id="jacksonObjectMapper" class="org.codehaus.jackson.map.ObjectMapper">
+        <property name="serializationInclusion" value="NON_NULL"/>
+    </bean>
+
+    <bean id="jsonProvider" class="org.codehaus.jackson.jaxrs.JacksonJsonProvider">
+        <property name="mapper" ref="jacksonObjectMapper"/>
+    </bean>
+
+    <!-- WEB-SOCKETS -->
+    <websocket:handlers allowed-origins="*">
+        <websocket:mapping path="/notificationHandler" handler="notificationHandler"/>
+        <websocket:handshake-handler ref="handshakeHandler"/>
+    </websocket:handlers>
+
+    <bean id="newNotificationsReader" class="org.openecomp.sdc.notification.workers.impl.NewNotificationsReaderRestImpl"/>
+
+    <bean id="notificationWorker" class="org.openecomp.sdc.notification.workers.NotificationWorker">
+        <constructor-arg ref="newNotificationsReader"/>
+    </bean>
+
+    <bean id="notificationHandler" class="org.openecomp.sdc.notification.websocket.NotificationWebsocketHandler">
+        <constructor-arg ref="notificationWorker"/>
+    </bean>
+
+    <bean class="org.springframework.web.socket.server.standard.ServletServerContainerFactoryBean">
+        <property name="maxTextMessageBufferSize" value="8192"/>
+        <property name="maxBinaryMessageBufferSize" value="8192"/>
+    </bean>
+
+    <bean id="handshakeHandler" class="org.springframework.web.socket.server.support.DefaultHandshakeHandler">
+        <constructor-arg ref="upgradeStrategy"/>
+    </bean>
+
+    <bean id="upgradeStrategy" class="org.springframework.web.socket.server.jetty.JettyRequestUpgradeStrategy">
+        <constructor-arg ref="serverFactory"/>
+    </bean>
+
+    <bean id="serverFactory" class="org.eclipse.jetty.websocket.server.WebSocketServerFactory">
+        <constructor-arg>
+            <bean class="org.eclipse.jetty.websocket.api.WebSocketPolicy">
+                <constructor-arg value="SERVER"/>
+                <property name="inputBufferSize" value="8092"/>
+                <property name="idleTimeout" value="600000"/>
+            </bean>
+        </constructor-arg>
+    </bean>
+
+</beans>
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/notifications-fe/src/main/webapp/WEB-INF/jetty-web.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/notifications-fe/src/main/webapp/WEB-INF/jetty-web.xml
new file mode 100644
index 0000000..443b6a1
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/notifications-fe/src/main/webapp/WEB-INF/jetty-web.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0"  encoding="UTF-8"?>
+<!DOCTYPE Configure PUBLIC
+        "-//Mort Bay Consulting//DTD Configure//EN"
+        "http://www.eclipse.org/jetty/configure_9_0.dtd">
+
+<Configure class="org.eclipse.jetty.webapp.WebAppContext">
+    <Set name="contextPath">/notification-api</Set>
+</Configure>
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/notifications-fe/src/main/webapp/WEB-INF/spring-mapper-servlet.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/notifications-fe/src/main/webapp/WEB-INF/spring-mapper-servlet.xml
new file mode 100644
index 0000000..2851d56
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/notifications-fe/src/main/webapp/WEB-INF/spring-mapper-servlet.xml
@@ -0,0 +1,12 @@
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+    <bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
+        <property name="mappings">
+            <props>
+            </props>
+        </property>
+    </bean>
+
+</beans>
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/notifications-fe/src/main/webapp/WEB-INF/web.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/notifications-fe/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000..354fcbf
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/notifications-fe/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,81 @@
+<web-app
+        xmlns="http://java.sun.com/xml/ns/javaee"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
+        version="3.0">
+
+
+    <!-- Spring -->
+    <context-param>
+        <param-name>contextConfigLocation</param-name>
+        <param-value>WEB-INF/beans-services.xml</param-value>
+    </context-param>
+
+    <listener>
+        <listener-class>org.openecomp.server.listeners.OnboardingAppStartupListener</listener-class>
+    </listener>
+
+    <filter>
+        <filter-name>cross-origin</filter-name>
+        <filter-class>org.eclipse.jetty.servlets.CrossOriginFilter</filter-class>
+        <init-param>
+            <param-name>allowedOrigins</param-name>
+            <param-value>*</param-value>
+        </init-param>
+        <init-param>
+            <param-name>allowedMethods</param-name>
+            <param-value>*</param-value>
+        </init-param>
+        <init-param>
+            <param-name>allowedHeaders</param-name>
+            <param-value>*</param-value>
+        </init-param>
+    </filter>
+    <filter-mapping>
+        <filter-name>cross-origin</filter-name>
+        <url-pattern>/*</url-pattern>
+    </filter-mapping>
+    <!-- Spring WS Mapping -->
+    <servlet>
+        <servlet-name>spring-mapper</servlet-name>
+        <servlet-class>
+            org.springframework.web.servlet.DispatcherServlet
+        </servlet-class>
+        <load-on-startup>1</load-on-startup>
+    </servlet>
+    <!-- CXF -->
+    <servlet>
+        <servlet-name>CXFServlet</servlet-name>
+        <display-name>CXF Servlet</display-name>
+        <servlet-class>
+            org.apache.cxf.transport.servlet.CXFServlet
+        </servlet-class>
+        <init-param>
+            <param-name>redirects-list</param-name>
+            <param-value>
+                /docs/(\S)+\.json
+            </param-value>
+        </init-param>
+        <init-param>
+            <param-name>redirect-attributes</param-name>
+            <param-value>
+                javax.servlet.include.request_uri
+            </param-value>
+        </init-param>
+        <init-param>
+            <param-name>redirect-servlet-name</param-name>
+            <param-value>default</param-value>
+        </init-param>
+        <load-on-startup>1</load-on-startup>
+    </servlet>
+
+    <servlet-mapping>
+        <servlet-name>spring-mapper</servlet-name>
+        <url-pattern>/ws/*</url-pattern>
+    </servlet-mapping>
+    <servlet-mapping>
+        <servlet-name>CXFServlet</servlet-name>
+        <url-pattern>/*</url-pattern>
+    </servlet-mapping>
+
+</web-app>
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/activity-log-rest/activity-log-rest-services/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/notifications-rest/notifications-rest-services/pom.xml
similarity index 74%
copy from openecomp-be/api/openecomp-sdc-rest-webapp/activity-log-rest/activity-log-rest-services/pom.xml
copy to openecomp-be/api/openecomp-sdc-rest-webapp/notifications-rest/notifications-rest-services/pom.xml
index 10685db..597b017 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/activity-log-rest/activity-log-rest-services/pom.xml
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/notifications-rest/notifications-rest-services/pom.xml
@@ -4,55 +4,53 @@
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
-    <artifactId>activity-log-rest-services</artifactId>
-
     <parent>
         <groupId>org.openecomp.sdc</groupId>
-        <artifactId>activity-log-rest</artifactId>
+        <artifactId>notifications-rest</artifactId>
         <version>1.2.0-SNAPSHOT</version>
     </parent>
 
+    <artifactId>notifications-rest-services</artifactId>
+
     <dependencies>
-
-
-        <dependency>
-            <groupId>javax.ws.rs</groupId>
-            <artifactId>javax.ws.rs-api</artifactId>
-            <version>${ws.rs.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.springframework</groupId>
-            <artifactId>spring-context</artifactId>
-            <version>${spring.framework.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>javax.inject</groupId>
-            <artifactId>javax.inject</artifactId>
-            <version>1</version>
-        </dependency>
-        <dependency>
+          <dependency>
             <groupId>org.openecomp.sdc</groupId>
-            <artifactId>openecomp-sdc-activity-log-manager</artifactId>
+            <artifactId>openecomp-sdc-application-config-manager</artifactId>
             <version>${project.version}</version>
-        </dependency>
-        <dependency>
-             <groupId>org.openecomp.sdc</groupId>
-            <artifactId>activity-log-rest-types</artifactId>
-            <version>${project.version}</version>
+            <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.openecomp.sdc</groupId>
             <artifactId>openecomp-sdc-common-rest</artifactId>
             <version>${project.version}</version>
         </dependency>
+        <dependency>
+            <groupId>javax.inject</groupId>
+            <artifactId>javax.inject</artifactId>
+            <version>1</version>
+        </dependency>
         <!-- CXF -->
         <dependency>
             <groupId>org.apache.cxf</groupId>
             <artifactId>cxf-rt-frontend-jaxrs</artifactId>
             <version>${cxf.version}</version>
         </dependency>
-
+        <dependency>
+            <groupId>org.openecomp.sdc</groupId>
+            <artifactId>notifications-rest-types</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.openecomp.sdc</groupId>
+            <artifactId>openecomp-sdc-notification-api</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-context</artifactId>
+            <version>${spring.framework.version}</version>
+        </dependency>
     </dependencies>
 
 
-</project>
+</project>
\ No newline at end of file
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/notifications-rest/notifications-rest-services/src/main/java/org/openecomp/sdcrests/notifications/rest/mapping/MapNotificationsStatusToDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/notifications-rest/notifications-rest-services/src/main/java/org/openecomp/sdcrests/notifications/rest/mapping/MapNotificationsStatusToDto.java
new file mode 100644
index 0000000..41376b0
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/notifications-rest/notifications-rest-services/src/main/java/org/openecomp/sdcrests/notifications/rest/mapping/MapNotificationsStatusToDto.java
@@ -0,0 +1,64 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * 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=========================================================
+ */
+
+package org.openecomp.sdcrests.notifications.rest.mapping;
+
+import com.datastax.driver.core.utils.UUIDs;
+import org.openecomp.core.utilities.json.JsonUtil;
+import org.openecomp.sdc.notification.dao.types.NotificationEntity;
+import org.openecomp.sdc.notification.dtos.NotificationsStatus;
+import org.openecomp.sdcrests.mapping.MappingBase;
+import org.openecomp.sdcrests.notifications.types.NotificationEntityDto;
+import org.openecomp.sdcrests.notifications.types.NotificationsStatusDto;
+
+import java.text.DateFormat;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+public class MapNotificationsStatusToDto
+    extends MappingBase<NotificationsStatus, NotificationsStatusDto> {
+
+    private static final DateFormat formatter =
+        DateFormat.getDateTimeInstance(DateFormat.LONG,
+            DateFormat.SHORT);
+
+    @Override
+    public void doMapping(NotificationsStatus source, NotificationsStatusDto target) {
+
+        target.setLastScanned(source.getLastScanned());
+        target.setNewEntries(source.getNewEntries());
+        target.setEndOfPage(source.getEndOfPage());
+        target.setNumOfNotSeenNotifications(source.getNumOfNotSeenNotifications());
+        List<NotificationEntityDto> entityDtos = new ArrayList<>();
+        source.getNotifications()
+            .forEach(notification -> entityDtos.add(new NotificationEntityDto(notification.isRead(),
+                notification.getEventId(), notification.getEventType(),
+                JsonUtil.json2Object(notification.getEventAttributes(), Map.class),
+                extractDate(notification))));
+        target.setNotifications(entityDtos);
+    }
+
+    private String extractDate(NotificationEntity notification) {
+        return formatter.format(UUIDs.unixTimestamp
+            (notification
+                .getEventId()));
+    }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/notifications-rest/notifications-rest-services/src/main/java/org/openecomp/sdcrests/notifications/rest/mapping/MapNotificationsToDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/notifications-rest/notifications-rest-services/src/main/java/org/openecomp/sdcrests/notifications/rest/mapping/MapNotificationsToDto.java
new file mode 100644
index 0000000..558453b
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/notifications-rest/notifications-rest-services/src/main/java/org/openecomp/sdcrests/notifications/rest/mapping/MapNotificationsToDto.java
@@ -0,0 +1,57 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * 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=========================================================
+ */
+
+package org.openecomp.sdcrests.notifications.rest.mapping;
+
+import com.datastax.driver.core.utils.UUIDs;
+import org.apache.commons.collections4.CollectionUtils;
+import org.openecomp.core.utilities.json.JsonUtil;
+import org.openecomp.sdc.notification.dao.types.NotificationEntity;
+import org.openecomp.sdcrests.mapping.MappingBase;
+import org.openecomp.sdcrests.notifications.types.NotificationEntityDto;
+import org.openecomp.sdcrests.notifications.types.NotificationsStatusDto;
+
+import java.text.DateFormat;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+public class MapNotificationsToDto extends MappingBase<List<NotificationEntity>, NotificationsStatusDto> {
+    private static final DateFormat formatter =
+            DateFormat.getDateTimeInstance(DateFormat.LONG,
+                    DateFormat.SHORT);
+    @Override
+    public void doMapping(List<NotificationEntity> source, NotificationsStatusDto target) {
+        List<NotificationEntityDto> entityDtos = new ArrayList<>();
+        if(CollectionUtils.isNotEmpty(source)) {
+            source.forEach(notification -> entityDtos.add(new NotificationEntityDto(notification.isRead(),
+                    notification.getEventId(), notification.getEventType(), JsonUtil.json2Object(notification.getEventAttributes(), Map.class),
+                    extractDate(notification))));
+            target.setNotifications(entityDtos);
+            target.setLastScanned(source.get(0).getEventId());
+        }
+    }
+
+    private String extractDate(NotificationEntity notification) {
+        return formatter.format(UUIDs.unixTimestamp
+                (notification
+                        .getEventId()));
+    }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/notifications-rest/notifications-rest-services/src/main/java/org/openecomp/sdcrests/notifications/rest/services/Notifications.java b/openecomp-be/api/openecomp-sdc-rest-webapp/notifications-rest/notifications-rest-services/src/main/java/org/openecomp/sdcrests/notifications/rest/services/Notifications.java
new file mode 100644
index 0000000..97199f6
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/notifications-rest/notifications-rest-services/src/main/java/org/openecomp/sdcrests/notifications/rest/services/Notifications.java
@@ -0,0 +1,94 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * 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=========================================================
+ */
+
+package org.openecomp.sdcrests.notifications.rest.services;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.openecomp.sdcrests.notifications.types.NotificationsStatusDto;
+import org.openecomp.sdcrests.notifications.types.UpdateNotificationResponseStatus;
+import org.springframework.validation.annotation.Validated;
+
+import javax.validation.constraints.NotNull;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import java.lang.reflect.InvocationTargetException;
+import java.util.UUID;
+
+import static org.openecomp.sdcrests.common.RestConstants.LAST_DELIVERED_QUERY_PARAM;
+import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
+import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
+
+@Path("/v1.0/notifications")
+@Produces(MediaType.APPLICATION_JSON)
+@Consumes(MediaType.APPLICATION_JSON)
+@Api(value = "Notifications")
+@Validated
+public interface Notifications {
+  String LIMIT_QUERY_PARAM = "NOTIFICATION_ROWS_LIMIT";
+  String END_OF_PAGE_QUERY_PARAM = "END_OF_PAGE_EVENT_ID";
+
+  @GET
+  @ApiOperation(value = "Retrive all user notifications",
+      response = NotificationsStatusDto.class,
+      responseContainer = "List")
+  Response getNotifications(
+      @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user,
+      @QueryParam(LAST_DELIVERED_QUERY_PARAM) UUID lastDelvered,
+      @QueryParam(END_OF_PAGE_QUERY_PARAM) UUID endOfPage);
+
+  @PUT
+  @Path("/{notificationId}")
+  @ApiOperation(value = "Mark notification as read",
+      response = UpdateNotificationResponseStatus.class)
+  Response markAsRead(
+      @ApiParam(value = "Notification Id") @PathParam("notificationId") String notificationId,
+      @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user)
+      throws InvocationTargetException, IllegalAccessException;
+
+  @PUT
+  @Path("/last-seen/{notificationId}")
+  @ApiOperation(value = "Update Last Seen Notification",
+      response = UpdateNotificationResponseStatus.class)
+  Response updateLastSeenNotification(
+      @ApiParam(value = "Notification Id") @PathParam("notificationId") String notificationId,
+      @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user)
+      throws InvocationTargetException, IllegalAccessException;
+
+  @GET
+  @Path("/worker")
+  @ApiOperation(value = "Retrive user not delivered notifications",
+      response = NotificationsStatusDto.class,
+      responseContainer = "List")
+  Response getNewNotificationsByOwnerId(
+      @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user,
+      @QueryParam(LAST_DELIVERED_QUERY_PARAM) String eventId,
+      @QueryParam(LIMIT_QUERY_PARAM) String limit);
+
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/notifications-rest/notifications-rest-services/src/main/java/org/openecomp/sdcrests/notifications/rest/services/impl/NotificationsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/notifications-rest/notifications-rest-services/src/main/java/org/openecomp/sdcrests/notifications/rest/services/impl/NotificationsImpl.java
new file mode 100644
index 0000000..8ff0ac0
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/notifications-rest/notifications-rest-services/src/main/java/org/openecomp/sdcrests/notifications/rest/services/impl/NotificationsImpl.java
@@ -0,0 +1,117 @@
+package org.openecomp.sdcrests.notifications.rest.services.impl;
+
+import org.openecomp.sdc.common.errors.Messages;
+import org.openecomp.sdc.datatypes.error.ErrorLevel;
+import org.openecomp.sdc.datatypes.error.ErrorMessage;
+import org.openecomp.sdc.logging.api.Logger;
+import org.openecomp.sdc.logging.api.LoggerFactory;
+import org.openecomp.sdc.logging.context.MdcUtil;
+import org.openecomp.sdc.logging.types.LoggerServiceName;
+import org.openecomp.sdc.notification.dao.types.NotificationEntity;
+import org.openecomp.sdc.notification.dtos.NotificationsStatus;
+import org.openecomp.sdc.notification.exceptons.NotificationNotExistException;
+import org.openecomp.sdc.notification.factories.NotificationsServiceFactory;
+import org.openecomp.sdc.notification.services.NotificationsService;
+import org.openecomp.sdcrests.notifications.rest.mapping.MapNotificationsStatusToDto;
+import org.openecomp.sdcrests.notifications.rest.mapping.MapNotificationsToDto;
+import org.openecomp.sdcrests.notifications.rest.services.Notifications;
+import org.openecomp.sdcrests.notifications.types.NotificationsStatusDto;
+import org.openecomp.sdcrests.notifications.types.UpdateNotificationResponseStatus;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Service;
+
+import javax.inject.Named;
+import javax.ws.rs.core.Response;
+import java.lang.reflect.InvocationTargetException;
+import java.util.List;
+import java.util.Objects;
+import java.util.UUID;
+
+/**
+ * @author Avrahamg
+ * @since June 22, 2017
+ */
+@Named
+@Service("notifications")
+@Scope(value = "prototype")
+public class NotificationsImpl implements Notifications {
+
+	private static int selectionLimit = 10;
+
+	private static final Logger LOGGER = LoggerFactory.getLogger(NotificationsImpl.class);
+	private NotificationsService notificationsService = NotificationsServiceFactory.getInstance().createInterface();
+
+    @Override
+    public Response getNotifications(String user, UUID lastDelivered, UUID endOfPage) {
+        MdcUtil.initMdc(LoggerServiceName.notifications.toString());
+        NotificationsStatus notificationsStatus = notificationsService
+            .getNotificationsStatus(user, lastDelivered, selectionLimit, endOfPage);
+        MapNotificationsStatusToDto converter = new MapNotificationsStatusToDto();
+        NotificationsStatusDto notificationsStatusDto = new NotificationsStatusDto();
+        converter.doMapping(notificationsStatus, notificationsStatusDto);
+
+        return Response.ok(notificationsStatusDto).build();
+    }
+
+    @Override
+    public Response updateLastSeenNotification(String notificationId, String user)
+        throws InvocationTargetException, IllegalAccessException {
+        UpdateNotificationResponseStatus
+            updateNotificationResponseStatus = new UpdateNotificationResponseStatus();
+        try {
+            notificationsService.updateLastSeenNotification(user, UUID.fromString(notificationId));
+        } catch (Exception ex) {
+            LOGGER.error(
+                String.format(Messages.FAILED_TO_UPDATE_LAST_SEEN_NOTIFICATION.getErrorMessage(),
+                    user), ex);
+            updateNotificationResponseStatus.addStructureError(notificationId,
+                new ErrorMessage(ErrorLevel.ERROR,
+                    Messages.FAILED_TO_UPDATE_LAST_SEEN_NOTIFICATION.getErrorMessage()));
+        }
+        return Response.ok(updateNotificationResponseStatus).build();
+    }
+
+    @Override
+    public Response markAsRead(String notificationId, String user)
+        throws InvocationTargetException, IllegalAccessException {
+
+        UpdateNotificationResponseStatus
+            updateNotificationResponseStatus = new UpdateNotificationResponseStatus();
+        try {
+            notificationsService.markAsRead(user, notificationId);
+        } catch (NotificationNotExistException ex) {
+            LOGGER.error(Messages.FAILED_TO_MARK_NOTIFICATION_AS_READ.getErrorMessage(), ex);
+            updateNotificationResponseStatus.addStructureError(
+                notificationId, new ErrorMessage(ErrorLevel.ERROR, Messages
+                    .FAILED_TO_MARK_NOTIFICATION_AS_READ
+                    .getErrorMessage()));
+        }
+        return Response.ok(updateNotificationResponseStatus).build();
+    }
+
+    @Override
+    public Response getNewNotificationsByOwnerId(String user, String eventId, String limitStr) {
+        MdcUtil.initMdc(LoggerServiceName.notifications.toString());
+
+        int limit = selectionLimit;
+
+        if (Objects.nonNull(limitStr)) {
+            try {
+                limit = Integer.parseInt(limitStr);
+            }
+	    catch (NumberFormatException f) {
+                LOGGER.error("Non numeric selection list size value specified: " + limitStr);
+            }
+        }
+
+        List<NotificationEntity> notifications = Objects.isNull(eventId)
+            ? notificationsService.getNotificationsByOwnerId(user, limit)
+            : notificationsService.getNewNotificationsByOwnerId(user, UUID.fromString(eventId), limit);
+
+        MapNotificationsToDto converter = new MapNotificationsToDto();
+        NotificationsStatusDto notificationsStatusDto = new NotificationsStatusDto();
+        converter.doMapping(notifications, notificationsStatusDto);
+
+        return Response.ok(notificationsStatusDto).build();
+    }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/notifications-rest/notifications-rest-types/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/notifications-rest/notifications-rest-types/pom.xml
new file mode 100644
index 0000000..4a3300a
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/notifications-rest/notifications-rest-types/pom.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <dependencies>
+        <dependency>
+            <groupId>org.openecomp.sdc</groupId>
+            <artifactId>openecomp-sdc-datatypes-lib</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
+
+    <parent>
+        <groupId>org.openecomp.sdc</groupId>
+        <artifactId>notifications-rest</artifactId>
+        <version>1.2.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>notifications-rest-types</artifactId>
+
+
+</project>
\ No newline at end of file
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/notifications-rest/notifications-rest-types/src/main/java/org/openecomp/sdcrests/notifications/types/NotificationEntityDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/notifications-rest/notifications-rest-types/src/main/java/org/openecomp/sdcrests/notifications/types/NotificationEntityDto.java
new file mode 100644
index 0000000..d41deb3
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/notifications-rest/notifications-rest-types/src/main/java/org/openecomp/sdcrests/notifications/types/NotificationEntityDto.java
@@ -0,0 +1,91 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * 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=========================================================
+ */
+
+package org.openecomp.sdcrests.notifications.types;
+
+import java.util.Map;
+import java.util.UUID;
+
+public class NotificationEntityDto {
+  private boolean read;
+  private UUID eventId;
+  private String dateTime;
+  private String eventType;
+  private Map<String, Object> eventAttributes;
+
+  public NotificationEntityDto() {
+  }
+  public NotificationEntityDto(boolean read, UUID eventId, String eventType,
+                               Map<String, Object> eventAttributes) {
+    this.read = read;
+    this.eventId = eventId;
+    this.eventType = eventType;
+    this.eventAttributes = eventAttributes;
+  }
+
+  public NotificationEntityDto(boolean read, UUID eventId,String eventType,
+                               Map<String, Object> eventAttributes, String dateTime) {
+    this.read = read;
+    this.eventId = eventId;
+    this.dateTime = dateTime;
+    this.eventType = eventType;
+    this.eventAttributes = eventAttributes;
+  }
+
+  public boolean isRead() {
+    return read;
+  }
+
+  public void setRead(boolean read) {
+    this.read = read;
+  }
+
+  public UUID getEventId() {
+    return eventId;
+  }
+
+  public void setEventId(UUID eventId) {
+    this.eventId = eventId;
+  }
+
+  public String getEventType() {
+    return eventType;
+  }
+
+  public void setEventType(String eventType) {
+    this.eventType = eventType;
+  }
+
+  public Map<String, Object> getEventAttributes() {
+    return eventAttributes;
+  }
+
+  public void setEventAttributes(Map<String, Object> eventAttributes) {
+    this.eventAttributes = eventAttributes;
+  }
+
+  public String getDateTime() {
+    return dateTime;
+  }
+
+  public void setDateTime(String dateTime) {
+    this.dateTime = dateTime;
+  }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspCreationDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/notifications-rest/notifications-rest-types/src/main/java/org/openecomp/sdcrests/notifications/types/NotificationResponseStatus.java
similarity index 76%
copy from openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspCreationDto.java
copy to openecomp-be/api/openecomp-sdc-rest-webapp/notifications-rest/notifications-rest-types/src/main/java/org/openecomp/sdcrests/notifications/types/NotificationResponseStatus.java
index f77005f..a0273d5 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspCreationDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/notifications-rest/notifications-rest-types/src/main/java/org/openecomp/sdcrests/notifications/types/NotificationResponseStatus.java
@@ -7,9 +7,9 @@
  * 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.
@@ -18,19 +18,9 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.sdcrests.vendorsoftwareproducts.types;
+package org.openecomp.sdcrests.notifications.types;
 
-/**
- * Created by TALIO on 4/26/2016.
- */
-public class VspCreationDto {
-  private String vspId;
-
-  public String getVspId() {
-    return vspId;
-  }
-
-  public void setVspId(String vspId) {
-    this.vspId = vspId;
-  }
+public enum NotificationResponseStatus {
+  Success,
+  Failure
 }
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/notifications-rest/notifications-rest-types/src/main/java/org/openecomp/sdcrests/notifications/types/NotificationsStatusDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/notifications-rest/notifications-rest-types/src/main/java/org/openecomp/sdcrests/notifications/types/NotificationsStatusDto.java
new file mode 100644
index 0000000..182245c
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/notifications-rest/notifications-rest-types/src/main/java/org/openecomp/sdcrests/notifications/types/NotificationsStatusDto.java
@@ -0,0 +1,61 @@
+package org.openecomp.sdcrests.notifications.types;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.UUID;
+
+/**
+ * @author avrahamg
+ * @since June 29, 2017
+ */
+public class NotificationsStatusDto {
+    private List<NotificationEntityDto> notifications;
+    private List<UUID> newEntries = new ArrayList<>();
+    private UUID lastScanned;
+    private UUID endOfPage;
+    private long numOfNotSeenNotifications;
+
+    public NotificationsStatusDto() {
+    }
+
+    public List<NotificationEntityDto> getNotifications() {
+        return notifications;
+    }
+
+    public void setNotifications(
+        List<NotificationEntityDto> notifications) {
+        this.notifications = notifications;
+    }
+
+    public List<UUID> getNewEntries() {
+        return newEntries;
+    }
+
+    public void setNewEntries(List<UUID> newEntries) {
+        this.newEntries = newEntries;
+    }
+
+    public UUID getLastScanned() {
+        return lastScanned;
+    }
+
+    public void setLastScanned(UUID lastScanned) {
+        this.lastScanned = lastScanned;
+    }
+
+    public UUID getEndOfPage() {
+        return endOfPage;
+    }
+
+    public void setEndOfPage(UUID endOfPage) {
+        this.endOfPage = endOfPage;
+    }
+
+    public long getNumOfNotSeenNotifications() {
+        return numOfNotSeenNotifications;
+    }
+
+    public void setNumOfNotSeenNotifications(long numOfNotSeenNotifications) {
+        this.numOfNotSeenNotifications = numOfNotSeenNotifications;
+    }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/notifications-rest/notifications-rest-types/src/main/java/org/openecomp/sdcrests/notifications/types/UpdateNotificationResponseStatus.java b/openecomp-be/api/openecomp-sdc-rest-webapp/notifications-rest/notifications-rest-types/src/main/java/org/openecomp/sdcrests/notifications/types/UpdateNotificationResponseStatus.java
new file mode 100644
index 0000000..9e98572
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/notifications-rest/notifications-rest-types/src/main/java/org/openecomp/sdcrests/notifications/types/UpdateNotificationResponseStatus.java
@@ -0,0 +1,65 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * 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=========================================================
+ */
+
+package org.openecomp.sdcrests.notifications.types;
+
+import org.openecomp.sdc.datatypes.error.ErrorLevel;
+import org.openecomp.sdc.datatypes.error.ErrorMessage;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import static org.openecomp.sdcrests.notifications.types.NotificationResponseStatus.Failure;
+import static org.openecomp.sdcrests.notifications.types.NotificationResponseStatus.Success;
+
+/**
+ * Created by TALIO on 4/27/2016.
+ */
+public class UpdateNotificationResponseStatus {
+    private Map<String, List<ErrorMessage>> errors = new HashMap<>();
+    private NotificationResponseStatus status = Success;
+
+    public Map<String, List<ErrorMessage>> getErrors() {
+        return errors;
+    }
+
+    public void setErrors(Map<String, List<ErrorMessage>> errors) {
+        this.errors = errors;
+    }
+
+    public NotificationResponseStatus getStatus() {
+        return status;
+    }
+
+    public void setStatus(NotificationResponseStatus status) {
+        this.status = status;
+    }
+
+    public void addStructureError(String notificationId, ErrorMessage errorMessage) {
+        List<ErrorMessage> errorList =
+            errors.computeIfAbsent(notificationId, k -> new ArrayList<>());
+        errorList.add(errorMessage);
+        if (ErrorLevel.ERROR.equals(errorMessage.getLevel())) {
+            status = Failure;
+        }
+    }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/activity-log-rest/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/notifications-rest/pom.xml
similarity index 77%
copy from openecomp-be/api/openecomp-sdc-rest-webapp/activity-log-rest/pom.xml
copy to openecomp-be/api/openecomp-sdc-rest-webapp/notifications-rest/pom.xml
index 0b3c83c..d35c5af 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/activity-log-rest/pom.xml
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/notifications-rest/pom.xml
@@ -4,19 +4,21 @@
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
-    <groupId>org.openecomp.sdc</groupId>
-    <artifactId>activity-log-rest</artifactId>
-    <packaging>pom</packaging>
-
     <parent>
         <groupId>org.openecomp.sdc</groupId>
         <artifactId>openecomp-sdc-rest-webapp</artifactId>
         <version>1.2.0-SNAPSHOT</version>
     </parent>
 
+    <groupId>org.openecomp.sdc</groupId>
+    <artifactId>notifications-rest</artifactId>
+
+    <packaging>pom</packaging>
+
+
     <modules>
-        <module>activity-log-rest-services</module>
-        <module>activity-log-rest-types</module>
-    </modules>
-    
-</project>
+        <module>notifications-rest-types</module>
+        <module>notifications-rest-services</module>
+     </modules>
+
+</project>
\ No newline at end of file
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/pom.xml
index 84c4eb4..32975b3 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/pom.xml
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/pom.xml
@@ -16,13 +16,23 @@
 
     <dependencies>
         <dependency>
+            <groupId>org.openecomp.sdc</groupId>
+            <artifactId>item-rest-services</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
             <groupId>org.openecomp.sdc.onboarding</groupId>
             <artifactId>vendor-license-rest-services</artifactId>
             <version>${project.version}</version>
         </dependency>
         <dependency>
             <groupId>org.openecomp.sdc</groupId>
-            <artifactId>activity-log-rest-services</artifactId>
+            <artifactId>openecomp-sdc-notification-api</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+	    <dependency>
+            <groupId>org.openecomp.sdc</groupId>
+            <artifactId>openecomp-sdc-notification-core</artifactId>
             <version>${project.version}</version>
         </dependency>
         <dependency>
@@ -42,6 +52,21 @@
         </dependency>
         <dependency>
             <groupId>org.openecomp.sdc</groupId>
+            <artifactId>conflict-rest-services</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.openecomp.sdc</groupId>
+            <artifactId>item-permissions-rest-services</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.openecomp.sdc</groupId>
+            <artifactId>notifications-rest-services</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.openecomp.sdc</groupId>
             <artifactId>application-config-rest-services</artifactId>
             <version>${project.version}</version>
         </dependency>
@@ -108,6 +133,11 @@
         </dependency>
         <dependency>
             <groupId>org.springframework</groupId>
+            <artifactId>spring-context</artifactId>
+            <version>${spring.framework.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
             <artifactId>spring-core</artifactId>
             <version>${spring.framework.version}</version>
         </dependency>
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/filters/ActionAuthenticationFilter.java b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/filters/ActionAuthenticationFilter.java
index 18465cd..e10f6a5 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/filters/ActionAuthenticationFilter.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/filters/ActionAuthenticationFilter.java
@@ -23,9 +23,6 @@
 import org.openecomp.sdc.logging.api.Logger;
 import org.openecomp.sdc.logging.api.LoggerFactory;
 
-import java.io.IOException;
-import java.security.Principal;
-import java.util.Base64;
 import javax.servlet.Filter;
 import javax.servlet.FilterChain;
 import javax.servlet.FilterConfig;
@@ -35,6 +32,9 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletRequestWrapper;
 import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.security.Principal;
+import java.util.Base64;
 
 public class ActionAuthenticationFilter implements Filter {
 
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/filters/ActionAuthorizationFilter.java b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/filters/ActionAuthorizationFilter.java
index 82e4fa8..f54b06d 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/filters/ActionAuthorizationFilter.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/filters/ActionAuthorizationFilter.java
@@ -20,7 +20,6 @@
 
 package org.openecomp.server.filters;
 
-import java.io.IOException;
 import javax.servlet.Filter;
 import javax.servlet.FilterChain;
 import javax.servlet.FilterConfig;
@@ -29,6 +28,7 @@
 import javax.servlet.ServletResponse;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
 
 public class ActionAuthorizationFilter implements Filter {
 
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/filters/SessionContextFilter.java b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/filters/SessionContextFilter.java
new file mode 100644
index 0000000..b317fa6
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/filters/SessionContextFilter.java
@@ -0,0 +1,45 @@
+package org.openecomp.server.filters;
+
+import org.openecomp.sdc.common.session.SessionContextProvider;
+import org.openecomp.sdc.common.session.SessionContextProviderFactory;
+
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
+import java.io.IOException;
+
+import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
+
+public class SessionContextFilter implements Filter {
+  @Override
+  public void init(FilterConfig filterConfig) throws ServletException {
+
+  }
+
+  @Override
+  public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse,
+                       FilterChain filterChain) throws IOException, ServletException {
+    SessionContextProvider contextProvider =
+        SessionContextProviderFactory.getInstance().createInterface();
+
+    try {
+      if (servletRequest instanceof HttpServletRequest) {
+        String userName = ((HttpServletRequest) servletRequest).getHeader(USER_ID_HEADER_PARAM);
+        contextProvider.create(userName);
+      }
+
+      filterChain.doFilter(servletRequest, servletResponse);
+    } finally {
+      contextProvider.close();
+    }
+  }
+
+  @Override
+  public void destroy() {
+
+  }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/webapp/WEB-INF/beans-services.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/webapp/WEB-INF/beans-services.xml
index 8f4a2db..e43fa01 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/webapp/WEB-INF/beans-services.xml
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/webapp/WEB-INF/beans-services.xml
@@ -36,24 +36,14 @@
 
     <!-- aspect beans -->
     <bean id = "healthCheck" class="org.openecomp.sdcrests.health.rest.services.HealthCheckImpl"/>
-    <!--aop:config>
-        < aspect pointcuts>
-        <aop:pointcut id="loggingDebugPointcut" expression="execution(* org.openecomp.sdc.*.*.*(..))"/>
-
-        <advices>
-        <aop:aspect id="logDebugAspect" ref="debugAspect">
-            <aop:before pointcut-ref="loggingDebugPointcut" method="debugEnterMethod"/>
-            <aop:after-returning pointcut-ref="loggingDebugPointcut" method="debugExitMethod"/>
-        </aop:aspect>
-    </aop:config-->
-
-
-
-
+    <bean id = "itemPermissions" class="org.openecomp.sdcrests.itempermissions.rest.services.ItemPermissionsImpl"/>
+    <bean id = "notifications" class="org.openecomp.sdcrests.notifications.rest.services.impl.NotificationsImpl"/>
     <!-- RESTful Services -->
     <jaxrs:server id="restContainer" address="/">
 
         <jaxrs:serviceBeans>
+            <ref bean="versions"/>
+            <ref bean="conflicts"/>
             <ref bean="vendorLicenseModels"/>
             <ref bean="licenseAgreements"/>
             <ref bean="featureGroups"/>
@@ -75,9 +65,10 @@
             <ref bean="deploymentFlavors"/>
 	        <ref bean="images"/>
             <ref bean="orchestrationTemplateCandidate"/>
-            <ref bean="componentDependencyModel"/>
-            <ref bean="activityLog"/>
+            <ref bean="componentDependencies"/>
             <ref bean="healthCheck"/>
+            <ref bean="itemPermissions"/>
+            <ref bean="notifications"/>
         </jaxrs:serviceBeans>
 
         <jaxrs:providers>
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/webapp/WEB-INF/spring-mapper-servlet.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/webapp/WEB-INF/spring-mapper-servlet.xml
new file mode 100644
index 0000000..437df79
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/webapp/WEB-INF/spring-mapper-servlet.xml
@@ -0,0 +1,13 @@
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+
+    <bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
+        <property name="mappings">
+            <props>
+            </props>
+        </property>
+    </bean>
+
+</beans>
\ No newline at end of file
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/webapp/WEB-INF/web.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/webapp/WEB-INF/web.xml
index 35865f9..de88197 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/webapp/WEB-INF/web.xml
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/webapp/WEB-INF/web.xml
@@ -23,6 +23,19 @@
     </listener>
 
     <filter>
+        <filter-name>PermissionsFilter</filter-name>
+        <filter-class>org.openecomp.sdc.itempermissions.servlet.PermissionsFilter</filter-class>
+    </filter>
+    <filter-mapping>
+        <filter-name>PermissionsFilter</filter-name>
+        <url-pattern>/v1.0/vendor-license-models/*</url-pattern>
+    </filter-mapping>
+    <filter-mapping>
+        <filter-name>PermissionsFilter</filter-name>
+        <url-pattern>/v1.0/vendor-software-products/*</url-pattern>
+    </filter-mapping>
+
+    <filter>
         <filter-name>cross-origin</filter-name>
         <filter-class>org.eclipse.jetty.servlets.CrossOriginFilter</filter-class>
         <init-param>
@@ -68,6 +81,22 @@
         <filter-name>LoggingServletFilter</filter-name>
         <url-pattern>/*</url-pattern>
     </filter-mapping>
+    <filter>
+        <filter-name>SessionContextFilter</filter-name>
+        <filter-class>org.openecomp.server.filters.SessionContextFilter</filter-class>
+    </filter>
+    <filter-mapping>
+        <filter-name>SessionContextFilter</filter-name>
+        <url-pattern>/*</url-pattern>
+    </filter-mapping>
+    <!-- Spring WS Mapping -->
+    <servlet>
+        <servlet-name>spring-mapper</servlet-name>
+        <servlet-class>
+            org.springframework.web.servlet.DispatcherServlet
+        </servlet-class>
+        <load-on-startup>1</load-on-startup>
+    </servlet>
     <!-- CXF -->
     <servlet>
         <servlet-name>CXFServlet</servlet-name>
@@ -94,7 +123,10 @@
         <load-on-startup>1</load-on-startup>
     </servlet>
     <servlet-mapping>
-        <!--servlet-name>logger-aspect</servlet-name-->
+        <servlet-name>spring-mapper</servlet-name>
+        <url-pattern>/ws/*</url-pattern>
+    </servlet-mapping>
+    <servlet-mapping>
         <servlet-name>CXFServlet</servlet-name>
         <url-pattern>/*</url-pattern>
     </servlet-mapping>
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/common/RestConstants.java b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/common/RestConstants.java
index 7bc1082..302af10 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/common/RestConstants.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/common/RestConstants.java
@@ -21,10 +21,12 @@
 package org.openecomp.sdcrests.common;
 
 public class RestConstants {
-  public static final String USER_ID_HEADER_PARAM = "USER_ID";
   // value Should be equal to com.tlv.sdc.common.api.Constants#USER_ID_HEADER
+  public static final String USER_ID_HEADER_PARAM = "USER_ID";
+  public static final String LAST_DELIVERED_QUERY_PARAM = "LAST_DELIVERED_EVENT_ID";
   public static final String USER_MISSING_ERROR_MSG =
       "Field does not conform to predefined criteria : user : may not be null";
+
   public static final String INVALID_JSON_ERROR_MESSAGE =
       "Field does not conform to predefined criteria : body :must be in JSON format";
 }
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/common/types/VersionDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/common/types/VersionDto.java
deleted file mode 100644
index b5b86c6..0000000
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/common/types/VersionDto.java
+++ /dev/null
@@ -1,34 +0,0 @@
-package org.openecomp.sdcrests.common.types;
-
-/**
- * Created by SVISHNEV on 3/5/2017.
- */
-public class VersionDto {
-    String id;
-    String label;
-
-    public VersionDto(){
-
-    }
-
-    public VersionDto(String id, String label) {
-        this.id = id;
-        this.label = label;
-    }
-
-    public String getId() {
-        return id;
-    }
-
-    public void setId(String id) {
-        this.id = id;
-    }
-
-    public String getLabel() {
-        return label;
-    }
-
-    public void setLabel(String label) {
-        this.label = label;
-    }
-}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/mapping/EchoMapMapping.java b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/mapping/EchoMapMapping.java
new file mode 100644
index 0000000..81c2f37
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/mapping/EchoMapMapping.java
@@ -0,0 +1,14 @@
+package org.openecomp.sdcrests.mapping;
+
+import java.util.HashMap;
+
+/**
+ * Created by ayalaben on 9/12/2017
+ */
+public class EchoMapMapping extends  MappingBase<HashMap<String,String>,HashMap<String,String>> {
+
+  @Override
+public void doMapping(HashMap<String,String> source, HashMap<String, String> target) {
+    target.putAll(source);
+    }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/mapping/EchoMapping.java b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/mapping/EchoMapping.java
new file mode 100644
index 0000000..4e5a22e
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/mapping/EchoMapping.java
@@ -0,0 +1,8 @@
+package org.openecomp.sdcrests.mapping;
+
+public class EchoMapping extends MappingBase <Object,Object>{
+  @Override
+  public void doMapping(Object source, Object target) {
+    target = source;
+  }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/mapping/MappingBase.java b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/mapping/MappingBase.java
index 2310c0f..25c2be9 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/mapping/MappingBase.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/mapping/MappingBase.java
@@ -23,15 +23,11 @@
 import org.openecomp.sdc.common.errors.CoreException;
 import org.openecomp.sdc.common.errors.ErrorCategory;
 import org.openecomp.sdc.common.errors.ErrorCode;
-import org.openecomp.sdc.common.errors.Messages;
 import org.openecomp.sdc.datatypes.error.ErrorLevel;
 import org.openecomp.sdc.logging.context.impl.MdcDataErrorMessage;
 import org.openecomp.sdc.logging.types.LoggerConstants;
 import org.openecomp.sdc.logging.types.LoggerServiceName;
 
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
-
 /**
  * Base class for all mapping classes. Mapping classes will perform data mapping from source object
  *  to target object Base class provides following<br>  <ol>  <li>provides life cycle of
@@ -55,8 +51,6 @@
    * @return <code>T</code> - instance of type <code>T</code>
    */
 
-  private final Logger logger = (Logger) LoggerFactory.getLogger(this.getClass().getName());
-
   public final T applyMapping(final S source, Class<T> clazz) {
     T target = (T) instantiateTarget(clazz);
     if (source == null || target == null) {
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/pom.xml
index 9970dfb..d44e0c8 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/pom.xml
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/pom.xml
@@ -22,8 +22,12 @@
 		<module>/validation-rest</module>
 		<module>/action-library-rest</module>
 		<module>/application-config-rest</module>
-		<module>/activity-log-rest</module>
 		<module>/healthcheck-rest</module>
+		<module>conflict-rest</module>
+		<module>item-permissions-rest</module>
+		<module>item-rest</module>
+		<module>notifications-fe</module>
+		<module>notifications-rest</module>
 	</modules>
 
 </project>
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/src/main/java/org/openecomp/sdcrests/validation/rest/Validation.java b/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/src/main/java/org/openecomp/sdcrests/validation/rest/Validation.java
index b08bc10..349f0bd 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/src/main/java/org/openecomp/sdcrests/validation/rest/Validation.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/src/main/java/org/openecomp/sdcrests/validation/rest/Validation.java
@@ -24,7 +24,6 @@
 import org.apache.cxf.jaxrs.ext.multipart.Multipart;
 import org.springframework.validation.annotation.Validated;
 
-import java.io.InputStream;
 import javax.ws.rs.Consumes;
 import javax.ws.rs.POST;
 import javax.ws.rs.Path;
@@ -32,6 +31,7 @@
 import javax.ws.rs.Produces;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
+import java.io.InputStream;
 
 
 @Path("/v1.0/validation")
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/src/main/java/org/openecomp/sdcrests/validation/rest/ValidationForSwaggerUsage.java b/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/src/main/java/org/openecomp/sdcrests/validation/rest/ValidationForSwaggerUsage.java
index fd5bea3..399f665 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/src/main/java/org/openecomp/sdcrests/validation/rest/ValidationForSwaggerUsage.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/src/main/java/org/openecomp/sdcrests/validation/rest/ValidationForSwaggerUsage.java
@@ -25,7 +25,6 @@
 import io.swagger.annotations.ApiOperation;
 import org.springframework.validation.annotation.Validated;
 
-import java.io.InputStream;
 import javax.ws.rs.Consumes;
 import javax.ws.rs.POST;
 import javax.ws.rs.Path;
@@ -33,6 +32,7 @@
 import javax.ws.rs.Produces;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
+import java.io.InputStream;
 
 
 @Path("/v1.0/validation")
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/src/main/java/org/openecomp/sdcrests/validation/rest/services/ValidationImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/src/main/java/org/openecomp/sdcrests/validation/rest/services/ValidationImpl.java
index 15675f1..f43ff60 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/src/main/java/org/openecomp/sdcrests/validation/rest/services/ValidationImpl.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/src/main/java/org/openecomp/sdcrests/validation/rest/services/ValidationImpl.java
@@ -39,10 +39,10 @@
 import org.springframework.context.annotation.Scope;
 import org.springframework.stereotype.Service;
 
-import java.io.IOException;
-import java.io.InputStream;
 import javax.inject.Named;
 import javax.ws.rs.core.Response;
+import java.io.IOException;
+import java.io.InputStream;
 
 @Named
 @Service("validation")
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/pom.xml
index 643addc..cec09f0 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/pom.xml
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/pom.xml
@@ -30,13 +30,13 @@
 		</dependency>
 		<dependency>
 			<groupId>org.openecomp.sdc</groupId>
-			<artifactId>openecomp-sdc-vendor-license-manager</artifactId>
+			<artifactId>openecomp-sdc-item-permissions-manager</artifactId>
 			<version>${project.version}</version>
 		</dependency>
 
 
 		<!-- Spring -->
-		<dependency>
+<!--		<dependency>
 			<groupId>org.springframework</groupId>
 			<artifactId>spring-core</artifactId>
 			<version>${spring.framework.version}</version>
@@ -60,7 +60,7 @@
 			<groupId>org.springframework</groupId>
 			<artifactId>spring-beans</artifactId>
 			<version>${spring.framework.version}</version>
-		</dependency>
+		</dependency>-->
 
 		<!-- CXF -->
 		<dependency>
@@ -79,11 +79,11 @@
 			<version>${http.client.version}</version>
 		</dependency>
 
-		<dependency>
+<!--		<dependency>
 			<groupId>javax.ws.rs</groupId>
 			<artifactId>javax.ws.rs-api</artifactId>
 			<version>${ws.rs.version}</version>
-		</dependency>
+		</dependency>-->
 
 		<!-- Other Stuff-->
 		<!--dependency>
@@ -105,8 +105,13 @@
 			<artifactId>openecomp-sdc-vendor-software-product-manager</artifactId>
 			<version>${project.version}</version>
 		</dependency>
+		<dependency>
+			<groupId>org.openecomp.sdc</groupId>
+			<artifactId>item-rest-services</artifactId>
+			<version>${project.version}</version>
+		</dependency>
 
-	</dependencies>
+    </dependencies>
 
 
 	<build>
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/EntitlementPoolLimits.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/EntitlementPoolLimits.java
index 3e7adc8..fb71b0a 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/EntitlementPoolLimits.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/EntitlementPoolLimits.java
@@ -1,12 +1,8 @@
 package org.openecomp.sdcrests.vendorlicense.rest;
 
-import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
-import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
-
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
-
 import org.openecomp.sdcrests.vendorlicense.types.LimitEntityDto;
 import org.openecomp.sdcrests.vendorlicense.types.LimitRequestDto;
 import org.springframework.validation.annotation.Validated;
@@ -15,9 +11,9 @@
 import javax.validation.constraints.NotNull;
 import javax.ws.rs.Consumes;
 import javax.ws.rs.DELETE;
-import javax.ws.rs.POST;
 import javax.ws.rs.GET;
 import javax.ws.rs.HeaderParam;
+import javax.ws.rs.POST;
 import javax.ws.rs.PUT;
 import javax.ws.rs.Path;
 import javax.ws.rs.PathParam;
@@ -25,8 +21,11 @@
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
-@Path("/v1.0/vendor-license-models/{vlmId}/versions/{versionId}/entitlement-pools" +
-    "/{entitlementPoolId}/limits")
+import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
+import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
+
+@Path(
+    "/v1.0/vendor-license-models/{vlmId}/versions/{versionId}/entitlement-pools/{entitlementPoolId}/limits")
 @Produces(MediaType.APPLICATION_JSON)
 @Consumes(MediaType.APPLICATION_JSON)
 @Api(value = "Vendor License Model - Entitlement Pool Limits")
@@ -37,16 +36,16 @@
   @Path("/")
   @ApiOperation(value = "Create vendor entitlement pool limits")
   Response createLimit(@Valid LimitRequestDto request,
-                                 @ApiParam(value = "Vendor license model Id") @PathParam("vlmId")
-                                     String vlmId,
-                                 @ApiParam(value = "Vendor license model version Id") @PathParam
-                                     ("versionId")
-                                     String versionId,
-                                 @ApiParam(value = "Vendor license model Entitlement Pool Id")
-                                      @PathParam("entitlementPoolId")
-                                          String entitlementPoolId  ,
-                                 @NotNull(message = USER_MISSING_ERROR_MSG)
-                                 @HeaderParam(USER_ID_HEADER_PARAM) String user);
+                       @ApiParam(value = "Vendor license model Id") @PathParam("vlmId")
+                           String vlmId,
+                       @ApiParam(value = "Vendor license model version Id") @PathParam
+                           ("versionId")
+                           String versionId,
+                       @ApiParam(value = "Vendor license model Entitlement Pool Id")
+                       @PathParam("entitlementPoolId")
+                           String entitlementPoolId,
+                       @NotNull(message = USER_MISSING_ERROR_MSG)
+                       @HeaderParam(USER_ID_HEADER_PARAM) String user);
 
 
   @GET
@@ -72,7 +71,7 @@
                            String versionId,
                        @ApiParam(value = "Vendor license model Entitlement Pool Id")
                        @PathParam("entitlementPoolId")
-                           String entitlementPoolId  ,
+                           String entitlementPoolId,
                        @NotNull(message = USER_MISSING_ERROR_MSG)
                        @PathParam("limitId") String limitId,
                        @HeaderParam(USER_ID_HEADER_PARAM) String user);
@@ -94,10 +93,11 @@
   @Path("/{limitId}")
   @ApiOperation(value = "Delete vendor entitlement pool limit")
   Response deleteLimit(
-    @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId,
-    @ApiParam(value = "Vendor license model version Id") @PathParam("versionId") String versionId,
-    @ApiParam(value = "Vendor license model Entitlement pool Id") @PathParam("entitlementPoolId") String entitlementPoolId,
-    @PathParam("limitId") String limitId,
-    @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
+      @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId,
+      @ApiParam(value = "Vendor license model version Id") @PathParam("versionId") String versionId,
+      @ApiParam(value = "Vendor license model Entitlement pool Id") @PathParam("entitlementPoolId")
+          String entitlementPoolId,
+      @PathParam("limitId") String limitId,
+      @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
 
 }
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/FeatureGroups.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/FeatureGroups.java
index a3a4e4d..7344459 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/FeatureGroups.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/FeatureGroups.java
@@ -20,9 +20,6 @@
 
 package org.openecomp.sdcrests.vendorlicense.rest;
 
-import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
-import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
-
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
@@ -46,6 +43,9 @@
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
+import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
+import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
+
 
 @Path("/v1.0/vendor-license-models/{vlmId}/versions/{versionId}/feature-groups")
 @Produces(MediaType.APPLICATION_JSON)
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/LicenseKeyGroupLimits.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/LicenseKeyGroupLimits.java
index bd31dc5..0033304 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/LicenseKeyGroupLimits.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/LicenseKeyGroupLimits.java
@@ -1,8 +1,5 @@
 package org.openecomp.sdcrests.vendorlicense.rest;
 
-import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
-import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
-
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
@@ -24,8 +21,11 @@
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
-@Path("/v1.0/vendor-license-models/{vlmId}/versions/{versionId}/license-key-groups" +
-    "/{licenseKeyGroupId}/limits")
+import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
+import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
+
+@Path(
+    "/v1.0/vendor-license-models/{vlmId}/versions/{versionId}/license-key-groups/{licenseKeyGroupId}/limits")
 @Produces(MediaType.APPLICATION_JSON)
 @Consumes(MediaType.APPLICATION_JSON)
 @Api(value = "Vendor License Model - License Key Group Limits")
@@ -43,7 +43,7 @@
                            String versionId,
                        @ApiParam(value = "Vendor license model License Key Group Id")
                        @PathParam("licenseKeyGroupId")
-                           String licenseKeyGroupId  ,
+                           String licenseKeyGroupId,
                        @NotNull(message = USER_MISSING_ERROR_MSG)
                        @HeaderParam(USER_ID_HEADER_PARAM) String user);
 
@@ -70,7 +70,7 @@
                            String versionId,
                        @ApiParam(value = "Vendor license model License Key Group Id")
                        @PathParam("licenseKeyGroupId")
-                           String licenseKeyGroupId  ,
+                           String licenseKeyGroupId,
                        @NotNull(message = USER_MISSING_ERROR_MSG)
                        @PathParam("limitId") String limitId,
                        @HeaderParam(USER_ID_HEADER_PARAM) String user);
@@ -88,13 +88,14 @@
           String limitId,
       @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
 
-    @DELETE
-    @Path("/{limitId}")
-    @ApiOperation(value = "Delete vendor license key group limit")
-    Response deleteLimit(
-            @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId,
-            @ApiParam(value = "Vendor license model version Id") @PathParam("versionId") String versionId,
-            @ApiParam(value = "Vendor license model license key group Id") @PathParam("licenseKeyGroupId") String licenseKeyGroupId,
-            @PathParam("limitId") String limitId,
-            @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
+  @DELETE
+  @Path("/{limitId}")
+  @ApiOperation(value = "Delete vendor license key group limit")
+  Response deleteLimit(
+      @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId,
+      @ApiParam(value = "Vendor license model version Id") @PathParam("versionId") String versionId,
+      @ApiParam(value = "Vendor license model license key group Id") @PathParam("licenseKeyGroupId")
+          String licenseKeyGroupId,
+      @PathParam("limitId") String limitId,
+      @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
 }
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/VendorLicenseModels.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/VendorLicenseModels.java
index 23a0960..9b1c096 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/VendorLicenseModels.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/VendorLicenseModels.java
@@ -24,6 +24,7 @@
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
 import org.openecomp.sdcrests.common.RestConstants;
+import org.openecomp.sdcrests.item.types.ItemDto;
 import org.openecomp.sdcrests.vendorlicense.types.VendorLicenseModelActionRequestDto;
 import org.openecomp.sdcrests.vendorlicense.types.VendorLicenseModelEntityDto;
 import org.openecomp.sdcrests.vendorlicense.types.VendorLicenseModelRequestDto;
@@ -31,7 +32,16 @@
 
 import javax.validation.Valid;
 import javax.validation.constraints.NotNull;
-import javax.ws.rs.*;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
@@ -45,65 +55,65 @@
 @Validated
 public interface VendorLicenseModels {
 
-    @GET
-    @Path("/")
-    @ApiOperation(value = "List vendor license models",
-            response = VendorLicenseModelEntityDto.class,
-            responseContainer = "List")
-    Response listLicenseModels(@ApiParam(
-            value = "Currently supported value: 'Final' - only vendor License models with final versions "
-                    + "will be return - with their latest final version")
-                               @QueryParam("versionFilter") String versionFilter,
-                               @NotNull(message = USER_MISSING_ERROR_MSG)
-                               @HeaderParam(RestConstants.USER_ID_HEADER_PARAM) String user);
+  @GET
+  @Path("/")
+  @ApiOperation(value = "List vendor license models",
+      response = ItemDto.class,
+      responseContainer = "List")
+  Response listLicenseModels(@ApiParam(value =
+      "Currently supported value: 'Certified' - only vendor License models with final versions "
+          + "will be return - with their latest final version")
+                             @QueryParam("versionFilter") String versionStatus,
+                             @NotNull(message = USER_MISSING_ERROR_MSG)
+                             @HeaderParam(RestConstants.USER_ID_HEADER_PARAM) String user);
 
-    @POST
-    @Path("/")
-    @ApiOperation(value = "Create vendor license model")
-    Response createLicenseModel(@Valid VendorLicenseModelRequestDto request,
-                                @NotNull(message = USER_MISSING_ERROR_MSG)
-                                @HeaderParam(RestConstants.USER_ID_HEADER_PARAM) String user);
+  @POST
+  @Path("/")
+  @ApiOperation(value = "Create vendor license model")
+  Response createLicenseModel(@Valid VendorLicenseModelRequestDto request,
+                              @NotNull(message = USER_MISSING_ERROR_MSG)
+                              @HeaderParam(RestConstants.USER_ID_HEADER_PARAM) String user);
 
-    @PUT
-    @Path("/{vlmId}/versions/{versionId}")
-    @ApiOperation(value = "Update vendor license model")
-    Response updateLicenseModel(@Valid VendorLicenseModelRequestDto request,
-                                @ApiParam(value = "Vendor license model Id") @PathParam("vlmId")
-                                String vlmId,
-                                @ApiParam(value = "Vendor license model version Id") @PathParam
-                                        ("versionId") String versionId,
-                                @NotNull(message = USER_MISSING_ERROR_MSG)
-                                @HeaderParam(RestConstants.USER_ID_HEADER_PARAM) String user);
+  @PUT
+  @Path("/{vlmId}/versions/{versionId}")
+  @ApiOperation(value = "Update vendor license model")
+  Response updateLicenseModel(@Valid VendorLicenseModelRequestDto request,
+                              @ApiParam(value = "Vendor license model Id")
+                              @PathParam("vlmId") String vlmId,
+                              @ApiParam(value = "Vendor license model version Id")
+                              @PathParam("versionId") String versionId,
+                              @NotNull(message = USER_MISSING_ERROR_MSG)
+                              @HeaderParam(RestConstants.USER_ID_HEADER_PARAM) String user);
 
-    @GET
-    @Path("/{vlmId}/versions/{versionId}")
-    @ApiOperation(value = "Get vendor license model",
-            response = VendorLicenseModelEntityDto.class)
-    Response getLicenseModel(
-            @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId,
-            @ApiParam(value = "Vendor license model version Id") @PathParam
-                    ("versionId") String versionId,
-            @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(RestConstants.USER_ID_HEADER_PARAM)
-            String user);
+  @GET
+  @Path("/{vlmId}/versions/{versionId}")
+  @ApiOperation(value = "Get vendor license model",
+      response = VendorLicenseModelEntityDto.class)
+  Response getLicenseModel(
+      @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId,
+      @ApiParam(value = "Vendor license model version Id") @PathParam
+          ("versionId") String versionId,
+      @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(RestConstants.USER_ID_HEADER_PARAM)
+          String user);
 
-    @DELETE
-    @Path("/{vlmId}/versions/{versionId}")
-    @ApiOperation(value = "Delete vendor license model")
-    Response deleteLicenseModel(
-            @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId,
-            @ApiParam(value = "Vendor license model version Id") @PathParam
-                    ("versionId") String versionId,
-            @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(RestConstants.USER_ID_HEADER_PARAM)
-            String user);
+  @DELETE
+  @Path("/{vlmId}/versions/{versionId}")
+  @ApiOperation(value = "Delete vendor license model")
+  Response deleteLicenseModel(
+      @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId,
+      @ApiParam(value = "Vendor license model version Id") @PathParam
+          ("versionId") String versionId,
+      @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(RestConstants.USER_ID_HEADER_PARAM)
+          String user);
 
-    @PUT
-    @Path("/{vlmId}/versions/{versionId}/actions")
-    @ApiOperation(value = "Update vendor license model")
-    Response actOnLicenseModel(@Valid VendorLicenseModelActionRequestDto request,
-                               @ApiParam(value = "Vendor license model Id") @PathParam("vlmId")
-                               String vlmId,
-                               @ApiParam(value = "Vendor license model version Id") @PathParam
-                                       ("versionId") String versionId,
-                               @NotNull(message = USER_MISSING_ERROR_MSG)
-                               @HeaderParam(RestConstants.USER_ID_HEADER_PARAM) String user);
+  @PUT
+  @Path("/{vlmId}/versions/{versionId}/actions")
+  @ApiOperation(value = "Update vendor license model")
+  Response actOnLicenseModel(@Valid VendorLicenseModelActionRequestDto request,
+                             @ApiParam(value = "Vendor license model Id") @PathParam("vlmId")
+                                 String vlmId,
+                             @ApiParam(value = "Vendor license model version Id") @PathParam
+                                 ("versionId") String versionId,
+                             @NotNull(message = USER_MISSING_ERROR_MSG)
+                             @HeaderParam(RestConstants.USER_ID_HEADER_PARAM) String user);
 }
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVspDetailsToVspCreationDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapVendorLicenseModelEntityToDto.java
similarity index 62%
rename from openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVspDetailsToVspCreationDto.java
rename to openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapVendorLicenseModelEntityToDto.java
index f009d8b..7bdde1d 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVspDetailsToVspCreationDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapVendorLicenseModelEntityToDto.java
@@ -7,9 +7,9 @@
  * 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.
@@ -18,15 +18,19 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.sdcrests.vsp.rest.mapping;
+package org.openecomp.sdcrests.vendorlicense.rest.mapping;
 
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
+import org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity;
 import org.openecomp.sdcrests.mapping.MappingBase;
-import org.openecomp.sdcrests.vendorsoftwareproducts.types.VspCreationDto;
+import org.openecomp.sdcrests.vendorlicense.types.VendorLicenseModelEntityDto;
 
-public class MapVspDetailsToVspCreationDto extends MappingBase<VspDetails, VspCreationDto> {
+public class MapVendorLicenseModelEntityToDto
+    extends MappingBase<VendorLicenseModelEntity, VendorLicenseModelEntityDto> {
   @Override
-  public void doMapping(VspDetails source, VspCreationDto target) {
-    target.setVspId(source.getId());
+  public void doMapping(VendorLicenseModelEntity source, VendorLicenseModelEntityDto target) {
+    target.setId(source.getId());
+    target.setVendorName(source.getVendorName());
+    target.setDescription(source.getDescription());
+    target.setIconRef(source.getIconRef());
   }
 }
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapVersionedVendorLicenseModelToVendorLicenseModelEntityDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapVersionedVendorLicenseModelToVendorLicenseModelEntityDto.java
deleted file mode 100644
index 7c2db85..0000000
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapVersionedVendorLicenseModelToVendorLicenseModelEntityDto.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * 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=========================================================
- */
-
-package org.openecomp.sdcrests.vendorlicense.rest.mapping;
-
-import org.openecomp.core.utilities.CommonMethods;
-import org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity;
-import org.openecomp.sdc.vendorlicense.types.VersionedVendorLicenseModel;
-import org.openecomp.sdc.versioning.dao.types.Version;
-import org.openecomp.sdc.versioning.types.VersionInfo;
-import org.openecomp.sdcrests.common.types.VersionDto;
-import org.openecomp.sdcrests.mapping.MappingBase;
-import org.openecomp.sdcrests.vendorlicense.types.VendorLicenseModelEntityDto;
-
-import java.util.stream.Collectors;
-
-public class MapVersionedVendorLicenseModelToVendorLicenseModelEntityDto
-    extends MappingBase<VersionedVendorLicenseModel, VendorLicenseModelEntityDto> {
-  @Override
-  public void doMapping(VersionedVendorLicenseModel source, VendorLicenseModelEntityDto target) {
-    VendorLicenseModelEntity sourceVlm = source.getVendorLicenseModel();
-    target.setId(sourceVlm.getId());
-    target.setVendorName(sourceVlm.getVendorName());
-    target.setDescription(sourceVlm.getDescription());
-    target.setIconRef(sourceVlm.getIconRef());
-
-    VersionInfo versionInfo = source.getVersionInfo();
-    if (versionInfo != null) {
-      target.setVersion(new VersionDto(versionInfo.getActiveVersion().toString(),versionInfo
-          .getActiveVersion().toString()));
-      target.setStatus(versionInfo.getStatus());
-      target.setLockingUser(versionInfo.getLockingUser());
-
-      if (!CommonMethods.isEmpty(versionInfo.getViewableVersions())) {
-        target.setViewableVersions(versionInfo.getViewableVersions().stream().map(version->new
-            VersionDto(version.toString(),version.toString()))
-            .collect(Collectors.toList()));
-      }
-
-      if (!CommonMethods.isEmpty(versionInfo.getFinalVersions())) {
-        target.setFinalVersions(versionInfo.getFinalVersions().stream().map(version->new
-            VersionDto(version.toString(),version.toString()))
-            .collect(Collectors.toList()));
-      }
-    }
-  }
-}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/EntitlementPoolLimitsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/EntitlementPoolLimitsImpl.java
index 4365ace..a866278 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/EntitlementPoolLimitsImpl.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/EntitlementPoolLimitsImpl.java
@@ -17,14 +17,12 @@
 import org.openecomp.sdcrests.vendorlicense.types.LimitEntityDto;
 import org.openecomp.sdcrests.vendorlicense.types.LimitRequestDto;
 import org.openecomp.sdcrests.wrappers.GenericCollectionWrapper;
-import org.openecomp.sdcrests.wrappers.StringWrapperResponse;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Scope;
 import org.springframework.stereotype.Service;
 
-import java.util.Collection;
 import javax.inject.Named;
 import javax.ws.rs.core.Response;
+import java.util.Collection;
 
 @Named
 @Service("entitlementPoolLimits")
@@ -32,7 +30,7 @@
 public class EntitlementPoolLimitsImpl implements EntitlementPoolLimits {
   private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage();
   private VendorLicenseManager vendorLicenseManager =
-          VendorLicenseManagerFactory.getInstance().createInterface();
+      VendorLicenseManagerFactory.getInstance().createInterface();
 
   public static final String parent = "EntitlementPool";
 
@@ -45,20 +43,20 @@
     mdcDataDebugMessage.debugEntryMessage("VLM id", vlmId, "EP id", entitlementPoolId);
 
     MdcUtil.initMdc(LoggerServiceName.Create_LIMIT.toString());
-    vendorLicenseManager.getEntitlementPool(new EntitlementPoolEntity(vlmId, Version.valueOf
-            (versionId), entitlementPoolId), user);
+    Version version = new Version(versionId);
+    vendorLicenseManager
+        .getEntitlementPool(new EntitlementPoolEntity(vlmId, version, entitlementPoolId));
 
     LimitEntity limitEntity =
-            new MapLimitRequestDtoToLimitEntity()
-                    .applyMapping(request, LimitEntity.class);
-    limitEntity.setEpLkgId(entitlementPoolId);
+        new MapLimitRequestDtoToLimitEntity().applyMapping(request, LimitEntity.class);
     limitEntity.setVendorLicenseModelId(vlmId);
+    limitEntity.setVersion(version);
+    limitEntity.setEpLkgId(entitlementPoolId);
     limitEntity.setParent(parent);
 
-    LimitEntity createdLimit = vendorLicenseManager.createLimit(limitEntity, user);
+    LimitEntity createdLimit = vendorLicenseManager.createLimit(limitEntity);
     MapLimitEntityToLimitCreationDto mapper = new MapLimitEntityToLimitCreationDto();
-    LimitCreationDto createdLimitDto = mapper.applyMapping(createdLimit, LimitCreationDto
-            .class);
+    LimitCreationDto createdLimitDto = mapper.applyMapping(createdLimit, LimitCreationDto.class);
 
     /*StringWrapperResponse result =
         createdLimit != null ? new StringWrapperResponse(createdLimit.getId())
@@ -67,25 +65,25 @@
     mdcDataDebugMessage.debugExitMessage("VLM id", vlmId, "EP id", entitlementPoolId);
 
     //return Response.ok(result).build();
-    return Response.ok(createdLimitDto != null ? createdLimitDto : null)
-            .build();
+    return Response.ok(createdLimitDto != null ? createdLimitDto : null).build();
   }
 
   @Override
   public Response listLimits(String vlmId, String versionId, String entitlementPoolId, String
-          user) {
+      user) {
     mdcDataDebugMessage.debugEntryMessage("VLM id", vlmId, "EP id", entitlementPoolId);
 
     MdcUtil.initMdc(LoggerServiceName.List_EP.toString());
-    vendorLicenseManager.getEntitlementPool(new EntitlementPoolEntity(vlmId, Version.valueOf
-            (versionId), entitlementPoolId), user);
+    Version version = new Version(versionId);
+    vendorLicenseManager
+        .getEntitlementPool(new EntitlementPoolEntity(vlmId, version, entitlementPoolId));
 
     Collection<LimitEntity> limits =
-            vendorLicenseManager.listLimits(vlmId, Version.valueOf(versionId), entitlementPoolId, user);
+        vendorLicenseManager.listLimits(vlmId, version, entitlementPoolId);
 
     GenericCollectionWrapper<LimitEntityDto> result = new GenericCollectionWrapper<>();
     MapLimitEntityToLimitDto outputMapper =
-            new MapLimitEntityToLimitDto();
+        new MapLimitEntityToLimitDto();
     for (LimitEntity limit : limits) {
       result.add(outputMapper.applyMapping(limit, LimitEntityDto.class));
     }
@@ -96,28 +94,28 @@
   }
 
   @Override
-  public Response getLimit( String vlmId, String versionId, String entitlementPoolId,
-                            String limitId, String user) {
-    mdcDataDebugMessage.debugEntryMessage("VLM id, EP id, Limit Id", vlmId, entitlementPoolId,
-            limitId);
+  public Response getLimit(String vlmId, String versionId, String entitlementPoolId,
+                           String limitId, String user) {
+    mdcDataDebugMessage
+        .debugEntryMessage("VLM id, EP id, Limit Id", vlmId, entitlementPoolId, limitId);
 
     MdcUtil.initMdc(LoggerServiceName.Get_LIMIT.toString());
 
-    vendorLicenseManager.getEntitlementPool(new EntitlementPoolEntity(vlmId, Version.valueOf
-            (versionId), entitlementPoolId), user);
-    LimitEntity epInput = new LimitEntity();
-    epInput.setVendorLicenseModelId(vlmId);
-    epInput.setVersion(Version.valueOf(versionId));
-    epInput.setEpLkgId(entitlementPoolId);
-    epInput.setId(limitId);
-    LimitEntity limit = vendorLicenseManager.getLimit(epInput, user);
+    Version version = new Version(versionId);
+    vendorLicenseManager
+        .getEntitlementPool(new EntitlementPoolEntity(vlmId, version, entitlementPoolId));
+    LimitEntity limitInput = new LimitEntity();
+    limitInput.setVendorLicenseModelId(vlmId);
+    limitInput.setVersion(version);
+    limitInput.setEpLkgId(entitlementPoolId);
+    limitInput.setId(limitId);
+    LimitEntity limit = vendorLicenseManager.getLimit(limitInput);
 
     LimitEntityDto entitlementPoolEntityDto = limit == null ? null :
-            new MapLimitEntityToLimitDto()
-                    .applyMapping(limit, LimitEntityDto.class);
+        new MapLimitEntityToLimitDto().applyMapping(limit, LimitEntityDto.class);
 
-    mdcDataDebugMessage.debugExitMessage("VLM id, EP id, Limit Id", vlmId, entitlementPoolId,
-            limitId);
+    mdcDataDebugMessage
+        .debugExitMessage("VLM id, EP id, Limit Id", vlmId, entitlementPoolId, limitId);
 
     return Response.ok(entitlementPoolEntityDto).build();
   }
@@ -129,26 +127,27 @@
                               String entitlementPoolId,
                               String limitId,
                               String user) {
-    mdcDataDebugMessage.debugEntryMessage("VLM id", vlmId, "EP id", entitlementPoolId, "limit Id",
-            limitId);
+    mdcDataDebugMessage
+        .debugEntryMessage("VLM id", vlmId, "EP id", entitlementPoolId, "limit Id", limitId);
 
     MdcUtil.initMdc(LoggerServiceName.Update_LIMIT.toString());
 
-    vendorLicenseManager.getEntitlementPool(new EntitlementPoolEntity(vlmId, Version.valueOf
-            (versionId), entitlementPoolId), user);
+    Version version = new Version(versionId);
+    vendorLicenseManager
+        .getEntitlementPool(new EntitlementPoolEntity(vlmId, version, entitlementPoolId));
 
     LimitEntity limitEntity =
-            new MapLimitRequestDtoToLimitEntity()
-                    .applyMapping(request, LimitEntity.class);
-    limitEntity.setEpLkgId(entitlementPoolId);
+        new MapLimitRequestDtoToLimitEntity().applyMapping(request, LimitEntity.class);
     limitEntity.setVendorLicenseModelId(vlmId);
+    limitEntity.setVersion(version);
+    limitEntity.setEpLkgId(entitlementPoolId);
     limitEntity.setId(limitId);
     limitEntity.setParent(parent);
 
-    vendorLicenseManager.updateLimit(limitEntity, user);
+    vendorLicenseManager.updateLimit(limitEntity);
 
-    mdcDataDebugMessage.debugExitMessage("VLM id", vlmId, "EP id", entitlementPoolId, "limit Id",
-            limitId);
+    mdcDataDebugMessage
+        .debugExitMessage("VLM id", vlmId, "EP id", entitlementPoolId, "limit Id", limitId);
 
     return Response.ok().build();
   }
@@ -156,29 +155,33 @@
   /**
    * Delete entitlement pool.
    *
-   * @param vlmId               the vlm id
-   * @param entitlementPoolId   the entitlement pool id
-   * @param limitId             the limitId
-   * @param user                the user
+   * @param vlmId             the vlm id
+   * @param entitlementPoolId the entitlement pool id
+   * @param limitId           the limitId
+   * @param user              the user
    * @return the response
    */
   public Response deleteLimit(String vlmId, String versionId, String entitlementPoolId,
                               String limitId, String user) {
-    mdcDataDebugMessage.debugEntryMessage("VLM id, Verison Id, EP id, Limit Id", vlmId, versionId, entitlementPoolId, limitId);
-
+    mdcDataDebugMessage.debugEntryMessage("VLM id, Verison Id, EP id, Limit Id", vlmId, versionId,
+        entitlementPoolId, limitId);
     MdcUtil.initMdc(LoggerServiceName.Delete_LIMIT.toString());
-    vendorLicenseManager.getEntitlementPool(new EntitlementPoolEntity(vlmId, Version.valueOf
-            (versionId), entitlementPoolId), user);
+
+    Version version = new Version(versionId);
+    vendorLicenseManager.getEntitlementPool(
+        new EntitlementPoolEntity(vlmId, version, entitlementPoolId));
 
     LimitEntity limitInput = new LimitEntity();
     limitInput.setVendorLicenseModelId(vlmId);
+    limitInput.setVersion(version);
     limitInput.setEpLkgId(entitlementPoolId);
     limitInput.setId(limitId);
     limitInput.setParent(parent);
 
-    vendorLicenseManager.deleteLimit(limitInput, user);
+    vendorLicenseManager.deleteLimit(limitInput);
 
-    mdcDataDebugMessage.debugExitMessage("VLM id, Verison Id, EP id, Limit Id", vlmId, versionId, entitlementPoolId, limitId);
+    mdcDataDebugMessage.debugExitMessage("VLM id, Verison Id, EP id, Limit Id", vlmId, versionId,
+        entitlementPoolId, limitId);
 
     return Response.ok().build();
   }
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/EntitlementPoolsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/EntitlementPoolsImpl.java
index 120bb3d..8c31303 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/EntitlementPoolsImpl.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/EntitlementPoolsImpl.java
@@ -34,7 +34,6 @@
 import org.openecomp.sdcrests.vendorlicense.types.EntitlementPoolRequestDto;
 import org.openecomp.sdcrests.wrappers.GenericCollectionWrapper;
 import org.openecomp.sdcrests.wrappers.StringWrapperResponse;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Scope;
 import org.springframework.stereotype.Service;
 
@@ -64,7 +63,7 @@
 
     MdcUtil.initMdc(LoggerServiceName.List_EP.toString());
     Collection<EntitlementPoolEntity> entitlementPools =
-        vendorLicenseManager.listEntitlementPools(vlmId, Version.valueOf(versionId), user);
+        vendorLicenseManager.listEntitlementPools(vlmId, new Version(versionId));
 
     GenericCollectionWrapper<EntitlementPoolEntityDto> result = new GenericCollectionWrapper<>();
     MapEntitlementPoolEntityToEntitlementPoolEntityDto outputMapper =
@@ -96,9 +95,10 @@
         new MapEntitlementPoolRequestDtoToEntitlementPoolEntity()
             .applyMapping(request, EntitlementPoolEntity.class);
     entitlementPoolEntity.setVendorLicenseModelId(vlmId);
+    entitlementPoolEntity.setVersion(new Version(versionId));
 
     EntitlementPoolEntity createdEntitlementPool =
-        vendorLicenseManager.createEntitlementPool(entitlementPoolEntity, user);
+        vendorLicenseManager.createEntitlementPool(entitlementPoolEntity);
     StringWrapperResponse result =
         createdEntitlementPool != null ? new StringWrapperResponse(createdEntitlementPool.getId())
             : null;
@@ -127,9 +127,10 @@
         new MapEntitlementPoolRequestDtoToEntitlementPoolEntity()
             .applyMapping(request, EntitlementPoolEntity.class);
     entitlementPoolEntity.setVendorLicenseModelId(vlmId);
+    entitlementPoolEntity.setVersion(new Version(versionId));
     entitlementPoolEntity.setId(entitlementPoolId);
 
-    vendorLicenseManager.updateEntitlementPool(entitlementPoolEntity, user);
+    vendorLicenseManager.updateEntitlementPool(entitlementPoolEntity);
 
     mdcDataDebugMessage.debugExitMessage("VLM id, EP id", vlmId, entitlementPoolId);
 
@@ -140,12 +141,12 @@
    * Gets entitlement pool.
    *
    * @param vlmId             the vlm id
-   * @param version           the version
+   * @param versionId           the version id
    * @param entitlementPoolId the entitlement pool id
    * @param user              the user
    * @return the entitlement pool
    */
-  public Response getEntitlementPool(String vlmId, String version, String entitlementPoolId,
+  public Response getEntitlementPool(String vlmId, String versionId, String entitlementPoolId,
                                      String user) {
 
     mdcDataDebugMessage.debugEntryMessage("VLM id, EP id", vlmId, entitlementPoolId);
@@ -153,9 +154,9 @@
     MdcUtil.initMdc(LoggerServiceName.Get_EP.toString());
     EntitlementPoolEntity epInput = new EntitlementPoolEntity();
     epInput.setVendorLicenseModelId(vlmId);
-    epInput.setVersion(Version.valueOf(version));
+    epInput.setVersion(new Version(versionId));
     epInput.setId(entitlementPoolId);
-    EntitlementPoolEntity entitlementPool = vendorLicenseManager.getEntitlementPool(epInput, user);
+    EntitlementPoolEntity entitlementPool = vendorLicenseManager.getEntitlementPool(epInput);
 
     EntitlementPoolEntityDto entitlementPoolEntityDto = entitlementPool == null ? null :
         new MapEntitlementPoolEntityToEntitlementPoolEntityDto()
@@ -183,7 +184,8 @@
     EntitlementPoolEntity epInput = new EntitlementPoolEntity();
     epInput.setVendorLicenseModelId(vlmId);
     epInput.setId(entitlementPoolId);
-    vendorLicenseManager.deleteEntitlementPool(epInput, user);
+    epInput.setVersion(new Version(versionId));
+    vendorLicenseManager.deleteEntitlementPool(epInput);
 
     mdcDataDebugMessage.debugExitMessage("VLM id, EP id", vlmId, entitlementPoolId);
 
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/FeatureGroupsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/FeatureGroupsImpl.java
index 593ed19..9f87f98 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/FeatureGroupsImpl.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/FeatureGroupsImpl.java
@@ -44,7 +44,6 @@
 import org.openecomp.sdcrests.vendorlicense.types.LicenseKeyGroupEntityDto;
 import org.openecomp.sdcrests.wrappers.GenericCollectionWrapper;
 import org.openecomp.sdcrests.wrappers.StringWrapperResponse;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Scope;
 import org.springframework.stereotype.Service;
 
@@ -69,7 +68,7 @@
 
     MdcUtil.initMdc(LoggerServiceName.List_FG.toString());
     Collection<FeatureGroupEntity> featureGroupEntities =
-        vendorLicenseManager.listFeatureGroups(vlmId, Version.valueOf(versionId), user);
+        vendorLicenseManager.listFeatureGroups(vlmId, new Version(versionId));
 
     MapFeatureGroupEntityToFeatureGroupDescriptorDto outputMapper =
         new MapFeatureGroupEntityToFeatureGroupDescriptorDto();
@@ -101,11 +100,12 @@
     FeatureGroupEntity featureGroupEntity = new MapFeatureGroupDescriptorDtoToFeatureGroupEntity()
         .applyMapping(request, FeatureGroupEntity.class);
     featureGroupEntity.setVendorLicenseModelId(vlmId);
+    featureGroupEntity.setVersion(new Version(versionId));
     featureGroupEntity.setLicenseKeyGroupIds(request.getAddedLicenseKeyGroupsIds());
     featureGroupEntity.setEntitlementPoolIds(request.getAddedEntitlementPoolsIds());
 
     FeatureGroupEntity createdFeatureGroup =
-        vendorLicenseManager.createFeatureGroup(featureGroupEntity, user);
+        vendorLicenseManager.createFeatureGroup(featureGroupEntity);
 
     StringWrapperResponse result =
         createdFeatureGroup != null ? new StringWrapperResponse(createdFeatureGroup.getId()) : null;
@@ -125,12 +125,13 @@
     FeatureGroupEntity featureGroupEntity = new MapFeatureGroupDescriptorDtoToFeatureGroupEntity()
         .applyMapping(request, FeatureGroupEntity.class);
     featureGroupEntity.setVendorLicenseModelId(vlmId);
+    featureGroupEntity.setVersion(new Version(versionId));
     featureGroupEntity.setId(featureGroupId);
 
     vendorLicenseManager
         .updateFeatureGroup(featureGroupEntity, request.getAddedLicenseKeyGroupsIds(),
             request.getRemovedLicenseKeyGroupsIds(), request.getAddedEntitlementPoolsIds(),
-            request.getRemovedEntitlementPoolsIds(), user);
+            request.getRemovedEntitlementPoolsIds());
 
     mdcDataDebugMessage.debugExitMessage("VLM id, FG id", vlmId, featureGroupId);
 
@@ -146,9 +147,9 @@
     MdcUtil.initMdc(LoggerServiceName.Get_FG.toString());
     FeatureGroupEntity fgInput = new FeatureGroupEntity();
     fgInput.setVendorLicenseModelId(vlmId);
-    fgInput.setVersion(Version.valueOf(versionId));
+    fgInput.setVersion(new Version(versionId));
     fgInput.setId(featureGroupId);
-    FeatureGroupModel featureGroupModel = vendorLicenseManager.getFeatureGroupModel(fgInput, user);
+    FeatureGroupModel featureGroupModel = vendorLicenseManager.getFeatureGroupModel(fgInput);
 
     if (featureGroupModel == null) {
       return Response.ok().build();
@@ -197,8 +198,9 @@
     MdcUtil.initMdc(LoggerServiceName.Delete_FG.toString());
     FeatureGroupEntity fgInput = new FeatureGroupEntity();
     fgInput.setVendorLicenseModelId(vlmId);
+    fgInput.setVersion(new Version(versionId));
     fgInput.setId(featureGroupId);
-    vendorLicenseManager.deleteFeatureGroup(fgInput, user);
+    vendorLicenseManager.deleteFeatureGroup(fgInput);
 
     mdcDataDebugMessage.debugExitMessage("VLM id, FG id", vlmId, featureGroupId);
 
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/LicenseAgreementsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/LicenseAgreementsImpl.java
index 60a2d68..210aadc 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/LicenseAgreementsImpl.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/LicenseAgreementsImpl.java
@@ -41,14 +41,13 @@
 import org.openecomp.sdcrests.vendorlicense.types.LicenseAgreementUpdateRequestDto;
 import org.openecomp.sdcrests.wrappers.GenericCollectionWrapper;
 import org.openecomp.sdcrests.wrappers.StringWrapperResponse;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Scope;
 import org.springframework.stereotype.Service;
 
-import java.util.Collection;
-import java.util.HashSet;
 import javax.inject.Named;
 import javax.ws.rs.core.Response;
+import java.util.Collection;
+import java.util.HashSet;
 
 @Named
 @Service("licenseAgreements")
@@ -62,9 +61,9 @@
   /**
    * List license agreements response.
    *
-   * @param vlmId   the vlm id
+   * @param vlmId     the vlm id
    * @param versionId the version
-   * @param user    the user
+   * @param user      the user
    * @return the response
    */
   public Response listLicenseAgreements(String vlmId, String versionId, String user) {
@@ -73,7 +72,7 @@
 
     MdcUtil.initMdc(LoggerServiceName.List_LA.toString());
     Collection<LicenseAgreementEntity> licenseAgreements =
-        vendorLicenseManager.listLicenseAgreements(vlmId, Version.valueOf(versionId), user);
+        vendorLicenseManager.listLicenseAgreements(vlmId, new Version(versionId));
 
     GenericCollectionWrapper<LicenseAgreementEntityDto> results = new GenericCollectionWrapper<>();
     MapLicenseAgreementEntityToLicenseAgreementDescriptorDto outputMapper =
@@ -100,7 +99,7 @@
    * @return the response
    */
   public Response createLicenseAgreement(LicenseAgreementRequestDto request, String vlmId,
-                                         String versionId,String user) {
+                                         String versionId, String user) {
 
     mdcDataDebugMessage.debugEntryMessage("VLM id", vlmId);
 
@@ -109,11 +108,11 @@
         new MapLicenseAgreementDescriptorDtoToLicenseAgreementEntity()
             .applyMapping(request, LicenseAgreementEntity.class);
     licenseAgreementEntity.setVendorLicenseModelId(vlmId);
-    licenseAgreementEntity.setVersion(Version.valueOf(versionId));
+    licenseAgreementEntity.setVersion(new Version(versionId));
     licenseAgreementEntity.setFeatureGroupIds(request.getAddedFeatureGroupsIds());
 
     LicenseAgreementEntity createdLicenseAgreement =
-        vendorLicenseManager.createLicenseAgreement(licenseAgreementEntity, user);
+        vendorLicenseManager.createLicenseAgreement(licenseAgreementEntity);
     StringWrapperResponse result =
         createdLicenseAgreement != null ? new StringWrapperResponse(createdLicenseAgreement.getId())
             : null;
@@ -133,7 +132,7 @@
    * @return the response
    */
   public Response updateLicenseAgreement(LicenseAgreementUpdateRequestDto request, String vlmId,
-                                         String versionId,String licenseAgreementId, String user) {
+                                         String versionId, String licenseAgreementId, String user) {
 
     mdcDataDebugMessage.debugEntryMessage("VLM id, LA id", vlmId, licenseAgreementId);
 
@@ -142,12 +141,12 @@
         new MapLicenseAgreementDescriptorDtoToLicenseAgreementEntity()
             .applyMapping(request, LicenseAgreementEntity.class);
     licenseAgreementEntity.setVendorLicenseModelId(vlmId);
-    licenseAgreementEntity.setVersion(Version.valueOf(versionId));
+    licenseAgreementEntity.setVersion(new Version(versionId));
     licenseAgreementEntity.setId(licenseAgreementId);
 
     vendorLicenseManager
         .updateLicenseAgreement(licenseAgreementEntity, request.getAddedFeatureGroupsIds(),
-            request.getRemovedFeatureGroupsIds(), user);
+            request.getRemovedFeatureGroupsIds());
 
     mdcDataDebugMessage.debugExitMessage("VLM id, LA id", vlmId, licenseAgreementId);
 
@@ -158,7 +157,7 @@
    * Gets license agreement.
    *
    * @param vlmId              the vlm id
-   * @param versionId            the version
+   * @param versionId          the version
    * @param licenseAgreementId the license agreement id
    * @param user               the user
    * @return the license agreement
@@ -170,7 +169,7 @@
 
     MdcUtil.initMdc(LoggerServiceName.Get_LA.toString());
     LicenseAgreementModel licenseAgreementModel = vendorLicenseManager
-        .getLicenseAgreementModel(vlmId, Version.valueOf(versionId), licenseAgreementId, user);
+        .getLicenseAgreementModel(vlmId, new Version(versionId), licenseAgreementId);
 
     if (licenseAgreementModel == null) {
       return Response.ok().build();
@@ -206,18 +205,18 @@
    * Delete license agreement response.
    *
    * @param vlmId              the vlm id
-   * @param versionId           the version id
-                               * @param licenseAgreementId the license agreement id
+   * @param versionId          the version id
+   * @param licenseAgreementId the license agreement id
    * @param user               the user
    * @return the response
    */
-  public Response deleteLicenseAgreement(String vlmId,String versionId, String licenseAgreementId,
+  public Response deleteLicenseAgreement(String vlmId, String versionId, String licenseAgreementId,
                                          String user) {
 
     mdcDataDebugMessage.debugEntryMessage("VLM id, LA id", vlmId, licenseAgreementId);
 
     MdcUtil.initMdc(LoggerServiceName.Delete_LA.toString());
-    vendorLicenseManager.deleteLicenseAgreement(vlmId, Version.valueOf(versionId), licenseAgreementId, user);
+    vendorLicenseManager.deleteLicenseAgreement(vlmId, new Version(versionId), licenseAgreementId);
 
     mdcDataDebugMessage.debugExitMessage("VLM id, LA id", vlmId, licenseAgreementId);
 
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/LicenseKeyGroupLimitsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/LicenseKeyGroupLimitsImpl.java
index bedbc92..3aef837 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/LicenseKeyGroupLimitsImpl.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/LicenseKeyGroupLimitsImpl.java
@@ -16,14 +16,12 @@
 import org.openecomp.sdcrests.vendorlicense.types.LimitEntityDto;
 import org.openecomp.sdcrests.vendorlicense.types.LimitRequestDto;
 import org.openecomp.sdcrests.wrappers.GenericCollectionWrapper;
-import org.openecomp.sdcrests.wrappers.StringWrapperResponse;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Scope;
 import org.springframework.stereotype.Service;
 
-import java.util.Collection;
 import javax.inject.Named;
 import javax.ws.rs.core.Response;
+import java.util.Collection;
 
 @Named
 @Service("licenseKeyGroupLimits")
@@ -32,10 +30,11 @@
 
   private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage();
   private VendorLicenseManager vendorLicenseManager =
-          VendorLicenseManagerFactory.getInstance().createInterface();
+      VendorLicenseManagerFactory.getInstance().createInterface();
 
   public static final String parent = "LicenseKeyGroup";
 
+
   @Override
   public Response createLimit(LimitRequestDto request,
                               String vlmId,
@@ -46,20 +45,20 @@
     mdcDataDebugMessage.debugEntryMessage("VLM id", vlmId, "LKG id", licenseKeyGroupId);
 
     MdcUtil.initMdc(LoggerServiceName.Create_LIMIT.toString());
-    vendorLicenseManager.getLicenseKeyGroup(new LicenseKeyGroupEntity(vlmId, Version.valueOf
-            (versionId), licenseKeyGroupId), user);
+    Version version = new Version(versionId);
+    vendorLicenseManager.getLicenseKeyGroup(
+        new LicenseKeyGroupEntity(vlmId, version, licenseKeyGroupId));
 
     LimitEntity limitEntity =
-            new MapLimitRequestDtoToLimitEntity()
-                    .applyMapping(request, LimitEntity.class);
-    limitEntity.setEpLkgId(licenseKeyGroupId);
+        new MapLimitRequestDtoToLimitEntity().applyMapping(request, LimitEntity.class);
     limitEntity.setVendorLicenseModelId(vlmId);
+    limitEntity.setVersion(version);
+    limitEntity.setEpLkgId(licenseKeyGroupId);
     limitEntity.setParent(parent);
 
-    LimitEntity createdLimit = vendorLicenseManager.createLimit(limitEntity, user);
+    LimitEntity createdLimit = vendorLicenseManager.createLimit(limitEntity);
     MapLimitEntityToLimitCreationDto mapper = new MapLimitEntityToLimitCreationDto();
-    LimitCreationDto createdLimitDto = mapper.applyMapping(createdLimit, LimitCreationDto
-            .class);
+    LimitCreationDto createdLimitDto = mapper.applyMapping(createdLimit, LimitCreationDto.class);
     /*StringWrapperResponse result =
         createdLimit != null ? new StringWrapperResponse(createdLimit.getId())
             : null;*/
@@ -67,25 +66,25 @@
     mdcDataDebugMessage.debugExitMessage("VLM id", vlmId, "LKG id", licenseKeyGroupId);
 
     //return Response.ok(result).build();
-    return Response.ok(createdLimitDto != null ? createdLimitDto : null)
-            .build();
+    return Response.ok(createdLimitDto != null ? createdLimitDto : null).build();
   }
 
   @Override
-  public Response listLimits(String vlmId, String versionId, String licenseKeyGroupId, String
-          user) {
+  public Response listLimits(String vlmId, String versionId, String licenseKeyGroupId,
+                             String user) {
     mdcDataDebugMessage.debugEntryMessage("VLM id", vlmId, "LKG id", licenseKeyGroupId);
 
     MdcUtil.initMdc(LoggerServiceName.List_EP.toString());
-    vendorLicenseManager.getLicenseKeyGroup(new LicenseKeyGroupEntity(vlmId, Version.valueOf
-            (versionId), licenseKeyGroupId), user);
+    Version version = new Version(versionId);
+    vendorLicenseManager
+        .getLicenseKeyGroup(new LicenseKeyGroupEntity(vlmId, version, licenseKeyGroupId));
 
     Collection<LimitEntity> limits =
-            vendorLicenseManager.listLimits(vlmId, Version.valueOf(versionId), licenseKeyGroupId, user);
+        vendorLicenseManager.listLimits(vlmId, version, licenseKeyGroupId);
 
     GenericCollectionWrapper<LimitEntityDto> result = new GenericCollectionWrapper<>();
     MapLimitEntityToLimitDto outputMapper =
-            new MapLimitEntityToLimitDto();
+        new MapLimitEntityToLimitDto();
     for (LimitEntity limit : limits) {
       result.add(outputMapper.applyMapping(limit, LimitEntityDto.class));
     }
@@ -103,25 +102,26 @@
                               String limitId,
                               String user) {
     mdcDataDebugMessage.debugEntryMessage("VLM id", vlmId, "LKG id", licenseKeyGroupId, "limit Id",
-            limitId);
+        limitId);
 
     MdcUtil.initMdc(LoggerServiceName.Update_LIMIT.toString());
 
-    vendorLicenseManager.getLicenseKeyGroup(new LicenseKeyGroupEntity(vlmId, Version.valueOf
-            (versionId), licenseKeyGroupId), user);
+    Version version = new Version(versionId);
+    vendorLicenseManager
+        .getLicenseKeyGroup(new LicenseKeyGroupEntity(vlmId, version, licenseKeyGroupId));
 
     LimitEntity limitEntity =
-            new MapLimitRequestDtoToLimitEntity()
-                    .applyMapping(request, LimitEntity.class);
-    limitEntity.setEpLkgId(licenseKeyGroupId);
+        new MapLimitRequestDtoToLimitEntity().applyMapping(request, LimitEntity.class);
     limitEntity.setVendorLicenseModelId(vlmId);
+    limitEntity.setVersion(version);
+    limitEntity.setEpLkgId(licenseKeyGroupId);
     limitEntity.setId(limitId);
     limitEntity.setParent(parent);
 
-    vendorLicenseManager.updateLimit(limitEntity, user);
+    vendorLicenseManager.updateLimit(limitEntity);
 
-    mdcDataDebugMessage.debugExitMessage("VLM id", vlmId, "LKG id", licenseKeyGroupId, "limit Id",
-            limitId);
+    mdcDataDebugMessage
+        .debugExitMessage("VLM id", vlmId, "LKG id", licenseKeyGroupId, "limit Id", limitId);
 
     return Response.ok().build();
   }
@@ -129,57 +129,59 @@
   /**
    * Delete License Key Group.
    *
-   * @param vlmId               the vlm id
-   * @param licenseKeyGroupId   the license Key Group id
-   * @param limitId             the limitId
-   * @param user                the user
+   * @param vlmId             the vlm id
+   * @param licenseKeyGroupId the license Key Group id
+   * @param limitId           the limitId
+   * @param user              the user
    * @return the response
    */
   public Response deleteLimit(String vlmId, String versionId, String licenseKeyGroupId,
                               String limitId, String user) {
     mdcDataDebugMessage.debugEntryMessage("VLM id, Verison Id, LKG id, Limit Id", vlmId, versionId,
-            licenseKeyGroupId, limitId);
-
+        licenseKeyGroupId, limitId);
     MdcUtil.initMdc(LoggerServiceName.Delete_LIMIT.toString());
-    vendorLicenseManager.getLicenseKeyGroup(new LicenseKeyGroupEntity(vlmId, Version.valueOf
-            (versionId), licenseKeyGroupId), user);
+
+    Version version = new Version(versionId);
+    vendorLicenseManager
+        .getLicenseKeyGroup(new LicenseKeyGroupEntity(vlmId, version, licenseKeyGroupId));
 
     LimitEntity limitInput = new LimitEntity();
     limitInput.setVendorLicenseModelId(vlmId);
+    limitInput.setVersion(version);
     limitInput.setEpLkgId(licenseKeyGroupId);
     limitInput.setId(limitId);
     limitInput.setParent(parent);
 
-    vendorLicenseManager.deleteLimit(limitInput, user);
+    vendorLicenseManager.deleteLimit(limitInput);
 
     mdcDataDebugMessage.debugExitMessage("VLM id, Verison Id, LKG id, Limit Id", vlmId, versionId,
-            licenseKeyGroupId, limitId);
+        licenseKeyGroupId, limitId);
 
     return Response.ok().build();
   }
 
   @Override
-  public Response getLimit( String vlmId, String versionId, String licenseKeyGroupId,
-                            String limitId, String user) {
+  public Response getLimit(String vlmId, String versionId, String licenseKeyGroupId,
+                           String limitId, String user) {
     mdcDataDebugMessage.debugEntryMessage("VLM id, LKG id, Limit Id", vlmId, licenseKeyGroupId,
-            limitId);
+        limitId);
 
     MdcUtil.initMdc(LoggerServiceName.Get_LIMIT.toString());
-    vendorLicenseManager.getLicenseKeyGroup(new LicenseKeyGroupEntity(vlmId, Version.valueOf
-            (versionId), licenseKeyGroupId), user);
-    LimitEntity epInput = new LimitEntity();
-    epInput.setVendorLicenseModelId(vlmId);
-    epInput.setVersion(Version.valueOf(versionId));
-    epInput.setEpLkgId(licenseKeyGroupId);
-    epInput.setId(limitId);
-    LimitEntity limit = vendorLicenseManager.getLimit(epInput, user);
+    Version version = new Version(versionId);
+    vendorLicenseManager
+        .getLicenseKeyGroup(new LicenseKeyGroupEntity(vlmId, version, licenseKeyGroupId));
+    LimitEntity limitInput = new LimitEntity();
+    limitInput.setVendorLicenseModelId(vlmId);
+    limitInput.setVersion(version);
+    limitInput.setEpLkgId(licenseKeyGroupId);
+    limitInput.setId(limitId);
+    LimitEntity limit = vendorLicenseManager.getLimit(limitInput);
 
-    LimitEntityDto entitlementPoolEntityDto = limit == null ? null :
-            new MapLimitEntityToLimitDto()
-                    .applyMapping(limit, LimitEntityDto.class);
+    LimitEntityDto entitlementPoolEntityDto = limit == null ? null
+        : new MapLimitEntityToLimitDto().applyMapping(limit, LimitEntityDto.class);
 
-    mdcDataDebugMessage.debugExitMessage("VLM id, LKG id, Limit Id", vlmId, licenseKeyGroupId,
-            limitId);
+    mdcDataDebugMessage
+        .debugExitMessage("VLM id, LKG id, Limit Id", vlmId, licenseKeyGroupId, limitId);
 
     return Response.ok(entitlementPoolEntityDto).build();
   }
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/LicenseKeyGroupsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/LicenseKeyGroupsImpl.java
index 4c4bf13..6fe33d7 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/LicenseKeyGroupsImpl.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/LicenseKeyGroupsImpl.java
@@ -34,7 +34,6 @@
 import org.openecomp.sdcrests.vendorlicense.types.LicenseKeyGroupRequestDto;
 import org.openecomp.sdcrests.wrappers.GenericCollectionWrapper;
 import org.openecomp.sdcrests.wrappers.StringWrapperResponse;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Scope;
 import org.springframework.stereotype.Service;
 import org.springframework.validation.annotation.Validated;
@@ -67,7 +66,7 @@
 
     MdcUtil.initMdc(LoggerServiceName.List_LKG.toString());
     Collection<LicenseKeyGroupEntity> licenseKeyGroups =
-        vendorLicenseManager.listLicenseKeyGroups(vlmId, Version.valueOf(versionId), user);
+        vendorLicenseManager.listLicenseKeyGroups(vlmId, new Version(versionId));
 
     GenericCollectionWrapper<LicenseKeyGroupEntityDto> result = new GenericCollectionWrapper<>();
     MapLicenseKeyGroupEntityToLicenseKeyGroupEntityDto outputMapper =
@@ -99,9 +98,10 @@
         new MapLicenseKeyGroupRequestDtoToLicenseKeyGroupEntity()
             .applyMapping(request, LicenseKeyGroupEntity.class);
     licenseKeyGroupEntity.setVendorLicenseModelId(vlmId);
+    licenseKeyGroupEntity.setVersion(new Version(versionId));
 
     LicenseKeyGroupEntity createdLicenseKeyGroup =
-        vendorLicenseManager.createLicenseKeyGroup(licenseKeyGroupEntity, user);
+        vendorLicenseManager.createLicenseKeyGroup(licenseKeyGroupEntity);
     StringWrapperResponse result =
         createdLicenseKeyGroup != null ? new StringWrapperResponse(createdLicenseKeyGroup.getId())
             : null;
@@ -131,9 +131,10 @@
         new MapLicenseKeyGroupRequestDtoToLicenseKeyGroupEntity()
             .applyMapping(request, LicenseKeyGroupEntity.class);
     licenseKeyGroupEntity.setVendorLicenseModelId(vlmId);
+    licenseKeyGroupEntity.setVersion(new Version(versionId));
     licenseKeyGroupEntity.setId(licenseKeyGroupId);
 
-    vendorLicenseManager.updateLicenseKeyGroup(licenseKeyGroupEntity, user);
+    vendorLicenseManager.updateLicenseKeyGroup(licenseKeyGroupEntity);
 
     mdcDataDebugMessage.debugExitMessage("VLM id, LKG id", vlmId, licenseKeyGroupId);
 
@@ -157,9 +158,9 @@
     MdcUtil.initMdc(LoggerServiceName.Get_LKG.toString());
     LicenseKeyGroupEntity lkgInput = new LicenseKeyGroupEntity();
     lkgInput.setVendorLicenseModelId(vlmId);
-    lkgInput.setVersion(Version.valueOf(versionId));
+    lkgInput.setVersion(new Version(versionId));
     lkgInput.setId(licenseKeyGroupId);
-    LicenseKeyGroupEntity licenseKeyGroup = vendorLicenseManager.getLicenseKeyGroup(lkgInput, user);
+    LicenseKeyGroupEntity licenseKeyGroup = vendorLicenseManager.getLicenseKeyGroup(lkgInput);
 
     LicenseKeyGroupEntityDto licenseKeyGroupEntityDto = licenseKeyGroup == null ? null :
         new MapLicenseKeyGroupEntityToLicenseKeyGroupEntityDto()
@@ -186,8 +187,9 @@
     MdcUtil.initMdc(LoggerServiceName.Delete_LKG.toString());
     LicenseKeyGroupEntity lkgInput = new LicenseKeyGroupEntity();
     lkgInput.setVendorLicenseModelId(vlmId);
+    lkgInput.setVersion(new Version(versionId));
     lkgInput.setId(licenseKeyGroupId);
-    vendorLicenseManager.deleteLicenseKeyGroup(lkgInput, user);
+    vendorLicenseManager.deleteLicenseKeyGroup(lkgInput);
 
     mdcDataDebugMessage.debugExitMessage("VLM id, LKG id", vlmId, licenseKeyGroupId);
 
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/VendorLicenseModelsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/VendorLicenseModelsImpl.java
index 6d88e4c..2b8e5a3 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/VendorLicenseModelsImpl.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/VendorLicenseModelsImpl.java
@@ -20,37 +20,67 @@
 
 package org.openecomp.sdcrests.vendorlicense.rest.services;
 
+import org.openecomp.core.util.UniqueValueUtil;
+import org.openecomp.sdc.activitylog.ActivityLogManager;
+import org.openecomp.sdc.activitylog.ActivityLogManagerFactory;
+import org.openecomp.sdc.activitylog.dao.type.ActivityLogEntity;
+import org.openecomp.sdc.activitylog.dao.type.ActivityType;
+import org.openecomp.sdc.common.errors.Messages;
+import org.openecomp.sdc.datatypes.model.ItemType;
+import org.openecomp.sdc.healing.factory.HealingManagerFactory;
+import org.openecomp.sdc.itempermissions.ItemPermissionsManager;
+import org.openecomp.sdc.itempermissions.ItemPermissionsManagerFactory;
+import org.openecomp.sdc.itempermissions.impl.types.PermissionTypes;
 import org.openecomp.sdc.logging.api.Logger;
 import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.openecomp.sdc.logging.context.MdcUtil;
 import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage;
 import org.openecomp.sdc.logging.messages.AuditMessages;
-import org.openecomp.sdc.logging.types.LoggerConstants;
 import org.openecomp.sdc.logging.types.LoggerServiceName;
+import org.openecomp.sdc.notification.dtos.Event;
+import org.openecomp.sdc.notification.factories.NotificationPropagationManagerFactory;
+import org.openecomp.sdc.notification.services.NotificationPropagationManager;
+import org.openecomp.sdc.vendorlicense.VendorLicenseConstants;
 import org.openecomp.sdc.vendorlicense.VendorLicenseManager;
 import org.openecomp.sdc.vendorlicense.VendorLicenseManagerFactory;
 import org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity;
-import org.openecomp.sdc.vendorlicense.types.VersionedVendorLicenseModel;
-import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductManager;
-import org.openecomp.sdc.vendorsoftwareproduct.VspManagerFactory;
+import org.openecomp.sdc.versioning.ItemManager;
+import org.openecomp.sdc.versioning.ItemManagerFactory;
+import org.openecomp.sdc.versioning.VersioningManager;
+import org.openecomp.sdc.versioning.VersioningManagerFactory;
 import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.versioning.dao.types.VersionStatus;
+import org.openecomp.sdc.versioning.types.Item;
+import org.openecomp.sdc.versioning.types.NotificationEventTypes;
+import org.openecomp.sdcrests.item.rest.mapping.MapItemToDto;
+import org.openecomp.sdcrests.item.rest.mapping.MapVersionToDto;
+import org.openecomp.sdcrests.item.types.ItemCreationDto;
+import org.openecomp.sdcrests.item.types.ItemDto;
+import org.openecomp.sdcrests.item.types.VersionDto;
 import org.openecomp.sdcrests.vendorlicense.rest.VendorLicenseModels;
+import org.openecomp.sdcrests.vendorlicense.rest.mapping.MapVendorLicenseModelEntityToDto;
 import org.openecomp.sdcrests.vendorlicense.rest.mapping.MapVendorLicenseModelRequestDtoToVendorLicenseModelEntity;
-import org.openecomp.sdcrests.vendorlicense.rest.mapping.MapVersionedVendorLicenseModelToVendorLicenseModelEntityDto;
 import org.openecomp.sdcrests.vendorlicense.types.VendorLicenseModelActionRequestDto;
 import org.openecomp.sdcrests.vendorlicense.types.VendorLicenseModelEntityDto;
 import org.openecomp.sdcrests.vendorlicense.types.VendorLicenseModelRequestDto;
 import org.openecomp.sdcrests.wrappers.GenericCollectionWrapper;
-import org.openecomp.sdcrests.wrappers.StringWrapperResponse;
-import org.slf4j.MDC;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Scope;
 import org.springframework.stereotype.Service;
 import org.springframework.validation.annotation.Validated;
 
 import javax.inject.Named;
 import javax.ws.rs.core.Response;
-import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Optional;
+import java.util.function.Predicate;
+
+import static org.openecomp.sdc.itempermissions.notifications.NotificationConstants.PERMISSION_USER;
+import static org.openecomp.sdc.versioning.VersioningNotificationConstansts.ITEM_ID;
+import static org.openecomp.sdc.versioning.VersioningNotificationConstansts.ITEM_NAME;
+import static org.openecomp.sdc.versioning.VersioningNotificationConstansts.SUBMIT_DESCRIPTION;
+import static org.openecomp.sdc.versioning.VersioningNotificationConstansts.VERSION_ID;
+import static org.openecomp.sdc.versioning.VersioningNotificationConstansts.VERSION_NAME;
 
 @Named
 @Service("vendorLicenseModels")
@@ -59,140 +89,248 @@
 public class VendorLicenseModelsImpl implements VendorLicenseModels {
 
   private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage();
+  private static final Logger logger = LoggerFactory.getLogger(VendorLicenseModelsImpl.class);
+  public static final String SUBMIT_ITEM = "Submit_Item";
 
+  private ItemPermissionsManager permissionsManager = ItemPermissionsManagerFactory.getInstance()
+      .createInterface();
+  private NotificationPropagationManager notifier =
+      NotificationPropagationManagerFactory.getInstance().createInterface();
+
+  private ItemManager itemManager = ItemManagerFactory.getInstance().createInterface();
+  private VersioningManager versioningManager =
+      VersioningManagerFactory.getInstance().createInterface();
   private VendorLicenseManager vendorLicenseManager =
       VendorLicenseManagerFactory.getInstance().createInterface();
+  private ActivityLogManager activityLogManager =
+      ActivityLogManagerFactory.getInstance().createInterface();
 
-  private static final Logger logger =
-          LoggerFactory.getLogger(VendorLicenseModelsImpl.class);
+  @Override
+  public Response listLicenseModels(String versionStatus, String user) {
+    mdcDataDebugMessage.debugEntryMessage(null);
+    MdcUtil.initMdc(LoggerServiceName.List_VLM.toString());
 
-    @Override
-    public Response listLicenseModels(String versionFilter, String user) {
+    Predicate<Item> itemPredicate;
+    if (VersionStatus.Certified.name().equals(versionStatus)) {
+      itemPredicate = item -> ItemType.vlm.name().equals(item.getType()) &&
+          item.getVersionStatusCounters().containsKey(VersionStatus.Certified);
 
-        mdcDataDebugMessage.debugEntryMessage(null, null);
-        MdcUtil.initMdc(LoggerServiceName.List_VLM.toString());
-        Collection<VersionedVendorLicenseModel> versionedVendorLicenseModels =
-                vendorLicenseManager.listVendorLicenseModels(versionFilter, user);
+    } else if (VersionStatus.Draft.name().equals(versionStatus)) {
+      itemPredicate = item -> ItemType.vlm.name().equals(item.getType()) &&
+          item.getVersionStatusCounters().containsKey(VersionStatus.Draft) &&
+          userHasPermission(item.getId(), user);
 
-        GenericCollectionWrapper<VendorLicenseModelEntityDto> results =
-                new GenericCollectionWrapper<>();
-        MapVersionedVendorLicenseModelToVendorLicenseModelEntityDto outputMapper =
-                new MapVersionedVendorLicenseModelToVendorLicenseModelEntityDto();
-        for (VersionedVendorLicenseModel versionedVlm : versionedVendorLicenseModels) {
-            results.add(outputMapper.applyMapping(versionedVlm, VendorLicenseModelEntityDto.class));
-        }
-
-        mdcDataDebugMessage.debugExitMessage(null, null);
-
-        return Response.ok(results).build();
+    } else {
+      itemPredicate = item -> ItemType.vlm.name().equals(item.getType());
     }
 
-    @Override
-    public Response createLicenseModel(VendorLicenseModelRequestDto request, String user) {
+    GenericCollectionWrapper<ItemDto> results = new GenericCollectionWrapper<>();
+    MapItemToDto mapper = new MapItemToDto();
+    itemManager.list(itemPredicate).stream()
+        .sorted((o1, o2) -> o2.getModificationTime().compareTo(o1.getModificationTime()))
+        .forEach(vspItem -> results.add(mapper.applyMapping(vspItem, ItemDto.class)));
 
-        mdcDataDebugMessage.debugEntryMessage(null, null);
+    mdcDataDebugMessage.debugExitMessage(null);
+    return Response.ok(results).build();
+  }
 
-    logger.audit(AuditMessages.AUDIT_MSG + AuditMessages.CREATE_VLM
-            + request.getVendorName());
-
+  @Override
+  public Response createLicenseModel(VendorLicenseModelRequestDto request, String user) {
+    mdcDataDebugMessage.debugEntryMessage(null);
+    logger.audit(AuditMessages.AUDIT_MSG + AuditMessages.CREATE_VLM + request.getVendorName());
     MdcUtil.initMdc(LoggerServiceName.Create_VLM.toString());
-    VendorLicenseModelEntity vendorLicenseModelEntity =
+
+    Item item = new Item();
+    item.setType(ItemType.vlm.name());
+    item.setName(request.getVendorName());
+    item.setDescription(request.getDescription());
+
+    UniqueValueUtil
+        .validateUniqueValue(VendorLicenseConstants.UniqueValues.VENDOR_NAME, item.getName());
+    item = itemManager.create(item);
+    UniqueValueUtil
+        .createUniqueValue(VendorLicenseConstants.UniqueValues.VENDOR_NAME, item.getName());
+
+    Version version = versioningManager.create(item.getId(), new Version(), null);
+
+    VendorLicenseModelEntity vlm = new MapVendorLicenseModelRequestDtoToVendorLicenseModelEntity()
+        .applyMapping(request, VendorLicenseModelEntity.class);
+    vlm.setId(item.getId());
+    vlm.setVersion(version);
+
+    vendorLicenseManager.createVendorLicenseModel(vlm);
+    versioningManager.publish(item.getId(), version, "Initial vlm:" + vlm.getVendorName());
+
+    ItemCreationDto itemCreationDto = new ItemCreationDto();
+    itemCreationDto.setItemId(item.getId());
+    itemCreationDto.setVersion(new MapVersionToDto().applyMapping(version, VersionDto.class));
+
+    activityLogManager.logActivity(new ActivityLogEntity(vlm.getId(), version,
+        ActivityType.Create, user, true, "", ""));
+
+    mdcDataDebugMessage.debugExitMessage(null);
+    return Response.ok(itemCreationDto).build();
+  }
+
+  @Override
+  public Response updateLicenseModel(VendorLicenseModelRequestDto request, String vlmId,
+                                     String versionId, String user) {
+    mdcDataDebugMessage.debugEntryMessage("VLM id", vlmId);
+    MdcUtil.initMdc(LoggerServiceName.Update_VLM.toString());
+
+    VendorLicenseModelEntity vlm =
         new MapVendorLicenseModelRequestDtoToVendorLicenseModelEntity()
             .applyMapping(request, VendorLicenseModelEntity.class);
-    VendorLicenseModelEntity createdVendorLicenseModel =
-        vendorLicenseManager.createVendorLicenseModel(vendorLicenseModelEntity, user);
-    StringWrapperResponse result = createdVendorLicenseModel != null ? new StringWrapperResponse(
-        createdVendorLicenseModel.getId()) : null;
+    vlm.setId(vlmId);
+    vlm.setVersion(new Version(versionId));
 
-        mdcDataDebugMessage.debugExitMessage(null, null);
+    vendorLicenseManager.updateVendorLicenseModel(vlm);
 
-        return Response.ok(result).build();
+    mdcDataDebugMessage.debugExitMessage("VLM id", vlmId);
+    return Response.ok().build();
+  }
+
+  @Override
+  public Response getLicenseModel(String vlmId, String versionId, String user) {
+    mdcDataDebugMessage.debugEntryMessage("VLM id", vlmId);
+    MdcUtil.initMdc(LoggerServiceName.Get_VLM.toString());
+
+    Version version = versioningManager.get(vlmId, new Version(versionId));
+    VendorLicenseModelEntity vlm = vendorLicenseManager.getVendorLicenseModel(vlmId, version);
+    vlm.setWritetimeMicroSeconds(version.getModificationTime().getTime());
+
+    try {
+      Optional<Version> healedVersion = HealingManagerFactory.getInstance().createInterface()
+          .healItemVersion(vlmId, version, ItemType.vlm, false);
+      healedVersion.ifPresent(vlm::setVersion);
+
+      if (healedVersion.isPresent() && version.getStatus() == VersionStatus.Certified) {
+        try {
+          submit(vlmId, healedVersion.get(), "Submit after heal", user);
+        } catch (Exception ex) {
+          logger.error("VLM Id {}: Error while submitting version {} " +
+                  "created based on Certified version {} for healing purpose.",
+              vlmId, healedVersion.get().getId(), versionId, ex.getMessage());
+        }
+      }
+    } catch (Exception e) {
+      logger.error(String.format("Error while auto healing VLM with Id %s and version %s: %s",
+          vlmId, versionId, e.getMessage()));
     }
 
-    @Override
-    public Response updateLicenseModel(VendorLicenseModelRequestDto request, String vlmId,
-                                       String versionId, String user) {
+    VendorLicenseModelEntityDto vlmDto =
+        new MapVendorLicenseModelEntityToDto().applyMapping(vlm, VendorLicenseModelEntityDto.class);
 
-        mdcDataDebugMessage.debugEntryMessage("VLM id", vlmId);
+    mdcDataDebugMessage.debugExitMessage("VLM id", vlmId);
+    return Response.ok(vlmDto).build();
+  }
 
-        MdcUtil.initMdc(LoggerServiceName.Update_VLM.toString());
-        VendorLicenseModelEntity vendorLicenseModelEntity =
-                new MapVendorLicenseModelRequestDtoToVendorLicenseModelEntity()
-                        .applyMapping(request, VendorLicenseModelEntity.class);
-        vendorLicenseModelEntity.setId(vlmId);
+  @Override
+  public Response deleteLicenseModel(String vlmId, String versionId, String user) {
+    mdcDataDebugMessage.debugEntryMessage("VLM id", vlmId);
 
-        vendorLicenseManager.updateVendorLicenseModel(vendorLicenseModelEntity, user);
+    MdcUtil.initMdc(LoggerServiceName.Delete_VLM.toString());
+    vendorLicenseManager.deleteVendorLicenseModel(vlmId, new Version(versionId));
 
-        mdcDataDebugMessage.debugExitMessage("VLM id", vlmId);
+    mdcDataDebugMessage.debugExitMessage("VLM id", vlmId);
 
-        return Response.ok().build();
-    }
+    return Response.ok().build();
+  }
 
-    @Override
-    public Response getLicenseModel(String vlmId, String versionId, String user) {
-
-        mdcDataDebugMessage.debugEntryMessage("VLM id", vlmId);
-
-        MdcUtil.initMdc(LoggerServiceName.Get_VLM.toString());
-        VersionedVendorLicenseModel versionedVlm =
-                vendorLicenseManager.getVendorLicenseModel(vlmId, Version.valueOf(versionId), user);
-
-        VendorLicenseModelEntityDto vlmDto = versionedVlm == null ? null :
-                new MapVersionedVendorLicenseModelToVendorLicenseModelEntityDto()
-                        .applyMapping(versionedVlm, VendorLicenseModelEntityDto.class);
-
-        mdcDataDebugMessage.debugExitMessage("VLM id", vlmId);
-
-        return Response.ok(vlmDto).build();
-    }
-
-    @Override
-    public Response deleteLicenseModel(String vlmId, String versionId, String user) {
-
-        mdcDataDebugMessage.debugEntryMessage("VLM id", vlmId);
-
-        MdcUtil.initMdc(LoggerServiceName.Delete_VLM.toString());
-        vendorLicenseManager.deleteVendorLicenseModel(vlmId, user);
-
-        mdcDataDebugMessage.debugExitMessage("VLM id", vlmId);
-
-        return Response.ok().build();
-    }
-
-    @Override
-    public Response actOnLicenseModel(VendorLicenseModelActionRequestDto request, String vlmId,
-                                      String versionId, String user) {
+  @Override
+  public Response actOnLicenseModel(VendorLicenseModelActionRequestDto request, String vlmId,
+                                    String versionId, String user) {
+    Version version = new Version(versionId);
 
     switch (request.getAction()) {
-      case Checkout:
-        MDC.put(LoggerConstants.SERVICE_NAME,
-            LoggerServiceName.Checkout_VLM.toString());
-        logger.audit(AuditMessages.AUDIT_MSG + AuditMessages.CHECK_OUT_VLM
-                + vlmId);
-        vendorLicenseManager.checkout(vlmId, user);
-        break;
-      case Undo_Checkout:
-        MDC.put(LoggerConstants.SERVICE_NAME,
-            LoggerServiceName.Undo_Checkout_VLM.toString());
-        vendorLicenseManager.undoCheckout(vlmId, user);
-        break;
-      case Checkin:
-        MDC.put(LoggerConstants.SERVICE_NAME,
-            LoggerServiceName.Checkin_VLM.toString());
-        logger.audit(AuditMessages.AUDIT_MSG + AuditMessages.CHECK_IN_VLM
-                + vlmId);
-        vendorLicenseManager.checkin(vlmId, user);
-        break;
       case Submit:
-        MDC.put(LoggerConstants.SERVICE_NAME,
-            LoggerServiceName.Submit_VLM.toString());
-        logger.audit(AuditMessages.AUDIT_MSG + AuditMessages.SUBMIT_VLM
-                + vlmId);
-        vendorLicenseManager.submit(vlmId, user);
+        if (!permissionsManager.isAllowed(vlmId, user, SUBMIT_ITEM)) {
+          return Response.status(Response.Status.FORBIDDEN).entity
+              (new Exception(Messages.PERMISSIONS_ERROR.getErrorMessage())).build();
+        }
+        String message =
+            request.getSubmitRequest() == null ? "" : request.getSubmitRequest().getMessage();
+        submit(vlmId, version, message, user);
+
+        notifyUsers(vlmId, version, message, user, NotificationEventTypes.SUBMIT);
         break;
       default:
     }
 
-        return Response.ok().build();
+    return Response.ok().build();
+  }
+
+  private void submit(String vlmId, Version version, String message, String user) {
+    MdcUtil.initMdc(LoggerServiceName.Submit_VLM.toString());
+    logger.audit(AuditMessages.AUDIT_MSG + AuditMessages.SUBMIT_VLM + vlmId);
+
+    vendorLicenseManager.validate(vlmId, version);
+    versioningManager.submit(vlmId, version, message);
+
+    activityLogManager.logActivity(
+        new ActivityLogEntity(vlmId, version, ActivityType.Submit, user, true, "", message));
+  }
+
+  private void notifyUsers(String itemId, Version version, String message,
+                           String userName, NotificationEventTypes eventType) {
+    Map<String, Object> eventProperties = new HashMap<>();
+    eventProperties.put(ITEM_NAME, itemManager.get(itemId).getName());
+    eventProperties.put(ITEM_ID, itemId);
+
+    Version ver = versioningManager.get(itemId, version);
+    eventProperties.put(VERSION_NAME, ver.getName());
+    eventProperties.put(VERSION_ID, ver.getId());
+
+    eventProperties.put(SUBMIT_DESCRIPTION, message);
+    eventProperties.put(PERMISSION_USER, userName);
+
+    Event syncEvent = new SyncEvent(eventType.getEventName(), itemId, eventProperties, itemId);
+    try {
+      notifier.notifySubscribers(syncEvent, userName);
+    } catch (Exception e) {
+      logger.error("Failed to send sync notification to users subscribed o item '" + itemId);
     }
+  }
+
+  private class SyncEvent implements Event {
+
+    private String eventType;
+    private String originatorId;
+    private Map<String, Object> attributes;
+    private String entityId;
+
+    public SyncEvent(String eventType, String originatorId,
+                     Map<String, Object> attributes, String entityId) {
+      this.eventType = eventType;
+      this.originatorId = originatorId;
+      this.attributes = attributes;
+      this.entityId = entityId;
+    }
+
+    @Override
+    public String getEventType() {
+      return eventType;
+    }
+
+    @Override
+    public String getOriginatorId() {
+      return originatorId;
+    }
+
+    @Override
+    public Map<String, Object> getAttributes() {
+      return attributes;
+    }
+
+    @Override
+    public String getEntityId() {
+      return entityId;
+    }
+  }
+
+  private boolean userHasPermission(String itemId, String userId) {
+    String permission = permissionsManager.getUserItemPermiission(itemId, userId);
+    return (permission != null && permission
+        .matches(PermissionTypes.Contributor.name() + "|" + PermissionTypes.Owner.name()));
+  }
 }
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/pom.xml
index 6b30f95..daeb720 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/pom.xml
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/pom.xml
@@ -12,17 +12,17 @@
 		<relativePath>../</relativePath>
 	</parent>
 
-	<dependencies>
-		<dependency>
-			<groupId>org.openecomp.sdc</groupId>
-			<artifactId>openecomp-sdc-common-rest</artifactId>
-			<version>${project.version}</version>
-		</dependency>
-		<dependency>
-			<groupId>org.openecomp.sdc</groupId>
-			<artifactId>openecomp-sdc-vendor-license-manager</artifactId>
-			<version>${project.version}</version>
-		</dependency>
-	</dependencies>
+    <dependencies>
+        <dependency>
+            <groupId>org.openecomp.sdc</groupId>
+            <artifactId>openecomp-sdc-vendor-license-manager</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.openecomp.sdc</groupId>
+            <artifactId>item-rest-types</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
 
 </project>
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupEntityDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupEntityDto.java
index aebb171..3edf283 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupEntityDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupEntityDto.java
@@ -22,8 +22,8 @@
 
 import io.swagger.annotations.ApiModel;
 
-import java.util.Set;
 import javax.validation.constraints.Size;
+import java.util.Set;
 
 @ApiModel(value = "FeatureGroupEntity")
 public class FeatureGroupEntityDto extends FeatureGroupDescriptorDto {
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementEntityDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementEntityDto.java
index 7c9f03d..23d1218 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementEntityDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementEntityDto.java
@@ -23,8 +23,8 @@
 
 import io.swagger.annotations.ApiModel;
 
-import java.util.Set;
 import javax.validation.constraints.Size;
+import java.util.Set;
 
 @ApiModel(value = "LicenseAgreementEntity")
 public class LicenseAgreementEntityDto extends LicenseAgreementDescriptorDto {
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/MultiChoiceOrOtherDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/MultiChoiceOrOtherDto.java
index 6039a81..1dc8ff2 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/MultiChoiceOrOtherDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/MultiChoiceOrOtherDto.java
@@ -24,9 +24,9 @@
 import org.openecomp.sdcrests.vendorlicense.types.validation.MultiChoiceOrOtherSequenceProvider;
 import org.openecomp.sdcrests.vendorlicense.types.validation.OtherChoiceValidation;
 
-import java.util.Set;
 import javax.validation.constraints.NotNull;
 import javax.validation.constraints.Size;
+import java.util.Set;
 
 @GroupSequenceProvider(value = MultiChoiceOrOtherSequenceProvider.class)
 public class MultiChoiceOrOtherDto<E extends Enum<E>> {
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/VendorLicenseModelActionRequestDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/VendorLicenseModelActionRequestDto.java
index cfae94c..68e0fd8 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/VendorLicenseModelActionRequestDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/VendorLicenseModelActionRequestDto.java
@@ -20,17 +20,30 @@
 
 package org.openecomp.sdcrests.vendorlicense.types;
 
-import org.openecomp.sdcrests.versioning.types.VersioningAction;
+import org.openecomp.sdcrests.item.types.SubmitRequestDto;
 
 public class VendorLicenseModelActionRequestDto {
 
-  private VersioningAction action;
+  private VendorLicenseModelAction action;
+  private SubmitRequestDto submitRequest;
 
-  public VersioningAction getAction() {
+  public VendorLicenseModelAction getAction() {
     return action;
   }
 
-  public void setAction(VersioningAction action) {
+  public void setAction(VendorLicenseModelAction action) {
     this.action = action;
   }
+
+  public SubmitRequestDto getSubmitRequest() {
+    return submitRequest;
+  }
+
+  public void setSubmitRequest(SubmitRequestDto submitRequest) {
+    this.submitRequest = submitRequest;
+  }
+
+  public enum VendorLicenseModelAction {
+    Submit
+  }
 }
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/VendorLicenseModelEntityDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/VendorLicenseModelEntityDto.java
index e8a900a..f88926c 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/VendorLicenseModelEntityDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/VendorLicenseModelEntityDto.java
@@ -21,19 +21,10 @@
 package org.openecomp.sdcrests.vendorlicense.types;
 
 import io.swagger.annotations.ApiModel;
-import org.openecomp.sdc.versioning.dao.types.VersionStatus;
-import org.openecomp.sdcrests.common.types.VersionDto;
-
-import java.util.List;
 
 @ApiModel(value = "VendorLicenseModelEntity")
 public class VendorLicenseModelEntityDto extends VendorLicenseModelRequestDto {
   private String id;
-  private VersionDto version;
-  private VersionStatus status;
-  private String lockingUser;
-  private List<VersionDto> viewableVersions;
-  private List<VersionDto> finalVersions;
 
   public String getId() {
     return id;
@@ -42,44 +33,4 @@
   public void setId(String id) {
     this.id = id;
   }
-
-  public VersionDto getVersion() {
-    return version;
-  }
-
-  public void setVersion(VersionDto version) {
-    this.version = version;
-  }
-
-  public VersionStatus getStatus() {
-    return status;
-  }
-
-  public void setStatus(VersionStatus status) {
-    this.status = status;
-  }
-
-  public String getLockingUser() {
-    return lockingUser;
-  }
-
-  public void setLockingUser(String lockingUser) {
-    this.lockingUser = lockingUser;
-  }
-
-  public List<VersionDto> getViewableVersions() {
-    return viewableVersions;
-  }
-
-  public void setViewableVersions(List<VersionDto> viewableVersions) {
-    this.viewableVersions = viewableVersions;
-  }
-
-  public List<VersionDto> getFinalVersions() {
-    return finalVersions;
-  }
-
-  public void setFinalVersions(List<VersionDto> finalVersions) {
-    this.finalVersions = finalVersions;
-  }
 }
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/ComponentDependencies.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/ComponentDependencies.java
new file mode 100644
index 0000000..44626ff
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/ComponentDependencies.java
@@ -0,0 +1,87 @@
+package org.openecomp.sdcrests.vsp.rest;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentDependencyModel;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentDependencyResponseDto;
+import org.springframework.validation.annotation.Validated;
+
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
+import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
+
+@Path("/v1.0/vendor-software-products/{vspId}/versions/{versionId}/component-dependencies")
+@Produces(MediaType.APPLICATION_JSON)
+@Consumes(MediaType.APPLICATION_JSON)
+@Api(value = "Vendor Software Product Component Dependencies")
+@Validated
+public interface ComponentDependencies extends VspEntities {
+
+  @POST
+  @Path("/")
+  @ApiOperation(value = "Create a vendor software product component dependency")
+  Response create(@Valid ComponentDependencyModel request,
+                  @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
+                  @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
+                  @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
+                      String user);
+
+  @GET
+  @Path("/")
+  @ApiOperation(value = "Get component dependencies for vendor software product",
+      response = ComponentDependencyResponseDto.class,
+      responseContainer = "List")
+  Response list(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
+                @ApiParam(value = "Vendor software product version Id") @PathParam("versionId")
+                    String versionId,
+                @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
+                    String user);
+
+  @DELETE
+  @Path("/{dependencyId}")
+  @ApiOperation(value = "Delete component dependency for vendor software product")
+  Response delete(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
+                  @ApiParam(value = "Vendor software product version Id")
+                  @PathParam("versionId") String versionId,
+                  @ApiParam(value = "Vendor software product Component Dependency Id") @PathParam
+                      ("dependencyId") String dependencyId,
+                  @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
+                      String user);
+
+  @PUT
+  @Path("/{dependencyId}")
+  @ApiOperation(value = "Update component dependency for vendor software product")
+  Response update(@Valid ComponentDependencyModel request,
+                  @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
+                  @ApiParam(value = "Vendor software product version Id") @PathParam("versionId")
+                      String versionId,
+                  @ApiParam(value = "Vendor software product Component Dependency Id") @PathParam
+                      ("dependencyId") String dependencyId,
+                  @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
+                      String user);
+
+  @GET
+  @Path("/{dependencyId}")
+  @ApiOperation(value = "Get component dependency for vendor software product",
+      response = ComponentDependencyResponseDto.class)
+  Response get(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
+               @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
+               @ApiParam(value = "Vendor software product Component Dependency Id") @PathParam
+                   ("dependencyId") String dependencyId,
+               @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
+                   String user);
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/ComponentDependencyModels.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/ComponentDependencyModels.java
deleted file mode 100644
index d7ba65f..0000000
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/ComponentDependencyModels.java
+++ /dev/null
@@ -1,50 +0,0 @@
-package org.openecomp.sdcrests.vsp.rest;
-
-import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
-import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
-
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
-import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentDependencyModelRequestDto;
-import org.springframework.validation.annotation.Validated;
-
-import javax.validation.Valid;
-import javax.validation.constraints.NotNull;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.GET;
-import javax.ws.rs.HeaderParam;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-@Path("/v1.0/vendor-software-products/{vspId}/versions/{versionId}/component-dependency-model")
-@Produces(MediaType.APPLICATION_JSON)
-@Consumes(MediaType.APPLICATION_JSON)
-@Api(value = "Vendor Software Product Component Dependency Model")
-@Validated
-public interface ComponentDependencyModels extends VspEntities {
-
-  @POST
-  @Path("/")
-  @ApiOperation(value = "Create a vendor software product component dependency model")
-  Response create(@Valid ComponentDependencyModelRequestDto request,
-                  @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
-                  @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
-                  @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
-                      String user);
-
-  @GET
-  @Path("/")
-  @ApiOperation(value = "Get component dependency Model for vendor software product",
-      response = ComponentDependencyModelRequestDto.class,
-      responseContainer = "List")
-  Response list(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
-                @ApiParam(value = "Vendor software product version Id") @PathParam("versionId")
-                    String versionId,
-                @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
-                    String user);
-}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/ComponentProcesses.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/ComponentProcesses.java
index edb3b5b..5595dc1 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/ComponentProcesses.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/ComponentProcesses.java
@@ -31,7 +31,15 @@
 
 import javax.validation.Valid;
 import javax.validation.constraints.NotNull;
-import javax.ws.rs.*;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Compute.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Compute.java
index d5125c9..635d312 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Compute.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Compute.java
@@ -1,8 +1,5 @@
 package org.openecomp.sdcrests.vsp.rest;
 
-import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
-import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
-
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
@@ -26,6 +23,9 @@
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
+import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
+import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
+
 @Path("/v1.0/vendor-software-products/{vspId}/versions/{versionId}/components/{componentId" +
     "}/compute-flavors")
 @Produces(MediaType.APPLICATION_JSON)
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/DeploymentFlavors.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/DeploymentFlavors.java
index 1ba2f71..a154f9f 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/DeploymentFlavors.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/DeploymentFlavors.java
@@ -1,8 +1,5 @@
 package org.openecomp.sdcrests.vsp.rest;
 
-import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
-import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
-
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
@@ -25,6 +22,9 @@
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
+import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
+import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
+
 
 @Path("/v1.0/vendor-software-products/{vspId}/versions/{versionId}/deployment-flavors")
 @Produces(MediaType.APPLICATION_JSON)
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Images.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Images.java
index ffa1675..b3d2e5c 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Images.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Images.java
@@ -1,8 +1,5 @@
 package org.openecomp.sdcrests.vsp.rest;
 
-import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
-import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
-
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
@@ -26,6 +23,9 @@
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
+import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
+import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
+
 @Path("/v1.0/vendor-software-products/{vspId}/versions/{versionId}/components/{componentId}/images")
 @Produces(MediaType.APPLICATION_JSON)
 @Consumes(MediaType.APPLICATION_JSON)
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Nics.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Nics.java
index 21bd65e..67be168 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Nics.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Nics.java
@@ -20,9 +20,6 @@
 
 package org.openecomp.sdcrests.vsp.rest;
 
-import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
-import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
-
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
@@ -46,6 +43,9 @@
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
+import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
+import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
+
 @Path("/v1.0/vendor-software-products/{vspId}/versions/{versionId}/components/{componentId}/nics")
 @Produces(MediaType.APPLICATION_JSON)
 @Consumes(MediaType.APPLICATION_JSON)
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/OrchestrationTemplateCandidate.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/OrchestrationTemplateCandidate.java
index fa7f421..4f5e31a 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/OrchestrationTemplateCandidate.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/OrchestrationTemplateCandidate.java
@@ -25,7 +25,7 @@
 import io.swagger.annotations.ApiParam;
 import org.apache.cxf.jaxrs.ext.multipart.Attachment;
 import org.apache.cxf.jaxrs.ext.multipart.Multipart;
-import org.openecomp.sdc.vendorsoftwareproduct.types.FileDataStructureDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.FileDataStructureDto;
 import org.openecomp.sdcrests.vendorsoftwareproducts.types.UploadFileResponseDto;
 import org.springframework.validation.annotation.Validated;
 
@@ -43,7 +43,6 @@
 import javax.ws.rs.core.Response;
 import java.io.File;
 import java.io.IOException;
-import java.io.InputStream;
 import java.lang.reflect.InvocationTargetException;
 
 import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Processes.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Processes.java
index 458a1c6..caf03b4 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Processes.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Processes.java
@@ -20,9 +20,6 @@
 
 package org.openecomp.sdcrests.vsp.rest;
 
-import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
-import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
-
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
@@ -46,6 +43,9 @@
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
+import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
+import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
+
 @Path("/v1.0/vendor-software-products/{vspId}/versions/{versionId}/processes")
 @Produces(MediaType.APPLICATION_JSON)
 @Consumes(MediaType.APPLICATION_JSON)
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/VendorSoftwareProducts.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/VendorSoftwareProducts.java
index 20fe64b..d848d41 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/VendorSoftwareProducts.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/VendorSoftwareProducts.java
@@ -23,12 +23,13 @@
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
+import org.openecomp.sdcrests.item.types.ItemCreationDto;
 import org.openecomp.sdcrests.vendorsoftwareproducts.types.PackageInfoDto;
 import org.openecomp.sdcrests.vendorsoftwareproducts.types.QuestionnaireResponseDto;
 import org.openecomp.sdcrests.vendorsoftwareproducts.types.VersionSoftwareProductActionRequestDto;
 import org.openecomp.sdcrests.vendorsoftwareproducts.types.VspComputeDto;
-import org.openecomp.sdcrests.vendorsoftwareproducts.types.VspCreationDto;
 import org.openecomp.sdcrests.vendorsoftwareproducts.types.VspDescriptionDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.VspRequestDto;
 import org.openecomp.sdcrests.vendorsoftwareproducts.types.validation.IsValidJson;
 import org.springframework.validation.annotation.Validated;
 
@@ -51,6 +52,7 @@
 
 import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
 import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
+
 @Path("/v1.0/vendor-software-products")
 @Produces(MediaType.APPLICATION_JSON)
 @Consumes(MediaType.APPLICATION_JSON)
@@ -61,8 +63,8 @@
   @POST
   @Path("/")
   @ApiOperation(value = "Create a new vendor software product",
-      response = VspCreationDto.class)
-  Response createVsp(@Valid VspDescriptionDto vspDescriptionDto,
+      response = ItemCreationDto.class)
+  Response createVsp(@Valid VspRequestDto vspRequestDto,
                      @NotNull(message = USER_MISSING_ERROR_MSG)
                      @HeaderParam(USER_ID_HEADER_PARAM) String user);
 
@@ -71,13 +73,12 @@
   @ApiOperation(value = "Get list of vendor software products and their description",
       responseContainer = "List")
   Response listVsps(@ApiParam(
-      value = "Currently supported values: 'Final' - only vendor software products with final "
+      value = "Currently supported values: 'Certified' - only vendor software products with final "
           + " version will be return - with their latest final version")
-                    @QueryParam("versionFilter") String versionFilter,
+                    @QueryParam("versionFilter") String versionStatus,
                     @NotNull(message = USER_MISSING_ERROR_MSG)
                     @HeaderParam(USER_ID_HEADER_PARAM) String user);
 
-
   @GET
   @Path("/{vspId}/versions/{versionId}")
   @ApiOperation(value = "Get details of a vendor software product")
@@ -140,9 +141,9 @@
           + "Checkin: Unlocks it and activates the edited version to all users.| "
           + "Submit: Finalize its active version.|"
           + "Create_Package: Creates a CSAR zip file.|")
-  Response actOnVendorSoftwareProduct(@PathParam("vspId") String vspId,
+  Response actOnVendorSoftwareProduct(VersionSoftwareProductActionRequestDto request,
+                                      @PathParam("vspId") String vspId,
                                       @PathParam("versionId") String versionId,
-                                      VersionSoftwareProductActionRequestDto request,
                                       @NotNull(message = USER_MISSING_ERROR_MSG)
                                       @HeaderParam(USER_ID_HEADER_PARAM) String user)
       throws IOException;
@@ -201,18 +202,9 @@
   @ApiOperation(value = "Get list of vendor software product compute-flavors",
       response = VspComputeDto.class,
       responseContainer = "List")
-  Response listCompute(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String
-                           vspId,
-                       @PathParam("versionId") String versionId,
-                       @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
-                           String user);
-
-  @PUT
-  @Path("/reSubmitAll")
-  @ApiOperation(value = "Performs healing ,check out, check in and submit for Network Package " +
-      "Based VSPs",
-      notes
-      = "Please note - only submitted VSPs will be processed")
-  Response reSubmitAll(@NotNull(message = USER_MISSING_ERROR_MSG)
-                       @HeaderParam(USER_ID_HEADER_PARAM) String user) throws IOException;
+  Response listComputes(@ApiParam(value = "Vendor software product Id")
+                        @PathParam("vspId") String vspId,
+                        @PathParam("versionId") String versionId,
+                        @NotNull(message = USER_MISSING_ERROR_MSG)
+                        @HeaderParam(USER_ID_HEADER_PARAM) String user);
 }
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/VendorSoftwareProductsForSwaggerFileUpload.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/VendorSoftwareProductsForSwaggerFileUpload.java
index eb70394..c2a4940 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/VendorSoftwareProductsForSwaggerFileUpload.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/VendorSoftwareProductsForSwaggerFileUpload.java
@@ -27,7 +27,12 @@
 import org.springframework.validation.annotation.Validated;
 
 import javax.validation.constraints.NotNull;
-import javax.ws.rs.*;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 import java.io.InputStream;
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/VspEntities.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/VspEntities.java
index bd53305..4514af6 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/VspEntities.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/VspEntities.java
@@ -20,27 +20,6 @@
 
 package org.openecomp.sdcrests.vsp.rest;
 
-import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants;
-import org.openecomp.sdc.versioning.VersioningManager;
-import org.openecomp.sdc.versioning.VersioningManagerFactory;
-import org.openecomp.sdc.versioning.VersioningUtil;
-import org.openecomp.sdc.versioning.dao.types.Version;
-import org.openecomp.sdc.versioning.types.VersionInfo;
-import org.openecomp.sdc.versioning.types.VersionableEntityAction;
-
 public interface VspEntities {
-  VersioningManager versioningManager = VersioningManagerFactory.getInstance().createInterface();
 
-  default Version resolveVspVersion(String vspId, String version, String user,
-                                    VersionableEntityAction action) {
-    return VersioningUtil
-        .resolveVersion(Version.valueOf(version), getVersionInfo(vspId, action, user), user);
-  }
-
-  default VersionInfo getVersionInfo(String vendorSoftwareProductId, VersionableEntityAction action,
-                                     String user) {
-    return versioningManager.getEntityVersionInfo(
-        VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE,
-        vendorSoftwareProductId, user, action);
-  }
 }
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentDependencyEntityToCreationDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentDependencyEntityToCreationDto.java
new file mode 100644
index 0000000..cb480b2
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentDependencyEntityToCreationDto.java
@@ -0,0 +1,16 @@
+package org.openecomp.sdcrests.vsp.rest.mapping;
+
+
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentDependencyModelEntity;
+import org.openecomp.sdcrests.mapping.MappingBase;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentDependencyCreationDto;
+
+public class MapComponentDependencyEntityToCreationDto extends MappingBase
+    <ComponentDependencyModelEntity, ComponentDependencyCreationDto> {
+
+  @Override
+  public void doMapping(ComponentDependencyModelEntity source,
+                        ComponentDependencyCreationDto target) {
+    target.setId(source.getId());
+  }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentDependencyEntityToDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentDependencyEntityToDto.java
new file mode 100644
index 0000000..0fe5117
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentDependencyEntityToDto.java
@@ -0,0 +1,18 @@
+package org.openecomp.sdcrests.vsp.rest.mapping;
+
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentDependencyModelEntity;
+import org.openecomp.sdcrests.mapping.MappingBase;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentDependencyResponseDto;
+
+public class MapComponentDependencyEntityToDto extends
+    MappingBase<ComponentDependencyModelEntity, ComponentDependencyResponseDto> {
+
+  @Override
+  public void doMapping(ComponentDependencyModelEntity source,
+                        ComponentDependencyResponseDto target) {
+    target.setSourceId(source.getSourceComponentId());
+    target.setTargetId(source.getTargetComponentId());
+    target.setRelationType(source.getRelation());
+    target.setId(source.getId());
+  }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComputeDetailsDtoToComputeEntity.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComputeDetailsDtoToComputeEntity.java
index ee98823..7db9a0a 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComputeDetailsDtoToComputeEntity.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComputeDetailsDtoToComputeEntity.java
@@ -12,6 +12,6 @@
   public void doMapping(ComputeDetailsDto source, ComputeEntity target) {
     ComputeDescription computeDesc = new ComputeDescription(source.getName(), source
         .getDescription());
-    target.setCompositionData(JsonUtil.object2Json(computeDesc));
+    target.setCompositionData(computeDesc == null ? null : JsonUtil.object2Json(computeDesc));
   }
 }
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapFilesDataStructureToDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapFilesDataStructureToDto.java
new file mode 100644
index 0000000..09e4d22
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapFilesDataStructureToDto.java
@@ -0,0 +1,17 @@
+package org.openecomp.sdcrests.vsp.rest.mapping;
+
+import org.openecomp.sdc.vendorsoftwareproduct.types.candidateheat.FilesDataStructure;
+import org.openecomp.sdcrests.mapping.MappingBase;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.FileDataStructureDto;
+
+public class MapFilesDataStructureToDto
+    extends MappingBase<FilesDataStructure, FileDataStructureDto> {
+
+  @Override
+  public void doMapping(FilesDataStructure source, FileDataStructureDto target) {
+    target.setModules(source.getModules());
+    target.setArtifacts(source.getArtifacts());
+    target.setNested(source.getNested());
+    target.setUnassigned(source.getUnassigned());
+  }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapFilesDataStructureToGetFileDataStructureResponseDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapFilesDataStructureToGetFileDataStructureResponseDto.java
deleted file mode 100644
index b7d4670..0000000
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapFilesDataStructureToGetFileDataStructureResponseDto.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * 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=========================================================
- */
-
-package org.openecomp.sdcrests.vsp.rest.mapping;
-
-
-import org.openecomp.sdc.vendorsoftwareproduct.types.GetFileDataStructureResponseDTO;
-import org.openecomp.sdc.vendorsoftwareproduct.types.candidateheat.FilesDataStructure;
-import org.openecomp.sdcrests.mapping.MappingBase;
-
-/**
- * Created by TALIO on 4/27/2016.
- */
-public class MapFilesDataStructureToGetFileDataStructureResponseDto
-    extends MappingBase<FilesDataStructure, GetFileDataStructureResponseDTO> {
-  @Override
-  public void doMapping(FilesDataStructure source, GetFileDataStructureResponseDTO target) {
-    target.setModules(source.getModules());
-    target.setArtifacts(source.getArtifacts());
-    target.setUnassigned(source.getUnassigned());
-    target.setNested(source.getNested());
-  }
-}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapImageDataToImageDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapImageDataToImageDto.java
index 684cd4c..f938c52 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapImageDataToImageDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapImageDataToImageDto.java
@@ -1,6 +1,5 @@
 package org.openecomp.sdcrests.vsp.rest.mapping;
 
-import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentData;
 import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ImageData;
 import org.openecomp.sdcrests.mapping.MappingBase;
 import org.openecomp.sdcrests.vendorsoftwareproducts.types.ImageDto;
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapItemToVspDetailsDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapItemToVspDetailsDto.java
new file mode 100644
index 0000000..ad45e63
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapItemToVspDetailsDto.java
@@ -0,0 +1,18 @@
+package org.openecomp.sdcrests.vsp.rest.mapping;
+
+import org.openecomp.sdc.versioning.types.Item;
+import org.openecomp.sdcrests.mapping.MappingBase;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.VspDetailsDto;
+import org.openecomp.sdcrests.vsp.rest.services.VspItemProperty;
+
+public class MapItemToVspDetailsDto extends MappingBase<Item, VspDetailsDto> {
+  @Override
+  public void doMapping(Item source, VspDetailsDto target) {
+    target.setId(source.getId());
+    target.setName(source.getName());
+    target.setDescription(source.getDescription());
+    target.setVendorId((String) source.getProperties().get(VspItemProperty.VENDOR_ID));
+    target.setVendorName((String) source.getProperties().get(VspItemProperty.VENDOR_NAME));
+    target.setOnboardingMethod((String) source.getProperties().get(VspItemProperty.ONBOARDING_METHOD));
+  }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapPackageInfoToPackageInfoDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapPackageInfoToPackageInfoDto.java
index 34616b4..eeee4e9 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapPackageInfoToPackageInfoDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapPackageInfoToPackageInfoDto.java
@@ -33,7 +33,7 @@
     target.setVspName(source.getVspName());
     target.setPackageId(source.getVspId());
     target.setDescription(source.getVspDescription());
-    target.setVersion(source.getVersion() == null ? null : source.getVersion().toString());
+    target.setVersion(source.getVersion());
     target.setPackageType(source.getPackageType());
     target.setCategory(source.getCategory());
     target.setSubCategory(source.getSubCategory());
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapQuestionnaireToQuestionnaireDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapQuestionnaireToQuestionnaireDto.java
new file mode 100644
index 0000000..f47f783
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapQuestionnaireToQuestionnaireDto.java
@@ -0,0 +1,21 @@
+package org.openecomp.sdcrests.vsp.rest.mapping;
+
+import org.openecomp.core.utilities.json.JsonUtil;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.CompositionEntity;
+import org.openecomp.sdcrests.mapping.MappingBase;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.QuestionnaireDto;
+
+import java.util.HashMap;
+
+/**
+ * Created by ayalaben on 9/26/2017
+ */
+public class MapQuestionnaireToQuestionnaireDto extends
+    MappingBase<CompositionEntity, QuestionnaireDto> {
+
+  @Override
+  public void doMapping(CompositionEntity source, QuestionnaireDto target) {
+    target.setId(source.getId());
+    target.setQuestionareData(JsonUtil.json2Object(source.getQuestionnaireData(), HashMap.class));
+  }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapValidationResponseToDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapValidationResponseToDto.java
index 3cabebb..85b5567 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapValidationResponseToDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapValidationResponseToDto.java
@@ -32,9 +32,7 @@
 import org.openecomp.sdcrests.common.types.ErrorCodeDto;
 import org.openecomp.sdcrests.common.types.ErrorMessageDto;
 import org.openecomp.sdcrests.mapping.MappingBase;
-import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentValidationResultDto;
 import org.openecomp.sdcrests.vendorsoftwareproducts.types.CompositionEntityValidationDataDto;
-import org.openecomp.sdcrests.vendorsoftwareproducts.types.DeploymentFlavorValidationResultDto;
 import org.openecomp.sdcrests.vendorsoftwareproducts.types.QuestionnaireValidationResultDto;
 import org.openecomp.sdcrests.vendorsoftwareproducts.types.ValidationResponseDto;
 
@@ -47,30 +45,31 @@
 import java.util.stream.Collectors;
 
 public class MapValidationResponseToDto
-        extends MappingBase<ValidationResponse, ValidationResponseDto> {
+    extends MappingBase<ValidationResponse, ValidationResponseDto> {
   private static Map<String, List<ErrorMessageDto>> mapUploadDataErrors(
-          Map<String, List<ErrorMessage>> uploadDataErrors) {
+      Map<String, List<ErrorMessage>> uploadDataErrors) {
     if (MapUtils.isEmpty(uploadDataErrors)) {
       return null;
     }
     return uploadDataErrors.entrySet().stream().collect(
-            Collectors.toMap(entry -> entry.getKey(), entry -> mapErrorMessages(entry.getValue())));
+        Collectors.toMap(entry -> entry.getKey(), entry -> mapErrorMessages(entry.getValue())));
   }
 
   private static QuestionnaireValidationResultDto mapQuestionnaireValidationResult(
-          QuestionnaireValidationResult questionnaireValidationResult) {
+      QuestionnaireValidationResult questionnaireValidationResult) {
     if (Objects.isNull(questionnaireValidationResult)
-            || Objects.isNull(questionnaireValidationResult.getValidationData())) {
+        || Objects.isNull(questionnaireValidationResult.getValidationData())) {
       return null;
     }
     QuestionnaireValidationResultDto questionnaireValidationResultDto =
-            new QuestionnaireValidationResultDto();
+        new QuestionnaireValidationResultDto();
     questionnaireValidationResultDto.setValid(questionnaireValidationResult.isValid());
 
     Set<CompositionEntityValidationDataDto> validationDataDto = new HashSet<>();
-    for(CompositionEntityValidationData validationData : questionnaireValidationResult.getValidationData()){
+    for (CompositionEntityValidationData validationData : questionnaireValidationResult
+        .getValidationData()) {
       validationDataDto.add(new MapCompositionEntityValidationDataToDto().applyMapping
-              (validationData, CompositionEntityValidationDataDto.class));
+          (validationData, CompositionEntityValidationDataDto.class));
     }
 
     questionnaireValidationResultDto.setValidationData(validationDataDto);
@@ -87,7 +86,7 @@
     componentValidationResultDto.setValid(componentValidationResult.isValid());
 
     Set<CompositionEntityValidationDataDto> validationDataDto = new HashSet<>();
-    for(CompositionEntityValidationData validationData : componentValidationResult.getValidationData()){
+    for(CompositionEntityValidationData validationData : componentValidationResult.getInfo()){
       validationDataDto.add(new MapCompositionEntityValidationDataToDto().applyMapping
           (validationData, CompositionEntityValidationDataDto.class));
     }
@@ -106,7 +105,7 @@
     deploymentFlavorValidationResultDto.setValid(deploymentFlavorValidationResult.isValid());
 
     Set<CompositionEntityValidationDataDto> validationDataDto = new HashSet<>();
-    for(CompositionEntityValidationData validationData : deploymentFlavorValidationResult.getValidationData()){
+    for(CompositionEntityValidationData validationData : deploymentFlavorValidationResult.getInfo()){
       validationDataDto.add(new MapCompositionEntityValidationDataToDto().applyMapping
           (validationData, CompositionEntityValidationDataDto.class));
     }
@@ -117,14 +116,14 @@
 
   private static List<ErrorMessageDto> mapErrorMessages(List<ErrorMessage> errorMessages) {
     return errorMessages == null ? null : errorMessages.stream().map(
-            errorMessage -> new MapErrorMessageToDto()
-                    .applyMapping(errorMessage, ErrorMessageDto.class)).collect(Collectors.toList());
+        errorMessage -> new MapErrorMessageToDto()
+            .applyMapping(errorMessage, ErrorMessageDto.class)).collect(Collectors.toList());
   }
 
   private static Collection<ErrorCodeDto> mapErrorCodes(Collection<ErrorCode> errorCodes) {
     return CollectionUtils.isEmpty(errorCodes) ? null : errorCodes.stream()
-            .map(errorCode -> new MapErrorCodeToDto().applyMapping(errorCode, ErrorCodeDto.class))
-            .collect(Collectors.toList());
+        .map(errorCode -> new MapErrorCodeToDto().applyMapping(errorCode, ErrorCodeDto.class))
+        .collect(Collectors.toList());
   }
 
   @Override
@@ -134,6 +133,6 @@
     target.setLicensingDataErrors(mapErrorCodes(source.getLicensingDataErrors()));
     target.setUploadDataErrors(mapUploadDataErrors(source.getUploadDataErrors()));
     target.setQuestionnaireValidationResult(
-            mapQuestionnaireValidationResult(source.getQuestionnaireValidationResult()));
+        mapQuestionnaireValidationResult(source.getQuestionnaireValidationResult()));
   }
 }
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVersionedVendorSoftwareProductInfoToVspDetailsDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVersionedVendorSoftwareProductInfoToVspDetailsDto.java
deleted file mode 100644
index 815135f..0000000
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVersionedVendorSoftwareProductInfoToVspDetailsDto.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * 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=========================================================
- */
-
-package org.openecomp.sdcrests.vsp.rest.mapping;
-
-import org.openecomp.core.utilities.CommonMethods;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
-import org.openecomp.sdc.vendorsoftwareproduct.types.LicensingData;
-import org.openecomp.sdc.vendorsoftwareproduct.types.VersionedVendorSoftwareProductInfo;
-import org.openecomp.sdcrests.common.types.VersionDto;
-import org.openecomp.sdcrests.mapping.MappingBase;
-import org.openecomp.sdcrests.vendorsoftwareproducts.types.VspDetailsDto;
-
-import java.util.stream.Collectors;
-
-public class MapVersionedVendorSoftwareProductInfoToVspDetailsDto
-    extends MappingBase<VersionedVendorSoftwareProductInfo, VspDetailsDto> {
-
-  @Override
-  public void doMapping(VersionedVendorSoftwareProductInfo source, VspDetailsDto target) {
-    VspDetails vsp = source.getVspDetails();
-
-    target.setId(vsp.getId());
-    target.setVersion(new VersionDto(vsp.getVersion().toString(), vsp.getVersion().toString()));
-    target.setName(vsp.getName());
-    target.setDescription(vsp.getDescription());
-    target.setCategory(vsp.getCategory());
-    target.setSubCategory(vsp.getSubCategory());
-    target.setVendorId(vsp.getVendorId());
-    target.setVendorName(vsp.getVendorName());
-    target.setOnboardingOrigin(vsp.getOnboardingOrigin());
-    target.setLicensingVersion(vsp.getVlmVersion() == null ? null : new VersionDto(vsp.getVlmVersion().toString(), vsp.getVlmVersion().toString()));
-    target.setIsOldVersion("False");
-    target.setNetworkPackageName(vsp.getNetworkPackageName());
-
-    if (vsp.getLicenseAgreement() != null || vsp.getFeatureGroups() != null) {
-      LicensingData licensingData = new LicensingData();
-      licensingData.setLicenseAgreement(vsp.getLicenseAgreement());
-      licensingData.setFeatureGroups(vsp.getFeatureGroups());
-      target.setLicensingData(licensingData);
-    }
-
-    target.setValidationData(vsp.getValidationDataStructure());
-
-    target.setStatus(source.getVersionInfo().getStatus());
-    target.setLockingUser(source.getVersionInfo().getLockingUser());
-
-    if (!CommonMethods.isEmpty(source.getVersionInfo().getViewableVersions())) {
-      target.setViewableVersions(
-          source.getVersionInfo().getViewableVersions().stream()
-              .map(version -> new VersionDto(version.toString(), version.toString()))
-              .collect(Collectors.toList()));
-    }
-
-    if (!CommonMethods.isEmpty(source.getVersionInfo().getFinalVersions())) {
-      target.setFinalVersions(
-          source.getVersionInfo().getFinalVersions().stream()
-              .map(version -> new VersionDto(version.toString(), version.toString()))
-              .collect(Collectors.toList()));
-    }
-
-    //Onboarding Method valid value will always be present in VSP saved in DB
-    target.setOnboardingMethod(vsp.getOnboardingMethod());
-
-  }
-}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVspDescriptionDtoToItem.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVspDescriptionDtoToItem.java
new file mode 100644
index 0000000..3a7800f
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVspDescriptionDtoToItem.java
@@ -0,0 +1,16 @@
+package org.openecomp.sdcrests.vsp.rest.mapping;
+
+import org.openecomp.sdc.versioning.types.Item;
+import org.openecomp.sdcrests.mapping.MappingBase;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.VspDescriptionDto;
+import org.openecomp.sdcrests.vsp.rest.services.VspItemProperty;
+
+public class MapVspDescriptionDtoToItem extends MappingBase<VspDescriptionDto, Item> {
+  @Override
+  public void doMapping(VspDescriptionDto source, Item target) {
+    target.setName(source.getName());
+    target.setDescription(source.getDescription());
+    target.addProperty(VspItemProperty.VENDOR_ID, source.getVendorId());
+    target.addProperty(VspItemProperty.VENDOR_NAME, source.getVendorName());
+  }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVspDescriptionDtoToVspDetails.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVspDescriptionDtoToVspDetails.java
index ba3d92e..634bd90 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVspDescriptionDtoToVspDetails.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVspDescriptionDtoToVspDetails.java
@@ -23,7 +23,6 @@
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
 import org.openecomp.sdc.vendorsoftwareproduct.types.LicensingData;
 import org.openecomp.sdc.versioning.dao.types.Version;
-import org.openecomp.sdcrests.common.types.VersionDto;
 import org.openecomp.sdcrests.mapping.MappingBase;
 import org.openecomp.sdcrests.vendorsoftwareproducts.types.VspDescriptionDto;
 
@@ -38,17 +37,9 @@
     target.setIcon(source.getIcon());
     target.setVendorName(source.getVendorName());
     target.setVendorId(source.getVendorId());
-    target.setOnboardingMethod(source.getOnboardingMethod());
-    target.setOnboardingOrigin(source.getOnboardingOrigin());
-    target.setNetworkPackageName(source.getNetworkPackageName());
 
-    VersionDto vlmVersion = source.getLicensingVersion();
-    if (vlmVersion != null) {
-      Version version = Version.valueOf(vlmVersion.getId());
-      target.setVlmVersion(version);
-//      target.setVlmVersion(
-//          Pattern.compile(Version.VERSION_REGEX).matcher(vlmVersion.getId()).find() ? Version
-//              .valueOf(vlmVersion.getId()) : null);
+    if (source.getLicensingVersion() != null) {
+      target.setVlmVersion(new Version(source.getLicensingVersion()));
     }
 
     LicensingData licensingData = source.getLicensingData();
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVspDetailsToDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVspDetailsToDto.java
new file mode 100644
index 0000000..6e659cb
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVspDetailsToDto.java
@@ -0,0 +1,53 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * 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=========================================================
+ */
+
+package org.openecomp.sdcrests.vsp.rest.mapping;
+
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
+import org.openecomp.sdc.vendorsoftwareproduct.types.LicensingData;
+import org.openecomp.sdcrests.mapping.MappingBase;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.VspDetailsDto;
+
+public class MapVspDetailsToDto extends MappingBase<VspDetails, VspDetailsDto> {
+
+  @Override
+  public void doMapping(VspDetails source, VspDetailsDto target) {
+    target.setId(source.getId());
+    target.setVersion(source.getVersion() == null ? null : source.getVersion().getId());
+    target.setName(source.getName());
+    target.setDescription(source.getDescription());
+    target.setIcon(source.getIcon());
+    target.setCategory(source.getCategory());
+    target.setSubCategory(source.getSubCategory());
+    target.setVendorId(source.getVendorId());
+    target.setVendorName(source.getVendorName());
+    target.setLicensingVersion(
+        source.getVlmVersion() == null ? null : source.getVlmVersion().getId());
+
+    if (source.getLicenseAgreement() != null || source.getFeatureGroups() != null) {
+      LicensingData licensingData = new LicensingData();
+      licensingData.setLicenseAgreement(source.getLicenseAgreement());
+      licensingData.setFeatureGroups(source.getFeatureGroups());
+      target.setLicensingData(licensingData);
+    }
+
+    target.setOnboardingMethod(source.getOnboardingMethod());
+  }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentDependenciesImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentDependenciesImpl.java
new file mode 100644
index 0000000..73c2bac
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentDependenciesImpl.java
@@ -0,0 +1,119 @@
+package org.openecomp.sdcrests.vsp.rest.services;
+
+import org.openecomp.sdc.logging.context.MdcUtil;
+import org.openecomp.sdc.logging.types.LoggerServiceName;
+import org.openecomp.sdc.vendorsoftwareproduct.ComponentDependencyModelManager;
+import org.openecomp.sdc.vendorsoftwareproduct.ComponentDependencyModelManagerFactory;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentDependencyModelEntity;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentDependencyCreationDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentDependencyModel;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentDependencyResponseDto;
+import org.openecomp.sdcrests.vsp.rest.ComponentDependencies;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapComponentDependencyEntityToCreationDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapComponentDependencyEntityToDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapComponentDependencyModelRequestToEntity;
+import org.openecomp.sdcrests.wrappers.GenericCollectionWrapper;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Service;
+
+import javax.inject.Named;
+import javax.ws.rs.core.Response;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+@Named
+@Service("componentDependencies")
+@Scope(value = "prototype")
+public class ComponentDependenciesImpl implements ComponentDependencies {
+
+  private ComponentDependencyModelManager componentDependencyModelManager =
+      ComponentDependencyModelManagerFactory.getInstance().createInterface();
+
+  @Override
+  public Response create(ComponentDependencyModel request, String vspId, String versionId,
+                         String user) {
+    MdcUtil.initMdc(LoggerServiceName.CREATE_COMPONENT_DEPENDENCY_MODEL.toString());
+    List<ComponentDependencyModelEntity> modelEntities = new
+        ArrayList<ComponentDependencyModelEntity>();
+
+    final Version version = new Version(versionId);
+
+    ComponentDependencyModelEntity modelEntity =
+        new MapComponentDependencyModelRequestToEntity().applyMapping(request,
+            ComponentDependencyModelEntity.class);
+
+    modelEntity.setVspId(vspId);
+    modelEntity.setVersion(version);
+
+    ComponentDependencyModelEntity componentDependency =
+        componentDependencyModelManager.createComponentDependency(modelEntity, vspId, version);
+
+    MapComponentDependencyEntityToCreationDto mapping =
+        new MapComponentDependencyEntityToCreationDto();
+    ComponentDependencyCreationDto createdComponentDependencyDto = mapping.applyMapping(
+        componentDependency, ComponentDependencyCreationDto.class);
+    return Response.ok(componentDependency != null ? createdComponentDependencyDto : null)
+        .build();
+  }
+
+  @Override
+  public Response list(String vspId, String versionId, String user) {
+    MdcUtil.initMdc(LoggerServiceName.GET_LIST_COMPONENT_DEPENDENCY.toString());
+    Version vspVersion = new Version(versionId);
+
+    Collection<ComponentDependencyModelEntity> componentDependencies =
+        componentDependencyModelManager.list(vspId, vspVersion);
+
+    MapComponentDependencyEntityToDto mapper = new MapComponentDependencyEntityToDto();
+    GenericCollectionWrapper<ComponentDependencyResponseDto> results = new GenericCollectionWrapper
+        <ComponentDependencyResponseDto>();
+    for (ComponentDependencyModelEntity entity : componentDependencies) {
+      results.add(mapper.applyMapping(entity, ComponentDependencyResponseDto.class));
+    }
+
+    return Response.ok(results).build();
+  }
+
+  @Override
+  public Response delete(String vspId, String versionId, String dependencyId, String user) {
+    MdcUtil.initMdc(LoggerServiceName.DELETE_COMPONENT_DEPENDENCY.toString());
+    Version vspVersion = new Version(versionId);
+    componentDependencyModelManager.delete(vspId, vspVersion, dependencyId);
+    return Response.ok().build();
+  }
+
+  @Override
+  public Response update(ComponentDependencyModel request, String vspId, String versionId, String
+      dependencyId, String user) {
+
+    MdcUtil.initMdc(LoggerServiceName.UPDATE_COMPONENT_DEPENDENCY.toString());
+
+    final Version version = new Version(versionId);
+    ComponentDependencyModelEntity modelEntity =
+        new MapComponentDependencyModelRequestToEntity().applyMapping(request,
+            ComponentDependencyModelEntity.class);
+
+    modelEntity.setId(dependencyId);
+    modelEntity.setVspId(vspId);
+    modelEntity.setVersion(version);
+    componentDependencyModelManager.update(modelEntity);
+    return Response.ok().build();
+  }
+
+  @Override
+  public Response get(String vspId, String version, String dependencyId, String user) {
+    MdcUtil.initMdc(LoggerServiceName.GET_COMPONENT_DEPENDENCY.toString());
+    ComponentDependencyModelEntity componentDependencyModelEntity = componentDependencyModelManager
+        .get(vspId, new Version(version), dependencyId);
+
+    MapComponentDependencyEntityToDto mapper = new MapComponentDependencyEntityToDto();
+    ComponentDependencyResponseDto componentDependencyResponseDto =
+        mapper.applyMapping(componentDependencyModelEntity, ComponentDependencyResponseDto.class);
+
+    return Response.ok(componentDependencyModelEntity != null ? componentDependencyResponseDto :
+        null).build();
+  }
+
+}
\ No newline at end of file
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentDependencyModelsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentDependencyModelsImpl.java
deleted file mode 100644
index 4a23140..0000000
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentDependencyModelsImpl.java
+++ /dev/null
@@ -1,78 +0,0 @@
-package org.openecomp.sdcrests.vsp.rest.services;
-
-import org.openecomp.sdc.logging.context.MdcUtil;
-import org.openecomp.sdc.logging.types.LoggerServiceName;
-import org.openecomp.sdc.vendorsoftwareproduct.ComponentDependencyModelManager;
-import org.openecomp.sdc.vendorsoftwareproduct.ComponentDependencyModelManagerFactory;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentDependencyModelEntity;
-import org.openecomp.sdc.versioning.dao.types.Version;
-import org.openecomp.sdc.versioning.types.VersionableEntityAction;
-import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentDependencyModel;
-import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentDependencyModelRequestDto;
-import org.openecomp.sdcrests.vsp.rest.ComponentDependencyModels;
-import org.openecomp.sdcrests.vsp.rest.mapping.MapComponentDependencyModelEntityToDto;
-import org.openecomp.sdcrests.vsp.rest.mapping.MapComponentDependencyModelRequestToEntity;
-
-import org.openecomp.sdcrests.wrappers.GenericCollectionWrapper;
-import org.springframework.context.annotation.Scope;
-import org.springframework.stereotype.Service;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import javax.inject.Named;
-import javax.ws.rs.core.Response;
-
-@Named
-@Service("componentDependencyModel")
-@Scope(value = "prototype")
-public class ComponentDependencyModelsImpl implements ComponentDependencyModels {
-
-  private ComponentDependencyModelManager componentDependencyModelManager =
-      ComponentDependencyModelManagerFactory.getInstance().createInterface();
-
-  @Override
-  public Response create(ComponentDependencyModelRequestDto request, String vspId,
-                         String versionId, String user) {
-    MdcUtil.initMdc(LoggerServiceName.CREATE_COMPONENT_DEPENDENCY_MODEL.toString());
-    List<ComponentDependencyModelEntity> modelEntities = new
-        ArrayList<ComponentDependencyModelEntity>();
-
-    final Version version = resolveVspVersion(vspId, null, user, VersionableEntityAction.Write);
-
-    if (request.getComponentDependencyModels() != null) {
-      for(ComponentDependencyModel model : request.getComponentDependencyModels()) {
-        ComponentDependencyModelEntity modelEntity =
-            new MapComponentDependencyModelRequestToEntity().applyMapping(model,
-                ComponentDependencyModelEntity.class);
-
-        modelEntity.setVspId(vspId);
-        modelEntity.setVersion(version);
-        modelEntities.add(modelEntity);
-      }
-    }
-
-    componentDependencyModelManager
-        .createComponentDependencyModel(modelEntities, vspId, version, user);
-
-    return Response.ok().build();
-  }
-
-  @Override
-  public Response list(String vspId, String versionId, String user) {
-    MdcUtil.initMdc(LoggerServiceName.GET_COMPONENT_DEPENDENCY_MODEL.toString());
-    Version vspVersion = resolveVspVersion(vspId, versionId, user, VersionableEntityAction.Read);
-
-    Collection<ComponentDependencyModelEntity> componentDependencies =
-        componentDependencyModelManager.list(vspId, vspVersion, user);
-
-    MapComponentDependencyModelEntityToDto mapper = new MapComponentDependencyModelEntityToDto();
-    GenericCollectionWrapper<ComponentDependencyModel> results = new GenericCollectionWrapper
-        <ComponentDependencyModel>();
-    for (ComponentDependencyModelEntity entity : componentDependencies) {
-      results.add(mapper.applyMapping(entity, ComponentDependencyModel.class));
-    }
-
-    return Response.ok(results).build();
-  }
-}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentMonitoringUploadsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentMonitoringUploadsImpl.java
index a971782..a997d94 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentMonitoringUploadsImpl.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentMonitoringUploadsImpl.java
@@ -16,7 +16,6 @@
 import org.openecomp.sdc.vendorsoftwareproduct.MonitoringUploadsManagerFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.MonitoringUploadStatus;
 import org.openecomp.sdc.versioning.dao.types.Version;
-import org.openecomp.sdc.versioning.types.VersionableEntityAction;
 import org.openecomp.sdcrests.vendorsoftwareproducts.types.MonitoringUploadStatusDto;
 import org.openecomp.sdcrests.vsp.rest.ComponentMonitoringUploads;
 import org.openecomp.sdcrests.vsp.rest.mapping.MapMonitoringUploadStatusToDto;
@@ -54,13 +53,13 @@
     logger.audit(AuditMessages.AUDIT_MSG + String.format(AuditMessages
         .UPLOAD_MONITORING_FILE, type, vspId, componentId));
 
-    Version version = resolveVspVersion(vspId, null, user, VersionableEntityAction.Write);
-    componentManager.validateComponentExistence(vspId, version, componentId, user);
+    Version version = new Version(versionId);
+    componentManager.validateComponentExistence(vspId, version, componentId);
 
     MonitoringUploadType monitoringUploadType = getMonitoringUploadType(vspId, componentId, type);
     monitoringUploadsManager.upload(attachment.getObject(InputStream.class),
         attachment.getContentDisposition().getParameter("filename"), vspId, version, componentId,
-        monitoringUploadType, user);
+        monitoringUploadType);
 
     mdcDataDebugMessage.debugExitMessage("VSP id, component id", vspId + "," + componentId);
     return Response.ok().build();
@@ -88,10 +87,9 @@
 
     MonitoringUploadType monitoringUploadType = getMonitoringUploadType(vspId, componentId, type);
 
-    Version version = resolveVspVersion(vspId, null, user, VersionableEntityAction.Write);
-    componentManager.validateComponentExistence(vspId, version, componentId, user);
-    monitoringUploadsManager
-        .delete(vspId, version, componentId, monitoringUploadType, user);
+    Version version = new Version(versionId);
+    componentManager.validateComponentExistence(vspId, version, componentId);
+    monitoringUploadsManager.delete(vspId, version, componentId, monitoringUploadType);
 
     mdcDataDebugMessage.debugExitMessage("VSP id, component id", vspId + "," + componentId);
     return Response.ok().build();
@@ -102,16 +100,15 @@
                        String user) {
     MdcUtil.initMdc(LoggerServiceName.List_Monitoring_Artifacts.toString());
 
-    Version version = resolveVspVersion(vspId, versionId, user, VersionableEntityAction.Read);
-    componentManager.validateComponentExistence(vspId, version, componentId, user);
+    Version version = new Version(versionId);
+    componentManager.validateComponentExistence(vspId, version, componentId);
 
-    MonitoringUploadStatus response = monitoringUploadsManager
-        .listFilenames(vspId, version, componentId, user);
+    MonitoringUploadStatus response =
+        monitoringUploadsManager.listFilenames(vspId, version, componentId);
 
     MonitoringUploadStatusDto returnEntity =
         new MapMonitoringUploadStatusToDto()
             .applyMapping(response, MonitoringUploadStatusDto.class);
     return Response.status(Response.Status.OK).entity(returnEntity).build();
-
   }
 }
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentProcessesImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentProcessesImpl.java
index abcb3c5..bad6f16 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentProcessesImpl.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentProcessesImpl.java
@@ -21,6 +21,10 @@
 package org.openecomp.sdcrests.vsp.rest.services;
 
 import org.apache.cxf.jaxrs.ext.multipart.Attachment;
+import org.openecomp.sdc.activitylog.ActivityLogManager;
+import org.openecomp.sdc.activitylog.ActivityLogManagerFactory;
+import org.openecomp.sdc.activitylog.dao.type.ActivityLogEntity;
+import org.openecomp.sdc.activitylog.dao.type.ActivityType;
 import org.openecomp.sdc.logging.api.Logger;
 import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.openecomp.sdc.logging.context.MdcUtil;
@@ -30,10 +34,8 @@
 import org.openecomp.sdc.vendorsoftwareproduct.ComponentManagerFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.ProcessManager;
 import org.openecomp.sdc.vendorsoftwareproduct.ProcessManagerFactory;
-import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity;
 import org.openecomp.sdc.versioning.dao.types.Version;
-import org.openecomp.sdc.versioning.types.VersionableEntityAction;
 import org.openecomp.sdcrests.vendorsoftwareproducts.types.ProcessEntityDto;
 import org.openecomp.sdcrests.vendorsoftwareproducts.types.ProcessRequestDto;
 import org.openecomp.sdcrests.vsp.rest.ComponentProcesses;
@@ -50,8 +52,6 @@
 import java.io.InputStream;
 import java.util.Collection;
 
-import static org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants.GENERAL_COMPONENT_ID;
-
 @Named
 @Service("componentProcesses")
 @Scope(value = "prototype")
@@ -60,21 +60,18 @@
   private ProcessManager processManager = ProcessManagerFactory.getInstance().createInterface();
   private ComponentManager componentManager =
       ComponentManagerFactory.getInstance().createInterface();
-    private static final Logger logger =
-            LoggerFactory.getLogger(ComponentProcessesImpl.class);
+  private ActivityLogManager activityLogManager =
+      ActivityLogManagerFactory.getInstance().createInterface();
+
+  private static final Logger logger =
+      LoggerFactory.getLogger(ComponentProcessesImpl.class);
 
   @Override
   public Response list(String vspId, String versionId, String componentId, String user) {
     MdcUtil.initMdc(LoggerServiceName.List_Component_Processes.toString());
-    Version vspVersion = resolveVspVersion(vspId, versionId, user, VersionableEntityAction.Read);
-    validateComponentExistence(vspId, vspVersion, componentId, user);
-    Collection<ProcessEntity> processes;
-    if (componentId.equals(VendorSoftwareProductConstants.GENERAL_COMPONENT_ID)) {
-      processes = processManager.listProcesses(vspId, vspVersion, null, user);
-    } else {
-      processes = processManager.listProcesses(vspId, vspVersion, componentId, user);
-    }
-
+    Version version = new Version(versionId);
+    validateComponentExistence(vspId, version, componentId, user);
+    Collection<ProcessEntity> processes = processManager.listProcesses(vspId, version, componentId);
 
     MapProcessEntityToProcessEntityDto mapper = new MapProcessEntityToProcessEntityDto();
     GenericCollectionWrapper<ProcessEntityDto> results = new GenericCollectionWrapper<>();
@@ -88,9 +85,9 @@
   @Override
   public Response deleteList(String vspId, String versionId, String componentId, String user) {
     MdcUtil.initMdc(LoggerServiceName.Delete_List_Component_Processes.toString());
-    Version version = resolveVspVersion(vspId, null, user, VersionableEntityAction.Write);
+    Version version = new Version(versionId);
     validateComponentExistence(vspId, version, componentId, user);
-    processManager.deleteProcesses(vspId, version, componentId, user);
+    processManager.deleteProcesses(vspId, version, componentId);
 
     return Response.ok().build();
   }
@@ -102,13 +99,11 @@
     ProcessEntity process =
         new MapProcessRequestDtoToProcessEntity().applyMapping(request, ProcessEntity.class);
     process.setVspId(vspId);
-    process.setVersion(resolveVspVersion(vspId, null, user, VersionableEntityAction.Write));
-    if (!componentId.equals(VendorSoftwareProductConstants.GENERAL_COMPONENT_ID)) {
-      process.setComponentId(componentId);
-    }
+    process.setVersion(new Version(versionId));
+    process.setComponentId(componentId);
 
     validateComponentExistence(vspId, process.getVersion(), componentId, user);
-    ProcessEntity createdProcess = processManager.createProcess(process, user);
+    ProcessEntity createdProcess = processManager.createProcess(process);
 
     return Response
         .ok(createdProcess != null ? new StringWrapperResponse(createdProcess.getId()) : null)
@@ -119,10 +114,9 @@
   public Response get(String vspId, String versionId, String componentId, String processId,
                       String user) {
     MdcUtil.initMdc(LoggerServiceName.Get_Component_Processes.toString());
-    Version vspVersion = resolveVspVersion(vspId, versionId, user, VersionableEntityAction.Read);
-    validateComponentExistence(vspId, vspVersion, componentId, user);
-    ProcessEntity process =
-        processManager.getProcess(vspId, vspVersion, componentId, processId, user);
+    Version version = new Version(versionId);
+    validateComponentExistence(vspId, version, componentId, user);
+    ProcessEntity process = processManager.getProcess(vspId, version, componentId, processId);
     ProcessEntityDto result =
         new MapProcessEntityToProcessEntityDto().applyMapping(process, ProcessEntityDto.class);
     return Response.ok(result).build();
@@ -132,9 +126,9 @@
   public Response delete(String vspId, String versionId, String componentId, String processId,
                          String user) {
     MdcUtil.initMdc(LoggerServiceName.Delete_Component_Processes.toString());
-    Version version = resolveVspVersion(vspId, null, user, VersionableEntityAction.Write);
+    Version version = new Version(versionId);
     validateComponentExistence(vspId, version, componentId, user);
-    processManager.deleteProcess(vspId, version, componentId, processId, user);
+    processManager.deleteProcess(vspId, version, componentId, processId);
     return Response.ok().build();
   }
 
@@ -146,11 +140,11 @@
     ProcessEntity process =
         new MapProcessRequestDtoToProcessEntity().applyMapping(request, ProcessEntity.class);
     process.setVspId(vspId);
-    process.setVersion(resolveVspVersion(vspId, null, user, VersionableEntityAction.Write));
+    process.setVersion(new Version(versionId));
     process.setComponentId(componentId);
     process.setId(processId);
     validateComponentExistence(vspId, process.getVersion(), componentId, user);
-    processManager.updateProcess(process, user);
+    processManager.updateProcess(process);
     return Response.ok().build();
   }
 
@@ -158,9 +152,9 @@
   public Response getUploadedFile(String vspId, String versionId, String componentId,
                                   String processId, String user) {
     MdcUtil.initMdc(LoggerServiceName.Get_Uploaded_File_Component_Processes.toString());
-    Version vspVersion = resolveVspVersion(vspId, versionId, user, VersionableEntityAction.Read);
+    Version vspVersion = new Version(versionId);
     validateComponentExistence(vspId, vspVersion, componentId, user);
-    File file = processManager.getProcessArtifact(vspId, vspVersion, componentId, processId, user);
+    File file = processManager.getProcessArtifact(vspId, vspVersion, componentId, processId);
 
     Response.ResponseBuilder response = Response.ok(file);
     if (file == null) {
@@ -175,9 +169,9 @@
                                      String processId,
                                      String user) {
     MdcUtil.initMdc(LoggerServiceName.Delete_Uploaded_File_Component_Processes.toString());
-    Version version = resolveVspVersion(vspId, null, user, VersionableEntityAction.Write);
+    Version version = new Version(versionId);
     validateComponentExistence(vspId, version, componentId, user);
-    processManager.deleteProcessArtifact(vspId, version, componentId, processId, user);
+    processManager.deleteProcessArtifact(vspId, version, componentId, processId);
     return Response.ok().build();
   }
 
@@ -186,21 +180,26 @@
                              String componentId,
                              String processId, String user) {
     MdcUtil.initMdc(LoggerServiceName.Upload_File_Component_Processes.toString());
-      logger.audit(AuditMessages.AUDIT_MSG + AuditMessages.UPLOAD_PROCESS_ARTIFACT + vspId);
-    Version version = resolveVspVersion(vspId, null, user, VersionableEntityAction.Write);
+    logger.audit(AuditMessages.AUDIT_MSG + AuditMessages.UPLOAD_PROCESS_ARTIFACT + vspId);
+    Version version = new Version(versionId);
     validateComponentExistence(vspId, version, componentId, user);
     processManager.uploadProcessArtifact(attachment.getObject(InputStream.class),
         attachment.getContentDisposition().getParameter("filename"), vspId, version, componentId,
-        processId, user);
+        processId);
+
+
+    activityLogManager.logActivity(new ActivityLogEntity(vspId, version,
+        ActivityType.Upload_Artifact, user, true, "", ""));
+
     return Response.ok().build();
   }
 
 
   private void validateComponentExistence(String vspId, Version version, String componentId,
                                           String user) {
-    if (GENERAL_COMPONENT_ID.equals(componentId)) {
+    if (componentId == null) {
       return;
     }
-    componentManager.validateComponentExistence(vspId, version, componentId, user);
+    componentManager.validateComponentExistence(vspId, version, componentId);
   }
 }
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentsImpl.java
index fa7e924..de422ec 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentsImpl.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentsImpl.java
@@ -31,7 +31,6 @@
 import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentData;
 import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityValidationData;
 import org.openecomp.sdc.versioning.dao.types.Version;
-import org.openecomp.sdc.versioning.types.VersionableEntityAction;
 import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentCreationDto;
 import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentDto;
 import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentRequestDto;
@@ -50,9 +49,9 @@
 import org.springframework.context.annotation.Scope;
 import org.springframework.stereotype.Service;
 
-import java.util.Collection;
 import javax.inject.Named;
 import javax.ws.rs.core.Response;
+import java.util.Collection;
 
 @Named
 @Service("components")
@@ -65,8 +64,7 @@
   public Response list(String vspId, String versionId, String user) {
     MdcUtil.initMdc(LoggerServiceName.List_Components.toString());
     Collection<ComponentEntity> components =
-        componentManager.listComponents(vspId, resolveVspVersion(vspId, versionId, user,
-            VersionableEntityAction.Read), user);
+        componentManager.listComponents(vspId, new Version(versionId));
 
     MapComponentEntityToComponentDto mapper = new MapComponentEntityToComponentDto();
     GenericCollectionWrapper<ComponentDto> results = new GenericCollectionWrapper<>();
@@ -80,8 +78,7 @@
   @Override
   public Response deleteList(String vspId, String versionId, String user) {
     MdcUtil.initMdc(LoggerServiceName.Delete_List_Components.toString());
-    Version version = resolveVspVersion(vspId, null, user, VersionableEntityAction.Write);
-    componentManager.deleteComponents(vspId, version, user);
+    componentManager.deleteComponents(vspId, new Version(versionId));
     return Response.ok().build();
   }
 
@@ -91,9 +88,9 @@
     ComponentEntity component =
         new MapComponentRequestDtoToComponentEntity().applyMapping(request, ComponentEntity.class);
     component.setVspId(vspId);
-    component.setVersion(resolveVspVersion(vspId, null, user, VersionableEntityAction.Write));
+    component.setVersion(new Version(versionId));
 
-    ComponentEntity createdComponent = componentManager.createComponent(component, user);
+    ComponentEntity createdComponent = componentManager.createComponent(component);
     MapComponentEntityToComponentCreationDto mapping =
         new MapComponentEntityToComponentCreationDto();
     ComponentCreationDto createdComponentDto = mapping.applyMapping(createdComponent,
@@ -106,9 +103,8 @@
   @Override
   public Response get(String vspId, String versionId, String componentId, String user) {
     MdcUtil.initMdc(LoggerServiceName.Get_Component.toString());
-    CompositionEntityResponse<ComponentData> response = componentManager
-        .getComponent(vspId, resolveVspVersion(vspId, versionId, user, VersionableEntityAction.Read),
-            componentId, user);
+    CompositionEntityResponse<ComponentData> response =
+        componentManager.getComponent(vspId, new Version(versionId), componentId);
 
     CompositionEntityResponseDto<ComponentDto> responseDto = new CompositionEntityResponseDto<>();
     new MapCompositionEntityResponseToDto<>(new MapComponentDataToComponentDto(),
@@ -119,23 +115,23 @@
   @Override
   public Response delete(String vspId, String versionId, String componentId, String user) {
     MdcUtil.initMdc(LoggerServiceName.Delete_Component.toString());
-    Version version = resolveVspVersion(vspId, null, user, VersionableEntityAction.Write);
-    componentManager.deleteComponent(vspId, version, componentId, user);
+    componentManager.deleteComponent(vspId, new Version(versionId), componentId);
     return Response.ok().build();
   }
 
   @Override
-  public Response update(ComponentRequestDto request, String vspId, String versionId, String componentId,
+  public Response update(ComponentRequestDto request, String vspId, String versionId,
+                         String componentId,
                          String user) {
     MdcUtil.initMdc(LoggerServiceName.Update_Component.toString());
     ComponentEntity componentEntity =
         new MapComponentRequestDtoToComponentEntity().applyMapping(request, ComponentEntity.class);
     componentEntity.setVspId(vspId);
-    componentEntity.setVersion(resolveVspVersion(vspId, null, user, VersionableEntityAction.Write));
+    componentEntity.setVersion(new Version(versionId));
     componentEntity.setId(componentId);
 
     CompositionEntityValidationData validationData =
-        componentManager.updateComponent(componentEntity, user);
+        componentManager.updateComponent(componentEntity);
     return validationData != null && CollectionUtils.isNotEmpty(validationData.getErrors())
         ? Response.status(Response.Status.EXPECTATION_FAILED).entity(
         new MapCompositionEntityValidationDataToDto().applyMapping(validationData,
@@ -143,12 +139,11 @@
   }
 
   @Override
-  public Response getQuestionnaire(String vspId, String versionId, String componentId, String user) {
+  public Response getQuestionnaire(String vspId, String versionId, String componentId,
+                                   String user) {
     MdcUtil.initMdc(LoggerServiceName.Get_Questionnaire_Component.toString());
-    QuestionnaireResponse questionnaireResponse = componentManager
-        .getQuestionnaire(vspId,
-            resolveVspVersion(vspId, versionId, user, VersionableEntityAction.Read), componentId,
-            user);
+    QuestionnaireResponse questionnaireResponse =
+        componentManager.getQuestionnaire(vspId, new Version(versionId), componentId);
 
     QuestionnaireResponseDto result = new MapQuestionnaireResponseToQuestionnaireResponseDto()
         .applyMapping(questionnaireResponse, QuestionnaireResponseDto.class);
@@ -156,11 +151,11 @@
   }
 
   @Override
-  public Response updateQuestionnaire(String questionnaireData, String vspId, String versionId, String componentId,
-                                      String user) {
+  public Response updateQuestionnaire(String questionnaireData, String vspId, String versionId,
+                                      String componentId, String user) {
     MdcUtil.initMdc(LoggerServiceName.Update_Questionnaire_Component.toString());
-    Version version = resolveVspVersion(vspId, null, user, VersionableEntityAction.Write);
-    componentManager.updateQuestionnaire(vspId, version, componentId, questionnaireData, user);
+    componentManager
+        .updateQuestionnaire(vspId, new Version(versionId), componentId, questionnaireData);
     return Response.ok().build();
   }
 }
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComputeImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComputeImpl.java
index 599b5ad..081024a 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComputeImpl.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComputeImpl.java
@@ -14,7 +14,6 @@
 import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityValidationData;
 import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComputeData;
 import org.openecomp.sdc.versioning.dao.types.Version;
-import org.openecomp.sdc.versioning.types.VersionableEntityAction;
 import org.openecomp.sdcrests.vendorsoftwareproducts.types.CompositionEntityResponseDto;
 import org.openecomp.sdcrests.vendorsoftwareproducts.types.CompositionEntityValidationDataDto;
 import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComputeCreationDto;
@@ -33,9 +32,9 @@
 import org.springframework.context.annotation.Scope;
 import org.springframework.stereotype.Service;
 
-import java.util.Collection;
 import javax.inject.Named;
 import javax.ws.rs.core.Response;
+import java.util.Collection;
 
 @Named
 @Service("computes")
@@ -47,13 +46,12 @@
       ComponentManagerFactory.getInstance().createInterface();
 
   @Override
-  public Response list(String vspId, String version, String componentId, String user) {
+  public Response list(String vspId, String versionId, String componentId, String user) {
     MdcUtil.initMdc(LoggerServiceName.List_Computes.toString());
-    Version vspVersion = resolveVspVersion(vspId, version, user, VersionableEntityAction.Read);
-    componentManager.validateComponentExistence(vspId, vspVersion, componentId, user);
+    Version version = new Version(versionId);
+    componentManager.validateComponentExistence(vspId, version, componentId);
     Collection<ListComputeResponse> computes =
-        computetManager
-            .listCompute(vspId, vspVersion, componentId, user);
+        computetManager.listComputes(vspId, version, componentId);
 
     MapComputeEntityToComputeDto mapper = new MapComputeEntityToComputeDto();
     GenericCollectionWrapper<ComputeDto> results = new GenericCollectionWrapper<>();
@@ -65,13 +63,13 @@
   }
 
   @Override
-  public Response get(String vspId, String version, String componentId, String computeId,
+  public Response get(String vspId, String versionId, String componentId, String computeId,
                       String user) {
     MdcUtil.initMdc(LoggerServiceName.Get_Compute.toString());
-    Version vspVersion = resolveVspVersion(vspId, version, user, VersionableEntityAction.Read);
-    componentManager.validateComponentExistence(vspId, vspVersion, componentId, user);
-    CompositionEntityResponse<ComputeData> response = computetManager
-        .getCompute(vspId, vspVersion, componentId, computeId, user);
+    Version version = new Version(versionId);
+    componentManager.validateComponentExistence(vspId, version, componentId);
+    CompositionEntityResponse<ComputeData> response =
+        computetManager.getCompute(vspId, version, componentId, computeId);
 
     CompositionEntityResponseDto<ComputeDetailsDto> responseDto = new
         CompositionEntityResponseDto<>();
@@ -87,33 +85,31 @@
     ComputeEntity compute = new MapComputeDetailsDtoToComputeEntity().applyMapping(request,
         ComputeEntity.class);
     compute.setVspId(vspId);
+    compute.setVersion(new Version(versionId));
     compute.setComponentId(componentId);
-    compute.setVersion(resolveVspVersion(vspId, null, user, VersionableEntityAction.Write));
-    componentManager.validateComponentExistence(vspId, compute.getVersion(), componentId, user);
+    componentManager.validateComponentExistence(vspId, compute.getVersion(), componentId);
 
-    ComputeEntity createdCompute = computetManager.createCompute(compute, user);
+    ComputeEntity createdCompute = computetManager.createCompute(compute);
 
     MapComputeEntityToComputeCreationDto mapper = new MapComputeEntityToComputeCreationDto();
-    ComputeCreationDto createdComputeDto = mapper.applyMapping(createdCompute, ComputeCreationDto
-        .class);
-    return Response.ok(createdComputeDto != null ? createdComputeDto : null)
-        .build();
+    ComputeCreationDto createdComputeDto =
+        mapper.applyMapping(createdCompute, ComputeCreationDto.class);
+    return Response.ok(createdComputeDto != null ? createdComputeDto : null).build();
   }
 
   @Override
-  public Response update(ComputeDetailsDto request, String vspId, String versionId, String
-      componentId, String computeFlavorId, String user) {
+  public Response update(ComputeDetailsDto request, String vspId, String versionId,
+                         String componentId, String computeFlavorId, String user) {
     MdcUtil.initMdc(LoggerServiceName.Update_Compute.toString());
-    ComputeEntity compute = new MapComputeDetailsDtoToComputeEntity().applyMapping(request,
-        ComputeEntity.class);
+    ComputeEntity compute =
+        new MapComputeDetailsDtoToComputeEntity().applyMapping(request, ComputeEntity.class);
     compute.setVspId(vspId);
+    compute.setVersion(new Version(versionId));
     compute.setComponentId(componentId);
-    compute.setVersion(resolveVspVersion(vspId, null, user, VersionableEntityAction.Write));
     compute.setId(computeFlavorId);
 
-    componentManager.validateComponentExistence(vspId, compute.getVersion(), componentId, user);
-    CompositionEntityValidationData validationData =
-        computetManager.updateCompute(compute, user);
+    componentManager.validateComponentExistence(vspId, compute.getVersion(), componentId);
+    CompositionEntityValidationData validationData = computetManager.updateCompute(compute);
     return validationData != null && CollectionUtils.isNotEmpty(validationData.getErrors())
         ? Response.status(Response.Status.EXPECTATION_FAILED).entity(
         new MapCompositionEntityValidationDataToDto().applyMapping(validationData,
@@ -121,23 +117,23 @@
   }
 
   @Override
-  public Response delete(String vspId, String versionId, String componentId, String
-      computeFlavorId, String user) {
+  public Response delete(String vspId, String versionId, String componentId, String computeFlavorId,
+                         String user) {
     MdcUtil.initMdc(LoggerServiceName.Delete_Compute.toString());
-    Version version = resolveVspVersion(vspId, null, user, VersionableEntityAction.Write);
-    componentManager.validateComponentExistence(vspId, version, componentId, user);
-    computetManager.deleteCompute(vspId, version, componentId, computeFlavorId, user);
+    Version version = new Version(versionId);
+    componentManager.validateComponentExistence(vspId, version, componentId);
+    computetManager.deleteCompute(vspId, version, componentId, computeFlavorId);
     return Response.ok().build();
   }
 
   @Override
-  public Response getQuestionnaire(String vspId, String versionId, String componentId, String
-      computeFlavorId, String user) {
+  public Response getQuestionnaire(String vspId, String versionId, String componentId,
+                                   String computeFlavorId, String user) {
     MdcUtil.initMdc(LoggerServiceName.Get_Questionnaire_Compute.toString());
-    Version vspVersion = resolveVspVersion(vspId, versionId, user, VersionableEntityAction.Read);
-    componentManager.validateComponentExistence(vspId, vspVersion, componentId, user);
-    QuestionnaireResponse questionnaireResponse = computetManager
-        .getComputeQuestionnaire(vspId, vspVersion, componentId, computeFlavorId, user);
+    Version version = new Version(versionId);
+    componentManager.validateComponentExistence(vspId, version, componentId);
+    QuestionnaireResponse questionnaireResponse =
+        computetManager.getComputeQuestionnaire(vspId, version, componentId, computeFlavorId);
 
     QuestionnaireResponseDto result = new MapQuestionnaireResponseToQuestionnaireResponseDto()
         .applyMapping(questionnaireResponse, QuestionnaireResponseDto.class);
@@ -146,16 +142,12 @@
 
   @Override
   public Response updateQuestionnaire(String questionnaireData, String vspId, String versionId,
-                                      String componentId,
-                                      String computeFlavorId, String user) {
-    MdcUtil
-        .initMdc(LoggerServiceName.Update_Questionnaire_Compute.toString()
-        );
-    Version version = resolveVspVersion(vspId, null, user, VersionableEntityAction.Write);
-    componentManager.validateComponentExistence(vspId, version, componentId, user);
-    computetManager
-        .updateComputeQuestionnaire(vspId, version, componentId, computeFlavorId,
-            questionnaireData, user);
+                                      String componentId, String computeFlavorId, String user) {
+    MdcUtil.initMdc(LoggerServiceName.Update_Questionnaire_Compute.toString());
+    Version version = new Version(versionId);
+    componentManager.validateComponentExistence(vspId, version, componentId);
+    computetManager.updateComputeQuestionnaire(vspId, version, componentId, computeFlavorId,
+        questionnaireData);
     return Response.ok().build();
   }
 }
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/DeploymentFlavorsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/DeploymentFlavorsImpl.java
index 0337226..d1486b6 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/DeploymentFlavorsImpl.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/DeploymentFlavorsImpl.java
@@ -10,7 +10,6 @@
 import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityValidationData;
 import org.openecomp.sdc.vendorsoftwareproduct.types.composition.DeploymentFlavor;
 import org.openecomp.sdc.versioning.dao.types.Version;
-import org.openecomp.sdc.versioning.types.VersionableEntityAction;
 import org.openecomp.sdcrests.vendorsoftwareproducts.types.CompositionEntityResponseDto;
 import org.openecomp.sdcrests.vendorsoftwareproducts.types.CompositionEntityValidationDataDto;
 import org.openecomp.sdcrests.vendorsoftwareproducts.types.DeploymentFlavorCreationDto;
@@ -28,15 +27,14 @@
 import org.springframework.context.annotation.Scope;
 import org.springframework.stereotype.Service;
 
-import java.util.Collection;
 import javax.inject.Named;
 import javax.ws.rs.core.Response;
+import java.util.Collection;
 
 @Named
 @Service("deploymentFlavors")
 @Scope(value = "prototype")
-public class DeploymentFlavorsImpl implements DeploymentFlavors
-{
+public class DeploymentFlavorsImpl implements DeploymentFlavors {
   private DeploymentFlavorManager deploymentFlavorManager =
       DeploymentFlavorManagerFactory.getInstance().createInterface();
 
@@ -48,29 +46,28 @@
         new MapDeploymentFlavorRequestDtoToDeploymentFlavorEntity()
             .applyMapping(request, DeploymentFlavorEntity.class);
     deploymentFlavorEntity.setVspId(vspId);
-    deploymentFlavorEntity.setVersion(resolveVspVersion(vspId, null, user,
-        VersionableEntityAction.Write));
+    deploymentFlavorEntity.setVersion(new Version(versionId));
     DeploymentFlavorEntity createdDeploymentFlavor =
-        deploymentFlavorManager.createDeploymentFlavor(deploymentFlavorEntity, user);
+        deploymentFlavorManager.createDeploymentFlavor(deploymentFlavorEntity);
     MapDeploymentFlavorEntityToDeploymentFlavorCreationDto mapping =
         new MapDeploymentFlavorEntityToDeploymentFlavorCreationDto();
-    DeploymentFlavorCreationDto deploymentFlavorCreatedDto= mapping.applyMapping
-        (createdDeploymentFlavor,DeploymentFlavorCreationDto.class);
+    DeploymentFlavorCreationDto deploymentFlavorCreatedDto = mapping.applyMapping
+        (createdDeploymentFlavor, DeploymentFlavorCreationDto.class);
     return Response
         .ok(createdDeploymentFlavor != null ? deploymentFlavorCreatedDto : null)
         .build();
   }
 
   @Override
-  public Response list(String vspId,String version,String user) {
+  public Response list(String vspId, String versionId, String user) {
     MdcUtil.initMdc(LoggerServiceName.Get_List_Deployment_flavor.toString());
     Collection<DeploymentFlavorEntity> deploymentFlavors =
-        deploymentFlavorManager.listDeploymentFlavors(vspId, resolveVspVersion(vspId, version, user,
-            VersionableEntityAction.Read), user);
+        deploymentFlavorManager.listDeploymentFlavors(vspId, new Version(versionId));
 
     MapDeploymentFlavorEntityDeploymentFlavorToListResponse mapper = new
         MapDeploymentFlavorEntityDeploymentFlavorToListResponse();
-    GenericCollectionWrapper<DeploymentFlavorListResponseDto> results = new GenericCollectionWrapper<>();
+    GenericCollectionWrapper<DeploymentFlavorListResponseDto> results =
+        new GenericCollectionWrapper<>();
     for (DeploymentFlavorEntity deploymentFlavor : deploymentFlavors) {
       results.add(mapper.applyMapping(deploymentFlavor, DeploymentFlavorListResponseDto.class));
     }
@@ -78,32 +75,32 @@
   }
 
   @Override
-  public Response get(String vspId, String version, String deploymentFlavorId, String user) {
+  public Response get(String vspId, String versionId, String deploymentFlavorId, String user) {
     MdcUtil.initMdc(LoggerServiceName.Get_Deployment_flavor.toString());
     CompositionEntityResponse<DeploymentFlavor> response = deploymentFlavorManager
-        .getDeploymentFlavor(vspId, resolveVspVersion(vspId, version, user,
-            VersionableEntityAction.Read), deploymentFlavorId, user);
+        .getDeploymentFlavor(vspId, new Version(versionId), deploymentFlavorId);
 
     CompositionEntityResponseDto<DeploymentFlavorDto> responseDto = new
         CompositionEntityResponseDto<>();
-    new MapCompositionEntityResponseToDto<>(new MapDeploymentFlavorToDeploymentDto(), DeploymentFlavorDto.class)
+    new MapCompositionEntityResponseToDto<>(new MapDeploymentFlavorToDeploymentDto(),
+        DeploymentFlavorDto.class)
         .doMapping(response, responseDto);
     return Response.ok(responseDto).build();
   }
 
   @Override
-  public Response getSchema(String vspId, String version, String user) {
+  public Response getSchema(String vspId, String versionId, String user) {
     MdcUtil.initMdc(LoggerServiceName.Get_Deployment_flavor.toString());
     CompositionEntityResponse<DeploymentFlavor> response = deploymentFlavorManager
-        .getDeploymentFlavorSchema(vspId, Version.valueOf(version), user);
+        .getDeploymentFlavorSchema(vspId, new Version(versionId));
     return Response.ok(response).build();
   }
 
   @Override
   public Response delete(String vspId, String versionId, String deploymentFlavorId, String user) {
     MdcUtil.initMdc(LoggerServiceName.Delete_Deployment_flavor.toString());
-    Version version = resolveVspVersion(vspId, null, user, VersionableEntityAction.Write);
-    deploymentFlavorManager.deleteDeploymentFlavor(vspId, version, deploymentFlavorId, user);
+    Version version = new Version(versionId);
+    deploymentFlavorManager.deleteDeploymentFlavor(vspId, version, deploymentFlavorId);
     return Response.ok().build();
   }
 
@@ -115,11 +112,11 @@
         new MapDeploymentFlavorRequestDtoToDeploymentFlavorEntity().applyMapping(request,
             DeploymentFlavorEntity.class);
     deploymentFlavorEntity.setVspId(vspId);
-    deploymentFlavorEntity.setVersion(resolveVspVersion(vspId, null, user, VersionableEntityAction.Write));
+    deploymentFlavorEntity.setVersion(new Version(versionId));
     deploymentFlavorEntity.setId(deploymentFlavorId);
 
     CompositionEntityValidationData validationData =
-        deploymentFlavorManager.updateDeploymentFlavor(deploymentFlavorEntity, user);
+        deploymentFlavorManager.updateDeploymentFlavor(deploymentFlavorEntity);
     return validationData != null && CollectionUtils.isNotEmpty(validationData.getErrors())
         ? Response.status(Response.Status.EXPECTATION_FAILED).entity(
         new MapCompositionEntityValidationDataToDto().applyMapping(validationData,
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ImagesImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ImagesImpl.java
index fcaf038..b8e0f64 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ImagesImpl.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ImagesImpl.java
@@ -14,7 +14,6 @@
 import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityValidationData;
 import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Image;
 import org.openecomp.sdc.versioning.dao.types.Version;
-import org.openecomp.sdc.versioning.types.VersionableEntityAction;
 import org.openecomp.sdcrests.vendorsoftwareproducts.types.CompositionEntityValidationDataDto;
 import org.openecomp.sdcrests.vendorsoftwareproducts.types.ImageCreationDto;
 import org.openecomp.sdcrests.vendorsoftwareproducts.types.ImageDto;
@@ -30,32 +29,31 @@
 import org.springframework.context.annotation.Scope;
 import org.springframework.stereotype.Service;
 
-import java.util.Collection;
 import javax.inject.Named;
 import javax.ws.rs.core.Response;
+import java.util.Collection;
 
 
 @Named
 @Service("images")
 @Scope(value = "prototype")
-public class ImagesImpl implements Images
- {
+public class ImagesImpl implements Images {
 
   private ImageManager imageManager = ImageManagerFactory.getInstance().createInterface();
   private ComponentManager componentManager =
       ComponentManagerFactory.getInstance().createInterface();
 
   @Override
-  public Response create(ImageRequestDto request, String vspId, String versionId,String
-      componentId, String user) {
+  public Response create(ImageRequestDto request, String vspId, String versionId,
+                         String componentId, String user) {
     MdcUtil.initMdc(LoggerServiceName.Create_Image.toString());
     ImageEntity image =
         new MapImageRequestDtoToImageEntity().applyMapping(request, ImageEntity.class);
     image.setVspId(vspId);
     image.setComponentId(componentId);
-    image.setVersion(resolveVspVersion(vspId, null, user, VersionableEntityAction.Write));
-    componentManager.validateComponentExistence(vspId, image.getVersion(), componentId, user);
-    ImageEntity createdImage = imageManager.createImage(image, user);
+    image.setVersion(new Version(versionId));
+    componentManager.validateComponentExistence(vspId, image.getVersion(), componentId);
+    ImageEntity createdImage = imageManager.createImage(image);
     MapImageEntityToImageCreationDto mapping = new MapImageEntityToImageCreationDto();
     ImageCreationDto createdImageDto = mapping.applyMapping(createdImage, ImageCreationDto.class);
     return Response
@@ -66,19 +64,18 @@
   @Override
   public Response getImageSchema(String vspId, String versionId, String componentId, String user) {
     MdcUtil.initMdc(LoggerServiceName.GET_Image_Schema.toString());
-    CompositionEntityResponse<Image> response =
-        imageManager.getImageSchema(vspId, user);
+    CompositionEntityResponse<Image> response = imageManager.getImageSchema(vspId);
     return Response.ok(response).build();
   }
 
   @Override
-  public Response get(String vspId, String versionId, String componentId, String imageId, String
-      user) {
+  public Response get(String vspId, String versionId, String componentId, String imageId,
+                      String user) {
     MdcUtil.initMdc(LoggerServiceName.GET_Image.toString());
-    Version vspVersion = resolveVspVersion(vspId, versionId, user, VersionableEntityAction.Read);
-    componentManager.validateComponentExistence(vspId, vspVersion, componentId, user);
-    CompositionEntityResponse<Image> response = imageManager.getImage(vspId,
-        vspVersion, componentId, imageId, user);
+    Version version = new Version(versionId);
+    componentManager.validateComponentExistence(vspId, version, componentId);
+    CompositionEntityResponse<Image> response =
+        imageManager.getImage(vspId, version, componentId, imageId);
 
     return Response.ok(response).build();
   }
@@ -86,10 +83,9 @@
   @Override
   public Response list(String vspId, String versionId, String componentId, String user) {
     MdcUtil.initMdc(LoggerServiceName.List_Images.toString());
-    Version vspVersion = resolveVspVersion(vspId, versionId, user, VersionableEntityAction.Read);
-    componentManager.validateComponentExistence(vspId, vspVersion, componentId, user);
-    Collection<ImageEntity> images =
-        imageManager.listImages(vspId, vspVersion, componentId, user);
+    Version vspVersion = new Version(versionId);
+    componentManager.validateComponentExistence(vspId, vspVersion, componentId);
+    Collection<ImageEntity> images = imageManager.listImages(vspId, vspVersion, componentId);
 
     MapImageEntityToImageDto mapper = new MapImageEntityToImageDto();
     GenericCollectionWrapper<ImageDto> results = new GenericCollectionWrapper<>();
@@ -104,28 +100,25 @@
   public Response delete(String vspId, String versionId, String componentId, String imageId,
                          String user) {
     MdcUtil.initMdc(LoggerServiceName.Delete_Image.toString());
-    Version vspVersion = resolveVspVersion(vspId, null, user, VersionableEntityAction.Write);
-    componentManager.validateComponentExistence(vspId, vspVersion, componentId, user);
-    imageManager.deleteImage(vspId, vspVersion, componentId, imageId, user);
+    Version vspVersion = new Version(versionId);
+    componentManager.validateComponentExistence(vspId, vspVersion, componentId);
+    imageManager.deleteImage(vspId, vspVersion, componentId, imageId);
     return Response.ok().build();
   }
 
   @Override
-  public Response update(ImageRequestDto request, String vspId, String versionId, String
-                         componentId,
-                         String imageId,
-                         String user) {
+  public Response update(ImageRequestDto request, String vspId, String versionId,
+                         String componentId, String imageId, String user) {
     MdcUtil.initMdc(LoggerServiceName.Update_Image.toString());
     ImageEntity imageEntity = new MapImageRequestDtoToImageEntity().applyMapping(request,
         ImageEntity.class);
     imageEntity.setVspId(vspId);
-    imageEntity.setVersion(resolveVspVersion(vspId, null, user, VersionableEntityAction.Write));
+    imageEntity.setVersion(new Version(versionId));
     imageEntity.setComponentId(componentId);
     imageEntity.setId(imageId);
-    componentManager.validateComponentExistence(vspId, imageEntity.getVersion(), componentId, user);
+    componentManager.validateComponentExistence(vspId, imageEntity.getVersion(), componentId);
 
-    CompositionEntityValidationData validationData =
-        imageManager.updateImage(imageEntity, user);
+    CompositionEntityValidationData validationData = imageManager.updateImage(imageEntity);
     return validationData != null && CollectionUtils.isNotEmpty(validationData.getErrors())
         ? Response.status(Response.Status.EXPECTATION_FAILED).entity(
         new MapCompositionEntityValidationDataToDto()
@@ -134,14 +127,13 @@
   }
 
   @Override
-  public Response getQuestionnaire(String vspId, String versionId, String componentId, String
-      imageId, String user) {
+  public Response getQuestionnaire(String vspId, String versionId, String componentId,
+                                   String imageId, String user) {
     MdcUtil.initMdc(LoggerServiceName.Get_Questionnaire_Compute.toString());
-    Version vspVersion = resolveVspVersion(vspId, versionId, user, VersionableEntityAction.Read);
-    componentManager.validateComponentExistence(vspId, vspVersion, componentId, user);
-    QuestionnaireResponse questionnaireResponse = imageManager
-        .getImageQuestionnaire(vspId, vspVersion, componentId, imageId,
-            user);
+    Version vspVersion = new Version(versionId);
+    componentManager.validateComponentExistence(vspId, vspVersion, componentId);
+    QuestionnaireResponse questionnaireResponse =
+        imageManager.getImageQuestionnaire(vspId, vspVersion, componentId, imageId);
 
     QuestionnaireResponseDto result = new MapQuestionnaireResponseToQuestionnaireResponseDto()
         .applyMapping(questionnaireResponse, QuestionnaireResponseDto.class);
@@ -150,15 +142,12 @@
   }
 
   @Override
-  public Response updateQuestionnaire(String questionnaireData, String vspId, String
-      versionId,String componentId,String imageId, String user) {
-    MdcUtil
-        .initMdc(LoggerServiceName.Update_Questionnaire_Compute.toString()
-        );
-   Version vspVersion = resolveVspVersion(vspId, null, user, VersionableEntityAction.Write);
-   componentManager.validateComponentExistence(vspId, vspVersion, componentId, user);
-    imageManager.updateImageQuestionnaire(vspId, vspVersion, componentId, imageId,
-        questionnaireData, user);
+  public Response updateQuestionnaire(String questionnaireData, String vspId, String versionId,
+                                      String componentId, String imageId, String user) {
+    MdcUtil.initMdc(LoggerServiceName.Update_Questionnaire_Compute.toString());
+    Version version = new Version(versionId);
+    componentManager.validateComponentExistence(vspId, version, componentId);
+    imageManager.updateImageQuestionnaire(vspId, version, componentId, imageId, questionnaireData);
     return Response.ok().build();
   }
 
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/NetworksImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/NetworksImpl.java
index 471138f..5478327 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/NetworksImpl.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/NetworksImpl.java
@@ -29,7 +29,7 @@
 import org.openecomp.sdc.vendorsoftwareproduct.types.CompositionEntityResponse;
 import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityValidationData;
 import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Network;
-import org.openecomp.sdc.versioning.types.VersionableEntityAction;
+import org.openecomp.sdc.versioning.dao.types.Version;
 import org.openecomp.sdcrests.vendorsoftwareproducts.types.CompositionEntityResponseDto;
 import org.openecomp.sdcrests.vendorsoftwareproducts.types.CompositionEntityValidationDataDto;
 import org.openecomp.sdcrests.vendorsoftwareproducts.types.NetworkDto;
@@ -61,8 +61,7 @@
   public Response list(String vspId, String versionId, String user) {
     MdcUtil.initMdc(LoggerServiceName.List_Network.toString());
     Collection<NetworkEntity> networks =
-        networkManager.listNetworks(vspId,
-            resolveVspVersion(vspId, versionId, user, VersionableEntityAction.Read), user);
+        networkManager.listNetworks(vspId, new Version(versionId));
 
     MapNetworkEntityToNetworkDto mapper = new MapNetworkEntityToNetworkDto();
     GenericCollectionWrapper<NetworkDto> results = new GenericCollectionWrapper<>();
@@ -79,8 +78,8 @@
     NetworkEntity network =
         new MapNetworkRequestDtoToNetworkEntity().applyMapping(request, NetworkEntity.class);
     network.setVspId(vspId);
-    network.setVersion(resolveVspVersion(vspId, null, user, VersionableEntityAction.Write));
-    NetworkEntity createdNetwork = networkManager.createNetwork(network, user);
+    network.setVersion(new Version(versionId));
+    NetworkEntity createdNetwork = networkManager.createNetwork(network);
     return Response
         .ok(createdNetwork != null ? new StringWrapperResponse(createdNetwork.getId()) : null)
         .build();
@@ -91,8 +90,8 @@
     MdcUtil.initMdc(LoggerServiceName.Get_Network.toString());
     CompositionEntityResponse<Network> response =
         networkManager.getNetwork(vspId,
-            resolveVspVersion(vspId, versionId, user, VersionableEntityAction.Read), networkId,
-            user);
+            new Version(versionId), networkId
+        );
 
     CompositionEntityResponseDto<NetworkDto> responseDto = new CompositionEntityResponseDto<>();
     new MapCompositionEntityResponseToDto<>(new MapNetworkToNetworkDto(), NetworkDto.class)
@@ -104,22 +103,23 @@
   public Response delete(String vspId, String versionId, String networkId, String user) {
     MdcUtil.initMdc(LoggerServiceName.Delete_Network.toString());
     networkManager
-        .deleteNetwork(vspId, resolveVspVersion(vspId, null, user, VersionableEntityAction.Write),
-            networkId, user);
+        .deleteNetwork(vspId, new Version(versionId),
+            networkId);
     return Response.ok().build();
   }
 
   @Override
-  public Response update(NetworkRequestDto request, String vspId, String versionId, String networkId, String user) {
+  public Response update(NetworkRequestDto request, String vspId, String versionId,
+                         String networkId, String user) {
     MdcUtil.initMdc(LoggerServiceName.Update_Network.toString());
     NetworkEntity networkEntity =
         new MapNetworkRequestDtoToNetworkEntity().applyMapping(request, NetworkEntity.class);
     networkEntity.setVspId(vspId);
-    networkEntity.setVersion(resolveVspVersion(vspId, null, user, VersionableEntityAction.Write));
+    networkEntity.setVersion(new Version(versionId));
     networkEntity.setId(networkId);
 
     CompositionEntityValidationData validationData =
-        networkManager.updateNetwork(networkEntity, user);
+        networkManager.updateNetwork(networkEntity);
     return validationData != null && CollectionUtils.isNotEmpty(validationData.getErrors())
         ? Response.status(Response.Status.EXPECTATION_FAILED).entity(
         new MapCompositionEntityValidationDataToDto()
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/NicsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/NicsImpl.java
index 73ca82a..738609a 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/NicsImpl.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/NicsImpl.java
@@ -33,7 +33,6 @@
 import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityValidationData;
 import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Nic;
 import org.openecomp.sdc.versioning.dao.types.Version;
-import org.openecomp.sdc.versioning.types.VersionableEntityAction;
 import org.openecomp.sdcrests.vendorsoftwareproducts.types.CompositionEntityResponseDto;
 import org.openecomp.sdcrests.vendorsoftwareproducts.types.CompositionEntityValidationDataDto;
 import org.openecomp.sdcrests.vendorsoftwareproducts.types.NicCreationResponseDto;
@@ -52,9 +51,9 @@
 import org.springframework.context.annotation.Scope;
 import org.springframework.stereotype.Service;
 
-import java.util.Collection;
 import javax.inject.Named;
 import javax.ws.rs.core.Response;
+import java.util.Collection;
 
 @Named
 @Service("nics")
@@ -67,9 +66,9 @@
   @Override
   public Response list(String vspId, String versionId, String componentId, String user) {
     MdcUtil.initMdc(LoggerServiceName.List_nics.toString());
-    Version vspVersion = resolveVspVersion(vspId, versionId, user, VersionableEntityAction.Read);
-    componentManager.validateComponentExistence(vspId, vspVersion, componentId, user);
-    Collection<NicEntity> nics = nicManager.listNics(vspId, vspVersion, componentId, user);
+    Version vspVersion = new Version(versionId);
+    componentManager.validateComponentExistence(vspId, vspVersion, componentId);
+    Collection<NicEntity> nics = nicManager.listNics(vspId, vspVersion, componentId);
 
     MapNicEntityToNicDto mapper = new MapNicEntityToNicDto();
     GenericCollectionWrapper<NicDto> results = new GenericCollectionWrapper<>();
@@ -81,15 +80,16 @@
   }
 
   @Override
-  public Response create(NicRequestDto request, String vspId, String versionId, String componentId, String user) {
+  public Response create(NicRequestDto request, String vspId, String versionId, String componentId,
+                         String user) {
     MdcUtil.initMdc(LoggerServiceName.Create_nic.toString());
     NicEntity nic = new MapNicRequestDtoToNicEntity().applyMapping(request, NicEntity.class);
     nic.setVspId(vspId);
-    nic.setVersion(resolveVspVersion(vspId, null, user, VersionableEntityAction.Write));
+    nic.setVersion(new Version(versionId));
     nic.setComponentId(componentId);
-    componentManager.validateComponentExistence(vspId, nic.getVersion(), componentId, user);
+    componentManager.validateComponentExistence(vspId, nic.getVersion(), componentId);
 
-    NicEntity createdNic = nicManager.createNic(nic, user);
+    NicEntity createdNic = nicManager.createNic(nic);
     MapNicEntityToNicCreationResponseDto mapping =
         new MapNicEntityToNicCreationResponseDto();
     NicCreationResponseDto createdNicDto = mapping.applyMapping(createdNic,
@@ -99,12 +99,13 @@
   }
 
   @Override
-  public Response get(String vspId, String versionId, String componentId, String nicId, String user) {
+  public Response get(String vspId, String versionId, String componentId, String nicId,
+                      String user) {
     MdcUtil.initMdc(LoggerServiceName.Get_nic.toString());
-    Version vspVersion = resolveVspVersion(vspId, versionId, user, VersionableEntityAction.Read);
-    componentManager.validateComponentExistence(vspId, vspVersion, componentId, user);
+    Version vspVersion = new Version(versionId);
+    componentManager.validateComponentExistence(vspId, vspVersion, componentId);
     CompositionEntityResponse<Nic> response =
-        nicManager.getNic(vspId, vspVersion, componentId, nicId, user);
+        nicManager.getNic(vspId, vspVersion, componentId, nicId);
 
     CompositionEntityResponseDto<NicDto> responseDto = new CompositionEntityResponseDto<>();
     new MapCompositionEntityResponseToDto<>(new MapNicToNicDto(), NicDto.class)
@@ -113,27 +114,29 @@
   }
 
   @Override
-  public Response delete(String vspId, String versionId, String componentId, String nicId, String user) {
+  public Response delete(String vspId, String versionId, String componentId, String nicId,
+                         String user) {
     MdcUtil.initMdc(LoggerServiceName.Delete_nic.toString());
-    Version vspVersion = resolveVspVersion(vspId, null, user, VersionableEntityAction.Write);
-    componentManager.validateComponentExistence(vspId, vspVersion, componentId, user);
-    nicManager.deleteNic(vspId, vspVersion, componentId, nicId, user);
+    Version vspVersion = new Version(versionId);
+    componentManager.validateComponentExistence(vspId, vspVersion, componentId);
+    nicManager.deleteNic(vspId, vspVersion, componentId, nicId);
     return Response.ok().build();
   }
 
   @Override
-  public Response update(NicRequestDto request, String vspId, String versionId, String componentId, String nicId,
+  public Response update(NicRequestDto request, String vspId, String versionId, String componentId,
+                         String nicId,
                          String user) {
     MdcUtil.initMdc(LoggerServiceName.Update_nic.toString());
     NicEntity nicEntity = new MapNicRequestDtoToNicEntity().applyMapping(request, NicEntity.class);
     nicEntity.setVspId(vspId);
-    nicEntity.setVersion(resolveVspVersion(vspId, null, user, VersionableEntityAction.Write));
+    nicEntity.setVersion(new Version(versionId));
     nicEntity.setComponentId(componentId);
     nicEntity.setId(nicId);
 
-    componentManager.validateComponentExistence(vspId, nicEntity.getVersion(), componentId, user);
+    componentManager.validateComponentExistence(vspId, nicEntity.getVersion(), componentId);
     CompositionEntityValidationData validationData =
-        nicManager.updateNic(nicEntity, user);
+        nicManager.updateNic(nicEntity);
     return validationData != null && CollectionUtils.isNotEmpty(validationData.getErrors())
         ? Response.status(Response.Status.EXPECTATION_FAILED).entity(
         new MapCompositionEntityValidationDataToDto()
@@ -145,10 +148,10 @@
   public Response getQuestionnaire(String vspId, String versionId, String componentId, String nicId,
                                    String user) {
     MdcUtil.initMdc(LoggerServiceName.Get_Questionnaire_nic.toString());
-    Version vspVersion = resolveVspVersion(vspId, versionId, user, VersionableEntityAction.Read);
-    componentManager.validateComponentExistence(vspId, vspVersion, componentId, user);
+    Version vspVersion = new Version(versionId);
+    componentManager.validateComponentExistence(vspId, vspVersion, componentId);
     QuestionnaireResponse questionnaireResponse =
-        nicManager.getNicQuestionnaire(vspId, vspVersion, componentId, nicId, user);
+        nicManager.getNicQuestionnaire(vspId, vspVersion, componentId, nicId);
 
     QuestionnaireResponseDto result = new MapQuestionnaireResponseToQuestionnaireResponseDto()
         .applyMapping(questionnaireResponse, QuestionnaireResponseDto.class);
@@ -156,13 +159,14 @@
   }
 
   @Override
-  public Response updateQuestionnaire(String questionnaireData, String vspId, String versionId, String componentId,
+  public Response updateQuestionnaire(String questionnaireData, String vspId, String versionId,
+                                      String componentId,
                                       String nicId, String user) {
     MdcUtil.initMdc(LoggerServiceName.Update_Questionnaire_nic.toString());
-    Version vspVersion = resolveVspVersion(vspId, null, user, VersionableEntityAction.Write);
-    componentManager.validateComponentExistence(vspId, vspVersion, componentId, user);
+    Version vspVersion = new Version(versionId);
+    componentManager.validateComponentExistence(vspId, vspVersion, componentId);
     nicManager
-        .updateNicQuestionnaire(vspId, vspVersion, componentId, nicId, questionnaireData, user);
+        .updateNicQuestionnaire(vspId, vspVersion, componentId, nicId, questionnaireData);
     return Response.ok().build();
   }
 }
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/OrchestrationTemplateCandidateImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/OrchestrationTemplateCandidateImpl.java
index 172c894..aaee77d 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/OrchestrationTemplateCandidateImpl.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/OrchestrationTemplateCandidateImpl.java
@@ -4,6 +4,10 @@
 import org.apache.commons.lang3.tuple.Pair;
 import org.apache.cxf.jaxrs.ext.multipart.Attachment;
 import org.openecomp.core.validation.errors.ErrorMessagesFormatBuilder;
+import org.openecomp.sdc.activitylog.ActivityLogManager;
+import org.openecomp.sdc.activitylog.ActivityLogManagerFactory;
+import org.openecomp.sdc.activitylog.dao.type.ActivityLogEntity;
+import org.openecomp.sdc.activitylog.dao.type.ActivityType;
 import org.openecomp.sdc.common.errors.Messages;
 import org.openecomp.sdc.logging.api.Logger;
 import org.openecomp.sdc.logging.api.LoggerFactory;
@@ -12,27 +16,28 @@
 import org.openecomp.sdc.logging.types.LoggerServiceName;
 import org.openecomp.sdc.vendorsoftwareproduct.OrchestrationTemplateCandidateManager;
 import org.openecomp.sdc.vendorsoftwareproduct.OrchestrationTemplateCandidateManagerFactory;
-import org.openecomp.sdc.vendorsoftwareproduct.types.FileDataStructureDto;
 import org.openecomp.sdc.vendorsoftwareproduct.types.OrchestrationTemplateActionResponse;
 import org.openecomp.sdc.vendorsoftwareproduct.types.UploadFileResponse;
 import org.openecomp.sdc.vendorsoftwareproduct.types.ValidationResponse;
 import org.openecomp.sdc.vendorsoftwareproduct.types.candidateheat.FilesDataStructure;
-import org.openecomp.sdc.versioning.types.VersionableEntityAction;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.FileDataStructureDto;
 import org.openecomp.sdcrests.vendorsoftwareproducts.types.OrchestrationTemplateActionResponseDto;
 import org.openecomp.sdcrests.vendorsoftwareproducts.types.UploadFileResponseDto;
 import org.openecomp.sdcrests.vendorsoftwareproducts.types.ValidationResponseDto;
 import org.openecomp.sdcrests.vsp.rest.OrchestrationTemplateCandidate;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapFilesDataStructureToDto;
 import org.openecomp.sdcrests.vsp.rest.mapping.MapUploadFileResponseToUploadFileResponseDto;
 import org.openecomp.sdcrests.vsp.rest.mapping.MapValidationResponseToDto;
 import org.springframework.context.annotation.Scope;
 import org.springframework.stereotype.Service;
 
+import javax.inject.Named;
+import javax.ws.rs.core.Response;
 import java.io.IOException;
 import java.io.InputStream;
 import java.lang.reflect.InvocationTargetException;
 import java.util.Optional;
-import javax.inject.Named;
-import javax.ws.rs.core.Response;
 
 import static org.openecomp.core.utilities.file.FileUtils.getFileExtension;
 import static org.openecomp.core.utilities.file.FileUtils.getNetworkPackageName;
@@ -44,32 +49,31 @@
 
   private OrchestrationTemplateCandidateManager candidateManager =
       OrchestrationTemplateCandidateManagerFactory.getInstance().createInterface();
+  private ActivityLogManager activityLogManager =
+      ActivityLogManagerFactory.getInstance().createInterface();
+
   private static final Logger logger =
-          LoggerFactory.getLogger(OrchestrationTemplateCandidateImpl.class);
+      LoggerFactory.getLogger(OrchestrationTemplateCandidateImpl.class);
 
   @Override
-  public Response upload(String vspId, String versionId, Attachment fileToUpload,
-                         String user) {
+  public Response upload(String vspId, String versionId, Attachment fileToUpload, String user) {
     MdcUtil.initMdc(LoggerServiceName.Upload_File.toString());
     logger.audit(AuditMessages.AUDIT_MSG + AuditMessages.UPLOAD_HEAT + vspId);
+
     String filename = fileToUpload.getContentDisposition().getParameter("filename");
     UploadFileResponse uploadFileResponse = candidateManager
-        .upload(vspId, resolveVspVersion(vspId, null, user, VersionableEntityAction
-            .Write), fileToUpload.getObject(InputStream.class), user, getFileExtension(filename),
-            getNetworkPackageName(filename));
+        .upload(vspId, new Version(versionId), fileToUpload.getObject(InputStream.class),
+            getFileExtension(filename), getNetworkPackageName(filename));
+
     UploadFileResponseDto uploadFileResponseDto = new MapUploadFileResponseToUploadFileResponseDto()
         .applyMapping(uploadFileResponse, UploadFileResponseDto.class);
 
     return Response.ok(uploadFileResponseDto).build();
   }
 
-
-
   @Override
   public Response get(String vspId, String versionId, String user) throws IOException {
-
-    Optional<Pair<String, byte[]>> zipFile = candidateManager
-        .get(vspId, resolveVspVersion(vspId, null, user, VersionableEntityAction.Read), user);
+    Optional<Pair<String, byte[]>> zipFile = candidateManager.get(vspId, new Version(versionId));
 
     if (!zipFile.isPresent()) {
       return Response.status(Response.Status.NOT_FOUND).build();
@@ -84,10 +88,12 @@
   public Response process(String vspId, String versionId, String user)
       throws InvocationTargetException, IllegalAccessException {
 
-    OrchestrationTemplateActionResponse response =
-        candidateManager
-            .process(vspId, resolveVspVersion(vspId, null, user, VersionableEntityAction.Write),
-                user);
+    Version version = new Version(versionId);
+    OrchestrationTemplateActionResponse response = candidateManager.process(vspId, version);
+
+    activityLogManager.logActivity(new ActivityLogEntity(vspId, version,
+        ActivityType.Upload_Network_Package, user, true, "", ""));
+
     OrchestrationTemplateActionResponseDto responseDto =
         new OrchestrationTemplateActionResponseDto();
     BeanUtils.copyProperties(responseDto, response);
@@ -95,8 +101,6 @@
     return Response.ok(responseDto).build();
   }
 
-
-
   @Override
   public Response updateFilesDataStructure(
       String vspId, String versionId, FileDataStructureDto fileDataStructureDto, String user)
@@ -112,9 +116,7 @@
       throw new Exception(errorWithParameters, exception);
     }
     ValidationResponse response = candidateManager
-        .updateFilesDataStructure(vspId,
-            resolveVspVersion(vspId, null, user, VersionableEntityAction
-                .Write), user, fileDataStructure);
+        .updateFilesDataStructure(vspId, new Version(versionId), fileDataStructure);
 
     if (!response.isValid()) {
       return Response.status(Response.Status.EXPECTATION_FAILED).entity(
@@ -127,20 +129,13 @@
   @Override
   public Response getFilesDataStructure(String vspId, String versionId, String user)
       throws Exception {
-    Optional<FilesDataStructure> filesDataStructure = candidateManager
-        .getFilesDataStructure(vspId, resolveVspVersion(vspId, null, user, VersionableEntityAction
-            .Read), user);
-    FileDataStructureDto fileDataStructureDto = new FileDataStructureDto();
-    if (filesDataStructure.isPresent()) {
-      try {
-        BeanUtils.copyProperties(fileDataStructureDto, filesDataStructure.get());
-      } catch (IllegalAccessException | InvocationTargetException exception) {
-        String errorWithParameters = ErrorMessagesFormatBuilder
-            .getErrorWithParameters(Messages.MAPPING_OBJECTS_FAILURE.getErrorMessage(),
-                filesDataStructure.toString(), fileDataStructureDto.toString());
-        throw new Exception(errorWithParameters, exception);
-      }
-    }
+    Optional<FilesDataStructure> filesDataStructure =
+        candidateManager.getFilesDataStructure(vspId, new Version(versionId));
+
+    FileDataStructureDto fileDataStructureDto =
+        filesDataStructure.map(dataStructure -> new MapFilesDataStructureToDto()
+            .applyMapping(dataStructure, FileDataStructureDto.class))
+            .orElse(new FileDataStructureDto());
     return Response.ok(fileDataStructureDto).build();
   }
 }
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ProcessesImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ProcessesImpl.java
index 6bc7a37..ab67b68 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ProcessesImpl.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ProcessesImpl.java
@@ -20,8 +20,6 @@
 
 package org.openecomp.sdcrests.vsp.rest.services;
 
-import static org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants.GENERAL_COMPONENT_ID;
-
 import org.apache.cxf.jaxrs.ext.multipart.Attachment;
 import org.openecomp.sdc.logging.api.Logger;
 import org.openecomp.sdc.logging.api.LoggerFactory;
@@ -43,67 +41,65 @@
 @Scope(value = "prototype")
 public class ProcessesImpl implements Processes {
 
+  private static final Logger logger = LoggerFactory.getLogger(ProcessesImpl.class);
   @Autowired
   private ComponentProcesses componentProcesses;
-  private static final Logger logger =
-          LoggerFactory.getLogger(ProcessesImpl.class);
 
   @Override
   public Response list(String vspId, String versionId, String user) {
     MdcUtil.initMdc(LoggerServiceName.List_Processes.toString());
-    return componentProcesses.list(vspId, versionId, GENERAL_COMPONENT_ID, user);
+    return componentProcesses.list(vspId, versionId, null, user);
   }
 
   @Override
   public Response deleteList(String vspId, String versionId, String user) {
     MdcUtil.initMdc(LoggerServiceName.Delete_List_Processes.toString());
-    return componentProcesses.deleteList(vspId,versionId, GENERAL_COMPONENT_ID, user);
+    return componentProcesses.deleteList(vspId, versionId, null, user);
   }
 
   @Override
   public Response create(ProcessRequestDto request, String vspId, String versionId, String user) {
     MdcUtil.initMdc(LoggerServiceName.Create_Process.toString());
-    return componentProcesses.create(request, vspId, versionId, GENERAL_COMPONENT_ID, user);
+    return componentProcesses.create(request, vspId, versionId, null, user);
   }
 
   @Override
   public Response get(String vspId, String versionId, String processId, String user) {
     MdcUtil.initMdc(LoggerServiceName.Get_Processes.toString());
-    return componentProcesses.get(vspId, versionId, GENERAL_COMPONENT_ID, processId, user);
+    return componentProcesses.get(vspId, versionId, null, processId, user);
   }
 
   @Override
   public Response delete(String vspId, String versionId, String processId, String user) {
     MdcUtil.initMdc(LoggerServiceName.Delete_Processes.toString());
-    return componentProcesses.delete(vspId, versionId, GENERAL_COMPONENT_ID, processId, user);
+    return componentProcesses.delete(vspId, versionId, null, processId, user);
   }
 
   @Override
-  public Response update(ProcessRequestDto request, String vspId, String versionId, String processId, String user) {
+  public Response update(ProcessRequestDto request, String vspId, String versionId,
+                         String processId, String user) {
     MdcUtil.initMdc(LoggerServiceName.Update_Process.toString());
-    return componentProcesses.update(request, vspId, versionId, GENERAL_COMPONENT_ID, processId, user);
+    return componentProcesses.update(request, vspId, versionId, null, processId, user);
   }
 
   @Override
   public Response getUploadedFile(String vspId, String versionId, String processId, String user) {
     MdcUtil.initMdc(LoggerServiceName.Get_Uploaded_File_Processes.toString());
-    return componentProcesses
-        .getUploadedFile(vspId, versionId, GENERAL_COMPONENT_ID, processId, user);
+    return componentProcesses.getUploadedFile(vspId, versionId, null, processId, user);
   }
 
   @Override
-  public Response deleteUploadedFile(String vspId, String versionId, String processId, String user) {
+  public Response deleteUploadedFile(String vspId, String versionId, String processId,
+                                     String user) {
     MdcUtil.initMdc(LoggerServiceName.Delete_Uploaded_File_Processes.toString());
-    return componentProcesses.deleteUploadedFile(vspId, versionId, GENERAL_COMPONENT_ID,
-        processId, user);
+    return componentProcesses.deleteUploadedFile(vspId, versionId, null, processId, user);
   }
 
   @Override
-  public Response uploadFile(Attachment attachment, String vspId, String versionId, String processId, String user) {
+  public Response uploadFile(Attachment attachment, String vspId, String versionId,
+                             String processId, String user) {
     MdcUtil.initMdc(LoggerServiceName.Upload_File_Processes.toString());
     logger.audit(AuditMessages.AUDIT_MSG + AuditMessages.UPLOAD_PROCESS_ARTIFACT + vspId);
-    return componentProcesses.uploadFile(attachment, vspId, versionId, GENERAL_COMPONENT_ID,
-        processId,
-        user);
+    return componentProcesses.uploadFile(attachment, vspId, versionId, null, processId, user);
   }
 }
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/VendorSoftwareProductsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/VendorSoftwareProductsImpl.java
index c38bf8a..feffb91 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/VendorSoftwareProductsImpl.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/VendorSoftwareProductsImpl.java
@@ -20,10 +20,23 @@
 
 package org.openecomp.sdcrests.vsp.rest.services;
 
+import org.apache.commons.collections4.MapUtils;
+import org.openecomp.core.util.UniqueValueUtil;
+import org.openecomp.core.utilities.orchestration.OnboardingTypesEnum;
+import org.openecomp.sdc.activitylog.ActivityLogManager;
+import org.openecomp.sdc.activitylog.ActivityLogManagerFactory;
+import org.openecomp.sdc.activitylog.dao.type.ActivityLogEntity;
+import org.openecomp.sdc.activitylog.dao.type.ActivityType;
 import org.openecomp.sdc.common.errors.CoreException;
 import org.openecomp.sdc.common.errors.ErrorCode;
+import org.openecomp.sdc.common.errors.Messages;
 import org.openecomp.sdc.datatypes.error.ErrorLevel;
 import org.openecomp.sdc.datatypes.error.ErrorMessage;
+import org.openecomp.sdc.datatypes.model.ItemType;
+import org.openecomp.sdc.healing.factory.HealingManagerFactory;
+import org.openecomp.sdc.itempermissions.ItemPermissionsManager;
+import org.openecomp.sdc.itempermissions.ItemPermissionsManagerFactory;
+import org.openecomp.sdc.itempermissions.impl.types.PermissionTypes;
 import org.openecomp.sdc.logging.api.Logger;
 import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.openecomp.sdc.logging.context.MdcUtil;
@@ -33,25 +46,53 @@
 import org.openecomp.sdc.logging.types.LoggerErrorCode;
 import org.openecomp.sdc.logging.types.LoggerServiceName;
 import org.openecomp.sdc.logging.types.LoggerTragetServiceName;
+import org.openecomp.sdc.notification.dtos.Event;
+import org.openecomp.sdc.notification.factories.NotificationPropagationManagerFactory;
+import org.openecomp.sdc.notification.services.NotificationPropagationManager;
+import org.openecomp.sdc.vendorsoftwareproduct.OrchestrationTemplateCandidateManagerFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductManager;
 import org.openecomp.sdc.vendorsoftwareproduct.VspManagerFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComputeEntity;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.OnboardingMethod;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.OrchestrationTemplateCandidateData;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.OrchestrationTemplateEntity;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.PackageInfo;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
+import org.openecomp.sdc.vendorsoftwareproduct.errors.CreatePackageForNonFinalVendorSoftwareProductErrorBuilder;
 import org.openecomp.sdc.vendorsoftwareproduct.errors.OnboardingMethodErrorBuilder;
+import org.openecomp.sdc.vendorsoftwareproduct.errors.PackageNotFoundErrorBuilder;
 import org.openecomp.sdc.vendorsoftwareproduct.types.QuestionnaireResponse;
 import org.openecomp.sdc.vendorsoftwareproduct.types.ValidationResponse;
-import org.openecomp.sdc.vendorsoftwareproduct.types.VersionedVendorSoftwareProductInfo;
+import org.openecomp.sdc.versioning.ItemManager;
+import org.openecomp.sdc.versioning.ItemManagerFactory;
+import org.openecomp.sdc.versioning.VersioningManager;
+import org.openecomp.sdc.versioning.VersioningManagerFactory;
 import org.openecomp.sdc.versioning.dao.types.Version;
 import org.openecomp.sdc.versioning.dao.types.VersionStatus;
-import org.openecomp.sdc.versioning.types.VersionInfo;
-import org.openecomp.sdc.versioning.types.VersionableEntityAction;
-import org.openecomp.sdcrests.vendorsoftwareproducts.types.*;
+import org.openecomp.sdc.versioning.errors.RequestedVersionInvalidErrorBuilder;
+import org.openecomp.sdc.versioning.types.Item;
+import org.openecomp.sdc.versioning.types.NotificationEventTypes;
+import org.openecomp.sdcrests.item.rest.mapping.MapVersionToDto;
+import org.openecomp.sdcrests.item.types.ItemCreationDto;
+import org.openecomp.sdcrests.item.types.VersionDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.PackageInfoDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.QuestionnaireResponseDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.ValidationResponseDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.VersionSoftwareProductActionRequestDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.VspComputeDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.VspDescriptionDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.VspDetailsDto;
+import org.openecomp.sdcrests.vendorsoftwareproducts.types.VspRequestDto;
 import org.openecomp.sdcrests.vsp.rest.VendorSoftwareProducts;
-import org.openecomp.sdcrests.vsp.rest.mapping.*;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapComputeEntityToVspComputeDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapItemToVspDetailsDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapPackageInfoToPackageInfoDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapQuestionnaireResponseToQuestionnaireResponseDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapValidationResponseToDto;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapVspDescriptionDtoToItem;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapVspDescriptionDtoToVspDetails;
+import org.openecomp.sdcrests.vsp.rest.mapping.MapVspDetailsToDto;
 import org.openecomp.sdcrests.wrappers.GenericCollectionWrapper;
-import org.openecomp.sdcrests.wrappers.StringWrapperResponse;
-import org.slf4j.MDC;
 import org.springframework.context.annotation.Scope;
 import org.springframework.stereotype.Service;
 
@@ -60,77 +101,126 @@
 import java.io.File;
 import java.io.IOException;
 import java.util.Collection;
+import java.util.HashMap;
 import java.util.List;
-import java.util.Objects;
-import java.util.stream.Collectors;
+import java.util.Map;
+import java.util.Optional;
+import java.util.function.Predicate;
 
+import static org.openecomp.sdc.itempermissions.notifications.NotificationConstants.PERMISSION_USER;
 import static org.openecomp.sdc.logging.messages.AuditMessages.SUBMIT_VSP_ERROR;
+import static org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants.UniqueValues.VENDOR_SOFTWARE_PRODUCT_NAME;
+import static org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants.VALIDATION_VSP_NAME;
+import static org.openecomp.sdc.versioning.VersioningNotificationConstansts.ITEM_ID;
+import static org.openecomp.sdc.versioning.VersioningNotificationConstansts.ITEM_NAME;
+import static org.openecomp.sdc.versioning.VersioningNotificationConstansts.SUBMIT_DESCRIPTION;
+import static org.openecomp.sdc.versioning.VersioningNotificationConstansts.VERSION_ID;
+import static org.openecomp.sdc.versioning.VersioningNotificationConstansts.VERSION_NAME;
 
 
 @Named
 @Service("vendorSoftwareProducts")
 @Scope(value = "prototype")
 public class VendorSoftwareProductsImpl implements VendorSoftwareProducts {
+  private static final String SUBMIT_ITEM = "Submit_Item";
 
-  private final VendorSoftwareProductManager vendorSoftwareProductManager =
+  private static final Logger LOGGER = LoggerFactory.getLogger(VendorSoftwareProductsImpl.class);
+
+  private static ItemCreationDto validationVsp;
+
+  private ItemManager itemManager = ItemManagerFactory.getInstance().createInterface();
+  private ItemPermissionsManager permissionsManager =
+      ItemPermissionsManagerFactory.getInstance().createInterface();
+  private VersioningManager versioningManager =
+      VersioningManagerFactory.getInstance().createInterface();
+  private VendorSoftwareProductManager vendorSoftwareProductManager =
       VspManagerFactory.getInstance().createInterface();
-
-  private static final Logger logger =
-      LoggerFactory.getLogger(VendorSoftwareProductsImpl.class);
+  private ActivityLogManager activityLogManager =
+      ActivityLogManagerFactory.getInstance().createInterface();
+  private NotificationPropagationManager notifier =
+      NotificationPropagationManagerFactory.getInstance().createInterface();
 
   @Override
-  public Response createVsp(VspDescriptionDto vspDescriptionDto, String user) {
+  public Response createVsp(VspRequestDto vspRequestDto, String user) {
     MdcUtil.initMdc(LoggerServiceName.Create_VSP.toString());
-    logger.audit(AuditMessages.AUDIT_MSG + AuditMessages.CREATE_VSP
-        + vspDescriptionDto.getName());
+    LOGGER.audit(AuditMessages.AUDIT_MSG + AuditMessages.CREATE_VSP + vspRequestDto.getName());
+
+    ItemCreationDto itemCreationDto;
 
     OnboardingMethod onboardingMethod;
-
     try {
-      onboardingMethod = OnboardingMethod.valueOf(vspDescriptionDto.getOnboardingMethod());
+      onboardingMethod = OnboardingMethod.valueOf(vspRequestDto.getOnboardingMethod());
     } catch (IllegalArgumentException e) {
-      return handleUnknownOnboardingMethod();
+      throw getUnknownOnboardingMethod();
     }
-
     switch (onboardingMethod) {
       case NetworkPackage:
       case Manual:
-        VspDetails vspDetails = new MapVspDescriptionDtoToVspDetails().
-            applyMapping(vspDescriptionDto, VspDetails.class);
+        Item item = new MapVspDescriptionDtoToItem().applyMapping(vspRequestDto, Item.class);
+        item.setType(ItemType.vsp.name());
+        item.addProperty(VspItemProperty.ONBOARDING_METHOD, onboardingMethod.name());
 
-        vspDetails = vendorSoftwareProductManager.createVsp(vspDetails, user);
+        UniqueValueUtil.validateUniqueValue(VENDOR_SOFTWARE_PRODUCT_NAME, item.getName());
+        item = itemManager.create(item);
+        UniqueValueUtil.createUniqueValue(VENDOR_SOFTWARE_PRODUCT_NAME, item.getName());
 
-        MapVspDetailsToVspCreationDto mapping = new MapVspDetailsToVspCreationDto();
-        VspCreationDto vspCreationDto = mapping.applyMapping(vspDetails, VspCreationDto.class);
-        return Response.ok(vspCreationDto).build();
+        Version version = versioningManager.create(item.getId(), new Version(), null);
+
+        VspDetails vspDetails =
+            new MapVspDescriptionDtoToVspDetails().applyMapping(vspRequestDto, VspDetails.class);
+        vspDetails.setId(item.getId());
+        vspDetails.setVersion(version);
+        vspDetails.setOnboardingMethod(vspRequestDto.getOnboardingMethod());
+
+        vendorSoftwareProductManager.createVsp(vspDetails);
+        versioningManager.publish(item.getId(), version, "Initial vsp:" + vspDetails.getName());
+
+        itemCreationDto = new ItemCreationDto();
+        itemCreationDto.setItemId(item.getId());
+        itemCreationDto.setVersion(new MapVersionToDto().applyMapping(version, VersionDto.class));
+
+        activityLogManager.logActivity(new ActivityLogEntity(vspDetails.getId(), version,
+            ActivityType.Create, user, true, "", ""));
+        break;
       default:
-        return handleUnknownOnboardingMethod();
+        throw getUnknownOnboardingMethod();
     }
+
+    return Response.ok(itemCreationDto).build();
   }
 
-  private Response handleUnknownOnboardingMethod() {
+  private CoreException getUnknownOnboardingMethod() {
     ErrorCode onboardingMethodUpdateErrorCode = OnboardingMethodErrorBuilder
         .getInvalidOnboardingMethodErrorBuilder();
     MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_API,
         LoggerTragetServiceName.ADD_VSP, ErrorLevel.ERROR.name(),
         LoggerErrorCode.DATA_ERROR.getErrorCode(), onboardingMethodUpdateErrorCode.message());
-    throw new CoreException(onboardingMethodUpdateErrorCode);
+    return new CoreException(onboardingMethodUpdateErrorCode);
   }
 
   @Override
-  public Response listVsps(String versionFilter, String user) {
+  public Response listVsps(String versionStatus, String user) {
     MdcUtil.initMdc(LoggerServiceName.List_VSP.toString());
-    List<VersionedVendorSoftwareProductInfo> vspList =
-        vendorSoftwareProductManager.listVsps(versionFilter, user);
+
+    Predicate<Item> itemPredicate;
+    if (VersionStatus.Certified.name().equals(versionStatus)) {
+      itemPredicate = item -> ItemType.vsp.name().equals(item.getType()) &&
+          item.getVersionStatusCounters().containsKey(VersionStatus.Certified);
+
+    } else if (VersionStatus.Draft.name().equals(versionStatus)) {
+      itemPredicate = item -> ItemType.vsp.name().equals(item.getType()) &&
+          item.getVersionStatusCounters().containsKey(VersionStatus.Draft) &&
+          userHasPermission(item.getId(), user);
+
+    } else {
+      itemPredicate = item -> ItemType.vsp.name().equals(item.getType());
+    }
 
     GenericCollectionWrapper<VspDetailsDto> results = new GenericCollectionWrapper<>();
-    if (!vspList.isEmpty()) {
-      MapVersionedVendorSoftwareProductInfoToVspDetailsDto mapper =
-          new MapVersionedVendorSoftwareProductInfoToVspDetailsDto();
-      for (VersionedVendorSoftwareProductInfo versionedVsp : vspList) {
-        results.add(mapper.applyMapping(versionedVsp, VspDetailsDto.class));
-      }
-    }
+    MapItemToVspDetailsDto mapper = new MapItemToVspDetailsDto();
+    itemManager.list(itemPredicate).stream()
+        .sorted((o1, o2) -> o2.getModificationTime().compareTo(o1.getModificationTime()))
+        .forEach(vspItem -> results.add(mapper.applyMapping(vspItem, VspDetailsDto.class)));
 
     return Response.ok(results).build();
   }
@@ -139,40 +229,48 @@
   public Response getVsp(String vspId, String versionId, String user) {
     MdcUtil.initMdc(LoggerServiceName.Get_VSP.toString());
 
+    Version version = versioningManager.get(vspId, new Version(versionId));
+    VspDetails vspDetails = vendorSoftwareProductManager.getVsp(vspId, version);
+    vspDetails.setWritetimeMicroSeconds(version.getModificationTime().getTime());
 
-    VspDetails vspDetails =
-        vendorSoftwareProductManager
-            .getVsp(vspId, resolveVspVersion(vspId, versionId, user, VersionableEntityAction.Read),
-                user);
+    try {
+      Optional<Version> healedVersion = HealingManagerFactory.getInstance().createInterface()
+          .healItemVersion(vspId, version, ItemType.vsp, false);
+      healedVersion.ifPresent(vspDetails::setVersion);
 
-    VersionInfo versionInfo = getVersionInfo(vspId, VersionableEntityAction.Read, user);
-
-
-    if (vspDetails.getOldVersion() != null && !"".equals(vspDetails.getOldVersion())) {
-      if (Version.valueOf(versionId).equals(versionInfo.getActiveVersion())) {
+      if (healedVersion.isPresent() && version.getStatus() == VersionStatus.Certified) {
         try {
-          Version healedVersion = vendorSoftwareProductManager.callAutoHeal(vspId, versionInfo,
-              vspDetails, user);
-          vspDetails =
-              vendorSoftwareProductManager
-                  .getVsp(vspId, resolveVspVersion(vspId, healedVersion.toString(), user,
-                      VersionableEntityAction.Read), user);
-          versionInfo = getVersionInfo(vspId, VersionableEntityAction.Read, user);
-        } catch (Exception e) {
-          logger.error(e.getMessage(), e);
+          submitHealedVsp(vspId, healedVersion.get(), user);
+        } catch (Exception ex) {
+          LOGGER.error("VSP Id {}: Error while submitting version {} " +
+                  "created based on Certified version {} for healing purpose.",
+              vspId, healedVersion.get().getId(), versionId, ex.getMessage());
         }
       }
+    } catch (Exception e) {
+      LOGGER.error(String.format("Error while auto healing VSP with Id %s and version %s: %s",
+          vspId, versionId, e.getMessage()));
     }
 
-    VspDetailsDto vspDetailsDto = vspDetails == null
-        ? null
-        : new MapVersionedVendorSoftwareProductInfoToVspDetailsDto()
-            .applyMapping(new VersionedVendorSoftwareProductInfo(vspDetails, versionInfo),
-                VspDetailsDto.class);
+    VspDetailsDto vspDetailsDto =
+        new MapVspDetailsToDto().applyMapping(vspDetails, VspDetailsDto.class);
+    addNetworkPackageInfo(vspId, version, vspDetailsDto);
 
     return Response.ok(vspDetailsDto).build();
   }
 
+  private void submitHealedVsp(String vspId, Version healedVersion, String user)
+      throws IOException {
+    Optional<ValidationResponse>
+        validationResponse = submit(vspId, healedVersion, "Submit healed Vsp", user);
+    if (validationResponse.isPresent()) {
+      // TODO: 8/9/2017 before collaboration checkout was done at this scenario (equivalent
+      // to new version in collaboration). need to decide what should be done now.
+      throw new IllegalStateException("Certified vsp after healing failed on validation");
+    }
+    vendorSoftwareProductManager.createPackage(vspId, healedVersion);
+  }
+
   @Override
   public Response updateVsp(String vspId, String versionId, VspDescriptionDto vspDescriptionDto,
                             String user) {
@@ -180,9 +278,9 @@
     VspDetails vspDetails =
         new MapVspDescriptionDtoToVspDetails().applyMapping(vspDescriptionDto, VspDetails.class);
     vspDetails.setId(vspId);
-    vspDetails.setVersion(resolveVspVersion(vspId, null, user, VersionableEntityAction.Write));
+    vspDetails.setVersion(new Version(versionId));
 
-    vendorSoftwareProductManager.updateVsp(vspDetails, user);
+    vendorSoftwareProductManager.updateVsp(vspDetails);
 
     return Response.ok().build();
   }
@@ -190,60 +288,38 @@
   @Override
   public Response deleteVsp(String vspId, String user) {
     MdcUtil.initMdc(LoggerServiceName.Delete_VSP.toString());
-    vendorSoftwareProductManager.deleteVsp(vspId, user);
+    vendorSoftwareProductManager.deleteVsp(vspId);
 
     return Response.ok().build();
   }
 
   @Override
-  public Response actOnVendorSoftwareProduct(String vspId, String versionId,
-                                             VersionSoftwareProductActionRequestDto request,
+  public Response actOnVendorSoftwareProduct(VersionSoftwareProductActionRequestDto request,
+                                             String vspId, String versionId,
                                              String user) throws IOException {
+    Version version = new Version(versionId);
 
     switch (request.getAction()) {
-      case Checkout:
-        MDC.put(LoggerConstants.SERVICE_NAME, LoggerServiceName.Checkout_VSP.toString());
-        vendorSoftwareProductManager.checkout(vspId, user);
-        logger.audit(AuditMessages.AUDIT_MSG + AuditMessages.CHECK_OUT_VSP + vspId);
-        break;
-      case Undo_Checkout:
-        MDC.put(LoggerConstants.SERVICE_NAME, LoggerServiceName.Undo_Checkout_VSP.toString());
-        vendorSoftwareProductManager.undoCheckout(vspId, user);
-        break;
-      case Checkin:
-        MDC.put(LoggerConstants.SERVICE_NAME, LoggerServiceName.Checkin_VSP.toString());
-        vendorSoftwareProductManager.checkin(vspId, user);
-        logger.audit(AuditMessages.AUDIT_MSG + AuditMessages.CHECK_IN_VSP + vspId);
-        break;
       case Submit:
-        MDC.put(LoggerConstants.SERVICE_NAME, LoggerServiceName.Submit_VSP.toString());
-        ValidationResponse validationResponse = vendorSoftwareProductManager.submit(vspId, user);
-        if (!validationResponse.isValid()) {
-          logger.audit(AuditMessages.AUDIT_MSG + AuditMessages.SUBMIT_VSP_FAIL + vspId);
-          if (validationResponse.getVspErrors() != null) {
-            validationResponse.getVspErrors().forEach(errorCode -> logger.audit(AuditMessages
-                .AUDIT_MSG + String.format(SUBMIT_VSP_ERROR, errorCode.message(), vspId)));
-          }
-          if (validationResponse.getUploadDataErrors() != null) {
-            validationResponse.getUploadDataErrors().values().forEach(errorMessages
-                -> printAuditForErrors(errorMessages, vspId, SUBMIT_VSP_ERROR));
-          }
-
-          return Response.status(Response.Status.EXPECTATION_FAILED).entity(
-              new MapValidationResponseToDto()
-                  .applyMapping(validationResponse, ValidationResponseDto.class)).build();
+        if (!permissionsManager.isAllowed(vspId, user, SUBMIT_ITEM)) {
+          return Response.status(Response.Status.FORBIDDEN)
+              .entity(new Exception(Messages.PERMISSIONS_ERROR.getErrorMessage())).build();
         }
-        logger.audit(AuditMessages.AUDIT_MSG + AuditMessages.SUBMIT_VSP + vspId);
+        String message =
+            request.getSubmitRequest() == null ? "" : request.getSubmitRequest().getMessage();
+        Optional<ValidationResponse> validationResponse = submit(vspId, version, message, user);
+
+        if (validationResponse.isPresent()) {
+          ValidationResponseDto validationResponseDto = new MapValidationResponseToDto()
+              .applyMapping(validationResponse.get(), ValidationResponseDto.class);
+          return Response.status(Response.Status.EXPECTATION_FAILED).entity(validationResponseDto)
+              .build();
+        }
+
+        notifyUsers(vspId, version, message, user, NotificationEventTypes.SUBMIT);
         break;
       case Create_Package:
-        MDC.put(LoggerConstants.SERVICE_NAME, LoggerServiceName.Create_Package.toString());
-
-        PackageInfo packageInfo = vendorSoftwareProductManager.createPackage(vspId,
-            resolveVspVersion(vspId, null, user, VersionableEntityAction.Read), user);
-        return Response.ok(packageInfo == null
-            ? null
-            : new MapPackageInfoToPackageInfoDto().applyMapping(packageInfo, PackageInfoDto.class))
-            .build();
+        return createPackage(vspId, version);
       default:
     }
 
@@ -251,21 +327,41 @@
   }
 
   @Override
-  public Response getValidationVsp(String user)
-      throws Exception {
-    String validationVspId = vendorSoftwareProductManager.fetchValidationVsp(user);
-    StringWrapperResponse response = new StringWrapperResponse(validationVspId);
-    return Response.ok(response).build();
-  }
+  public Response getValidationVsp(String user) throws Exception {
+    if (validationVsp != null) {
+      return Response.ok(validationVsp).build();
+    }
 
+    VspRequestDto validationVspRequest = new VspRequestDto();
+    validationVspRequest.setOnboardingMethod("HEAT");
+    validationVspRequest.setName(VALIDATION_VSP_NAME);
+
+    try {
+      validationVsp = (ItemCreationDto) createVsp(validationVspRequest, user).getEntity();
+      return Response.ok(validationVsp).build();
+
+    } catch (CoreException validationVspAlreadyExistException) {
+      // find validationVsp
+      String validationVspId = itemManager.list(item ->
+          ItemType.vsp.name().equals(item.getType()) && VALIDATION_VSP_NAME.equals(item.getName()))
+          .stream().findFirst().orElseThrow(() -> new IllegalStateException("Vsp with name %s " +
+              "does not exist even though the name exists according to unique value util")).getId();
+      Version validationVspVersion = versioningManager.list(validationVspId).iterator().next();
+
+      validationVsp = new ItemCreationDto();
+      validationVsp.setItemId(validationVspId);
+      validationVsp
+          .setVersion(new MapVersionToDto().applyMapping(validationVspVersion, VersionDto.class));
+
+      return Response.ok(validationVsp).build();
+    }
+  }
 
   @Override
   public Response getOrchestrationTemplate(String vspId, String versionId, String user) {
     MdcUtil.initMdc(LoggerServiceName.Get_Uploaded_File.toString());
     byte[] orchestrationTemplateFile =
-        vendorSoftwareProductManager
-            .getOrchestrationTemplateFile(vspId,
-                resolveVspVersion(vspId, versionId, user, VersionableEntityAction.Read), user);
+        vendorSoftwareProductManager.getOrchestrationTemplateFile(vspId, new Version(versionId));
 
     if (orchestrationTemplateFile == null) {
       return Response.status(Response.Status.NOT_FOUND).build();
@@ -293,24 +389,47 @@
   }
 
   @Override
-  public Response getTranslatedFile(String vspId, String versionId, String user) {
+  public Response getTranslatedFile(String vspId, String versionName, String user) {
     MdcUtil.initMdc(LoggerServiceName.Get_Translated_File.toString());
 
-    Version version = Version.valueOf(versionId);
-    Version resolvedVersion = version == null
-        ? getVersionInfo(vspId, VersionableEntityAction.Read, user).getLatestFinalVersion()
-        : version;
+    List<Version> versions = versioningManager.list(vspId);
+    Version version;
+    if (versionName == null) {
+      version = versions.stream().filter(ver -> VersionStatus.Certified == ver.getStatus())
+          .max((o1, o2) -> ((Double) Double.parseDouble(o1.getName()))
+              .compareTo(Double.parseDouble(o2.getName()))).orElseThrow(() -> {
+            MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
+                LoggerTragetServiceName.GET_TRANSLATED_FILE, ErrorLevel.ERROR.name(),
+                LoggerErrorCode.DATA_ERROR.getErrorCode(), "Package not found");
+            return new CoreException(new PackageNotFoundErrorBuilder(vspId).build());
+          });
+    } else {
+      version = versions.stream().filter(ver -> versionName.equals(ver.getName()))
+          .findFirst().orElseThrow(() -> {
+            MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
+                LoggerTragetServiceName.GET_TRANSLATED_FILE, ErrorLevel.ERROR.name(),
+                LoggerErrorCode.DATA_ERROR.getErrorCode(), "Package not found");
+            return new CoreException(new PackageNotFoundErrorBuilder(vspId).build());
+          });
 
-    File zipFile = vendorSoftwareProductManager.getTranslatedFile(vspId, resolvedVersion, user);
+      if (version.getStatus() != VersionStatus.Certified) {
+        MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
+            LoggerTragetServiceName.GET_VERSION_INFO, ErrorLevel.ERROR.name(),
+            LoggerErrorCode.DATA_ERROR.getErrorCode(), "Invalid requested version");
+        throw new CoreException(new RequestedVersionInvalidErrorBuilder().build());
+      }
+    }
+
+    File zipFile = vendorSoftwareProductManager.getTranslatedFile(vspId, version);
 
     Response.ResponseBuilder response = Response.ok(zipFile);
     if (zipFile == null) {
-      logger.audit(AuditMessages.AUDIT_MSG + AuditMessages.IMPORT_FAIL + vspId);
+      LOGGER.audit(AuditMessages.AUDIT_MSG + AuditMessages.IMPORT_FAIL + vspId);
       return Response.status(Response.Status.NOT_FOUND).build();
     }
     response.header("Content-Disposition", "attachment; filename=" + zipFile.getName());
 
-    logger.audit(AuditMessages.AUDIT_MSG + AuditMessages.IMPORT_SUCCESS + vspId);
+    LOGGER.audit(AuditMessages.AUDIT_MSG + AuditMessages.IMPORT_SUCCESS + vspId);
     return response.build();
   }
 
@@ -318,8 +437,7 @@
   public Response getQuestionnaire(String vspId, String versionId, String user) {
     MdcUtil.initMdc(LoggerServiceName.Get_Questionnaire_VSP.toString());
     QuestionnaireResponse questionnaireResponse =
-        vendorSoftwareProductManager.getVspQuestionnaire(vspId,
-            resolveVspVersion(vspId, versionId, user, VersionableEntityAction.Read), user);
+        vendorSoftwareProductManager.getVspQuestionnaire(vspId, new Version(versionId));
 
     if (questionnaireResponse.getErrorMessage() != null) {
       return Response.status(Response.Status.EXPECTATION_FAILED).entity(
@@ -336,16 +454,15 @@
   public Response updateQuestionnaire(String questionnaireData, String vspId, String
       versionId, String user) {
     MdcUtil.initMdc(LoggerServiceName.Update_Questionnaire_VSP.toString());
-    vendorSoftwareProductManager.updateVspQuestionnaire(vspId,
-        resolveVspVersion(vspId, null, user, VersionableEntityAction.Write),
-        questionnaireData, user);
+    vendorSoftwareProductManager
+        .updateVspQuestionnaire(vspId, new Version(versionId), questionnaireData);
     return Response.ok().build();
   }
 
   @Override
   public Response heal(String vspId, String versionId, String user) {
-    vendorSoftwareProductManager.heal(vspId, Version.valueOf(versionId), user);
-
+    HealingManagerFactory.getInstance().createInterface()
+        .healItemVersion(vspId, new Version(versionId), ItemType.vsp, true);
     return Response.ok().build();
   }
 
@@ -353,8 +470,7 @@
   public Response getVspInformationArtifact(String vspId, String versionId, String user) {
     MdcUtil.initMdc(LoggerServiceName.Get_Information_Artifact.toString());
     File textInformationArtifact =
-        vendorSoftwareProductManager.getInformationArtifact(vspId,
-            resolveVspVersion(vspId, versionId, user, VersionableEntityAction.Read), user);
+        vendorSoftwareProductManager.getInformationArtifact(vspId, new Version(versionId));
 
     Response.ResponseBuilder response = Response.ok(textInformationArtifact);
     if (textInformationArtifact == null) {
@@ -365,10 +481,11 @@
     return response.build();
   }
 
-  public Response listCompute(String vspId, String version, String user) {
+  @Override
+  public Response listComputes(String vspId, String version, String user) {
 
-    Collection<ComputeEntity> computes = vendorSoftwareProductManager.getComputeByVsp(vspId,
-        resolveVspVersion(vspId, version, user, VersionableEntityAction.Read), user);
+    Collection<ComputeEntity> computes =
+        vendorSoftwareProductManager.getComputeByVsp(vspId, new Version(version));
 
     MapComputeEntityToVspComputeDto mapper = new MapComputeEntityToVspComputeDto();
     GenericCollectionWrapper<VspComputeDto> results = new GenericCollectionWrapper<>();
@@ -379,91 +496,152 @@
     return Response.ok(results).build();
   }
 
-  @Override
-  public Response reSubmitAll(String user) throws IOException {
+  private Optional<ValidationResponse> submit(String vspId, Version version, String message,
+                                              String user) throws IOException {
+    MdcUtil.initMdc(LoggerServiceName.Submit_VSP.toString());
+    LOGGER.audit(AuditMessages.AUDIT_MSG + AuditMessages.SUBMIT_VSP + vspId);
 
-    MDC.put(LoggerConstants.SERVICE_NAME, LoggerServiceName.Re_Submit_ALL_Final_VSPs.toString());
-    logger.audit(AuditMessages.AUDIT_MSG + AuditMessages.RESUBMIT_ALL_FINAL_VSPS);
-
-    List<VersionedVendorSoftwareProductInfo> latestFinalVsps = Objects
-        .requireNonNull(vendorSoftwareProductManager.listVsps(VersionStatus.Final.name(), user));
-
-    List<VersionedVendorSoftwareProductInfo> nonLockedLatestFinalVsps = latestFinalVsps.stream()
-        .filter(vsp ->
-            !isVspLocked(vsp.getVspDetails().getId(), vsp.getVspDetails().getName(), user))
-        .collect(Collectors.toList());
-
-    logger.info("Removed {} VSPs out of {} from processing due to status LOCKED.\n" +
-            "Total number of VSPs: {}. Performing healing and resubmit for all non-Manual VSPs " +
-            "in submitted status.\n No need to pre-set oldVersion field",
-        latestFinalVsps.size() - nonLockedLatestFinalVsps.size(), latestFinalVsps.size(),
-        nonLockedLatestFinalVsps.size());
-
-    int healingCounter = 0;
-    int failedCounter = 0;
-    for (int counter = 0; counter < nonLockedLatestFinalVsps.size(); counter++) {
-      VersionedVendorSoftwareProductInfo versionVspInfo = nonLockedLatestFinalVsps.get(counter);
-      try {
-        final VspDetails vspDetails = versionVspInfo.getVspDetails();
-        if (!OnboardingMethod.Manual.name().equals(vspDetails.getOnboardingMethod())) {
-          logger.info("Starting on healing and resubmit for VSP [{}], #{} out of total {}",
-              vspDetails.getName(), counter + 1, nonLockedLatestFinalVsps.size());
-          reSubmit(vspDetails, user);
-          healingCounter++;
-        }
-      } catch (Exception e) {
-        failedCounter++;
+    ValidationResponse validationResponse = vendorSoftwareProductManager.validate(vspId, version);
+    Map<String, List<ErrorMessage>> compilationErrors =
+        vendorSoftwareProductManager.compile(vspId, version);
+    if (!validationResponse.isValid() || MapUtils.isNotEmpty(compilationErrors)) {
+      LOGGER.audit(AuditMessages.AUDIT_MSG + AuditMessages.SUBMIT_VSP_FAIL + vspId);
+      if (validationResponse.getVspErrors() != null) {
+        validationResponse.getVspErrors().forEach(errorCode -> LOGGER.audit(AuditMessages
+            .AUDIT_MSG + String.format(SUBMIT_VSP_ERROR, errorCode.message(), vspId)));
       }
+      if (validationResponse.getUploadDataErrors() != null) {
+        validationResponse.getUploadDataErrors().values().forEach(errorMessages
+            -> printAuditForErrors(errorMessages, vspId, SUBMIT_VSP_ERROR));
+      }
+      activityLogManager.logActivity(
+          new ActivityLogEntity(vspId, version, ActivityType.Submit, user, false,
+              "Failed on validation before submit", ""));
+      return Optional.of(validationResponse);
     }
 
-    logger.info("Total VSPs processed {}. Completed running healing and resubmit for {} VSPs out" +
-            " of total # of {} submitted VSPs.  Failures count during resubmitAll: {}",
-        nonLockedLatestFinalVsps.size(), healingCounter, latestFinalVsps.size(), failedCounter);
+    versioningManager.submit(vspId, version, message);
 
-    return Response.ok().build();
+    LOGGER.audit(AuditMessages.AUDIT_MSG + AuditMessages.SUBMIT_VSP + vspId);
+    activityLogManager.logActivity(
+        new ActivityLogEntity(vspId, version, ActivityType.Submit, user, true, "", message));
+    return Optional.empty();
   }
 
-  private boolean isVspLocked(String vspId, String vspName, String user) {
-    final VersionInfo versionInfo = getVersionInfo(vspId, VersionableEntityAction.Read, user);
+  private void notifyUsers(String itemId, Version version, String message,
+                           String userName, NotificationEventTypes eventType) {
+    Map<String, Object> eventProperties = new HashMap<>();
+    eventProperties.put(ITEM_NAME, itemManager.get(itemId).getName());
+    eventProperties.put(ITEM_ID, itemId);
 
-    if (versionInfo.getStatus().equals(VersionStatus.Locked)) {
-      logger.info("VSP name [{}]/id [{}] status is LOCKED", vspName, vspId);
-      return true;
-    }
-    logger.info("VSP Name {}, VSP id [{}], Active Version {} , Status {}, Latest Final Version {}",
-        vspName, vspId, versionInfo.getActiveVersion().toString(), versionInfo.getStatus(),
-        versionInfo.getLatestFinalVersion().toString());
-    return false;
-  }
+    Version ver = versioningManager.get(itemId, version);
+    eventProperties.put(VERSION_NAME, ver.getName());
+    eventProperties.put(VERSION_ID, ver.getId());
 
+    eventProperties.put(SUBMIT_DESCRIPTION, message);
+    eventProperties.put(PERMISSION_USER, userName);
 
-  private void reSubmit(VspDetails vspDetails, String user) throws Exception {
-    final Version versionBefore = vspDetails.getVersion();
-    vspDetails.setOldVersion("true");
-
-    Version finalVersion;
+    Event syncEvent = new SyncEvent(eventType.getEventName(), itemId, eventProperties, itemId);
     try {
-      finalVersion =
-          vendorSoftwareProductManager
-              .healAndAdvanceFinalVersion(vspDetails.getId(), vspDetails, user);
+      notifier.notifySubscribers(syncEvent, userName);
     } catch (Exception e) {
-      logger.error("Failed during resubmit, VSP [{}] , version before:{}, version after:{}, " +
-              "status after:{}, with exception:{}",
-          vspDetails.getName(), versionBefore.toString(), vspDetails.getVersion().toString(),
-          vspDetails
-              .getVersion().getStatus().name(), e.getMessage());
-      throw e;
+      LOGGER.error("Failed to send sync notification to users subscribed o item '" + itemId);
     }
-
-    logger.info("Completed healing and resubmit for VSP [{}], version before:{}, version after:" +
-        " {}", vspDetails.getName(), versionBefore.toString(), finalVersion);
   }
 
-  private static void printAuditForErrors(List<ErrorMessage> errorList, String vspId,
-                                          String auditType) {
+  private class SyncEvent implements Event {
+
+    private String eventType;
+    private String originatorId;
+    private Map<String, Object> attributes;
+    private String entityId;
+
+    public SyncEvent(String eventType, String originatorId,
+                     Map<String, Object> attributes, String entityId) {
+      this.eventType = eventType;
+      this.originatorId = originatorId;
+      this.attributes = attributes;
+      this.entityId = entityId;
+    }
+
+    @Override
+    public String getEventType() {
+      return eventType;
+    }
+
+    @Override
+    public String getOriginatorId() {
+      return originatorId;
+    }
+
+    @Override
+    public Map<String, Object> getAttributes() {
+      return attributes;
+    }
+
+    @Override
+    public String getEntityId() {
+      return entityId;
+    }
+  }
+
+  private Response createPackage(String vspId, Version version) throws IOException {
+    MdcUtil.initMdc(LoggerServiceName.Create_Package.toString());
+
+    Version retrievedVersion = versioningManager.get(vspId, version);
+    if (retrievedVersion.getStatus() != VersionStatus.Certified) {
+      MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
+          LoggerTragetServiceName.CREATE_PACKAGE, ErrorLevel.ERROR.name(),
+          LoggerErrorCode.PERMISSION_ERROR.getErrorCode(), "Can't create package");
+      throw new CoreException(
+          new CreatePackageForNonFinalVendorSoftwareProductErrorBuilder(vspId, version)
+              .build());
+    }
+    PackageInfo packageInfo =
+        vendorSoftwareProductManager.createPackage(vspId, retrievedVersion);
+    return Response.ok(packageInfo == null
+        ? null
+        : new MapPackageInfoToPackageInfoDto().applyMapping(packageInfo, PackageInfoDto.class))
+        .build();
+  }
+
+  private void addNetworkPackageInfo(String vspId, Version version, VspDetailsDto vspDetailsDto) {
+    OrchestrationTemplateEntity orchestrationTemplateInfo =
+        vendorSoftwareProductManager.getOrchestrationTemplateInfo(vspId, version);
+
+    vspDetailsDto.setValidationData(orchestrationTemplateInfo.getValidationDataStructure());
+    vspDetailsDto.setNetworkPackageName(orchestrationTemplateInfo.getFileName());
+    vspDetailsDto.setOnboardingOrigin(orchestrationTemplateInfo.getFileSuffix() == null
+        ? OnboardingTypesEnum.NONE.toString()
+        : orchestrationTemplateInfo.getFileSuffix());
+
+    OrchestrationTemplateCandidateData candidateInfo =
+        OrchestrationTemplateCandidateManagerFactory.getInstance().createInterface()
+            .getInfo(vspId, version);
+
+    //todo - remove after fix missing candidate element
+    if(candidateInfo == null){
+      candidateInfo = new OrchestrationTemplateCandidateData();
+      candidateInfo.setFileSuffix("zip");
+    }
+
+    vspDetailsDto
+        .setCandidateOnboardingOrigin( candidateInfo.getFileSuffix()
+            == null
+            ? OnboardingTypesEnum.NONE.toString()
+            : candidateInfo.getFileSuffix());
+  }
+
+  private boolean userHasPermission(String itemId, String userId) {
+    String permission = permissionsManager.getUserItemPermiission(itemId, userId);
+    return (permission != null && permission
+        .matches(PermissionTypes.Contributor.name() + "|" + PermissionTypes.Owner.name()));
+  }
+
+  private void printAuditForErrors(List<ErrorMessage> errorList, String vspId, String auditType) {
     errorList.forEach(errorMessage -> {
       if (errorMessage.getLevel().equals(ErrorLevel.ERROR)) {
-        logger.audit(AuditMessages.AUDIT_MSG + String.format(auditType, errorMessage.getMessage(),
+        LOGGER.audit(AuditMessages.AUDIT_MSG + String.format(auditType, errorMessage.getMessage(),
             vspId));
       }
     });
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/VspItemProperty.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/VspItemProperty.java
new file mode 100644
index 0000000..a40f6b1
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/VspItemProperty.java
@@ -0,0 +1,7 @@
+package org.openecomp.sdcrests.vsp.rest.services;
+
+public final class VspItemProperty {
+  public static final String VENDOR_ID = "vendorId";
+  public static final String VENDOR_NAME = "vendorName";
+  public static final String ONBOARDING_METHOD = "onboardingMethod";
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/pom.xml
index 9e3f3f3..fca77a8 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/pom.xml
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/pom.xml
@@ -22,6 +22,11 @@
         </dependency>
         <dependency>
             <groupId>org.openecomp.sdc</groupId>
+            <artifactId>item-rest-services</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.openecomp.sdc</groupId>
             <artifactId>openecomp-sdc-vendor-software-product-manager</artifactId>
             <version>${project.version}</version>
         </dependency>
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentDependencyCreationDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentDependencyCreationDto.java
new file mode 100644
index 0000000..d9f8354
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentDependencyCreationDto.java
@@ -0,0 +1,13 @@
+package org.openecomp.sdcrests.vendorsoftwareproducts.types;
+
+public class ComponentDependencyCreationDto {
+  private String id;
+
+  public String getId() {
+    return id;
+  }
+
+  public void setId(String id) {
+    this.id = id;
+  }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentDependencyResponseDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentDependencyResponseDto.java
new file mode 100644
index 0000000..91f89a1
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentDependencyResponseDto.java
@@ -0,0 +1,41 @@
+package org.openecomp.sdcrests.vendorsoftwareproducts.types;
+
+public class ComponentDependencyResponseDto {
+
+  private String sourceId;
+  private String targetId;
+  private String relationType;
+  private String id;
+
+  public String getSourceId() {
+    return sourceId;
+  }
+
+  public void setSourceId(String sourceId) {
+    this.sourceId = sourceId;
+  }
+
+  public String getTargetId() {
+    return targetId;
+  }
+
+  public void setTargetId(String targetId) {
+    this.targetId = targetId;
+  }
+
+  public String getRelationType() {
+    return relationType;
+  }
+
+  public void setRelationType(String relationType) {
+    this.relationType = relationType;
+  }
+
+  public String getId() {
+    return id;
+  }
+
+  public void setId(String id) {
+    this.id = id;
+  }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/DeploymentFlavorRequestDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/DeploymentFlavorRequestDto.java
index 3bc0b95..a24d01a 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/DeploymentFlavorRequestDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/DeploymentFlavorRequestDto.java
@@ -4,8 +4,8 @@
 import org.hibernate.validator.constraints.NotBlank;
 import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentComputeAssociation;
 
-import java.util.List;
 import javax.validation.constraints.Size;
+import java.util.List;
 
 public class DeploymentFlavorRequestDto {
     @NotBlank(message = "is mandatory and should not be empty")
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/FileDataStructureDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/FileDataStructureDto.java
similarity index 96%
rename from openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/FileDataStructureDto.java
rename to openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/FileDataStructureDto.java
index 8cb3673..5d1191c 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/FileDataStructureDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/FileDataStructureDto.java
@@ -7,9 +7,9 @@
  * 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.
@@ -18,7 +18,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.sdc.vendorsoftwareproduct.types;
+package org.openecomp.sdcrests.vendorsoftwareproducts.types;
 
 import org.openecomp.sdc.vendorsoftwareproduct.types.candidateheat.Module;
 
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/OnboardingMethod.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/OnboardingMethod.java
deleted file mode 100644
index 0db4b04..0000000
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/OnboardingMethod.java
+++ /dev/null
@@ -1,6 +0,0 @@
-package org.openecomp.sdcrests.vendorsoftwareproducts.types;
-
-public enum OnboardingMethod {
-  NetworkPackage,
-  Manual;
-}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/QuestionnaireDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/QuestionnaireDto.java
new file mode 100644
index 0000000..cb30b50
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/QuestionnaireDto.java
@@ -0,0 +1,30 @@
+package org.openecomp.sdcrests.vendorsoftwareproducts.types;
+
+import java.util.HashMap;
+
+/**
+ * Created by ayalaben on 9/26/2017
+ */
+public class QuestionnaireDto {
+
+  private String id;
+
+  public HashMap<String, String> getQuestionareData() {
+    return questionareData;
+  }
+
+  public void setQuestionareData(HashMap<String, String> questionareData) {
+    this.questionareData = questionareData;
+  }
+
+  private HashMap<String,String> questionareData;
+
+  public String getId() {
+    return id;
+  }
+
+  public void setId(String id) {
+    this.id = id;
+  }
+
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VendorSoftwareProductAction.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VendorSoftwareProductAction.java
index c652c1c..1ec68e4 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VendorSoftwareProductAction.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VendorSoftwareProductAction.java
@@ -21,9 +21,6 @@
 package org.openecomp.sdcrests.vendorsoftwareproducts.types;
 
 public enum VendorSoftwareProductAction {
-  Checkout,
-  Undo_Checkout,
-  Checkin,
   Submit,
   Create_Package;
 }
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VersionSoftwareProductActionRequestDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VersionSoftwareProductActionRequestDto.java
index dbfdf34..f8ea65c 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VersionSoftwareProductActionRequestDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VersionSoftwareProductActionRequestDto.java
@@ -20,11 +20,14 @@
 
 package org.openecomp.sdcrests.vendorsoftwareproducts.types;
 
+import org.openecomp.sdcrests.item.types.SubmitRequestDto;
+
 /**
  * Created by TALIO on 4/20/2016.
  */
 public class VersionSoftwareProductActionRequestDto {
   private VendorSoftwareProductAction action;
+  private SubmitRequestDto submitRequest;
 
   public VendorSoftwareProductAction getAction() {
     return action;
@@ -33,4 +36,12 @@
   public void setAction(VendorSoftwareProductAction action) {
     this.action = action;
   }
+
+  public SubmitRequestDto getSubmitRequest() {
+    return submitRequest;
+  }
+
+  public void setSubmitRequest(SubmitRequestDto submitRequest) {
+    this.submitRequest = submitRequest;
+  }
 }
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspDescriptionDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspDescriptionDto.java
index 9062f89..a2358a0 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspDescriptionDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspDescriptionDto.java
@@ -21,7 +21,6 @@
 package org.openecomp.sdcrests.vendorsoftwareproducts.types;
 
 import org.openecomp.sdc.vendorsoftwareproduct.types.LicensingData;
-import org.openecomp.sdcrests.common.types.VersionDto;
 
 import javax.validation.constraints.NotNull;
 
@@ -39,14 +38,9 @@
   private String vendorName;
   @NotNull
   private String vendorId;            // this will be populated with vlm id
-  private VersionDto licensingVersion;    // this will be populated with vlm version
+  private String licensingVersion;    // this will be populated with vlm version
   private LicensingData licensingData;
 
-  @NotNull
-  private String onboardingMethod;
-  private String onboardingOrigin;
-  private String networkPackageName;
-
   public String getName() {
     return name;
   }
@@ -103,11 +97,11 @@
     this.vendorId = vendorId;
   }
 
-  public VersionDto getLicensingVersion() {
+  public String getLicensingVersion() {
     return licensingVersion;
   }
 
-  public void setLicensingVersion(VersionDto licensingVersion) {
+  public void setLicensingVersion(String licensingVersion) {
     this.licensingVersion = licensingVersion;
   }
 
@@ -118,28 +112,4 @@
   public void setLicensingData(LicensingData licensingData) {
     this.licensingData = licensingData;
   }
-
-  public String getOnboardingMethod() {
-    return onboardingMethod;
-  }
-
-  public void setOnboardingMethod(String onboardingMethod) {
-    this.onboardingMethod = onboardingMethod;
-  }
-
-  public String getOnboardingOrigin() {
-    return onboardingOrigin;
-  }
-
-  public void setOnboardingOrigin(String onboardingOrigin) {
-    this.onboardingOrigin = onboardingOrigin;
-  }
-
-  public String getNetworkPackageName() {
-    return networkPackageName;
-  }
-
-  public void setNetworkPackageName(String networkPackageName) {
-    this.networkPackageName = networkPackageName;
-  }
 }
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspDetailsDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspDetailsDto.java
index 28a77f2..5052442 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspDetailsDto.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspDetailsDto.java
@@ -22,27 +22,20 @@
 
 import io.swagger.annotations.ApiModel;
 import org.openecomp.sdc.heat.datatypes.structure.ValidationStructureList;
-import org.openecomp.sdc.versioning.dao.types.VersionStatus;
-import org.openecomp.sdcrests.common.types.VersionDto;
-
-import java.util.List;
 
 /**
  * Created by TALIO on 4/25/2016.
  */
 @ApiModel(value = "VspDetails")
-public class VspDetailsDto extends VspDescriptionDto {
+public class VspDetailsDto extends VspRequestDto {
 
   private String id;
-  private VersionDto version;
-  private List<VersionDto> viewableVersions;
-  private List<VersionDto> finalVersions;
-  private VersionStatus status;
-  private String lockingUser;
+  private String version;
   private ValidationStructureList validationData;
-  private String isOldVersion;
+  private String candidateOnboardingOrigin;
   private String onboardingOrigin;
   private String networkPackageName;
+
   public String getId() {
     return id;
   }
@@ -51,62 +44,30 @@
     this.id = id;
   }
 
-  public VersionDto getVersion() {
+  public String getVersion() {
     return version;
   }
 
-  public void setVersion(VersionDto version) {
+  public void setVersion(String version) {
     this.version = version;
   }
 
-  public List<VersionDto> getViewableVersions() {
-    return viewableVersions;
-  }
-
-  public void setViewableVersions(List<VersionDto> viewableVersions) {
-    this.viewableVersions = viewableVersions;
-  }
-
-  public List<VersionDto> getFinalVersions() {
-    return finalVersions;
-  }
-
-  public void setFinalVersions(List<VersionDto> finalVersions) {
-    this.finalVersions = finalVersions;
-  }
-
-  public VersionStatus getStatus() {
-    return status;
-  }
-
-  public void setStatus(VersionStatus status) {
-    this.status = status;
-  }
-
-  public String getLockingUser() {
-    return lockingUser;
-  }
-
-  public void setLockingUser(String lockingUser) {
-    this.lockingUser = lockingUser;
-  }
-
   public ValidationStructureList getValidationData() {
     return validationData;
   }
 
-  public String getIsOldVersion() {
-    return isOldVersion;
-  }
-
-  public void setIsOldVersion(String isOldVersion) {
-    this.isOldVersion = isOldVersion;
-  }
-
   public void setValidationData(ValidationStructureList validationData) {
     this.validationData = validationData;
   }
 
+  public String getCandidateOnboardingOrigin() {
+    return candidateOnboardingOrigin;
+  }
+
+  public void setCandidateOnboardingOrigin(String candidateOnboardingOrigin) {
+    this.candidateOnboardingOrigin = candidateOnboardingOrigin;
+  }
+
   public String getOnboardingOrigin() {
     return onboardingOrigin;
   }
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspRequestDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspRequestDto.java
new file mode 100644
index 0000000..19cad86
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspRequestDto.java
@@ -0,0 +1,16 @@
+package org.openecomp.sdcrests.vendorsoftwareproducts.types;
+
+import javax.validation.constraints.NotNull;
+
+public class VspRequestDto extends VspDescriptionDto {
+  @NotNull
+  private String onboardingMethod;
+
+  public String getOnboardingMethod() {
+    return onboardingMethod;
+  }
+
+  public void setOnboardingMethod(String onboardingMethod) {
+    this.onboardingMethod = onboardingMethod;
+  }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/validation/IsValidJson.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/validation/IsValidJson.java
index 5109002..aa8b32c 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/validation/IsValidJson.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/validation/IsValidJson.java
@@ -24,6 +24,14 @@
  * @since July 13, 2016
  */
 
+import org.openecomp.sdcrests.common.RestConstants;
+
+import javax.validation.Constraint;
+import javax.validation.Payload;
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
 import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
 import static java.lang.annotation.ElementType.CONSTRUCTOR;
 import static java.lang.annotation.ElementType.FIELD;
@@ -31,14 +39,6 @@
 import static java.lang.annotation.ElementType.PARAMETER;
 import static java.lang.annotation.RetentionPolicy.RUNTIME;
 
-import org.openecomp.sdcrests.common.RestConstants;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-import javax.validation.Constraint;
-import javax.validation.Payload;
-
 /**
  * The interface Is valid json.
  */
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/validation/StringValidator.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/validation/StringValidator.java
index 0fc2fd7..49b3e91 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/validation/StringValidator.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/validation/StringValidator.java
@@ -1,9 +1,9 @@
 package org.openecomp.sdcrests.vendorsoftwareproducts.types.validation;
 
-import java.util.ArrayList;
-import java.util.List;
 import javax.validation.ConstraintValidator;
 import javax.validation.ConstraintValidatorContext;
+import java.util.ArrayList;
+import java.util.List;
 
 public class StringValidator implements ConstraintValidator<ValidateString, String> {
 
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/validation/ValidateString.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/validation/ValidateString.java
index 1218bb1..dab2f25 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/validation/ValidateString.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/validation/ValidateString.java
@@ -1,5 +1,11 @@
 package org.openecomp.sdcrests.vendorsoftwareproducts.types.validation;
 
+import javax.validation.Constraint;
+import javax.validation.Payload;
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
 import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
 import static java.lang.annotation.ElementType.CONSTRUCTOR;
 import static java.lang.annotation.ElementType.FIELD;
@@ -7,12 +13,6 @@
 import static java.lang.annotation.ElementType.PARAMETER;
 import static java.lang.annotation.RetentionPolicy.RUNTIME;
 
-import java.lang.annotation.Documented;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-import javax.validation.Constraint;
-import javax.validation.Payload;
-
 /**
  * The interface Validate string.
  */
diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/src/main/java/org/openecomp/sdc/action/impl/ActionManagerImpl.java b/openecomp-be/backend/openecomp-sdc-action-manager/src/main/java/org/openecomp/sdc/action/impl/ActionManagerImpl.java
index f9b6bfe..492bfef 100644
--- a/openecomp-be/backend/openecomp-sdc-action-manager/src/main/java/org/openecomp/sdc/action/impl/ActionManagerImpl.java
+++ b/openecomp-be/backend/openecomp-sdc-action-manager/src/main/java/org/openecomp/sdc/action/impl/ActionManagerImpl.java
@@ -20,14 +20,61 @@
 
 package org.openecomp.sdc.action.impl;
 
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.lang.StringUtils;
+import org.openecomp.core.util.UniqueValueUtil;
+import org.openecomp.core.utilities.CommonMethods;
+import org.openecomp.core.utilities.json.JsonUtil;
+import org.openecomp.sdc.action.ActionConstants;
+import org.openecomp.sdc.action.ActionManager;
+import org.openecomp.sdc.action.dao.ActionArtifactDao;
+import org.openecomp.sdc.action.dao.ActionArtifactDaoFactory;
+import org.openecomp.sdc.action.dao.ActionDao;
+import org.openecomp.sdc.action.dao.ActionDaoFactory;
+import org.openecomp.sdc.action.dao.types.ActionArtifactEntity;
+import org.openecomp.sdc.action.dao.types.ActionEntity;
+import org.openecomp.sdc.action.errors.ActionErrorConstants;
+import org.openecomp.sdc.action.errors.ActionException;
+import org.openecomp.sdc.action.logging.StatusCode;
+import org.openecomp.sdc.action.types.Action;
+import org.openecomp.sdc.action.types.ActionArtifact;
+import org.openecomp.sdc.action.types.ActionArtifactProtection;
+import org.openecomp.sdc.action.types.ActionStatus;
+import org.openecomp.sdc.action.types.ActionSubOperation;
+import org.openecomp.sdc.action.types.OpenEcompComponent;
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.logging.api.Logger;
+import org.openecomp.sdc.logging.api.LoggerFactory;
+import org.openecomp.sdc.versioning.VersioningManager;
+import org.openecomp.sdc.versioning.VersioningManagerFactory;
+import org.openecomp.sdc.versioning.dao.VersionInfoDao;
+import org.openecomp.sdc.versioning.dao.VersionInfoDaoFactory;
+import org.openecomp.sdc.versioning.dao.types.UserCandidateVersion;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.versioning.dao.types.VersionInfoEntity;
+import org.openecomp.sdc.versioning.errors.EntityNotExistErrorBuilder;
+import org.openecomp.sdc.versioning.errors.VersioningErrorCodes;
+import org.openecomp.sdc.versioning.types.VersionInfo;
+import org.openecomp.sdc.versioning.types.VersionableEntityAction;
+import org.slf4j.MDC;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+
 import static org.openecomp.sdc.action.ActionConstants.ACTION_VERSIONABLE_TYPE;
 import static org.openecomp.sdc.action.ActionConstants.ARTIFACT_METADATA_ATTR_NAME;
 import static org.openecomp.sdc.action.ActionConstants.ARTIFACT_METADATA_ATTR_UUID;
 import static org.openecomp.sdc.action.ActionConstants.FILTER_TYPE_CATEGORY;
-import static org.openecomp.sdc.action.ActionConstants.FILTER_TYPE_OPEN_ECOMP_COMPONENT;
 import static org.openecomp.sdc.action.ActionConstants.FILTER_TYPE_MODEL;
 import static org.openecomp.sdc.action.ActionConstants.FILTER_TYPE_NAME;
 import static org.openecomp.sdc.action.ActionConstants.FILTER_TYPE_NONE;
+import static org.openecomp.sdc.action.ActionConstants.FILTER_TYPE_OPEN_ECOMP_COMPONENT;
 import static org.openecomp.sdc.action.ActionConstants.FILTER_TYPE_VENDOR;
 import static org.openecomp.sdc.action.ActionConstants.SERVICE_INSTANCE_ID;
 import static org.openecomp.sdc.action.ActionConstants.STATUS;
@@ -68,49 +115,6 @@
 import static org.openecomp.sdc.action.util.ActionUtil.getCurrentTimeStampUtc;
 import static org.openecomp.sdc.versioning.dao.types.Version.VERSION_STRING_VIOLATION_MSG;
 
-import org.apache.commons.collections4.CollectionUtils;
-import org.apache.commons.lang.StringUtils;
-import org.openecomp.sdc.action.types.*;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
-import org.openecomp.core.util.UniqueValueUtil;
-import org.openecomp.core.utilities.CommonMethods;
-import org.openecomp.core.utilities.json.JsonUtil;
-import org.openecomp.sdc.action.ActionConstants;
-import org.openecomp.sdc.action.ActionManager;
-import org.openecomp.sdc.action.dao.ActionArtifactDao;
-import org.openecomp.sdc.action.dao.ActionArtifactDaoFactory;
-import org.openecomp.sdc.action.dao.ActionDao;
-import org.openecomp.sdc.action.dao.ActionDaoFactory;
-import org.openecomp.sdc.action.dao.types.ActionArtifactEntity;
-import org.openecomp.sdc.action.dao.types.ActionEntity;
-import org.openecomp.sdc.action.errors.ActionErrorConstants;
-import org.openecomp.sdc.action.errors.ActionException;
-import org.openecomp.sdc.action.logging.StatusCode;
-import org.openecomp.sdc.action.types.OpenEcompComponent;
-import org.openecomp.sdc.common.errors.CoreException;
-import org.openecomp.sdc.versioning.VersioningManager;
-import org.openecomp.sdc.versioning.VersioningManagerFactory;
-import org.openecomp.sdc.versioning.dao.VersionInfoDao;
-import org.openecomp.sdc.versioning.dao.VersionInfoDaoFactory;
-import org.openecomp.sdc.versioning.dao.types.UserCandidateVersion;
-import org.openecomp.sdc.versioning.dao.types.Version;
-import org.openecomp.sdc.versioning.dao.types.VersionInfoEntity;
-import org.openecomp.sdc.versioning.errors.EntityNotExistErrorBuilder;
-import org.openecomp.sdc.versioning.errors.VersioningErrorCodes;
-import org.openecomp.sdc.versioning.types.VersionInfo;
-import org.openecomp.sdc.versioning.types.VersionableEntityAction;
-import org.slf4j.MDC;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-
 /**
  * Manager Implementation for {@link ActionManager Action Library Operations} <br> Handles Business
  * layer validations and acts as an interface between the REST and DAO layers.
diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/src/test/java/org/openecomp/sdc/action/ActionTest.java b/openecomp-be/backend/openecomp-sdc-action-manager/src/test/java/org/openecomp/sdc/action/ActionTest.java
index a8f7b69..582a4c7 100644
--- a/openecomp-be/backend/openecomp-sdc-action-manager/src/test/java/org/openecomp/sdc/action/ActionTest.java
+++ b/openecomp-be/backend/openecomp-sdc-action-manager/src/test/java/org/openecomp/sdc/action/ActionTest.java
@@ -20,57 +20,6 @@
 
 package org.openecomp.sdc.action;
 
-import static org.openecomp.sdc.action.ActionConstants.FILTER_TYPE_NAME;
-import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_ALREADY_EXISTS;
-import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_ALREADY_EXISTS_CODE;
-import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_DEL_LOCKED_OTHER_USER;
-import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_DEL_LOCKED_OTHER_USER_CODE;
-import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_ENTITY_NOT_EXIST;
-import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_ENTITY_NOT_EXIST_CODE;
-import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_UPDATE_NAME_INVALID;
-import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_UPDATE_READ_ONLY_MSG;
-import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_DELETE_ON_LOCKED_ENTITY_CODE;
-import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_EDIT_ON_ENTITY_LOCKED_BY_OTHER_USER;
-import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ENTITY_NOT_EXIST;
-import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ENTITY_NOT_EXIST_CODE;
-import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ENTITY_UNIQUE_VALUE_ERROR;
-import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ENTITY_UNIQUE_VALUE_MSG;
-import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_NOT_LOCKED_CODE;
-import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_NOT_LOCKED_MSG;
-import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_UPDATE_ON_UNLOCKED_ENTITY;
-
-import org.openecomp.core.nosqldb.api.NoSqlDb;
-import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
-import org.openecomp.core.utilities.json.JsonUtil;
-import org.openecomp.sdc.action.dao.ActionDao;
-import org.openecomp.sdc.action.dao.ActionDaoFactory;
-import org.openecomp.sdc.action.dao.types.ActionEntity;
-import org.openecomp.sdc.action.errors.ActionErrorConstants;
-import org.openecomp.sdc.action.errors.ActionException;
-import org.openecomp.sdc.action.impl.ActionManagerImpl;
-import org.openecomp.sdc.action.types.Action;
-import org.openecomp.sdc.action.types.ActionArtifact;
-import org.openecomp.sdc.action.types.ActionArtifactProtection;
-import org.openecomp.sdc.action.types.ActionStatus;
-import org.openecomp.sdc.action.types.OpenEcompComponent;
-import org.openecomp.sdc.versioning.dao.types.Version;
-import org.testng.Assert;
-import org.testng.annotations.BeforeTest;
-import org.testng.annotations.Test;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.LinkedHashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-
-
 @SuppressWarnings("Duplicates")
 public class ActionTest {
 
diff --git a/openecomp-be/backend/openecomp-sdc-activity-log-manager/pom.xml b/openecomp-be/backend/openecomp-sdc-activity-log-manager/pom.xml
index fc014cd..4b0db49 100644
--- a/openecomp-be/backend/openecomp-sdc-activity-log-manager/pom.xml
+++ b/openecomp-be/backend/openecomp-sdc-activity-log-manager/pom.xml
@@ -46,11 +46,6 @@
             <version>${project.version}</version>
             <scope>runtime</scope>
         </dependency>
-        <dependency>
-            <groupId>org.openecomp.sdc</groupId>
-            <artifactId>activity-log-rest-types</artifactId>
-            <version>${project.version}</version>
-        </dependency>
     </dependencies>
 
 
diff --git a/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activityLog/impl/ActivityLogManagerImpl.java b/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activityLog/impl/ActivityLogManagerImpl.java
deleted file mode 100644
index 324af20..0000000
--- a/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activityLog/impl/ActivityLogManagerImpl.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * 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=========================================================
- */
-
-package org.openecomp.sdc.activityLog.impl;
-
-import org.openecomp.core.utilities.CommonMethods;
-import org.openecomp.sdc.activityLog.ActivityLogManager;
-import org.openecomp.sdc.activitylog.dao.ActivityLogDao;
-import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage;
-import org.openecomp.sdc.activitylog.dao.type.ActivityLogEntity;
-import org.openecomp.sdc.versioning.dao.types.Version;
-
-import java.util.Collection;
-
-public class ActivityLogManagerImpl implements ActivityLogManager {
-    private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage();
-    private ActivityLogDao activityLogDao;
-
-    public ActivityLogManagerImpl(ActivityLogDao activityLogDao) {
-        this.activityLogDao = activityLogDao;
-    }
-
-    @Override
-    public void addActionLog(ActivityLogEntity activityLogEntity, String user) {
-        mdcDataDebugMessage.debugEntryMessage("ITEM id", activityLogEntity.getItemId());
-        activityLogEntity.setId(CommonMethods.nextUuId());
-        activityLogDao.create(activityLogEntity);
-    }
-
-    @Override
-    public Collection<ActivityLogEntity> listActivityLogs(String itemId, Version version, String user) {
-        mdcDataDebugMessage.debugEntryMessage("ITEM id", itemId);
-        String versionId = version.getMinor() == 0 ? String.valueOf(version.getMajor()) : String.valueOf(version.getMajor()+1);
-        return activityLogDao.getActivityLogListForItem(itemId, versionId);
-    }
-}
diff --git a/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activityLog/ActivityLogManager.java b/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activitylog/ActivityLogManager.java
similarity index 84%
rename from openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activityLog/ActivityLogManager.java
rename to openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activitylog/ActivityLogManager.java
index a40e101..06de3e1 100644
--- a/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activityLog/ActivityLogManager.java
+++ b/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activitylog/ActivityLogManager.java
@@ -18,7 +18,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.sdc.activityLog;
+package org.openecomp.sdc.activitylog;
 
 import org.openecomp.sdc.activitylog.dao.type.ActivityLogEntity;
 import org.openecomp.sdc.versioning.dao.types.Version;
@@ -26,6 +26,8 @@
 import java.util.Collection;
 
 public interface ActivityLogManager {
-    void addActionLog(ActivityLogEntity activityLogEntity, String user);
-    Collection<ActivityLogEntity> listActivityLogs(String itemId, Version versionId, String user);
+
+  void logActivity(ActivityLogEntity activityLogEntity);
+
+  Collection<ActivityLogEntity> listLoggedActivities(String itemId, Version versionId);
 }
diff --git a/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activityLog/ActivityLogManagerFactory.java b/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activitylog/ActivityLogManagerFactory.java
similarity index 93%
rename from openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activityLog/ActivityLogManagerFactory.java
rename to openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activitylog/ActivityLogManagerFactory.java
index 9816b76..93010f6 100644
--- a/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activityLog/ActivityLogManagerFactory.java
+++ b/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activitylog/ActivityLogManagerFactory.java
@@ -17,11 +17,10 @@
  * limitations under the License.
  * ============LICENSE_END=========================================================
  */
-package org.openecomp.sdc.activityLog;
+package org.openecomp.sdc.activitylog;
 
 import org.openecomp.core.factory.api.AbstractComponentFactory;
 import org.openecomp.core.factory.api.AbstractFactory;
-import org.openecomp.sdc.activityLog.ActivityLogManager;
 
 
 public abstract class ActivityLogManagerFactory extends AbstractComponentFactory<ActivityLogManager> {
diff --git a/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activityLog/impl/ActivityLogManagerFactoryImpl.java b/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activitylog/impl/ActivityLogManagerFactoryImpl.java
similarity index 73%
rename from openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activityLog/impl/ActivityLogManagerFactoryImpl.java
rename to openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activitylog/impl/ActivityLogManagerFactoryImpl.java
index 4911924..5dc7f84 100644
--- a/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activityLog/impl/ActivityLogManagerFactoryImpl.java
+++ b/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activitylog/impl/ActivityLogManagerFactoryImpl.java
@@ -17,17 +17,18 @@
  * limitations under the License.
  * ============LICENSE_END=========================================================
  */
-package org.openecomp.sdc.activityLog.impl;
+package org.openecomp.sdc.activitylog.impl;
 
-import org.openecomp.sdc.activityLog.ActivityLogManager;
-import org.openecomp.sdc.activityLog.ActivityLogManagerFactory;
+import org.openecomp.sdc.activitylog.ActivityLogManager;
+import org.openecomp.sdc.activitylog.ActivityLogManagerFactory;
 import org.openecomp.sdc.activitylog.dao.ActivityLogDaoFactory;
 
 public class ActivityLogManagerFactoryImpl extends ActivityLogManagerFactory {
-    private static final ActivityLogManager INSTANCE = new ActivityLogManagerImpl(
-            ActivityLogDaoFactory.getInstance().createInterface()
-    );
+  private static final ActivityLogManager INSTANCE =
+      new ActivityLogManagerImpl(ActivityLogDaoFactory.getInstance().createInterface());
 
-    @Override
-    public ActivityLogManager createInterface() {return INSTANCE;}
+  @Override
+  public ActivityLogManager createInterface() {
+    return INSTANCE;
+  }
 }
diff --git a/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activitylog/impl/ActivityLogManagerImpl.java b/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activitylog/impl/ActivityLogManagerImpl.java
new file mode 100644
index 0000000..711fd68
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activitylog/impl/ActivityLogManagerImpl.java
@@ -0,0 +1,52 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * 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=========================================================
+ */
+
+package org.openecomp.sdc.activitylog.impl;
+
+import org.openecomp.core.utilities.CommonMethods;
+import org.openecomp.sdc.activitylog.ActivityLogManager;
+import org.openecomp.sdc.activitylog.dao.ActivityLogDao;
+import org.openecomp.sdc.activitylog.dao.type.ActivityLogEntity;
+import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+import java.util.Collection;
+
+public class ActivityLogManagerImpl implements ActivityLogManager {
+  private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage();
+  private ActivityLogDao activityLogDao;
+
+  public ActivityLogManagerImpl(ActivityLogDao activityLogDao) {
+    this.activityLogDao = activityLogDao;
+  }
+
+  @Override
+  public void logActivity(ActivityLogEntity activityLogEntity) {
+    mdcDataDebugMessage.debugEntryMessage("ITEM id", activityLogEntity.getItemId());
+    activityLogEntity.setId(CommonMethods.nextUuId());
+    activityLogDao.create(activityLogEntity);
+  }
+
+  @Override
+  public Collection<ActivityLogEntity> listLoggedActivities(String itemId, Version version) {
+    mdcDataDebugMessage.debugEntryMessage("ITEM id", itemId);
+    return activityLogDao.list(new ActivityLogEntity(itemId, version));
+  }
+}
diff --git a/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/resources/factoryConfiguration.json b/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/resources/factoryConfiguration.json
index b4e151d..e4d3dab 100644
--- a/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/resources/factoryConfiguration.json
+++ b/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/resources/factoryConfiguration.json
@@ -1,3 +1,3 @@
 {
-  "org.openecomp.sdc.activityLog.ActivityLogManagerFactory": "org.openecomp.sdc.activityLog.impl.ActivityLogManagerFactoryImpl"
+  "org.openecomp.sdc.activitylog.ActivityLogManagerFactory": "org.openecomp.sdc.activitylog.impl.ActivityLogManagerFactoryImpl"
 }
\ No newline at end of file
diff --git a/openecomp-be/backend/openecomp-sdc-application-config-manager/src/test/java/org/openecomp/sdc/applicationconfig/ApplicationConfigManagerTest.java b/openecomp-be/backend/openecomp-sdc-application-config-manager/src/test/java/org/openecomp/sdc/applicationconfig/ApplicationConfigManagerTest.java
index 4217025..e58f455 100644
--- a/openecomp-be/backend/openecomp-sdc-application-config-manager/src/test/java/org/openecomp/sdc/applicationconfig/ApplicationConfigManagerTest.java
+++ b/openecomp-be/backend/openecomp-sdc-application-config-manager/src/test/java/org/openecomp/sdc/applicationconfig/ApplicationConfigManagerTest.java
@@ -20,14 +20,7 @@
 
 package org.openecomp.sdc.applicationconfig;
 
-import org.openecomp.core.utilities.applicationconfig.dao.type.ApplicationConfigEntity;
-import org.openecomp.core.utilities.applicationconfig.type.ConfigurationData;
 import org.openecomp.sdc.applicationconfig.impl.ApplicationConfigManagerImpl;
-import org.openecomp.sdc.common.errors.CoreException;
-import org.testng.Assert;
-import org.testng.annotations.Test;
-
-import java.util.Collection;
 
 /**
  * Created by Talio on 8/9/2016.
diff --git a/openecomp-be/backend/openecomp-sdc-conflict-manager/pom.xml b/openecomp-be/backend/openecomp-sdc-conflict-manager/pom.xml
new file mode 100644
index 0000000..4fa58b2
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-conflict-manager/pom.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.openecomp.sdc</groupId>
+        <artifactId>backend</artifactId>
+        <version>1.2.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>openecomp-sdc-conflict-manager</artifactId>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.openecomp.sdc.core</groupId>
+            <artifactId>openecomp-facade-core</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.openecomp.sdc</groupId>
+            <artifactId>openecomp-conflict-api</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.openecomp.sdc</groupId>
+            <artifactId>openecomp-conflict-core</artifactId>
+            <version>${project.version}</version>
+            <scope>runtime</scope>
+        </dependency>
+    </dependencies>
+
+</project>
\ No newline at end of file
diff --git a/openecomp-be/backend/openecomp-sdc-conflict-manager/src/main/java/org/openecomp/sdc/conflicts/ConflictsManager.java b/openecomp-be/backend/openecomp-sdc-conflict-manager/src/main/java/org/openecomp/sdc/conflicts/ConflictsManager.java
new file mode 100644
index 0000000..d7c5c3f
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-conflict-manager/src/main/java/org/openecomp/sdc/conflicts/ConflictsManager.java
@@ -0,0 +1,20 @@
+package org.openecomp.sdc.conflicts;
+
+import org.openecomp.conflicts.types.Conflict;
+import org.openecomp.conflicts.types.ConflictResolution;
+import org.openecomp.conflicts.types.ItemVersionConflict;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+public interface ConflictsManager {
+
+  boolean isConflicted(String itemId, Version version);
+
+  ItemVersionConflict getConflict(String itemId, Version version);
+
+  void finalizeMerge(String itemId, Version version);
+
+  Conflict getConflict(String itemId, Version version, String conflictId);
+
+  void resolveConflict(String itemId, Version version, String conflictId,
+                       ConflictResolution resolution);
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/UploadDataDaoFactory.java b/openecomp-be/backend/openecomp-sdc-conflict-manager/src/main/java/org/openecomp/sdc/conflicts/ConflictsManagerFactory.java
similarity index 79%
copy from openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/UploadDataDaoFactory.java
copy to openecomp-be/backend/openecomp-sdc-conflict-manager/src/main/java/org/openecomp/sdc/conflicts/ConflictsManagerFactory.java
index 9654551..7a24cfd 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/UploadDataDaoFactory.java
+++ b/openecomp-be/backend/openecomp-sdc-conflict-manager/src/main/java/org/openecomp/sdc/conflicts/ConflictsManagerFactory.java
@@ -7,9 +7,9 @@
  * 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.
@@ -17,15 +17,14 @@
  * limitations under the License.
  * ============LICENSE_END=========================================================
  */
-
-package org.openecomp.sdc.vendorsoftwareproduct.dao;
+package org.openecomp.sdc.conflicts;
 
 import org.openecomp.core.factory.api.AbstractComponentFactory;
 import org.openecomp.core.factory.api.AbstractFactory;
 
-public abstract class UploadDataDaoFactory extends AbstractComponentFactory<UploadDataDao> {
 
-  public static UploadDataDaoFactory getInstance() {
-    return AbstractFactory.getInstance(UploadDataDaoFactory.class);
-  }
+public abstract class ConflictsManagerFactory extends AbstractComponentFactory<ConflictsManager> {
+    public static ConflictsManagerFactory getInstance() {
+        return AbstractFactory.getInstance(ConflictsManagerFactory.class);
+    }
 }
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VendorSoftwareProductDaoFactoryImpl.java b/openecomp-be/backend/openecomp-sdc-conflict-manager/src/main/java/org/openecomp/sdc/conflicts/impl/ConflictsManagerFactoryImpl.java
similarity index 67%
rename from openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VendorSoftwareProductDaoFactoryImpl.java
rename to openecomp-be/backend/openecomp-sdc-conflict-manager/src/main/java/org/openecomp/sdc/conflicts/impl/ConflictsManagerFactoryImpl.java
index 0a80b2a..2d703c4 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VendorSoftwareProductDaoFactoryImpl.java
+++ b/openecomp-be/backend/openecomp-sdc-conflict-manager/src/main/java/org/openecomp/sdc/conflicts/impl/ConflictsManagerFactoryImpl.java
@@ -7,9 +7,9 @@
  * 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.
@@ -17,18 +17,19 @@
  * limitations under the License.
  * ============LICENSE_END=========================================================
  */
-
-package org.openecomp.sdc.vendorsoftwareproduct.dao.impl;
-
-import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDaoFactory;
+package org.openecomp.sdc.conflicts.impl;
 
 
-public class VendorSoftwareProductDaoFactoryImpl extends VendorSoftwareProductDaoFactory {
-  private static final VendorSoftwareProductDao INSTANCE = new VendorSoftwareProductDaoImpl();
+import org.openecomp.conflicts.dao.ConflictsDaoFactory;
+import org.openecomp.sdc.conflicts.ConflictsManager;
+import org.openecomp.sdc.conflicts.ConflictsManagerFactory;
+
+public class ConflictsManagerFactoryImpl extends ConflictsManagerFactory {
+  private static final ConflictsManager INSTANCE =
+      new ConflictsManagerImpl(ConflictsDaoFactory.getInstance().createInterface());
 
   @Override
-  public VendorSoftwareProductDao createInterface() {
+  public ConflictsManager createInterface() {
     return INSTANCE;
   }
 }
diff --git a/openecomp-be/backend/openecomp-sdc-conflict-manager/src/main/java/org/openecomp/sdc/conflicts/impl/ConflictsManagerImpl.java b/openecomp-be/backend/openecomp-sdc-conflict-manager/src/main/java/org/openecomp/sdc/conflicts/impl/ConflictsManagerImpl.java
new file mode 100644
index 0000000..cb4c2dd
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-conflict-manager/src/main/java/org/openecomp/sdc/conflicts/impl/ConflictsManagerImpl.java
@@ -0,0 +1,112 @@
+package org.openecomp.sdc.conflicts.impl;
+
+import org.openecomp.conflicts.ItemMergeHandler;
+import org.openecomp.conflicts.ItemMergeHandlerFactory;
+import org.openecomp.conflicts.dao.ConflictsDao;
+import org.openecomp.conflicts.types.Conflict;
+import org.openecomp.conflicts.types.ConflictResolution;
+import org.openecomp.conflicts.types.ItemVersionConflict;
+import org.openecomp.conflicts.types.Resolution;
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.common.errors.ErrorCategory;
+import org.openecomp.sdc.common.errors.ErrorCode;
+import org.openecomp.sdc.conflicts.ConflictsManager;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+import java.util.Optional;
+
+public class ConflictsManagerImpl implements ConflictsManager {
+
+  private static final String ELEMENT_CONFLICT_NOT_EXIST_ERR_ID = "ELEMENT_CONFLICT_NOT_EXIST";
+  private static final String ELEMENT_CONFLICT_NOT_EXISTS_MSG =
+      "Item Id %s, version Id %s, element conflict with Id %s does not exists.";
+
+  private final ConflictsDao conflictsDao;
+
+  public ConflictsManagerImpl(ConflictsDao conflictsDao) {
+    this.conflictsDao = conflictsDao;
+  }
+
+  @Override
+  public boolean isConflicted(String itemId, Version version) {
+    Optional<ItemMergeHandler> itemMergeHandler =
+        ItemMergeHandlerFactory.getInstance().createInterface(itemId);
+
+    return conflictsDao.isConflicted(itemId, version) ||
+        (itemMergeHandler.isPresent() &&
+            itemMergeHandler.get().isConflicted(itemId, version));
+  }
+
+  @Override
+  public ItemVersionConflict getConflict(String itemId, Version version) {
+    ItemVersionConflict conflicts = conflictsDao.getConflict(itemId, version);
+
+    ItemMergeHandlerFactory.getInstance().createInterface(itemId)
+        .ifPresent(itemMergeHandler -> itemMergeHandler
+            .postListConflicts(itemId, version, conflicts));
+
+    return conflicts;
+  }
+
+  @Override
+  public void finalizeMerge(String itemId, Version version) {
+    ItemMergeHandlerFactory.getInstance().createInterface(itemId)
+        .ifPresent(mergeHandler -> mergeHandler.finalizeMerge(itemId, version));
+  }
+
+  @Override
+  public Conflict getConflict(String itemId, Version version, String conflictId) {
+    Optional<ItemMergeHandler> itemMergeHandler =
+        ItemMergeHandlerFactory.getInstance().createInterface(itemId);
+    if (itemMergeHandler.isPresent()) {
+      Optional<Conflict> conflict =
+          itemMergeHandler.get().getConflict(itemId, version, conflictId);
+      if (conflict.isPresent()) {
+        return conflict.get();
+      }
+    }
+
+    Conflict conflict = conflictsDao.getConflict(itemId, version, conflictId);
+
+    itemMergeHandler.ifPresent(mergeHandler ->
+        mergeHandler.postGetConflict(itemId, version, conflict));
+
+    if (conflict == null) {
+      throw getConflictNotExistException(itemId, version, conflictId);
+    }
+    return conflict;
+  }
+
+  @Override
+  public void resolveConflict(String itemId, Version version, String conflictId,
+                              ConflictResolution resolution) {
+    if (Resolution.OTHER.equals(resolution.getResolution())) {
+      throw new UnsupportedOperationException(
+          "Resolution other than 'THEIRS' or 'YOURS' is not supported.");
+    }
+
+    Optional<ItemMergeHandler> itemMergeHandler =
+        ItemMergeHandlerFactory.getInstance().createInterface(itemId);
+    if (!itemMergeHandler.isPresent() ||
+        !itemMergeHandler.get()
+            .resolveConflict(itemId, version, conflictId, resolution)) {
+
+      getConflict(itemId, version, conflictId); // validate that the conflict exist
+      itemMergeHandler.ifPresent(mergeHandler ->
+          mergeHandler.preResolveConflict(itemId, version, conflictId, resolution));
+
+      conflictsDao.resolveConflict(itemId, version, conflictId, resolution);
+    }
+  }
+
+  private CoreException getConflictNotExistException(String itemId, Version version,
+                                                     String conflictId) {
+    return new CoreException(new ErrorCode.ErrorCodeBuilder()
+        .withCategory(ErrorCategory.APPLICATION)
+        .withId(ELEMENT_CONFLICT_NOT_EXIST_ERR_ID)
+        .withMessage(
+            String.format(ELEMENT_CONFLICT_NOT_EXISTS_MSG, itemId, version.getId(), conflictId))
+        .build());
+  }
+
+}
diff --git a/openecomp-be/backend/openecomp-sdc-conflict-manager/src/main/resources/factoryConfiguration.json b/openecomp-be/backend/openecomp-sdc-conflict-manager/src/main/resources/factoryConfiguration.json
new file mode 100644
index 0000000..58e57ab
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-conflict-manager/src/main/resources/factoryConfiguration.json
@@ -0,0 +1,3 @@
+{
+  "org.openecomp.sdc.conflicts.ConflictsManagerFactory": "org.openecomp.sdc.conflicts.impl.ConflictsManagerFactoryImpl"
+}
\ No newline at end of file
diff --git a/openecomp-be/backend/openecomp-sdc-healthcheck-manager/pom.xml b/openecomp-be/backend/openecomp-sdc-healthcheck-manager/pom.xml
index 0fd84b8..35777c2 100644
--- a/openecomp-be/backend/openecomp-sdc-healthcheck-manager/pom.xml
+++ b/openecomp-be/backend/openecomp-sdc-healthcheck-manager/pom.xml
@@ -35,11 +35,6 @@
             <version>${project.version}</version>
         </dependency>
         <dependency>
-            <groupId>org.openecomp.sdc</groupId>
-            <artifactId>activity-log-rest-types</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
             <groupId>org.openecomp.sdc.core</groupId>
             <artifactId>openecomp-zusammen-core</artifactId>
             <version>${project.version}</version>
diff --git a/openecomp-be/backend/openecomp-sdc-healthcheck-manager/src/main/java/org/openecomp/sdc/health/impl/HealthCheckManagerFactoryImpl.java b/openecomp-be/backend/openecomp-sdc-healthcheck-manager/src/main/java/org/openecomp/sdc/health/impl/HealthCheckManagerFactoryImpl.java
index 1da515f..e5d85a2 100644
--- a/openecomp-be/backend/openecomp-sdc-healthcheck-manager/src/main/java/org/openecomp/sdc/health/impl/HealthCheckManagerFactoryImpl.java
+++ b/openecomp-be/backend/openecomp-sdc-healthcheck-manager/src/main/java/org/openecomp/sdc/health/impl/HealthCheckManagerFactoryImpl.java
@@ -19,7 +19,8 @@
  */
 package org.openecomp.sdc.health.impl;
 
-import org.openecomp.sdc.health.*;
+import org.openecomp.sdc.health.HealthCheckManager;
+import org.openecomp.sdc.health.HealthCheckManagerFactory;
 
 public class HealthCheckManagerFactoryImpl extends HealthCheckManagerFactory {
     private static final HealthCheckManager INSTANCE ;
diff --git a/openecomp-be/backend/openecomp-sdc-healthcheck-manager/src/main/java/org/openecomp/sdc/health/impl/HealthCheckManagerImpl.java b/openecomp-be/backend/openecomp-sdc-healthcheck-manager/src/main/java/org/openecomp/sdc/health/impl/HealthCheckManagerImpl.java
index 2ee1581..f96b3a3 100644
--- a/openecomp-be/backend/openecomp-sdc-healthcheck-manager/src/main/java/org/openecomp/sdc/health/impl/HealthCheckManagerImpl.java
+++ b/openecomp-be/backend/openecomp-sdc-healthcheck-manager/src/main/java/org/openecomp/sdc/health/impl/HealthCheckManagerImpl.java
@@ -26,14 +26,14 @@
 import org.openecomp.core.zusammen.api.ZusammenAdaptor;
 import org.openecomp.core.zusammen.api.ZusammenAdaptorFactory;
 import org.openecomp.core.zusammen.api.ZusammenUtil;
+import org.openecomp.sdc.health.HealthCheckDao;
+import org.openecomp.sdc.health.HealthCheckDaoFactory;
 import org.openecomp.sdc.health.HealthCheckManager;
 import org.openecomp.sdc.health.data.HealthCheckStatus;
 import org.openecomp.sdc.health.data.MonitoredModules;
 import org.openecomp.sdc.logging.api.Logger;
 import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage;
-import org.openecomp.sdc.health.HealthCheckDao;
-import org.openecomp.sdc.health.HealthCheckDaoFactory;
 
 import java.util.ArrayList;
 import java.util.Arrays;
diff --git a/openecomp-be/backend/openecomp-sdc-item-permissions-manager/pom.xml b/openecomp-be/backend/openecomp-sdc-item-permissions-manager/pom.xml
new file mode 100644
index 0000000..3212205
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-item-permissions-manager/pom.xml
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+
+    <parent>
+        <groupId>org.openecomp.sdc</groupId>
+        <artifactId>backend</artifactId>
+        <version>1.2.0-SNAPSHOT</version>
+
+    </parent>
+
+    <artifactId>openecomp-sdc-item-permissions-manager</artifactId>
+
+    <dependencies>
+
+        <dependency>
+            <groupId>org.openecomp.sdc.core</groupId>
+            <artifactId>openecomp-session-lib</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.openecomp.sdc.core</groupId>
+            <artifactId>openecomp-facade-core</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.openecomp.sdc</groupId>
+            <artifactId>openecomp-item-permissions-api</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.openecomp.sdc</groupId>
+            <artifactId>openecomp-item-permissions-impl</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.openecomp.sdc</groupId>
+            <artifactId>openecomp-item-permissions-core</artifactId>
+            <version>${project.version}</version>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.openecomp.sdc</groupId>
+            <artifactId>openecomp-sdc-versioning-api</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.openecomp.sdc</groupId>
+            <artifactId>openecomp-sdc-notification-api</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.testng</groupId>
+            <artifactId>testng</artifactId>
+            <version>RELEASE</version>
+        </dependency>
+        <dependency>
+            <groupId>org.mockito</groupId>
+            <artifactId>mockito-all</artifactId>
+            <version>RELEASE</version>
+        </dependency>
+</dependencies>
+
+</project>
\ No newline at end of file
diff --git a/openecomp-be/backend/openecomp-sdc-item-permissions-manager/src/main/java/org/openecomp/sdc/itempermissions/ItemPermissionsManager.java b/openecomp-be/backend/openecomp-sdc-item-permissions-manager/src/main/java/org/openecomp/sdc/itempermissions/ItemPermissionsManager.java
new file mode 100644
index 0000000..74fc3d3
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-item-permissions-manager/src/main/java/org/openecomp/sdc/itempermissions/ItemPermissionsManager.java
@@ -0,0 +1,23 @@
+package org.openecomp.sdc.itempermissions;
+
+import org.openecomp.sdc.itempermissions.type.ItemPermissionsEntity;
+
+import java.util.Collection;
+import java.util.Set;
+
+/**
+ * Created by ayalaben on 6/18/2017.
+ */
+public interface ItemPermissionsManager {
+
+  Collection<ItemPermissionsEntity> listItemPermissions(String itemId);
+
+  void updateItemPermissions(String itemId, String permission, Set<String> addedUsersIds,
+                             Set<String> removedUsersIds);
+
+  boolean isAllowed(String itemId,String userId,String action);
+
+  String getUserItemPermiission(String itemId, String userId);
+
+
+}
diff --git a/openecomp-be/backend/openecomp-sdc-item-permissions-manager/src/main/java/org/openecomp/sdc/itempermissions/ItemPermissionsManagerFactory.java b/openecomp-be/backend/openecomp-sdc-item-permissions-manager/src/main/java/org/openecomp/sdc/itempermissions/ItemPermissionsManagerFactory.java
new file mode 100644
index 0000000..b983314
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-item-permissions-manager/src/main/java/org/openecomp/sdc/itempermissions/ItemPermissionsManagerFactory.java
@@ -0,0 +1,15 @@
+package org.openecomp.sdc.itempermissions;
+
+import org.openecomp.core.factory.api.AbstractComponentFactory;
+import org.openecomp.core.factory.api.AbstractFactory;
+
+/**
+ * Created by ayalaben on 6/18/2017.
+ */
+public abstract class ItemPermissionsManagerFactory extends
+    AbstractComponentFactory<ItemPermissionsManager> {
+
+  public static ItemPermissionsManagerFactory getInstance() {
+    return AbstractFactory.getInstance(ItemPermissionsManagerFactory.class);
+  }
+}
diff --git a/openecomp-be/backend/openecomp-sdc-item-permissions-manager/src/main/java/org/openecomp/sdc/itempermissions/dao/impl/ItemPermissionsManagerFactoryImpl.java b/openecomp-be/backend/openecomp-sdc-item-permissions-manager/src/main/java/org/openecomp/sdc/itempermissions/dao/impl/ItemPermissionsManagerFactoryImpl.java
new file mode 100644
index 0000000..2255ad5
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-item-permissions-manager/src/main/java/org/openecomp/sdc/itempermissions/dao/impl/ItemPermissionsManagerFactoryImpl.java
@@ -0,0 +1,25 @@
+package org.openecomp.sdc.itempermissions.dao.impl;
+
+import org.openecomp.sdc.itempermissions.ItemPermissionsManager;
+import org.openecomp.sdc.itempermissions.ItemPermissionsManagerFactory;
+import org.openecomp.sdc.itempermissions.PermissionsServicesFactory;
+import org.openecomp.sdc.notification.factories.NotificationPropagationManagerFactory;
+import org.openecomp.sdc.notification.factories.SubscriptionServiceFactory;
+import org.openecomp.sdc.versioning.ItemManagerFactory;
+
+/**
+ * Created by ayalaben on 6/18/2017
+ */
+public class ItemPermissionsManagerFactoryImpl extends ItemPermissionsManagerFactory {
+
+    private static final ItemPermissionsManager INSTANCE =
+        new ItemPermissionsManagerImpl(PermissionsServicesFactory.getInstance().createInterface(),
+            ItemManagerFactory.getInstance().createInterface(),
+            NotificationPropagationManagerFactory.getInstance().createInterface(),
+            SubscriptionServiceFactory.getInstance().createInterface());
+
+    @Override
+    public ItemPermissionsManager createInterface() {
+        return INSTANCE;
+    }
+}
diff --git a/openecomp-be/backend/openecomp-sdc-item-permissions-manager/src/main/java/org/openecomp/sdc/itempermissions/dao/impl/ItemPermissionsManagerImpl.java b/openecomp-be/backend/openecomp-sdc-item-permissions-manager/src/main/java/org/openecomp/sdc/itempermissions/dao/impl/ItemPermissionsManagerImpl.java
new file mode 100644
index 0000000..b9fcfcd
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-item-permissions-manager/src/main/java/org/openecomp/sdc/itempermissions/dao/impl/ItemPermissionsManagerImpl.java
@@ -0,0 +1,159 @@
+package org.openecomp.sdc.itempermissions.dao.impl;
+
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.common.errors.ErrorCategory;
+import org.openecomp.sdc.common.errors.ErrorCode;
+import org.openecomp.sdc.common.errors.Messages;
+import org.openecomp.sdc.common.session.SessionContextProviderFactory;
+import org.openecomp.sdc.itempermissions.ItemPermissionsManager;
+import org.openecomp.sdc.itempermissions.PermissionsServices;
+import org.openecomp.sdc.itempermissions.type.ItemPermissionsEntity;
+import org.openecomp.sdc.logging.api.Logger;
+import org.openecomp.sdc.logging.api.LoggerFactory;
+import org.openecomp.sdc.notification.dtos.Event;
+import org.openecomp.sdc.notification.services.NotificationPropagationManager;
+import org.openecomp.sdc.notification.services.SubscriptionService;
+import org.openecomp.sdc.versioning.ItemManager;
+import org.openecomp.sdc.versioning.types.Item;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+import static org.openecomp.sdc.itempermissions.notifications.NotificationConstants.ITEM_ID_PROP;
+import static org.openecomp.sdc.itempermissions.notifications.NotificationConstants.ITEM_NAME_PROP;
+import static org.openecomp.sdc.itempermissions.notifications.NotificationConstants.PERMISSION_CHANGED;
+import static org.openecomp.sdc.itempermissions.notifications.NotificationConstants.PERMISSION_GRANTED;
+import static org.openecomp.sdc.itempermissions.notifications.NotificationConstants.PERMISSION_ITEM;
+import static org.openecomp.sdc.itempermissions.notifications.NotificationConstants.PERMISSION_USER;
+
+/**
+ * Created by ayalaben on 6/18/2017.
+ */
+public class ItemPermissionsManagerImpl implements ItemPermissionsManager {
+
+  private static final Logger LOGGER = LoggerFactory.getLogger(ItemPermissionsManagerImpl.class);
+  private static final String CHANGE_PERMISSIONS = "Change_Item_Permissions";
+
+  private PermissionsServices permissionsServices;
+  private ItemManager itemManager;
+  private NotificationPropagationManager notifier;
+  private SubscriptionService subscriptionService;
+
+  public ItemPermissionsManagerImpl(PermissionsServices permissionsServices,
+                                    ItemManager itemManager,
+                                    NotificationPropagationManager notificationPropagationManager,
+                                    SubscriptionService subscriptionService) {
+    this.permissionsServices = permissionsServices;
+    this.itemManager = itemManager;
+    this.notifier = notificationPropagationManager;
+    this.subscriptionService = subscriptionService;
+  }
+
+  @Override
+  public Collection<ItemPermissionsEntity> listItemPermissions(String itemId) {
+
+    return permissionsServices.listItemPermissions(itemId);
+  }
+
+  @Override
+  public void updateItemPermissions(String itemId, String permission, Set<String> addedUsersIds,
+                                    Set<String> removedUsersIds) {
+
+    String currentUser =
+        SessionContextProviderFactory.getInstance().createInterface().get().getUser().getUserId();
+
+    if (!permissionsServices.isAllowed(itemId, currentUser, CHANGE_PERMISSIONS)) {
+      throw new CoreException(new ErrorCode.ErrorCodeBuilder()
+          .withMessage(Messages.PERMISSIONS_ERROR.getErrorMessage())
+          .withId(Messages.PERMISSIONS_ERROR.getErrorMessage())
+          .withCategory(ErrorCategory.SECURITY).build());
+    }
+
+    permissionsServices
+        .updateItemPermissions(itemId, permission, addedUsersIds, removedUsersIds);
+    sendNotifications(itemId, permission, addedUsersIds, removedUsersIds, currentUser);
+  }
+
+  private void sendNotifications(String itemId, String permission, Set<String> addedUsersIds,
+                                   Set<String> removedUsersIds, String userName) {
+
+    Item item = itemManager.get(itemId);
+    addedUsersIds.forEach(affectedUser -> {
+      notifyUser(userName, true, item.getName(), itemId, affectedUser, permission);
+      subscriptionService.subscribe(affectedUser, itemId);
+    });
+    removedUsersIds.forEach(affectedUser -> {
+      notifyUser(userName, false, item.getName(), itemId, affectedUser, permission);
+      subscriptionService.unsubscribe(affectedUser, itemId);
+    });
+
+  }
+
+  private void notifyUser(String userName, boolean granted, String itemName, String itemId,
+                          String affectedUser, String permission) {
+    Map<String, Object> details = new HashMap<>();
+    details.put(PERMISSION_ITEM, permission);
+    details.put(ITEM_ID_PROP, itemId);
+    details.put(ITEM_NAME_PROP, itemName);
+    details.put(PERMISSION_GRANTED, granted);
+    details.put(PERMISSION_USER, userName);
+    PermissionEvent permissionEvent = new PermissionEvent(PERMISSION_CHANGED, affectedUser,
+        details, affectedUser);
+
+    try {
+      notifier.directNotification(permissionEvent, affectedUser);
+    } catch (Exception e) {
+      LOGGER.error("Failed to send notification on permission changed for user '" +
+          affectedUser + "'");
+    }
+
+  }
+
+  @Override
+  public boolean isAllowed(String itemId, String userId, String action) {
+    return permissionsServices.isAllowed(itemId, userId, action);
+  }
+
+  @Override
+  public String getUserItemPermiission(String itemId, String userId) {
+    return permissionsServices.getUserItemPermiission(itemId, userId);
+  }
+
+  private class PermissionEvent implements Event {
+
+    private String eventType;
+    private String originatorId;
+    private Map<String, Object> attributes;
+    private String entityId;
+
+    private PermissionEvent(String eventType, String originatorId,
+                            Map<String, Object> attributes, String entityId) {
+      this.eventType = eventType;
+      this.originatorId = originatorId;
+      this.attributes = attributes;
+      this.entityId = entityId;
+    }
+
+    @Override
+    public String getEventType() {
+      return eventType;
+    }
+
+    @Override
+    public String getOriginatorId() {
+      return originatorId;
+    }
+
+    @Override
+    public Map<String, Object> getAttributes() {
+      return attributes;
+    }
+
+    @Override
+    public String getEntityId() {
+      return entityId;
+    }
+  }
+}
diff --git a/openecomp-be/backend/openecomp-sdc-item-permissions-manager/src/main/resources/factoryConfiguration.json b/openecomp-be/backend/openecomp-sdc-item-permissions-manager/src/main/resources/factoryConfiguration.json
new file mode 100644
index 0000000..a98f9c0
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-item-permissions-manager/src/main/resources/factoryConfiguration.json
@@ -0,0 +1,3 @@
+{
+  "org.openecomp.sdc.itempermissions.ItemPermissionsManagerFactory": "org.openecomp.sdc.itempermissions.dao.impl.ItemPermissionsManagerFactoryImpl"
+}
\ No newline at end of file
diff --git a/openecomp-be/backend/openecomp-sdc-item-permissions-manager/src/test/java/org/openecomp/sdc/itempermissions/dao/impl/ItemPermissionsManagerImplTest.java b/openecomp-be/backend/openecomp-sdc-item-permissions-manager/src/test/java/org/openecomp/sdc/itempermissions/dao/impl/ItemPermissionsManagerImplTest.java
new file mode 100644
index 0000000..e461824
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-item-permissions-manager/src/test/java/org/openecomp/sdc/itempermissions/dao/impl/ItemPermissionsManagerImplTest.java
@@ -0,0 +1,86 @@
+package org.openecomp.sdc.itempermissions.dao.impl;
+
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.common.session.SessionContextProviderFactory;
+import org.openecomp.sdc.itempermissions.PermissionsServices;
+import org.openecomp.sdc.notification.services.NotificationPropagationManager;
+import org.openecomp.sdc.notification.services.SubscriptionService;
+import org.openecomp.sdc.versioning.ItemManager;
+import org.openecomp.sdc.versioning.types.Item;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.verify;
+
+/**
+ * Created by ayalaben on 7/6/2017
+ */
+public class ItemPermissionsManagerImplTest {
+
+  private static final String ITEM1_ID = "1";
+  private static final String PERMISSION = "Contributor";
+  private static final String ACTION = "Change_Item_Permissions";
+  private static final String USER = "user";
+  private static final String AFFECTED_USER1 = "affected_user1";
+  private static final String AFFECTED_USER2 = "affected_user2";
+  private static final String AFFECTED_USER3 = "affected_user3";
+
+  @Mock
+  private PermissionsServices permissionsServicesMock;
+  @Mock
+  private ItemManager itemManagerMock;
+  @Mock
+  private SubscriptionService subscriptionServiceMock;
+  @Mock
+  private NotificationPropagationManager notifierMock;
+  @InjectMocks
+  private ItemPermissionsManagerImpl permissionsManager;
+
+  @BeforeMethod
+  public void setUp() throws Exception {
+    SessionContextProviderFactory.getInstance().createInterface().create(USER);
+    MockitoAnnotations.initMocks(this);
+  }
+
+  @Test(expectedExceptions = CoreException.class, expectedExceptionsMessageRegExp = "Permissions " +
+      "Error. The user does not have permission to perform this action.")
+  public void testUpdateItemPermissionsWhenNotAllowed() {
+    doReturn(false).when(permissionsServicesMock).isAllowed(ITEM1_ID, USER, ACTION);
+
+    permissionsManager
+        .updateItemPermissions(ITEM1_ID, PERMISSION, Collections.singleton(AFFECTED_USER1),
+            new HashSet<>());
+  }
+
+  @Test
+  public void testUpdateItemPermissions() {
+    doReturn(true).when(permissionsServicesMock).isAllowed(ITEM1_ID, USER, ACTION);
+    Item item = new Item();
+    item.setName("Item 1 Name");
+    doReturn(item).when(itemManagerMock).get(ITEM1_ID);
+
+    Set<String> addedUsersIds =
+        Stream.of(AFFECTED_USER1, AFFECTED_USER2).collect(Collectors.toSet());
+    Set<String> removedUsersIds = Collections.singleton(AFFECTED_USER3);
+    permissionsManager
+        .updateItemPermissions(ITEM1_ID, PERMISSION, addedUsersIds, removedUsersIds);
+
+    verify(permissionsServicesMock)
+        .updateItemPermissions(ITEM1_ID, PERMISSION, addedUsersIds, removedUsersIds);
+    verify(subscriptionServiceMock).subscribe(AFFECTED_USER1, ITEM1_ID);
+    verify(subscriptionServiceMock).subscribe(AFFECTED_USER2, ITEM1_ID);
+    verify(subscriptionServiceMock).unsubscribe(AFFECTED_USER3, ITEM1_ID);
+
+    // TODO: 12/18/2017 verify notification
+  }
+}
\ No newline at end of file
diff --git a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/resources/logback.xml b/openecomp-be/backend/openecomp-sdc-item-permissions-manager/src/test/resources/logback.xml
similarity index 91%
rename from openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/resources/logback.xml
rename to openecomp-be/backend/openecomp-sdc-item-permissions-manager/src/test/resources/logback.xml
index 9c9c06c..c1932e3 100644
--- a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/resources/logback.xml
+++ b/openecomp-be/backend/openecomp-sdc-item-permissions-manager/src/test/resources/logback.xml
@@ -9,7 +9,7 @@
     </appender>
 
     <root level="warn">
-        <appender-ref ref="STDOUT"/>
+        <appender-ref ref="STDOUT" />
     </root>
 
 </configuration>
\ No newline at end of file
diff --git a/openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/impl/UploadValidationManagerImpl.java b/openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/impl/UploadValidationManagerImpl.java
index 1d1ce4f..924235d 100644
--- a/openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/impl/UploadValidationManagerImpl.java
+++ b/openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/impl/UploadValidationManagerImpl.java
@@ -25,10 +25,10 @@
 import org.openecomp.core.utilities.file.FileContentHandler;
 import org.openecomp.core.utilities.file.FileUtils;
 import org.openecomp.core.validation.api.ValidationManager;
-import org.openecomp.sdc.common.errors.Messages;
 import org.openecomp.sdc.common.errors.CoreException;
 import org.openecomp.sdc.common.errors.ErrorCategory;
 import org.openecomp.sdc.common.errors.ErrorCode;
+import org.openecomp.sdc.common.errors.Messages;
 import org.openecomp.sdc.common.utils.SdcCommon;
 import org.openecomp.sdc.datatypes.error.ErrorLevel;
 import org.openecomp.sdc.datatypes.error.ErrorMessage;
diff --git a/openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/util/ValidationManagerUtil.java b/openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/util/ValidationManagerUtil.java
index 53b05eb..7a78f09 100644
--- a/openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/util/ValidationManagerUtil.java
+++ b/openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/util/ValidationManagerUtil.java
@@ -23,8 +23,8 @@
 import org.openecomp.core.utilities.file.FileContentHandler;
 import org.openecomp.core.utilities.file.FileUtils;
 import org.openecomp.core.validation.api.ValidationManager;
-import org.openecomp.sdc.common.errors.Messages;
 import org.openecomp.core.validation.factory.ValidationManagerFactory;
+import org.openecomp.sdc.common.errors.Messages;
 import org.openecomp.sdc.common.utils.SdcCommon;
 import org.openecomp.sdc.datatypes.error.ErrorLevel;
 import org.openecomp.sdc.datatypes.error.ErrorMessage;
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/main/java/org/openecomp/sdc/vendorlicense/VendorLicenseManager.java b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/main/java/org/openecomp/sdc/vendorlicense/VendorLicenseManager.java
index a76b9b8..9184afe 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/main/java/org/openecomp/sdc/vendorlicense/VendorLicenseManager.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/main/java/org/openecomp/sdc/vendorlicense/VendorLicenseManager.java
@@ -28,8 +28,6 @@
 import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity;
 import org.openecomp.sdc.vendorlicense.dao.types.LimitEntity;
 import org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity;
-import org.openecomp.sdc.vendorlicense.errors.LimitErrorBuilder;
-import org.openecomp.sdc.vendorlicense.types.VersionedVendorLicenseModel;
 import org.openecomp.sdc.versioning.dao.types.Version;
 
 import java.util.Collection;
@@ -37,88 +35,71 @@
 
 public interface VendorLicenseManager {
 
-  void checkout(String vendorLicenseModelId, String user);
+  void validate(String vendorLicenseModelId, Version version);
 
-  void undoCheckout(String vendorLicenseModelId, String user);
+  VendorLicenseModelEntity createVendorLicenseModel(VendorLicenseModelEntity licenseModel);
 
-  void checkin(String vendorLicenseModelId, String user);
+  void updateVendorLicenseModel(VendorLicenseModelEntity licenseModel);
 
-  void submit(String vendorLicenseModelId, String user);
+  VendorLicenseModelEntity getVendorLicenseModel(String vlmId, Version version);
 
-  Collection<VersionedVendorLicenseModel> listVendorLicenseModels(String versionFilter,
-                                                                  String user);
-
-  VendorLicenseModelEntity createVendorLicenseModel(VendorLicenseModelEntity licenseModel,
-                                                    String user);
-
-  void updateVendorLicenseModel(VendorLicenseModelEntity licenseModel, String user);
-
-  VersionedVendorLicenseModel getVendorLicenseModel(String vlmId, Version version, String user);
-
-  void deleteVendorLicenseModel(String vlmId, String user);
+  void deleteVendorLicenseModel(String vlmId, Version version);
 
 
-  Collection<LicenseAgreementEntity> listLicenseAgreements(String vlmId, Version version,
-                                                           String user);
+  Collection<LicenseAgreementEntity> listLicenseAgreements(String vlmId, Version version);
 
-  LicenseAgreementEntity createLicenseAgreement(LicenseAgreementEntity licenseAgreement,
-                                                String user);
+  LicenseAgreementEntity createLicenseAgreement(LicenseAgreementEntity licenseAgreement);
 
   void updateLicenseAgreement(LicenseAgreementEntity licenseAgreement,
-                              Set<String> addedFeatureGroupIds, Set<String> removedFeatureGroupIds,
-                              String user);
+                              Set<String> addedFeatureGroupIds, Set<String> removedFeatureGroupIds);
 
   LicenseAgreementModel getLicenseAgreementModel(String vlmId, Version version,
-                                                 String licenseAgreementId, String user);
+                                                 String licenseAgreementId);
 
-  void deleteLicenseAgreement(String vlmId, Version version, String licenseAgreementId, String user);
+  void deleteLicenseAgreement(String vlmId, Version version, String licenseAgreementId);
 
 
-  Collection<FeatureGroupEntity> listFeatureGroups(String vlmId, Version version, String user);
+  Collection<FeatureGroupEntity> listFeatureGroups(String vlmId, Version version);
 
-  FeatureGroupEntity createFeatureGroup(FeatureGroupEntity fg, String user);
+  FeatureGroupEntity createFeatureGroup(FeatureGroupEntity fg);
 
   void updateFeatureGroup(FeatureGroupEntity featureGroup,
                           Set<String> addedLicenseKeyGroups, Set<String> removedLicenseKeyGroups,
-                          Set<String> addedEntitlementPools, Set<String> removedEntitlementPools,
-                          String user);
+                          Set<String> addedEntitlementPools, Set<String> removedEntitlementPools);
 
-  FeatureGroupModel getFeatureGroupModel(FeatureGroupEntity featureGroup, String user);
+  FeatureGroupModel getFeatureGroupModel(FeatureGroupEntity featureGroup);
 
-  void deleteFeatureGroup(FeatureGroupEntity featureGroup, String user);
+  void deleteFeatureGroup(FeatureGroupEntity featureGroup);
 
 
-  Collection<EntitlementPoolEntity> listEntitlementPools(String vlmId, Version version,
-                                                         String user);
+  Collection<EntitlementPoolEntity> listEntitlementPools(String vlmId, Version version);
 
-  EntitlementPoolEntity createEntitlementPool(EntitlementPoolEntity entitlementPool, String user);
+  EntitlementPoolEntity createEntitlementPool(EntitlementPoolEntity entitlementPool);
 
-  void updateEntitlementPool(EntitlementPoolEntity entitlementPool, String user);
+  void updateEntitlementPool(EntitlementPoolEntity entitlementPool);
 
-  EntitlementPoolEntity getEntitlementPool(EntitlementPoolEntity entitlementPool, String user);
+  EntitlementPoolEntity getEntitlementPool(EntitlementPoolEntity entitlementPool);
 
-  void deleteEntitlementPool(EntitlementPoolEntity entitlementPool, String user);
+  void deleteEntitlementPool(EntitlementPoolEntity entitlementPool);
 
 
-  Collection<LicenseKeyGroupEntity> listLicenseKeyGroups(String vlmId, Version version,
-                                                         String user);
+  Collection<LicenseKeyGroupEntity> listLicenseKeyGroups(String vlmId, Version version);
 
-  LicenseKeyGroupEntity createLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup, String user);
+  LicenseKeyGroupEntity createLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup);
 
-  void updateLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup, String user);
+  void updateLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup);
 
-  LicenseKeyGroupEntity getLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup, String user);
+  LicenseKeyGroupEntity getLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup);
 
-  void deleteLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup, String user);
+  void deleteLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup);
 
-  LimitEntity createLimit(LimitEntity limitEntity, String user);
+  LimitEntity createLimit(LimitEntity limitEntity);
 
-  Collection<LimitEntity> listLimits(String vlmId, Version version, String epLkgId, String user);
+  Collection<LimitEntity> listLimits(String vlmId, Version version, String epLkgId);
 
-  void deleteLimit(LimitEntity limitEntity, String user);
+  void deleteLimit(LimitEntity limitEntity);
 
-  void updateLimit(LimitEntity limitEntity, String user);
+  void updateLimit(LimitEntity limitEntity);
 
-  LimitEntity getLimit(LimitEntity entitlementPool, String user);
-
+  LimitEntity getLimit(LimitEntity entitlementPool);
 }
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/main/java/org/openecomp/sdc/vendorlicense/impl/VendorLicenseManagerFactoryImpl.java b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/main/java/org/openecomp/sdc/vendorlicense/impl/VendorLicenseManagerFactoryImpl.java
index 152ddd0..472473f 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/main/java/org/openecomp/sdc/vendorlicense/impl/VendorLicenseManagerFactoryImpl.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/main/java/org/openecomp/sdc/vendorlicense/impl/VendorLicenseManagerFactoryImpl.java
@@ -1,6 +1,5 @@
 package org.openecomp.sdc.vendorlicense.impl;
 
-import org.openecomp.sdc.activityLog.ActivityLogManagerFactory;
 import org.openecomp.sdc.vendorlicense.VendorLicenseManager;
 import org.openecomp.sdc.vendorlicense.VendorLicenseManagerFactory;
 import org.openecomp.sdc.vendorlicense.dao.EntitlementPoolDaoFactory;
@@ -10,22 +9,19 @@
 import org.openecomp.sdc.vendorlicense.dao.LimitDaoFactory;
 import org.openecomp.sdc.vendorlicense.dao.VendorLicenseModelDaoFactory;
 import org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacadeFactory;
-import org.openecomp.sdc.versioning.VersioningManagerFactory;
 
 /**
  * Created by ayalaben on 8/3/2017
  */
-public class VendorLicenseManagerFactoryImpl  extends VendorLicenseManagerFactory {
+public class VendorLicenseManagerFactoryImpl extends VendorLicenseManagerFactory {
   private static final VendorLicenseManager INSTANCE =
       new VendorLicenseManagerImpl(
-          VersioningManagerFactory.getInstance().createInterface(),
           VendorLicenseFacadeFactory.getInstance().createInterface(),
           VendorLicenseModelDaoFactory.getInstance().createInterface(),
           LicenseAgreementDaoFactory.getInstance().createInterface(),
           FeatureGroupDaoFactory.getInstance().createInterface(),
           EntitlementPoolDaoFactory.getInstance().createInterface(),
           LicenseKeyGroupDaoFactory.getInstance().createInterface(),
-          ActivityLogManagerFactory.getInstance().createInterface(),
           LimitDaoFactory.getInstance().createInterface());
 
   @Override
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/main/java/org/openecomp/sdc/vendorlicense/impl/VendorLicenseManagerImpl.java b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/main/java/org/openecomp/sdc/vendorlicense/impl/VendorLicenseManagerImpl.java
index e07a13c..2489b5a 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/main/java/org/openecomp/sdc/vendorlicense/impl/VendorLicenseManagerImpl.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/main/java/org/openecomp/sdc/vendorlicense/impl/VendorLicenseManagerImpl.java
@@ -20,16 +20,10 @@
 
 package org.openecomp.sdc.vendorlicense.impl;
 
-import static org.openecomp.sdc.vendorlicense.VendorLicenseConstants.VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE;
-
 import org.openecomp.core.util.UniqueValueUtil;
-import org.openecomp.sdc.activityLog.ActivityLogManager;
-import org.openecomp.sdc.activitylog.dao.type.ActivityLogEntity;
 import org.openecomp.sdc.common.errors.CoreException;
 import org.openecomp.sdc.common.errors.ErrorCode;
 import org.openecomp.sdc.datatypes.error.ErrorLevel;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage;
 import org.openecomp.sdc.logging.context.impl.MdcDataErrorMessage;
 import org.openecomp.sdc.logging.types.LoggerConstants;
@@ -57,26 +51,16 @@
 import org.openecomp.sdc.vendorlicense.errors.InvalidDateErrorBuilder;
 import org.openecomp.sdc.vendorlicense.errors.LimitErrorBuilder;
 import org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacade;
-import org.openecomp.sdc.vendorlicense.types.VersionedVendorLicenseModel;
-import org.openecomp.sdc.versioning.VersioningManager;
 import org.openecomp.sdc.versioning.VersioningUtil;
 import org.openecomp.sdc.versioning.dao.types.Version;
-import org.openecomp.sdc.versioning.dao.types.VersionStatus;
-import org.openecomp.sdc.versioning.types.VersionInfo;
-import org.openecomp.sdc.versioning.types.VersionableEntityAction;
-import org.openecomp.sdcrests.activitylog.types.ActivityType;
 
 import java.time.LocalDate;
 import java.time.format.DateTimeFormatter;
-import java.util.ArrayList;
 import java.util.Collection;
-import java.util.List;
-import java.util.Map;
 import java.util.Optional;
 import java.util.Set;
 
 public class VendorLicenseManagerImpl implements VendorLicenseManager {
-  private VersioningManager versioningManager;
   private VendorLicenseFacade vendorLicenseFacade;
   private VendorLicenseModelDao vendorLicenseModelDao;
   private LicenseAgreementDao licenseAgreementDao;
@@ -84,278 +68,134 @@
   private EntitlementPoolDao entitlementPoolDao;
   private LicenseKeyGroupDao licenseKeyGroupDao;
   private LimitDao limitDao;
-  private ActivityLogManager activityLogManager;
 
   private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage();
-  private static final Logger logger =
-          LoggerFactory.getLogger(VendorLicenseManagerImpl.class);
 
-  public VendorLicenseManagerImpl(VersioningManager versioningManager,
-                                  VendorLicenseFacade vendorLicenseFacade,
+  public VendorLicenseManagerImpl(VendorLicenseFacade vendorLicenseFacade,
                                   VendorLicenseModelDao vendorLicenseModelDao,
                                   LicenseAgreementDao licenseAgreementDao,
                                   FeatureGroupDao featureGroupDao,
                                   EntitlementPoolDao entitlementPoolDao,
                                   LicenseKeyGroupDao licenseKeyGroupDao,
-                                  ActivityLogManager activityLogManager,
                                   LimitDao limitDao) {
-    this.versioningManager = versioningManager;
     this.vendorLicenseFacade = vendorLicenseFacade;
     this.vendorLicenseModelDao = vendorLicenseModelDao;
     this.licenseAgreementDao = licenseAgreementDao;
     this.featureGroupDao = featureGroupDao;
     this.entitlementPoolDao = entitlementPoolDao;
     this.licenseKeyGroupDao = licenseKeyGroupDao;
-    this.activityLogManager = activityLogManager;
     this.limitDao = limitDao;
   }
 
 
-  private static void sortVlmListByModificationTimeDescOrder(
-          List<VersionedVendorLicenseModel> vendorLicenseModels) {
-    vendorLicenseModels.sort((o1, o2) -> o2.getVendorLicenseModel().getWritetimeMicroSeconds()
-            .compareTo(o1.getVendorLicenseModel().getWritetimeMicroSeconds()));
-  }
-
   @Override
-  public void checkout(String vendorLicenseModelId, String user) {
-
+  public void validate(String vendorLicenseModelId, Version version) {
     mdcDataDebugMessage.debugEntryMessage("VLM id", vendorLicenseModelId);
 
-    Version newVersion = versioningManager
-            .checkout(VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE, vendorLicenseModelId, user);
-
-    ActivityLogEntity activityLogEntity = new ActivityLogEntity(vendorLicenseModelId, String.valueOf(newVersion.getMajor()+1),
-            ActivityType.CHECKOUT.toString(), user, true, "", "");
-    activityLogManager.addActionLog(activityLogEntity, user);
-
-    newVersion.setStatus(VersionStatus.Locked);
-    vendorLicenseFacade.updateVlmLastModificationTime(vendorLicenseModelId, newVersion);
+    vendorLicenseFacade.validate(vendorLicenseModelId, version);
 
     mdcDataDebugMessage.debugExitMessage("VLM id", vendorLicenseModelId);
   }
 
   @Override
-  public void undoCheckout(String vendorLicenseModelId, String user) {
-
-    mdcDataDebugMessage.debugEntryMessage("VLM id", vendorLicenseModelId);
-
-    Version newVersion = versioningManager
-            .undoCheckout(VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE, vendorLicenseModelId, user);
-
-    ActivityLogEntity activityLogEntity =
-        new ActivityLogEntity(vendorLicenseModelId, String.valueOf(newVersion.getMajor() + 1),
-            ActivityType.UNDO_CHECKOUT.toString(), user, true, "", "");
-    activityLogManager.addActionLog(activityLogEntity, user);
-
-    vendorLicenseFacade.updateVlmLastModificationTime(vendorLicenseModelId, newVersion);
-
-    mdcDataDebugMessage.debugExitMessage("VLM id", vendorLicenseModelId);
-  }
-
-  @Override
-  public void checkin(String vendorLicenseModelId, String user) {
-
-    mdcDataDebugMessage.debugEntryMessage("VLM id", vendorLicenseModelId);
-
-    Version newVersion = vendorLicenseFacade.checkin(vendorLicenseModelId, user);
-
-    ActivityLogEntity activityLogEntity = new ActivityLogEntity(vendorLicenseModelId,
-            String.valueOf(newVersion.getMajor()+1), ActivityType.CHECKIN.toString(), user, true, "", "");
-    activityLogManager.addActionLog(activityLogEntity, user);
-
-    mdcDataDebugMessage.debugExitMessage("VLM id", vendorLicenseModelId);
-  }
-
-  @Override
-  public void submit(String vendorLicenseModelId, String user) {
-
-    mdcDataDebugMessage.debugEntryMessage("VLM id", vendorLicenseModelId);
-
-    Version newVersion = vendorLicenseFacade.submit(vendorLicenseModelId, user);
-
-    ActivityLogEntity activityLogEntity = new ActivityLogEntity(vendorLicenseModelId, String.valueOf(newVersion.getMajor()),
-            ActivityType.SUBMIT.toString(), user, true, "", "");
-    activityLogManager.addActionLog(activityLogEntity, user);
-
-    mdcDataDebugMessage.debugExitMessage("VLM id", vendorLicenseModelId);
-  }
-
-  @Override
-  public Collection<VersionedVendorLicenseModel> listVendorLicenseModels(String versionFilter,
-                                                                         String user) {
+  public VendorLicenseModelEntity createVendorLicenseModel(
+      VendorLicenseModelEntity vendorLicenseModelEntity) {
     mdcDataDebugMessage.debugEntryMessage(null);
 
-    Map<String, VersionInfo> idToVersionsInfo = versioningManager
-            .listEntitiesVersionInfo(VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE, user,
-                    VersionableEntityAction.Read);
-
-    List<VersionedVendorLicenseModel> vendorLicenseModels = new ArrayList<>();
-    for (Map.Entry<String, VersionInfo> entry : idToVersionsInfo.entrySet()) {
-      VersionInfo versionInfo = entry.getValue();
-      if (versionFilter != null && versionFilter.equals(VersionStatus.Final.name())) {
-        if (versionInfo.getLatestFinalVersion() == null) {
-          continue;
-        }
-        versionInfo.setActiveVersion(versionInfo.getLatestFinalVersion());
-        versionInfo.setStatus(VersionStatus.Final);
-        versionInfo.setLockingUser(null);
-      }
-
-      Version version = versionInfo.getActiveVersion();
-      if (user.equals(versionInfo.getLockingUser())) {
-        version.setStatus(VersionStatus.Locked);
-      }
-
-      try {
-        VendorLicenseModelEntity vlm =
-                vendorLicenseModelDao.get(new VendorLicenseModelEntity(entry.getKey(), version));
-        if (vlm != null) {
-          VersionedVendorLicenseModel versionedVlm = new VersionedVendorLicenseModel();
-          versionedVlm.setVendorLicenseModel(vlm);
-          versionedVlm.setVersionInfo(versionInfo);
-          vendorLicenseModels.add(versionedVlm);
-        }
-      }catch(RuntimeException rte){
-        logger.error("Error trying to retrieve vlm["+entry.getKey()+"] version["+version.toString
-                ()+"] " +
-                "message:"+rte
-                .getMessage());
-      }
-    }
-
-    sortVlmListByModificationTimeDescOrder(vendorLicenseModels);
-
+    vendorLicenseModelDao.create(vendorLicenseModelEntity);
     mdcDataDebugMessage.debugExitMessage(null);
-    return vendorLicenseModels;
+
+    return vendorLicenseModelEntity;
   }
 
   @Override
-  public VendorLicenseModelEntity createVendorLicenseModel(VendorLicenseModelEntity vendorLicenseModelEntity, String user) {
-
-    VendorLicenseModelEntity vendorLicenseModelCreated = vendorLicenseFacade.createVendorLicenseModel(vendorLicenseModelEntity, user);
-
-    ActivityLogEntity activityLogEntity = new ActivityLogEntity(vendorLicenseModelCreated.getId(),
-            String.valueOf(vendorLicenseModelCreated.getVersion().getMajor()+1),
-            ActivityType.CREATE_NEW.toString(), user, true, "", "");
-    activityLogManager.addActionLog(activityLogEntity, user);
-
-    return vendorLicenseModelCreated;
-  }
-
-  @Override
-  public void updateVendorLicenseModel(VendorLicenseModelEntity vendorLicenseModelEntity,
-                                       String user) {
+  public void updateVendorLicenseModel(VendorLicenseModelEntity vendorLicenseModelEntity) {
     mdcDataDebugMessage.debugEntryMessage("VLM id", vendorLicenseModelEntity.getId());
 
-    Version version = resloveVersion(vendorLicenseModelEntity.getId(),null,
-            getVersionInfo(vendorLicenseModelEntity.getId(), VersionableEntityAction.Write, user),
-            user);
-    vendorLicenseModelEntity.setVersion(version);
-
     String existingVendorName = vendorLicenseModelDao.get(vendorLicenseModelEntity).getVendorName();
 
     updateUniqueName(VendorLicenseConstants.UniqueValues.VENDOR_NAME, existingVendorName,
-            vendorLicenseModelEntity.getVendorName());
+        vendorLicenseModelEntity.getVendorName());
     vendorLicenseModelDao.update(vendorLicenseModelEntity);
 
-    vendorLicenseFacade
-            .updateVlmLastModificationTime(vendorLicenseModelEntity.getId(), version);
-
     mdcDataDebugMessage.debugExitMessage("VLM id", vendorLicenseModelEntity.getId());
   }
 
   @Override
-  public VersionedVendorLicenseModel getVendorLicenseModel(String vlmId, Version version,
-                                                           String user) {
-    return vendorLicenseFacade.getVendorLicenseModel(vlmId, version, user);
+  public VendorLicenseModelEntity getVendorLicenseModel(String vlmId, Version version) {
+    return vendorLicenseFacade.getVendorLicenseModel(vlmId, version);
   }
 
   @Override
-  public void deleteVendorLicenseModel(String vlmId, String user) {
+  public void deleteVendorLicenseModel(String vlmId, Version version) {
     MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
-            LoggerTragetServiceName.DELETE_ENTITY, ErrorLevel.ERROR.name(),
-            LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.UNSUPPORTED_OPERATION);
+        LoggerTragetServiceName.DELETE_ENTITY, ErrorLevel.ERROR.name(),
+        LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.UNSUPPORTED_OPERATION);
     throw new UnsupportedOperationException(VendorLicenseConstants.UNSUPPORTED_OPERATION_ERROR);
   }
 
   @Override
-  public Collection<LicenseAgreementEntity> listLicenseAgreements(String vlmId, Version version,
-                                                                  String user) {
+  public Collection<LicenseAgreementEntity> listLicenseAgreements(String vlmId, Version version) {
     mdcDataDebugMessage.debugEntryMessage("VLM id", vlmId);
     mdcDataDebugMessage.debugExitMessage("VLM id", vlmId);
-    LicenseAgreementEntity licenseAgreementEntity =  createLicenseAgreementForList(vlmId, version,
-            user);
-//    return licenseAgreementDao.list(new LicenseAgreementEntity(vlmId, VersioningUtil
-//        .resolveVersion(version, getVersionInfo(vlmId, VersionableEntityAction.Read, user), user),
-//        null));
-    return licenseAgreementDao.list(licenseAgreementEntity);
+    return licenseAgreementDao.list(new LicenseAgreementEntity(vlmId, version, null));
   }
 
   @Override
-  public LicenseAgreementEntity createLicenseAgreement(LicenseAgreementEntity licenseAgreement,
-                                                       String user) {
+  public LicenseAgreementEntity createLicenseAgreement(LicenseAgreementEntity licenseAgreement) {
     mdcDataDebugMessage
-            .debugEntryMessage("VLM id", licenseAgreement.getVendorLicenseModelId());
+        .debugEntryMessage("VLM id", licenseAgreement.getVendorLicenseModelId());
     mdcDataDebugMessage
-            .debugExitMessage("VLM id", licenseAgreement.getVendorLicenseModelId());
-    return vendorLicenseFacade.createLicenseAgreement(licenseAgreement, user);
+        .debugExitMessage("VLM id", licenseAgreement.getVendorLicenseModelId());
+    return vendorLicenseFacade.createLicenseAgreement(licenseAgreement);
   }
 
   @Override
   public void updateLicenseAgreement(LicenseAgreementEntity licenseAgreement,
                                      Set<String> addedFeatureGroupIds,
-                                     Set<String> removedFeatureGroupIds, String user) {
+                                     Set<String> removedFeatureGroupIds) {
     mdcDataDebugMessage.debugEntryMessage("VLM id, LA id", licenseAgreement
-            .getVendorLicenseModelId(), licenseAgreement.getId());
+        .getVendorLicenseModelId(), licenseAgreement.getId());
 
-    Version version = VersioningUtil.resolveVersion(licenseAgreement.getVersion(),
-            getVersionInfo(licenseAgreement.getVendorLicenseModelId(), VersionableEntityAction.Write,
-                    user), user);
-    licenseAgreement.setVersion(version);
     LicenseAgreementEntity retrieved = licenseAgreementDao.get(licenseAgreement);
     VersioningUtil
-            .validateEntityExistence(retrieved, licenseAgreement, VendorLicenseModelEntity.ENTITY_TYPE);
+        .validateEntityExistence(retrieved, licenseAgreement, VendorLicenseModelEntity.ENTITY_TYPE);
     VersioningUtil.validateContainedEntitiesExistence(new FeatureGroupEntity().getEntityType(),
-            removedFeatureGroupIds, retrieved, retrieved.getFeatureGroupIds());
+        removedFeatureGroupIds, retrieved, retrieved.getFeatureGroupIds());
     VersioningUtil.validateEntitiesExistence(addedFeatureGroupIds,
-            new FeatureGroupEntity(licenseAgreement.getVendorLicenseModelId(), version, null),
-            featureGroupDao, VendorLicenseModelEntity.ENTITY_TYPE);
+        new FeatureGroupEntity(licenseAgreement.getVendorLicenseModelId(),
+            licenseAgreement.getVersion(),
+            null),
+        featureGroupDao, VendorLicenseModelEntity.ENTITY_TYPE);
 
     updateUniqueName(VendorLicenseConstants.UniqueValues.LICENSE_AGREEMENT_NAME,
-            retrieved.getName(), licenseAgreement.getName(), licenseAgreement.getVendorLicenseModelId(),
-            licenseAgreement.getVersion().toString());
+        retrieved.getName(), licenseAgreement.getName(), licenseAgreement.getVendorLicenseModelId(),
+        licenseAgreement.getVersion().getId());
     licenseAgreementDao.updateColumnsAndDeltaFeatureGroupIds(licenseAgreement, addedFeatureGroupIds,
-            removedFeatureGroupIds);
+        removedFeatureGroupIds);
 
     addFeatureGroupsToLicenseAgreementRef(addedFeatureGroupIds, licenseAgreement);
     removeFeatureGroupsToLicenseAgreementRef(removedFeatureGroupIds, licenseAgreement);
 
-    vendorLicenseFacade
-            .updateVlmLastModificationTime(licenseAgreement.getVendorLicenseModelId(), version);
-
     mdcDataDebugMessage.debugExitMessage("VLM id, LA id", licenseAgreement
-            .getVendorLicenseModelId(), licenseAgreement.getId());
+        .getVendorLicenseModelId(), licenseAgreement.getId());
   }
 
   @Override
   public LicenseAgreementModel getLicenseAgreementModel(String vlmId, Version version,
-                                                        String licenseAgreementId, String user) {
+                                                        String licenseAgreementId) {
 
     mdcDataDebugMessage.debugEntryMessage("VLM id, LA id", vlmId, licenseAgreementId);
     mdcDataDebugMessage.debugExitMessage("VLM id, LA id", vlmId, licenseAgreementId);
-    return vendorLicenseFacade.getLicenseAgreementModel(vlmId, version, licenseAgreementId, user);
+    return vendorLicenseFacade.getLicenseAgreementModel(vlmId, version, licenseAgreementId);
   }
 
   @Override
-  public void deleteLicenseAgreement(String vlmId, Version version, String licenseAgreementId,
-                                     String user) {
+  public void deleteLicenseAgreement(String vlmId, Version version, String licenseAgreementId) {
     mdcDataDebugMessage.debugEntryMessage("VLM id, LA id", vlmId, licenseAgreementId);
 
-    version = VersioningUtil
-            .resolveVersion(version, getVersionInfo(vlmId, VersionableEntityAction.Write, user), user);
     LicenseAgreementEntity input =
-            new LicenseAgreementEntity(vlmId, version, licenseAgreementId);
+        new LicenseAgreementEntity(vlmId, version, licenseAgreementId);
     LicenseAgreementEntity retrieved = licenseAgreementDao.get(input);
     VersioningUtil.validateEntityExistence(retrieved, input, VendorLicenseModelEntity.ENTITY_TYPE);
 
@@ -364,29 +204,25 @@
     licenseAgreementDao.delete(retrieved);
 
     deleteUniqueName(VendorLicenseConstants.UniqueValues.LICENSE_AGREEMENT_NAME,
-            retrieved.getVendorLicenseModelId(), retrieved.getVersion().toString(),
-            retrieved.getName());
-
-    vendorLicenseFacade
-            .updateVlmLastModificationTime(input.getVendorLicenseModelId(), input.getVersion());
+        retrieved.getVendorLicenseModelId(), retrieved.getVersion().toString(),
+        retrieved.getName());
 
     mdcDataDebugMessage.debugExitMessage("VLM id, LA id", vlmId, licenseAgreementId);
   }
 
   @Override
-  public Collection<FeatureGroupEntity> listFeatureGroups(String vlmId, Version version,
-                                                          String user) {
+  public Collection<FeatureGroupEntity> listFeatureGroups(String vlmId, Version version) {
     mdcDataDebugMessage.debugEntryMessage("VLM id", vlmId);
     mdcDataDebugMessage.debugExitMessage("VLM id", vlmId);
-    return vendorLicenseFacade.listFeatureGroups(vlmId, version, user);
+    return vendorLicenseFacade.listFeatureGroups(vlmId, version);
   }
 
   @Override
-  public FeatureGroupEntity createFeatureGroup(FeatureGroupEntity featureGroup, String user) {
+  public FeatureGroupEntity createFeatureGroup(FeatureGroupEntity featureGroup) {
     mdcDataDebugMessage
-            .debugEntryMessage("VLM id", featureGroup.getVendorLicenseModelId());
+        .debugEntryMessage("VLM id", featureGroup.getVendorLicenseModelId());
     mdcDataDebugMessage.debugExitMessage("VLM id", featureGroup.getId());
-    return vendorLicenseFacade.createFeatureGroup(featureGroup, user);
+    return vendorLicenseFacade.createFeatureGroup(featureGroup);
   }
 
   @Override
@@ -394,35 +230,31 @@
                                  Set<String> addedLicenseKeyGroups,
                                  Set<String> removedLicenseKeyGroups,
                                  Set<String> addedEntitlementPools,
-                                 Set<String> removedEntitlementPools,
-                                 String user) {
+                                 Set<String> removedEntitlementPools) {
     mdcDataDebugMessage.debugEntryMessage("VLM id, FG id", featureGroup
-            .getVendorLicenseModelId(), featureGroup.getId());
-
-    Version version = VersioningUtil.resolveVersion(featureGroup.getVersion(),
-            getVersionInfo(featureGroup.getVendorLicenseModelId(), VersionableEntityAction.Write, user),
-            user);
-    featureGroup.setVersion(version);
+        .getVendorLicenseModelId(), featureGroup.getId());
 
     FeatureGroupEntity retrieved = featureGroupDao.get(featureGroup);
     VersioningUtil
-            .validateEntityExistence(retrieved, featureGroup, VendorLicenseModelEntity.ENTITY_TYPE);
+        .validateEntityExistence(retrieved, featureGroup, VendorLicenseModelEntity.ENTITY_TYPE);
 
     VersioningUtil.validateContainedEntitiesExistence(new LicenseKeyGroupEntity().getEntityType(),
-            removedLicenseKeyGroups, retrieved, retrieved.getLicenseKeyGroupIds());
+        removedLicenseKeyGroups, retrieved, retrieved.getLicenseKeyGroupIds());
     VersioningUtil.validateContainedEntitiesExistence(new EntitlementPoolEntity().getEntityType(),
-            removedEntitlementPools, retrieved, retrieved.getEntitlementPoolIds());
+        removedEntitlementPools, retrieved, retrieved.getEntitlementPoolIds());
 
     VersioningUtil.validateEntitiesExistence(addedLicenseKeyGroups,
-            new LicenseKeyGroupEntity(featureGroup.getVendorLicenseModelId(), version, null),
-            licenseKeyGroupDao, VendorLicenseModelEntity.ENTITY_TYPE);
+        new LicenseKeyGroupEntity(featureGroup.getVendorLicenseModelId(), featureGroup.getVersion(),
+            null),
+        licenseKeyGroupDao, VendorLicenseModelEntity.ENTITY_TYPE);
     VersioningUtil.validateEntitiesExistence(addedEntitlementPools,
-            new EntitlementPoolEntity(featureGroup.getVendorLicenseModelId(), version, null),
-            entitlementPoolDao, VendorLicenseModelEntity.ENTITY_TYPE);
+        new EntitlementPoolEntity(featureGroup.getVendorLicenseModelId(), featureGroup.getVersion(),
+            null),
+        entitlementPoolDao, VendorLicenseModelEntity.ENTITY_TYPE);
 
     updateUniqueName(VendorLicenseConstants.UniqueValues.FEATURE_GROUP_NAME,
-            retrieved.getName(), featureGroup.getName(), featureGroup.getVendorLicenseModelId(),
-            featureGroup.getVersion().toString());
+        retrieved.getName(), featureGroup.getName(), featureGroup.getVendorLicenseModelId(),
+        featureGroup.getVersion().getId());
 
     addLicenseKeyGroupsToFeatureGroupsRef(addedLicenseKeyGroups, featureGroup);
     removeLicenseKeyGroupsToFeatureGroupsRef(removedLicenseKeyGroups, featureGroup);
@@ -430,413 +262,364 @@
     removeEntitlementPoolsToFeatureGroupsRef(removedEntitlementPools, featureGroup);
 
     featureGroupDao.updateFeatureGroup(featureGroup, addedEntitlementPools, removedEntitlementPools,
-            addedLicenseKeyGroups, removedLicenseKeyGroups);
-
-    vendorLicenseFacade
-            .updateVlmLastModificationTime(featureGroup.getVendorLicenseModelId(), version);
+        addedLicenseKeyGroups, removedLicenseKeyGroups);
 
     mdcDataDebugMessage.debugExitMessage("VLM id, FG id", featureGroup
-            .getVendorLicenseModelId(), featureGroup.getId());
+        .getVendorLicenseModelId(), featureGroup.getId());
   }
 
   @Override
-  public FeatureGroupModel getFeatureGroupModel(FeatureGroupEntity featureGroup, String user) {
+  public FeatureGroupModel getFeatureGroupModel(FeatureGroupEntity featureGroup) {
     mdcDataDebugMessage.debugEntryMessage("VLM id, FG id",
-            featureGroup.getVendorLicenseModelId(), featureGroup.getId());
+        featureGroup.getVendorLicenseModelId(), featureGroup.getId());
 
     mdcDataDebugMessage.debugExitMessage("VLM id, FG id",
-            featureGroup.getVendorLicenseModelId(), featureGroup.getId());
-    return vendorLicenseFacade.getFeatureGroupModel(featureGroup, user);
+        featureGroup.getVendorLicenseModelId(), featureGroup.getId());
+    return vendorLicenseFacade.getFeatureGroupModel(featureGroup);
   }
 
   @Override
-  public void deleteFeatureGroup(FeatureGroupEntity featureGroup, String user) {
+  public void deleteFeatureGroup(FeatureGroupEntity featureGroup) {
     mdcDataDebugMessage.debugEntryMessage("VLM id, FG id",
-            featureGroup.getVendorLicenseModelId(), featureGroup.getId());
+        featureGroup.getVendorLicenseModelId(), featureGroup.getId());
 
-    Version version = VersioningUtil.resolveVersion(featureGroup.getVersion(),
-            getVersionInfo(featureGroup.getVendorLicenseModelId(), VersionableEntityAction.Write,
-                    user), user);
-    featureGroup.setVersion(version);
     FeatureGroupEntity retrieved = featureGroupDao.get(featureGroup);
     VersioningUtil
-            .validateEntityExistence(retrieved, featureGroup, VendorLicenseModelEntity.ENTITY_TYPE);
+        .validateEntityExistence(retrieved, featureGroup, VendorLicenseModelEntity.ENTITY_TYPE);
 
     removeLicenseKeyGroupsToFeatureGroupsRef(retrieved.getLicenseKeyGroupIds(), featureGroup);
     removeEntitlementPoolsToFeatureGroupsRef(retrieved.getEntitlementPoolIds(), featureGroup);
 
     for (String licenceAgreementId : retrieved.getReferencingLicenseAgreements()) {
       licenseAgreementDao.removeFeatureGroup(
-              new LicenseAgreementEntity(featureGroup.getVendorLicenseModelId(), version,
-                      licenceAgreementId), featureGroup.getId());
+          new LicenseAgreementEntity(featureGroup.getVendorLicenseModelId(),
+              featureGroup.getVersion(),
+              licenceAgreementId), featureGroup.getId());
     }
 
     featureGroupDao.delete(featureGroup);
 
     deleteUniqueName(VendorLicenseConstants.UniqueValues.FEATURE_GROUP_NAME,
-            retrieved.getVendorLicenseModelId(), retrieved.getVersion().toString(),
-            retrieved.getName());
-
-    vendorLicenseFacade.updateVlmLastModificationTime(featureGroup.getVendorLicenseModelId(),
-            featureGroup.getVersion());
+        retrieved.getVendorLicenseModelId(), retrieved.getVersion().toString(),
+        retrieved.getName());
 
     mdcDataDebugMessage
-            .debugExitMessage("VLM id, FG id",
-                    featureGroup.getVendorLicenseModelId(), featureGroup.getId());
+        .debugExitMessage("VLM id, FG id",
+            featureGroup.getVendorLicenseModelId(), featureGroup.getId());
   }
 
   @Override
-  public Collection<EntitlementPoolEntity> listEntitlementPools(String vlmId, Version version,
-                                                                String user) {
+  public Collection<EntitlementPoolEntity> listEntitlementPools(String vlmId, Version version) {
     mdcDataDebugMessage.debugEntryMessage("VLM id", vlmId);
     mdcDataDebugMessage.debugExitMessage("VLM id", vlmId);
-    return vendorLicenseFacade.listEntitlementPools(vlmId, version, user);
+    return vendorLicenseFacade.listEntitlementPools(vlmId, version);
   }
 
   @Override
-  public EntitlementPoolEntity createEntitlementPool(EntitlementPoolEntity entitlementPool,
-                                                     String user) {
+  public EntitlementPoolEntity createEntitlementPool(EntitlementPoolEntity entitlementPool) {
     mdcDataDebugMessage
-            .debugEntryMessage("VLM id", entitlementPool.getVendorLicenseModelId());
+        .debugEntryMessage("VLM id", entitlementPool.getVendorLicenseModelId());
     mdcDataDebugMessage
-            .debugExitMessage("VLM id", entitlementPool.getVendorLicenseModelId());
+        .debugExitMessage("VLM id", entitlementPool.getVendorLicenseModelId());
 
     entitlementPool.setStartDate(entitlementPool.getStartDate() != null ? (entitlementPool
-            .getStartDate().trim().length() != 0 ? entitlementPool.getStartDate()+"T00:00:00Z"
-            : null) : null);
+        .getStartDate().trim().length() != 0 ? entitlementPool.getStartDate() + "T00:00:00Z"
+        : null) : null);
     entitlementPool.setExpiryDate(entitlementPool.getExpiryDate() != null ? (entitlementPool
-            .getExpiryDate().trim().length() != 0 ? entitlementPool.getExpiryDate()+"T23:59:59Z"
-            : null) : null);
+        .getExpiryDate().trim().length() != 0 ? entitlementPool.getExpiryDate() + "T23:59:59Z"
+        : null) : null);
 
     validateCreateDate(entitlementPool.getStartDate(), entitlementPool.getExpiryDate(),
-            entitlementPool.getVendorLicenseModelId());
-    return vendorLicenseFacade.createEntitlementPool(entitlementPool, user);
+        entitlementPool.getVendorLicenseModelId());
+    return vendorLicenseFacade.createEntitlementPool(entitlementPool);
   }
 
-  private void validateCreateDate(String startDate, String expiryDate, String vendorLicenseModelId){
+  private void validateCreateDate(String startDate, String expiryDate,
+                                  String vendorLicenseModelId) {
     mdcDataDebugMessage.debugEntryMessage("Start date and end date", startDate
-            +"   "+expiryDate);
+        + "   " + expiryDate);
 
     DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy'T'HH:mm:ss'Z'");
 
-    if(startDate != null && expiryDate != null) {
+    if (startDate != null && expiryDate != null) {
       if (LocalDate.parse(startDate, formatter).atStartOfDay().isBefore
-              (LocalDate.now().atStartOfDay()) || LocalDate.parse(expiryDate, formatter).atStartOfDay()
-              .isEqual(LocalDate.parse(startDate, formatter).atStartOfDay()) || LocalDate
-              .parse(expiryDate, formatter).isBefore(LocalDate.parse(startDate, formatter))) {
+          (LocalDate.now().atStartOfDay()) || LocalDate.parse(expiryDate, formatter).atStartOfDay()
+          .isEqual(LocalDate.parse(startDate, formatter).atStartOfDay()) || LocalDate
+          .parse(expiryDate, formatter).isBefore(LocalDate.parse(startDate, formatter))) {
         MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
-                LoggerTragetServiceName.VALIDATE_DATE_RANGE,ErrorLevel.ERROR.name(),
-                LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.INVALID_VALUE);
+            LoggerTragetServiceName.VALIDATE_DATE_RANGE, ErrorLevel.ERROR.name(),
+            LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.INVALID_VALUE);
         throw new CoreException(
-                new InvalidDateErrorBuilder(vendorLicenseModelId)
-                        .build());
+            new InvalidDateErrorBuilder(vendorLicenseModelId)
+                .build());
       }
     }
 
-    if(startDate != null && expiryDate == null) {
+    if (startDate != null && expiryDate == null) {
       if (LocalDate.parse(startDate, formatter).atStartOfDay().isBefore
-              (LocalDate.now().atStartOfDay())) {
+          (LocalDate.now().atStartOfDay())) {
         MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
-                LoggerTragetServiceName.VALIDATE_DATE_RANGE,ErrorLevel.ERROR.name(),
-                LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.INVALID_VALUE);
+            LoggerTragetServiceName.VALIDATE_DATE_RANGE, ErrorLevel.ERROR.name(),
+            LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.INVALID_VALUE);
         throw new CoreException(
-                new InvalidDateErrorBuilder(vendorLicenseModelId)
-                        .build());
+            new InvalidDateErrorBuilder(vendorLicenseModelId)
+                .build());
       }
     }
 
-    if(startDate == null && expiryDate != null) {
+    if (startDate == null && expiryDate != null) {
       MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
-              LoggerTragetServiceName.VALIDATE_DATE_RANGE,ErrorLevel.ERROR.name(),
-              LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.INVALID_VALUE);
+          LoggerTragetServiceName.VALIDATE_DATE_RANGE, ErrorLevel.ERROR.name(),
+          LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.INVALID_VALUE);
       throw new CoreException(
-              new InvalidDateErrorBuilder(vendorLicenseModelId)
-                      .build());
+          new InvalidDateErrorBuilder(vendorLicenseModelId)
+              .build());
 
     }
 
-    mdcDataDebugMessage.debugExitMessage(null,null);
+    mdcDataDebugMessage.debugExitMessage(null);
   }
 
-  private void validateUpdateDate(String startDate, String expiryDate, String vendorLicenseModelId){
+  private void validateUpdateDate(String startDate, String expiryDate,
+                                  String vendorLicenseModelId) {
     mdcDataDebugMessage.debugEntryMessage("Start date and end date", startDate
-            +"   "+ expiryDate);
+        + "   " + expiryDate);
 
     DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy'T'HH:mm:ss'Z'");
 
-    if(startDate != null && expiryDate != null) {
+    if (startDate != null && expiryDate != null) {
       if (LocalDate.parse(expiryDate, formatter).atStartOfDay()
-              .isEqual(LocalDate.parse(startDate, formatter).atStartOfDay()) ||
-              LocalDate.parse(expiryDate, formatter).isBefore(LocalDate.parse(startDate, formatter))) {
+          .isEqual(LocalDate.parse(startDate, formatter).atStartOfDay()) ||
+          LocalDate.parse(expiryDate, formatter).isBefore(LocalDate.parse(startDate, formatter))) {
         MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
-                LoggerTragetServiceName.VALIDATE_DATE_RANGE,ErrorLevel.ERROR.name(),
-                LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.INVALID_VALUE);
+            LoggerTragetServiceName.VALIDATE_DATE_RANGE, ErrorLevel.ERROR.name(),
+            LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.INVALID_VALUE);
         throw new CoreException(
-                new InvalidDateErrorBuilder(vendorLicenseModelId)
-                        .build());
+            new InvalidDateErrorBuilder(vendorLicenseModelId)
+                .build());
       }
     }
 
-    if(startDate == null && expiryDate != null) {
+    if (startDate == null && expiryDate != null) {
       MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
-              LoggerTragetServiceName.VALIDATE_DATE_RANGE,ErrorLevel.ERROR.name(),
-              LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.INVALID_VALUE);
+          LoggerTragetServiceName.VALIDATE_DATE_RANGE, ErrorLevel.ERROR.name(),
+          LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.INVALID_VALUE);
       throw new CoreException(
-              new InvalidDateErrorBuilder(vendorLicenseModelId)
-                      .build());
+          new InvalidDateErrorBuilder(vendorLicenseModelId)
+              .build());
 
     }
 
-    mdcDataDebugMessage.debugExitMessage(null,null);
+    mdcDataDebugMessage.debugExitMessage(null);
   }
 
   @Override
-  public void updateEntitlementPool(EntitlementPoolEntity entitlementPool, String user) {
+  public void updateEntitlementPool(EntitlementPoolEntity entitlementPool) {
     mdcDataDebugMessage.debugEntryMessage("VLM id, EP id", entitlementPool
-            .getVendorLicenseModelId(), entitlementPool.getId());
+        .getVendorLicenseModelId(), entitlementPool.getId());
 
     entitlementPool.setStartDate(entitlementPool.getStartDate() != null ? (entitlementPool
-            .getStartDate().trim().length() != 0 ? entitlementPool.getStartDate()+"T00:00:00Z"
-            : null) : null);
+        .getStartDate().trim().length() != 0 ? entitlementPool.getStartDate() + "T00:00:00Z"
+        : null) : null);
     entitlementPool.setExpiryDate(entitlementPool.getExpiryDate() != null ? (entitlementPool
-            .getExpiryDate().trim().length() != 0 ? entitlementPool.getExpiryDate()+"T23:59:59Z"
-            : null) : null);
+        .getExpiryDate().trim().length() != 0 ? entitlementPool.getExpiryDate() + "T23:59:59Z"
+        : null) : null);
 
     validateUpdateDate(entitlementPool.getStartDate(), entitlementPool.getExpiryDate(),
-            entitlementPool.getVendorLicenseModelId());
-    Version version = VersioningUtil.resolveVersion(entitlementPool.getVersion(),
-            getVersionInfo(entitlementPool.getVendorLicenseModelId(), VersionableEntityAction.Write,
-                    user), user);
-    vendorLicenseFacade
-            .updateVlmLastModificationTime(entitlementPool.getVendorLicenseModelId(), version);
-    vendorLicenseFacade.updateEntitlementPool(entitlementPool, user);
+        entitlementPool.getVendorLicenseModelId());
+    vendorLicenseFacade.updateEntitlementPool(entitlementPool);
 
     mdcDataDebugMessage.debugExitMessage("VLM id, EP id", entitlementPool
-            .getVendorLicenseModelId(), entitlementPool.getId());
+        .getVendorLicenseModelId(), entitlementPool.getId());
   }
 
   @Override
-  public EntitlementPoolEntity getEntitlementPool(EntitlementPoolEntity entitlementPool,
-                                                  String user) {
+  public EntitlementPoolEntity getEntitlementPool(EntitlementPoolEntity entitlementPool) {
     mdcDataDebugMessage.debugEntryMessage("VLM id, EP id", entitlementPool
-            .getVendorLicenseModelId(), entitlementPool.getId());
-
-    entitlementPool.setVersion(VersioningUtil.resolveVersion(entitlementPool.getVersion(),
-            getVersionInfo(entitlementPool.getVendorLicenseModelId(), VersionableEntityAction.Read,
-                    user), user));
+        .getVendorLicenseModelId(), entitlementPool.getId());
 
     EntitlementPoolEntity retrieved = entitlementPoolDao.get(entitlementPool);
     VersioningUtil
-            .validateEntityExistence(retrieved, entitlementPool, VendorLicenseModelEntity.ENTITY_TYPE);
+        .validateEntityExistence(retrieved, entitlementPool, VendorLicenseModelEntity.ENTITY_TYPE);
 
     DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy'T'HH:mm:ss'Z'");
     DateTimeFormatter targetFormatter = DateTimeFormatter.ofPattern("MM/dd/yyyy");
-    if(retrieved.getStartDate() != null){
-      retrieved.setStartDate(LocalDate.parse(retrieved.getStartDate(),formatter).format
-              (targetFormatter));
+    if (retrieved.getStartDate() != null) {
+      retrieved.setStartDate(LocalDate.parse(retrieved.getStartDate(), formatter).format
+          (targetFormatter));
     }
 
-    if(retrieved.getExpiryDate() != null){
-      retrieved.setExpiryDate(LocalDate.parse(retrieved.getExpiryDate(),formatter).format
-              (targetFormatter));
+    if (retrieved.getExpiryDate() != null) {
+      retrieved.setExpiryDate(LocalDate.parse(retrieved.getExpiryDate(), formatter).format
+          (targetFormatter));
     }
 
     mdcDataDebugMessage.debugExitMessage("VLM id, EP id", entitlementPool
-            .getVendorLicenseModelId(), entitlementPool.getId());
+        .getVendorLicenseModelId(), entitlementPool.getId());
     return retrieved;
   }
 
   @Override
-  public void deleteEntitlementPool(EntitlementPoolEntity entitlementPool, String user) {
+  public void deleteEntitlementPool(EntitlementPoolEntity entitlementPool) {
     mdcDataDebugMessage.debugEntryMessage("VLM id, EP id", entitlementPool
-            .getVendorLicenseModelId(), entitlementPool.getId());
-
-    Version version = VersioningUtil.resolveVersion(entitlementPool.getVersion(),
-            getVersionInfo(entitlementPool.getVendorLicenseModelId(), VersionableEntityAction.Write,
-                    user), user);
-    entitlementPool.setVersion(version);
+        .getVendorLicenseModelId(), entitlementPool.getId());
 
     EntitlementPoolEntity retrieved = entitlementPoolDao.get(entitlementPool);
     VersioningUtil
-            .validateEntityExistence(retrieved, entitlementPool, VendorLicenseModelEntity.ENTITY_TYPE);
+        .validateEntityExistence(retrieved, entitlementPool, VendorLicenseModelEntity.ENTITY_TYPE);
 
     for (String referencingFeatureGroupId : retrieved.getReferencingFeatureGroups()) {
       featureGroupDao.removeEntitlementPool(
-              new FeatureGroupEntity(entitlementPool.getVendorLicenseModelId(), version,
-                      referencingFeatureGroupId), entitlementPool.getId());
+          new FeatureGroupEntity(entitlementPool.getVendorLicenseModelId(),
+              entitlementPool.getVersion(),
+              referencingFeatureGroupId), entitlementPool.getId());
     }
 
-    deleteChildLimits(entitlementPool.getVendorLicenseModelId(), entitlementPool.getVersion(), entitlementPool.getId(), user);
+    deleteChildLimits(entitlementPool.getVendorLicenseModelId(), entitlementPool.getVersion(),
+        entitlementPool.getId());
 
     entitlementPoolDao.delete(entitlementPool);
 
     deleteUniqueName(VendorLicenseConstants.UniqueValues.ENTITLEMENT_POOL_NAME,
-            retrieved.getVendorLicenseModelId(), retrieved.getVersion().toString(),
-            retrieved.getName());
-
-    vendorLicenseFacade.updateVlmLastModificationTime(entitlementPool.getVendorLicenseModelId(),
-            entitlementPool.getVersion());
+        retrieved.getVendorLicenseModelId(), retrieved.getVersion().toString(),
+        retrieved.getName());
 
     mdcDataDebugMessage.debugExitMessage("VLM id, EP id", entitlementPool
-            .getVendorLicenseModelId(), entitlementPool.getId());
+        .getVendorLicenseModelId(), entitlementPool.getId());
   }
 
-  protected void deleteChildLimits(String vlmId, Version version, String epLkgId, String user) {
+  protected void deleteChildLimits(String vlmId, Version version, String epLkgId) {
     Optional<Collection<LimitEntity>> limitEntities = Optional.ofNullable(
-            listLimits(vlmId, version, epLkgId, user));
-    limitEntities.ifPresent(entities->
-            entities.forEach(entity->
-                    deleteLimit(entity, user)));
+        listLimits(vlmId, version, epLkgId));
+    limitEntities.ifPresent(entities -> entities.forEach(this::deleteLimit));
   }
 
   @Override
-  public Collection<LicenseKeyGroupEntity> listLicenseKeyGroups(String vlmId, Version version,
-                                                                String user) {
+  public Collection<LicenseKeyGroupEntity> listLicenseKeyGroups(String vlmId, Version version) {
     mdcDataDebugMessage.debugEntryMessage("VLM id", vlmId);
     mdcDataDebugMessage.debugExitMessage("VLM id", vlmId);
-    return vendorLicenseFacade.listLicenseKeyGroups(vlmId, version, user);
+    return vendorLicenseFacade.listLicenseKeyGroups(vlmId, version);
   }
 
   @Override
-  public LicenseKeyGroupEntity createLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup,
-                                                     String user) {
+  public LicenseKeyGroupEntity createLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup) {
     mdcDataDebugMessage
-            .debugEntryMessage("VLM id", licenseKeyGroup.getVendorLicenseModelId());
+        .debugEntryMessage("VLM id", licenseKeyGroup.getVendorLicenseModelId());
 
     mdcDataDebugMessage.debugExitMessage("VLM id", licenseKeyGroup
-            .getVendorLicenseModelId());
+        .getVendorLicenseModelId());
 
     licenseKeyGroup.setStartDate(licenseKeyGroup.getStartDate() != null ? (licenseKeyGroup
-            .getStartDate().trim().length() != 0 ? licenseKeyGroup.getStartDate()+"T00:00:00Z"
-            : null) : null);
+        .getStartDate().trim().length() != 0 ? licenseKeyGroup.getStartDate() + "T00:00:00Z"
+        : null) : null);
     licenseKeyGroup.setExpiryDate(licenseKeyGroup.getExpiryDate() != null ? (licenseKeyGroup
-            .getExpiryDate().trim().length() != 0 ? licenseKeyGroup.getExpiryDate()+"T23:59:59Z"
-            : null) : null);
+        .getExpiryDate().trim().length() != 0 ? licenseKeyGroup.getExpiryDate() + "T23:59:59Z"
+        : null) : null);
 
     validateCreateDate(licenseKeyGroup.getStartDate(), licenseKeyGroup.getExpiryDate(),
-            licenseKeyGroup.getVendorLicenseModelId());
-    return vendorLicenseFacade.createLicenseKeyGroup(licenseKeyGroup, user);
+        licenseKeyGroup.getVendorLicenseModelId());
+    return vendorLicenseFacade.createLicenseKeyGroup(licenseKeyGroup);
   }
 
   @Override
-  public void updateLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup, String user) {
+  public void updateLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup) {
     mdcDataDebugMessage.debugEntryMessage("VLM id, LKG id", licenseKeyGroup
-            .getVendorLicenseModelId(), licenseKeyGroup.getId());
+        .getVendorLicenseModelId(), licenseKeyGroup.getId());
 
     licenseKeyGroup.setStartDate(licenseKeyGroup.getStartDate() != null ? (licenseKeyGroup
-            .getStartDate().trim().length() != 0 ? licenseKeyGroup.getStartDate()+"T00:00:00Z"
-            : null) : null);
+        .getStartDate().trim().length() != 0 ? licenseKeyGroup.getStartDate() + "T00:00:00Z"
+        : null) : null);
     licenseKeyGroup.setExpiryDate(licenseKeyGroup.getExpiryDate() != null ? (licenseKeyGroup
-            .getExpiryDate().trim().length() != 0 ? licenseKeyGroup.getExpiryDate()+"T23:59:59Z"
-            : null) : null);
+        .getExpiryDate().trim().length() != 0 ? licenseKeyGroup.getExpiryDate() + "T23:59:59Z"
+        : null) : null);
 
     validateUpdateDate(licenseKeyGroup.getStartDate(), licenseKeyGroup.getExpiryDate(),
-            licenseKeyGroup.getVendorLicenseModelId());
-
-    Version version = VersioningUtil.resolveVersion(licenseKeyGroup.getVersion(),
-            getVersionInfo(licenseKeyGroup.getVendorLicenseModelId(), VersionableEntityAction.Write,
-                    user), user);
-    vendorLicenseFacade
-            .updateVlmLastModificationTime(licenseKeyGroup.getVendorLicenseModelId(), version);
-
-    vendorLicenseFacade.updateLicenseKeyGroup(licenseKeyGroup, user);
+        licenseKeyGroup.getVendorLicenseModelId());
+    vendorLicenseFacade.updateLicenseKeyGroup(licenseKeyGroup);
 
     mdcDataDebugMessage.debugExitMessage("VLM id, LKG id", licenseKeyGroup
-            .getVendorLicenseModelId(), licenseKeyGroup.getId());
+        .getVendorLicenseModelId(), licenseKeyGroup.getId());
   }
 
   @Override
-  public LicenseKeyGroupEntity getLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup,
-                                                  String user) {
+  public LicenseKeyGroupEntity getLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup) {
     mdcDataDebugMessage.debugEntryMessage("VLM id, LKG id", licenseKeyGroup
-            .getVendorLicenseModelId(), licenseKeyGroup.getId());
-
-    licenseKeyGroup.setVersion(VersioningUtil.resolveVersion(licenseKeyGroup.getVersion(),
-            getVersionInfo(licenseKeyGroup.getVendorLicenseModelId(), VersionableEntityAction.Read,
-                    user), user));
+        .getVendorLicenseModelId(), licenseKeyGroup.getId());
 
     LicenseKeyGroupEntity retrieved = licenseKeyGroupDao.get(licenseKeyGroup);
     VersioningUtil
-            .validateEntityExistence(retrieved, licenseKeyGroup, VendorLicenseModelEntity.ENTITY_TYPE);
+        .validateEntityExistence(retrieved, licenseKeyGroup, VendorLicenseModelEntity.ENTITY_TYPE);
 
     mdcDataDebugMessage.debugExitMessage("VLM id, LKG id", licenseKeyGroup
-            .getVendorLicenseModelId(), licenseKeyGroup.getId());
+        .getVendorLicenseModelId(), licenseKeyGroup.getId());
     return retrieved;
   }
 
   @Override
-  public void deleteLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup, String user) {
+  public void deleteLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup) {
     mdcDataDebugMessage.debugEntryMessage("VLM id, LKG id", licenseKeyGroup
-            .getVendorLicenseModelId(), licenseKeyGroup.getId());
-
-    Version version = VersioningUtil.resolveVersion(licenseKeyGroup.getVersion(),
-            getVersionInfo(licenseKeyGroup.getVendorLicenseModelId(), VersionableEntityAction.Write,
-                    user), user);
-    licenseKeyGroup.setVersion(version);
+        .getVendorLicenseModelId(), licenseKeyGroup.getId());
 
     LicenseKeyGroupEntity retrieved = licenseKeyGroupDao.get(licenseKeyGroup);
     VersioningUtil
-            .validateEntityExistence(retrieved, licenseKeyGroup, VendorLicenseModelEntity.ENTITY_TYPE);
+        .validateEntityExistence(retrieved, licenseKeyGroup, VendorLicenseModelEntity.ENTITY_TYPE);
 
     for (String referencingFeatureGroupId : retrieved.getReferencingFeatureGroups()) {
       featureGroupDao.removeLicenseKeyGroup(
-              new FeatureGroupEntity(licenseKeyGroup.getVendorLicenseModelId(), version,
-                      referencingFeatureGroupId), licenseKeyGroup.getId());
+          new FeatureGroupEntity(licenseKeyGroup.getVendorLicenseModelId(),
+              licenseKeyGroup.getVersion(),
+              referencingFeatureGroupId), licenseKeyGroup.getId());
     }
 
-    deleteChildLimits(licenseKeyGroup.getVendorLicenseModelId(), licenseKeyGroup.getVersion(), licenseKeyGroup.getId(), user);
+    deleteChildLimits(licenseKeyGroup.getVendorLicenseModelId(), licenseKeyGroup.getVersion(),
+        licenseKeyGroup.getId());
 
     licenseKeyGroupDao.delete(licenseKeyGroup);
 
     deleteUniqueName(VendorLicenseConstants.UniqueValues.LICENSE_KEY_GROUP_NAME,
-            retrieved.getVendorLicenseModelId(), retrieved.getVersion().toString(),
-            retrieved.getName());
-
-    vendorLicenseFacade.updateVlmLastModificationTime(licenseKeyGroup.getVendorLicenseModelId(),
-            licenseKeyGroup.getVersion());
+        retrieved.getVendorLicenseModelId(), retrieved.getVersion().toString(),
+        retrieved.getName());
 
     mdcDataDebugMessage.debugExitMessage("VLM id, LKG id", licenseKeyGroup
-            .getVendorLicenseModelId(), licenseKeyGroup.getId());
+        .getVendorLicenseModelId(), licenseKeyGroup.getId());
   }
 
   @Override
-  public LimitEntity createLimit(LimitEntity limit, String user) {
+  public LimitEntity createLimit(LimitEntity limit) {
     mdcDataDebugMessage
-            .debugEntryMessage("VLM id", limit.getVendorLicenseModelId(), "EP/LKGId", limit
-                    .getEpLkgId());
+        .debugEntryMessage("VLM id", limit.getVendorLicenseModelId(), "EP/LKGId", limit
+            .getEpLkgId());
     mdcDataDebugMessage
-            .debugExitMessage("VLM id", limit.getVendorLicenseModelId(), "EP/LKGId", limit
-                    .getEpLkgId());
-    validateLimit(limit, user);
-    LimitEntity createdLimit = vendorLicenseFacade.createLimit(limit, user);
-    updateParentForLimit(limit,user);
+        .debugExitMessage("VLM id", limit.getVendorLicenseModelId(), "EP/LKGId", limit
+            .getEpLkgId());
+    validateLimit(limit);
+    LimitEntity createdLimit = vendorLicenseFacade.createLimit(limit);
+    updateParentForLimit(limit);
     return createdLimit;
   }
 
-  private void validateLimit(LimitEntity limit, String user) {
-    Version version = VersioningUtil.resolveVersion(limit.getVersion(),
-            getVersionInfo(limit.getVendorLicenseModelId(), VersionableEntityAction.Write,
-                    user), user);
-    Collection<LimitEntity> limitList = listLimits(limit.getVendorLicenseModelId(),version
-            ,limit.getEpLkgId(), user);
+  private void validateLimit(LimitEntity limit) {
+    Collection<LimitEntity> limitList =
+        listLimits(limit.getVendorLicenseModelId(), limit.getVersion()
+            , limit.getEpLkgId());
 
-    if (!isLimitNameUnique(limitList,limit.getName(), limit.getType(), limit.getId())) {
+    if (!isLimitNameUnique(limitList, limit.getName(), limit.getType(), limit.getId())) {
       final ErrorCode duplicateLimitNameErrorBuilder =
-              LimitErrorBuilder.getDuplicateNameErrorbuilder(limit.getName(), limit.getType().name());
+          LimitErrorBuilder.getDuplicateNameErrorbuilder(limit.getName(), limit.getType().name());
       MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
-              LoggerServiceName.Create_LIMIT.toString(), ErrorLevel.ERROR.name(),
-              LoggerErrorCode.DATA_ERROR.getErrorCode(),
-              duplicateLimitNameErrorBuilder.message());
+          LoggerServiceName.Create_LIMIT.toString(), ErrorLevel.ERROR.name(),
+          LoggerErrorCode.DATA_ERROR.getErrorCode(),
+          duplicateLimitNameErrorBuilder.message());
       throw new CoreException(duplicateLimitNameErrorBuilder);
     }
   }
 
   private boolean isLimitNameUnique(Collection<LimitEntity> limitList, String name, LimitType
-          type, String id) {
+      type, String id) {
     for (LimitEntity limit : limitList) {
-      if(limit.getName().equalsIgnoreCase(name) &&
-              limit.getType().name().equalsIgnoreCase(type.name())) {
-        if(id != null && limit.getId().equals(id)){
+      if (limit.getName().equalsIgnoreCase(name) &&
+          limit.getType().name().equalsIgnoreCase(type.name())) {
+        if (id != null && limit.getId().equals(id)) {
           continue;
         }
         return false;
@@ -846,54 +629,45 @@
   }
 
   @Override
-  public Collection<LimitEntity> listLimits(String vlmId, Version version, String epLkgId,
-                                            String user) {
+  public Collection<LimitEntity> listLimits(String vlmId, Version version, String epLkgId) {
     mdcDataDebugMessage.debugEntryMessage("VLM id", vlmId, "EP/LKGId", epLkgId);
     mdcDataDebugMessage.debugExitMessage("VLM id", vlmId, "EP/LKGId", epLkgId);
-    return vendorLicenseFacade.listLimits(vlmId, version, epLkgId, user);
+    return vendorLicenseFacade.listLimits(vlmId, version, epLkgId);
   }
 
   @Override
-  public void deleteLimit(LimitEntity limitEntity, String user) {
+  public void deleteLimit(LimitEntity limitEntity) {
     mdcDataDebugMessage.debugEntryMessage("VLM id, EP id, Limit Id", limitEntity
-            .getVendorLicenseModelId(), limitEntity.getEpLkgId(), limitEntity.getId());
+        .getVendorLicenseModelId(), limitEntity.getEpLkgId(), limitEntity.getId());
 
-    Version version = VersioningUtil.resolveVersion(limitEntity.getVersion(),
-            getVersionInfo(limitEntity.getVendorLicenseModelId(), VersionableEntityAction.Write,
-                    user), user);
-    limitEntity.setVersion(version);
-
-    if ( !isLimitPresent(limitEntity)) {
+    if (!isLimitPresent(limitEntity)) {
       VersioningUtil
-              .validateEntityExistence(null, limitEntity, VendorLicenseModelEntity.ENTITY_TYPE);
+          .validateEntityExistence(null, limitEntity, VendorLicenseModelEntity.ENTITY_TYPE);
     }
     LimitEntity retrieved = limitDao.get(limitEntity);
     VersioningUtil
-            .validateEntityExistence(retrieved, limitEntity, VendorLicenseModelEntity.ENTITY_TYPE);
+        .validateEntityExistence(retrieved, limitEntity, VendorLicenseModelEntity.ENTITY_TYPE);
 
     limitDao.delete(limitEntity);
 
-    vendorLicenseFacade.updateVlmLastModificationTime(limitEntity.getVendorLicenseModelId(),
-            limitEntity.getVersion());
-
-    updateParentForLimit(limitEntity,user);
+    updateParentForLimit(limitEntity);
 
     mdcDataDebugMessage.debugExitMessage("VLM id, EP id, Limit Id", limitEntity
-            .getVendorLicenseModelId(), limitEntity.getEpLkgId(), limitEntity.getId());
+        .getVendorLicenseModelId(), limitEntity.getEpLkgId(), limitEntity.getId());
   }
 
   @Override
-  public void updateLimit(LimitEntity limit, String user) {
+  public void updateLimit(LimitEntity limit) {
     mdcDataDebugMessage
-            .debugEntryMessage("VLM id", limit.getVendorLicenseModelId(), "EP/LKGId", limit
-                    .getEpLkgId());
-    getLimit(limit,user);
-    validateLimit(limit, user);
-    vendorLicenseFacade.updateLimit(limit, user);
-    updateParentForLimit(limit,user);
+        .debugEntryMessage("VLM id", limit.getVendorLicenseModelId(), "EP/LKGId", limit
+            .getEpLkgId());
+    getLimit(limit);
+    validateLimit(limit);
+    vendorLicenseFacade.updateLimit(limit);
+    updateParentForLimit(limit);
     mdcDataDebugMessage
-            .debugExitMessage("VLM id", limit.getVendorLicenseModelId(), "EP/LKGId", limit
-                    .getEpLkgId());
+        .debugExitMessage("VLM id", limit.getVendorLicenseModelId(), "EP/LKGId", limit
+            .getEpLkgId());
   }
 
   private boolean isLimitPresent(LimitEntity limit) {
@@ -901,52 +675,46 @@
   }
 
   @Override
-  public LimitEntity getLimit(LimitEntity limitEntity,
-                              String user) {
+  public LimitEntity getLimit(LimitEntity limitEntity) {
     mdcDataDebugMessage.debugEntryMessage("VLM id", limitEntity.getVendorLicenseModelId(),
-            "EP/LKGId", limitEntity.getEpLkgId());
+        "EP/LKGId", limitEntity.getEpLkgId());
 
-    limitEntity.setVersion(VersioningUtil.resolveVersion(limitEntity.getVersion(),
-            getVersionInfo(limitEntity.getVendorLicenseModelId(), VersionableEntityAction.Read,
-                    user), user));
-    if(!isLimitPresent(limitEntity)){
+    if (!isLimitPresent(limitEntity)) {
       VersioningUtil
-              .validateEntityExistence(null, limitEntity, VendorLicenseModelEntity.ENTITY_TYPE);
+          .validateEntityExistence(null, limitEntity, VendorLicenseModelEntity.ENTITY_TYPE);
     }
     LimitEntity retrieved = limitDao.get(limitEntity);
     VersioningUtil
-            .validateEntityExistence(retrieved, limitEntity, VendorLicenseModelEntity.ENTITY_TYPE);
+        .validateEntityExistence(retrieved, limitEntity, VendorLicenseModelEntity.ENTITY_TYPE);
 
     mdcDataDebugMessage.debugExitMessage("VLM id", limitEntity.getVendorLicenseModelId(),
-            "EP/LKGId", limitEntity.getEpLkgId());
+        "EP/LKGId", limitEntity.getEpLkgId());
     return retrieved;
   }
 
   /**
    * update Parent of limit (EP/LKG) versionuuid when limit is modified so that limit updates are
    * captured in VLM XML
-   * @param limit
-   * @param user
    */
-  private void updateParentForLimit(LimitEntity limit, String user) {
+  private void updateParentForLimit(LimitEntity limit) {
     mdcDataDebugMessage.debugEntryMessage("VLM id", limit.getVendorLicenseModelId(),
-            "EP/LKGId", limit.getEpLkgId(), "Limit Parent ", limit.getParent());
-    if ("EntitlementPool".equals(limit.getParent()) ) {
+        "EP/LKGId", limit.getEpLkgId(), "Limit Parent ", limit.getParent());
+    if ("EntitlementPool".equals(limit.getParent())) {
       EntitlementPoolEntity entitlementPoolEntity =
-              entitlementPoolDao.get(new EntitlementPoolEntity(limit.getVendorLicenseModelId(),
-                      limit.getVersion(), limit.getEpLkgId()));
-      vendorLicenseFacade.updateEntitlementPool(entitlementPoolEntity, user);
+          entitlementPoolDao.get(new EntitlementPoolEntity(limit.getVendorLicenseModelId(),
+              limit.getVersion(), limit.getEpLkgId()));
+      vendorLicenseFacade.updateEntitlementPool(entitlementPoolEntity);
     }
 
     if ("LicenseKeyGroup".equals(limit.getParent())) {
       LicenseKeyGroupEntity licenseKeyGroupEntity = licenseKeyGroupDao.get(
-              new LicenseKeyGroupEntity(limit.getVendorLicenseModelId(), limit.getVersion(),
-                      limit.getEpLkgId()));
-      vendorLicenseFacade.updateLicenseKeyGroup(licenseKeyGroupEntity, user);
+          new LicenseKeyGroupEntity(limit.getVendorLicenseModelId(), limit.getVersion(),
+              limit.getEpLkgId()));
+      vendorLicenseFacade.updateLicenseKeyGroup(licenseKeyGroupEntity);
     }
 
     mdcDataDebugMessage.debugEntryMessage("VLM id", limit.getVendorLicenseModelId(),
-            "EP/LKGId", limit.getEpLkgId(), "Limit Parent ", limit.getParent());
+        "EP/LKGId", limit.getEpLkgId(), "Limit Parent ", limit.getParent());
   }
 
   protected void addFeatureGroupsToLicenseAgreementRef(Set<String> featureGroupIds,
@@ -954,8 +722,8 @@
     if (featureGroupIds != null) {
       for (String featureGroupId : featureGroupIds) {
         featureGroupDao.addReferencingLicenseAgreement(
-                new FeatureGroupEntity(licenseAgreement.getVendorLicenseModelId(),
-                        licenseAgreement.getVersion(), featureGroupId), licenseAgreement.getId());
+            new FeatureGroupEntity(licenseAgreement.getVendorLicenseModelId(),
+                licenseAgreement.getVersion(), featureGroupId), licenseAgreement.getId());
       }
     }
   }
@@ -965,8 +733,8 @@
     if (featureGroupIds != null) {
       for (String featureGroupId : featureGroupIds) {
         featureGroupDao.removeReferencingLicenseAgreement(
-                new FeatureGroupEntity(licenseAgreement.getVendorLicenseModelId(),
-                        licenseAgreement.getVersion(), featureGroupId), licenseAgreement.getId());
+            new FeatureGroupEntity(licenseAgreement.getVendorLicenseModelId(),
+                licenseAgreement.getVersion(), featureGroupId), licenseAgreement.getId());
       }
     }
   }
@@ -976,8 +744,8 @@
     if (licenseKeyGroupIds != null) {
       for (String licenseKeyGroupId : licenseKeyGroupIds) {
         licenseKeyGroupDao.addReferencingFeatureGroup(
-                new LicenseKeyGroupEntity(featureGroup.getVendorLicenseModelId(),
-                        featureGroup.getVersion(), licenseKeyGroupId), featureGroup.getId());
+            new LicenseKeyGroupEntity(featureGroup.getVendorLicenseModelId(),
+                featureGroup.getVersion(), licenseKeyGroupId), featureGroup.getId());
       }
     }
   }
@@ -987,8 +755,8 @@
     if (licenseKeyGroupIds != null) {
       for (String licenseKeyGroupId : licenseKeyGroupIds) {
         licenseKeyGroupDao.removeReferencingFeatureGroup(
-                new LicenseKeyGroupEntity(featureGroup.getVendorLicenseModelId(),
-                        featureGroup.getVersion(), licenseKeyGroupId), featureGroup.getId());
+            new LicenseKeyGroupEntity(featureGroup.getVendorLicenseModelId(),
+                featureGroup.getVersion(), licenseKeyGroupId), featureGroup.getId());
       }
     }
   }
@@ -998,8 +766,8 @@
     if (entitlementPoolIds != null) {
       for (String entitlementPoolId : entitlementPoolIds) {
         entitlementPoolDao.addReferencingFeatureGroup(
-                new EntitlementPoolEntity(featureGroup.getVendorLicenseModelId(),
-                        featureGroup.getVersion(), entitlementPoolId), featureGroup.getId());
+            new EntitlementPoolEntity(featureGroup.getVendorLicenseModelId(),
+                featureGroup.getVersion(), entitlementPoolId), featureGroup.getId());
       }
     }
   }
@@ -1009,38 +777,19 @@
     if (entitlementPoolIds != null) {
       for (String entitlementPoolId : entitlementPoolIds) {
         entitlementPoolDao.removeReferencingFeatureGroup(
-                new EntitlementPoolEntity(featureGroup.getVendorLicenseModelId(),
-                        featureGroup.getVersion(), entitlementPoolId), featureGroup.getId());
+            new EntitlementPoolEntity(featureGroup.getVendorLicenseModelId(),
+                featureGroup.getVersion(), entitlementPoolId), featureGroup.getId());
       }
     }
   }
 
-  protected VersionInfo getVersionInfo(String vendorLicenseModelId, VersionableEntityAction action,
-                                       String user) {
-    return vendorLicenseFacade.getVersionInfo(vendorLicenseModelId, action, user);
-  }
-
-  protected LicenseAgreementEntity createLicenseAgreementForList(String vlmId, Version version,
-                                                                 String user) {
-    return new LicenseAgreementEntity(vlmId, VersioningUtil
-            .resolveVersion(version, getVersionInfo(vlmId, VersionableEntityAction.Read, user), user),
-            null);
-  }
-
-  protected void updateUniqueName(String uniqueValueType ,String oldName, String newName,String ...
-          context) {
+  protected void updateUniqueName(String uniqueValueType, String oldName, String newName, String...
+      context) {
     UniqueValueUtil
-            .updateUniqueValue(uniqueValueType, oldName, newName,context);
+        .updateUniqueValue(uniqueValueType, oldName, newName, context);
   }
 
-  protected void deleteUniqueName(String uniqueValueType,String ... uniqueCombination) {
+  protected void deleteUniqueName(String uniqueValueType, String... uniqueCombination) {
     UniqueValueUtil.deleteUniqueValue(uniqueValueType, uniqueCombination);
   }
-
-  protected Version resloveVersion(String vlmId,Version requestedVersion, VersionInfo versionInfo,
-                                   String user){
-    return VersioningUtil.resolveVersion(null,
-            getVersionInfo(vlmId, VersionableEntityAction.Write, user), user);
-  }
-
 }
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/ArtifactTestUtils.java b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/ArtifactTestUtils.java
index 5d9729d..c005e96 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/ArtifactTestUtils.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/ArtifactTestUtils.java
@@ -20,41 +20,6 @@
 
 package org.openecomp.sdc.vendorlicense;
 
-import org.openecomp.core.utilities.CommonMethods;
-import org.openecomp.sdc.vendorlicense.dao.types.AggregationFunction;
-import org.openecomp.sdc.vendorlicense.dao.types.ChoiceOrOther;
-import org.openecomp.sdc.vendorlicense.dao.types.EntitlementMetric;
-import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity;
-import org.openecomp.sdc.vendorlicense.dao.types.EntitlementTime;
-import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity;
-import org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity;
-import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity;
-import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyType;
-import org.openecomp.sdc.vendorlicense.dao.types.LicenseTerm;
-import org.openecomp.sdc.vendorlicense.dao.types.MultiChoiceOrOther;
-import org.openecomp.sdc.vendorlicense.dao.types.OperationalScope;
-import org.openecomp.sdc.vendorlicense.dao.types.ThresholdUnit;
-import org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacade;
-import org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacadeFactory;
-import org.openecomp.sdc.vendorlicense.impl.VendorLicenseManagerImpl;
-import org.openecomp.sdc.vendorlicense.licenseartifacts.VendorLicenseArtifactsService;
-import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductManager;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
-import org.openecomp.sdc.vendorsoftwareproduct.impl.VendorSoftwareProductManagerImpl;
-import org.openecomp.sdc.versioning.VersioningManager;
-import org.openecomp.sdc.versioning.VersioningManagerFactory;
-import org.openecomp.sdc.versioning.dao.types.Version;
-import org.openecomp.sdc.versioning.types.VersionInfo;
-import org.openecomp.sdc.versioning.types.VersionableEntityAction;
-import org.testng.annotations.BeforeMethod;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import static org.openecomp.sdc.vendorlicense.VendorLicenseConstants.VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE;
-
 /**
  * Created by  Katyr on 29-May-16
  */
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/LimitTest.java b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/LimitTest.java
index 07fdeee..0197dd9 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/LimitTest.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/LimitTest.java
@@ -20,17 +20,11 @@
 
 package org.openecomp.sdc.vendorlicense;
 
-import static org.mockito.Matchers.anyObject;
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.verify;
-
 import org.mockito.InjectMocks;
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
 import org.mockito.Spy;
 import org.openecomp.sdc.common.errors.CoreException;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.openecomp.sdc.vendorlicense.dao.LimitDao;
 import org.openecomp.sdc.vendorlicense.dao.types.AggregationFunction;
 import org.openecomp.sdc.vendorlicense.dao.types.LimitEntity;
@@ -45,19 +39,19 @@
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
-import java.lang.reflect.Field;
-import java.lang.reflect.Modifier;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.List;
 
+import static org.mockito.Matchers.anyObject;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.verify;
+
 public class LimitTest {
 
-  private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName());
-
-  private  final String USER1 = "limitTestUser1";
-  private  final String LT1_NAME = "LT1 name";
+  private final String USER1 = "limitTestUser1";
+  private final String LT1_NAME = "LT1 name";
 
   private static final String VLM_ID = "VLM_ID";
   private static final Version VERSION = new Version(0, 1);
@@ -76,8 +70,8 @@
   private VendorLicenseManagerImpl vendorLicenseManagerImpl;
 
   public static LimitEntity createLimitEntity(String name, LimitType type, String description,
-                                       Version version, String metric,
-                                       AggregationFunction aggregationFunction, int unit,
+                                              Version version, String metric,
+                                              AggregationFunction aggregationFunction, int unit,
                                               String time) {
     LimitEntity limitEntity = new LimitEntity();
     limitEntity.setName(name);
@@ -92,22 +86,22 @@
   }
 
   @BeforeMethod
-  public void setUp() {
+  public void setUp() throws Exception {
     MockitoAnnotations.initMocks(this);
   }
 
   @Test
   public void testUpdateLimit() {
     Version version = new Version();
-    LimitEntity limitEntity1 = createLimitEntity(LT1_NAME,LimitType.Vendor,"string",version,
-        "Core",AggregationFunction.Average,10,"Hour");
-    LimitEntity limitEntity2 = createLimitEntity(LT1_NAME,LimitType.Vendor,"string",version,
-        "Tokens",AggregationFunction.Peak,12,"Month");
+    LimitEntity limitEntity1 = createLimitEntity(LT1_NAME, LimitType.Vendor, "string", version,
+        "Core", AggregationFunction.Average, 10, "Hour");
+    LimitEntity limitEntity2 = createLimitEntity(LT1_NAME, LimitType.Vendor, "string", version,
+        "Tokens", AggregationFunction.Peak, 12, "Month");
     VersionInfo info = new VersionInfo();
     info.getViewableVersions().add(version);
     info.setActiveVersion(version);
 
-    doReturn(info).when(vendorLicenseFacade).getVersionInfo(anyObject(),anyObject(),anyObject());
+    /*doReturn(info).when(vendorLicenseFacade).getVersionInfo(anyObject(), anyObject(), anyObject());*/
     doReturn(true).when(limitDao).isLimitPresent(anyObject());
     doReturn(limitEntity1).when(limitDao).get(anyObject());
 
@@ -116,27 +110,28 @@
     limitEntityList.add(limitEntity2);
     limitEntity1.setId("1234");
     limitEntity2.setId("1234");
-    doReturn(limitEntityList).when(vendorLicenseFacade).listLimits(anyObject(),anyObject(),
-        anyObject(),anyObject());
+    doReturn(limitEntityList).when(vendorLicenseFacade)
+        .listLimits(anyObject(), anyObject(), anyObject());
 
-    vendorLicenseManagerImpl.updateLimit(limitEntity2,USER1);
+    vendorLicenseManagerImpl.updateLimit(limitEntity2);
 
-    verify(vendorLicenseFacade).updateLimit(anyObject(), anyObject());
+    verify(vendorLicenseFacade).updateLimit(anyObject());
   }
 
   @Test
   public void testUpdateLimitErrorWithSameNameType() {
     try {
       Version version = new Version();
-      LimitEntity limitEntity1 = createLimitEntity(LT1_NAME,LimitType.Vendor,"string",version,
-          "Core",AggregationFunction.Average,10,"Hour");
-      LimitEntity limitEntity2 = createLimitEntity(LT1_NAME,LimitType.Vendor,"string",version,
-          "Tokens",AggregationFunction.Peak,12,"Month");
+      LimitEntity limitEntity1 = createLimitEntity(LT1_NAME, LimitType.Vendor, "string", version,
+          "Core", AggregationFunction.Average, 10, "Hour");
+      LimitEntity limitEntity2 = createLimitEntity(LT1_NAME, LimitType.Vendor, "string", version,
+          "Tokens", AggregationFunction.Peak, 12, "Month");
       VersionInfo info = new VersionInfo();
       info.getViewableVersions().add(version);
       info.setActiveVersion(version);
 
-      doReturn(info).when(vendorLicenseFacade).getVersionInfo(anyObject(),anyObject(),anyObject());
+/*      doReturn(info).when(vendorLicenseFacade)
+          .getVersionInfo(anyObject(), anyObject(), anyObject());*/
       doReturn(limitEntity1).when(limitDao).get(anyObject());
 
       List<LimitEntity> limitEntityList = new ArrayList<>();
@@ -144,13 +139,12 @@
       limitEntityList.add(limitEntity2);
       limitEntity1.setId("1234");
       limitEntity2.setId("9632");
-      doReturn(limitEntityList).when(vendorLicenseFacade).listLimits(anyObject(),anyObject(),
-          anyObject(),anyObject());
+      doReturn(limitEntityList).when(vendorLicenseFacade)
+          .listLimits(anyObject(), anyObject(), anyObject());
 
-      vendorLicenseManagerImpl.updateLimit(limitEntity2,USER1);
+      vendorLicenseManagerImpl.updateLimit(limitEntity2);
       Assert.fail();
     } catch (CoreException exception) {
-      log.debug("",exception);
       Assert.assertEquals(exception.code().id(),
           VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
     }
@@ -159,13 +153,13 @@
   @Test
   public void testDeleteLimit() {
     Version version = new Version();
-    LimitEntity limitEntity = createLimitEntity(LT1_NAME,LimitType.Vendor,"string",version,
-            "Core",AggregationFunction.Average,10,"Hour");
+    LimitEntity limitEntity = createLimitEntity(LT1_NAME, LimitType.Vendor, "string", version,
+        "Core", AggregationFunction.Average, 10, "Hour");
     VersionInfo info = new VersionInfo();
     info.getViewableVersions().add(version);
     info.setActiveVersion(version);
 
-    doReturn(info).when(vendorLicenseFacade).getVersionInfo(anyObject(),anyObject(),anyObject());
+    /*doReturn(info).when(vendorLicenseFacade).getVersionInfo(anyObject(), anyObject(), anyObject());*/
     doReturn(true).when(limitDao).isLimitPresent(anyObject());
     doReturn(limitEntity).when(limitDao).get(anyObject());
 
@@ -173,27 +167,28 @@
     limitEntityList.add(limitEntity);
     limitEntity.setId("1234");
 
-    vendorLicenseManagerImpl.deleteLimit(limitEntity,LT1_NAME);
+    vendorLicenseManagerImpl.deleteLimit(limitEntity);
 
-    verify(vendorLicenseManagerImpl).deleteLimit(anyObject(), anyObject());
+    verify(vendorLicenseManagerImpl).deleteLimit(anyObject());
   }
 
   @Test
   public void testUpdateLimitErrorWithInvalidId() {
     try {
       Version version = new Version();
-      LimitEntity limitEntity1 = createLimitEntity(LT1_NAME,LimitType.Vendor,"string",version,
-          "Core",AggregationFunction.Average,10,"Hour");
-      LimitEntity limitEntity2 = createLimitEntity(LT1_NAME,LimitType.Vendor,"string",version,
-          "Tokens",AggregationFunction.Peak,12,"Month");
+      LimitEntity limitEntity1 = createLimitEntity(LT1_NAME, LimitType.Vendor, "string", version,
+          "Core", AggregationFunction.Average, 10, "Hour");
+      LimitEntity limitEntity2 = createLimitEntity(LT1_NAME, LimitType.Vendor, "string", version,
+          "Tokens", AggregationFunction.Peak, 12, "Month");
       VersionInfo info = new VersionInfo();
       info.getViewableVersions().add(version);
       info.setActiveVersion(version);
 
-      doReturn(info).when(vendorLicenseFacade).getVersionInfo(anyObject(),anyObject(),anyObject());
+/*      doReturn(info).when(vendorLicenseFacade)
+          .getVersionInfo(anyObject(), anyObject(), anyObject());*/
       doReturn(null).when(limitDao).get(anyObject());
 
-      vendorLicenseManagerImpl.updateLimit(limitEntity2,USER1);
+      vendorLicenseManagerImpl.updateLimit(limitEntity2);
       Assert.fail();
     } catch (CoreException exception) {
       Assert.assertEquals(exception.code().id(),
@@ -206,14 +201,14 @@
     doReturn(Arrays.asList(
         createLimit(VLM_ID, VERSION, EPLKG_ID, LIMIT1_ID),
         createLimit(VLM_ID, VERSION, EPLKG_ID, LIMIT2_ID)))
-        .when(vendorLicenseFacade).listLimits(VLM_ID, VERSION, EPLKG_ID, USER1);
+        .when(vendorLicenseFacade).listLimits(VLM_ID, VERSION, EPLKG_ID);
 
     final Collection<LimitEntity> limits =
-        vendorLicenseManagerImpl.listLimits(VLM_ID, VERSION, EPLKG_ID, USER1);
+        vendorLicenseManagerImpl.listLimits(VLM_ID, VERSION, EPLKG_ID);
     Assert.assertEquals(limits.size(), 2);
     for (LimitEntity limit : limits) {
       Assert.assertEquals(limit.getName(),
-          LIMIT1_ID.equals(limit.getId()) ? LIMIT1_ID+" name" : LIMIT2_ID+" name" );
+          LIMIT1_ID.equals(limit.getId()) ? LIMIT1_ID + " name" : LIMIT2_ID + " name");
     }
   }
 
@@ -224,10 +219,10 @@
     info.getViewableVersions().add(VERSION);
     info.setActiveVersion(VERSION);
 
-    doReturn(info).when(vendorLicenseFacade).getVersionInfo(anyObject(),anyObject(),anyObject());
+    /*doReturn(info).when(vendorLicenseFacade).getVersionInfo(anyObject(), anyObject(), anyObject());*/
 
-    vendorLicenseManagerImpl.createLimit(expected, USER1);
-    verify(vendorLicenseFacade).createLimit(expected,USER1);
+    vendorLicenseManagerImpl.createLimit(expected);
+    verify(vendorLicenseFacade).createLimit(expected);
   }
 
   @Test
@@ -241,20 +236,19 @@
 
     List<LimitEntity> vfcImageList = new ArrayList<LimitEntity>();
     vfcImageList.add(expectedDiffName);
-    doReturn(vfcImageList).when(vendorLicenseFacade).listLimits(anyObject(), anyObject(), anyObject(),
-        anyObject());
+    doReturn(vfcImageList).when(vendorLicenseFacade)
+        .listLimits(anyObject(), anyObject(), anyObject());
 
     VersionInfo info = new VersionInfo();
     info.getViewableVersions().add(VERSION);
     info.setActiveVersion(VERSION);
 
-    doReturn(info).when(vendorLicenseFacade).getVersionInfo(anyObject(),anyObject(),anyObject());
+/*    doReturn(info).when(vendorLicenseFacade).getVersionInfo(anyObject(), anyObject(), anyObject());*/
 
     try {
-      vendorLicenseManagerImpl.createLimit(expected, USER1);
+      vendorLicenseManagerImpl.createLimit(expected);
       Assert.fail();
-    }
-    catch (CoreException ex) {
+    } catch (CoreException ex) {
       Assert.assertEquals(ex.code().id(),
           VendorLicenseErrorCodes.DUPLICATE_LIMIT_NAME_NOT_ALLOWED);
     }
@@ -267,13 +261,14 @@
     info.getViewableVersions().add(VERSION);
     info.setActiveVersion(VERSION);
 
-    doReturn(info).when(vendorLicenseFacade).getVersionInfo(anyObject(),anyObject(),anyObject());
+    /*doReturn(info).when(vendorLicenseFacade).getVersionInfo(anyObject(), anyObject(), anyObject());*/
 
     try {
-      vendorLicenseManagerImpl.getLimit(limit , USER1);
+      vendorLicenseManagerImpl.getLimit(limit);
       Assert.fail();
     } catch (CoreException exception) {
-      Assert.assertEquals(exception.code().id(), VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
+      Assert.assertEquals(exception.code().id(),
+          VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
     }
   }
 
@@ -293,10 +288,10 @@
     info.getViewableVersions().add(VERSION);
     info.setActiveVersion(VERSION);
 
-    doReturn(info).when(vendorLicenseFacade).getVersionInfo(anyObject(),anyObject(),anyObject());
+    /*doReturn(info).when(vendorLicenseFacade).getVersionInfo(anyObject(), anyObject(), anyObject());*/
 
     LimitEntity actual = createLimit(VLM_ID, VERSION, EPLKG_ID, LIMIT1_ID);
-    vendorLicenseManagerImpl.getLimit(actual, USER1);
+    vendorLicenseManagerImpl.getLimit(actual);
     Assert.assertEquals(actual.getId(), expected.getId());
     Assert.assertEquals(actual.getName(), expected.getName());
     Assert.assertEquals(actual.getUnit(), expected.getUnit());
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/VendorLicenseFacadeImplTest.java b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/VendorLicenseFacadeImplTest.java
index ab6262d..e3719ab 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/VendorLicenseFacadeImplTest.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/VendorLicenseFacadeImplTest.java
@@ -1,39 +1,5 @@
 package org.openecomp.sdc.vendorlicense;
 
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-import org.mockito.Spy;
-import org.openecomp.sdc.common.errors.CoreException;
-import org.openecomp.sdc.vendorlicense.dao.EntitlementPoolDao;
-import org.openecomp.sdc.vendorlicense.dao.FeatureGroupDao;
-import org.openecomp.sdc.vendorlicense.dao.LicenseAgreementDao;
-import org.openecomp.sdc.vendorlicense.dao.LicenseKeyGroupDao;
-import org.openecomp.sdc.vendorlicense.dao.VendorLicenseModelDao;
-import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity;
-import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity;
-import org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity;
-import org.openecomp.sdc.vendorlicense.facade.impl.VendorLicenseFacadeImpl;
-import org.openecomp.sdc.versioning.VersioningManager;
-import org.openecomp.sdc.versioning.dao.types.Version;
-import org.openecomp.sdc.versioning.types.VersionInfo;
-import org.testng.Assert;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Modifier;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import static org.mockito.Matchers.anyObject;
-import static org.mockito.Mockito.doReturn;
-import static org.openecomp.sdc.vendorlicense.errors.UncompletedVendorLicenseModelErrorType.SUBMIT_UNCOMPLETED_VLM_MSG_FG_MISSING_EP;
-import static org.openecomp.sdc.vendorlicense.errors.UncompletedVendorLicenseModelErrorType.SUBMIT_UNCOMPLETED_VLM_MSG_LA_MISSING_FG;
-
 /**
  * This test just verifies Feature Group Get and List APIs.
  */
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/impl/EntitlementPoolTest.java b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/impl/EntitlementPoolTest.java
index 178d05e..57d2254 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/impl/EntitlementPoolTest.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/impl/EntitlementPoolTest.java
@@ -28,12 +28,16 @@
 import org.openecomp.sdc.common.errors.CoreException;
 import org.openecomp.sdc.vendorlicense.dao.EntitlementPoolDao;
 import org.openecomp.sdc.vendorlicense.dao.LimitDao;
-import org.openecomp.sdc.vendorlicense.dao.types.*;
+import org.openecomp.sdc.vendorlicense.dao.types.AggregationFunction;
+import org.openecomp.sdc.vendorlicense.dao.types.EntitlementMetric;
+import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity;
+import org.openecomp.sdc.vendorlicense.dao.types.EntitlementTime;
+import org.openecomp.sdc.vendorlicense.dao.types.MultiChoiceOrOther;
+import org.openecomp.sdc.vendorlicense.dao.types.OperationalScope;
+import org.openecomp.sdc.vendorlicense.dao.types.ThresholdUnit;
 import org.openecomp.sdc.vendorlicense.errors.VendorLicenseErrorCodes;
 import org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacade;
 import org.openecomp.sdc.versioning.dao.types.Version;
-import org.openecomp.sdc.versioning.types.VersionInfo;
-import org.openecomp.sdc.versioning.types.VersionableEntityAction;
 import org.testng.Assert;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
@@ -41,7 +45,6 @@
 import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
-import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.HashSet;
@@ -54,353 +57,323 @@
 
 public class EntitlementPoolTest {
 
-    //JUnit Test Cases using Mockito
-    private  final String USER1 = "epTestUser1";
-    private  final String EP1_NAME = "EP1 name";
-    private  final String EP2_NAME = "EP2 name";
-    private  final String LT1_NAME = "LT1 name";
-    private static String vlm1_id = "vlm1_id";
-    private static String ep1_id = "ep1_id";
-    private static String ep2_id = "ep2_id";
-    public static final Version VERSION01 = new Version(0, 1);
+  //JUnit Test Cases using Mockito
+  private final String USER1 = "epTestUser1";
+  private final String EP1_NAME = "EP1 name";
+  private final String EP2_NAME = "EP2 name";
+  private final String LT1_NAME = "LT1 name";
+  private static String vlm1_id = "vlm1_id";
+  private static String ep1_id = "ep1_id";
+  private static String ep2_id = "ep2_id";
+  public static final Version VERSION01 = new Version(0, 1);
 
-    @Mock
-    private VendorLicenseFacade vendorLicenseFacade;
+  @Mock
+  private VendorLicenseFacade vendorLicenseFacade;
 
-    @Mock
-    private EntitlementPoolDao entitlementPoolDao;
-    @Mock
-    private LimitDao limitDao;
+  @Mock
+  private EntitlementPoolDao entitlementPoolDao;
+  @Mock
+  private LimitDao limitDao;
 
-    @InjectMocks
-    @Spy
-    private VendorLicenseManagerImpl vendorLicenseManagerImpl;
+  @InjectMocks
+  @Spy
+  private VendorLicenseManagerImpl vendorLicenseManagerImpl;
 
-    public EntitlementPoolEntity createEntitlementPool(String vlmId, Version version,String id,
-                                                       String name, String desc, int threshold,
-                                                       ThresholdUnit thresholdUnit,
-                                                       EntitlementMetric entitlementMetricChoice,
-                                                       String entitlementMetricOther,
-                                                       String increments,
-                                                       AggregationFunction aggregationFunctionChoice,
-                                                       String aggregationFunctionOther,
-                                                       Set<OperationalScope> operationalScopeChoices,
-                                                       String operationalScopeOther,
-                                                       EntitlementTime timeChoice,
-                                                       String timeOther, String sku) {
-        EntitlementPoolEntity entitlementPool = new EntitlementPoolEntity();
-        entitlementPool.setVendorLicenseModelId(vlmId);
-        entitlementPool.setId(id);
-        entitlementPool.setVersion(version);
-        entitlementPool.setName(name);
-        entitlementPool.setDescription(desc);
-        entitlementPool.setThresholdValue(threshold);
-        entitlementPool.setThresholdUnit(thresholdUnit);
-        entitlementPool.setIncrements(increments);
-        entitlementPool.setOperationalScope(
-            new MultiChoiceOrOther<>(operationalScopeChoices, operationalScopeOther));
-        return entitlementPool;
+  public EntitlementPoolEntity createEntitlementPool(String vlmId, Version version, String id,
+                                                     String name, String desc, int threshold,
+                                                     ThresholdUnit thresholdUnit,
+                                                     EntitlementMetric entitlementMetricChoice,
+                                                     String entitlementMetricOther,
+                                                     String increments,
+                                                     AggregationFunction aggregationFunctionChoice,
+                                                     String aggregationFunctionOther,
+                                                     Set<OperationalScope> operationalScopeChoices,
+                                                     String operationalScopeOther,
+                                                     EntitlementTime timeChoice,
+                                                     String timeOther, String sku) {
+    EntitlementPoolEntity entitlementPool = new EntitlementPoolEntity();
+    entitlementPool.setVendorLicenseModelId(vlmId);
+    entitlementPool.setId(id);
+    entitlementPool.setVersion(version);
+    entitlementPool.setName(name);
+    entitlementPool.setDescription(desc);
+    entitlementPool.setThresholdValue(threshold);
+    entitlementPool.setThresholdUnit(thresholdUnit);
+    entitlementPool.setIncrements(increments);
+    entitlementPool.setOperationalScope(
+        new MultiChoiceOrOther<>(operationalScopeChoices, operationalScopeOther));
+    return entitlementPool;
+  }
+
+  @BeforeMethod
+  public void setUp() throws Exception {
+    MockitoAnnotations.initMocks(this);
+  }
+
+  @Test
+  public void createTest() {
+    Set<OperationalScope> opScopeChoices;
+    opScopeChoices = new HashSet<>();
+    opScopeChoices.add(OperationalScope.Core);
+    opScopeChoices.add(OperationalScope.CPU);
+    opScopeChoices.add(OperationalScope.Network_Wide);
+    EntitlementPoolEntity ep2 =
+        createEntitlementPool("vlm1Id", null, ep1_id, EP1_NAME, "EP2 dec", 70, ThresholdUnit
+                .Absolute,
+            EntitlementMetric.Other, "exception metric2", "inc2", AggregationFunction.Average, null,
+            opScopeChoices, null, EntitlementTime.Other, "time2", "sku2");
+    DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy");
+    ep2.setStartDate(LocalDate.now().format(formatter));
+    ep2.setExpiryDate(LocalDate.now().plusDays(1L).format(formatter));
+
+    vendorLicenseManagerImpl.createEntitlementPool(ep2);
+    verify(vendorLicenseFacade).createEntitlementPool(ep2);
+
+  }
+
+  @Test(expectedExceptions = CoreException.class, expectedExceptionsMessageRegExp = "Vendor " +
+      "license model with id vlm1_id has invalid date range.")
+  public void createWithInvalidStartExpiryDateTest() {
+
+    Set<OperationalScope> opScopeChoices;
+    opScopeChoices = new HashSet<>();
+    opScopeChoices.add(OperationalScope.Core);
+    opScopeChoices.add(OperationalScope.CPU);
+    opScopeChoices.add(OperationalScope.Network_Wide);
+    EntitlementPoolEntity ep2 =
+        createEntitlementPool("vlm2Id", null, ep1_id, EP1_NAME, "EP2 dec", 70,
+            ThresholdUnit.Absolute,
+            EntitlementMetric.Other, "exception metric2", "inc2", AggregationFunction.Average, null,
+            opScopeChoices, null, EntitlementTime.Other, "time2", "sku2");
+    DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy");
+    ep2.setStartDate(LocalDate.now().format(formatter));
+    ep2.setExpiryDate(LocalDate.now().minusDays(2L).format(formatter));
+    ep2.setVendorLicenseModelId(vlm1_id);
+    vendorLicenseManagerImpl.createEntitlementPool(ep2).getId();
+    Assert.fail();
+
+  }
+
+  @Test(expectedExceptions = CoreException.class, expectedExceptionsMessageRegExp = "Vendor " +
+      "license model with id vlm1_id has invalid date range.")
+  public void createWithoutStartDateTest() {
+
+    Set<OperationalScope> opScopeChoices;
+    opScopeChoices = new HashSet<>();
+    opScopeChoices.add(OperationalScope.Core);
+    opScopeChoices.add(OperationalScope.CPU);
+    opScopeChoices.add(OperationalScope.Network_Wide);
+    EntitlementPoolEntity ep2 =
+        createEntitlementPool("vlm3Id", null, ep1_id, EP1_NAME, "EP2 dec", 70,
+            ThresholdUnit.Absolute,
+            EntitlementMetric.Other, "exception metric2", "inc2", AggregationFunction.Average, null,
+            opScopeChoices, null, EntitlementTime.Other, "time2", "sku2");
+    DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy");
+    ep2.setExpiryDate(LocalDate.now().plusDays(2L).format(formatter));
+    ep2.setVendorLicenseModelId(vlm1_id);
+    vendorLicenseManagerImpl.createEntitlementPool(ep2).getId();
+    Assert.fail();
+
+  }
+
+  @Test(expectedExceptions = CoreException.class, expectedExceptionsMessageRegExp = "Vendor " +
+      "license model with id vlm1_id has invalid date range.")
+  public void createWithSameStartExpiryDateTest() {
+
+    Set<OperationalScope> opScopeChoices;
+    opScopeChoices = new HashSet<>();
+    opScopeChoices.add(OperationalScope.Core);
+    opScopeChoices.add(OperationalScope.CPU);
+    opScopeChoices.add(OperationalScope.Network_Wide);
+    EntitlementPoolEntity ep2 =
+        createEntitlementPool("vlm4Id", null, ep1_id, EP1_NAME, "EP2 dec", 70,
+            ThresholdUnit.Absolute,
+            EntitlementMetric.Other, "exception metric2", "inc2", AggregationFunction.Average, null,
+            opScopeChoices, null, EntitlementTime.Other, "time2", "sku2");
+    DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy");
+    ep2.setStartDate(LocalDate.now().format(formatter));
+    ep2.setExpiryDate(LocalDate.now().format(formatter));
+    ep2.setVendorLicenseModelId(vlm1_id);
+    vendorLicenseManagerImpl.createEntitlementPool(ep2).getId();
+    Assert.fail();
+  }
+
+  @Test
+  public void testUpdate() {
+    Set<OperationalScope> opScopeChoices;
+    opScopeChoices = new HashSet<>();
+    opScopeChoices.add(OperationalScope.Core);
+    opScopeChoices.add(OperationalScope.CPU);
+    opScopeChoices.add(OperationalScope.Network_Wide);
+    EntitlementPoolEntity ep2 =
+        createEntitlementPool(vlm1_id, VERSION01, ep1_id, EP1_NAME, "EP2 dec", 70,
+            ThresholdUnit
+                .Absolute,
+            EntitlementMetric.Other, "exception metric2", "inc2", AggregationFunction.Average, null,
+            opScopeChoices, null, EntitlementTime.Other, "time2", "sku2");
+    DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy");
+    ep2.setStartDate(LocalDate.now().minusDays(3L).format(formatter));
+    ep2.setExpiryDate(LocalDate.now().minusDays(2L).format(formatter));
+
+    vendorLicenseManagerImpl.updateEntitlementPool(ep2);
+  }
+
+  @Test(expectedExceptions = CoreException.class, expectedExceptionsMessageRegExp = "Vendor " +
+      "license model with id vlm1_id has invalid date range.")
+  public void updateWithInvalidStartExpiryDateTest() {
+
+    Set<OperationalScope> opScopeChoices;
+    opScopeChoices = new HashSet<>();
+    opScopeChoices.add(OperationalScope.Core);
+    opScopeChoices.add(OperationalScope.CPU);
+    opScopeChoices.add(OperationalScope.Network_Wide);
+    EntitlementPoolEntity ep2 =
+        createEntitlementPool("vlm2Id", null, ep1_id, EP1_NAME, "EP2 dec", 70,
+            ThresholdUnit.Absolute,
+            EntitlementMetric.Other, "exception metric2", "inc2", AggregationFunction.Average, null,
+            opScopeChoices, null, EntitlementTime.Other, "time2", "sku2");
+    DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy");
+    ep2.setStartDate(LocalDate.now().format(formatter));
+    ep2.setExpiryDate(LocalDate.now().minusDays(2L).format(formatter));
+    ep2.setVendorLicenseModelId(vlm1_id);
+    vendorLicenseManagerImpl.updateEntitlementPool(ep2);
+    Assert.fail();
+
+  }
+
+  @Test
+  public void updateWithoutStartDateTest() {
+    try {
+
+      Set<OperationalScope> opScopeChoices;
+      opScopeChoices = new HashSet<>();
+      opScopeChoices.add(OperationalScope.Core);
+      opScopeChoices.add(OperationalScope.CPU);
+      opScopeChoices.add(OperationalScope.Network_Wide);
+      EntitlementPoolEntity ep2 =
+          createEntitlementPool("vlm3Id", null, ep1_id, EP1_NAME, "EP2 dec", 70,
+              ThresholdUnit.Absolute,
+              EntitlementMetric.Other, "exception metric2", "inc2", AggregationFunction.Average,
+              null,
+              opScopeChoices, null, EntitlementTime.Other, "time2", "sku2");
+      DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy");
+      ep2.setExpiryDate(LocalDate.now().plusDays(2L).format(formatter));
+      vendorLicenseManagerImpl.updateEntitlementPool(ep2);
+      Assert.fail();
+    } catch (CoreException exception) {
+      Assert.assertEquals(exception.code().id(), VendorLicenseErrorCodes.DATE_RANGE_INVALID);
     }
+  }
 
-    @BeforeMethod
-    public void setUp() throws Exception {
-        MockitoAnnotations.initMocks(this);
+  @Test
+  public void updateWithSameStartExpiryDateTest() {
+    try {
+
+      Set<OperationalScope> opScopeChoices;
+      opScopeChoices = new HashSet<>();
+      opScopeChoices.add(OperationalScope.Core);
+      opScopeChoices.add(OperationalScope.CPU);
+      opScopeChoices.add(OperationalScope.Network_Wide);
+      EntitlementPoolEntity ep2 =
+          createEntitlementPool("vlm4Id", null, ep1_id, EP1_NAME, "EP2 dec", 70,
+              ThresholdUnit.Absolute,
+              EntitlementMetric.Other, "exception metric2", "inc2", AggregationFunction.Average,
+              null,
+              opScopeChoices, null, EntitlementTime.Other, "time2", "sku2");
+      DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy");
+      ep2.setStartDate(LocalDate.now().format(formatter));
+      ep2.setExpiryDate(LocalDate.now().format(formatter));
+      vendorLicenseManagerImpl.updateEntitlementPool(ep2);
+      Assert.fail();
+    } catch (CoreException exception) {
+      Assert.assertEquals(exception.code().id(), VendorLicenseErrorCodes.DATE_RANGE_INVALID);
     }
+  }
 
-    @Test
-    public void createTest() {
-        Set<OperationalScope> opScopeChoices;
-        opScopeChoices = new HashSet<>();
-        opScopeChoices.add(OperationalScope.Core);
-        opScopeChoices.add(OperationalScope.CPU);
-        opScopeChoices.add(OperationalScope.Network_Wide);
-        EntitlementPoolEntity ep2 =
-            createEntitlementPool("vlm1Id", null, ep1_id,EP1_NAME, "EP2 dec", 70, ThresholdUnit
-                    .Absolute,
-                EntitlementMetric.Other, "exception metric2", "inc2", AggregationFunction.Average, null,
-                opScopeChoices, null, EntitlementTime.Other, "time2", "sku2");
-        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy");
-        ep2.setStartDate(LocalDate.now().format(formatter));
-        ep2.setExpiryDate(LocalDate.now().plusDays(1L).format(formatter));
+  @Test
+  public void deleteEntitlementPoolTest() {
+    Set<OperationalScope> opScopeChoices;
+    opScopeChoices = new HashSet<>();
+    opScopeChoices.add(OperationalScope.Core);
+    opScopeChoices.add(OperationalScope.CPU);
+    opScopeChoices.add(OperationalScope.Network_Wide);
 
-        vendorLicenseManagerImpl.createEntitlementPool(ep2, USER1);
-        verify(vendorLicenseFacade).createEntitlementPool(ep2,USER1);
+    EntitlementPoolEntity entitlementPool =
+        createEntitlementPool(vlm1_id, VERSION01, ep1_id, EP1_NAME, "EP2 dec", 70,
+            ThresholdUnit.Absolute, EntitlementMetric.Other, "exception metric2", "inc2",
+            AggregationFunction.Average, null,
+            opScopeChoices, null, EntitlementTime.Other, "time2", "sku2");
+    DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy");
+    entitlementPool.setStartDate(LocalDate.now().format(formatter));
+    entitlementPool.setExpiryDate(LocalDate.now().plusDays(1L).format(formatter));
 
-    }
+    doReturn(entitlementPool).when(entitlementPoolDao).get(anyObject());
 
-    @Test(expectedExceptions = CoreException.class, expectedExceptionsMessageRegExp = "Vendor " +
-        "license model with id vlm1_id has invalid date range.")
-    public void createWithInvalidStartExpiryDateTest() {
+    doNothing().when(vendorLicenseManagerImpl).deleteChildLimits(vlm1_id, VERSION01, ep1_id);
 
-        Set<OperationalScope> opScopeChoices;
-        opScopeChoices = new HashSet<>();
-        opScopeChoices.add(OperationalScope.Core);
-        opScopeChoices.add(OperationalScope.CPU);
-        opScopeChoices.add(OperationalScope.Network_Wide);
-        EntitlementPoolEntity ep2 =
-            createEntitlementPool("vlm2Id", null, ep1_id,EP1_NAME, "EP2 dec", 70,
-                ThresholdUnit.Absolute,
-                EntitlementMetric.Other, "exception metric2", "inc2", AggregationFunction.Average, null,
-                opScopeChoices, null, EntitlementTime.Other, "time2", "sku2");
-        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy");
-        ep2.setStartDate(LocalDate.now().format(formatter));
-        ep2.setExpiryDate(LocalDate.now().minusDays(2L).format(formatter));
-        ep2.setVendorLicenseModelId(vlm1_id);
-        vendorLicenseManagerImpl.createEntitlementPool(ep2, USER1).getId();
-        Assert.fail();
+    doNothing().when(vendorLicenseManagerImpl).deleteUniqueName(anyObject(), anyObject(),
+        anyObject(), anyObject());
 
-    }
+    vendorLicenseManagerImpl.deleteEntitlementPool(entitlementPool);
 
-    @Test(expectedExceptions = CoreException.class, expectedExceptionsMessageRegExp = "Vendor " +
-        "license model with id vlm1_id has invalid date range.")
-    public void createWithoutStartDateTest() {
+    verify(entitlementPoolDao).delete(entitlementPool);
+  }
 
-        Set<OperationalScope> opScopeChoices;
-        opScopeChoices = new HashSet<>();
-        opScopeChoices.add(OperationalScope.Core);
-        opScopeChoices.add(OperationalScope.CPU);
-        opScopeChoices.add(OperationalScope.Network_Wide);
-        EntitlementPoolEntity ep2 =
-            createEntitlementPool("vlm3Id", null, ep1_id,EP1_NAME, "EP2 dec", 70,
-                ThresholdUnit.Absolute,
-                EntitlementMetric.Other, "exception metric2", "inc2", AggregationFunction.Average, null,
-                opScopeChoices, null, EntitlementTime.Other, "time2", "sku2");
-        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy");
-        ep2.setExpiryDate(LocalDate.now().plusDays(2L).format(formatter));
-        ep2.setVendorLicenseModelId(vlm1_id);
-        vendorLicenseManagerImpl.createEntitlementPool(ep2, USER1).getId();
-        Assert.fail();
+  @Test
+  public void testGetEntitlementPool() {
+    Set<OperationalScope> opScopeChoices;
+    opScopeChoices = new HashSet<>();
+    opScopeChoices.add(OperationalScope.Core);
+    opScopeChoices.add(OperationalScope.CPU);
+    opScopeChoices.add(OperationalScope.Network_Wide);
 
-    }
+    EntitlementPoolEntity entitlementPool =
+        createEntitlementPool(vlm1_id, VERSION01, ep1_id, EP1_NAME, "EP2 dec", 70,
+            ThresholdUnit.Absolute, EntitlementMetric.Other, "exception metric2", "inc2",
+            AggregationFunction.Average, null,
+            opScopeChoices, null, EntitlementTime.Other, "time2", "sku2");
+    DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy'T'HH:mm:ss'Z'");
 
-    @Test(expectedExceptions = CoreException.class, expectedExceptionsMessageRegExp = "Vendor " +
-        "license model with id vlm1_id has invalid date range.")
-    public void createWithSameStartExpiryDateTest() {
+    entitlementPool.setStartDate(LocalDateTime.now().format(formatter));
+    entitlementPool.setExpiryDate(LocalDateTime.now().plusDays(1L).format(formatter));
 
-        Set<OperationalScope> opScopeChoices;
-        opScopeChoices = new HashSet<>();
-        opScopeChoices.add(OperationalScope.Core);
-        opScopeChoices.add(OperationalScope.CPU);
-        opScopeChoices.add(OperationalScope.Network_Wide);
-        EntitlementPoolEntity ep2 =
-            createEntitlementPool("vlm4Id", null, ep1_id,EP1_NAME, "EP2 dec", 70,
-                ThresholdUnit.Absolute,
-                EntitlementMetric.Other, "exception metric2", "inc2", AggregationFunction.Average, null,
-                opScopeChoices, null, EntitlementTime.Other, "time2", "sku2");
-        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy");
-        ep2.setStartDate(LocalDate.now().format(formatter));
-        ep2.setExpiryDate(LocalDate.now().format(formatter));
-        ep2.setVendorLicenseModelId(vlm1_id);
-        vendorLicenseManagerImpl.createEntitlementPool(ep2, USER1).getId();
-        Assert.fail();
-    }
+    doReturn(entitlementPool).when(entitlementPoolDao).get(anyObject());
 
-    @Test
-    public void testUpdate() {
-        Set<OperationalScope> opScopeChoices;
-        opScopeChoices = new HashSet<>();
-        opScopeChoices.add(OperationalScope.Core);
-        opScopeChoices.add(OperationalScope.CPU);
-        opScopeChoices.add(OperationalScope.Network_Wide);
-        EntitlementPoolEntity ep2 =
-            createEntitlementPool(vlm1_id, VERSION01, ep1_id,EP1_NAME, "EP2 dec", 70,
-                ThresholdUnit
-                    .Absolute,
-                EntitlementMetric.Other, "exception metric2", "inc2", AggregationFunction.Average, null,
-                opScopeChoices, null, EntitlementTime.Other, "time2", "sku2");
-        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy");
-        ep2.setStartDate(LocalDate.now().minusDays(3L).format(formatter));
-        ep2.setExpiryDate(LocalDate.now().minusDays(2L).format(formatter));
+    EntitlementPoolEntity retrived = vendorLicenseManagerImpl.getEntitlementPool(entitlementPool);
 
-        VersionInfo info = new VersionInfo();
-        info.getViewableVersions().add(VERSION01);
-        info.setActiveVersion(VERSION01);
-        doReturn(info).when(vendorLicenseFacade).getVersionInfo(anyObject(),anyObject(),anyObject());
+    Assert.assertEquals(retrived.getId(), entitlementPool.getId());
+    Assert.assertEquals(retrived.getVendorLicenseModelId(),
+        entitlementPool.getVendorLicenseModelId());
+    Assert.assertEquals(retrived.getVersion(), entitlementPool.getVersion());
+  }
 
-        vendorLicenseManagerImpl.updateEntitlementPool(ep2, USER1);
-        verify(vendorLicenseFacade).updateEntitlementPool(ep2,USER1);
-        verify(vendorLicenseFacade).updateVlmLastModificationTime(vlm1_id,VERSION01);
-    }
+  @Test
+  public void testListEntitlmentPool() {
 
-    @Test(expectedExceptions = CoreException.class, expectedExceptionsMessageRegExp = "Vendor " +
-        "license model with id vlm1_id has invalid date range.")
-    public void updateWithInvalidStartExpiryDateTest() {
+    Set<OperationalScope> opScopeChoices;
+    opScopeChoices = new HashSet<>();
+    opScopeChoices.add(OperationalScope.Core);
+    opScopeChoices.add(OperationalScope.CPU);
+    opScopeChoices.add(OperationalScope.Network_Wide);
 
-        Set<OperationalScope> opScopeChoices;
-        opScopeChoices = new HashSet<>();
-        opScopeChoices.add(OperationalScope.Core);
-        opScopeChoices.add(OperationalScope.CPU);
-        opScopeChoices.add(OperationalScope.Network_Wide);
-        EntitlementPoolEntity ep2 =
-            createEntitlementPool("vlm2Id", null, ep1_id,EP1_NAME, "EP2 dec", 70,
-                ThresholdUnit.Absolute,
-                EntitlementMetric.Other, "exception metric2", "inc2", AggregationFunction.Average, null,
-                opScopeChoices, null, EntitlementTime.Other, "time2", "sku2");
-        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy");
-        ep2.setStartDate(LocalDate.now().format(formatter));
-        ep2.setExpiryDate(LocalDate.now().minusDays(2L).format(formatter));
-        ep2.setVendorLicenseModelId(vlm1_id);
-        vendorLicenseManagerImpl.updateEntitlementPool(ep2, USER1);
-        Assert.fail();
+    doReturn(Arrays.asList(
+        createEntitlementPool(vlm1_id, VERSION01, ep1_id, EP1_NAME, "EP1 dec", 70,
+            ThresholdUnit.Absolute, EntitlementMetric.Other, "exception metric1",
+            "inc1", AggregationFunction.Average, null,
+            opScopeChoices, null, EntitlementTime.Other, "time1", "sku1"),
+        createEntitlementPool(vlm1_id, VERSION01, ep2_id, EP2_NAME, "EP2 dec", 70,
+            ThresholdUnit.Absolute, EntitlementMetric.Other, "exception metric2",
+            "inc2", AggregationFunction.Average, null,
+            opScopeChoices, null, EntitlementTime.Other, "time2", "sku2")))
+        .when(vendorLicenseFacade).listEntitlementPools(vlm1_id, VERSION01);
 
-    }
+    Collection<EntitlementPoolEntity> EPs =
+        vendorLicenseManagerImpl.listEntitlementPools(vlm1_id, VERSION01);
 
-    @Test
-    public void updateWithoutStartDateTest() {
-        try {
-
-            Set<OperationalScope> opScopeChoices;
-            opScopeChoices = new HashSet<>();
-            opScopeChoices.add(OperationalScope.Core);
-            opScopeChoices.add(OperationalScope.CPU);
-            opScopeChoices.add(OperationalScope.Network_Wide);
-            EntitlementPoolEntity ep2 =
-                createEntitlementPool("vlm3Id", null, ep1_id,EP1_NAME, "EP2 dec", 70,
-                    ThresholdUnit.Absolute,
-                    EntitlementMetric.Other, "exception metric2", "inc2", AggregationFunction.Average, null,
-                    opScopeChoices, null, EntitlementTime.Other, "time2", "sku2");
-            DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy");
-            ep2.setExpiryDate(LocalDate.now().plusDays(2L).format(formatter));
-            vendorLicenseManagerImpl.updateEntitlementPool(ep2, USER1);
-            Assert.fail();
-        } catch (CoreException exception) {
-            Assert.assertEquals(exception.code().id(), VendorLicenseErrorCodes.DATE_RANGE_INVALID);
-        }
-    }
-
-    @Test
-    public void updateWithSameStartExpiryDateTest() {
-        try {
-
-            Set<OperationalScope> opScopeChoices;
-            opScopeChoices = new HashSet<>();
-            opScopeChoices.add(OperationalScope.Core);
-            opScopeChoices.add(OperationalScope.CPU);
-            opScopeChoices.add(OperationalScope.Network_Wide);
-            EntitlementPoolEntity ep2 =
-                createEntitlementPool("vlm4Id", null, ep1_id,EP1_NAME, "EP2 dec", 70,
-                    ThresholdUnit.Absolute,
-                    EntitlementMetric.Other, "exception metric2", "inc2", AggregationFunction.Average, null,
-                    opScopeChoices, null, EntitlementTime.Other, "time2", "sku2");
-            DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy");
-            ep2.setStartDate(LocalDate.now().format(formatter));
-            ep2.setExpiryDate(LocalDate.now().format(formatter));
-            vendorLicenseManagerImpl.updateEntitlementPool(ep2, USER1);
-            Assert.fail();
-        } catch (CoreException exception) {
-            Assert.assertEquals(exception.code().id(), VendorLicenseErrorCodes.DATE_RANGE_INVALID);
-        }
-    }
-
-    @Test
-    public void deleteEntitlementPoolTest() {
-
-        VersionInfo versionInfo = new VersionInfo();
-        versionInfo.setActiveVersion(VERSION01);
-        versionInfo.setLockingUser(USER1);
-        ArrayList<Version> viewable = new ArrayList<Version>();
-        viewable.add(VERSION01);
-        versionInfo.setViewableVersions(viewable);
-
-        doReturn(versionInfo).when(vendorLicenseManagerImpl).getVersionInfo(vlm1_id,
-            VersionableEntityAction.Write, USER1);
-
-        Set<OperationalScope> opScopeChoices;
-        opScopeChoices = new HashSet<>();
-        opScopeChoices.add(OperationalScope.Core);
-        opScopeChoices.add(OperationalScope.CPU);
-        opScopeChoices.add(OperationalScope.Network_Wide);
-
-        EntitlementPoolEntity entitlementPool =
-            createEntitlementPool(vlm1_id,VERSION01, ep1_id,EP1_NAME, "EP2 dec", 70,
-                ThresholdUnit.Absolute,EntitlementMetric.Other, "exception metric2", "inc2",
-                AggregationFunction.Average, null,
-                opScopeChoices, null, EntitlementTime.Other, "time2", "sku2");
-        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy");
-        entitlementPool.setStartDate(LocalDate.now().format(formatter));
-        entitlementPool.setExpiryDate(LocalDate.now().plusDays(1L).format(formatter));
-
-        doReturn(entitlementPool).when(entitlementPoolDao).get(anyObject());
-
-        doNothing().when(vendorLicenseManagerImpl).deleteChildLimits(vlm1_id,VERSION01,ep1_id,USER1);
-
-        doNothing().when(vendorLicenseManagerImpl).deleteUniqueName(anyObject(),anyObject(),
-            anyObject(),anyObject());
-
-        vendorLicenseManagerImpl.deleteEntitlementPool(entitlementPool, USER1);
-
-        verify(entitlementPoolDao).delete(entitlementPool);
-        verify(vendorLicenseFacade).updateVlmLastModificationTime(vlm1_id,VERSION01);
-
-    }
-
-    @Test
-    public void testGetEntitlementPool(){
-
-        VersionInfo versionInfo = new VersionInfo();
-        versionInfo.setActiveVersion(VERSION01);
-        versionInfo.setLockingUser(USER1);
-        ArrayList<Version> viewable = new ArrayList<Version>();
-        viewable.add(VERSION01);
-        versionInfo.setViewableVersions(viewable);
-        versionInfo.setActiveVersion(VERSION01);
-
-        doReturn(versionInfo).when(vendorLicenseManagerImpl).getVersionInfo(vlm1_id,
-            VersionableEntityAction.Read, USER1);
-
-        Set<OperationalScope> opScopeChoices;
-        opScopeChoices = new HashSet<>();
-        opScopeChoices.add(OperationalScope.Core);
-        opScopeChoices.add(OperationalScope.CPU);
-        opScopeChoices.add(OperationalScope.Network_Wide);
-
-        EntitlementPoolEntity entitlementPool =
-            createEntitlementPool(vlm1_id,VERSION01, ep1_id,EP1_NAME, "EP2 dec", 70,
-                ThresholdUnit.Absolute,EntitlementMetric.Other, "exception metric2", "inc2",
-                AggregationFunction.Average, null,
-                opScopeChoices, null, EntitlementTime.Other, "time2", "sku2");
-        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy'T'HH:mm:ss'Z'");
-
-        entitlementPool.setStartDate(LocalDateTime.now().format(formatter));
-        entitlementPool.setExpiryDate(LocalDateTime.now().plusDays(1L).format(formatter));
-
-        doReturn(entitlementPool).when(entitlementPoolDao).get(anyObject());
-
-        EntitlementPoolEntity retrived = vendorLicenseManagerImpl.getEntitlementPool
-            (entitlementPool,USER1);
-
-        Assert.assertEquals(retrived.getId(),entitlementPool.getId());
-        Assert.assertEquals(retrived.getVendorLicenseModelId(),entitlementPool.getVendorLicenseModelId());
-        Assert.assertEquals(retrived.getVersion(),entitlementPool.getVersion());
-    }
-
-    @Test
-    public void testListEntitlmentPool(){
-
-        Set<OperationalScope> opScopeChoices;
-        opScopeChoices = new HashSet<>();
-        opScopeChoices.add(OperationalScope.Core);
-        opScopeChoices.add(OperationalScope.CPU);
-        opScopeChoices.add(OperationalScope.Network_Wide);
-
-        doReturn(Arrays.asList(
-            createEntitlementPool(vlm1_id,VERSION01, ep1_id, EP1_NAME,"EP1 dec", 70,
-                ThresholdUnit.Absolute,EntitlementMetric.Other, "exception metric1",
-                "inc1", AggregationFunction.Average, null,
-                opScopeChoices, null, EntitlementTime.Other, "time1", "sku1"),
-            createEntitlementPool(vlm1_id,VERSION01, ep2_id, EP2_NAME,"EP2 dec", 70,
-                ThresholdUnit.Absolute,EntitlementMetric.Other, "exception metric2",
-                "inc2", AggregationFunction.Average, null,
-                opScopeChoices, null, EntitlementTime.Other, "time2", "sku2")))
-            .when(vendorLicenseFacade).listEntitlementPools(vlm1_id, VERSION01, USER1);
-
-        Collection<EntitlementPoolEntity> EPs =
-            vendorLicenseManagerImpl.listEntitlementPools(vlm1_id, VERSION01, USER1);
-
-        verify(vendorLicenseFacade).listEntitlementPools(vlm1_id, VERSION01, USER1);
-        Assert.assertEquals(EPs.size(), 2);
-        EPs.forEach(ep -> Assert.assertTrue(ep.getId().matches(ep1_id + "|" + ep2_id)));
-    }
+    verify(vendorLicenseFacade).listEntitlementPools(vlm1_id, VERSION01);
+    Assert.assertEquals(EPs.size(), 2);
+    EPs.forEach(ep -> Assert.assertTrue(ep.getId().matches(ep1_id + "|" + ep2_id)));
+  }
 
 
   /*  @Test
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/impl/FeatureGroupTest.java b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/impl/FeatureGroupTest.java
index dd35606..b9eacc3 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/impl/FeatureGroupTest.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/impl/FeatureGroupTest.java
@@ -21,35 +21,27 @@
 
 package org.openecomp.sdc.vendorlicense.impl;
 
-import static org.mockito.Matchers.anyObject;
-import static org.mockito.Mockito.doReturn;
-
 import org.mockito.InjectMocks;
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
 import org.mockito.Spy;
-import org.openecomp.sdc.activityLog.ActivityLogManager;
 import org.openecomp.sdc.vendorlicense.VendorLicenseConstants;
-import org.openecomp.sdc.vendorlicense.dao.*;
-import org.openecomp.sdc.vendorlicense.dao.types.ChoiceOrOther;
+import org.openecomp.sdc.vendorlicense.dao.EntitlementPoolDao;
+import org.openecomp.sdc.vendorlicense.dao.FeatureGroupDao;
+import org.openecomp.sdc.vendorlicense.dao.LicenseAgreementDao;
+import org.openecomp.sdc.vendorlicense.dao.LicenseKeyGroupDao;
+import org.openecomp.sdc.vendorlicense.dao.LimitDao;
+import org.openecomp.sdc.vendorlicense.dao.VendorLicenseModelDao;
 import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity;
 import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity;
-import org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity;
 import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity;
-import org.openecomp.sdc.vendorlicense.dao.types.LicenseTerm;
 import org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacade;
-import org.openecomp.sdc.vendorlicense.facade.impl.VendorLicenseFacadeImpl;
-import org.openecomp.sdc.vendorlicense.impl.VendorLicenseManagerImpl;
 import org.openecomp.sdc.versioning.VersioningManager;
 import org.openecomp.sdc.versioning.dao.types.Version;
-import org.openecomp.sdc.versioning.types.VersionInfo;
-import org.openecomp.sdc.versioning.types.VersionableEntityAction;
 import org.testng.Assert;
-import org.testng.AssertJUnit.*;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
-import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.HashSet;
@@ -58,7 +50,6 @@
 import static org.mockito.Matchers.anyObject;
 import static org.mockito.Mockito.doNothing;
 import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.never;
 import static org.mockito.Mockito.verify;
 
 /**
@@ -66,272 +57,254 @@
  */
 
 public class FeatureGroupTest {
-    //JUnit Test Cases using Mockito
-    private static final Version VERSION01 = new Version(0, 1);
-    private static final Version VERSION10 = new Version(1, 0);
-    private final String FG1_NAME = "FG1 name";
-    private static final String USER1 = "TestUser1";
-    private static final String USER2 = "TestUser2";
+  //JUnit Test Cases using Mockito
+  private static final Version VERSION01 = new Version(0, 1);
+  private static final Version VERSION10 = new Version(1, 0);
+  private final String FG1_NAME = "FG1 name";
+  private static final String USER1 = "TestUser1";
+  private static final String USER2 = "TestUser2";
 
-    private static String vlm1_id = "vlm1_id";
-    private static String vlm2_id = "vlm2_id";
-    private static String lkg1_id = "lkg1_id";
-    private static String lkg2_id = "lkg2_id";
-    private static String fg1_id = "fg1_id";
-    private static String fg2_id = "fg2_id";
-    private static String ep1_id = "ep1_id";
-    private static String ep2_id = "ep2_id";
+  private static String vlm1_id = "vlm1_id";
+  private static String vlm2_id = "vlm2_id";
+  private static String lkg1_id = "lkg1_id";
+  private static String lkg2_id = "lkg2_id";
+  private static String fg1_id = "fg1_id";
+  private static String fg2_id = "fg2_id";
+  private static String ep1_id = "ep1_id";
+  private static String ep2_id = "ep2_id";
 
-    @Mock
-    private VendorLicenseFacade vendorLicenseFacadeMcok;
+  @Mock
+  private VendorLicenseFacade vendorLicenseFacadeMcok;
 
-    @Mock
-    private LimitDao limitDaoMcok;
-    @Mock
-    private ActivityLogManager activityLogManagerMcok;
+  @Mock
+  private LimitDao limitDaoMcok;
 
-    @Mock
-    private VendorLicenseModelDao vendorLicenseModelDao;
+  @Mock
+  private VendorLicenseModelDao vendorLicenseModelDao;
 
-    @Mock
-    private LicenseAgreementDao licenseAgreementDao;
+  @Mock
+  private LicenseAgreementDao licenseAgreementDao;
 
-    @Mock
-    private FeatureGroupDao featureGroupDao;
+  @Mock
+  private FeatureGroupDao featureGroupDao;
 
-    @Mock
-    private EntitlementPoolDao entitlementPoolDao;
+  @Mock
+  private EntitlementPoolDao entitlementPoolDao;
 
-    @Mock
-    private LicenseKeyGroupDao licenseKeyGroupDao;
+  @Mock
+  private LicenseKeyGroupDao licenseKeyGroupDao;
 
-    @Mock
-    private VersioningManager versioningManager;
+  @Mock
+  private VersioningManager versioningManager;
 
-    @InjectMocks
-    @Spy
-    private VendorLicenseManagerImpl vendorLicenseManagerImpl;
+  @InjectMocks
+  @Spy
+  private VendorLicenseManagerImpl vendorLicenseManagerImpl;
 
-    public FeatureGroupEntity updateFeatureGroup(String vlmId, Version version, String id, String name, String desc,
-                                                 String partNumber, String manufacturerReferenceNumber, Set<String>
-                                                     licenseKeyGroupIds, Set<String> entitlementPoolIds, Set<String>
-                                                     referencingLicenseAgreements){
-        FeatureGroupEntity featureGroup = new FeatureGroupEntity(vlmId, version, id);
-        featureGroup.setVendorLicenseModelId(vlmId);
-        featureGroup.setVersion(version);
-        featureGroup.setId(id);
-        featureGroup.setName(name);
-        featureGroup.setDescription(desc);
-        featureGroup.setPartNumber(partNumber);
-        //featureGroup.setManufacturerReferenceNumber(manufacturerReferenceNumber);
-        featureGroup.setLicenseKeyGroupIds(licenseKeyGroupIds);
-        featureGroup.setEntitlementPoolIds(entitlementPoolIds);
-        featureGroup.setReferencingLicenseAgreements(referencingLicenseAgreements);
+  public FeatureGroupEntity updateFeatureGroup(String vlmId, Version version, String id,
+                                               String name, String desc,
+                                               String partNumber,
+                                               String manufacturerReferenceNumber, Set<String>
+                                                   licenseKeyGroupIds,
+                                               Set<String> entitlementPoolIds, Set<String>
+                                                   referencingLicenseAgreements) {
+    FeatureGroupEntity featureGroup = new FeatureGroupEntity(vlmId, version, id);
+    featureGroup.setVendorLicenseModelId(vlmId);
+    featureGroup.setVersion(version);
+    featureGroup.setId(id);
+    featureGroup.setName(name);
+    featureGroup.setDescription(desc);
+    featureGroup.setPartNumber(partNumber);
+    //featureGroup.setManufacturerReferenceNumber(manufacturerReferenceNumber);
+    featureGroup.setLicenseKeyGroupIds(licenseKeyGroupIds);
+    featureGroup.setEntitlementPoolIds(entitlementPoolIds);
+    featureGroup.setReferencingLicenseAgreements(referencingLicenseAgreements);
 
-        return featureGroup;
-    }
+    return featureGroup;
+  }
 
-    @BeforeMethod
-    public void setUp() {
-        MockitoAnnotations.initMocks(this);
-    }
+  @BeforeMethod
+  public void setUp() throws Exception {
+    MockitoAnnotations.initMocks(this);
+  }
 
-    @Test
-    public void testUpdate(){
-        Set<String> licenseKeyGroupIds;
-        licenseKeyGroupIds = new HashSet<>();
-        licenseKeyGroupIds.add("lkg1");
+  @Test
+  public void testUpdate() {
+    Set<String> licenseKeyGroupIds;
+    licenseKeyGroupIds = new HashSet<>();
+    licenseKeyGroupIds.add("lkg1");
 
-        Set<String> entitlementPoolIds;
-        entitlementPoolIds = new HashSet<>();
-        entitlementPoolIds.add("ep1");
+    Set<String> entitlementPoolIds;
+    entitlementPoolIds = new HashSet<>();
+    entitlementPoolIds.add("ep1");
 
-        Set<String> referencingLicenseAgreements;
-        referencingLicenseAgreements = new HashSet<>();
-        referencingLicenseAgreements.add("la1");
+    Set<String> referencingLicenseAgreements;
+    referencingLicenseAgreements = new HashSet<>();
+    referencingLicenseAgreements.add("la1");
 
-        FeatureGroupEntity featureGroupEntity = updateFeatureGroup("vlmId", VERSION01, "fgId", FG1_NAME, "fg1 desc",
+    FeatureGroupEntity featureGroupEntity =
+        updateFeatureGroup("vlmId", VERSION01, "fgId", FG1_NAME, "fg1 desc",
             "partNumber", "MRN", licenseKeyGroupIds, entitlementPoolIds,
             referencingLicenseAgreements);
 
-        doReturn(featureGroupEntity).when(featureGroupDao).get(anyObject());
+    doReturn(featureGroupEntity).when(featureGroupDao).get(anyObject());
 
         /*if(featureGroupEntity.getManufacturerReferenceNumber() != null)
             featureGroupDao.update(featureGroupEntity);
         verify(featureGroupDao).update(anyObject());*/
-    }
+  }
 
-    @Test
-    public void testUpdateWithoutManufacturingReferenceNumber(){
-        Set<String> licenseKeyGroupIds;
-        licenseKeyGroupIds = new HashSet<>();
-        licenseKeyGroupIds.add("lkg1");
+  @Test
+  public void testUpdateWithoutManufacturingReferenceNumber() {
+    Set<String> licenseKeyGroupIds;
+    licenseKeyGroupIds = new HashSet<>();
+    licenseKeyGroupIds.add("lkg1");
 
-        Set<String> entitlementPoolIds;
-        entitlementPoolIds = new HashSet<>();
-        entitlementPoolIds.add("ep1");
+    Set<String> entitlementPoolIds;
+    entitlementPoolIds = new HashSet<>();
+    entitlementPoolIds.add("ep1");
 
-        Set<String> referencingLicenseAgreements;
-        referencingLicenseAgreements = new HashSet<>();
-        referencingLicenseAgreements.add("la1");
+    Set<String> referencingLicenseAgreements;
+    referencingLicenseAgreements = new HashSet<>();
+    referencingLicenseAgreements.add("la1");
 
-        FeatureGroupEntity featureGroupEntity = updateFeatureGroup("vlmId", VERSION01, "fgId", FG1_NAME, "fg1 desc",
+    FeatureGroupEntity featureGroupEntity =
+        updateFeatureGroup("vlmId", VERSION01, "fgId", FG1_NAME, "fg1 desc",
             "partNumber", null, licenseKeyGroupIds, entitlementPoolIds,
             referencingLicenseAgreements);
 
-        doReturn(featureGroupEntity).when(featureGroupDao).get(anyObject());
+    doReturn(featureGroupEntity).when(featureGroupDao).get(anyObject());
 
         /*if(featureGroupEntity.getManufacturerReferenceNumber() != null)
             featureGroupDao.update(featureGroupEntity);
         verify(featureGroupDao, never()).update(anyObject());*/
-    }
+  }
 
-    @Test
-    public void testListFeatureGroups() {
-        doReturn(Arrays.asList(
-            createFeatureGroup(vlm1_id, VERSION01, fg1_id, "FG1", "FG1 desc", new HashSet<String>(),
-                new HashSet<String>()),
-            createFeatureGroup(vlm1_id, VERSION01, fg2_id, "FG2", "FG2 desc", new HashSet<String>(),
-                new HashSet<String>())))
-            .when(vendorLicenseFacadeMcok).listFeatureGroups(vlm1_id, VERSION01, USER1);
+  @Test
+  public void testListFeatureGroups() {
+    doReturn(Arrays.asList(
+        createFeatureGroup(vlm1_id, VERSION01, fg1_id, "FG1", "FG1 desc", new HashSet<String>(),
+            new HashSet<String>()),
+        createFeatureGroup(vlm1_id, VERSION01, fg2_id, "FG2", "FG2 desc", new HashSet<String>(),
+            new HashSet<String>())))
+        .when(vendorLicenseFacadeMcok).listFeatureGroups(vlm1_id, VERSION01);
 
-        Collection<FeatureGroupEntity> FGs =
-            vendorLicenseManagerImpl.listFeatureGroups(vlm1_id, VERSION01, USER1);
+    Collection<FeatureGroupEntity> FGs =
+        vendorLicenseManagerImpl.listFeatureGroups(vlm1_id, VERSION01);
 
-        verify(vendorLicenseFacadeMcok).listFeatureGroups(vlm1_id, VERSION01, USER1);
-        Assert.assertEquals(FGs.size(), 2);
-        FGs.forEach(fg -> Assert.assertTrue(fg.getId().matches(fg1_id + "|" + fg2_id)));
-    }
+    verify(vendorLicenseFacadeMcok).listFeatureGroups(vlm1_id, VERSION01);
+    Assert.assertEquals(FGs.size(), 2);
+    FGs.forEach(fg -> Assert.assertTrue(fg.getId().matches(fg1_id + "|" + fg2_id)));
+  }
 
-    @Test
-    public void testCreateFeatureGroup() {
-        FeatureGroupEntity featureGroupEntity = new FeatureGroupEntity(vlm1_id,VERSION01,
-            fg1_id);
+  @Test
+  public void testCreateFeatureGroup() {
+    FeatureGroupEntity featureGroupEntity = new FeatureGroupEntity(vlm1_id, VERSION01,
+        fg1_id);
 
-        doReturn(featureGroupEntity).when(vendorLicenseFacadeMcok).createFeatureGroup
-            (featureGroupEntity,USER1);
+    doReturn(featureGroupEntity).when(vendorLicenseFacadeMcok).createFeatureGroup
+        (featureGroupEntity);
 
-        vendorLicenseManagerImpl.createFeatureGroup(featureGroupEntity,USER1);
+    vendorLicenseManagerImpl.createFeatureGroup(featureGroupEntity);
 
-        verify(vendorLicenseFacadeMcok).createFeatureGroup(featureGroupEntity,USER1);
-    }
+    verify(vendorLicenseFacadeMcok).createFeatureGroup(featureGroupEntity);
+  }
 
 
-    @Test
-    public void testUpdateFeatureGroup(){
-        VersionInfo versionInfo = new VersionInfo();
-        versionInfo.setActiveVersion(VERSION01);
-        versionInfo.setLockingUser(USER1);
-        ArrayList<Version> viewable = new ArrayList<Version>();
-        viewable.add(VERSION01);
-        versionInfo.setViewableVersions(viewable);
+  @Test
+  public void testUpdateFeatureGroup() {
+    FeatureGroupEntity existingFG = new FeatureGroupEntity(vlm1_id, VERSION01, fg1_id);
 
-        doReturn(versionInfo).when(vendorLicenseManagerImpl).getVersionInfo(vlm1_id,
-            VersionableEntityAction.Write, USER1);
-        FeatureGroupEntity existingFG = new FeatureGroupEntity(vlm1_id, VERSION01, fg1_id);
+    existingFG.setEntitlementPoolIds(new HashSet<String>());
+    existingFG.setLicenseKeyGroupIds(new HashSet<String>());
 
-        existingFG.setEntitlementPoolIds(new HashSet<String>());
-        existingFG.setLicenseKeyGroupIds(new HashSet<String>());
+    doReturn(existingFG).when(featureGroupDao).get(existingFG);
 
-        doReturn(existingFG).when(featureGroupDao).get(existingFG);
+    Set<String> removedEPs = new HashSet<>();
+    Set<String> addedEPs = new HashSet<>();
 
-        Set<String> removedEPs = new HashSet<>();
-        Set<String> addedEPs = new HashSet<>();
+    addedEPs.add(ep1_id);
+    addedEPs.add(ep2_id);
+    EntitlementPoolEntity ep1 = new EntitlementPoolEntity(vlm1_id, VERSION01, ep1_id);
+    EntitlementPoolEntity ep2 = new EntitlementPoolEntity(vlm1_id, VERSION01, ep2_id);
+    doReturn(ep1).when(entitlementPoolDao).get(ep1);
+    doReturn(ep2).when(entitlementPoolDao).get(ep2);
 
-        addedEPs.add(ep1_id);
-        addedEPs.add(ep2_id);
-        EntitlementPoolEntity ep1 = new EntitlementPoolEntity(vlm1_id, VERSION01, ep1_id);
-        EntitlementPoolEntity ep2 = new EntitlementPoolEntity(vlm1_id, VERSION01, ep2_id);
-        doReturn(ep1).when(entitlementPoolDao).get(ep1);
-        doReturn(ep2).when(entitlementPoolDao).get(ep2);
+    Set<String> removedLKGs = new HashSet<>();
+    Set<String> addedLKGs = new HashSet<>();
 
-        Set<String> removedLKGs = new HashSet<>();
-        Set<String> addedLKGs = new HashSet<>();
+    addedLKGs.add(lkg1_id);
+    addedLKGs.add(lkg2_id);
+    LicenseKeyGroupEntity lkg1 = new LicenseKeyGroupEntity(vlm1_id, VERSION01, lkg1_id);
+    LicenseKeyGroupEntity lkg2 = new LicenseKeyGroupEntity(vlm1_id, VERSION01, lkg2_id);
+    doReturn(lkg1).when(licenseKeyGroupDao).get(lkg1);
+    doReturn(lkg2).when(licenseKeyGroupDao).get(lkg2);
 
-        addedLKGs.add(lkg1_id);
-        addedLKGs.add(lkg2_id);
-        LicenseKeyGroupEntity lkg1 = new LicenseKeyGroupEntity(vlm1_id, VERSION01, lkg1_id);
-        LicenseKeyGroupEntity lkg2 = new LicenseKeyGroupEntity(vlm1_id, VERSION01, lkg2_id);
-        doReturn(lkg1).when(licenseKeyGroupDao).get(lkg1);
-        doReturn(lkg2).when(licenseKeyGroupDao).get(lkg2);
+    doNothing().when(vendorLicenseManagerImpl).updateUniqueName(anyObject(), anyObject(),
+        anyObject(), anyObject(), anyObject());
 
-        doNothing().when(vendorLicenseManagerImpl).updateUniqueName(anyObject(), anyObject(),
-            anyObject(),anyObject(), anyObject());
+    vendorLicenseManagerImpl.updateFeatureGroup(existingFG, addedLKGs, removedLKGs, addedEPs,
+        removedEPs);
 
-        vendorLicenseManagerImpl.updateFeatureGroup(existingFG,addedLKGs,removedLKGs, addedEPs,
-            removedEPs, USER1);
+    verify(vendorLicenseManagerImpl).addLicenseKeyGroupsToFeatureGroupsRef(addedLKGs,
+        existingFG);
+    verify(vendorLicenseManagerImpl).removeLicenseKeyGroupsToFeatureGroupsRef(removedLKGs,
+        existingFG);
+    verify(vendorLicenseManagerImpl).addEntitlementPoolsToFeatureGroupsRef(addedEPs, existingFG);
+    verify(vendorLicenseManagerImpl).removeEntitlementPoolsToFeatureGroupsRef(removedEPs,
+        existingFG);
 
-        verify(vendorLicenseManagerImpl).addLicenseKeyGroupsToFeatureGroupsRef(addedLKGs,
-            existingFG);
-        verify(vendorLicenseManagerImpl).removeLicenseKeyGroupsToFeatureGroupsRef(removedLKGs,
-            existingFG);
-        verify(vendorLicenseManagerImpl).addEntitlementPoolsToFeatureGroupsRef(addedEPs,existingFG);
-        verify(vendorLicenseManagerImpl).removeEntitlementPoolsToFeatureGroupsRef(removedEPs,
-            existingFG);
-
-        verify(featureGroupDao)
-            .updateFeatureGroup(existingFG,addedEPs,removedEPs, addedLKGs, removedLKGs);
-        verify(vendorLicenseFacadeMcok).updateVlmLastModificationTime(vlm1_id,VERSION01);
-    }
+    verify(featureGroupDao)
+        .updateFeatureGroup(existingFG, addedEPs, removedEPs, addedLKGs, removedLKGs);
+  }
 
 
-    @Test
-    public void testGetFeatureGroup(){
-        FeatureGroupEntity featureGroupEntity = new FeatureGroupEntity(vlm1_id,VERSION01,fg1_id);
-        vendorLicenseManagerImpl.getFeatureGroupModel(featureGroupEntity,USER1);
-        verify(vendorLicenseFacadeMcok).getFeatureGroupModel(featureGroupEntity,USER1);
-    }
+  @Test
+  public void testGetFeatureGroup() {
+    FeatureGroupEntity featureGroupEntity = new FeatureGroupEntity(vlm1_id, VERSION01, fg1_id);
+    vendorLicenseManagerImpl.getFeatureGroupModel(featureGroupEntity);
+    verify(vendorLicenseFacadeMcok).getFeatureGroupModel(featureGroupEntity);
+  }
 
-    @Test
-    public void deleteFeatureGroupTest() {
+  @Test
+  public void deleteFeatureGroupTest() {
 
-        VersionInfo versionInfo = new VersionInfo();
-        versionInfo.setActiveVersion(VERSION01);
-        versionInfo.setLockingUser(USER1);
-        ArrayList<Version> viewable = new ArrayList<Version>();
-        viewable.add(VERSION01);
-        versionInfo.setViewableVersions(viewable);
+    FeatureGroupEntity existingFG = new FeatureGroupEntity(vlm1_id, VERSION01, fg1_id);
+    existingFG.setName("FG_name");
+    existingFG.setLicenseKeyGroupIds(new HashSet<String>());
+    existingFG.setEntitlementPoolIds(new HashSet<String>());
+    existingFG.setLicenseKeyGroupIds(new HashSet<String>());
 
-        doReturn(versionInfo).when(vendorLicenseManagerImpl).getVersionInfo(vlm1_id,
-            VersionableEntityAction.Write, USER1);
+    doReturn(existingFG).when(featureGroupDao).get(anyObject());
 
-        FeatureGroupEntity existingFG = new FeatureGroupEntity(vlm1_id, VERSION01, fg1_id);
-        existingFG.setName("FG_name");
-        existingFG.setLicenseKeyGroupIds(new HashSet<String>());
-        existingFG.setEntitlementPoolIds(new HashSet<String>());
-        existingFG.setLicenseKeyGroupIds(new HashSet<String>());
+    doNothing().when(vendorLicenseManagerImpl).deleteUniqueName(VendorLicenseConstants
+        .UniqueValues.FEATURE_GROUP_NAME, vlm1_id, VERSION01.toString(), existingFG.getName());
 
-        doReturn(existingFG).when(featureGroupDao).get(anyObject());
+    vendorLicenseManagerImpl.deleteFeatureGroup(existingFG);
 
-        doNothing().when(vendorLicenseManagerImpl).deleteUniqueName(VendorLicenseConstants
-            .UniqueValues.FEATURE_GROUP_NAME,vlm1_id,VERSION01.toString(),existingFG.getName());
+    verify(featureGroupDao).delete(existingFG);
 
-        vendorLicenseManagerImpl.deleteFeatureGroup(existingFG, USER1);
+    verify(vendorLicenseManagerImpl).removeLicenseKeyGroupsToFeatureGroupsRef(existingFG
+        .getLicenseKeyGroupIds(), existingFG);
+    verify(vendorLicenseManagerImpl).removeEntitlementPoolsToFeatureGroupsRef(existingFG
+        .getEntitlementPoolIds(), existingFG);
+    verify(vendorLicenseManagerImpl).deleteUniqueName(VendorLicenseConstants
+        .UniqueValues.FEATURE_GROUP_NAME, vlm1_id, VERSION01.toString(), existingFG.getName());
+  }
 
-        verify(featureGroupDao).delete(existingFG);
-        verify(vendorLicenseFacadeMcok).updateVlmLastModificationTime(vlm1_id,VERSION01);
-
-        verify(vendorLicenseManagerImpl).removeLicenseKeyGroupsToFeatureGroupsRef(existingFG
-            .getLicenseKeyGroupIds(),existingFG);
-        verify(vendorLicenseManagerImpl).removeEntitlementPoolsToFeatureGroupsRef(existingFG
-            .getEntitlementPoolIds(),existingFG);
-        verify(vendorLicenseManagerImpl).deleteUniqueName(VendorLicenseConstants
-            .UniqueValues.FEATURE_GROUP_NAME,vlm1_id,VERSION01.toString(),existingFG.getName());
-    }
-
-    private FeatureGroupEntity createFeatureGroup(String vendorId, Version version, String id,
-                                                  String name, String description,
-                                                  Set<String> entitlementPoolIds,
-                                                  Set<String> licenseKeyGroupIds) {
-        FeatureGroupEntity featureGroup = new FeatureGroupEntity();
-        featureGroup.setVendorLicenseModelId(vendorId);
-        featureGroup.setVersion(version);
-        featureGroup.setId(id);
-        featureGroup.setName(name);
-        featureGroup.setDescription(description);
-        featureGroup.setEntitlementPoolIds(entitlementPoolIds);
-        featureGroup.setLicenseKeyGroupIds(licenseKeyGroupIds);
-        return featureGroup;
-    }
+  private FeatureGroupEntity createFeatureGroup(String vendorId, Version version, String id,
+                                                String name, String description,
+                                                Set<String> entitlementPoolIds,
+                                                Set<String> licenseKeyGroupIds) {
+    FeatureGroupEntity featureGroup = new FeatureGroupEntity();
+    featureGroup.setVendorLicenseModelId(vendorId);
+    featureGroup.setVersion(version);
+    featureGroup.setId(id);
+    featureGroup.setName(name);
+    featureGroup.setDescription(description);
+    featureGroup.setEntitlementPoolIds(entitlementPoolIds);
+    featureGroup.setLicenseKeyGroupIds(licenseKeyGroupIds);
+    return featureGroup;
+  }
 }
 
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/impl/LicenseAgreementTest.java b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/impl/LicenseAgreementTest.java
index b0b5953..91435e8 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/impl/LicenseAgreementTest.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/impl/LicenseAgreementTest.java
@@ -26,17 +26,11 @@
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
 import org.mockito.Spy;
-import org.openecomp.core.util.UniqueValueUtil;
-import org.openecomp.core.utilities.CommonMethods;
-import org.openecomp.sdc.activityLog.ActivityLogManager;
 import org.openecomp.sdc.activitylog.dao.type.ActivityLogEntity;
-import org.openecomp.sdc.common.errors.CoreException;
 import org.openecomp.sdc.vendorlicense.VendorLicenseConstants;
 import org.openecomp.sdc.vendorlicense.dao.EntitlementPoolDao;
 import org.openecomp.sdc.vendorlicense.dao.FeatureGroupDao;
-import org.openecomp.sdc.vendorlicense.dao.FeatureGroupDaoFactory;
 import org.openecomp.sdc.vendorlicense.dao.LicenseAgreementDao;
-import org.openecomp.sdc.vendorlicense.dao.LicenseAgreementDaoFactory;
 import org.openecomp.sdc.vendorlicense.dao.LicenseKeyGroupDao;
 import org.openecomp.sdc.vendorlicense.dao.LimitDao;
 import org.openecomp.sdc.vendorlicense.dao.VendorLicenseModelDao;
@@ -44,36 +38,24 @@
 import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity;
 import org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity;
 import org.openecomp.sdc.vendorlicense.dao.types.LicenseTerm;
-import org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity;
 import org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacade;
-import org.openecomp.sdc.vendorlicense.impl.VendorLicenseManagerImpl;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity;
 import org.openecomp.sdc.versioning.VersioningManager;
-import org.openecomp.sdc.versioning.VersioningUtil;
 import org.openecomp.sdc.versioning.dao.types.Version;
-import org.openecomp.sdc.versioning.types.VersionInfo;
-import org.openecomp.sdc.versioning.types.VersionableEntityAction;
 import org.testng.Assert;
-import org.testng.annotations.BeforeClass;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyObject;
-import static org.mockito.Matchers.eq;
-import static org.mockito.Mockito.doNothing;
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.doThrow;
-import static org.mockito.Mockito.verify;
-import static org.openecomp.sdc.vendorlicense.VendorLicenseConstants.VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE;
-import static org.testng.AssertJUnit.assertEquals;
-
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.HashSet;
 import java.util.Set;
 
+import static org.mockito.Matchers.anyObject;
+import static org.mockito.Mockito.doNothing;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.verify;
+
 public class LicenseAgreementTest {
 
   private static final String USER1 = "TestUser1";
@@ -104,8 +86,6 @@
   private LicenseKeyGroupDao licenseKeyGroupDaoMcok;
   @Mock
   private LimitDao limitDaoMcok;
-  @Mock
-  private ActivityLogManager activityLogManagerMcok;
 
 
   @Spy
@@ -160,12 +140,12 @@
   @Test
   public void listLicenseAgreementsTest() {
 
-    LicenseAgreementEntity la = new LicenseAgreementEntity(vlm1_id,VERSION01,USER1);
-    doReturn(la).when(vendorLicenseManager).createLicenseAgreementForList(vlm1_id,VERSION01, USER1);
+    LicenseAgreementEntity la =
+        new LicenseAgreementEntity(vlm1_id, VERSION01, null); // TODO: 8/13/2017
 
     doReturn(Arrays.asList(
         createLicenseAgreement(vlm1_id, VERSION01, la1_id, "LA1", "LA1 " +
-                "desc","RequirementsAndConstrains2", new ChoiceOrOther<>(LicenseTerm.Unlimited, null),
+                "desc", "RequirementsAndConstrains2", new ChoiceOrOther<>(LicenseTerm.Unlimited, null),
             "fg1"),
         createLicenseAgreement(vlm1_id, VERSION01, la2_id, "LA2", "LA2 desc",
             "RequirementsAndConstrains2", new ChoiceOrOther<>(LicenseTerm.Unlimited, null),
@@ -173,23 +153,23 @@
         .when(licenseAgreementDaoMcok).list(la);
 
     Collection<LicenseAgreementEntity> LAs =
-        vendorLicenseManager.listLicenseAgreements(vlm1_id, VERSION01, USER1);
+        vendorLicenseManager.listLicenseAgreements(vlm1_id, VERSION01);
     Assert.assertEquals(LAs.size(), 2);
-    LAs.forEach(licseAgreement-> Assert.assertTrue(licseAgreement.getId().matches(la1_id + "|" + la2_id)));
+    LAs.forEach(
+        licseAgreement -> Assert.assertTrue(licseAgreement.getId().matches(la1_id + "|" + la2_id)));
   }
 
   @Test
   public void testListLicenseAgreementsWhenNone() {
 
-    LicenseAgreementEntity la = new LicenseAgreementEntity(vlm1_id,VERSION01,USER1);
-    doReturn(la).when(vendorLicenseManager).createLicenseAgreementForList(vlm1_id,VERSION01,
-        USER1);
+    LicenseAgreementEntity la =
+        new LicenseAgreementEntity(vlm1_id, VERSION01, null); // TODO: 8/13/2017
 
     doReturn(new ArrayList<LicenseAgreementEntity>())
         .when(licenseAgreementDaoMcok).list(la);
 
     Collection<LicenseAgreementEntity> LAs =
-        vendorLicenseManager.listLicenseAgreements(vlm1_id, VERSION01, USER1);
+        vendorLicenseManager.listLicenseAgreements(vlm1_id, VERSION01);
 
     verify(licenseAgreementDaoMcok).list(la);
     Assert.assertEquals(LAs.size(), 0);
@@ -199,29 +179,19 @@
   @Test
   public void testCreateLicenseAgreement() {
 
-    LicenseAgreementEntity licenseAgreementEntity = new LicenseAgreementEntity(vlm1_id,VERSION01,
+    LicenseAgreementEntity licenseAgreementEntity = new LicenseAgreementEntity(vlm1_id, VERSION01,
         la2_id);
 
     doReturn(licenseAgreementEntity).when(vendorLicenseFacadeMcok).createLicenseAgreement
-        (licenseAgreementEntity,USER1);
+        (licenseAgreementEntity);
 
-    vendorLicenseManager.createLicenseAgreement(licenseAgreementEntity,USER1);
+    vendorLicenseManager.createLicenseAgreement(licenseAgreementEntity);
 
-    verify(vendorLicenseFacadeMcok).createLicenseAgreement(licenseAgreementEntity,USER1);
+    verify(vendorLicenseFacadeMcok).createLicenseAgreement(licenseAgreementEntity);
   }
 
   @Test
   public void testUpdateLicenseAgreement() {
-
-    VersionInfo versionInfo = new VersionInfo();
-    versionInfo.setActiveVersion(VERSION01);
-    versionInfo.setLockingUser(USER1);
-    ArrayList<Version> viewable = new ArrayList<Version>();
-    viewable.add(VERSION01);
-    versionInfo.setViewableVersions(viewable);
-
-    doReturn(versionInfo).when(vendorLicenseManager).getVersionInfo(vlm1_id,
-        VersionableEntityAction.Write, USER1);
     LicenseAgreementEntity existingLA = new LicenseAgreementEntity(vlm1_id, VERSION01, la1_id);
 
     existingLA.setFeatureGroupIds(new HashSet<String>());
@@ -236,34 +206,20 @@
     FeatureGroupEntity fg2 = new FeatureGroupEntity(vlm1_id, VERSION01, fg2_id);
     doReturn(fg1).when(featureGroupDaoMcok).get(fg1);
     doReturn(fg2).when(featureGroupDaoMcok).get(fg2);
-    doReturn(existingLA).when(vendorLicenseManager).createLicenseAgreementForList(vlm1_id,VERSION01,
-        USER1);
     doNothing().when(vendorLicenseManager).updateUniqueName(anyObject(), anyObject(), anyObject(),
         anyObject(), anyObject());
 
-    vendorLicenseManager.updateLicenseAgreement(existingLA, addedFGs, removedFGs, USER1);
+    vendorLicenseManager.updateLicenseAgreement(existingLA, addedFGs, removedFGs);
 
     verify(licenseAgreementDaoMcok)
         .updateColumnsAndDeltaFeatureGroupIds(existingLA, addedFGs, removedFGs);
-    verify(vendorLicenseManager).addFeatureGroupsToLicenseAgreementRef(addedFGs,existingLA);
-    verify(vendorLicenseManager).removeFeatureGroupsToLicenseAgreementRef(removedFGs,existingLA);
-    verify(vendorLicenseFacadeMcok).updateVlmLastModificationTime(vlm1_id,VERSION01);
+    verify(vendorLicenseManager).addFeatureGroupsToLicenseAgreementRef(addedFGs, existingLA);
+    verify(vendorLicenseManager).removeFeatureGroupsToLicenseAgreementRef(removedFGs, existingLA);
 
   }
 
   @Test
   public void deleteLicenseAgreementsTest() {
-
-    VersionInfo versionInfo = new VersionInfo();
-    versionInfo.setActiveVersion(VERSION01);
-    versionInfo.setLockingUser(USER1);
-    ArrayList<Version> viewable = new ArrayList<Version>();
-    viewable.add(VERSION01);
-    versionInfo.setViewableVersions(viewable);
-
-    doReturn(versionInfo).when(vendorLicenseManager).getVersionInfo(vlm1_id,
-        VersionableEntityAction.Write, USER1);
-
     LicenseAgreementEntity existingLA = new LicenseAgreementEntity(vlm1_id, VERSION01, la1_id);
     existingLA.setName("LA");
     existingLA.setFeatureGroupIds(new HashSet<>());
@@ -271,20 +227,19 @@
     doReturn(existingLA).when(licenseAgreementDaoMcok).get(anyObject());
 
     doNothing().when(vendorLicenseManager).deleteUniqueName(VendorLicenseConstants.UniqueValues
-        .LICENSE_AGREEMENT_NAME,vlm1_id,VERSION01.toString(),existingLA.getName());
+        .LICENSE_AGREEMENT_NAME, vlm1_id, VERSION01.toString(), existingLA.getName());
 
-    vendorLicenseManager.deleteLicenseAgreement(vlm1_id, VERSION01, la1_id, USER1);
+    vendorLicenseManager.deleteLicenseAgreement(vlm1_id, VERSION01, la1_id);
 
     verify(licenseAgreementDaoMcok).delete(existingLA);
-    verify(vendorLicenseFacadeMcok).updateVlmLastModificationTime(vlm1_id,VERSION01);
     verify(vendorLicenseManager).removeFeatureGroupsToLicenseAgreementRef(existingLA
-        .getFeatureGroupIds(),existingLA);
+        .getFeatureGroupIds(), existingLA);
   }
 
   @Test
-  public void testGetLicenseAgreement(){
-    vendorLicenseManager.getLicenseAgreementModel(vlm1_id,VERSION01,la1_id,USER1);
-    verify(vendorLicenseFacadeMcok).getLicenseAgreementModel(vlm1_id,VERSION01,la1_id,USER1);
+  public void testGetLicenseAgreement() {
+    vendorLicenseManager.getLicenseAgreementModel(vlm1_id, VERSION01, la1_id);
+    verify(vendorLicenseFacadeMcok).getLicenseAgreementModel(vlm1_id, VERSION01, la1_id);
   }
 
 /*
@@ -300,7 +255,7 @@
     featureGroupDao.create(created);
     featureGroupDao.addReferencingLicenseAgreement(created, licenseAgreement.getId());
 
-    vendorLicenseManager.deleteFeatureGroup(created, USER1);
+    vendorLicenseManager.deleteFeatureGroup(created);
     LicenseAgreementEntity afterDeletingFG = licenseAgreementDao.get(licenseAgreement);
     Assert.assertEquals(afterDeletingFG.getFeatureGroupIds().size(), 1);
     Assert.assertTrue(afterDeletingFG.getFeatureGroupIds().contains("fg2"));
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/impl/LicenseKeyGroupTest.java b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/impl/LicenseKeyGroupTest.java
index f0dd383..dc376ee 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/impl/LicenseKeyGroupTest.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/impl/LicenseKeyGroupTest.java
@@ -26,21 +26,19 @@
 import org.mockito.MockitoAnnotations;
 import org.mockito.Spy;
 import org.openecomp.sdc.common.errors.CoreException;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.openecomp.sdc.vendorlicense.dao.LicenseKeyGroupDao;
 import org.openecomp.sdc.vendorlicense.dao.LimitDao;
-import org.openecomp.sdc.vendorlicense.dao.types.*;
+import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity;
+import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyType;
+import org.openecomp.sdc.vendorlicense.dao.types.MultiChoiceOrOther;
+import org.openecomp.sdc.vendorlicense.dao.types.OperationalScope;
 import org.openecomp.sdc.vendorlicense.errors.VendorLicenseErrorCodes;
 import org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacade;
 import org.openecomp.sdc.versioning.dao.types.Version;
-import org.openecomp.sdc.versioning.types.VersionInfo;
-import org.openecomp.sdc.versioning.types.VersionableEntityAction;
 import org.testng.Assert;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
-import java.util.ArrayList;
 import java.time.LocalDate;
 import java.time.format.DateTimeFormatter;
 import java.util.Arrays;
@@ -56,10 +54,10 @@
 public class LicenseKeyGroupTest {
 
   //JUnit Test Cases using Mockito
-  private  final String USER = "lkgTestUser";
-  private  final String LKG_NAME = "LKG name";
-  private  final String LKG2_NAME = "LKG2 name";
-  private  final String LT_NAME = "LT name";
+  private final String USER = "lkgTestUser";
+  private final String LKG_NAME = "LKG name";
+  private final String LKG2_NAME = "LKG2 name";
+  private final String LT_NAME = "LT name";
   private final String LKG1_NAME = "LKG1 name";
   private final String USER1 = "user1";
   private static String lkg1_id = "lkg1_id";
@@ -85,15 +83,16 @@
     MockitoAnnotations.initMocks(this);
   }
 
-  private LicenseKeyGroupEntity createLicenseKeyGroup(LicenseKeyType type, Set<OperationalScope> operationalScopeChoices,
-                                                      String operationalScopeOther)
-  {
+  private LicenseKeyGroupEntity createLicenseKeyGroup(LicenseKeyType type,
+                                                      Set<OperationalScope> operationalScopeChoices,
+                                                      String operationalScopeOther) {
     LicenseKeyGroupEntity licenseKeyGroupEntity = new LicenseKeyGroupEntity();
     licenseKeyGroupEntity.setType(type);
     licenseKeyGroupEntity.setOperationalScope(
         new MultiChoiceOrOther<>(operationalScopeChoices, operationalScopeOther));
     return licenseKeyGroupEntity;
   }
+
   /*
       @Test
       public void deleteLicenseKeyGroupTest() {
@@ -207,14 +206,14 @@
     opScopeChoices.add(OperationalScope.CPU);
     opScopeChoices.add(OperationalScope.Network_Wide);
     LicenseKeyGroupEntity lkg =
-        createLicenseKeyGroup("vlm1Id", null,lkg1_id, LKG1_NAME, "LKG1 dec",LicenseKeyType.Unique,
+        createLicenseKeyGroup("vlm1Id", null, lkg1_id, LKG1_NAME, "LKG1 dec", LicenseKeyType.Unique,
             new MultiChoiceOrOther<>(opScopeChoices, null));
     DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy");
     lkg.setStartDate(LocalDate.now().format(formatter));
     lkg.setExpiryDate(LocalDate.now().plusDays(1L).format(formatter));
 
-    vendorLicenseManagerImpl.createLicenseKeyGroup(lkg, USER1);
-    verify(vendorLicenseFacade).createLicenseKeyGroup(lkg,USER1);
+    vendorLicenseManagerImpl.createLicenseKeyGroup(lkg);
+    verify(vendorLicenseFacade).createLicenseKeyGroup(lkg);
   }
 
   @Test
@@ -227,12 +226,13 @@
       opScopeChoices.add(OperationalScope.CPU);
       opScopeChoices.add(OperationalScope.Network_Wide);
       LicenseKeyGroupEntity lkg =
-          createLicenseKeyGroup("vlm1Id", null, lkg1_id,LKG1_NAME, "LKG1 dec",LicenseKeyType.Unique,
+          createLicenseKeyGroup("vlm1Id", null, lkg1_id, LKG1_NAME, "LKG1 dec",
+              LicenseKeyType.Unique,
               new MultiChoiceOrOther<>(opScopeChoices, null));
       DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy");
       lkg.setStartDate(LocalDate.now().format(formatter));
       lkg.setExpiryDate(LocalDate.now().minusDays(2L).format(formatter));
-      vendorLicenseManagerImpl.createLicenseKeyGroup(lkg, USER1);
+      vendorLicenseManagerImpl.createLicenseKeyGroup(lkg);
       Assert.fail();
     } catch (CoreException exception) {
       Assert.assertEquals(exception.code().id(), VendorLicenseErrorCodes.DATE_RANGE_INVALID);
@@ -249,11 +249,12 @@
       opScopeChoices.add(OperationalScope.CPU);
       opScopeChoices.add(OperationalScope.Network_Wide);
       LicenseKeyGroupEntity lkg =
-          createLicenseKeyGroup("vlm1Id", null, lkg1_id,LKG1_NAME, "LKG1 dec",LicenseKeyType.Unique,
+          createLicenseKeyGroup("vlm1Id", null, lkg1_id, LKG1_NAME, "LKG1 dec",
+              LicenseKeyType.Unique,
               new MultiChoiceOrOther<>(opScopeChoices, null));
       DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy");
       lkg.setExpiryDate(LocalDate.now().plusDays(2L).format(formatter));
-      vendorLicenseManagerImpl.createLicenseKeyGroup(lkg, USER1).getId();
+      vendorLicenseManagerImpl.createLicenseKeyGroup(lkg).getId();
       Assert.fail();
     } catch (CoreException exception) {
       Assert.assertEquals(exception.code().id(), VendorLicenseErrorCodes.DATE_RANGE_INVALID);
@@ -270,12 +271,13 @@
       opScopeChoices.add(OperationalScope.CPU);
       opScopeChoices.add(OperationalScope.Network_Wide);
       LicenseKeyGroupEntity lkg =
-          createLicenseKeyGroup("vlm1Id", null, lkg1_id,LKG1_NAME, "LKG1 dec",LicenseKeyType.Unique,
+          createLicenseKeyGroup("vlm1Id", null, lkg1_id, LKG1_NAME, "LKG1 dec",
+              LicenseKeyType.Unique,
               new MultiChoiceOrOther<>(opScopeChoices, null));
       DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy");
       lkg.setStartDate(LocalDate.now().plusDays(2L).format(formatter));
       lkg.setExpiryDate(LocalDate.now().plusDays(2L).format(formatter));
-      vendorLicenseManagerImpl.createLicenseKeyGroup(lkg, USER1).getId();
+      vendorLicenseManagerImpl.createLicenseKeyGroup(lkg).getId();
       Assert.fail();
     } catch (CoreException exception) {
       Assert.assertEquals(exception.code().id(), VendorLicenseErrorCodes.DATE_RANGE_INVALID);
@@ -290,19 +292,14 @@
     opScopeChoices.add(OperationalScope.CPU);
     opScopeChoices.add(OperationalScope.Network_Wide);
     LicenseKeyGroupEntity lkg =
-        createLicenseKeyGroup(vlm1_id, null,lkg1_id, LKG1_NAME, "LKG1 dec",LicenseKeyType.Unique,
+        createLicenseKeyGroup(vlm1_id, null, lkg1_id, LKG1_NAME, "LKG1 dec", LicenseKeyType.Unique,
             new MultiChoiceOrOther<>(opScopeChoices, null));
     DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy");
     lkg.setStartDate(LocalDate.now().minusDays(3L).format(formatter));
     lkg.setExpiryDate(LocalDate.now().minusDays(2L).format(formatter));
-    VersionInfo info = new VersionInfo();
-    info.getViewableVersions().add(VERSION01);
-    info.setActiveVersion(VERSION01);
-    doReturn(info).when(vendorLicenseFacade).getVersionInfo(anyObject(),anyObject(),anyObject());
 
-    vendorLicenseManagerImpl.updateLicenseKeyGroup(lkg, USER1);
-    verify(vendorLicenseFacade).updateLicenseKeyGroup(lkg,USER1);
-    verify(vendorLicenseFacade).updateVlmLastModificationTime(vlm1_id,VERSION01);
+    vendorLicenseManagerImpl.updateLicenseKeyGroup(lkg);
+    verify(vendorLicenseFacade).updateLicenseKeyGroup(lkg);
   }
 
   @Test
@@ -315,12 +312,13 @@
       opScopeChoices.add(OperationalScope.CPU);
       opScopeChoices.add(OperationalScope.Network_Wide);
       LicenseKeyGroupEntity lkg =
-          createLicenseKeyGroup("vlm1Id", null, lkg1_id,LKG1_NAME, "LKG1 dec",LicenseKeyType.Unique,
+          createLicenseKeyGroup("vlm1Id", null, lkg1_id, LKG1_NAME, "LKG1 dec",
+              LicenseKeyType.Unique,
               new MultiChoiceOrOther<>(opScopeChoices, null));
       DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy");
       lkg.setStartDate(LocalDate.now().format(formatter));
       lkg.setExpiryDate(LocalDate.now().minusDays(2L).format(formatter));
-      vendorLicenseManagerImpl.updateLicenseKeyGroup(lkg, USER1);
+      vendorLicenseManagerImpl.updateLicenseKeyGroup(lkg);
       Assert.fail();
     } catch (CoreException exception) {
       Assert.assertEquals(exception.code().id(), VendorLicenseErrorCodes.DATE_RANGE_INVALID);
@@ -337,11 +335,12 @@
       opScopeChoices.add(OperationalScope.CPU);
       opScopeChoices.add(OperationalScope.Network_Wide);
       LicenseKeyGroupEntity lkg =
-          createLicenseKeyGroup("vlm1Id", null, lkg1_id,LKG1_NAME, "LKG1 dec",LicenseKeyType.Unique,
+          createLicenseKeyGroup("vlm1Id", null, lkg1_id, LKG1_NAME, "LKG1 dec",
+              LicenseKeyType.Unique,
               new MultiChoiceOrOther<>(opScopeChoices, null));
       DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy");
       lkg.setExpiryDate(LocalDate.now().plusDays(2L).format(formatter));
-      vendorLicenseManagerImpl.updateLicenseKeyGroup(lkg, USER1);
+      vendorLicenseManagerImpl.updateLicenseKeyGroup(lkg);
       Assert.fail();
     } catch (CoreException exception) {
       Assert.assertEquals(exception.code().id(), VendorLicenseErrorCodes.DATE_RANGE_INVALID);
@@ -358,12 +357,13 @@
       opScopeChoices.add(OperationalScope.CPU);
       opScopeChoices.add(OperationalScope.Network_Wide);
       LicenseKeyGroupEntity lkg =
-          createLicenseKeyGroup("vlm1Id", null,lkg1_id, LKG1_NAME, "LKG1 dec",LicenseKeyType.Unique,
+          createLicenseKeyGroup("vlm1Id", null, lkg1_id, LKG1_NAME, "LKG1 dec",
+              LicenseKeyType.Unique,
               new MultiChoiceOrOther<>(opScopeChoices, null));
       DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy");
       lkg.setStartDate(LocalDate.now().format(formatter));
       lkg.setExpiryDate(LocalDate.now().format(formatter));
-      vendorLicenseManagerImpl.updateLicenseKeyGroup(lkg, USER1);
+      vendorLicenseManagerImpl.updateLicenseKeyGroup(lkg);
       Assert.fail();
     } catch (CoreException exception) {
       Assert.assertEquals(exception.code().id(), VendorLicenseErrorCodes.DATE_RANGE_INVALID);
@@ -371,9 +371,10 @@
   }
 
   @Test
-  public void testListlistLicenseKeyGroups(){
+  public void testListlistLicenseKeyGroups() {
 
-    MultiChoiceOrOther<OperationalScope> multiChoiceOrOther = new MultiChoiceOrOther<OperationalScope>();
+    MultiChoiceOrOther<OperationalScope> multiChoiceOrOther =
+        new MultiChoiceOrOther<OperationalScope>();
     Set<OperationalScope> opScopeChoices = new HashSet<>();
     opScopeChoices.add(OperationalScope.Core);
     opScopeChoices.add(OperationalScope.CPU);
@@ -382,34 +383,25 @@
     multiChoiceOrOther.setOther("Other");
 
     doReturn(Arrays.asList(
-        createLicenseKeyGroup(vlm1_id,VERSION01, lkg1_id, LKG1_NAME,"LKG1 dec", LicenseKeyType.Universal,
+        createLicenseKeyGroup(vlm1_id, VERSION01, lkg1_id, LKG1_NAME, "LKG1 dec",
+            LicenseKeyType.Universal,
             multiChoiceOrOther),
-        createLicenseKeyGroup(vlm1_id,VERSION01, lkg2_id, LKG2_NAME,"LKG2 dec", LicenseKeyType
+        createLicenseKeyGroup(vlm1_id, VERSION01, lkg2_id, LKG2_NAME, "LKG2 dec", LicenseKeyType
             .Universal, multiChoiceOrOther)))
-        .when(vendorLicenseFacade).listLicenseKeyGroups(vlm1_id, VERSION01, USER1);
+        .when(vendorLicenseFacade).listLicenseKeyGroups(vlm1_id, VERSION01);
 
     Collection<LicenseKeyGroupEntity> LKGs =
-        vendorLicenseManagerImpl.listLicenseKeyGroups(vlm1_id, VERSION01, USER1);
+        vendorLicenseManagerImpl.listLicenseKeyGroups(vlm1_id, VERSION01);
 
-    verify(vendorLicenseFacade).listLicenseKeyGroups(vlm1_id, VERSION01, USER1);
+    verify(vendorLicenseFacade).listLicenseKeyGroups(vlm1_id, VERSION01);
     Assert.assertEquals(LKGs.size(), 2);
     LKGs.forEach(lkg -> Assert.assertTrue(lkg.getId().matches(lkg1_id + "|" + lkg2_id)));
   }
 
   @Test
-  public void testGetLicenseKeyGroup(){
-    VersionInfo versionInfo = new VersionInfo();
-    versionInfo.setActiveVersion(VERSION01);
-    versionInfo.setLockingUser(USER1);
-    ArrayList<Version> viewable = new ArrayList<Version>();
-    viewable.add(VERSION01);
-    versionInfo.setViewableVersions(viewable);
-    versionInfo.setActiveVersion(VERSION01);
-
-    doReturn(versionInfo).when(vendorLicenseManagerImpl).getVersionInfo(vlm1_id,
-        VersionableEntityAction.Read, USER1);
-
-    MultiChoiceOrOther<OperationalScope> multiChoiceOrOther = new MultiChoiceOrOther<OperationalScope>();
+  public void testGetLicenseKeyGroup() {
+    MultiChoiceOrOther<OperationalScope> multiChoiceOrOther =
+        new MultiChoiceOrOther<OperationalScope>();
     Set<OperationalScope> opScopeChoices = new HashSet<>();
     opScopeChoices.add(OperationalScope.Core);
     opScopeChoices.add(OperationalScope.CPU);
@@ -417,35 +409,24 @@
     multiChoiceOrOther.setChoices(opScopeChoices);
     multiChoiceOrOther.setOther("Other");
 
-    LicenseKeyGroupEntity lkg = createLicenseKeyGroup(vlm1_id,VERSION01, lkg1_id, LKG1_NAME,
+    LicenseKeyGroupEntity lkg = createLicenseKeyGroup(vlm1_id, VERSION01, lkg1_id, LKG1_NAME,
         "LKG1 dec", LicenseKeyType.Universal, multiChoiceOrOther);
 
     doReturn(lkg).when(licenseKeyGroupDao).get(anyObject());
 
-    LicenseKeyGroupEntity lkgRetrived = vendorLicenseManagerImpl.getLicenseKeyGroup(lkg,USER1);
+    LicenseKeyGroupEntity lkgRetrived = vendorLicenseManagerImpl.getLicenseKeyGroup(lkg);
     verify(licenseKeyGroupDao).get(lkg);
 
-    Assert.assertEquals(lkgRetrived.getId(),lkg.getId());
-    Assert.assertEquals(lkgRetrived.getVendorLicenseModelId(),lkg.getVendorLicenseModelId());
-    Assert.assertEquals(lkgRetrived.getVersion(),lkg.getVersion());
+    Assert.assertEquals(lkgRetrived.getId(), lkg.getId());
+    Assert.assertEquals(lkgRetrived.getVendorLicenseModelId(), lkg.getVendorLicenseModelId());
+    Assert.assertEquals(lkgRetrived.getVersion(), lkg.getVersion());
 
   }
 
   @Test
   public void testDeleteLicenseKeyGroup() {
-
-    VersionInfo versionInfo = new VersionInfo();
-    versionInfo.setActiveVersion(VERSION01);
-    versionInfo.setLockingUser(USER1);
-    ArrayList<Version> viewable = new ArrayList<Version>();
-    viewable.add(VERSION01);
-    versionInfo.setViewableVersions(viewable);
-
-    doReturn(versionInfo).when(vendorLicenseManagerImpl).getVersionInfo(vlm1_id,
-        VersionableEntityAction.Write, USER1);
-
-
-    MultiChoiceOrOther<OperationalScope> multiChoiceOrOther = new MultiChoiceOrOther<OperationalScope>();
+    MultiChoiceOrOther<OperationalScope> multiChoiceOrOther =
+        new MultiChoiceOrOther<OperationalScope>();
     Set<OperationalScope> opScopeChoices = new HashSet<>();
     opScopeChoices.add(OperationalScope.Core);
     opScopeChoices.add(OperationalScope.CPU);
@@ -453,26 +434,26 @@
     multiChoiceOrOther.setChoices(opScopeChoices);
     multiChoiceOrOther.setOther("Other");
 
-    LicenseKeyGroupEntity lkg = createLicenseKeyGroup(vlm1_id,VERSION01, lkg1_id, LKG1_NAME,
+    LicenseKeyGroupEntity lkg = createLicenseKeyGroup(vlm1_id, VERSION01, lkg1_id, LKG1_NAME,
         "LKG1 dec", LicenseKeyType.Universal, multiChoiceOrOther);
 
     lkg.setReferencingFeatureGroups(new HashSet<>());
 
     doReturn(lkg).when(licenseKeyGroupDao).get(anyObject());
 
-    doNothing().when(vendorLicenseManagerImpl).deleteChildLimits(vlm1_id,VERSION01,lkg1_id,USER1);
+    doNothing().when(vendorLicenseManagerImpl).deleteChildLimits(vlm1_id, VERSION01, lkg1_id);
 
-    doNothing().when(vendorLicenseManagerImpl).deleteUniqueName(anyObject(),anyObject(),
-        anyObject(),anyObject());
+    doNothing().when(vendorLicenseManagerImpl).deleteUniqueName(anyObject(), anyObject(),
+        anyObject(), anyObject());
 
-    vendorLicenseManagerImpl.deleteLicenseKeyGroup(lkg, USER1);
+    vendorLicenseManagerImpl.deleteLicenseKeyGroup(lkg);
 
     verify(licenseKeyGroupDao).delete(lkg);
-    verify(vendorLicenseFacade).updateVlmLastModificationTime(vlm1_id,VERSION01);
 
   }
 
-  public static LicenseKeyGroupEntity createLicenseKeyGroup(String vlmId, Version version,String id,
+  public static LicenseKeyGroupEntity createLicenseKeyGroup(String vlmId, Version version,
+                                                            String id,
                                                             String name, String desc,
                                                             LicenseKeyType type,
                                                             MultiChoiceOrOther<OperationalScope> operationalScope) {
@@ -525,7 +506,7 @@
 
     vlm1Id = vendorLicenseManager.createVendorLicenseModel(VendorLicenseModelTest
         .createVendorLicenseModel("vendor1 name " + CommonMethods.nextUuId(), "vlm1Id dec",
-            "icon1"), USER1).getId();
+            "icon1")1).getId();
     vlm2Id = vendorLicenseManager.createVendorLicenseModel(VendorLicenseModelTest
             .createVendorLicenseModel("vendor2 name " + CommonMethods.nextUuId(), "vlm2 dec", "icon2"),
         USER1).getId();
@@ -545,7 +526,7 @@
     LicenseKeyGroupEntity
         lkg1 = createLicenseKeyGroup(vlmId, VERSION01, name, "LKG1 dec", LicenseKeyType.One_Time,
         new MultiChoiceOrOther<>(opScopeChoices, null));
-    String lkg1Id = vendorLicenseManager.createLicenseKeyGroup(lkg1, USER1).getId();
+    String lkg1Id = vendorLicenseManager.createLicenseKeyGroup(lkg11).getId();
     lkg1.setId(lkg1Id);
 
     LicenseKeyGroupEntity loadedLkg1 = licenseKeyGroupDao.get(lkg1);
@@ -560,7 +541,7 @@
           createLicenseKeyGroup(vlm1Id, VERSION01, LKG1_NAME, "LKG1 dec", LicenseKeyType.One_Time,
               new MultiChoiceOrOther<>(Collections.singleton(OperationalScope.Other),
                   "other op scope"));
-      vendorLicenseManager.createLicenseKeyGroup(lkg1, USER1).getId();
+      vendorLicenseManager.createLicenseKeyGroup(lkg11).getId();
       Assert.fail();
     } catch (CoreException exception) {
       Assert.assertEquals(exception.code().id(), UniqueValueUtil.UNIQUE_VALUE_VIOLATION);
@@ -581,9 +562,9 @@
     lkg1.setOperationalScope(new MultiChoiceOrOther<>(opScopeChoices, "op scope1 updated"));
     lkg1.setDescription("LKG1 dec updated");
 
-    vendorLicenseManager.updateLicenseKeyGroup(lkg1, USER1);
+    vendorLicenseManager.updateLicenseKeyGroup(lkg11);
 
-    LicenseKeyGroupEntity loadedLkg1 = vendorLicenseManager.getLicenseKeyGroup(lkg1, USER1);
+    LicenseKeyGroupEntity loadedLkg1 = vendorLicenseManager.getLicenseKeyGroup(lkg11);
     Assert.assertTrue(loadedLkg1.equals(lkg1));
 
   }
@@ -595,11 +576,11 @@
     LicenseKeyGroupEntity lkg2 =
         createLicenseKeyGroup(vlm1Id, VERSION01, "LKG2", "LKG2 dec", LicenseKeyType.Universal,
             new MultiChoiceOrOther<>(opScopeChoices, null));
-    lkg2Id = vendorLicenseManager.createLicenseKeyGroup(lkg2, USER1).getId();
+    lkg2Id = vendorLicenseManager.createLicenseKeyGroup(lkg21).getId();
     lkg2.setId(lkg2Id);
 
     Collection<LicenseKeyGroupEntity> loadedLkgs =
-        vendorLicenseManager.listLicenseKeyGroups(vlm1Id, null, USER1);
+        vendorLicenseManager.listLicenseKeyGroups(vlm1Id, null1);
     Assert.assertEquals(loadedLkgs.size(), 2);
     for (LicenseKeyGroupEntity loadedLkg : loadedLkgs) {
       if (lkg2Id.equals(loadedLkg.getId())) {
@@ -611,7 +592,7 @@
   @Test(dependsOnMethods = {"listTest"})
   public void deleteTest() {
     vendorLicenseManager
-        .deleteLicenseKeyGroup(new LicenseKeyGroupEntity(vlm1Id, VERSION01, lkg1Id), USER1);
+        .deleteLicenseKeyGroup(new LicenseKeyGroupEntity(vlm1Id, VERSION01, lkg1Id)1);
 
     LicenseKeyGroupEntity loadedLkg1 =
         licenseKeyGroupDao.get(new LicenseKeyGroupEntity(vlm1Id, VERSION01, lkg1Id));
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/impl/VendorLicenseModelTest.java b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/impl/VendorLicenseModelTest.java
index 195fa5d..d1df147 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/impl/VendorLicenseModelTest.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/impl/VendorLicenseModelTest.java
@@ -1,12 +1,12 @@
 package org.openecomp.sdc.vendorlicense.impl;
 
-import org.junit.rules.ExpectedException;
-import org.openecomp.core.util.UniqueValueUtil;
-import org.openecomp.sdc.activityLog.ActivityLogManager;
+import org.mockito.ArgumentCaptor;
+import org.mockito.Captor;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.mockito.Spy;
 import org.openecomp.sdc.activitylog.dao.type.ActivityLogEntity;
-import org.openecomp.sdc.common.errors.CoreException;
-import org.openecomp.sdc.common.errors.ErrorCategory;
-import org.openecomp.sdc.common.errors.ErrorCode;
 import org.openecomp.sdc.vendorlicense.VendorLicenseConstants;
 import org.openecomp.sdc.vendorlicense.dao.EntitlementPoolDao;
 import org.openecomp.sdc.vendorlicense.dao.FeatureGroupDao;
@@ -14,50 +14,17 @@
 import org.openecomp.sdc.vendorlicense.dao.LicenseKeyGroupDao;
 import org.openecomp.sdc.vendorlicense.dao.LimitDao;
 import org.openecomp.sdc.vendorlicense.dao.VendorLicenseModelDao;
-import org.openecomp.sdc.vendorlicense.dao.types.ChoiceOrOther;
-import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity;
-import org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity;
-import org.openecomp.sdc.vendorlicense.dao.types.LicenseTerm;
 import org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity;
 import org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacade;
-import org.openecomp.sdc.vendorlicense.types.VersionedVendorLicenseModel;
-import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
-import org.openecomp.sdc.vendorsoftwareproduct.types.VersionedVendorSoftwareProductInfo;
 import org.openecomp.sdc.versioning.VersioningManager;
-import org.openecomp.sdc.versioning.VersioningUtil;
 import org.openecomp.sdc.versioning.dao.types.Version;
-import org.openecomp.sdc.versioning.dao.types.VersionStatus;
-import org.openecomp.sdc.versioning.types.VersionInfo;
-import org.openecomp.sdc.versioning.types.VersionableEntityAction;
-import org.testng.annotations.BeforeMethod;
-import org.mockito.ArgumentCaptor;
-import org.mockito.Captor;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-import org.mockito.Spy;
-import org.testng.Assert;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
 import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyObject;
-import static org.mockito.Matchers.eq;
 import static org.mockito.Mockito.doNothing;
 import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.doThrow;
 import static org.mockito.Mockito.verify;
-import static org.openecomp.sdc.vendorlicense.VendorLicenseConstants.VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE;
 
 
 /**
@@ -93,9 +60,6 @@
   private LicenseKeyGroupDao licenseKeyGroupDaoMcok;
   @Mock
   private LimitDao limitDaoMcok;
-  @Mock
-  private ActivityLogManager activityLogManagerMcok;
-
 
   @Spy
   @InjectMocks
@@ -112,159 +76,19 @@
   }
 
   @Test
-  public void testCheckout() {
-
-    doReturn(VERSION01).when(versioningManagerMcok)
-        .checkout(VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE, vlm1_id, USER1);
-
-    vendorLicenseManager.checkout(vlm1_id, USER1);
-
-    Assert.assertEquals(VERSION01.getStatus(), VersionStatus.Locked);
-    verify(vendorLicenseFacadeMcok).updateVlmLastModificationTime(vlm1_id, VERSION01);
-
-    verify(versioningManagerMcok)
-        .checkout(VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE, vlm1_id, USER1);
-
-    verify(activityLogManagerMcok).addActionLog(activityLogEntityArg.capture(), eq(USER1));
-    ActivityLogEntity activityLogEntity = activityLogEntityArg.getValue();
-    Assert.assertEquals(activityLogEntity.getVersionId(), String.valueOf(VERSION01.getMajor() + 1));
-    Assert.assertTrue(activityLogEntity.isSuccess());
-  }
-
-  @Test
-  public void testUndoCheckout() {
-    Version existingVersion = new Version(0, 2);
-    doReturn(existingVersion).when(versioningManagerMcok).undoCheckout(
-        VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE, vlm1_id, USER1);
-
-    vendorLicenseManager.undoCheckout(vlm1_id, USER1);
-
-    verify(vendorLicenseFacadeMcok).updateVlmLastModificationTime(vlm1_id, existingVersion);
-  }
-
-  @Test
-  public void testCheckin() {
-
-    doReturn(VERSION10).when(vendorLicenseFacadeMcok).checkin(vlm1_id, USER1);
-
-    vendorLicenseManager.checkin(vlm1_id, USER1);
-    verify(activityLogManagerMcok).addActionLog(activityLogEntityArg.capture(), eq(USER1));
-    ActivityLogEntity activityLogEntity = activityLogEntityArg.getValue();
-    Assert.assertEquals(activityLogEntity.getVersionId(), String.valueOf(VERSION10.getMajor() + 1));
-    verify(vendorLicenseFacadeMcok).checkin(vlm1_id, USER1);
-
-  }
-
-  @Test
-  public void testSubmit() {
-
-    doReturn(VERSION10).when(vendorLicenseFacadeMcok).submit(vlm1_id, USER1);
-
-    vendorLicenseManager.submit(vlm1_id, USER1);
-    verify(activityLogManagerMcok).addActionLog(activityLogEntityArg.capture(), eq(USER1));
-    ActivityLogEntity activityLogEntity = activityLogEntityArg.getValue();
-    Assert.assertEquals(activityLogEntity.getVersionId(), String.valueOf(VERSION10.getMajor()));
-    verify(vendorLicenseFacadeMcok).submit(vlm1_id, USER1);
-
-  }
-
-  @Test
-  public void testListWhenNone() {
-    doReturn(new HashMap<>()).when(versioningManagerMcok).listEntitiesVersionInfo
-        (VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE, USER1, VersionableEntityAction.Read);
-    Collection<VersionedVendorLicenseModel> vlms = vendorLicenseManager.listVendorLicenseModels
-        (null, USER1);
-    Assert.assertEquals(vlms.size(), 0);
-  }
-
-  @Test
-  public void testList() {
-
-    Map<String, VersionInfo> vlmsTobeReturned = new HashMap<>();
-
-    VersionInfo versionInfo1 = new VersionInfo();
-    versionInfo1.setActiveVersion(VERSION01);
-    vlmsTobeReturned.put(vlm1_id, versionInfo1);
-
-    VersionInfo versionInfo2 = new VersionInfo();
-    versionInfo2.setActiveVersion(VERSION10);
-    vlmsTobeReturned.put(vlm2_id, versionInfo2);
-
-    doReturn(vlmsTobeReturned).when(versioningManagerMcok).listEntitiesVersionInfo
-        (VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE, USER1, VersionableEntityAction.Read);
-
-    VendorLicenseModelEntity vlm1 = new VendorLicenseModelEntity(vlm1_id, VERSION01);
-    vlm1.setWritetimeMicroSeconds(8L);
-    doReturn(vlm1).when(vendorLicenseModelDaoMcok).get(any(VendorLicenseModelEntity.class));
-
-    Collection<VersionedVendorLicenseModel> vlms = vendorLicenseManager.listVendorLicenseModels
-        (null, USER1);
-    Assert.assertEquals(vlms.size(), 2);
-  }
-
-  @Test
-  public void testListFinalsWhenNone() {
-
-    Map<String, VersionInfo> vspsTobeReturned = new HashMap<>();
-
-    VersionInfo versionInfo1 = new VersionInfo();
-    versionInfo1.setActiveVersion(VERSION01);
-    vspsTobeReturned.put(vlm1_id, versionInfo1);
-
-    VersionInfo versionInfo2 = new VersionInfo();
-    versionInfo2.setActiveVersion(VERSION10);
-    vspsTobeReturned.put(vlm2_id, versionInfo2);
-
-    doReturn(vspsTobeReturned).when(versioningManagerMcok).listEntitiesVersionInfo
-        (VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE, USER1, VersionableEntityAction.Read);
-
-    Collection<VersionedVendorLicenseModel> vlms = vendorLicenseManager.listVendorLicenseModels
-        (VersionStatus.Final.name(), USER1);
-    Assert.assertEquals(vlms.size(), 0);
-  }
-
-  @Test
-  public void testListFinals() {
-    Map<String, VersionInfo> vlmsTobeReturned = new HashMap<>();
-
-    VersionInfo versionInfo1 = new VersionInfo();
-    versionInfo1.setActiveVersion(VERSION01);
-    vlmsTobeReturned.put(vlm1_id, versionInfo1);
-
-    VersionInfo versionInfo2 = new VersionInfo();
-
-    versionInfo2.setActiveVersion(new Version(1, 3));
-    versionInfo2.setLatestFinalVersion(VERSION10);
-    vlmsTobeReturned.put(vlm2_id, versionInfo2);
-
-    doReturn(vlmsTobeReturned).when(versioningManagerMcok).listEntitiesVersionInfo
-        (VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE, USER1, VersionableEntityAction.Read);
-
-    VendorLicenseModelEntity vlm1 = new VendorLicenseModelEntity(vlm1_id, VERSION01);
-    vlm1.setWritetimeMicroSeconds(8L);
-    doReturn(vlm1).when(vendorLicenseModelDaoMcok).get(any(VendorLicenseModelEntity.class));
-
-    Collection<VersionedVendorLicenseModel> vlms = vendorLicenseManager.listVendorLicenseModels
-        (VersionStatus.Final.name(), USER1);
-
-    Assert.assertEquals(vlms.size(), 1);
+  public void testValidate() {
+    // TODO: 8/13/2017
+    vendorLicenseManager.validate(vlm1_id, null);
+    verify(vendorLicenseFacadeMcok).validate(vlm1_id, null);
   }
 
   @Test
   public void testCreate() {
-
     VendorLicenseModelEntity vlmEntity = new VendorLicenseModelEntity(vlm1_id, VERSION01);
 
-    doReturn(vlmEntity).when(vendorLicenseFacadeMcok).createVendorLicenseModel(vlmEntity, USER1);
+    vendorLicenseManager.createVendorLicenseModel(vlmEntity);
 
-    vendorLicenseManager.createVendorLicenseModel(vlmEntity, USER1);
-
-    verify(vendorLicenseFacadeMcok).createVendorLicenseModel(vlmEntity, USER1);
-    verify(activityLogManagerMcok).addActionLog(activityLogEntityArg.capture(), eq(USER1));
-    ActivityLogEntity activityLogEntity = activityLogEntityArg.getValue();
-    Assert.assertEquals(activityLogEntity.getVersionId(), String.valueOf(VERSION01.getMajor() + 1));
-    Assert.assertTrue(activityLogEntity.isSuccess());
-
+    verify(vendorLicenseModelDaoMcok).create(vlmEntity);
   }
 
   @Test
@@ -277,14 +101,6 @@
     existingVlm.setVendorName("VLM1");
     existingVlm.setDescription("decription");
 
-    VersionInfo versionInfo = new VersionInfo();
-    versionInfo.setActiveVersion(VERSION01);
-
-    doReturn(versionInfo).when(vendorLicenseManager).getVersionInfo(existingVlm.getId(),
-        VersionableEntityAction.Write, USER1);
-
-    doReturn(VERSION01).when(vendorLicenseManager).resloveVersion(vlm1_id,null, versionInfo, USER1);
-
     doReturn("VLM1").when(vendorLicenseModelDaoMcok).get(existingVlm);
 
     VendorLicenseModelEntity updatedVlm = new VendorLicenseModelEntity();
@@ -302,21 +118,20 @@
 
     doReturn(existingVlm).when(vendorLicenseModelDaoMcok).get(any(VendorLicenseModelEntity.class));
 
-    vendorLicenseManager.updateVendorLicenseModel(updatedVlm, USER1);
+    vendorLicenseManager.updateVendorLicenseModel(updatedVlm);
 
     verify(vendorLicenseModelDaoMcok).update(updatedVlm);
-    verify(vendorLicenseFacadeMcok).updateVlmLastModificationTime(vlm1_id, VERSION01);
   }
 
   @Test
-  public void testGetVendorLicenseModel(){
-    vendorLicenseManager.getVendorLicenseModel(vlm1_id,VERSION01,USER1);
-    verify(vendorLicenseFacadeMcok).getVendorLicenseModel(vlm1_id,VERSION01,USER1);
+  public void testGetVendorLicenseModel() {
+    vendorLicenseManager.getVendorLicenseModel(vlm1_id, VERSION01);
+    verify(vendorLicenseFacadeMcok).getVendorLicenseModel(vlm1_id, VERSION01);
   }
 
   @Test(expectedExceptions = UnsupportedOperationException.class)
   public void testDeleteVLMUnsupportedOperation() {
-    vendorLicenseManager.deleteVendorLicenseModel(vlm1_id, USER1);
+    vendorLicenseManager.deleteVendorLicenseModel(vlm1_id, null); // TODO: 8/13/2017
   }
 
 
@@ -324,7 +139,7 @@
 //  public void testGetNonExistingVersion_negative() {
 //    Version notExistversion = new Version(43, 8);
 //    doReturn(null).when(vspInfoDaoMock).get(any(VspDetails.class));
-//    vendorSoftwareProductManager.getVsp(VSP_ID, notExistversion, USER1);
+//    vendorSoftwareProductManager.getVsp(VSP_ID, notExistversion);
 //  }
 
 }
\ No newline at end of file
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/VendorLicenseArtifactsServiceTest.java b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/VendorLicenseArtifactsServiceTest.java
index ec50c96..c20d96a 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/VendorLicenseArtifactsServiceTest.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/VendorLicenseArtifactsServiceTest.java
@@ -20,22 +20,8 @@
 
 package org.openecomp.sdc.vendorlicense.licenseartifacts.impl;
 
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang3.StringUtils;
 import org.openecomp.core.utilities.file.FileContentHandler;
 import org.openecomp.sdc.vendorlicense.ArtifactTestUtils;
-import org.openecomp.sdc.vendorlicense.VendorLicenseConstants;
-import org.openecomp.sdc.vendorlicense.dao.types.EntitlementMetric;
-import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity;
-import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity;
-import org.openecomp.sdc.vendorlicense.dao.types.OperationalScope;
-import org.openecomp.sdc.versioning.dao.types.Version;
-import org.testng.Assert;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
-
-import java.io.IOException;
-import java.nio.charset.StandardCharsets;
 
 
 public class VendorLicenseArtifactsServiceTest extends ArtifactTestUtils {
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/ComponentDependencyModelManager.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/ComponentDependencyModelManager.java
index a651b0b..869628e 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/ComponentDependencyModelManager.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/ComponentDependencyModelManager.java
@@ -4,12 +4,17 @@
 import org.openecomp.sdc.versioning.dao.types.Version;
 
 import java.util.Collection;
-import java.util.List;
 
 public interface ComponentDependencyModelManager {
 
-  void createComponentDependencyModel(List<ComponentDependencyModelEntity> entities, String
-      vspId, Version version, String user);
+  Collection<ComponentDependencyModelEntity> list(String vspId, Version version);
 
-  Collection<ComponentDependencyModelEntity> list(String vspId, Version version, String user);
+  ComponentDependencyModelEntity createComponentDependency(ComponentDependencyModelEntity entity,
+                                                           String vspId, Version version);
+
+  void delete(String vspId, Version version, String dependencyId);
+
+  void update(ComponentDependencyModelEntity entity);
+
+  ComponentDependencyModelEntity get(String vspId, Version version, String dependencyId);
 }
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/ComponentManager.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/ComponentManager.java
index b895f55..4135298 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/ComponentManager.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/ComponentManager.java
@@ -31,24 +31,23 @@
 
 public interface ComponentManager {
 
-  Collection<ComponentEntity> listComponents(String vspId, Version version, String user);
+  Collection<ComponentEntity> listComponents(String vspId, Version version);
 
-  void deleteComponents(String vspId, Version version, String user);
+  void deleteComponents(String vspId, Version version);
 
-  ComponentEntity createComponent(ComponentEntity componentEntity, String user);
+  ComponentEntity createComponent(ComponentEntity componentEntity);
 
-  CompositionEntityValidationData updateComponent(ComponentEntity componentEntity, String user);
+  CompositionEntityValidationData updateComponent(ComponentEntity componentEntity);
 
   CompositionEntityResponse<ComponentData> getComponent(String vspId, Version version,
-                                                        String componentId, String user);
+                                                        String componentId);
 
-  void deleteComponent(String vspId, Version version, String componentId, String user);
+  void deleteComponent(String vspId, Version version, String componentId);
 
-  QuestionnaireResponse getQuestionnaire(String vspId, Version version, String componentId,
-                                         String user);
+  QuestionnaireResponse getQuestionnaire(String vspId, Version version, String componentId);
 
   void updateQuestionnaire(String vspId, Version version, String componentId,
-                           String questionnaireData, String user);
+                           String questionnaireData);
 
-  void validateComponentExistence(String vspId, Version version, String componentId, String user);
+  void validateComponentExistence(String vspId, Version version, String componentId);
 }
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/ComputeManager.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/ComputeManager.java
index 65bceb9..7ddd4e2 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/ComputeManager.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/ComputeManager.java
@@ -12,23 +12,20 @@
 
 public interface ComputeManager {
 
-  Collection<ListComputeResponse> listCompute(String vspId, Version version, String
-      componentId, String user);
+  Collection<ListComputeResponse> listComputes(String vspId, Version version, String componentId);
 
-  ComputeEntity createCompute(ComputeEntity compute, String user);
+  ComputeEntity createCompute(ComputeEntity compute);
 
-  CompositionEntityResponse<ComputeData> getCompute(String vspId, Version version, String
-      componentId, String computeFlavorId, String user);
+  CompositionEntityResponse<ComputeData> getCompute(String vspId, Version version,
+                                                    String componentId, String computeFlavorId);
 
-  QuestionnaireResponse getComputeQuestionnaire(String vspId, Version version, String
-      componentId, String computeFlavorId, String user);
+  QuestionnaireResponse getComputeQuestionnaire(String vspId, Version version, String componentId,
+                                                String computeFlavorId);
 
-  void updateComputeQuestionnaire(String vspId, Version version, String componentId, String
-      computeId, String
-      questionnaireData, String user);
+  void updateComputeQuestionnaire(String vspId, Version version, String componentId,
+                                  String computeId, String questionnaireData);
 
-  CompositionEntityValidationData updateCompute(ComputeEntity compute, String user);
+  CompositionEntityValidationData updateCompute(ComputeEntity compute);
 
-  void deleteCompute(String vspId, Version version,String componentId, String computeFlavorId,
-                     String user);
+  void deleteCompute(String vspId, Version version, String componentId, String computeFlavorId);
 }
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/DeploymentFlavorManager.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/DeploymentFlavorManager.java
index 51ba2f4..88d399a 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/DeploymentFlavorManager.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/DeploymentFlavorManager.java
@@ -12,23 +12,19 @@
 public interface DeploymentFlavorManager {
 
 
-  DeploymentFlavorEntity createDeploymentFlavor(DeploymentFlavorEntity deploymentFlavorEntity,
-                                                String user);
+  DeploymentFlavorEntity createDeploymentFlavor(DeploymentFlavorEntity deploymentFlavorEntity);
 
-  Collection<DeploymentFlavorEntity> listDeploymentFlavors(String vspId, Version version,
-                                                           String user);
+  Collection<DeploymentFlavorEntity> listDeploymentFlavors(String vspId, Version version);
 
   CompositionEntityResponse<DeploymentFlavor> getDeploymentFlavor(String vspId, Version version,
-                                                                  String deploymentFlavorId,
-                                                                  String user);
+                                                                  String deploymentFlavorId);
 
-  CompositionEntityResponse<DeploymentFlavor> getDeploymentFlavorSchema(String vspId, Version
-      version, String user);
+  CompositionEntityResponse<DeploymentFlavor> getDeploymentFlavorSchema(String vspId,
+                                                                        Version version);
 
-  void deleteDeploymentFlavor(String vspId, Version version, String deploymentFlavorId, String
-      user);
+  void deleteDeploymentFlavor(String vspId, Version version, String deploymentFlavorId);
 
-  CompositionEntityValidationData updateDeploymentFlavor(DeploymentFlavorEntity
-                                                             deploymentFlavorEntity, String user);
+  CompositionEntityValidationData updateDeploymentFlavor(
+      DeploymentFlavorEntity deploymentFlavorEntity);
 
 }
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/ImageManager.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/ImageManager.java
index 6bbfc0b..1a53221 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/ImageManager.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/ImageManager.java
@@ -10,24 +10,22 @@
 import java.util.Collection;
 
 public interface ImageManager {
-  ImageEntity createImage(ImageEntity imageEntity, String user);
+  ImageEntity createImage(ImageEntity imageEntity);
 
-  CompositionEntityResponse<Image> getImageSchema(String vspId, String user);
+  CompositionEntityResponse<Image> getImageSchema(String vspId);
 
-  Collection<ImageEntity> listImages(String vspId, Version version, String componentId,
-                                     String user);
+  Collection<ImageEntity> listImages(String vspId, Version version, String componentId);
 
   CompositionEntityResponse<Image> getImage(String vspId, Version version, String componentId,
-                                            String imageId, String user);
+                                            String imageId);
 
-  QuestionnaireResponse getImageQuestionnaire(String vspId, Version version, String
-      componentId, String imageId, String user);
+  QuestionnaireResponse getImageQuestionnaire(String vspId, Version version, String componentId,
+                                              String imageId);
 
-  void deleteImage(String vspId, Version version, String componentId, String imageId, String user);
+  void deleteImage(String vspId, Version version, String componentId, String imageId);
 
-  CompositionEntityValidationData updateImage(ImageEntity imageEntity, String user);
+  CompositionEntityValidationData updateImage(ImageEntity imageEntity);
 
   void updateImageQuestionnaire(String vspId, Version version, String componentId, String imageId,
-                                String
-      questionnaireData, String user);
+                                String questionnaireData);
 }
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/ManualVspToscaManager.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/ManualVspToscaManager.java
index c9a5206..621374a 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/ManualVspToscaManager.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/ManualVspToscaManager.java
@@ -6,7 +6,7 @@
 
 public interface ManualVspToscaManager {
 
-  public VspModelInfo gatherVspInformation(String vspId, Version version, String user);
+  VspModelInfo gatherVspInformation(String vspId, Version version);
 
-  public ToscaServiceModel generateToscaModel(VspModelInfo vspModelInfo);
+  ToscaServiceModel generateToscaModel(VspModelInfo vspModelInfo);
 }
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/MonitoringUploadsManager.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/MonitoringUploadsManager.java
index f5e34a0..36f0650 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/MonitoringUploadsManager.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/MonitoringUploadsManager.java
@@ -28,11 +28,10 @@
 
 public interface MonitoringUploadsManager {
   void delete(String vspId, Version version, String componentId,
-              MonitoringUploadType monitoringUploadType, String user);
+              MonitoringUploadType monitoringUploadType);
 
   void upload(InputStream object, String filename, String vspId, Version version,
-              String componentId, MonitoringUploadType monitoringUploadType, String user);
+              String componentId, MonitoringUploadType monitoringUploadType);
 
-  MonitoringUploadStatus listFilenames(String vspId, Version version, String componentId,
-                                       String user);
+  MonitoringUploadStatus listFilenames(String vspId, Version version, String componentId);
 }
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/NetworkManager.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/NetworkManager.java
index b647735..fa74069 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/NetworkManager.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/NetworkManager.java
@@ -29,14 +29,13 @@
 import java.util.Collection;
 
 public interface NetworkManager {
-  Collection<NetworkEntity> listNetworks(String vspId, Version version, String user);
+  Collection<NetworkEntity> listNetworks(String vspId, Version version);
 
-  NetworkEntity createNetwork(NetworkEntity network, String user);
+  NetworkEntity createNetwork(NetworkEntity network);
 
-  CompositionEntityValidationData updateNetwork(NetworkEntity networkEntity, String user);
+  CompositionEntityValidationData updateNetwork(NetworkEntity networkEntity);
 
-  CompositionEntityResponse<Network> getNetwork(String vspId, Version version, String networkId,
-                                                String user);
+  CompositionEntityResponse<Network> getNetwork(String vspId, Version version, String networkId);
 
-  void deleteNetwork(String vspId, Version version, String networkId, String user);
+  void deleteNetwork(String vspId, Version version, String networkId);
 }
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/NicManager.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/NicManager.java
index 466583e..b055d97 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/NicManager.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/NicManager.java
@@ -31,20 +31,20 @@
 
 public interface NicManager {
 
-  Collection<NicEntity> listNics(String vspId, Version version, String componentId, String user);
+  Collection<NicEntity> listNics(String vspId, Version version, String componentId);
 
-  NicEntity createNic(NicEntity nic, String user);
+  NicEntity createNic(NicEntity nic);
 
-  CompositionEntityValidationData updateNic(NicEntity nicEntity, String user);
+  CompositionEntityValidationData updateNic(NicEntity nicEntity);
 
   CompositionEntityResponse<Nic> getNic(String vspId, Version version, String componentId,
-                                        String nicId, String user);
+                                        String nicId);
 
-  void deleteNic(String vspId, Version version, String componentId, String nicId, String user);
+  void deleteNic(String vspId, Version version, String componentId, String nicId);
 
   QuestionnaireResponse getNicQuestionnaire(String vspId, Version version, String componentId,
-                                            String nicId, String user);
+                                            String nicId);
 
   void updateNicQuestionnaire(String vspId, Version version, String componentId, String nicId,
-                              String questionnaireData, String user);
+                              String questionnaireData);
 }
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/OrchestrationTemplateCandidateManager.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/OrchestrationTemplateCandidateManager.java
index e2ef861..84318db 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/OrchestrationTemplateCandidateManager.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/OrchestrationTemplateCandidateManager.java
@@ -21,6 +21,7 @@
 package org.openecomp.sdc.vendorsoftwareproduct;
 
 import org.apache.commons.lang3.tuple.Pair;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.OrchestrationTemplateCandidateData;
 import org.openecomp.sdc.vendorsoftwareproduct.types.OrchestrationTemplateActionResponse;
 import org.openecomp.sdc.vendorsoftwareproduct.types.UploadFileResponse;
 import org.openecomp.sdc.vendorsoftwareproduct.types.ValidationResponse;
@@ -33,14 +34,16 @@
 
 public interface OrchestrationTemplateCandidateManager {
   UploadFileResponse upload(String vspId, Version version, InputStream heatFileToUpload,
-                            String user, String filePrefix, String networkPackageName);
+                            String fileSuffix, String networkPackageName);
 
-  OrchestrationTemplateActionResponse process(String vspId, Version version, String user);
+  OrchestrationTemplateActionResponse process(String vspId, Version version);
 
-  Optional<FilesDataStructure> getFilesDataStructure(String vspId, Version version, String user);
+  Optional<FilesDataStructure> getFilesDataStructure(String vspId, Version version);
 
-  ValidationResponse updateFilesDataStructure(String vspId, Version version, String user,
+  ValidationResponse updateFilesDataStructure(String vspId, Version version,
                                               FilesDataStructure fileDataStructure);
 
-  Optional<Pair<String, byte[]>> get(String vspId, Version version, String user) throws IOException;
+  Optional<Pair<String, byte[]>> get(String vspId, Version version) throws IOException;
+
+  OrchestrationTemplateCandidateData getInfo(String vspId, Version version);
 }
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/ProcessManager.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/ProcessManager.java
index afe88d2..979eea0 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/ProcessManager.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/ProcessManager.java
@@ -28,27 +28,22 @@
 import java.util.Collection;
 
 public interface ProcessManager {
-  Collection<ProcessEntity> listProcesses(String vspId, Version version, String componentId,
-                                          String user);
+  Collection<ProcessEntity> listProcesses(String vspId, Version version, String componentId);
 
-  void deleteProcesses(String vspId, Version version, String componentId, String user);
+  void deleteProcesses(String vspId, Version version, String componentId);
 
-  ProcessEntity createProcess(ProcessEntity processEntity, String user);
+  ProcessEntity createProcess(ProcessEntity processEntity);
 
-  ProcessEntity getProcess(String vspId, Version version, String componentId, String processId,
-                           String user);
+  ProcessEntity getProcess(String vspId, Version version, String componentId, String processId);
 
-  void updateProcess(ProcessEntity processEntity, String user);
+  void updateProcess(ProcessEntity processEntity);
 
-  void deleteProcess(String vspId, Version version, String componentId, String processId,
-                     String user);
+  void deleteProcess(String vspId, Version version, String componentId, String processId);
 
-  File getProcessArtifact(String vspId, Version version, String componentId, String processId,
-                          String user);
+  File getProcessArtifact(String vspId, Version version, String componentId, String processId);
 
-  void deleteProcessArtifact(String vspId, Version version, String componentId, String processId,
-                             String user);
+  void deleteProcessArtifact(String vspId, Version version, String componentId, String processId);
 
   void uploadProcessArtifact(InputStream uploadFile, String fileName, String vspId,
-                             Version version, String componentId, String processId, String user);
+                             Version version, String componentId, String processId);
 }
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/VendorSoftwareProductManager.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/VendorSoftwareProductManager.java
index 0adca1c..2e38122 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/VendorSoftwareProductManager.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/VendorSoftwareProductManager.java
@@ -20,65 +20,55 @@
 
 package org.openecomp.sdc.vendorsoftwareproduct;
 
+import org.openecomp.sdc.datatypes.error.ErrorMessage;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComputeEntity;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.OrchestrationTemplateEntity;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.PackageInfo;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
 import org.openecomp.sdc.vendorsoftwareproduct.types.QuestionnaireResponse;
 import org.openecomp.sdc.vendorsoftwareproduct.types.ValidationResponse;
-import org.openecomp.sdc.vendorsoftwareproduct.types.VersionedVendorSoftwareProductInfo;
 import org.openecomp.sdc.versioning.dao.types.Version;
-import org.openecomp.sdc.versioning.types.VersionInfo;
 
 import java.io.File;
 import java.io.IOException;
 import java.util.Collection;
 import java.util.List;
+import java.util.Map;
 
 public interface VendorSoftwareProductManager {
 
-  Version checkout(String vendorSoftwareProductId, String user);
+  VspDetails createVsp(VspDetails vspDetails);
 
-  Version undoCheckout(String vendorSoftwareProductId, String user);
+  void updateVsp(VspDetails vspDetails);
 
-  Version checkin(String vendorSoftwareProductId, String user);
+  VspDetails getVsp(String vspId, Version version);
 
-  ValidationResponse submit(String vendorSoftwareProductId, String user) throws IOException;
+  void deleteVsp(String vspIdToDelete);
+
+  ValidationResponse validate(String vspId, Version version) throws IOException;
+
+  Map<String, List<ErrorMessage>> compile(String vspId, Version version);
 
 
-  List<VersionedVendorSoftwareProductInfo> listVsps(String versionFilter, String user);
+  QuestionnaireResponse getVspQuestionnaire(String vspId, Version version);
 
-  VspDetails createVsp(VspDetails vspDetails, String user);
-
-  void updateVsp(VspDetails vspDetails, String user);
-
-  VspDetails getVsp(String vspId, Version version, String user);
-
-  Version callAutoHeal(String vspId, VersionInfo versionInfo,
-                       VspDetails vendorSoftwareProductInfo, String user) throws Exception;
-
-  void deleteVsp(String vspIdToDelete, String user);
-
-  QuestionnaireResponse getVspQuestionnaire(String vspId, Version version, String user);
-
-  void updateVspQuestionnaire(String vspId, Version version, String questionnaireData, String user);
+  void updateVspQuestionnaire(String vspId, Version version, String questionnaireData);
 
 
-  byte[] getOrchestrationTemplateFile(String vspId, Version version, String user);
+  byte[] getOrchestrationTemplateFile(String vspId, Version version);
 
-  PackageInfo createPackage(String vspId, Version version, String user) throws IOException;
+  OrchestrationTemplateEntity getOrchestrationTemplateInfo(String vspId, Version version);
+
+
+  PackageInfo createPackage(String vspId, Version version) throws IOException;
 
   List<PackageInfo> listPackages(String category, String subCategory);
 
-  File getTranslatedFile(String vspId, Version version, String user);
 
-  void heal(String vspId, Version version, String user);
+  File getTranslatedFile(String vspId, Version version);
 
-  File getInformationArtifact(String vspId, Version version, String user);
+  File getInformationArtifact(String vspId, Version version);
 
-  String fetchValidationVsp(String user);
 
-  Collection<ComputeEntity> getComputeByVsp(String vspId, Version version, String user);
-
-  Version healAndAdvanceFinalVersion(String vspId, VspDetails vendorSoftwareProductInfo,
-                                     String user) throws IOException;
+  Collection<ComputeEntity> getComputeByVsp(String vspId, Version version);
 }
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/ComponentDependencyModelErrorBuilder.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/ComponentDependencyModelErrorBuilder.java
index 78605c8..53ad74b 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/ComponentDependencyModelErrorBuilder.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/ComponentDependencyModelErrorBuilder.java
@@ -1,18 +1,14 @@
 package org.openecomp.sdc.vendorsoftwareproduct.errors;
 
 
-import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes
-    .CYCLIC_DEPENDENCY_IN_COMPONENTS;
-import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes
-    .INVALID_COMPONENT_RELATION_TYPE;
-import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes
-    .NO_SOURCE_COMPONENT;
-import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes
-    .SAME_SOURCE_TARGET_COMPONENT;
-
 import org.openecomp.sdc.common.errors.ErrorCategory;
 import org.openecomp.sdc.common.errors.ErrorCode;
 
+import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes.CYCLIC_DEPENDENCY_IN_COMPONENTS;
+import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes.INVALID_COMPONENT_RELATION_TYPE;
+import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes.NO_SOURCE_COMPONENT;
+import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes.SAME_SOURCE_TARGET_COMPONENT;
+
 public class ComponentDependencyModelErrorBuilder {
 
   private static final String CYCLIC_DEPENDENCY_COMPONENT_MSG = "Cyclic dependency exists between"
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/DuplicateComputeInComponentErrorBuilder.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/DuplicateComputeInComponentErrorBuilder.java
index b242b71..5d58f5c 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/DuplicateComputeInComponentErrorBuilder.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/DuplicateComputeInComponentErrorBuilder.java
@@ -2,41 +2,16 @@
 
 import org.openecomp.sdc.common.errors.ErrorCategory;
 import org.openecomp.sdc.common.errors.ErrorCode;
+
 import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes.UPDATE_COMPUTE_NOT_ALLOWED;
 
 
 public class DuplicateComputeInComponentErrorBuilder {
-
-  private static final String DUPLICATE_COMPUTE_NAME_NOT_ALLOWED_MSG =
-      "Invalid request, Compute with name %s already exists for component with ID %s.";
-  private static final String COMPUTE_HEAT_READONLY_ATTR_MSG = "Update of attribute %s not allowed "
-          + "for VSP onboarded via HEAT.";
-  private static final String COMPUTE_MANUAL_READONLY_ATTR_MSG = "Update of attribute %s not allowed "
-          + "for VSP onboarded manually.";
-
+  private static final String COMPUTE_HEAT_READONLY_ATTR_MSG =
+      "Update of attribute %s not allowed for VSP onboarded via HEAT.";
 
   private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder();
 
-  public DuplicateComputeInComponentErrorBuilder(String computeName, String componentId ){
-    builder.withId(VendorSoftwareProductErrorCodes.DUPLICATE_COMPUTE_NAME_NOT_ALLOWED);
-    builder.withCategory(ErrorCategory.APPLICATION);
-    builder.withMessage(String.format(DUPLICATE_COMPUTE_NAME_NOT_ALLOWED_MSG,computeName,
-        componentId));
-  }
-
-  /**
-   * Gets duplicate compute name error builder.
-   *
-   * @return the duplicate compute name error builder
-   */
-  public static ErrorCode getDuplicateComputeNameErrorBuilder(String computeName, String componenetId) {
-    ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder();
-    builder.withId(VendorSoftwareProductErrorCodes.DUPLICATE_COMPUTE_NAME_NOT_ALLOWED);
-    builder.withCategory(ErrorCategory.APPLICATION);
-    builder.withMessage(String.format(DUPLICATE_COMPUTE_NAME_NOT_ALLOWED_MSG, computeName, componenetId ));
-    return builder.build();
-  }
-
   public static ErrorCode getComputeHeatReadOnlyErrorBuilder(String name) {
     ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder();
     builder.withId(UPDATE_COMPUTE_NOT_ALLOWED);
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/ImageErrorBuilder.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/ImageErrorBuilder.java
index 9ac6e1b..2d22d01 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/ImageErrorBuilder.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/ImageErrorBuilder.java
@@ -3,7 +3,11 @@
 import org.openecomp.sdc.common.errors.ErrorCategory;
 import org.openecomp.sdc.common.errors.ErrorCode;
 
-import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes.*;
+import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes.DUPLICATE_IMAGE_NAME_NOT_ALLOWED;
+import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes.DUPLICATE_IMAGE_VERSION_NOT_ALLOWED;
+import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes.IMAGE_NAME_FORMAT_NOT_ALLOWED;
+import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes.UPDATE_IMAGE_NOT_ALLOWED;
+import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes.VFC_IMAGE_INVALID_FORMAT;
 
 /**
  * The Image error builder.
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/MonitoringUploadErrorBuilder.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/MonitoringUploadErrorBuilder.java
index 5fc29d5..eed56e1 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/MonitoringUploadErrorBuilder.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/MonitoringUploadErrorBuilder.java
@@ -28,8 +28,7 @@
 
 public class MonitoringUploadErrorBuilder extends BaseErrorBuilder {
   private static final String UPLOAD_INVALID_DETAILED_MSG =
-      "Monitoring file uploaded for vendor software product with Id %s and version %s is invalid:" +
-          " %s";
+      "Monitoring file uploaded for vendor software product with Id %s and version %s is invalid: %s";
 
 
   /**
@@ -44,7 +43,7 @@
     getErrorCodeBuilder().withId(MONITORING_UPLOAD_INVALID);
     getErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION);
     getErrorCodeBuilder().withMessage(String.format(UPLOAD_INVALID_DETAILED_MSG,
-        vendorSoftwareProductId, version == null ? null : version.toString(), error));
+        vendorSoftwareProductId, version == null ? null : version.getId(), error));
   }
 
   /**
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/NicInternalNetworkErrorBuilder.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/NicInternalNetworkErrorBuilder.java
index 0850d2e..2acfde4 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/NicInternalNetworkErrorBuilder.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/NicInternalNetworkErrorBuilder.java
@@ -1,11 +1,11 @@
 package org.openecomp.sdc.vendorsoftwareproduct.errors;
 
-import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes.NETWORK_DESCRIPTION_NOT_ALLOWED_FOR_INTERNAL_NETWORK;
-import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes.NETWORK_TYPE_UPDATE_NOT_ALLOWED;
-
 import org.openecomp.sdc.common.errors.ErrorCategory;
 import org.openecomp.sdc.common.errors.ErrorCode;
 
+import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes.NETWORK_DESCRIPTION_NOT_ALLOWED_FOR_INTERNAL_NETWORK;
+import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes.NETWORK_TYPE_UPDATE_NOT_ALLOWED;
+
 public class NicInternalNetworkErrorBuilder {
   private static final String NULL_NETWORKID_NOT_ALLOWED_MSG =
       "Internal Networks are currently not supported for VSP created Manually, so please fix all the NIC to be of Type External and re-submit the VSP.";
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/NotSupportedHeatOnboardMethodErrorBuilder.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/NotSupportedHeatOnboardMethodErrorBuilder.java
index 7801df8..1b68962 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/NotSupportedHeatOnboardMethodErrorBuilder.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/NotSupportedHeatOnboardMethodErrorBuilder.java
@@ -1,5 +1,8 @@
 package org.openecomp.sdc.vendorsoftwareproduct.errors;
 
+import org.openecomp.sdc.common.errors.ErrorCategory;
+import org.openecomp.sdc.common.errors.ErrorCode;
+
 import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes.ADD_COMPUTE_NOT_ALLOWED_IN_HEAT_ONBOARDING;
 import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes.ADD_IMAGE_NOT_ALLOWED_IN_HEAT_ONBOARDING;
 import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes.ADD_NIC_NOT_ALLOWED_IN_HEAT_ONBOARDING;
@@ -7,9 +10,6 @@
 import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes.DELETE_IMAGE_NOT_ALLOWED;
 import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes.EDIT_DEPLOYMENT_FLAVOR_NOT_ALLOWED_IN_HEAT_ONBOARDING;
 
-import org.openecomp.sdc.common.errors.ErrorCategory;
-import org.openecomp.sdc.common.errors.ErrorCode;
-
 public class NotSupportedHeatOnboardMethodErrorBuilder {
   private static final String ADD_NIC_NOT_ALLOWED_IN_HEAT_ONBOARDING_MSG =
       "NIC cannot be added for VSPs onboarded with HEAT.";
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/OnboardingMethodErrorBuilder.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/OnboardingMethodErrorBuilder.java
index 8aad900..49785a3 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/OnboardingMethodErrorBuilder.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/OnboardingMethodErrorBuilder.java
@@ -1,37 +1,19 @@
 package org.openecomp.sdc.vendorsoftwareproduct.errors;
 
-import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes
-    .VSP_INVALID_ONBOARDING_METHOD;
-import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes
-    .VSP_ONBOARD_METHOD_UPDATE_NOT_ALLOWED;
-
 import org.openecomp.sdc.common.errors.ErrorCategory;
 import org.openecomp.sdc.common.errors.ErrorCode;
 
+import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes.VSP_INVALID_ONBOARDING_METHOD;
+
 /**
  * The type Onboarding method error builder.
  */
 public class OnboardingMethodErrorBuilder {
 
-  private static final String VSP_ONBOARD_METHOD_UPDATE_NOT_ALLOWED_MSG =
-      "onboardingMethod update is not allowed.";
   private static final String VSP_INVALID_ONBOARDING_METHOD_MSG =
       "The onboardingMethod value doesn't meet the expected attribute value.";
 
   /**
-   * Gets onboarding update error.
-   *
-   * @return the onboarding update error
-   */
-  public static ErrorCode getOnboardingUpdateError() {
-    ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder();
-    builder.withId(VSP_ONBOARD_METHOD_UPDATE_NOT_ALLOWED);
-    builder.withCategory(ErrorCategory.APPLICATION);
-    builder.withMessage(String.format(VSP_ONBOARD_METHOD_UPDATE_NOT_ALLOWED_MSG));
-    return builder.build();
-  }
-
-  /**
    * Get invalid onboarding method error builder error code.
    *
    * @return the error code
@@ -40,7 +22,7 @@
     ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder();
     builder.withId(VSP_INVALID_ONBOARDING_METHOD);
     builder.withCategory(ErrorCategory.APPLICATION);
-    builder.withMessage(String.format(VSP_INVALID_ONBOARDING_METHOD_MSG));
+    builder.withMessage(VSP_INVALID_ONBOARDING_METHOD_MSG);
     return builder.build();
   }
 }
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/TranslationFileCreationErrorBuilder.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/TranslationFileCreationErrorBuilder.java
index 1ec3af3..fd8acd1 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/TranslationFileCreationErrorBuilder.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/TranslationFileCreationErrorBuilder.java
@@ -20,12 +20,12 @@
 
 package org.openecomp.sdc.vendorsoftwareproduct.errors;
 
-import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes.TRANSLATION_FILE_CREATION;
-
 import org.openecomp.sdc.common.errors.ErrorCategory;
 import org.openecomp.sdc.common.errors.ErrorCode;
 import org.openecomp.sdc.versioning.dao.types.Version;
 
+import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes.TRANSLATION_FILE_CREATION;
+
 public class TranslationFileCreationErrorBuilder {
   private static final String TRANSLATION_FILE_CREATION_ERROR_MSG =
       "Error while trying to create translation file from the package of vendor software product "
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/VendorSoftwareProductInvalidErrorBuilder.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/VendorSoftwareProductInvalidErrorBuilder.java
index 4a84c83..4fc0b6e 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/VendorSoftwareProductInvalidErrorBuilder.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/VendorSoftwareProductInvalidErrorBuilder.java
@@ -28,7 +28,7 @@
   private static final String VSP_INVALID_MSG =
       "Vendor software product with Id %s and version %s is invalid - does not contain "
           + "service model.";
-  private static final String VSP_INVALID_MISSING_DEPLOYMENT_FLAVOR_MSG ="VSP has to have a " +
+  private static final String VSP_INVALID_MISSING_DEPLOYMENT_FLAVOR_MSG = "VSP has to have a " +
       "minimum of one Deployment Flavor defined for being able to be instantiated.Please add a Deployment Flavor and re-submit the VSP.";
   private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder();
 
@@ -39,13 +39,13 @@
    * @param version                 the version
    */
   public static ErrorCode VendorSoftwareProductMissingServiceModelErrorBuilder(String
-                                                                         vendorSoftwareProductId,
-                                                             Version version) {
+                                                                                   vendorSoftwareProductId,
+                                                                               Version version) {
     ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder();
     builder.withId(VendorSoftwareProductErrorCodes.VSP_INVALID);
     builder.withCategory(ErrorCategory.APPLICATION);
     builder
-        .withMessage(String.format(VSP_INVALID_MSG, vendorSoftwareProductId, version.toString()));
+        .withMessage(String.format(VSP_INVALID_MSG, vendorSoftwareProductId, version.getId()));
     return builder.build();
   }
 
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComponentDependencyModelManagerFactoryImpl.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComponentDependencyModelManagerFactoryImpl.java
index b4513de..1f9a35c 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComponentDependencyModelManagerFactoryImpl.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComponentDependencyModelManagerFactoryImpl.java
@@ -3,13 +3,16 @@
 import org.openecomp.sdc.vendorsoftwareproduct.ComponentDependencyModelManager;
 import org.openecomp.sdc.vendorsoftwareproduct.ComponentDependencyModelManagerFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.ComponentManagerFactory;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDaoFactory;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDependencyModelDaoFactory;
 
 public class ComponentDependencyModelManagerFactoryImpl extends
     ComponentDependencyModelManagerFactory {
+
   private static final ComponentDependencyModelManager INSTANCE =
-      new ComponentDependencyModelManagerImpl(VendorSoftwareProductDaoFactory.getInstance()
-          .createInterface(), ComponentManagerFactory.getInstance().createInterface());
+      new ComponentDependencyModelManagerImpl(
+          ComponentManagerFactory.getInstance().createInterface(),
+          ComponentDependencyModelDaoFactory.getInstance().createInterface()
+      );
 
   @Override
   public ComponentDependencyModelManager createInterface() {
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComponentDependencyModelManagerImpl.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComponentDependencyModelManagerImpl.java
index 5dc1446..17d1833 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComponentDependencyModelManagerImpl.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComponentDependencyModelManagerImpl.java
@@ -1,6 +1,7 @@
 package org.openecomp.sdc.vendorsoftwareproduct.impl;
 
 import org.apache.commons.lang3.StringUtils;
+import org.openecomp.core.utilities.CommonMethods;
 import org.openecomp.sdc.common.errors.CoreException;
 import org.openecomp.sdc.common.errors.ErrorCode;
 import org.openecomp.sdc.datatypes.error.ErrorLevel;
@@ -12,57 +13,28 @@
 import org.openecomp.sdc.logging.types.LoggerTragetServiceName;
 import org.openecomp.sdc.vendorsoftwareproduct.ComponentDependencyModelManager;
 import org.openecomp.sdc.vendorsoftwareproduct.ComponentManager;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDependencyModelDao;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentDependencyModelEntity;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
 import org.openecomp.sdc.vendorsoftwareproduct.errors.ComponentDependencyModelErrorBuilder;
+import org.openecomp.sdc.versioning.VersioningUtil;
 import org.openecomp.sdc.versioning.dao.types.Version;
 
 import java.util.Collection;
-import java.util.List;
 
 public class ComponentDependencyModelManagerImpl implements ComponentDependencyModelManager {
 
-  private VendorSoftwareProductDao vendorSoftwareProductDao;
   private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage();
   protected static final Logger logger =
       LoggerFactory.getLogger(ComponentDependencyModelManagerImpl.class);
 
   private ComponentManager componentManager;
+  private ComponentDependencyModelDao componentDependencyModelDao;
 
-  public ComponentDependencyModelManagerImpl(VendorSoftwareProductDao vendorSoftwareProductDao, ComponentManager componentManager) {
-    this.vendorSoftwareProductDao = vendorSoftwareProductDao;
+  public ComponentDependencyModelManagerImpl(
+      ComponentManager componentManager, ComponentDependencyModelDao componentDependencyModelDao) {
     this.componentManager = componentManager;
-  }
-
-  @Override
-  public void createComponentDependencyModel(List<ComponentDependencyModelEntity> entities,
-                                             String vspId, Version version, String user) {
-
-    mdcDataDebugMessage.debugEntryMessage("createComponentDependencyModel");
-    for(ComponentDependencyModelEntity entity : entities) {
-      if (!StringUtils.isEmpty(entity.getSourceComponentId())) {
-        componentManager.validateComponentExistence(entity.getVspId(), entity.getVersion(),
-            entity.getSourceComponentId(), user);
-        if (entity.getSourceComponentId().equals(entity.getTargetComponentId())) {
-          ErrorCode errorCode =
-              ComponentDependencyModelErrorBuilder.getSourceTargetComponentEqualErrorBuilder();
-          raiseException(errorCode);
-        }
-      } else {
-          ErrorCode errorCode = ComponentDependencyModelErrorBuilder
-              .getNoSourceComponentErrorBuilder();
-          raiseException(errorCode);
-      }
-
-      if (!StringUtils.isEmpty(entity.getTargetComponentId())) {
-        componentManager.validateComponentExistence(entity.getVspId(), entity.getVersion(),
-            entity.getTargetComponentId(), user);
-      }
-    }
-
-    vendorSoftwareProductDao.createComponentDependencyModel(entities, vspId, version );
-
-    mdcDataDebugMessage.debugExitMessage("createComponentDependencyModel");
+    this.componentDependencyModelDao = componentDependencyModelDao;
   }
 
   private void raiseException(ErrorCode errorCode) {
@@ -73,11 +45,82 @@
   }
 
   @Override
-  public Collection<ComponentDependencyModelEntity> list(String vspId, Version version, String
-      user) {
+  public Collection<ComponentDependencyModelEntity> list(String vspId, Version version) {
 
     mdcDataDebugMessage.debugExitMessage("VSP id, version", vspId, version.toString());
 
-    return vendorSoftwareProductDao.listComponentDependencies(vspId, version);
+    return componentDependencyModelDao
+        .list(new ComponentDependencyModelEntity(vspId, version, null));
+  }
+
+  @Override
+  public ComponentDependencyModelEntity createComponentDependency(ComponentDependencyModelEntity
+                                                                      entity, String vspId,
+                                                                  Version version) {
+
+    validateComponentDependency(entity);
+    entity.setId(CommonMethods.nextUuId());
+    componentDependencyModelDao.create(entity);
+    return entity;
+  }
+
+  private void validateComponentDependency(ComponentDependencyModelEntity entity) {
+    if (!StringUtils.isEmpty(entity.getSourceComponentId())) {
+      componentManager.validateComponentExistence(entity.getVspId(), entity.getVersion(),
+          entity.getSourceComponentId());
+      if (entity.getSourceComponentId().equals(entity.getTargetComponentId())) {
+        ErrorCode errorCode =
+            ComponentDependencyModelErrorBuilder.getSourceTargetComponentEqualErrorBuilder();
+        raiseException(errorCode);
+      }
+    } else {
+      ErrorCode errorCode = ComponentDependencyModelErrorBuilder
+          .getNoSourceComponentErrorBuilder();
+      raiseException(errorCode);
+    }
+
+    if (!StringUtils.isEmpty(entity.getTargetComponentId())) {
+      componentManager.validateComponentExistence(entity.getVspId(), entity.getVersion(),
+          entity.getTargetComponentId());
+    }
+  }
+
+  @Override
+  public void delete(String vspId, Version version, String dependencyId) {
+    mdcDataDebugMessage.debugEntryMessage("VSP id, dependencyId", vspId, dependencyId);
+    ComponentDependencyModelEntity componentDependencyEntity = getComponentDependency(vspId,
+        version, dependencyId);
+    if (componentDependencyEntity != null) {
+      componentDependencyModelDao.delete(componentDependencyEntity);
+    }
+
+    mdcDataDebugMessage.debugExitMessage("VSP id, dependencyId", vspId, dependencyId);
+  }
+
+  @Override
+  public void update(ComponentDependencyModelEntity entity) {
+    mdcDataDebugMessage.debugEntryMessage("VSP id, dependencyId", entity.getVspId(),
+        entity.getId());
+    ComponentDependencyModelEntity componentDependencyEntity = getComponentDependency(
+        entity.getVspId(), entity.getVersion(), entity.getId());
+    validateComponentDependency(entity);
+    componentDependencyModelDao.update(entity);
+  }
+
+  @Override
+  public ComponentDependencyModelEntity get(String vspId, Version version, String dependencyId) {
+    mdcDataDebugMessage.debugEntryMessage("VSP id, dependencyId", vspId, dependencyId);
+    ComponentDependencyModelEntity componentDependency =
+        getComponentDependency(vspId, version, dependencyId);
+    return componentDependency;
+  }
+
+  private ComponentDependencyModelEntity getComponentDependency(String vspId, Version version,
+                                                                String dependencyId) {
+    ComponentDependencyModelEntity retrieved = componentDependencyModelDao.get(
+        new ComponentDependencyModelEntity(vspId, version, dependencyId));
+    VersioningUtil.validateEntityExistence(retrieved, new ComponentDependencyModelEntity(
+        vspId, version, dependencyId), VspDetails.ENTITY_TYPE);
+    return retrieved;
   }
 }
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComponentManagerImpl.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComponentManagerImpl.java
index 72a38bb..1834bf0 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComponentManagerImpl.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComponentManagerImpl.java
@@ -67,10 +67,10 @@
   private NicManager nicManager;
   private VendorSoftwareProductInfoDao vspInfoDao;
 
-  public ComponentManagerImpl(
-      ComponentDao componentDao,
-      CompositionEntityDataManager compositionEntityDataManager,
-      NicManager nicManager, VendorSoftwareProductInfoDao vspInfoDao) {
+  public ComponentManagerImpl(ComponentDao componentDao,
+                              CompositionEntityDataManager compositionEntityDataManager,
+                              NicManager nicManager,
+                              VendorSoftwareProductInfoDao vspInfoDao) {
     this.componentDao = componentDao;
     this.compositionEntityDataManager = compositionEntityDataManager;
     this.nicManager = nicManager;
@@ -78,14 +78,14 @@
   }
 
   @Override
-  public Collection<ComponentEntity> listComponents(String vspId, Version version, String user) {
+  public Collection<ComponentEntity> listComponents(String vspId, Version version) {
     mdcDataDebugMessage.debugEntryMessage("VSP id", vspId);
     mdcDataDebugMessage.debugExitMessage("VSP id", vspId);
     return componentDao.list(new ComponentEntity(vspId, version, null));
   }
 
   @Override
-  public void deleteComponents(String vspId, Version version, String user) {
+  public void deleteComponents(String vspId, Version version) {
     mdcDataDebugMessage.debugEntryMessage("VSP id", vspId);
     if (!vspInfoDao.isManual(vspId, version)) {
       MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
@@ -95,12 +95,11 @@
           new CompositionEditNotAllowedErrorBuilder(vspId, version).build());
     }
 
-    //componentDao.updateVspLatestModificationTime(vspId, version);
     mdcDataDebugMessage.debugExitMessage("VSP id", vspId);
   }
 
   /*@Override
-  public ComponentEntity createComponent(ComponentEntity component, String user) {
+  public ComponentEntity createComponent(ComponentEntity component) {
     mdcDataDebugMessage.debugEntryMessage("VSP id", component.getId());
 
     if (!isManual(component.getVspId(), component.getVersion())) {
@@ -112,24 +111,18 @@
               .build());
 
     }
-    //componentDao.updateVspLatestModificationTime(component.getVspId(), component.getVersion());
     mdcDataDebugMessage.debugExitMessage("VSP id", component.getId());
     return null;
   }*/
 
   @Override
-  public ComponentEntity createComponent(ComponentEntity component, String user) {
+  public ComponentEntity createComponent(ComponentEntity component) {
     mdcDataDebugMessage.debugEntryMessage("VSP id", component.getId());
-    /*Version activeVersion =
-        getVersionInfo(component.getVspId(), VersionableEntityAction.Write, user)
-            .getActiveVersion();
-    component.setVersion(activeVersion);*/
 
     final String VFC_ADD_NOT_ALLOWED_IN_HEAT_ONBOARDING_MSG =
         "VFCs cannot be added for VSPs onboarded with HEAT.";
 
-    ComponentEntity createdComponent = null;
-
+    ComponentEntity createdComponent;
     if (!vspInfoDao.isManual(component.getVspId(), component.getVersion())) {
       MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
           LoggerTragetServiceName.CREATE_COMPONENT, ErrorLevel.ERROR.name(),
@@ -141,7 +134,7 @@
     } else {
       validateComponentManual(component);
       updateComponentName(component);
-      createdComponent = createComponent(component);
+      createdComponent = compositionEntityDataManager.createComponent(component);
     }
 
     mdcDataDebugMessage.debugExitMessage("VSP id", component.getId());
@@ -149,10 +142,6 @@
     return createdComponent;
   }
 
-  private ComponentEntity createComponent(ComponentEntity component) {
-    return compositionEntityDataManager.createComponent(component);
-  }
-
   private void updateComponentName(ComponentEntity component) {
     ComponentData data = component.getComponentCompositionData();
     data.setName(COMPUTE_TYPE_PREFIX + data.getDisplayName());
@@ -166,8 +155,8 @@
     final String VSP_VFC_DUPLICATE_NAME_MSG = "VFC with specified name "
         + "already present in given VSP.";
 
-    Collection<ComponentEntity> vspComponentList = listComponents(component.getVspId()
-        , component.getVersion(), null);
+    Collection<ComponentEntity> vspComponentList =
+        listComponents(component.getVspId(), component.getVersion());
     if (vspComponentList.size() >= 1) //1707 release only supports 1 VFC in VSP (manual creation)
     {
       MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
@@ -202,18 +191,17 @@
   }
 
   @Override
-  public CompositionEntityValidationData updateComponent(ComponentEntity component, String user) {
+  public CompositionEntityValidationData updateComponent(ComponentEntity component) {
     mdcDataDebugMessage.debugEntryMessage("VSP id, component id", component
         .getVspId(), component.getId());
     ComponentEntity retrieved =
-        getComponent(component.getVspId(), component.getVersion(), component.getId());
+        getValidatedComponent(component.getVspId(), component.getVersion(), component.getId());
 
     boolean isManual = vspInfoDao.isManual(component.getVspId(), component.getVersion());
     if (isManual) {
-      validateComponentUpdateManual(component, retrieved, user);
+      validateComponentUpdateManual(retrieved);
     }
 
-
     ComponentCompositionSchemaInput schemaInput = new ComponentCompositionSchemaInput();
     schemaInput.setManual(isManual);
     schemaInput.setComponent(retrieved.getComponentCompositionData());
@@ -232,19 +220,18 @@
     return validationData;
   }
 
-  private void validateComponentUpdateManual(ComponentEntity component, ComponentEntity
-      retrieved, String user) {
+  private void validateComponentUpdateManual(ComponentEntity component) {
     Collection<ComponentEntity> vspComponentList =
-        listComponents(component.getVspId(), component.getVersion(), user);
+        listComponents(component.getVspId(), component.getVersion());
     //VFC name should be unique within VSP
     //Removing VFC with same ID from list to avoid self compare
-    for(ComponentEntity ce : vspComponentList) {
+    for (ComponentEntity ce : vspComponentList) {
       if (ce.getId().equals(component.getId())) {
         vspComponentList.remove(ce);
         break;
       }
     }
-    if (!isVfcNameUnique(vspComponentList,  component.getComponentCompositionData()
+    if (!isVfcNameUnique(vspComponentList, component.getComponentCompositionData()
         .getDisplayName())) {
       MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
           LoggerTragetServiceName.UPDATE_COMPONENT, ErrorLevel.ERROR.name(),
@@ -259,9 +246,9 @@
   }
 
   public CompositionEntityResponse<ComponentData> getComponent(String vspId, Version version,
-                                                               String componentId, String user) {
+                                                               String componentId) {
     mdcDataDebugMessage.debugEntryMessage("VSP id, component id", vspId, componentId);
-    ComponentEntity componentEntity = getComponent(vspId, version, componentId);
+    ComponentEntity componentEntity = getValidatedComponent(vspId, version, componentId);
     ComponentData component = componentEntity.getComponentCompositionData();
 
     ComponentCompositionSchemaInput schemaInput = new ComponentCompositionSchemaInput();
@@ -278,7 +265,7 @@
   }
 
   @Override
-  public void deleteComponent(String vspId, Version version, String componentId, String user) {
+  public void deleteComponent(String vspId, Version version, String componentId) {
     mdcDataDebugMessage.debugEntryMessage("VSP id, component id", vspId, componentId);
 
     if (!vspInfoDao.isManual(vspId, version)) {
@@ -289,14 +276,12 @@
           new CompositionEditNotAllowedErrorBuilder(vspId, version).build());
     }
 
-    //componentDao.updateVspLatestModificationTime(vspId, version);
-
     mdcDataDebugMessage.debugExitMessage("VSP id, component id", vspId, componentId);
   }
 
   @Override
   public QuestionnaireResponse getQuestionnaire(String vspId, Version version,
-                                                String componentId, String user) {
+                                                String componentId) {
     mdcDataDebugMessage.debugEntryMessage("VSP id, component id", vspId, componentId);
 
     QuestionnaireResponse questionnaireResponse = new QuestionnaireResponse();
@@ -306,7 +291,7 @@
             VspDetails.ENTITY_TYPE);
 
     questionnaireResponse.setData(component.getQuestionnaireData());
-    List<String> nicNames = nicManager.listNics(vspId, version, componentId, user).stream()
+    List<String> nicNames = nicManager.listNics(vspId, version, componentId).stream()
         .map(nic -> nic.getNicCompositionData().getName()).collect(Collectors.toList());
     questionnaireResponse.setSchema(getComponentQuestionnaireSchema(
         new ComponentQuestionnaireSchemaInput(nicNames, questionnaireResponse.getData() == null
@@ -319,23 +304,21 @@
 
   @Override
   public void updateQuestionnaire(String vspId, Version version, String componentId,
-                                  String questionnaireData, String user) {
+                                  String questionnaireData) {
     mdcDataDebugMessage.debugEntryMessage("VSP id, component id", vspId, componentId);
-    validateComponentExistence(vspId, version, componentId, user);
+    validateComponentExistence(vspId, version, componentId);
 
     componentDao.updateQuestionnaireData(vspId, version, componentId, questionnaireData);
 
-    //componentDao.updateVspLatestModificationTime(vspId, version);
     mdcDataDebugMessage.debugExitMessage("VSP id, component id", vspId, componentId);
   }
 
   @Override
-  public void validateComponentExistence(String vspId, Version version, String componentId,
-                                         String user) {
-    getComponent(vspId, version, componentId);
+  public void validateComponentExistence(String vspId, Version version, String componentId) {
+    getValidatedComponent(vspId, version, componentId);
   }
 
-  private ComponentEntity getComponent(String vspId, Version version, String componentId) {
+  private ComponentEntity getValidatedComponent(String vspId, Version version, String componentId) {
     ComponentEntity retrieved = componentDao.get(new ComponentEntity(vspId, version, componentId));
     VersioningUtil
         .validateEntityExistence(retrieved, new ComponentEntity(vspId, version, componentId),
@@ -353,8 +336,4 @@
         .generate(SchemaTemplateContext.questionnaire, CompositionEntityType.component,
             schemaInput);
   }
-
-  /*private boolean isManual(String vspId, Version version) {
-    return false;
-  }*/
 }
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComputeManagerFactoryImpl.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComputeManagerFactoryImpl.java
index 71985fa..598c45f 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComputeManagerFactoryImpl.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComputeManagerFactoryImpl.java
@@ -2,7 +2,6 @@
 
 import org.openecomp.sdc.vendorsoftwareproduct.ComputeManager;
 import org.openecomp.sdc.vendorsoftwareproduct.ComputeManagerFactory;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDaoFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.ComputeDaoFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.DeploymentFlavorDaoFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDaoFactory;
@@ -15,10 +14,7 @@
           VendorSoftwareProductInfoDaoFactory.getInstance().createInterface(),
           ComputeDaoFactory.getInstance().createInterface(),
           CompositionEntityDataManagerFactory.getInstance().createInterface(),
-          DeploymentFlavorDaoFactory.getInstance().createInterface(),
-          ComponentDaoFactory.getInstance().createInterface()
-
-      );
+          DeploymentFlavorDaoFactory.getInstance().createInterface());
 
   @Override
   public ComputeManager createInterface() {
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComputeManagerImpl.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComputeManagerImpl.java
index be90b08..0fc0aaf 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComputeManagerImpl.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComputeManagerImpl.java
@@ -2,6 +2,8 @@
 
 
 import org.apache.commons.collections4.CollectionUtils;
+import org.openecomp.core.util.UniqueValueUtil;
+import org.openecomp.core.utilities.json.JsonSchemaDataGenerator;
 import org.openecomp.sdc.common.errors.CoreException;
 import org.openecomp.sdc.common.errors.ErrorCategory;
 import org.openecomp.sdc.common.errors.ErrorCode;
@@ -12,7 +14,7 @@
 import org.openecomp.sdc.logging.types.LoggerErrorCode;
 import org.openecomp.sdc.logging.types.LoggerTragetServiceName;
 import org.openecomp.sdc.vendorsoftwareproduct.ComputeManager;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDao;
+import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.ComputeDao;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.DeploymentFlavorDao;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDao;
@@ -51,33 +53,22 @@
   private CompositionEntityDataManager compositionEntityDataManager;
   private VendorSoftwareProductInfoDao vspInfoDao;
   private DeploymentFlavorDao deploymentFlavorDao;
-  private ComponentDao componentDao;
-  private static final String MANUAL = "Manual";
 
-  public ComputeManagerImpl(
-      VendorSoftwareProductInfoDao vspInfoDao,
-      ComputeDao computeDao,
-      CompositionEntityDataManager compositionEntityDataManager,
-      DeploymentFlavorDao deploymentFlavorDao,
-      ComponentDao componentDao
-     ) {
+  public ComputeManagerImpl(VendorSoftwareProductInfoDao vspInfoDao,
+                            ComputeDao computeDao,
+                            CompositionEntityDataManager compositionEntityDataManager,
+                            DeploymentFlavorDao deploymentFlavorDao) {
     this.computeDao = computeDao;
     this.compositionEntityDataManager = compositionEntityDataManager;
     this.vspInfoDao = vspInfoDao;
     this.deploymentFlavorDao = deploymentFlavorDao;
-    this.componentDao = componentDao;
   }
 
   @Override
-  public ComputeEntity createCompute(ComputeEntity compute, String user) {
-    ComputeEntity createdCompute = null;
-    mdcDataDebugMessage.debugEntryMessage("VSP id, component id", compute.getVspId(),
-        compute.getComponentId());
+  public ComputeEntity createCompute(ComputeEntity compute) {
+    mdcDataDebugMessage
+        .debugEntryMessage("VSP id, component id", compute.getVspId(), compute.getComponentId());
 
-    /*Version activeVersion =
-        getVersionInfo(compute.getVspId(), VersionableEntityAction.Write, user).getActiveVersion();
-    compute.setVersion(activeVersion);*/
-    //if (!isManual(compute.getVspId(), activeVersion)) {
     if (!vspInfoDao.isManual(compute.getVspId(), compute.getVersion())) {
       ErrorCode onboardingMethodUpdateErrorCode = NotSupportedHeatOnboardMethodErrorBuilder
           .getAddComputeNotSupportedHeatOnboardMethodErrorBuilder();
@@ -87,92 +78,45 @@
           onboardingMethodUpdateErrorCode.message());
       throw new CoreException(onboardingMethodUpdateErrorCode);
     } else {
+      validateUniqueName(compute.getVspId(), compute.getVersion(), compute.getComponentId(),
+          compute.getComputeCompositionData().getName());
 
-      //validateComponentId(compute.getVspId(),compute.getVersion(),compute.getComponentId());
-        Collection<ComputeEntity> vfcComputeList = listCompute(compute.getVspId(),compute.getVersion
-                (),compute.getComponentId());
-
-        validateVfcCompute(compute, vfcComputeList, LoggerTragetServiceName.CREATE_COMPUTE);
-        createdCompute = createCompute(compute);
+      compute.setQuestionnaireData(
+          new JsonSchemaDataGenerator(getComputeQuestionnaireSchema(null)).generateData());
+      computeDao.create(compute);
+      createUniqueName(compute.getVspId(), compute.getVersion(), compute.getComponentId(),
+          compute.getComputeCompositionData().getName());
     }
 
     mdcDataDebugMessage
         .debugExitMessage("VSP id, component id", compute.getVspId(), compute.getComponentId());
 
-    return createdCompute;
+    return compute;
   }
 
-  private ComputeEntity createCompute(ComputeEntity compute) {
-
-    return compositionEntityDataManager.createCompute(compute);
-  }
-
-  /*private void validateCompute(ComputeEntity compute) {
-    Collection<ComputeEntity> vfcComputeList = listCompute(compute.getVspId(),compute.getVersion
-        (),compute.getComponentId());
-
-    if (!isComputeNameUnique(vfcComputeList,compute.getComputeCompositionData().getName())) {
-      final ErrorCode duplicateComputeInComponentErrorBuilder =
-          new DuplicateComputeInComponentErrorBuilder(compute.getComputeCompositionData().getName(),
-              compute.getComponentId()).build();
-      MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
-          LoggerTragetServiceName.CREATE_COMPUTE, ErrorLevel.ERROR.name(),
-          LoggerErrorCode.DATA_ERROR.getErrorCode(),
-          duplicateComputeInComponentErrorBuilder.message());
-      throw new CoreException(duplicateComputeInComponentErrorBuilder);
-    }
-
-  }*/
-
-  private void validateComputeUpdate(ComputeEntity compute) {
-    Collection<ComputeEntity> vfcComputeList = listCompute(compute.getVspId(),compute.getVersion
-        (),compute.getComponentId());
-
-    for (ComputeEntity ce : vfcComputeList) {
-      if (ce.getId().equals(compute.getId())) {
-        vfcComputeList.remove(ce);
-        break;
-      }
-    }
-
-    if (!isComputeNameUnique(vfcComputeList,compute.getComputeCompositionData().getName())) {
-      final ErrorCode duplicateComputeInComponentErrorBuilder =
-          new DuplicateComputeInComponentErrorBuilder(compute.getComputeCompositionData().getName(),
-              compute.getComponentId()).build();
-      MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
-          LoggerTragetServiceName.UPDATE_COMPUTE, ErrorLevel.ERROR.name(),
-          LoggerErrorCode.DATA_ERROR.getErrorCode(),
-          duplicateComputeInComponentErrorBuilder.message());
-      throw new CoreException(duplicateComputeInComponentErrorBuilder);
-    }
-
-  }
 
   @Override
-  public Collection<ListComputeResponse> listCompute(String vspId, Version version,
-                                                     String componentId, String user) {
-
+  public Collection<ListComputeResponse> listComputes(String vspId, Version version,
+                                                      String componentId) {
     mdcDataDebugMessage.debugEntryMessage("VSP id, component id", vspId, componentId);
-    //validateComponentId(vspId, version, componentId);
-    ComputeEntity entity = new ComputeEntity(vspId, version, componentId, null);
-    Collection<ComputeEntity> computes = computeDao.list(entity);
+    Collection<ComputeEntity> computes =
+        computeDao.list(new ComputeEntity(vspId, version, componentId, null));
 
     Collection<ListComputeResponse> computeResponse =
-        getListComputeResponse(vspId, version, user, computes);
+        getListComputeResponse(vspId, version, computes);
     mdcDataDebugMessage.debugExitMessage("VSP id, component id", vspId, componentId);
 
     return computeResponse;
   }
 
   private Collection<ListComputeResponse> getListComputeResponse(String vspId, Version version,
-                                                                 String user,
                                                                  Collection<ComputeEntity> computes) {
-    Set<String> vspComputes = getComputeAssociatedWithDepFlavors(vspId, version, user);
-    Collection<ListComputeResponse> computeResponse = new ArrayList<ListComputeResponse>();
-    for(ComputeEntity computeEntity : computes) {
+    Set<String> vspComputes = getComputeAssociatedWithDepFlavors(vspId, version);
+    Collection<ListComputeResponse> computeResponse = new ArrayList<>();
+    for (ComputeEntity computeEntity : computes) {
       ListComputeResponse response = new ListComputeResponse();
       response.setComputeEntity(computeEntity);
-      if(vspComputes.contains(computeEntity.getId())) {
+      if (vspComputes.contains(computeEntity.getId())) {
         response.setAssociatedWithDeploymentFlavor(true);
       } else {
         response.setAssociatedWithDeploymentFlavor(false);
@@ -182,16 +126,15 @@
     return computeResponse;
   }
 
-  private Set<String> getComputeAssociatedWithDepFlavors(String vspId, Version version,
-                                                         String user) {
+  private Set<String> getComputeAssociatedWithDepFlavors(String vspId, Version version) {
     final Collection<DeploymentFlavorEntity> deploymentFlavorEntities =
         deploymentFlavorDao.list(new DeploymentFlavorEntity(vspId, version, null));
-    Set<String> vspComputes = new HashSet<String>();
-    for(DeploymentFlavorEntity entity : deploymentFlavorEntities) {
+    Set<String> vspComputes = new HashSet<>();
+    for (DeploymentFlavorEntity entity : deploymentFlavorEntities) {
       final List<ComponentComputeAssociation> componentComputeAssociations =
           entity.getDeploymentFlavorCompositionData().getComponentComputeAssociations();
-      if(componentComputeAssociations != null  && !componentComputeAssociations.isEmpty()) {
-        for(ComponentComputeAssociation association : componentComputeAssociations) {
+      if (componentComputeAssociations != null && !componentComputeAssociations.isEmpty()) {
+        for (ComponentComputeAssociation association : componentComputeAssociations) {
           vspComputes.add(association.getComputeFlavorId());
         }
       }
@@ -199,32 +142,14 @@
     return vspComputes;
   }
 
-  private boolean isComputeNameUnique(Collection<ComputeEntity> vfcComputeList, String name) {
-    for (ComputeEntity compute : vfcComputeList) {
-      if (compute.getComputeCompositionData().getName().equalsIgnoreCase(name)) {
-        return false;
-      }
-    }
-    return true;
-  }
-
-  private Collection<ComputeEntity> listCompute(String vspId, Version version,String componentId) {
-    Collection<ComputeEntity> computeEntities =
-        computeDao.list(new ComputeEntity(vspId, version, componentId, null));
-
-    return computeEntities;
-  }
-
   @Override
   public CompositionEntityResponse<ComputeData> getCompute(String vspId, Version version,
                                                            String componentId,
-                                                           String computeFlavorId, String user) {
+                                                           String computeFlavorId) {
     mdcDataDebugMessage.debugEntryMessage("VSP id, component id, compute id", vspId,
         componentId, computeFlavorId);
 
-    /*version = VersioningUtil
-        .resolveVersion(version, getVersionInfo(vspId, VersionableEntityAction.Read, user));*/
-    ComputeEntity computeEntity = getCompute(vspId, version, componentId, computeFlavorId);
+    ComputeEntity computeEntity = getValidatedCompute(vspId, version, componentId, computeFlavorId);
     ComputeData compute = computeEntity.getComputeCompositionData();
 
     ComputeCompositionSchemaInput schemaInput = new ComputeCompositionSchemaInput();
@@ -242,9 +167,8 @@
     return response;
   }
 
-  private ComputeEntity getCompute(String vspId, Version version, String componentId, String
-      computeFlavorId) {
-    //validateComponentId(vspId,version,componentId);
+  private ComputeEntity getValidatedCompute(String vspId, Version version, String componentId,
+                                            String computeFlavorId) {
     ComputeEntity retrieved = computeDao.get(new ComputeEntity(vspId, version, componentId,
         computeFlavorId));
     VersioningUtil
@@ -253,186 +177,113 @@
     return retrieved;
   }
 
-  /*private void validateComponentId(String vspId, Version version, String componentId) {
-    ComponentEntity retrivedComponent = componentDao.get(new ComponentEntity(vspId, version,
-        componentId));
-    VersioningUtil
-        .validateEntityExistence(retrivedComponent, new ComponentEntity(vspId, version,
-            componentId),VspDetails.ENTITY_TYPE);
-  }*/
-
   @Override
   public QuestionnaireResponse getComputeQuestionnaire(String vspId, Version version, String
-          componentId, String computeId, String user) {
+      componentId, String computeId) {
     mdcDataDebugMessage.debugEntryMessage("VSP id, componentId", vspId, componentId, computeId);
 
-    /*version = VersioningUtil
-        .resolveVersion(version, getVersionInfo(vspId, VersionableEntityAction.Read, user));*/
-    //validateComponentId(vspId,version,componentId);
     QuestionnaireResponse questionnaireResponse = new QuestionnaireResponse();
-    //validateComponentId(vspId,version,componentId);
-    ComputeEntity computeQuestionnaire = computeDao.getQuestionnaireData(vspId, version, componentId, computeId);
+    ComputeEntity computeQuestionnaire =
+        computeDao.getQuestionnaireData(vspId, version, componentId, computeId);
     VersioningUtil
-            .validateEntityExistence(computeQuestionnaire, new ComputeEntity(vspId, version, componentId,
-                    computeId), VspDetails.ENTITY_TYPE);
+        .validateEntityExistence(computeQuestionnaire,
+            new ComputeEntity(vspId, version, componentId, computeId), VspDetails.ENTITY_TYPE);
     questionnaireResponse.setData(computeQuestionnaire.getQuestionnaireData());
     questionnaireResponse.setSchema(getComputeQuestionnaireSchema(null));
 
-    mdcDataDebugMessage.debugExitMessage("VSP id, component id", vspId,
-            componentId, computeId);
+    mdcDataDebugMessage.debugExitMessage("VSP id, component id", vspId, componentId, computeId);
 
     return questionnaireResponse;
   }
 
 
-  protected String getComputeQuestionnaireSchema(SchemaTemplateInput schemaInput) {
-    mdcDataDebugMessage.debugEntryMessage(null, null);
-
-    mdcDataDebugMessage.debugExitMessage(null, null);
-    return SchemaGenerator
-        .generate(SchemaTemplateContext.questionnaire, CompositionEntityType.compute,
-            schemaInput);
-  }
-
-
   @Override
-  public void updateComputeQuestionnaire(String vspId, Version version, String componentId, String
-      computeId,
-                                         String questionnaireData, String user) {
-    mdcDataDebugMessage.debugEntryMessage("VSP id, component id, compute id", vspId,
-        componentId, computeId);
+  public void updateComputeQuestionnaire(String vspId, Version version, String componentId,
+                                         String computeId, String questionnaireData) {
+    mdcDataDebugMessage
+        .debugEntryMessage("VSP id, component id, compute id", vspId, componentId, computeId);
 
-    /*Version activeVersion =
-        getVersionInfo(vspId, VersionableEntityAction.Write, user).getActiveVersion();
-    getComponent(vspId, activeVersion, componentId);*/
-    ComputeEntity retrieved = computeDao.get(new ComputeEntity(vspId,version,componentId,
+    ComputeEntity retrieved = computeDao.get(new ComputeEntity(vspId, version, componentId,
         computeId));
     VersioningUtil.validateEntityExistence(retrieved, new ComputeEntity(vspId, version,
         componentId, computeId), VspDetails.ENTITY_TYPE);
 
     computeDao.updateQuestionnaireData(vspId, version, componentId, computeId, questionnaireData);
 
-    mdcDataDebugMessage.debugExitMessage("VSP id, component id, compute id", vspId,
-        componentId, computeId);
+    mdcDataDebugMessage
+        .debugExitMessage("VSP id, component id, compute id", vspId, componentId, computeId);
   }
 
   @Override
-  public CompositionEntityValidationData updateCompute(ComputeEntity compute, String user) {
+  public CompositionEntityValidationData updateCompute(ComputeEntity compute) {
     mdcDataDebugMessage
-            .debugEntryMessage("VSP id, component id", compute.getVspId(), compute.getComponentId(),
-                    compute.getId());
-
-    /*Version activeVersion =
-        getVersionInfo(image.getVspId(), VersionableEntityAction.Write, user).getActiveVersion();
-    image.setVersion(activeVersion);*/
-
-    ComputeEntity retrieved = getComputeEntity(compute.getVspId(), compute.getVersion(), compute.getComponentId(),
+        .debugEntryMessage("VSP id, component id", compute.getVspId(), compute.getComponentId(),
             compute.getId());
 
-    if(!vspInfoDao.isManual(compute.getVspId(), compute.getVersion())) {
-      final ComputeData computeCompositionData = compute.getComputeCompositionData();
-      final String name = computeCompositionData.getName();
-      //final String format = computeCompositionData.getFormat();
-      validateHeatVspComputeUpdate("Name", name, retrieved.getComputeCompositionData()
-              .getName());
-      /*validateHeatVspComputeUpdate("format", format, retrieved.getComputeCompositionData()
-          .getFormat());*/
+    ComputeEntity retrieved =
+        getComputeEntity(compute.getVspId(), compute.getVersion(), compute.getComponentId(),
+            compute.getId());
+
+    boolean manual = vspInfoDao.isManual(compute.getVspId(), compute.getVersion());
+    if (!manual) {
+      validateHeatVspComputeUpdate("Name",
+          compute.getComputeCompositionData().getName(),
+          retrieved.getComputeCompositionData().getName());
     }
 
-    Collection<ComputeEntity> vfcComputeList = listComputes(compute.getVspId() ,
-            compute.getVersion(), compute.getComponentId());
-
-    //Set to null so that retrieved object is equal to one in list and gets removed.
-    retrieved.setQuestionnaireData(null);
-    vfcComputeList.remove(retrieved);
-    if(vspInfoDao.isManual(compute.getVspId(), compute.getVersion()))
-      validateVfcCompute(compute, vfcComputeList, LoggerTragetServiceName.UPDATE_COMPUTE);
-
-    //Set format to default value in order to handle FTL validation when compute format is null
-    /*if(compute.getComputeCompositionData().getFormat() == null)
-      compute.getComputeCompositionData().setFormat(ComputeFormat.qcow2.name());*/
-
     ComputeCompositionSchemaInput schemaInput = new ComputeCompositionSchemaInput();
     schemaInput.setCompute(compute.getComputeCompositionData());
 
     CompositionEntityValidationData validationData = compositionEntityDataManager
-            .validateEntity(compute, SchemaTemplateContext.composition, schemaInput);
+        .validateEntity(compute, SchemaTemplateContext.composition, schemaInput);
     if (CollectionUtils.isEmpty(validationData.getErrors())) {
+      updateUniqueName(compute.getVspId(), compute.getVersion(), compute.getComponentId(),
+          retrieved.getComputeCompositionData().getName(),
+          compute.getComputeCompositionData().getName());
       computeDao.update(compute);
     }
 
     mdcDataDebugMessage
-            .debugExitMessage("VSP id, component id", compute.getVspId(), compute.getComponentId(),
-                    compute.getId());
+        .debugExitMessage("VSP id, component id", compute.getVspId(), compute.getComponentId(),
+            compute.getId());
 
     return validationData;
   }
 
   private void validateHeatVspComputeUpdate(String name, String value, String retrivedValue) {
 
-    if(value != null && !value.equals(retrivedValue)) {
+    if (value != null && !value.equals(retrivedValue)) {
 
       final ErrorCode updateHeatComputeErrorBuilder =
-              DuplicateComputeInComponentErrorBuilder.getComputeHeatReadOnlyErrorBuilder(name);
+          DuplicateComputeInComponentErrorBuilder.getComputeHeatReadOnlyErrorBuilder(name);
 
       MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
-              LoggerTragetServiceName.UPDATE_COMPUTE, ErrorLevel.ERROR.name(),
-              LoggerErrorCode.PERMISSION_ERROR.getErrorCode(),
-              updateHeatComputeErrorBuilder.message());
+          LoggerTragetServiceName.UPDATE_COMPUTE, ErrorLevel.ERROR.name(),
+          LoggerErrorCode.PERMISSION_ERROR.getErrorCode(),
+          updateHeatComputeErrorBuilder.message());
       throw new CoreException(updateHeatComputeErrorBuilder);
     }
   }
 
-  private void validateVfcCompute(ComputeEntity compute, Collection<ComputeEntity> vfcComputeList,
-                                  String event) {
-    if (isComputeNameDuplicate(vfcComputeList,compute.getComputeCompositionData().getName(),
-        compute.getId())) {
-      ErrorCode errorCode = DuplicateComputeInComponentErrorBuilder
-          .getDuplicateComputeNameErrorBuilder(compute.getComputeCompositionData().getName(),
-              compute.getComponentId());
-
-      MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
-          event, ErrorLevel.ERROR.name(),
-          errorCode.id(),errorCode.message());
-
-      throw new CoreException(errorCode);
-    }
-  }
-
-  private boolean isComputeNameDuplicate(Collection<ComputeEntity> computes, String name, String computeId) {
-    for (ComputeEntity compute : computes) {
-      if (compute.getComputeCompositionData().getName().equalsIgnoreCase(name) && !compute.getId().equals(computeId)) {
-        return true;
-      }
-    }
-    return false;
-  }
-
-
   private ComputeEntity getComputeEntity(String vspId, Version version, String componentId,
-  String computeId) {
-      //validateComponentId(vspId,version,componentId);
-      ComputeEntity computeEntity = computeDao.get(new ComputeEntity(vspId, version, componentId, computeId));
-      VersioningUtil.validateEntityExistence(computeEntity, new ComputeEntity(vspId, version, componentId,
-      computeId), VspDetails.ENTITY_TYPE);
-      return computeEntity;
-      }
-
-  private Collection<ComputeEntity> listComputes(String vspId, Version version, String componentId) {
-    return computeDao.list(new ComputeEntity(vspId, version, componentId, null));
+                                         String computeId) {
+    ComputeEntity computeEntity =
+        computeDao.get(new ComputeEntity(vspId, version, componentId, computeId));
+    VersioningUtil
+        .validateEntityExistence(computeEntity, new ComputeEntity(vspId, version, componentId,
+            computeId), VspDetails.ENTITY_TYPE);
+    return computeEntity;
   }
 
   @Override
-  public void deleteCompute(String vspId, Version version, String componentId, String
-      computeFlavorId, String user) {
+  public void deleteCompute(String vspId, Version version, String componentId,
+                            String computeFlavorId) {
     final String VSP_COMPOSITION_EDIT_NOT_ALLOWED_MSG =
         "Composition entities may not be created / deleted for Vendor Software Product "
             + "whose entities were uploaded";
     mdcDataDebugMessage.debugEntryMessage("VSP id, component id, compute id", vspId,
         componentId, computeFlavorId);
 
-    /*Version activeVersion =
-        getVersionInfo(vspId, VersionableEntityAction.Write, user).getActiveVersion();*/
     if (!vspInfoDao.isManual(vspId, version)) {
       MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
           LoggerTragetServiceName.DELETE_COMPUTE, ErrorLevel.ERROR.name(),
@@ -442,30 +293,32 @@
               .withId(VendorSoftwareProductErrorCodes.VSP_COMPOSITION_EDIT_NOT_ALLOWED)
               .withMessage(VSP_COMPOSITION_EDIT_NOT_ALLOWED_MSG).build());
     }
-    ComputeEntity retrived = getCompute(vspId,version,componentId,computeFlavorId);
-    if (retrived != null){
-      deleteComputeFromDeploymentFlavors(vspId,version,computeFlavorId);
+    ComputeEntity retrieved = getValidatedCompute(vspId, version, componentId, computeFlavorId);
+    if (retrieved != null) {
+      deleteComputeFromDeploymentFlavors(vspId, version, computeFlavorId);
       computeDao.delete(new ComputeEntity(vspId, version, componentId, computeFlavorId));
+      deleteUniqueValue(retrieved.getVspId(), retrieved.getVersion(), retrieved.getComponentId(),
+          retrieved.getComputeCompositionData().getName());
     }
 
     mdcDataDebugMessage.debugExitMessage("VSP id, component id, compute id", vspId,
         componentId, computeFlavorId);
   }
 
-  private void deleteComputeFromDeploymentFlavors(String vspId, Version activeVersion,
+  private void deleteComputeFromDeploymentFlavors(String vspId, Version version,
                                                   String computeFlavorId) {
-    //Collection<DeploymentFlavorEntity> listDF = listDeploymentFlavors(vspId, activeVersion);
-    Collection<DeploymentFlavorEntity> listDF = deploymentFlavorDao.list(new DeploymentFlavorEntity
-        (vspId, activeVersion, null));
-    for(DeploymentFlavorEntity df : listDF) {
-      DeploymentFlavorEntity deploymentFlavorEntity=removeComputeFromDF(df, computeFlavorId);
-      if(deploymentFlavorEntity!=null)
+    Collection<DeploymentFlavorEntity> listDF =
+        deploymentFlavorDao.list(new DeploymentFlavorEntity(vspId, version, null));
+    for (DeploymentFlavorEntity df : listDF) {
+      DeploymentFlavorEntity deploymentFlavorEntity = removeComputeFromDF(df, computeFlavorId);
+      if (deploymentFlavorEntity != null) {
         deploymentFlavorDao.update(deploymentFlavorEntity);
+      }
     }
   }
 
-  private DeploymentFlavorEntity removeComputeFromDF(DeploymentFlavorEntity df, String
-      computeFlavorId) {
+  private DeploymentFlavorEntity removeComputeFromDF(DeploymentFlavorEntity df,
+                                                     String computeFlavorId) {
     DeploymentFlavor flavor = df.getDeploymentFlavorCompositionData();
     List<ComponentComputeAssociation> associations = flavor.getComponentComputeAssociations();
     if (associations != null) {
@@ -486,20 +339,47 @@
     return null;
   }
 
-  protected String getComputeCompositionSchema(SchemaTemplateInput schemaInput){
-    mdcDataDebugMessage.debugEntryMessage(null, null);
-    mdcDataDebugMessage.debugExitMessage(null, null);
-    return SchemaGenerator.generate(SchemaTemplateContext.composition, CompositionEntityType.compute, schemaInput);
+  protected String getComputeCompositionSchema(SchemaTemplateInput schemaInput) {
+    mdcDataDebugMessage.debugEntryMessage(null);
+    mdcDataDebugMessage.debugExitMessage(null);
+    return SchemaGenerator
+        .generate(SchemaTemplateContext.composition, CompositionEntityType.compute, schemaInput);
   }
 
-   /*boolean isManual(String vspId, Version version) {
+  protected String getComputeQuestionnaireSchema(SchemaTemplateInput schemaInput) {
+    mdcDataDebugMessage.debugEntryMessage(null);
+    mdcDataDebugMessage.debugExitMessage(null);
+    return SchemaGenerator
+        .generate(SchemaTemplateContext.questionnaire, CompositionEntityType.compute, schemaInput);
+  }
 
-    VspDetails vsp = vspInfoDao.get(new VspDetails(vspId, version));
-    String onboardingMethod = vsp.getOnboardingMethod();
-    if (MANUAL.equals(onboardingMethod)) {
-      return true;
+  protected void validateUniqueName(String vspId, Version version, String componentId,
+                                    String name) {
+    UniqueValueUtil.validateUniqueValue(VendorSoftwareProductConstants.UniqueValues.COMPUTE_NAME,
+        vspId, version.getId(), componentId, name);
+  }
+
+  protected void createUniqueName(String vspId, Version version, String componentId, String name) {
+    UniqueValueUtil
+        .createUniqueValue(VendorSoftwareProductConstants.UniqueValues.COMPUTE_NAME, vspId,
+            version.getId(), componentId, name);
+  }
+
+  protected void updateUniqueName(String vspId, Version version, String componentId,
+                                  String oldName, String newName) {
+    UniqueValueUtil
+        .updateUniqueValue(VendorSoftwareProductConstants.UniqueValues.COMPUTE_NAME, oldName,
+            newName, vspId, version.getId(), componentId);
+  }
+
+  protected void deleteUniqueValue(String vspId, Version version, String componentId, String name) {
+    if (componentId == null) {
+      UniqueValueUtil
+          .deleteUniqueValue(VendorSoftwareProductConstants.UniqueValues.COMPUTE_NAME, vspId,
+              version.getId(), name);
     }
-    return false;
-  }*/
-
+    UniqueValueUtil
+        .deleteUniqueValue(VendorSoftwareProductConstants.UniqueValues.COMPUTE_NAME, vspId,
+            version.getId(), componentId, name);
+  }
 }
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/DeploymentFlavorManagerImpl.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/DeploymentFlavorManagerImpl.java
index 0873eaf..f1acaae 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/DeploymentFlavorManagerImpl.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/DeploymentFlavorManagerImpl.java
@@ -44,18 +44,14 @@
   private VendorSoftwareProductInfoDao vspInfoDao;
   private DeploymentFlavorDao deploymentFlavorDao;
   private CompositionEntityDataManager compositionEntityDataManager;
-  private  ComponentDao componentDao;
+  private ComponentDao componentDao;
   private ComputeDao computeDao;
 
-  public DeploymentFlavorManagerImpl(
-      VendorSoftwareProductInfoDao vspInfoDao,
-      DeploymentFlavorDao deploymentFlavorDao,
-      CompositionEntityDataManager compositionEntityDataManager,
-      ComponentDao componentDao,
-      ComputeDao computeDao
-
-  ) {
-
+  public DeploymentFlavorManagerImpl(VendorSoftwareProductInfoDao vspInfoDao,
+                                     DeploymentFlavorDao deploymentFlavorDao,
+                                     CompositionEntityDataManager compositionEntityDataManager,
+                                     ComponentDao componentDao,
+                                     ComputeDao computeDao) {
     this.vspInfoDao = vspInfoDao;
     this.deploymentFlavorDao = deploymentFlavorDao;
     this.compositionEntityDataManager = compositionEntityDataManager;
@@ -65,31 +61,17 @@
   }
 
   @Override
-  public Collection<DeploymentFlavorEntity> listDeploymentFlavors(String vspId, Version version,
-                                                                  String user) {
+  public Collection<DeploymentFlavorEntity> listDeploymentFlavors(String vspId, Version version) {
     mdcDataDebugMessage.debugEntryMessage("VSP id", vspId);
-    /*version = VersioningUtil
-        .resolveVersion(version, getVersionInfo(vspId, VersionableEntityAction.Read, user));*/
-
     mdcDataDebugMessage.debugExitMessage("VSP id", vspId);
-    return listDeploymentFlavors(vspId, version);
-  }
-
-  private Collection<DeploymentFlavorEntity> listDeploymentFlavors(String vspId, Version version) {
-    Collection<DeploymentFlavorEntity> deploymentFlavorEntities =
-        deploymentFlavorDao.list(new DeploymentFlavorEntity(vspId, version, null));
-    return deploymentFlavorEntities;
+    return deploymentFlavorDao.list(new DeploymentFlavorEntity(vspId, version, null));
   }
 
   @Override
   public DeploymentFlavorEntity createDeploymentFlavor(
-      DeploymentFlavorEntity deploymentFlavorEntity, String user) {
-    DeploymentFlavorEntity createDeploymentFlavor = null;
+      DeploymentFlavorEntity deploymentFlavorEntity) {
+    DeploymentFlavorEntity createDeploymentFlavor;
     mdcDataDebugMessage.debugEntryMessage("VSP id ", deploymentFlavorEntity.getVspId());
-    /*Version activeVersion =
-        getVersionInfo(deploymentFlavorEntity.getVspId(), VersionableEntityAction.Write, user)
-            .getActiveVersion();
-    deploymentFlavorEntity.setVersion(activeVersion);*/
 
     if (!vspInfoDao.isManual(deploymentFlavorEntity.getVspId(),
         deploymentFlavorEntity.getVersion())) {
@@ -100,31 +82,30 @@
           LoggerErrorCode.PERMISSION_ERROR.getErrorCode(), deploymentFlavorErrorBuilder.message());
       throw new CoreException(deploymentFlavorErrorBuilder);
     } else {
-      validateDeploymentFlavor(deploymentFlavorEntity, user, deploymentFlavorEntity.getVersion());
+      validateDeploymentFlavor(deploymentFlavorEntity, deploymentFlavorEntity.getVersion());
       createDeploymentFlavor =
           compositionEntityDataManager.createDeploymentFlavor(deploymentFlavorEntity);
     }
     return createDeploymentFlavor;
   }
 
-  private void validateDeploymentFlavor(DeploymentFlavorEntity deploymentFlavorEntity, String
-      user, Version activeVersion) {
-
+  private void validateDeploymentFlavor(DeploymentFlavorEntity deploymentFlavorEntity,
+                                        Version version) {
     //Validation for unique model.
     Collection<DeploymentFlavorEntity> listDeploymentFlavors =
         listDeploymentFlavors(deploymentFlavorEntity.getVspId(),
-            activeVersion);
+            version);
     isDeploymentFlavorModelDuplicate(deploymentFlavorEntity, listDeploymentFlavors);
 
     List<String> featureGroups =
-        getFeatureGroupListForVsp(deploymentFlavorEntity.getVspId(), user, activeVersion);
+        getFeatureGroupListForVsp(deploymentFlavorEntity.getVspId(), version);
     String featureGroup = deploymentFlavorEntity.getDeploymentFlavorCompositionData()
         .getFeatureGroupId();
-    if (featureGroup != null && featureGroup.trim().length()>0) {
+    if (featureGroup != null && featureGroup.trim().length() > 0) {
       if (isEmpty(featureGroups) || (!(validFeatureGroup(featureGroups, featureGroup)))) {
         ErrorCode deploymentFlavorErrorBuilder = DeploymentFlavorErrorBuilder
             .getFeatureGroupNotexistErrorBuilder(featureGroup, deploymentFlavorEntity.getVspId(),
-                activeVersion);
+                version);
         MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
             LoggerTragetServiceName.CREATE_DEPLOYMENT_FLAVOR, ErrorLevel.ERROR.name(),
             LoggerErrorCode.DATA_ERROR.getErrorCode(), deploymentFlavorErrorBuilder.message());
@@ -132,7 +113,7 @@
       }
     }
 
-    validateComponentComputeAssociation(deploymentFlavorEntity, activeVersion);
+    validateComponentComputeAssociation(deploymentFlavorEntity, version);
   }
 
   private void isDeploymentFlavorModelDuplicate(DeploymentFlavorEntity deploymentFlavorEntity,
@@ -152,14 +133,8 @@
     });
   }
 
-  private List<String> getFeatureGroupListForVsp(String vspId,
-                                                 String user, Version activeVersion) {
-    /*VersionedVendorSoftwareProductInfo versionedVendorSoftwareProductInfo = getVspDetails(
-        vspId,activeVersion, user);
-    return versionedVendorSoftwareProductInfo.getVspDetails()
-        .getFeatureGroups();*/
-
-    final VspDetails vspDetails = vspInfoDao.get(new VspDetails(vspId, activeVersion));
+  private List<String> getFeatureGroupListForVsp(String vspId, Version version) {
+    final VspDetails vspDetails = vspInfoDao.get(new VspDetails(vspId, version));
     return vspDetails.getFeatureGroups();
   }
 
@@ -183,7 +158,7 @@
   }
 
   private void validateComponentComputeAssociation(DeploymentFlavorEntity deploymentFlavorEntity,
-                                                   Version activeVersion) {
+                                                   Version version) {
     List<ComponentComputeAssociation> componentComputeAssociationList = deploymentFlavorEntity
         .getDeploymentFlavorCompositionData().getComponentComputeAssociations();
     List<String> vfcList = new ArrayList<>();
@@ -201,14 +176,14 @@
               LoggerErrorCode.DATA_ERROR.getErrorCode(), invalidAssociationErrorBuilder.message());
           throw new CoreException(invalidAssociationErrorBuilder);
         } else if (componentComputeAssociation.getComponentId() != null &&
-            componentComputeAssociation.getComponentId().trim().length() > 0 ) {
-          ComponentEntity component = getComponent(deploymentFlavorEntity.getVspId(), activeVersion,
+            componentComputeAssociation.getComponentId().trim().length() > 0) {
+          ComponentEntity component = getComponent(deploymentFlavorEntity.getVspId(), version,
               componentComputeAssociation.getComponentId());
           if (componentComputeAssociation
               .getComputeFlavorId() != null && componentComputeAssociation
-              .getComputeFlavorId().trim().length() > 0 ) {
+              .getComputeFlavorId().trim().length() > 0) {
             ComputeEntity computeFlavor = computeDao.get(new ComputeEntity(deploymentFlavorEntity
-                    .getVspId(), activeVersion, componentComputeAssociation.getComponentId(),
+                .getVspId(), version, componentComputeAssociation.getComponentId(),
                 componentComputeAssociation.getComputeFlavorId()));
             if (computeFlavor == null) {
               ErrorCode invalidComputeIdErrorBuilder = DeploymentFlavorErrorBuilder
@@ -251,22 +226,19 @@
   @Override
   public CompositionEntityResponse<DeploymentFlavor> getDeploymentFlavor(String vspId,
                                                                          Version version,
-                                                                         String deploymentFlavorId,
-                                                                         String user) {
+                                                                         String deploymentFlavorId) {
     mdcDataDebugMessage
         .debugEntryMessage("VSP id, deployment flavor id", vspId, deploymentFlavorId);
 
-    /*version = VersioningUtil
-        .resolveVersion(version, getVersionInfo(vspId, VersionableEntityAction.Read, user));*/
-    DeploymentFlavorEntity deploymentFlavorEntity = getDeploymentFlavor(vspId,version,
-        deploymentFlavorId);
+    DeploymentFlavorEntity deploymentFlavorEntity =
+        getValidatedDeploymentFlavor(vspId, version, deploymentFlavorId);
     DeploymentFlavor deploymentFlavor = deploymentFlavorEntity.getDeploymentFlavorCompositionData();
     DeploymentFlavorCompositionSchemaInput schemaInput = new
         DeploymentFlavorCompositionSchemaInput();
     schemaInput.setManual(vspInfoDao.isManual(vspId, version));
     schemaInput.setDeploymentFlavor(deploymentFlavor);
     List<String> featureGroups =
-        getFeatureGroupListForVsp(vspId, user, version);
+        getFeatureGroupListForVsp(vspId, version);
     schemaInput.setFeatureGroupIds(featureGroups);
     CompositionEntityResponse<DeploymentFlavor> response = new CompositionEntityResponse<>();
     response.setId(deploymentFlavorId);
@@ -280,27 +252,24 @@
     return response;
   }
 
-  private DeploymentFlavorEntity getDeploymentFlavor(String vspId, Version version, String
+  private DeploymentFlavorEntity getValidatedDeploymentFlavor(String vspId, Version version, String
       deploymentFlavorId) {
     DeploymentFlavorEntity retrieved = deploymentFlavorDao.get(new DeploymentFlavorEntity(vspId,
         version, deploymentFlavorId));
     VersioningUtil
         .validateEntityExistence(retrieved, new DeploymentFlavorEntity(vspId, version,
-            deploymentFlavorId ), VspDetails.ENTITY_TYPE);
+            deploymentFlavorId), VspDetails.ENTITY_TYPE);
     return retrieved;
   }
 
   @Override
   public CompositionEntityResponse<DeploymentFlavor> getDeploymentFlavorSchema(String vspId,
-                                                                               Version version,
-                                                                               String user) {
-    /*version = VersioningUtil
-        .resolveVersion(version, getVersionInfo(vspId, VersionableEntityAction.Read, user));*/
-    DeploymentFlavorCompositionSchemaInput schemaInput= new
-        DeploymentFlavorCompositionSchemaInput();
+                                                                               Version version) {
+    DeploymentFlavorCompositionSchemaInput schemaInput =
+        new DeploymentFlavorCompositionSchemaInput();
     schemaInput.setManual(vspInfoDao.isManual(vspId, version));
     List<String> featureGroups =
-        getFeatureGroupListForVsp(vspId, user, version);
+        getFeatureGroupListForVsp(vspId, version);
     schemaInput.setFeatureGroupIds(featureGroups);
     CompositionEntityResponse<DeploymentFlavor> response = new CompositionEntityResponse<>();
     response.setSchema((SchemaGenerator
@@ -310,14 +279,13 @@
   }
 
   @Override
-  public void deleteDeploymentFlavor(String vspId, Version version, String deploymentFlavorId,
-                                     String user) {
+  public void deleteDeploymentFlavor(String vspId, Version version, String deploymentFlavorId) {
     mdcDataDebugMessage
         .debugEntryMessage("VSP id, deployment flavor id", vspId, deploymentFlavorId);
     /*Version activeVersion =
         getVersionInfo(vspId, VersionableEntityAction.Write, user).getActiveVersion();*/
-    DeploymentFlavorEntity deploymentFlavorEntity = getDeploymentFlavor(vspId,version,
-        deploymentFlavorId);
+    DeploymentFlavorEntity deploymentFlavorEntity =
+        getValidatedDeploymentFlavor(vspId, version, deploymentFlavorId);
     if (!vspInfoDao.isManual(vspId, version)) {
       final ErrorCode deleteDeploymentFlavorErrorBuilder =
           NotSupportedHeatOnboardMethodErrorBuilder
@@ -328,7 +296,7 @@
           deleteDeploymentFlavorErrorBuilder.message());
       throw new CoreException(deleteDeploymentFlavorErrorBuilder);
     }
-    if(deploymentFlavorEntity != null) {
+    if (deploymentFlavorEntity != null) {
       deploymentFlavorDao.delete(new DeploymentFlavorEntity(vspId, version, deploymentFlavorId));
 
     }
@@ -336,8 +304,8 @@
         .debugExitMessage("VSP id, deployment flavor id", vspId, deploymentFlavorId);
   }
 
-  public CompositionEntityValidationData updateDeploymentFlavor(DeploymentFlavorEntity
-                                                                    deploymentFlavorEntity, String user) {
+  public CompositionEntityValidationData updateDeploymentFlavor(
+      DeploymentFlavorEntity deploymentFlavorEntity) {
     mdcDataDebugMessage.debugEntryMessage("VSP id, deploymentFlavor id", deploymentFlavorEntity
         .getVspId(), deploymentFlavorEntity.getId());
     /*Version activeVersion =
@@ -355,9 +323,9 @@
           updateDeploymentFlavorErrorBuilder.message());
       throw new CoreException(updateDeploymentFlavorErrorBuilder);
     }
-    //deploymentFlavorEntity.setVersion(activeVersion);
     DeploymentFlavorEntity retrieved =
-        getDeploymentFlavor(deploymentFlavorEntity.getVspId(), deploymentFlavorEntity.getVersion(),
+        getValidatedDeploymentFlavor(deploymentFlavorEntity.getVspId(),
+            deploymentFlavorEntity.getVersion(),
             deploymentFlavorEntity.getId());
 
 
@@ -367,7 +335,8 @@
     isDeploymentFlavorModelDuplicate(deploymentFlavorEntity, listDeploymentFlavors);
 
     //validateComponentComputeAssociation(deploymentFlavorEntity, activeVersion);
-    validateComponentComputeAssociation(deploymentFlavorEntity, deploymentFlavorEntity.getVersion());
+    validateComponentComputeAssociation(deploymentFlavorEntity,
+        deploymentFlavorEntity.getVersion());
 
     DeploymentFlavorCompositionSchemaInput schemaInput = new
         DeploymentFlavorCompositionSchemaInput();
@@ -376,7 +345,7 @@
     schemaInput.setDeploymentFlavor(retrieved.getDeploymentFlavorCompositionData());
 
     List<String> featureGroups =
-        getFeatureGroupListForVsp(deploymentFlavorEntity.getVspId(), user,
+        getFeatureGroupListForVsp(deploymentFlavorEntity.getVspId(),
             deploymentFlavorEntity.getVersion());
     schemaInput.setFeatureGroupIds(featureGroups);
 
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ImageManagerImpl.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ImageManagerImpl.java
index 82b7139..0429ba4 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ImageManagerImpl.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ImageManagerImpl.java
@@ -37,72 +37,49 @@
 import java.util.Collection;
 import java.util.stream.Collectors;
 
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
-
 public class ImageManagerImpl implements ImageManager {
   private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage();
   private VendorSoftwareProductInfoDao vspInfoDao;
   private ImageDao imageDao;
   private CompositionEntityDataManager compositionEntityDataManager;
 
-  private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName());
-
-  public ImageManagerImpl(
-          VendorSoftwareProductInfoDao vspInfoDao,
-          ImageDao imageDao,
-          CompositionEntityDataManager compositionEntityDataManager
-
-  ) {
-
+  public ImageManagerImpl(VendorSoftwareProductInfoDao vspInfoDao,
+                          ImageDao imageDao,
+                          CompositionEntityDataManager compositionEntityDataManager) {
     this.vspInfoDao = vspInfoDao;
     this.imageDao = imageDao;
     this.compositionEntityDataManager = compositionEntityDataManager;
-
   }
 
   @Override
-  public ImageEntity createImage(ImageEntity imageEntity, String user) {
-    /*Version activeVersion = getVersionInfo(imageEntity.getVspId(),
-        VersionableEntityAction.Write, user).getActiveVersion();
-
-    imageEntity.setVersion(activeVersion);*/
+  public ImageEntity createImage(ImageEntity imageEntity) {
     boolean isManual = vspInfoDao.isManual(imageEntity.getVspId(), imageEntity.getVersion());
     if (!isManual) {
-
       ErrorCode errorCode = NotSupportedHeatOnboardMethodErrorBuilder
-              .getAddImageNotSupportedHeatOnboardMethodErrorBuilder();
+          .getAddImageNotSupportedHeatOnboardMethodErrorBuilder();
 
       MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
-              LoggerTragetServiceName.CREATE_IMAGE, ErrorLevel.ERROR.name(),
-              errorCode.id(), errorCode.message());
+          LoggerTragetServiceName.CREATE_IMAGE, ErrorLevel.ERROR.name(),
+          errorCode.id(), errorCode.message());
 
       throw new CoreException(errorCode);
     }
-
-    /*Collection<ImageEntity> vfcImageList = listImages(imageEntity.getVspId() ,
-        imageEntity.getVersion(), imageEntity.getComponentId());*/
     compositionEntityDataManager.createImage(imageEntity);
     return imageEntity;
   }
 
   @Override
-  public Collection<ImageEntity> listImages(String vspId, Version version, String componentId,
-                                            String user) {
+  public Collection<ImageEntity> listImages(String vspId, Version version, String componentId) {
     mdcDataDebugMessage.debugEntryMessage("VSP id", vspId);
-    Collection<ImageEntity> imageEntities = listImages(vspId, version, componentId);
+    Collection<ImageEntity> imageEntities =
+        imageDao.list(new ImageEntity(vspId, version, componentId, null));
 
     mdcDataDebugMessage.debugExitMessage("VSP id", vspId);
-
     return imageEntities;
   }
 
-  private Collection<ImageEntity> listImages(String vspId, Version version, String componentId) {
-    return imageDao.list(new ImageEntity(vspId, version, componentId, null));
-  }
-
   @Override
-  public CompositionEntityResponse getImageSchema(String vspId, String user) {
+  public CompositionEntityResponse<Image> getImageSchema(String vspId) {
     mdcDataDebugMessage.debugEntryMessage("VSP id, image id", vspId);
 
     CompositionEntityResponse<Image> response = new CompositionEntityResponse<>();
@@ -118,14 +95,10 @@
 
   @Override
   public CompositionEntityResponse<Image> getImage(String vspId, Version version, String
-          componentId, String imageId, String user) {
+      componentId, String imageId) {
 
     mdcDataDebugMessage.debugEntryMessage("VSP id, componentId, image id", vspId, componentId,
-            imageId);
-
-    /*version = VersioningUtil
-        .resolveVersion(version, getVersionInfo(vspId, VersionableEntityAction.Read, user));*/
-
+        imageId);
     ImageEntity imageEntity = getImageEntity(vspId, version, componentId, imageId);
 
     Image image = imageEntity.getImageCompositionData();
@@ -142,25 +115,21 @@
     response.setSchema(getImageCompositionSchema(schemaInput));
 
     mdcDataDebugMessage.debugExitMessage("VSP id, componentId, image id", vspId, componentId,
-            imageId);
+        imageId);
 
     return response;
   }
 
   @Override
   public QuestionnaireResponse getImageQuestionnaire(String vspId, Version version, String
-          componentId, String imageId, String user) {
+      componentId, String imageId) {
     mdcDataDebugMessage.debugEntryMessage("VSP id", vspId);
-
-    /*version = VersioningUtil
-        .resolveVersion(version, getVersionInfo(vspId, VersionableEntityAction.Read, user));
-    validateComponentId(vspId,version,componentId);*/
     QuestionnaireResponse questionnaireResponse = new QuestionnaireResponse();
     //validateComponentId(vspId,version,componentId);
 
     ImageEntity retrieved = imageDao.getQuestionnaireData(vspId, version, componentId, imageId);
     VersioningUtil.validateEntityExistence(retrieved, new ImageEntity(vspId, version, componentId,
-            imageId), ComponentEntity.ENTITY_TYPE);
+        imageId), ComponentEntity.ENTITY_TYPE);
     questionnaireResponse.setData(retrieved.getQuestionnaireData());
     questionnaireResponse.setSchema(getImageQuestionnaireSchema(null));
 
@@ -170,72 +139,63 @@
   }
 
   @Override
-  public void deleteImage(String vspId, Version version, String componentId, String imageId, String
-          user) {
+  public void deleteImage(String vspId, Version version, String componentId, String imageId) {
     mdcDataDebugMessage
-            .debugEntryMessage("VSP id, component id", vspId, componentId, imageId);
-
-    /*Version activeVersion =
-        getVersionInfo(vspId, VersionableEntityAction.Write, user).getActiveVersion();
-    ComponentEntity component = getComponent(vspId, activeVersion, componentId);*/
+        .debugEntryMessage("VSP id, component id", vspId, componentId, imageId);
     ImageEntity imageEntity = getImageEntity(vspId, version, componentId, imageId);
     if (!vspInfoDao.isManual(vspId, version)) {
       final ErrorCode deleteImageErrorBuilder =
-              NotSupportedHeatOnboardMethodErrorBuilder
-                      .getDelImageNotSupportedHeatOnboardMethodErrorBuilder();
+          NotSupportedHeatOnboardMethodErrorBuilder
+              .getDelImageNotSupportedHeatOnboardMethodErrorBuilder();
       MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
-              LoggerTragetServiceName.DELETE_IMAGE, ErrorLevel.ERROR.name(),
-              LoggerErrorCode.PERMISSION_ERROR.getErrorCode(),
-              deleteImageErrorBuilder.message());
+          LoggerTragetServiceName.DELETE_IMAGE, ErrorLevel.ERROR.name(),
+          LoggerErrorCode.PERMISSION_ERROR.getErrorCode(),
+          deleteImageErrorBuilder.message());
       throw new CoreException(deleteImageErrorBuilder);
     }
     if (imageEntity != null) {
       imageDao.delete(new ImageEntity(vspId, version, componentId, imageId));
     }
     mdcDataDebugMessage
-            .debugExitMessage("VSP id, component id", vspId, componentId, imageId);
+        .debugExitMessage("VSP id, component id", vspId, componentId, imageId);
   }
 
   private void validateHeatVspImageUpdate(String name, String value, String retrivedValue) {
-
-    if(value != null && !value.equals(retrivedValue)) {
-
+    if (value != null && !value.equals(retrivedValue)) {
       final ErrorCode updateHeatImageErrorBuilder =
-              ImageErrorBuilder.getImageHeatReadOnlyErrorBuilder(name);
+          ImageErrorBuilder.getImageHeatReadOnlyErrorBuilder(name);
 
       MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
-              LoggerTragetServiceName.UPDATE_IMAGE, ErrorLevel.ERROR.name(),
-              LoggerErrorCode.PERMISSION_ERROR.getErrorCode(),
-              updateHeatImageErrorBuilder.message());
+          LoggerTragetServiceName.UPDATE_IMAGE, ErrorLevel.ERROR.name(),
+          LoggerErrorCode.PERMISSION_ERROR.getErrorCode(),
+          updateHeatImageErrorBuilder.message());
       throw new CoreException(updateHeatImageErrorBuilder);
     }
   }
 
   @Override
-  public CompositionEntityValidationData updateImage(ImageEntity image, String user) {
+  public CompositionEntityValidationData updateImage(ImageEntity image) {
     mdcDataDebugMessage
-            .debugEntryMessage("VSP id, component id", image.getVspId(), image.getComponentId(),
-                    image.getId());
-
-    /*Version activeVersion =
-        getVersionInfo(image.getVspId(), VersionableEntityAction.Write, user).getActiveVersion();
-    image.setVersion(activeVersion);*/
-    boolean isManual = vspInfoDao.isManual(image.getVspId(), image.getVersion());
-    ImageEntity retrieved = getImageEntity(image.getVspId(), image.getVersion(), image.getComponentId(),
+        .debugEntryMessage("VSP id, component id", image.getVspId(), image.getComponentId(),
             image.getId());
 
-    if(!isManual) {
+    boolean isManual = vspInfoDao.isManual(image.getVspId(), image.getVersion());
+    ImageEntity retrieved =
+        getImageEntity(image.getVspId(), image.getVersion(), image.getComponentId(),
+            image.getId());
+
+    if (!isManual) {
       final Image imageCompositionData = image.getImageCompositionData();
       final String fileName = imageCompositionData.getFileName();
       //final String format = imageCompositionData.getFormat();
       validateHeatVspImageUpdate("fileName", fileName, retrieved.getImageCompositionData()
-              .getFileName());
+          .getFileName());
       /*validateHeatVspImageUpdate("format", format, retrieved.getImageCompositionData()
           .getFormat());*/
     }
 
-    Collection<ImageEntity> vfcImageList = listImages(image.getVspId() ,
-            image.getVersion(), image.getComponentId());
+    Collection<ImageEntity> vfcImageList = listImages(image.getVspId(),
+        image.getVersion(), image.getComponentId());
 
     //Set to null so that retrieved object is equal to one in list and gets removed.
     retrieved.setQuestionnaireData(null);
@@ -249,50 +209,45 @@
     schemaInput.setImage(image.getImageCompositionData());
 
     CompositionEntityValidationData validationData = compositionEntityDataManager
-            .validateEntity(image, SchemaTemplateContext.composition, schemaInput);
+        .validateEntity(image, SchemaTemplateContext.composition, schemaInput);
     if (CollectionUtils.isEmpty(validationData.getErrors())) {
       imageDao.update(image);
     }
 
     mdcDataDebugMessage
-            .debugExitMessage("VSP id, component id", image.getVspId(), image.getComponentId(),
-                    image.getId());
+        .debugExitMessage("VSP id, component id", image.getVspId(), image.getComponentId(),
+            image.getId());
 
     return validationData;
   }
 
   @Override
   public void updateImageQuestionnaire(String vspId, Version version, String componentId, String
-          imageId, String questionnaireData, String user) {
+      imageId, String questionnaireData) {
     mdcDataDebugMessage.debugEntryMessage("VSP id, component id, imageId", vspId, componentId,
-            imageId);
+        imageId);
 
     getImageEntity(vspId, version, componentId, imageId);
 
-    /*Version activeVersion =
-        getVersionInfo(vspId, VersionableEntityAction.Write, user).getActiveVersion();
-
-    getComponent(vspId, activeVersion, componentId);*/
 
     final ImageDetails image = JsonUtil.json2Object(questionnaireData, ImageDetails.class);
     final String format = image.getFormat();
     try {
       if (format != null) {
-        final ImageFormat imageFormat = ImageFormat.valueOf(format);
+        ImageFormat.valueOf(format);
       }
     } catch (IllegalArgumentException exception) {
-      log.debug("", exception);
       ErrorCode errorCode = ImageErrorBuilder.getInvalidImageFormatErrorBuilder();
       MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
-              LoggerTragetServiceName.UPDATE_IMAGE, ErrorLevel.ERROR.name(),
-              errorCode.id(), errorCode.message() );
+          LoggerTragetServiceName.UPDATE_IMAGE, ErrorLevel.ERROR.name(),
+          errorCode.id(), errorCode.message());
       throw new CoreException(errorCode);
     }
 
     //Validate Format is read only for HEAT Onboarding
     if (!vspInfoDao.isManual(vspId, version)) {
       final QuestionnaireResponse imageQuestionnaire = getImageQuestionnaire(vspId, version,
-              componentId, imageId, user);
+          componentId, imageId);
       final String data = imageQuestionnaire.getData();
       if (data != null) {
         String retrivedFormat = JsonUtil.json2Object(data, ImageDetails.class).getFormat();
@@ -300,34 +255,33 @@
       }
     }
 
-    if(!isImageVersionUnique(vspId, version, componentId, imageId, image, user))
-    {
+    if (!isImageVersionUnique(vspId, version, componentId, imageId, image)) {
       ErrorCode errorCode = ImageErrorBuilder.getDuplicateImageVersionErrorBuilder(image
-              .getVersion(), componentId);
+          .getVersion(), componentId);
 
       MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
-              LoggerTragetServiceName.UPDATE_IMAGE, ErrorLevel.ERROR.name(),
-              errorCode.id(),errorCode.message());
+          LoggerTragetServiceName.UPDATE_IMAGE, ErrorLevel.ERROR.name(),
+          errorCode.id(), errorCode.message());
 
       throw new CoreException(errorCode);
     }
 
     imageDao.updateQuestionnaireData(vspId, version, componentId, imageId, questionnaireData);
     mdcDataDebugMessage.debugExitMessage("VSP id, component id, imageId", vspId, componentId,
-            imageId);
+        imageId);
   }
 
-  private boolean isImageVersionUnique(String vspId, Version version, String componentId, String imageId,
-                                       ImageDetails image, String user)
-  {
+  private boolean isImageVersionUnique(String vspId, Version version, String componentId,
+                                       String imageId,
+                                       ImageDetails image) {
     boolean isPresent = true;
-    if(image!=null && image.getVersion()!=null)
-    {
-      Collection<ImageEntity> imageEntities = imageDao.list(new ImageEntity(vspId, version, componentId, null));
-      if(CollectionUtils.isNotEmpty(imageEntities))
-      {
-        imageEntities = imageEntities.stream().filter(imageEntity -> image.getVersion().trim().equalsIgnoreCase(
-                getImageVersion(vspId, version, componentId, imageEntity, user))
+    if (image != null && image.getVersion() != null) {
+      Collection<ImageEntity> imageEntities =
+          imageDao.list(new ImageEntity(vspId, version, componentId, null));
+      if (CollectionUtils.isNotEmpty(imageEntities)) {
+        imageEntities =
+            imageEntities.stream().filter(imageEntity -> image.getVersion().trim().equalsIgnoreCase(
+                getImageVersion(vspId, version, componentId, imageEntity))
                 && !imageEntity.getId().equals(imageId)).collect(Collectors.toList());
 
         isPresent = CollectionUtils.isEmpty(imageEntities);
@@ -337,14 +291,17 @@
     return isPresent;
   }
 
-  private String getImageVersion(String vspId, Version version, String componentId, ImageEntity imageEntity, String user)
-  {
+  private String getImageVersion(String vspId, Version version, String componentId,
+                                 ImageEntity imageEntity) {
     QuestionnaireResponse imageQuestionnaire = getImageQuestionnaire(vspId, version,
-            componentId, imageEntity.getId(), user);
-    ImageDetails imageDetails = JsonUtil.json2Object(imageQuestionnaire.getData(), ImageDetails.class);
+        componentId, imageEntity.getId());
+    ImageDetails imageDetails =
+        JsonUtil.json2Object(imageQuestionnaire.getData(), ImageDetails.class);
 
-    return imageDetails==null?null:imageDetails.getVersion()!=null?imageDetails.getVersion().trim():null;
+    return imageDetails == null ? null
+        : imageDetails.getVersion() != null ? imageDetails.getVersion().trim() : null;
   }
+
   private ImageEntity getImageEntity(String vspId, Version version, String componentId,
                                      String imageId) {
     //validateComponentId(vspId,version,componentId);
@@ -352,34 +309,24 @@
     ImageEntity imageEntity = imageDao.get(new ImageEntity(vspId, version, componentId, imageId));
 
     VersioningUtil.validateEntityExistence(imageEntity, new ImageEntity(vspId, version, componentId,
-            imageId), VspDetails.ENTITY_TYPE);
+        imageId), VspDetails.ENTITY_TYPE);
     return imageEntity;
   }
 
-
-  private boolean isImageNameDuplicate(Collection<ImageEntity> images, String fileName) {
-    for (ImageEntity image : images) {
-      if (image.getImageCompositionData().getFileName().equalsIgnoreCase(fileName)) {
-        return true;
-      }
-    }
-    return false;
-  }
-
   protected String getImageCompositionSchema(SchemaTemplateInput schemaInput) {
-    mdcDataDebugMessage.debugEntryMessage(null, null);
-    mdcDataDebugMessage.debugExitMessage(null, null);
+    mdcDataDebugMessage.debugEntryMessage(null);
+    mdcDataDebugMessage.debugExitMessage(null);
     return SchemaGenerator
-            .generate(SchemaTemplateContext.composition, CompositionEntityType.image,
-                    schemaInput);
+        .generate(SchemaTemplateContext.composition, CompositionEntityType.image,
+            schemaInput);
   }
 
   protected String getImageQuestionnaireSchema(SchemaTemplateInput schemaInput) {
-    mdcDataDebugMessage.debugEntryMessage(null, null);
+    mdcDataDebugMessage.debugEntryMessage(null);
 
-    mdcDataDebugMessage.debugExitMessage(null, null);
+    mdcDataDebugMessage.debugExitMessage(null);
     return SchemaGenerator
-            .generate(SchemaTemplateContext.questionnaire, CompositionEntityType.image,
-                    schemaInput);
+        .generate(SchemaTemplateContext.questionnaire, CompositionEntityType.image,
+            schemaInput);
   }
 }
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ManualVspToscaManagerImpl.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ManualVspToscaManagerImpl.java
index 8bdc7fd..fdb9621 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ManualVspToscaManagerImpl.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ManualVspToscaManagerImpl.java
@@ -6,8 +6,6 @@
 import org.openecomp.sdc.generator.datatypes.tosca.DeploymentFlavorModel;
 import org.openecomp.sdc.generator.datatypes.tosca.MultiFlavorVfcImage;
 import org.openecomp.sdc.generator.datatypes.tosca.VspModelInfo;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage;
 import org.openecomp.sdc.logging.context.impl.MdcDataErrorMessage;
 import org.openecomp.sdc.logging.types.LoggerConstants;
@@ -29,18 +27,15 @@
   private ManualVspDataCollectionService
       manualVspDataCollectionService = new ManualVspDataCollectionService();
 
-  private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName());
-
   @Override
-  public VspModelInfo gatherVspInformation(String vspId, Version version, String user) {
+  public VspModelInfo gatherVspInformation(String vspId, Version version) {
     mdcDataDebugMessage.debugEntryMessage(null, null);
     VspModelInfo vspModelInfo = new VspModelInfo();
     //Get Release Vendor Name
     Optional<String> releaseVendor;
     try {
-      releaseVendor = manualVspDataCollectionService.getReleaseVendor(vspId, version, user);
+      releaseVendor = manualVspDataCollectionService.getReleaseVendor(vspId, version);
     } catch (Exception ex) {
-      log.debug("", ex);
       releaseVendor = Optional.empty();
       MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_API,
           LoggerTragetServiceName.COLLECT_MANUAL_VSP_TOSCA_DATA, ErrorLevel.INFO.name(),
@@ -52,9 +47,8 @@
     //Get Allowed Deployment flavors information
     Map<String, DeploymentFlavorModel> allowedFlavors;
     try {
-      allowedFlavors = manualVspDataCollectionService.getAllowedFlavors(vspId, version, user);
+      allowedFlavors = manualVspDataCollectionService.getAllowedFlavors(vspId, version);
     } catch (Exception ex) {
-      log.debug("", ex);
       MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_API,
           LoggerTragetServiceName.COLLECT_MANUAL_VSP_TOSCA_DATA, ErrorLevel.INFO.name(),
           LoggerErrorCode.DATA_ERROR.getErrorCode(), "Unable to collect allowed flavors : "
@@ -69,9 +63,8 @@
     Map<String, List<MultiFlavorVfcImage>> vspComponentImages;
     try {
       vspComponentImages =
-          manualVspDataCollectionService.getVspComponentImages(vspId, version, user);
+          manualVspDataCollectionService.getVspComponentImages(vspId, version);
     } catch (Exception ex) {
-      log.debug("", ex);
       MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_API,
           LoggerTragetServiceName.COLLECT_MANUAL_VSP_TOSCA_DATA, ErrorLevel.INFO.name(),
           LoggerErrorCode.DATA_ERROR.getErrorCode(), "Unable to collect vsp component images : "
@@ -85,9 +78,8 @@
     //Get VFC component information
     Map<String, String> vspComponents;
     try {
-      vspComponents = manualVspDataCollectionService.getVspComponents(vspId, version, user);
+      vspComponents = manualVspDataCollectionService.getVspComponents(vspId, version);
     } catch (Exception ex) {
-      log.debug("", ex);
       MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_API,
           LoggerTragetServiceName.COLLECT_MANUAL_VSP_TOSCA_DATA, ErrorLevel.INFO.name(),
           LoggerErrorCode.DATA_ERROR.getErrorCode(), "Unable to collect vsp components : "
@@ -101,9 +93,8 @@
     //Get VSP component nic information
     Map<String, List<Nic>> vspComponentNics;
     try {
-      vspComponentNics = manualVspDataCollectionService.getVspComponentNics(vspId, version, user);
+      vspComponentNics = manualVspDataCollectionService.getVspComponentNics(vspId, version);
     } catch (Exception ex) {
-      log.debug("", ex);
       MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_API,
           LoggerTragetServiceName.COLLECT_MANUAL_VSP_TOSCA_DATA, ErrorLevel.INFO.name(),
           LoggerErrorCode.DATA_ERROR.getErrorCode(), "Unable to collect vsp component nics : "
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/MonitoringUploadsManagerFactoryImpl.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/MonitoringUploadsManagerFactoryImpl.java
index 6569312..eed566d 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/MonitoringUploadsManagerFactoryImpl.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/MonitoringUploadsManagerFactoryImpl.java
@@ -20,15 +20,13 @@
 
 package org.openecomp.sdc.vendorsoftwareproduct.impl;
 
-import org.openecomp.sdc.activityLog.ActivityLogManagerFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.MonitoringUploadsManager;
 import org.openecomp.sdc.vendorsoftwareproduct.MonitoringUploadsManagerFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.MonitoringUploadDaoFactory;
 
 public class MonitoringUploadsManagerFactoryImpl extends MonitoringUploadsManagerFactory {
   private static final MonitoringUploadsManager INSTANCE =
-      new MonitoringUploadsManagerImpl(MonitoringUploadDaoFactory.getInstance().createInterface(),
-          ActivityLogManagerFactory.getInstance().createInterface());
+      new MonitoringUploadsManagerImpl(MonitoringUploadDaoFactory.getInstance().createInterface());
 
   @Override
   public MonitoringUploadsManager createInterface() {
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/MonitoringUploadsManagerImpl.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/MonitoringUploadsManagerImpl.java
index 0f4d73f..bcfdefb 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/MonitoringUploadsManagerImpl.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/MonitoringUploadsManagerImpl.java
@@ -26,8 +26,6 @@
 import org.openecomp.core.utilities.file.FileContentHandler;
 import org.openecomp.core.utilities.file.FileUtils;
 import org.openecomp.core.utilities.orchestration.OnboardingTypesEnum;
-import org.openecomp.sdc.activityLog.ActivityLogManager;
-import org.openecomp.sdc.activitylog.dao.type.ActivityLogEntity;
 import org.openecomp.sdc.common.errors.CoreException;
 import org.openecomp.sdc.common.errors.Messages;
 import org.openecomp.sdc.common.utils.CommonUtil;
@@ -45,7 +43,6 @@
 import org.openecomp.sdc.vendorsoftwareproduct.MonitoringUploadsManager;
 import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentArtifactDao;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentMonitoringUploadEntity;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
 import org.openecomp.sdc.vendorsoftwareproduct.errors.MonitoringUploadErrorBuilder;
@@ -53,7 +50,6 @@
 import org.openecomp.sdc.vendorsoftwareproduct.utils.VendorSoftwareProductUtils;
 import org.openecomp.sdc.versioning.dao.types.Version;
 import org.openecomp.sdc.versioning.errors.VersionableSubEntityNotFoundErrorBuilder;
-import org.openecomp.sdcrests.activitylog.types.ActivityType;
 
 import java.io.IOException;
 import java.io.InputStream;
@@ -67,26 +63,20 @@
 
 public class MonitoringUploadsManagerImpl implements MonitoringUploadsManager {
   private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage();
-  private ActivityLogManager activityLogManager;
   private ComponentArtifactDao componentArtifactDao;
-  private VendorSoftwareProductDao vendorSoftwareProductDao;
   private static final Logger logger =
       LoggerFactory.getLogger(VendorSoftwareProductManagerImpl.class);
 
-  private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName());
-
-  MonitoringUploadsManagerImpl(ComponentArtifactDao componentArtifactDao,
-                               ActivityLogManager activityLogManager) {
+  MonitoringUploadsManagerImpl(ComponentArtifactDao componentArtifactDao) {
     this.componentArtifactDao = componentArtifactDao;
 
-    this.activityLogManager = activityLogManager;
     componentArtifactDao.registerVersioning(
         VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE);
   }
 
   @Override
   public void delete(String vspId, Version version, String componentId,
-                     MonitoringUploadType monitoringUploadType, String user) {
+                     MonitoringUploadType monitoringUploadType) {
     mdcDataDebugMessage.debugEntryMessage("VSP id, component id", vspId, componentId);
 
     ComponentMonitoringUploadEntity componentMonitoringUploadEntity =
@@ -112,8 +102,7 @@
   @Override
   public void upload(InputStream object, String filename, String vspId,
                      Version version, String componentId,
-                     MonitoringUploadType type,
-                     String user) {
+                     MonitoringUploadType type) {
     mdcDataDebugMessage.debugEntryMessage("VSP id, component id", vspId, componentId);
 
     if (object == null) {
@@ -130,7 +119,7 @@
         final FileContentHandler upload =
             validateZip(vspId, version, uploadedFileData, errors);
         if (type.equals(MonitoringUploadType.VES_EVENTS)) {
-          validateVesEventUpload(upload, errors, vspId, version);
+          validateVesEventUpload(upload, errors);
         }
         if (MapUtils.isNotEmpty(errors)) {
           MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
@@ -147,27 +136,18 @@
             uploadedFileData);
 
       } catch (Exception exception) {
-        log.debug("", exception);
         MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
             LoggerTragetServiceName.UPLOAD_MONITORING_FILE, ErrorLevel.ERROR.name(),
             LoggerErrorCode.DATA_ERROR.getErrorCode(), "Invalid " + type.toString() + "zip file");
         throw new CoreException(new MonitoringUploadErrorBuilder(exception.getMessage()).build());
       }
     }
-
-    ActivityLogEntity activityLogEntity =
-        new ActivityLogEntity(vspId, String.valueOf(version.getMajor() + 1),
-            ActivityType.UPLOAD_MONITORING_FILE.toString(), user, true, "", "");
-    activityLogManager.addActionLog(activityLogEntity, user);
     logger.audit("Uploaded Monitoring File for component id:" + componentId + " ,vspId:" + vspId);
-
-
     mdcDataDebugMessage.debugExitMessage("VSP id, component id", vspId, componentId);
   }
 
   private void validateVesEventUpload(FileContentHandler upload,
-                                      Map<String, List<ErrorMessage>> errors, String vspId,
-                                      Version version) {
+                                      Map<String, List<ErrorMessage>> errors) {
     if (!CommonUtil.validateAllFilesYml(upload)) {
       ErrorMessage.ErrorMessageUtil.addMessage(SdcCommon.UPLOAD_FILE, errors)
           .add(new ErrorMessage(ErrorLevel.ERROR,
@@ -194,8 +174,7 @@
   }
 
   @Override
-  public MonitoringUploadStatus listFilenames(String vspId, Version version, String componentId,
-                                              String user) {
+  public MonitoringUploadStatus listFilenames(String vspId, Version version, String componentId) {
     mdcDataDebugMessage.debugEntryMessage("VSP id, component id", vspId, componentId);
 
     ComponentMonitoringUploadEntity current =
@@ -259,10 +238,10 @@
                                          Map<String, List<ErrorMessage>> errors) {
     FileContentHandler contentMap;
     try {
-      contentMap = CommonUtil.validateAndUploadFileContent(OnboardingTypesEnum.ZIP, uploadedFileData);
+      contentMap =
+          CommonUtil.validateAndUploadFileContent(OnboardingTypesEnum.ZIP, uploadedFileData);
       VendorSoftwareProductUtils.validateContentZipData(contentMap, errors);
     } catch (IOException exception) {
-      log.debug("", exception);
       MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
           LoggerTragetServiceName.VALIDATE_MONITORING_FILE, ErrorLevel.ERROR.name(),
           LoggerErrorCode.DATA_ERROR.getErrorCode(), "Invalid Monitoring zip file");
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/NetworkManagerImpl.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/NetworkManagerImpl.java
index 77b6b00..e6233bb 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/NetworkManagerImpl.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/NetworkManagerImpl.java
@@ -59,7 +59,7 @@
   }
 
   @Override
-  public Collection<NetworkEntity> listNetworks(String vspId, Version version, String user) {
+  public Collection<NetworkEntity> listNetworks(String vspId, Version version) {
     mdcDataDebugMessage.debugEntryMessage("VSP id", vspId);
     mdcDataDebugMessage.debugExitMessage("VSP id", vspId);
 
@@ -67,7 +67,7 @@
   }
 
   @Override
-  public NetworkEntity createNetwork(NetworkEntity network, String user) {
+  public NetworkEntity createNetwork(NetworkEntity network) {
     mdcDataDebugMessage.debugEntryMessage("VSP id", network.getVspId());
 
     if (!isManual(network.getVspId(), network.getVersion())) {
@@ -87,16 +87,12 @@
     return null;
   }
 
-  private NetworkEntity createNetwork(NetworkEntity network) {
-    return compositionEntityDataManager.createNetwork(network);
-  }
-
   @Override
-  public CompositionEntityValidationData updateNetwork(NetworkEntity network, String user) {
+  public CompositionEntityValidationData updateNetwork(NetworkEntity network) {
     mdcDataDebugMessage
         .debugEntryMessage("VSP id, network id", network.getVspId(), network.getId());
 
-    NetworkEntity retrieved = getNetwork(network.getVspId(), network.getVersion(), network.getId());
+    NetworkEntity retrieved = getValidatedNetwork(network.getVspId(), network.getVersion(), network.getId());
 
     NetworkCompositionSchemaInput schemaInput = new NetworkCompositionSchemaInput();
     schemaInput.setManual(isManual(network.getVspId(), network.getVersion()));
@@ -119,10 +115,10 @@
 
   @Override
   public CompositionEntityResponse<Network> getNetwork(String vspId, Version version,
-                                                       String networkId, String user) {
+                                                       String networkId) {
     mdcDataDebugMessage.debugEntryMessage("VSP id, network id", vspId, networkId);
 
-    NetworkEntity networkEntity = getNetwork(vspId, version, networkId);
+    NetworkEntity networkEntity = getValidatedNetwork(vspId, version, networkId);
     Network network = networkEntity.getNetworkCompositionData();
 
     NetworkCompositionSchemaInput schemaInput = new NetworkCompositionSchemaInput();
@@ -140,7 +136,7 @@
   }
 
 
-  private NetworkEntity getNetwork(String vspId, Version version, String networkId) {
+  private NetworkEntity getValidatedNetwork(String vspId, Version version, String networkId) {
     NetworkEntity retrieved = networkDao.get(new NetworkEntity(vspId, version, networkId));
     VersioningUtil.validateEntityExistence(retrieved, new NetworkEntity(vspId, version, networkId),
         VspDetails.ENTITY_TYPE);
@@ -148,7 +144,7 @@
   }
 
   @Override
-  public void deleteNetwork(String vspId, Version version, String networkId, String user) {
+  public void deleteNetwork(String vspId, Version version, String networkId) {
     mdcDataDebugMessage.debugEntryMessage("VSP id, network id", vspId, networkId);
 
     if (!isManual(vspId, version)) {
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/NicManagerImpl.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/NicManagerImpl.java
index 0304353..f2bb0ba 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/NicManagerImpl.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/NicManagerImpl.java
@@ -37,7 +37,12 @@
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
-import org.openecomp.sdc.vendorsoftwareproduct.errors.*;
+import org.openecomp.sdc.vendorsoftwareproduct.errors.DeleteNicErrorBuilder;
+import org.openecomp.sdc.vendorsoftwareproduct.errors.DuplicateNicInComponentErrorBuilder;
+import org.openecomp.sdc.vendorsoftwareproduct.errors.NicErrorBuilder;
+import org.openecomp.sdc.vendorsoftwareproduct.errors.NicInternalNetworkErrorBuilder;
+import org.openecomp.sdc.vendorsoftwareproduct.errors.NicNetworkIdNotAllowedExternalNetworkErrorBuilder;
+import org.openecomp.sdc.vendorsoftwareproduct.errors.NotSupportedHeatOnboardMethodErrorBuilder;
 import org.openecomp.sdc.vendorsoftwareproduct.services.composition.CompositionEntityDataManager;
 import org.openecomp.sdc.vendorsoftwareproduct.services.schemagenerator.SchemaGenerator;
 import org.openecomp.sdc.vendorsoftwareproduct.types.CompositionEntityResponse;
@@ -63,7 +68,7 @@
   private NicDao nicDao;
   private CompositionEntityDataManager compositionEntityDataManager;
   private NetworkManager networkManager;
-  private  VendorSoftwareProductInfoDao vspInfoDao;
+  private VendorSoftwareProductInfoDao vspInfoDao;
 
   public NicManagerImpl(NicDao nicDao,
                         CompositionEntityDataManager compositionEntityDataManager,
@@ -76,14 +81,13 @@
   }
 
   @Override
-  public Collection<NicEntity> listNics(String vspId, Version version, String componentId,
-                                        String user) {
+  public Collection<NicEntity> listNics(String vspId, Version version, String componentId) {
     mdcDataDebugMessage.debugEntryMessage("VSP id, component id", vspId, componentId);
 
     Collection<NicEntity> nics = nicDao.list(new NicEntity(vspId, version, componentId, null));
 
     if (!nics.isEmpty()) {
-      Map<String, String> networksNameById = listNetworksNameById(vspId, version, user);
+      Map<String, String> networksNameById = listNetworksNameById(vspId, version);
       nics.forEach(nicEntity -> {
         Nic nic = nicEntity.getNicCompositionData();
         nic.setNetworkName(networksNameById.get(nic.getNetworkId()));
@@ -96,18 +100,18 @@
     return nics;
   }
 
-  private Map<String, String> listNetworksNameById(String vspId, Version version, String user) {
-    Collection<NetworkEntity> networks = networkManager.listNetworks(vspId, version, user);
+  private Map<String, String> listNetworksNameById(String vspId, Version version) {
+    Collection<NetworkEntity> networks = networkManager.listNetworks(vspId, version);
     return networks.stream().collect(Collectors.toMap(NetworkEntity::getId,
         networkEntity -> networkEntity.getNetworkCompositionData().getName()));
   }
 
   @Override
-  public NicEntity createNic(NicEntity nic, String user) {
-    NicEntity createdNic = null;
+  public NicEntity createNic(NicEntity nic) {
     mdcDataDebugMessage.debugEntryMessage("VSP id, component id", nic.getVspId(),
         nic.getComponentId());
 
+    NicEntity createdNic;
     if (!vspInfoDao.isManual(nic.getVspId(), nic.getVersion())) {
       ErrorCode onboardingMethodUpdateErrorCode = NotSupportedHeatOnboardMethodErrorBuilder
           .getAddNicNotSupportedHeatOnboardMethodErrorBuilder();
@@ -117,25 +121,20 @@
           onboardingMethodUpdateErrorCode.message());
       throw new CoreException(onboardingMethodUpdateErrorCode);
     } else {
-      validateNic(nic, user);
-      createdNic = createNic(nic);
+      validateNic(nic);
+      createdNic = compositionEntityDataManager.createNic(nic);
     }
 
-    //nicDao.updateVspLatestModificationTime(nic.getVspId(), nic.getVersion());
-
     mdcDataDebugMessage
         .debugExitMessage("VSP id, component id", nic.getVspId(), nic.getComponentId());
 
     return createdNic;
   }
 
-  private NicEntity createNic(NicEntity nic) {
-    return compositionEntityDataManager.createNic(nic);
-  }
 
-  private void validateNic(NicEntity nic, String user) {
+  private void validateNic(NicEntity nic) {
     Collection<NicEntity> listNics = listNics(nic.getVspId(), nic.getVersion(), nic
-        .getComponentId(), user);
+        .getComponentId());
     String networkId = nic.getNicCompositionData().getNetworkId();
     NetworkType networkType = nic.getNicCompositionData().getNetworkType();
     String networkDescription = nic.getNicCompositionData().getNetworkDescription();
@@ -171,14 +170,12 @@
       if (!(networkId == null || networkId.equals(""))) {
         //NetworkEntity ne = getNetwork(nic.getVspId(), activeVersion, networkId);
         final CompositionEntityResponse<Network> network =
-            networkManager.getNetwork(nic.getVspId(), nic.getVersion(), networkId,
-                user);
+            networkManager.getNetwork(nic.getVspId(), nic.getVersion(), networkId);
       }
 
       if (!(networkDescription == null || networkDescription.equals(""))) {
         final ErrorCode nicNetworkDescriptionErrorBuilder =
-            new NicInternalNetworkErrorBuilder()
-                .getNetworkDescriptionInternalNetworkErrorBuilder();
+            NicInternalNetworkErrorBuilder.getNetworkDescriptionInternalNetworkErrorBuilder();
         MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
             LoggerTragetServiceName.CREATE_NIC, ErrorLevel.ERROR.name(),
             LoggerErrorCode.DATA_ERROR.getErrorCode(), nicNetworkDescriptionErrorBuilder.message());
@@ -200,17 +197,17 @@
 
   @Override
   public CompositionEntityResponse<Nic> getNic(String vspId, Version version, String componentId,
-                                               String nicId, String user) {
+                                               String nicId) {
     mdcDataDebugMessage
         .debugEntryMessage("VSP id, component id, nic id", vspId, componentId, nicId);
 
-    NicEntity nicEntity = getNic(vspId, version, componentId, nicId);
+    NicEntity nicEntity = getValidatedNic(vspId, version, componentId, nicId);
     Nic nic = nicEntity.getNicCompositionData();
 
     NicCompositionSchemaInput schemaInput = new NicCompositionSchemaInput();
     schemaInput.setManual(vspInfoDao.isManual(vspId, version));
     schemaInput.setNic(nic);
-    Map<String, String> networksNameById = listNetworksNameById(vspId, version, user);
+    Map<String, String> networksNameById = listNetworksNameById(vspId, version);
     nic.setNetworkName(networksNameById.get(nic.getNetworkId()));
     schemaInput.setNetworkIds(networksNameById.keySet());
 
@@ -226,7 +223,8 @@
   }
 
 
-  private NicEntity getNic(String vspId, Version version, String componentId, String nicId) {
+  private NicEntity getValidatedNic(String vspId, Version version, String componentId,
+                                    String nicId) {
     NicEntity retrieved = nicDao.get(new NicEntity(vspId, version, componentId, nicId));
     VersioningUtil
         .validateEntityExistence(retrieved, new NicEntity(vspId, version, componentId, nicId),
@@ -235,14 +233,13 @@
   }
 
   @Override
-  public void deleteNic(String vspId, Version version, String componentId, String nicId,
-                        String user) {
+  public void deleteNic(String vspId, Version version, String componentId, String nicId) {
     mdcDataDebugMessage
         .debugEntryMessage("VSP id, component id", vspId, componentId, nicId);
 
     if (!vspInfoDao.isManual(vspId, version)) {
       final ErrorCode deleteNicErrorBuilder =
-          new DeleteNicErrorBuilder().getDeleteNicForHeatOnboardedVspErrorBuilder();
+          DeleteNicErrorBuilder.getDeleteNicForHeatOnboardedVspErrorBuilder();
       MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
           LoggerTragetServiceName.DELETE_NIC, ErrorLevel.ERROR.name(),
           LoggerErrorCode.PERMISSION_ERROR.getErrorCode(),
@@ -250,23 +247,21 @@
       throw new CoreException(deleteNicErrorBuilder);
     }
 
-    NicEntity nicEntity = getNic(vspId, version, componentId, nicId);
-    if (nicEntity != null) {
-      nicDao.delete(nicEntity);
-    }
+    NicEntity nicEntity = getValidatedNic(vspId, version, componentId, nicId);
+    nicDao.delete(nicEntity);
 
     mdcDataDebugMessage
         .debugExitMessage("VSP id, component id", vspId, componentId, nicId);
   }
 
   @Override
-  public CompositionEntityValidationData updateNic(NicEntity nic, String user) {
+  public CompositionEntityValidationData updateNic(NicEntity nic) {
     mdcDataDebugMessage
         .debugEntryMessage("VSP id, component id", nic.getVspId(), nic.getComponentId(),
             nic.getId());
 
     NicEntity retrieved =
-        getNic(nic.getVspId(), nic.getVersion(), nic.getComponentId(), nic.getId());
+        getValidatedNic(nic.getVspId(), nic.getVersion(), nic.getComponentId(), nic.getId());
 
     NicCompositionSchemaInput schemaInput = new NicCompositionSchemaInput();
     schemaInput.setManual(vspInfoDao.isManual(nic.getVspId(), nic.getVersion()));
@@ -289,9 +284,6 @@
     if (CollectionUtils.isEmpty(validationData.getErrors())) {
       nicDao.update(nic);
     }
-
-    //nicDao.updateVspLatestModificationTime(nic.getVspId(), nic.getVersion());
-
     mdcDataDebugMessage
         .debugExitMessage("VSP id, component id", nic.getVspId(), nic.getComponentId(),
             nic.getId());
@@ -301,7 +293,7 @@
 
   @Override
   public QuestionnaireResponse getNicQuestionnaire(String vspId, Version version,
-                                                   String componentId, String nicId, String user) {
+                                                   String componentId, String nicId) {
     mdcDataDebugMessage
         .debugEntryMessage("VSP id, component id", vspId, componentId, nicId);
 
@@ -321,15 +313,13 @@
 
   @Override
   public void updateNicQuestionnaire(String vspId, Version version, String componentId,
-                                     String nicId, String questionnaireData, String user) {
+                                     String nicId, String questionnaireData) {
     mdcDataDebugMessage.debugEntryMessage("VSP id, component id", vspId, componentId, nicId);
 
     getNic(vspId, version, componentId, nicId);
 
     nicDao.updateQuestionnaireData(vspId, version, componentId, nicId, questionnaireData);
 
-    //nicDao.updateVspLatestModificationTime(vspId, version);
-
     mdcDataDebugMessage.debugExitMessage("VSP id, component id", vspId, componentId, nicId);
   }
 
@@ -342,9 +332,4 @@
     return SchemaGenerator
         .generate(SchemaTemplateContext.composition, CompositionEntityType.nic, schemaInput);
   }
-  // todo *************************** move to reusable place! *************************
-
-  /*private boolean isManual(String vspId, Version version) {
-    return false;
-  }*/
 }
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/OrchestrationTemplateCandidateManagerFactoryImpl.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/OrchestrationTemplateCandidateManagerFactoryImpl.java
index b5464e5..b8fddcd 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/OrchestrationTemplateCandidateManagerFactoryImpl.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/OrchestrationTemplateCandidateManagerFactoryImpl.java
@@ -20,40 +20,21 @@
 
 package org.openecomp.sdc.vendorsoftwareproduct.impl;
 
-import org.openecomp.core.model.dao.ServiceModelDaoFactory;
-import org.openecomp.sdc.activityLog.ActivityLogManagerFactory;
 import org.openecomp.sdc.healing.factory.HealingManagerFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.OrchestrationTemplateCandidateManager;
 import org.openecomp.sdc.vendorsoftwareproduct.OrchestrationTemplateCandidateManagerFactory;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDaoFactory;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.MonitoringUploadDaoFactory;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.NicDaoFactory;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.OrchestrationTemplateDaoFactory;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.ProcessDaoFactory;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDaoFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDaoFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.factory.CandidateServiceFactory;
-import org.openecomp.sdc.vendorsoftwareproduct.factory.CompositionDataExtractorFactory;
-import org.openecomp.sdc.vendorsoftwareproduct.factory.CompositionEntityDataManagerFactory;
 
 public class OrchestrationTemplateCandidateManagerFactoryImpl extends
     OrchestrationTemplateCandidateManagerFactory {
+
   private static final OrchestrationTemplateCandidateManager INSTANCE =
       new OrchestrationTemplateCandidateManagerImpl(
-          VendorSoftwareProductDaoFactory.getInstance().createInterface(),
           VendorSoftwareProductInfoDaoFactory.getInstance().createInterface(),
-          OrchestrationTemplateDaoFactory.getInstance().createInterface(),
           CandidateServiceFactory.getInstance().createInterface(),
-          HealingManagerFactory.getInstance().createInterface(),
-          CompositionDataExtractorFactory.getInstance().createInterface(),
-          ServiceModelDaoFactory.getInstance().createInterface(),
-          CompositionEntityDataManagerFactory.getInstance().createInterface(),
-          NicDaoFactory.getInstance().createInterface(),
-          ComponentDaoFactory.getInstance().createInterface(),
-          MonitoringUploadDaoFactory.getInstance().createInterface(),
-          ProcessDaoFactory.getInstance().createInterface(),
-          ActivityLogManagerFactory.getInstance().createInterface());
-
+          HealingManagerFactory.getInstance().createInterface()
+      );
 
   @Override
   public OrchestrationTemplateCandidateManager createInterface() {
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/OrchestrationTemplateCandidateManagerImpl.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/OrchestrationTemplateCandidateManagerImpl.java
index 07a3fa7..f613dbb 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/OrchestrationTemplateCandidateManagerImpl.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/OrchestrationTemplateCandidateManagerImpl.java
@@ -23,11 +23,8 @@
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang3.tuple.ImmutablePair;
 import org.apache.commons.lang3.tuple.Pair;
-import org.openecomp.core.model.dao.ServiceModelDao;
-import org.openecomp.core.model.types.ServiceElement;
 import org.openecomp.core.utilities.json.JsonUtil;
 import org.openecomp.core.utilities.orchestration.OnboardingTypesEnum;
-import org.openecomp.sdc.activityLog.ActivityLogManager;
 import org.openecomp.sdc.common.errors.CoreException;
 import org.openecomp.sdc.common.errors.Messages;
 import org.openecomp.sdc.common.utils.CommonUtil;
@@ -35,7 +32,6 @@
 import org.openecomp.sdc.datatypes.error.ErrorLevel;
 import org.openecomp.sdc.datatypes.error.ErrorMessage;
 import org.openecomp.sdc.healing.api.HealingManager;
-import org.openecomp.sdc.healing.types.HealCode;
 import org.openecomp.sdc.logging.api.Logger;
 import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.openecomp.sdc.logging.api.annotations.Metrics;
@@ -43,14 +39,7 @@
 import org.openecomp.sdc.logging.messages.AuditMessages;
 import org.openecomp.sdc.logging.types.LoggerServiceName;
 import org.openecomp.sdc.logging.types.LoggerTragetServiceName;
-import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel;
 import org.openecomp.sdc.vendorsoftwareproduct.OrchestrationTemplateCandidateManager;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentArtifactDao;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDao;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.NicDao;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.OrchestrationTemplateDao;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.ProcessDao;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDao;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.OrchestrationTemplateCandidateData;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
@@ -58,9 +47,6 @@
 import org.openecomp.sdc.vendorsoftwareproduct.impl.orchestration.OrchestrationTemplateFileHandler;
 import org.openecomp.sdc.vendorsoftwareproduct.impl.orchestration.OrchestrationUploadFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.impl.orchestration.process.OrchestrationProcessFactory;
-import org.openecomp.sdc.vendorsoftwareproduct.impl.orchestration.process.OrchestrationTemplateProcessHandler;
-import org.openecomp.sdc.vendorsoftwareproduct.services.composition.CompositionDataExtractor;
-import org.openecomp.sdc.vendorsoftwareproduct.services.composition.CompositionEntityDataManager;
 import org.openecomp.sdc.vendorsoftwareproduct.services.filedatastructuremodule.CandidateService;
 import org.openecomp.sdc.vendorsoftwareproduct.types.OrchestrationTemplateActionResponse;
 import org.openecomp.sdc.vendorsoftwareproduct.types.UploadFileResponse;
@@ -80,114 +66,52 @@
   private static final Logger logger =
       LoggerFactory.getLogger(OrchestrationTemplateCandidateManagerImpl.class);
   private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage();
-  private VendorSoftwareProductDao vendorSoftwareProductDao;
+
   private VendorSoftwareProductInfoDao vspInfoDao;
-  private OrchestrationTemplateDao orchestrationTemplateDataDao;
   private CandidateService candidateService;
   private HealingManager healingManager;
-  private CompositionDataExtractor compositionDataExtractor;
-  private ServiceModelDao<ToscaServiceModel, ServiceElement> serviceModelDao;
-  private CompositionEntityDataManager compositionEntityDataManager;
-  private NicDao nicDao;
-  private ComponentDao componentDao;
-  private ComponentArtifactDao componentArtifactDao;
-  private ActivityLogManager activityLogManager;
-  private ProcessDao processDao;
 
-  /**
-   * Instantiates a new Orchestration template candidate manager.
-   *
-   * @param vendorSoftwareProductDao     the vendor software product dao
-   * @param vspInfoDao                   the vsp info dao
-   * @param orchestrationTemplateDataDao the orchestration template data dao
-   * @param candidateService             the candidate service
-   * @param healingManager               the healing manager
-   * @param compositionDataExtractor     the composition data extractor
-   * @param serviceModelDao              the service model dao
-   * @param compositionEntityDataManager the composition entity data manager
-   * @param nicDao                       the nic dao
-   * @param componentDao                 the component dao
-   * @param componentArtifactDao                       the mib dao
-   * @param processDao                   the process dao
-   * @param activityLogManager           the activity log manager
-   */
-  public OrchestrationTemplateCandidateManagerImpl(
-      VendorSoftwareProductDao vendorSoftwareProductDao, VendorSoftwareProductInfoDao
-      vspInfoDao,
-      OrchestrationTemplateDao orchestrationTemplateDataDao,
-      CandidateService candidateService, HealingManager healingManager,
-      CompositionDataExtractor compositionDataExtractor,
-      ServiceModelDao<ToscaServiceModel, ServiceElement> serviceModelDao,
-      CompositionEntityDataManager compositionEntityDataManager,
-      NicDao nicDao,
-      ComponentDao componentDao,
-      ComponentArtifactDao componentArtifactDao,
-      ProcessDao processDao,
-      ActivityLogManager activityLogManager) {
-    this.vendorSoftwareProductDao = vendorSoftwareProductDao;
+  public OrchestrationTemplateCandidateManagerImpl(VendorSoftwareProductInfoDao vspInfoDao,
+                                                   CandidateService candidateService,
+                                                   HealingManager healingManager) {
     this.vspInfoDao = vspInfoDao;
-    this.orchestrationTemplateDataDao = orchestrationTemplateDataDao;
     this.candidateService = candidateService;
     this.healingManager = healingManager;
-    this.compositionDataExtractor = compositionDataExtractor;
-    this.serviceModelDao = serviceModelDao;
-    this.compositionEntityDataManager = compositionEntityDataManager;
-    this.nicDao = nicDao;
-    this.componentDao = componentDao;
-    this.componentArtifactDao = componentArtifactDao;
-    this.processDao = processDao;
-    this.activityLogManager = activityLogManager;
   }
 
   @Override
   @Metrics
   public UploadFileResponse upload(String vspId, Version version, InputStream fileToUpload,
-                                   String user, String filePrefix,
-                                   String networkPackageName) {
+                                   String fileSuffix, String networkPackageName) {
     mdcDataDebugMessage.debugEntryMessage("VSP id", vspId);
+
     OrchestrationTemplateFileHandler orchestrationTemplateFileHandler =
-            OrchestrationUploadFactory.createOrchestrationTemplateFileHandler(filePrefix);
+        OrchestrationUploadFactory.createOrchestrationTemplateFileHandler(fileSuffix);
+
     VspDetails vspDetails = getVspDetails(vspId, version);
+
     UploadFileResponse uploadResponse = orchestrationTemplateFileHandler
-        .upload(vspId, version, fileToUpload, user, candidateService,
-            vspDetails);
-    vspDetails.setOnboardingOrigin(filePrefix);
-    vspDetails.setNetworkPackageName(networkPackageName);
-    vspInfoDao.update(vspDetails);
+        .upload(vspDetails, fileToUpload, fileSuffix, networkPackageName, candidateService);
 
     uploadResponse.setNetworkPackageName(networkPackageName);
     return uploadResponse;
   }
 
-
-
   @Override
-  public OrchestrationTemplateActionResponse process(String vspId,
-                                                     Version version, String user) {
+  public OrchestrationTemplateActionResponse process(String vspId, Version version) {
     mdcDataDebugMessage.debugEntryMessage("VSP id", vspId);
-    OrchestrationTemplateActionResponse response = new OrchestrationTemplateActionResponse();
 
-    Optional<OrchestrationTemplateCandidateData> candidate =
-        fetchCandidateDataEntity(vspId, version);
-    if (!candidate.isPresent()) {
-      throw new CoreException(new OrchestrationTemplateNotFoundErrorBuilder(vspId).build());
-    }
+    OrchestrationTemplateCandidateData candidate = fetchCandidateDataEntity(vspId, version)
+        .orElseThrow(
+            () -> new CoreException(new OrchestrationTemplateNotFoundErrorBuilder(vspId).build()));
 
-    VspDetails vspDetails =
-        getVspDetails(vspId, version);
-    Optional<OrchestrationTemplateProcessHandler> processInstance =
-        OrchestrationProcessFactory.getInstance(vspDetails.getOnboardingOrigin());
-
-    if(processInstance.isPresent()){
-      response = processInstance.get().process(vspDetails, candidate.get(), user);
-    }
-
-    return response;
+    return OrchestrationProcessFactory.getInstance(candidate.getFileSuffix())
+        .map(processor -> processor.process(getVspDetails(vspId, version), candidate))
+        .orElse(new OrchestrationTemplateActionResponse());
   }
 
   @Override
-  public Optional<FilesDataStructure> getFilesDataStructure(
-      String vspId, Version version, String user) {
+  public Optional<FilesDataStructure> getFilesDataStructure(String vspId, Version version) {
     mdcDataDebugMessage.debugEntryMessage("VSP id", vspId);
 
     Optional<FilesDataStructure> candidateFileDataStructure =
@@ -195,19 +119,13 @@
     if (candidateFileDataStructure.isPresent()) {
       return candidateFileDataStructure;
     } else {
-      Map<String, Object> healingParams = getHealingParamsAsMap(vspId, version, user);
-
-      mdcDataDebugMessage
-          .debugExitMessage("VSP id", vspId);
-      return (Optional<FilesDataStructure>) healingManager
-          .heal(HealCode.FILE_DATA_STRUCTURE_HEALER, healingParams);
+      mdcDataDebugMessage.debugExitMessage("VSP id", vspId);
+      return Optional.empty();
     }
   }
 
   @Override
-
-  public ValidationResponse updateFilesDataStructure(String vspId,
-                                                     Version version, String user,
+  public ValidationResponse updateFilesDataStructure(String vspId, Version version,
                                                      FilesDataStructure fileDataStructure) {
     mdcDataDebugMessage.debugEntryMessage("VSP id", vspId);
 
@@ -222,27 +140,23 @@
         response.setUploadDataErrors(errorsMap, LoggerServiceName.Update_Manifest,
             LoggerTragetServiceName.VALIDATE_FILE_DATA_STRUCTURE);
 
-        mdcDataDebugMessage
-            .debugExitMessage("VSP id", vspId);
+        mdcDataDebugMessage.debugExitMessage("VSP id", vspId);
         return response;
       }
     }
-    candidateService.updateOrchestrationTemplateCandidateFileDataStructure(vspId, version,
-        fileDataStructure);
+    candidateService
+        .updateOrchestrationTemplateCandidateFileDataStructure(vspId, version, fileDataStructure);
 
-    mdcDataDebugMessage
-        .debugExitMessage("VSP id", vspId);
+    mdcDataDebugMessage.debugExitMessage("VSP id", vspId);
     return response;
   }
 
   @Override
 
-  public Optional<Pair<String, byte[]>> get(String vspId, Version version, String user)
-      throws IOException {
+  public Optional<Pair<String, byte[]>> get(String vspId, Version version) throws IOException {
     mdcDataDebugMessage.debugEntryMessage("VSP id", vspId);
 
-    VspDetails vspDetails =
-        getVspDetails(vspId, version);
+    VspDetails vspDetails = getVspDetails(vspId, version);
 
     Optional<OrchestrationTemplateCandidateData> candidateDataEntity =
         fetchCandidateDataEntity(vspId, version);
@@ -252,31 +166,34 @@
           Messages.NO_ZIP_FILE_WAS_UPLOADED_OR_ZIP_NOT_EXIST.getErrorMessage());
       logger.error(errorMessage.getMessage());
 
-      mdcDataDebugMessage
-          .debugExitMessage("VSP id", vspId);
+      mdcDataDebugMessage.debugExitMessage("VSP id", vspId);
       return Optional.empty();
     }
     OnboardingTypesEnum type =
-        OnboardingTypesEnum.getOnboardingTypesEnum(vspDetails.getOnboardingOrigin());
+        OnboardingTypesEnum.getOnboardingTypesEnum(candidateDataEntity.get().getFileSuffix());
 
-    if(CommonUtil.isFileOriginFromZip(vspDetails.getOnboardingOrigin())) {
+    if (CommonUtil.isFileOriginFromZip(candidateDataEntity.get().getFileSuffix())) {
       FilesDataStructure structure = JsonUtil
           .json2Object(candidateDataEntity.get().getFilesDataStructure(), FilesDataStructure.class);
       String manifest = candidateService.createManifest(vspDetails, structure);
 
-      mdcDataDebugMessage
-          .debugExitMessage("VSP id", vspId);
+      mdcDataDebugMessage.debugExitMessage("VSP id", vspId);
       return Optional.of(
-          new ImmutablePair<>(OnboardingTypesEnum.ZIP.toString(),candidateService
+          new ImmutablePair<>(OnboardingTypesEnum.ZIP.toString(), candidateService
               .replaceManifestInZip(candidateDataEntity.get().getContentData(),
-              manifest, vspId, type)));
+                  manifest, vspId, type)));
     }
 
     return Optional.of(
-        new ImmutablePair<>(vspDetails.getOnboardingOrigin(),candidateDataEntity.get()
+        new ImmutablePair<>(candidateDataEntity.get().getFileSuffix(), candidateDataEntity.get()
             .getContentData().array()));
   }
 
+  @Override
+  public OrchestrationTemplateCandidateData getInfo(String vspId, Version version) {
+    return candidateService.getOrchestrationTemplateCandidateInfo(vspId, version);
+  }
+
   private Optional<OrchestrationTemplateCandidateData> fetchCandidateDataEntity(
       String vspId, Version version) {
     return Optional
@@ -286,19 +203,22 @@
 
   // todo *************************** move to reusable place! *************************
 
-  private Map<String, Object> getHealingParamsAsMap(String vspId, Version version, String user) {
+  private Map<String, Object> getHealingParamsAsMap(String vspId, Version version) {
     Map<String, Object> healingParams = new HashMap<>();
 
     healingParams.put(SdcCommon.VSP_ID, vspId);
     healingParams.put(SdcCommon.VERSION, version);
-    healingParams.put(SdcCommon.USER, user);
 
     return healingParams;
   }
 
   private VspDetails getVspDetails(String vspId, Version version) {
     VspDetails vspDetails = vspInfoDao.get(new VspDetails(vspId, version));
-    vspDetails.setValidationData(orchestrationTemplateDataDao.getValidationData(vspId, version));
+/*    OrchestrationTemplateEntity orchestrationTemplateInfo =
+        orchestrationTemplateDao.getInfo(vspId, version);
+    vspDetails.setValidationData(orchestrationTemplateInfo.getValidationData());
+    vspDetails.setNetworkPackageName(orchestrationTemplateInfo.getFileName());
+    vspDetails.setOnboardingOrigin(orchestrationTemplateInfo.getFileSuffix());*/
     return vspDetails;
   }
 
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ProcessManagerFactoryImpl.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ProcessManagerFactoryImpl.java
index d870454..7a4e487 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ProcessManagerFactoryImpl.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ProcessManagerFactoryImpl.java
@@ -20,16 +20,13 @@
 
 package org.openecomp.sdc.vendorsoftwareproduct.impl;
 
-import org.openecomp.sdc.activityLog.ActivityLogManagerFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.ProcessManager;
 import org.openecomp.sdc.vendorsoftwareproduct.ProcessManagerFactory;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDaoFactory;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.ProcessDaoFactory;
 
 public class ProcessManagerFactoryImpl extends ProcessManagerFactory {
   private static final ProcessManager INSTANCE =
-      new ProcessManagerImpl(
-              VendorSoftwareProductDaoFactory.getInstance().createInterface(),
-              ActivityLogManagerFactory.getInstance().createInterface());
+      new ProcessManagerImpl(ProcessDaoFactory.getInstance().createInterface());
 
   @Override
   public ProcessManager createInterface() {
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ProcessManagerImpl.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ProcessManagerImpl.java
index a3d0286..121abda 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ProcessManagerImpl.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ProcessManagerImpl.java
@@ -22,12 +22,10 @@
 
 import org.openecomp.core.util.UniqueValueUtil;
 import org.openecomp.core.utilities.file.FileUtils;
-import org.openecomp.sdc.activityLog.ActivityLogManager;
-import org.openecomp.sdc.activitylog.dao.type.ActivityLogEntity;
 import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.common.errors.ErrorCategory;
+import org.openecomp.sdc.common.errors.ErrorCode;
 import org.openecomp.sdc.datatypes.error.ErrorLevel;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage;
 import org.openecomp.sdc.logging.context.impl.MdcDataErrorMessage;
 import org.openecomp.sdc.logging.types.LoggerConstants;
@@ -35,138 +33,133 @@
 import org.openecomp.sdc.logging.types.LoggerTragetServiceName;
 import org.openecomp.sdc.vendorsoftwareproduct.ProcessManager;
 import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.ProcessDao;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
 import org.openecomp.sdc.vendorsoftwareproduct.errors.UploadInvalidErrorBuilder;
 import org.openecomp.sdc.versioning.VersioningUtil;
 import org.openecomp.sdc.versioning.dao.types.Version;
-import org.openecomp.sdcrests.activitylog.types.ActivityType;
+import org.openecomp.sdc.versioning.errors.VersioningErrorCodes;
 
 import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
+import java.nio.ByteBuffer;
 import java.util.Collection;
 
 public class ProcessManagerImpl implements ProcessManager {
-  private static final MdcDataDebugMessage MDC_DATA_DEBUG_MESSAGE = new MdcDataDebugMessage();
-  private final ActivityLogManager activityLogManager;
+  private static final String PROCESS_ARTIFACT_NOT_EXIST_MSG =
+      "Process artifact for process with Id %s does not exist for %s with Id %s and version %s";
 
-  private final VendorSoftwareProductDao vendorSoftwareProductDao;
+  private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage();
 
-  private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName());
+  private ProcessDao processDao;
 
-  public ProcessManagerImpl(VendorSoftwareProductDao vendorSoftwareProductDao, ActivityLogManager activityLogManager) {
-    this.vendorSoftwareProductDao = vendorSoftwareProductDao;
-    this.activityLogManager = activityLogManager;
+  public ProcessManagerImpl(ProcessDao processDao) {
+    this.processDao = processDao;
   }
 
   @Override
   public Collection<ProcessEntity> listProcesses(String vspId, Version version,
-                                                 String componentId,
-                                                 String user) {
-    MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("VSP id, component id", vspId, componentId);
-    MDC_DATA_DEBUG_MESSAGE.debugExitMessage("VSP id, component id", vspId, componentId);
+                                                 String componentId) {
+    mdcDataDebugMessage.debugEntryMessage("VSP id, component id", vspId, componentId);
+    mdcDataDebugMessage.debugExitMessage("VSP id, component id", vspId, componentId);
 
-    return vendorSoftwareProductDao.listProcesses(vspId, version, componentId);
+    return processDao.list(new ProcessEntity(vspId, version, componentId, null));
   }
 
   @Override
-  public void deleteProcesses(String vspId, Version version, String componentId, String user) {
-    MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("VSP id, component id", vspId, componentId);
+  public void deleteProcesses(String vspId, Version version, String componentId) {
+    mdcDataDebugMessage.debugEntryMessage("VSP id, component id", vspId, componentId);
 
-    Collection<ProcessEntity> processes =
-        vendorSoftwareProductDao.listProcesses(vspId, version, componentId);
+    ProcessEntity allProcesses = new ProcessEntity(vspId, version, componentId, null);
+    Collection<ProcessEntity> processes = processDao.list(allProcesses);
 
     if (!processes.isEmpty()) {
       for (ProcessEntity process : processes) {
         deleteUniqueValue(process.getVspId(), process.getVersion(), process.getComponentId(),
             process.getName());
       }
-
-      vendorSoftwareProductDao.deleteProcesses(vspId, version, componentId);
     }
-    MDC_DATA_DEBUG_MESSAGE.debugExitMessage("VSP id, component id", vspId, componentId);
+
+    if (componentId == null) {
+      processDao.deleteVspAll(vspId,version);
+    } else {
+      processDao.deleteAll(allProcesses);
+    }
+
+    mdcDataDebugMessage.debugExitMessage("VSP id, component id", vspId, componentId);
   }
 
   @Override
-  public ProcessEntity createProcess(ProcessEntity process, String user) {
-    MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("VSP id, component id", process.getId(),
+  public ProcessEntity createProcess(ProcessEntity process) {
+    mdcDataDebugMessage.debugEntryMessage("VSP id, component id", process.getId(),
         process.getComponentId());
     validateUniqueName(process.getVspId(), process.getVersion(), process.getComponentId(),
         process.getName());
-    //process.setId(CommonMethods.nextUuId());
 
-    vendorSoftwareProductDao.createProcess(process);
+    processDao.create(process);
     createUniqueName(process.getVspId(), process.getVersion(), process.getComponentId(),
         process.getName());
 
-    MDC_DATA_DEBUG_MESSAGE.debugExitMessage("VSP id, component id", process.getId(),
+    mdcDataDebugMessage.debugExitMessage("VSP id, component id", process.getId(),
         process.getComponentId());
 
     return process;
   }
 
-
   @Override
   public ProcessEntity getProcess(String vspId, Version version, String componentId,
-                                  String processId, String user) {
-    MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("VSP id, component id", vspId, componentId);
+                                  String processId) {
+    mdcDataDebugMessage.debugEntryMessage("VSP id, component id", vspId, componentId);
 
     ProcessEntity retrieved =
-        vendorSoftwareProductDao.getProcess(vspId, version, componentId, processId);
+        processDao.get(new ProcessEntity(vspId, version, componentId, processId));
     validateProcessExistence(vspId, version, componentId, processId, retrieved);
 
-    MDC_DATA_DEBUG_MESSAGE.debugExitMessage("VSP id, component id", vspId, componentId);
+    mdcDataDebugMessage.debugExitMessage("VSP id, component id", vspId, componentId);
 
     return retrieved;
   }
 
   @Override
-  public void updateProcess(ProcessEntity process, String user) {
-    MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("VSP id, component id", process.getId(),
+  public void updateProcess(ProcessEntity process) {
+    mdcDataDebugMessage.debugEntryMessage("VSP id, component id", process.getId(),
         process.getComponentId());
 
-    ProcessEntity retrieved = vendorSoftwareProductDao
-        .getProcess(process.getVspId(), process.getVersion(), process.getComponentId(),
-            process.getId());
+    ProcessEntity retrieved = processDao.get(process);
     validateProcessExistence(process.getVspId(), process.getVersion(), process.getComponentId(),
         process.getId(), retrieved);
 
     updateUniqueName(process.getVspId(), process.getVersion(), process.getComponentId(),
         retrieved.getName(), process.getName());
-    vendorSoftwareProductDao.updateProcess(process);
+    processDao.update(process);
 
-    MDC_DATA_DEBUG_MESSAGE.debugExitMessage("VSP id, component id", process.getId(),
+    mdcDataDebugMessage.debugExitMessage("VSP id, component id", process.getId(),
         process.getComponentId());
   }
 
   @Override
-  public void deleteProcess(String vspId, Version version, String componentId, String processId,
-                            String user) {
-    MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("VSP id, component id", vspId, componentId);
+  public void deleteProcess(String vspId, Version version, String componentId, String processId) {
+    mdcDataDebugMessage.debugEntryMessage("VSP id, component id", vspId, componentId);
 
-    ProcessEntity retrieved =
-        vendorSoftwareProductDao.getProcess(vspId, version, componentId, processId);
-    validateProcessExistence(vspId, version, componentId, processId, retrieved);
+    ProcessEntity retrieved = getProcess(vspId, version, componentId, processId);
 
-    vendorSoftwareProductDao.deleteProcess(vspId, version, componentId, processId);
+    processDao.delete(retrieved);
     deleteUniqueValue(retrieved.getVspId(), retrieved.getVersion(), retrieved.getComponentId(),
         retrieved.getName());
 
-    MDC_DATA_DEBUG_MESSAGE.debugExitMessage("VSP id, component id", vspId, componentId);
+    mdcDataDebugMessage.debugExitMessage("VSP id, component id", vspId, componentId);
   }
 
 
   @Override
   public File getProcessArtifact(String vspId, Version version, String componentId,
-                                 String processId, String user) {
-    MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("VSP id, component id", vspId, componentId);
+                                 String processId) {
+    mdcDataDebugMessage.debugEntryMessage("VSP id, component id", vspId, componentId);
 
-    ProcessEntity retrieved =
-        vendorSoftwareProductDao.getProcessArtifact(vspId, version, componentId, processId);
-    validateProcessArtifactExistence(vspId, version, componentId, processId, retrieved);
+    ProcessEntity retrieved = getValidatedProcessArtifact(vspId, version, componentId, processId);
 
     File file = new File(String.format("%s_%s_%s", vspId, componentId, processId));
     try (FileOutputStream fos = new FileOutputStream(file)) {
@@ -175,125 +168,115 @@
       MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
           LoggerTragetServiceName.GET_PROCESS_ARTIFACT, ErrorLevel.ERROR.name(),
           LoggerErrorCode.DATA_ERROR.getErrorCode(), "Can't get process artifact");
-      throw new CoreException(new UploadInvalidErrorBuilder().build(), exception);
+      throw new CoreException(new UploadInvalidErrorBuilder().build());
     }
 
-    MDC_DATA_DEBUG_MESSAGE.debugExitMessage("VSP id, component id", vspId, componentId);
+    mdcDataDebugMessage.debugExitMessage("VSP id, component id", vspId, componentId);
 
     return file;
   }
 
   @Override
   public void deleteProcessArtifact(String vspId, Version version, String componentId,
-                                    String processId, String user) {
-    MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("VSP id, component id", vspId, componentId);
+                                    String processId) {
+    mdcDataDebugMessage.debugEntryMessage("VSP id, component id", vspId, componentId);
 
-    ProcessEntity retrieved =
-        vendorSoftwareProductDao.getProcessArtifact(vspId, version, componentId, processId);
-    validateProcessArtifactExistence(vspId, version, componentId, processId, retrieved);
+    ProcessEntity retrieved = getValidatedProcessArtifact(vspId, version, componentId, processId);
 
-    vendorSoftwareProductDao.deleteProcessArtifact(vspId, version, componentId, processId);
+    processDao.deleteArtifact(retrieved);
 
-    MDC_DATA_DEBUG_MESSAGE.debugExitMessage("VSP id, component id", vspId, componentId);
+    mdcDataDebugMessage.debugExitMessage("VSP id, component id", vspId, componentId);
   }
 
   @Override
   public void uploadProcessArtifact(InputStream artifactFile, String artifactFileName, String vspId,
-                                    Version version, String componentId, String processId,
-                                    String user) {
-    MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("VSP id, component id", vspId, componentId);
+                                    Version version, String componentId, String processId) {
+    mdcDataDebugMessage.debugEntryMessage("VSP id, component id", vspId, componentId);
 
+    ProcessEntity process = getProcess(vspId, version, componentId, processId);
+    process.setArtifactName(artifactFileName);
+    process.setArtifact(readArtifact(artifactFile));
+    processDao.uploadArtifact(process);
+
+    mdcDataDebugMessage.debugExitMessage("VSP id, component id", vspId, componentId);
+  }
+
+  private ProcessEntity getValidatedProcessArtifact(String vspId, Version version,
+                                                    String componentId, String processId) {
     ProcessEntity retrieved =
-        vendorSoftwareProductDao.getProcess(vspId, version, componentId, processId);
-    validateProcessExistence(vspId, version, componentId, processId, retrieved);
+        processDao.getArtifact(new ProcessEntity(vspId, version, componentId, processId));
+    validateProcessArtifactExistence(vspId, version, componentId, processId, retrieved);
+    return retrieved;
+  }
 
-    if (artifactFile == null) {
+  private ByteBuffer readArtifact(InputStream artifactInputStream) {
+    if (artifactInputStream == null) {
       MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
           LoggerTragetServiceName.UPLOAD_PROCESS_ARTIFACT, ErrorLevel.ERROR.name(),
           LoggerErrorCode.DATA_ERROR.getErrorCode(), "Can't upload process artifact");
       throw new CoreException(new UploadInvalidErrorBuilder().build());
     }
-
-    byte[] artifact;
     try {
-      artifact = FileUtils.toByteArray(artifactFile);
+      return ByteBuffer.wrap(FileUtils.toByteArray(artifactInputStream));
     } catch (RuntimeException exception) {
       MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
           LoggerTragetServiceName.UPLOAD_PROCESS_ARTIFACT, ErrorLevel.ERROR.name(),
           LoggerErrorCode.DATA_ERROR.getErrorCode(), "Can't upload process artifact");
-      throw new CoreException(new UploadInvalidErrorBuilder().build(), exception);
+      throw new CoreException(new UploadInvalidErrorBuilder().build());
     }
-
-    vendorSoftwareProductDao.uploadProcessArtifact(vspId, version, componentId, processId, artifact,
-            artifactFileName);
-    ActivityLogEntity activityLogEntity = new ActivityLogEntity(vspId, String.valueOf(version.getMajor()+1),
-        ActivityType.UPLOAD_MONITORING_FILE.toString(), user, true, "", "");
-    activityLogManager.addActionLog(activityLogEntity, user);
-
-    MDC_DATA_DEBUG_MESSAGE.debugExitMessage("VSP id, component id", vspId, componentId);
   }
 
 
   private void validateProcessExistence(String vspId, Version version, String componentId,
                                         String processId, ProcessEntity retrieved) {
-    MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("VSP id, component id, process id", vspId, componentId,
-        processId);
-
-    if (retrieved != null) {
-      return;
-    }
     VersioningUtil.validateEntityExistence(retrieved,
         new ProcessEntity(vspId, version, componentId, processId),
-        VspDetails.ENTITY_TYPE);//todo retrieved is always null ??
-
-    MDC_DATA_DEBUG_MESSAGE.debugExitMessage("VSP id, component id, process id", vspId, componentId,
-        processId);
+        VspDetails.ENTITY_TYPE);
   }
 
   private void validateProcessArtifactExistence(String vspId, Version version, String componentId,
                                                 String processId, ProcessEntity retrieved) {
-    MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("VSP id, component id, process id", vspId, componentId,
-        processId);
-
-    if (retrieved != null) {
-      VersioningUtil.validateEntityExistence(retrieved.getArtifact(),
-          new ProcessEntity(vspId, version, componentId, processId),
-          VspDetails.ENTITY_TYPE);
-    } else {
-      VersioningUtil.validateEntityExistence(retrieved,
-          new ProcessEntity(vspId, version, componentId, processId),
-          VspDetails.ENTITY_TYPE); //todo retrieved is always null ??
+    ProcessEntity inputProcess = new ProcessEntity(vspId, version, componentId, processId);
+    VersioningUtil.validateEntityExistence(retrieved, inputProcess, VspDetails.ENTITY_TYPE);
+    if (retrieved.getArtifact() == null) {
+      throw new CoreException(new ErrorCode.ErrorCodeBuilder()
+          .withCategory(ErrorCategory.APPLICATION)
+          .withId(VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND)
+          .withMessage(String.format(PROCESS_ARTIFACT_NOT_EXIST_MSG,
+              processId, VspDetails.ENTITY_TYPE, vspId, version)).build());
     }
-
-    MDC_DATA_DEBUG_MESSAGE.debugExitMessage("VSP id, component id, process id", vspId, componentId,
-        processId);
   }
 
 
   protected void validateUniqueName(String vspId, Version version, String componentId,
                                     String processName) {
     UniqueValueUtil.validateUniqueValue(VendorSoftwareProductConstants.UniqueValues.PROCESS_NAME,
-        vspId, version.toString(), componentId, processName);
+        vspId, version.getId(), componentId, processName);
   }
 
   protected void createUniqueName(String vspId, Version version, String componentId,
                                   String processName) {
     UniqueValueUtil
         .createUniqueValue(VendorSoftwareProductConstants.UniqueValues.PROCESS_NAME, vspId,
-            version.toString(), componentId, processName);
+            version.getId(), componentId, processName);
   }
 
   protected void updateUniqueName(String vspId, Version version, String componentId,
                                   String oldProcessName, String newProcessName) {
     UniqueValueUtil
         .updateUniqueValue(VendorSoftwareProductConstants.UniqueValues.PROCESS_NAME, oldProcessName,
-            newProcessName, vspId, version.toString(), componentId);
+            newProcessName, vspId, version.getId(), componentId);
   }
 
   protected void deleteUniqueValue(String vspId, Version version, String componentId,
                                    String processName) {
+    if (componentId == null) {
+      UniqueValueUtil
+          .deleteUniqueValue(VendorSoftwareProductConstants.UniqueValues.PROCESS_NAME, vspId,
+              version.getId(), processName);
+    }
     UniqueValueUtil
         .deleteUniqueValue(VendorSoftwareProductConstants.UniqueValues.PROCESS_NAME, vspId,
-            version.toString(), componentId, processName);
+            version.getId(), componentId, processName);
   }
 }
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImpl.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImpl.java
index d4879da..640d5c0 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImpl.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImpl.java
@@ -34,18 +34,12 @@
 import org.openecomp.core.utilities.orchestration.OnboardingTypesEnum;
 import org.openecomp.core.validation.api.ValidationManager;
 import org.openecomp.core.validation.util.MessageContainerUtil;
-import org.openecomp.sdc.activityLog.ActivityLogManager;
-import org.openecomp.sdc.activitylog.dao.type.ActivityLogEntity;
 import org.openecomp.sdc.common.errors.CoreException;
-import org.openecomp.sdc.common.errors.ErrorCategory;
 import org.openecomp.sdc.common.errors.ErrorCode;
 import org.openecomp.sdc.common.errors.ValidationErrorBuilder;
 import org.openecomp.sdc.common.utils.CommonUtil;
-import org.openecomp.sdc.common.utils.SdcCommon;
 import org.openecomp.sdc.datatypes.error.ErrorLevel;
 import org.openecomp.sdc.datatypes.error.ErrorMessage;
-import org.openecomp.sdc.generator.datatypes.tosca.VspModelInfo;
-import org.openecomp.sdc.healing.api.HealingManager;
 import org.openecomp.sdc.logging.api.Logger;
 import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage;
@@ -63,11 +57,14 @@
 import org.openecomp.sdc.vendorsoftwareproduct.ManualVspToscaManager;
 import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants;
 import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductManager;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDependencyModelDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.ComputeDao;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.DeploymentFlavorDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.ImageDao;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.NicDao;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.OrchestrationTemplateDao;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.PackageInfoDao;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDao;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.errors.VendorSoftwareProductNotFoundErrorBuilder;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentDependencyModelEntity;
@@ -76,18 +73,17 @@
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.DeploymentFlavorEntity;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ImageEntity;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.OnboardingMethod;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.OrchestrationTemplateEntity;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.PackageInfo;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.UploadDataEntity;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspQuestionnaireEntity;
 import org.openecomp.sdc.vendorsoftwareproduct.errors.ComponentDependencyModelErrorBuilder;
 import org.openecomp.sdc.vendorsoftwareproduct.errors.ComponentErrorBuilder;
-import org.openecomp.sdc.vendorsoftwareproduct.errors.CreatePackageForNonFinalVendorSoftwareProductErrorBuilder;
 import org.openecomp.sdc.vendorsoftwareproduct.errors.DeploymentFlavorErrorBuilder;
 import org.openecomp.sdc.vendorsoftwareproduct.errors.FileCreationErrorBuilder;
 import org.openecomp.sdc.vendorsoftwareproduct.errors.InformationArtifactCreationErrorBuilder;
 import org.openecomp.sdc.vendorsoftwareproduct.errors.NicInternalNetworkErrorBuilder;
-import org.openecomp.sdc.vendorsoftwareproduct.errors.OnboardingMethodErrorBuilder;
 import org.openecomp.sdc.vendorsoftwareproduct.errors.PackageInvalidErrorBuilder;
 import org.openecomp.sdc.vendorsoftwareproduct.errors.PackageNotFoundErrorBuilder;
 import org.openecomp.sdc.vendorsoftwareproduct.errors.TranslationFileCreationErrorBuilder;
@@ -99,7 +95,6 @@
 import org.openecomp.sdc.vendorsoftwareproduct.types.QuestionnaireResponse;
 import org.openecomp.sdc.vendorsoftwareproduct.types.QuestionnaireValidationResult;
 import org.openecomp.sdc.vendorsoftwareproduct.types.ValidationResponse;
-import org.openecomp.sdc.vendorsoftwareproduct.types.VersionedVendorSoftwareProductInfo;
 import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentComputeAssociation;
 import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityId;
 import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityType;
@@ -111,15 +106,8 @@
 import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.SchemaTemplateContext;
 import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.SchemaTemplateInput;
 import org.openecomp.sdc.vendorsoftwareproduct.utils.ComponentDependencyTracker;
-import org.openecomp.sdc.versioning.VersioningManager;
 import org.openecomp.sdc.versioning.VersioningUtil;
 import org.openecomp.sdc.versioning.dao.types.Version;
-import org.openecomp.sdc.versioning.dao.types.VersionStatus;
-import org.openecomp.sdc.versioning.errors.RequestedVersionInvalidErrorBuilder;
-import org.openecomp.sdc.versioning.types.VersionInfo;
-import org.openecomp.sdc.versioning.types.VersionableEntityAction;
-import org.openecomp.sdcrests.activitylog.types.ActivityType;
-import org.slf4j.MDC;
 
 import java.io.BufferedOutputStream;
 import java.io.ByteArrayInputStream;
@@ -136,276 +124,178 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
-import java.util.Optional;
 import java.util.Set;
 import java.util.zip.ZipInputStream;
 import java.util.zip.ZipOutputStream;
 
 public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductManager {
-  private String VALIDATION_VSP_ID = "validationOnlyVspId";
-  private static final String VALIDATION_VSP_NAME = "validationOnlyVspName";
-  //private static final String VALIDATION_VSP_USER = "validationOnlyVspUser";
-
-  private static final MdcDataDebugMessage MDC_DATA_DEBUG_MESSAGE = new MdcDataDebugMessage();
+  private static MdcDataDebugMessage MDC_DATA_DEBUG_MESSAGE = new MdcDataDebugMessage();
   private static final Logger LOGGER =
       LoggerFactory.getLogger(VendorSoftwareProductManagerImpl.class);
 
-  private final OrchestrationTemplateDao orchestrationTemplateDao;
-  private final VendorSoftwareProductInfoDao vspInfoDao;
-  private final VersioningManager versioningManager;
-  private final VendorSoftwareProductDao vendorSoftwareProductDao;
-  private final VendorLicenseFacade vendorLicenseFacade;
-  private final ServiceModelDao<ToscaServiceModel, ServiceElement> serviceModelDao;
-  private final EnrichedServiceModelDao<ToscaServiceModel, ServiceElement> enrichedServiceModelDao;
-  private final HealingManager healingManager;
-  private final VendorLicenseArtifactsService licenseArtifactsService;
-  private final InformationArtifactGenerator informationArtifactGenerator;
-  private final PackageInfoDao packageInfoDao;
-  private final ActivityLogManager activityLogManager;
-  private final DeploymentFlavorDao deploymentFlavorDao;
-  private final NicDao nicDao;
-  private final ManualVspToscaManager manualVspToscaManager;
+  private OrchestrationTemplateDao orchestrationTemplateDao;
+  private VendorSoftwareProductInfoDao vspInfoDao;
+  private VendorLicenseFacade vendorLicenseFacade;
+  private ServiceModelDao<ToscaServiceModel, ServiceElement> serviceModelDao;
+  private EnrichedServiceModelDao<ToscaServiceModel, ServiceElement> enrichedServiceModelDao;
+  private VendorLicenseArtifactsService licenseArtifactsService;
+  private InformationArtifactGenerator informationArtifactGenerator;
+  private PackageInfoDao packageInfoDao;
+  private DeploymentFlavorDao deploymentFlavorDao;
+  private ComponentDao componentDao;
+  private ComponentDependencyModelDao componentDependencyModelDao;
+  private NicDao nicDao;
+  private ComputeDao computeDao;
+  private ImageDao imageDao;
+  private ManualVspToscaManager manualVspToscaManager;
 
-  /**
-   * Instantiates a new Vendor software product manager.
-   *
-   * @param versioningManager            the versioning manager
-   * @param vendorSoftwareProductDao     the vendor software product dao
-   * @param orchestrationTemplateDataDao the orchestration template data dao
-   * @param vspInfoDao                   the vsp info dao
-   * @param vendorLicenseFacade          the vendor license facade
-   * @param serviceModelDao              the service model dao
-   * @param enrichedServiceModelDao      the enriched service model dao
-   * @param healingManager               the healing manager
-   * @param licenseArtifactsService      the license artifacts service
-   * @param informationArtifactGenerator the information artifact generator
-   * @param packageInfoDao               the package info dao
-   * @param activityLogManager           the activity log manager
-   * @param deploymentFlavorDao          the deployment flavor dao
-   * @param nicDao                       the nic dao
-   */
   public VendorSoftwareProductManagerImpl(
-      VersioningManager versioningManager,
-      VendorSoftwareProductDao vendorSoftwareProductDao,
       OrchestrationTemplateDao orchestrationTemplateDataDao,
       VendorSoftwareProductInfoDao vspInfoDao,
       VendorLicenseFacade vendorLicenseFacade,
       ServiceModelDao<ToscaServiceModel, ServiceElement> serviceModelDao,
       EnrichedServiceModelDao<ToscaServiceModel, ServiceElement> enrichedServiceModelDao,
-      HealingManager healingManager,
       VendorLicenseArtifactsService licenseArtifactsService,
       InformationArtifactGenerator informationArtifactGenerator,
       PackageInfoDao packageInfoDao,
-      ActivityLogManager activityLogManager,
       DeploymentFlavorDao deploymentFlavorDao,
+      ComponentDao componentDao,
+      ComponentDependencyModelDao componentDependencyModelDao,
       NicDao nicDao,
+      ComputeDao computeDao,
+      ImageDao imageDao,
       ManualVspToscaManager manualVspToscaManager) {
-    this.versioningManager = versioningManager;
-    this.vendorSoftwareProductDao = vendorSoftwareProductDao;
     this.orchestrationTemplateDao = orchestrationTemplateDataDao;
     this.vspInfoDao = vspInfoDao;
     this.vendorLicenseFacade = vendorLicenseFacade;
     this.serviceModelDao = serviceModelDao;
     this.enrichedServiceModelDao = enrichedServiceModelDao;
-    this.healingManager = healingManager;
     this.licenseArtifactsService = licenseArtifactsService;
     this.informationArtifactGenerator = informationArtifactGenerator;
     this.packageInfoDao = packageInfoDao;
-    this.activityLogManager = activityLogManager;
     this.deploymentFlavorDao = deploymentFlavorDao;
+    this.componentDao = componentDao;
+    this.componentDependencyModelDao = componentDependencyModelDao;
     this.nicDao = nicDao;
+    this.computeDao = computeDao;
+    this.imageDao = imageDao;
     this.manualVspToscaManager = manualVspToscaManager;
 
     registerToVersioning();
   }
 
   private void registerToVersioning() {
-    vendorSoftwareProductDao.registerVersioning(
-        VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE);
     serviceModelDao.registerVersioning(
         VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE);
     enrichedServiceModelDao.registerVersioning(
         VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE);
   }
 
-  @Override
-  public Version checkout(String vendorSoftwareProductId, String user) {
-    MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("VSP id", vendorSoftwareProductId);
-    MDC.put(LoggerConstants.SERVICE_NAME, LoggerServiceName.Checkout_Entity.toString());
-
-    Version newVersion = versioningManager
-        .checkout(VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE,
-            vendorSoftwareProductId, user);
-
-    if (newVersion != null) {
-      ActivityLogEntity activityLogEntity =
-          new ActivityLogEntity(vendorSoftwareProductId, String.valueOf(newVersion.getMajor() + 1),
-              ActivityType.CHECKOUT.toString(), user, true, "", "");
-      activityLogManager.addActionLog(activityLogEntity, user);
-    }
-
-    MDC_DATA_DEBUG_MESSAGE.debugExitMessage("VSP id", vendorSoftwareProductId);
-    return newVersion;
-  }
-
 
   @Override
-  public Version undoCheckout(String vendorSoftwareProductId, String user) {
-    MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("VSP id", vendorSoftwareProductId);
-
-    Version version =
-        getVersionInfo(vendorSoftwareProductId, VersionableEntityAction.Read, user)
-            .getActiveVersion();
-
-    ActivityLogEntity activityLogEntity =
-        new ActivityLogEntity(vendorSoftwareProductId, String.valueOf(version.getMajor() + 1),
-            ActivityType.UNDO_CHECKOUT.toString(), user, true, "", "");
-    activityLogManager.addActionLog(activityLogEntity, user);
-
-    String preVspName = vspInfoDao
-        .get(new VspDetails(vendorSoftwareProductId, version)).getName();
-
-    Version newVersion = versioningManager.undoCheckout(
-        VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE,
-        vendorSoftwareProductId, user);
-
-    String postVspName = vspInfoDao
-        .get(new VspDetails(vendorSoftwareProductId, newVersion))
-        .getName();
-
-    updateUniqueName(preVspName, postVspName);
-
-    MDC_DATA_DEBUG_MESSAGE.debugExitMessage("VSP id", vendorSoftwareProductId);
-
-    return newVersion;
-  }
-
-  @Override
-  public Version checkin(String vendorSoftwareProductId, String user) {
-    MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("VSP id", vendorSoftwareProductId);
-
-    Version newVersion = versioningManager.checkin(
-        VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE,
-        vendorSoftwareProductId, user, null);
-
-    if (newVersion != null) {
-      ActivityLogEntity activityLogEntity =
-          new ActivityLogEntity(vendorSoftwareProductId, String.valueOf(newVersion.getMajor() + 1),
-              ActivityType.CHECKIN.toString(), user, true, "", "");
-      activityLogManager.addActionLog(activityLogEntity, user);
-    }
-
-    MDC_DATA_DEBUG_MESSAGE.debugExitMessage("VSP id", vendorSoftwareProductId);
-
-    return newVersion;
-  }
-
-  @Override
-  public ValidationResponse submit(String vspId, String user) throws IOException {
+  public ValidationResponse validate(String vspId, Version version) throws IOException {
     MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("VSP id", vspId);
 
-    Version version = getVersionInfo(vspId, VersionableEntityAction.Read, user).getActiveVersion();
-    VspDetails vspDetails = getVsp(vspId, version, user);
-    UploadDataEntity uploadData = orchestrationTemplateDao.getOrchestrationTemplate(vspId, version);
-    ToscaServiceModel serviceModel =
-        serviceModelDao.getServiceModel(vspId, vspDetails.getVersion());
+    VspDetails vspDetails = getValidatedVsp(vspId, version);
+    Collection<ComponentDependencyModelEntity> componentDependencies =
+        componentDependencyModelDao.list(new ComponentDependencyModelEntity(vspId, version, null));
 
     ValidationResponse validationResponse = new ValidationResponse();
-    validationResponse
-        .setVspErrors(validateCompletedVendorSoftwareProduct(vspDetails, uploadData, serviceModel),
-            LoggerServiceName.Submit_VSP, LoggerTragetServiceName.SUBMIT_VSP);
-
-    if (isCyclicDependencyInComponents(vspId, vspDetails.getVersion())) {
-      Collection<ErrorCode> vspErrors = validationResponse.getVspErrors() == null
-          ? new ArrayList<>()
-          : validationResponse.getVspErrors();
-      vspErrors.add(ComponentDependencyModelErrorBuilder
-          .getcyclicDependencyComponentErrorBuilder());
-      validationResponse.setVspErrors(vspErrors, LoggerServiceName.Submit_VSP,
-          LoggerTragetServiceName.SUBMIT_VSP);
-    }
-
-    validationResponse.setLicensingDataErrors(validateLicensingData(vspDetails));
-    validationResponse
-        .setUploadDataErrors(validateUploadData(uploadData, vspDetails),
-            LoggerServiceName.Submit_VSP,
-            LoggerTragetServiceName.SUBMIT_VSP);
-
     validationResponse.setQuestionnaireValidationResult(
-        validateQuestionnaire(vspDetails.getId(), vspDetails.getVersion(), vspDetails
-            .getOnboardingMethod()));
+        validateQuestionnaire(vspDetails.getId(), vspDetails.getVersion(),
+            vspDetails.getOnboardingMethod()));
 
-    if ("Manual".equals(vspDetails.getOnboardingMethod())) {
-      Collection<ErrorCode> deploymentFlavourValidationErrList =
-          deploymentFlavorValidation(vspDetails.getId(), vspDetails.getVersion());
-      if (validationResponse.getVspErrors() != null) {
-        if (deploymentFlavourValidationErrList != null) {
-          validationResponse.getVspErrors().addAll(deploymentFlavourValidationErrList);
-        }
-      } else {
-        validationResponse
-            .setVspErrors(deploymentFlavourValidationErrList, LoggerServiceName.Submit_VSP,
-                LoggerTragetServiceName.SUBMIT_VSP);
+    List<ErrorCode> vspErrors = new ArrayList<>();
+    vspErrors.addAll(validateVspFields(vspDetails));
+    if (validateComponentDependencies(componentDependencies)) {
+      vspErrors
+          .add(ComponentDependencyModelErrorBuilder.getcyclicDependencyComponentErrorBuilder());
+    }
+    if (Objects.nonNull(vspDetails.getOnboardingMethod()) &&
+        OnboardingMethod.Manual.name().equals(vspDetails.getOnboardingMethod())) {
+      vspErrors.addAll(validateMandatoryLicenseFields(vspDetails));
+
+      Collection<DeploymentFlavorEntity> deploymentFlavors = deploymentFlavorDao
+          .list(new DeploymentFlavorEntity(vspDetails.getId(), vspDetails.getVersion(), null));
+      if (CollectionUtils.isEmpty(deploymentFlavors)) {
+        vspErrors
+            .add(VendorSoftwareProductInvalidErrorBuilder.VspMissingDeploymentFlavorErrorBuilder());
       }
+      vspErrors.addAll(validateDeploymentFlavors(deploymentFlavors));
 
-      Set<CompositionEntityValidationData> compositionEntityValidationData =
+      Set<CompositionEntityValidationData> componentValidationResult =
           componentValidation(vspDetails.getId(), vspDetails.getVersion());
-      if (validationResponse.getQuestionnaireValidationResult() != null) {
-        if (!CollectionUtils.isEmpty(compositionEntityValidationData)) {
+      if (!CollectionUtils.isEmpty(componentValidationResult)) {
+        if (validationResponse.getQuestionnaireValidationResult() == null ||
+            validationResponse.getQuestionnaireValidationResult().getValidationData() == null) {
+          validationResponse.setQuestionnaireValidationResult(
+              new QuestionnaireValidationResult(componentValidationResult));
+        } else {
           validationResponse.getQuestionnaireValidationResult().getValidationData()
-              .addAll(compositionEntityValidationData);
+              .addAll(componentValidationResult);
         }
-      } else {
-        validationResponse.setQuestionnaireValidationResult(
-            CollectionUtils.isEmpty(compositionEntityValidationData) ? null :
-                new QuestionnaireValidationResult(compositionEntityValidationData));
       }
-
-      //Generate Tosca service model for Manual Onboarding flow
-      VspModelInfo vspModelInfo = manualVspToscaManager.gatherVspInformation(vspId, version, user);
-      serviceModel = manualVspToscaManager.generateToscaModel(vspModelInfo);
+    } else {
+      if (vspDetails.getVlmVersion() != null || vspDetails.getLicenseAgreement() != null
+          || vspDetails.getFeatureGroups() != null) {
+        vspErrors.addAll(validateMandatoryLicenseFields(vspDetails));
+      }
+      OrchestrationTemplateEntity orchestrationTemplate =
+          orchestrationTemplateDao.get(vspId, version);
+      ToscaServiceModel serviceModel =
+          serviceModelDao.getServiceModel(vspId, vspDetails.getVersion());
+      if (!isOrchestrationTemplateExist(orchestrationTemplate) ||
+          !isServiceModelExist(serviceModel)) {
+        vspErrors.add(VendorSoftwareProductInvalidErrorBuilder
+            .VendorSoftwareProductMissingServiceModelErrorBuilder(vspDetails.getId(),
+                vspDetails.getVersion()));
+      }
+      validationResponse.setUploadDataErrors(validateOrchestrationTemplate(orchestrationTemplate),
+          LoggerServiceName.Submit_VSP, LoggerTragetServiceName.SUBMIT_VSP);
     }
-    validationResponse.setCompilationErrors(
-        compile(vspId, vspDetails.getVersion(), serviceModel),
-        LoggerServiceName.Submit_VSP, LoggerTragetServiceName.SUBMIT_VSP);
+    validationResponse
+        .setVspErrors(vspErrors, LoggerServiceName.Submit_VSP, LoggerTragetServiceName.SUBMIT_VSP);
+    validationResponse.setLicensingDataErrors(validateLicensingData(vspDetails));
 
-    if (validationResponse.isValid()) {
-      Version newVersion = versioningManager.submit(
-          VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE,
-          vspId, user, null);
-      ActivityLogEntity activityLogEntity = new ActivityLogEntity(vspDetails.getId(), String
-          .valueOf(newVersion.getMajor()),
-          ActivityType.SUBMIT.toString(), user, true, "", "");
-      activityLogManager.addActionLog(activityLogEntity, user);
-    }
 
     MDC_DATA_DEBUG_MESSAGE.debugExitMessage("VSP id", vspId);
     return validationResponse;
   }
 
-  private boolean isCyclicDependencyInComponents(String vendorSoftwareProductId,
-                                                 Version version) {
-    final Collection<ComponentDependencyModelEntity> componentDependencyModelEntities =
-        vendorSoftwareProductDao.listComponentDependencies(vendorSoftwareProductId, version);
+  @Override
+  public Map<String, List<ErrorMessage>> compile(String vspId, Version version) {
+    MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("VSP id", vspId);
+
+    ToscaServiceModel serviceModel =
+        OnboardingMethod.Manual.name().equals(getValidatedVsp(vspId, version).getOnboardingMethod())
+            //Generate Tosca service model for Manual Onboarding flow
+            ? manualVspToscaManager
+            .generateToscaModel(manualVspToscaManager.gatherVspInformation(vspId, version))
+            : serviceModelDao.getServiceModel(vspId, version);
+
+    Map<String, List<ErrorMessage>> compilationErrors = compile(vspId, version, serviceModel);
+    MDC_DATA_DEBUG_MESSAGE.debugExitMessage("VSP id", vspId);
+    return compilationErrors;
+  }
+
+  private boolean validateComponentDependencies(
+      Collection<ComponentDependencyModelEntity> componentDependencies) {
     ComponentDependencyTracker dependencyTracker = new ComponentDependencyTracker();
 
-    for (ComponentDependencyModelEntity entity : componentDependencyModelEntities) {
-      dependencyTracker.addDependency(entity.getSourceComponentId(), entity.getTargetComponentId());
+    for (ComponentDependencyModelEntity componentDependency : componentDependencies) {
+      dependencyTracker.addDependency(componentDependency.getSourceComponentId(),
+          componentDependency.getTargetComponentId());
     }
     return dependencyTracker.isCyclicDependencyPresent();
   }
 
-  private Collection<ErrorCode> deploymentFlavorValidation(String vspId,
-                                                           Version version) {
-    MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("VSP id", vspId);
-    Set<CompositionEntityValidationData> validationData = new HashSet<>();
+  private Collection<ErrorCode> validateDeploymentFlavors(
+      Collection<DeploymentFlavorEntity> deploymentFlavors) {
+
     Collection<ErrorCode> errorCodeList = new ArrayList<>();
-    Collection<DeploymentFlavorEntity> deploymentFlavors =
-        vendorSoftwareProductDao.listDeploymentFlavors(vspId, version);
     if (!CollectionUtils.isEmpty(deploymentFlavors)) {
       deploymentFlavors.forEach(deploymentFlavor -> {
-        DeploymentFlavorEntity deployment = vendorSoftwareProductDao.getDeploymentFlavor(vspId,
-            version, deploymentFlavor.getId());
+        DeploymentFlavorEntity deployment = deploymentFlavorDao.get(deploymentFlavor);
         DeploymentFlavor deploymentlocalFlavor = deployment.getDeploymentFlavorCompositionData();
         if (deploymentlocalFlavor != null) {
           if (deploymentlocalFlavor.getFeatureGroupId() == null) {
@@ -455,7 +345,7 @@
 
     Set<CompositionEntityValidationData> validationData = new HashSet<>();
     Collection<ComponentEntity> components =
-        vendorSoftwareProductDao.listComponents(vspId, version);
+        componentDao.list(new ComponentEntity(vspId, version, null));
     if (!CollectionUtils.isEmpty(components)) {
       components.forEach(component -> {
         validateImage(vspId, version, validationData, component);
@@ -496,13 +386,13 @@
   private void validateImage(String vspId, Version version,
                              Set<CompositionEntityValidationData> validationData,
                              ComponentEntity component) {
-    Collection<ImageEntity> images = vendorSoftwareProductDao.listImages(vspId, version,
-        component.getId());
+    Collection<ImageEntity> images =
+        imageDao.list(new ImageEntity(vspId, version, component.getId(), null));
     if (CollectionUtils.isEmpty(images)) {
       CompositionEntityValidationData compositionEntityValidationData = new
           CompositionEntityValidationData(component.getType(), component.getId());
-      compositionEntityValidationData.setEntityName(component.getComponentCompositionData()
-          .getDisplayName());
+      compositionEntityValidationData
+          .setEntityName(component.getComponentCompositionData().getDisplayName());
       ErrorCode vfcMissingImageErrorBuilder =
           ComponentErrorBuilder.VfcMissingImageErrorBuilder();
       List<String> errors = new ArrayList<>();
@@ -512,10 +402,7 @@
     }
   }
 
-
-  private List<ErrorCode> validateCompletedVendorSoftwareProduct(
-      VspDetails vspDetails, UploadDataEntity uploadData, Object serviceModel) {
-
+  private List<ErrorCode> validateVspFields(VspDetails vspDetails) {
     List<ErrorCode> errors = new ArrayList<>();
 
     if (vspDetails.getName() == null) {
@@ -533,36 +420,13 @@
     if (vspDetails.getSubCategory() == null) {
       errors.add(createMissingMandatoryFieldError("sub category"));
     }
-    if ("Manual".equals(vspDetails.getOnboardingMethod())) {
-      //Manual Onboarding specific validations
-      Collection<DeploymentFlavorEntity> deploymentFlavorEntities = vendorSoftwareProductDao
-          .listDeploymentFlavors(vspDetails.getId(), vspDetails.getVersion());
-      if (CollectionUtils.isEmpty(deploymentFlavorEntities)) {
-        ErrorCode vspMissingDeploymentFlavorErrorBuilder =
-            VendorSoftwareProductInvalidErrorBuilder.VspMissingDeploymentFlavorErrorBuilder();
-        errors.add(vspMissingDeploymentFlavorErrorBuilder);
-      }
-      errors.addAll(validateMandatoryLicenseFields(vspDetails));
-    } else {
-      //Heat flow specific VSP validations
-      if (uploadData == null || uploadData.getContentData() == null || serviceModel == null) {
-        errors.add(VendorSoftwareProductInvalidErrorBuilder
-            .VendorSoftwareProductMissingServiceModelErrorBuilder(vspDetails.getId(),
-                vspDetails.getVersion()));
-      }
-      if (vspDetails.getVlmVersion() != null || vspDetails.getLicenseAgreement() != null
-          || vspDetails.getFeatureGroups() != null) {
-        errors.addAll(validateMandatoryLicenseFields(vspDetails));
-      }
-    }
-    return errors.isEmpty() ? null : errors;
+    return errors;
   }
 
   private List<ErrorCode> validateMandatoryLicenseFields(VspDetails vspDetails) {
     List<ErrorCode> errors = new ArrayList<>();
     if (vspDetails.getVlmVersion() == null) {
-      errors.add(createMissingMandatoryFieldError(
-          "licensing version (in the format of: {integer}.{integer})"));
+      errors.add(createMissingMandatoryFieldError("licensing version"));
     }
     if (vspDetails.getLicenseAgreement() == null) {
       errors.add(createMissingMandatoryFieldError("license agreement"));
@@ -577,23 +441,9 @@
     return new ValidationErrorBuilder("must be supplied", fieldName).build();
   }
 
-  String getVspQuestionnaireSchema(SchemaTemplateInput schemaInput) {
-    MDC_DATA_DEBUG_MESSAGE.debugEntryMessage(null);
-    MDC_DATA_DEBUG_MESSAGE.debugExitMessage(null);
-    return SchemaGenerator
-        .generate(SchemaTemplateContext.questionnaire, CompositionEntityType.vsp, schemaInput);
-  }
-
-  private static void sortVspListByModificationTimeDescOrder(
-      List<VersionedVendorSoftwareProductInfo> vsps) {
-    vsps.sort((o1, o2) -> o2.getVspDetails().getWritetimeMicroSeconds()
-        .compareTo(o1.getVspDetails().getWritetimeMicroSeconds()));
-  }
-
-
   private Map<String, List<ErrorMessage>> compile(String vendorSoftwareProductId, Version version,
                                                   ToscaServiceModel serviceModel) {
-    if (serviceModel == null) {
+    if (!isServiceModelExist(serviceModel)) {
       return null;
     }
 
@@ -636,135 +486,47 @@
   }
 
   @Override
-  public String fetchValidationVsp(String user) {
-    try {
-      validateUniqueName(VALIDATION_VSP_NAME);
-    } catch (Exception ignored) {
-      LOGGER.debug("Ignored exception when validating unique VSP name", ignored);
-      return VALIDATION_VSP_ID;
-    }
-    VspDetails validationVsp = new VspDetails();
-    validationVsp.setName(VALIDATION_VSP_NAME);
-
-    vspInfoDao.create(validationVsp);
-    Version version = versioningManager.create(
-        VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE,
-        validationVsp.getId(), user);
-    validationVsp.setVersion(version);
-
-    createUniqueName(VALIDATION_VSP_NAME);
-    VALIDATION_VSP_ID = validationVsp.getId();
-    return VALIDATION_VSP_ID;
-  }
-
-  @Override
-  public VspDetails createVsp(VspDetails vspDetails, String user) {
+  public VspDetails createVsp(VspDetails vspDetails) {
     MDC_DATA_DEBUG_MESSAGE.debugEntryMessage(null);
 
-    validateUniqueName(vspDetails.getName());
-
-    vspDetails.setOnboardingOrigin(OnboardingTypesEnum.NONE.toString());
-
-    vspInfoDao.create(vspDetails);//id will be set in the dao
-    vspInfoDao.updateQuestionnaireData(vspDetails.getId(), null,
+    vspInfoDao.create(vspDetails);
+    vspInfoDao.updateQuestionnaireData(vspDetails.getId(), vspDetails.getVersion(),
         new JsonSchemaDataGenerator(getVspQuestionnaireSchema(null)).generateData());
 
-    Version version = versioningManager
-        .create(VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE,
-            vspDetails.getId(), user);
-    vspDetails.setVersion(version);
-    ActivityLogEntity activityLogEntity = new ActivityLogEntity(vspDetails.getId(), String
-        .valueOf(vspDetails.getVersion().getMajor() + 1),
-        ActivityType.CREATE_NEW.toString(), user, true, "", "");
-    activityLogManager.addActionLog(activityLogEntity, user);
-    String vspName = vspDetails.getName();
-    createUniqueName(vspName);
     MDC_DATA_DEBUG_MESSAGE.debugExitMessage(null);
     return vspDetails;
   }
 
   @Override
-  public List<VersionedVendorSoftwareProductInfo> listVsps(String versionFilter, String user) {
-    MDC_DATA_DEBUG_MESSAGE.debugEntryMessage(null);
-
-    Map<String, VersionInfo> idToVersionsInfo = versioningManager.listEntitiesVersionInfo(
-        VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, user,
-        VersionableEntityAction.Read);
-
-    List<VersionedVendorSoftwareProductInfo> vsps = new ArrayList<>();
-    for (Map.Entry<String, VersionInfo> entry : idToVersionsInfo.entrySet()) {
-      VersionInfo versionInfo = entry.getValue();
-      if (versionFilter != null && versionFilter.equals(VersionStatus.Final.name())) {
-        if (versionInfo.getLatestFinalVersion() == null) {
-          continue;
-        }
-        versionInfo.setActiveVersion(versionInfo.getLatestFinalVersion());
-        versionInfo.setStatus(VersionStatus.Final);
-        versionInfo.setLockingUser(null);
-      }
-
-      Version version = versionInfo.getActiveVersion();
-      if (user.equals(versionInfo.getLockingUser())) {
-        version.setStatus(VersionStatus.Locked);
-      }
-      try {
-        VspDetails vsp = vspInfoDao.get(new VspDetails(entry.getKey(), version));
-        if (vsp != null && !vsp.getId().equals(VALIDATION_VSP_ID)) {
-          vsp.setValidationDataStructure(null);
-          vsps.add(new VersionedVendorSoftwareProductInfo(vsp, versionInfo));
-        }
-      } catch (RuntimeException rte) {
-        LOGGER.error(
-            "Error trying to retrieve vsp[" + entry.getKey() + "] version[" + version.toString
-                () + "] " +
-                "message:" + rte.getMessage(), rte);
-      }
-    }
-
-    sortVspListByModificationTimeDescOrder(vsps);
-
-    MDC_DATA_DEBUG_MESSAGE.debugExitMessage(null);
-
-    return vsps;
-  }
-
-  @Override
-  public void updateVsp(VspDetails vspDetails, String user) {
+  public void updateVsp(VspDetails vspDetails) {
     MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("VSP id", vspDetails.getId());
 
     VspDetails retrieved = vspInfoDao.get(vspDetails);
-    if (!Objects.equals(retrieved.getOnboardingMethod(), vspDetails.getOnboardingMethod())) {
-      final ErrorCode onboardingMethodUpdateErrorCode = OnboardingMethodErrorBuilder
-          .getOnboardingUpdateError();
-
-      MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
-          LoggerTragetServiceName.UPDATE_VSP, ErrorLevel.ERROR.name(),
-          LoggerErrorCode.DATA_ERROR.getErrorCode(), onboardingMethodUpdateErrorCode.message());
-
-      throw new CoreException(onboardingMethodUpdateErrorCode);
+    // TODO: 6/21/2017 remove this validation when validation will be added in the REST level
+    if (retrieved == null) {
+      throw new RuntimeException(String.format("Vsp with id %s and version %s does not exist.",
+          vspDetails.getId(), vspDetails.getVersion().getId()));
     }
+    vspDetails.setOnboardingMethod(retrieved.getOnboardingMethod());
 
     //If any existing feature group is removed from VSP which is also associated in DF then
     //update DF to remove feature group associations.
-    updateDeploymentFlavor(vspDetails, user);
+    updateDeploymentFlavor(vspDetails);
 
     updateUniqueName(retrieved.getName(), vspDetails.getName());
-    vspDetails.setOldVersion(retrieved.getOldVersion());
-
     vspInfoDao.update(vspDetails);
-    //vendorSoftwareProductDao.updateVspLatestModificationTime(vspDetails.getId(), activeVersion);
 
     MDC_DATA_DEBUG_MESSAGE.debugExitMessage("VSP id", vspDetails.getId());
   }
 
-  private void updateDeploymentFlavor(VspDetails vspDetails, String user) {
+  private void updateDeploymentFlavor(VspDetails vspDetails) {
     final List<String> featureGroups = vspDetails.getFeatureGroups();
     if (featureGroups != null) {
       final Collection<DeploymentFlavorEntity> deploymentFlavorEntities = deploymentFlavorDao
           .list(new DeploymentFlavorEntity(vspDetails.getId(), vspDetails
               .getVersion(), null));
       if (Objects.nonNull(deploymentFlavorEntities)) {
-        deploymentFlavorEntities.forEach(deploymentFlavorEntity -> {
+        for (DeploymentFlavorEntity deploymentFlavorEntity : deploymentFlavorEntities) {
           final String featureGroupId =
               deploymentFlavorEntity.getDeploymentFlavorCompositionData().getFeatureGroupId();
           if (!featureGroups.contains(featureGroupId)) {
@@ -773,18 +535,25 @@
             deploymentFlavorCompositionData.setFeatureGroupId(null);
             deploymentFlavorEntity.setDeploymentFlavorCompositionData
                 (deploymentFlavorCompositionData);
-            vendorSoftwareProductDao.updateDeploymentFlavor(deploymentFlavorEntity);
+            deploymentFlavorDao.update(deploymentFlavorEntity);
           }
-        });
+        }
       }
     }
   }
 
 
   @Override
-  public VspDetails getVsp(String vspId, Version version, String user) {
+  public VspDetails getVsp(String vspId, Version version) {
     MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("VSP id", vspId);
 
+    VspDetails vsp = getValidatedVsp(vspId, version);
+
+    MDC_DATA_DEBUG_MESSAGE.debugExitMessage("VSP id", vspId);
+    return vsp;
+  }
+
+  private VspDetails getValidatedVsp(String vspId, Version version) {
     VspDetails vsp = vspInfoDao.get(new VspDetails(vspId, version));
     if (vsp == null) {
       MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
@@ -792,64 +561,11 @@
           LoggerErrorCode.DATA_ERROR.getErrorCode(), "Requested VSP not found");
       throw new CoreException(new VendorSoftwareProductNotFoundErrorBuilder(vspId).build());
     }
-    vsp.setValidationData(orchestrationTemplateDao.getValidationData(vspId, version));
-    if (Objects.isNull(vsp.getOnboardingOrigin())) { //todo should this only be done for non-Manual?
-      vsp.setOnboardingOrigin(OnboardingTypesEnum.ZIP.toString());
-    }
-
-    if (Objects.isNull(vsp.getNetworkPackageName())) {
-      vsp.setNetworkPackageName("Upload File");
-    }
-
-    MDC_DATA_DEBUG_MESSAGE.debugExitMessage("VSP id", vspId);
     return vsp;
   }
 
   @Override
-  public Version callAutoHeal(String vspId, VersionInfo versionInfo,
-                              VspDetails vendorSoftwareProductInfo, String user)
-      throws Exception {
-    switch (versionInfo.getStatus()) {
-      case Locked:
-        if (user.equals(versionInfo.getLockingUser())) {
-          autoHeal(vspId, versionInfo.getActiveVersion(), vendorSoftwareProductInfo,
-              versionInfo.getLockingUser());
-        }
-        return versionInfo.getActiveVersion();
-      case Available:
-        Version checkoutVersion = checkout(vspId, user);
-        autoHeal(vspId, checkoutVersion, vendorSoftwareProductInfo, user);
-        return checkin(vspId, user);
-      case Final:
-        return healAndAdvanceFinalVersion(vspId, vendorSoftwareProductInfo, user);
-      default:
-        //do nothing
-        break;
-    }
-    return versionInfo.getActiveVersion();
-  }
-
-  public Version healAndAdvanceFinalVersion(String vspId, VspDetails vendorSoftwareProductInfo,
-                                            String user) throws IOException {
-
-    Version checkoutVersion = checkout(vspId, user);
-    autoHeal(vspId, checkoutVersion, vendorSoftwareProductInfo, user);
-    Version checkinVersion = checkin(vspId, user);
-
-    ValidationResponse response = Objects.requireNonNull(submit(vspId, user),
-        "Null response not expected");
-
-    if (!response.isValid()) {
-      return checkinVersion;
-    }
-
-    Version finalVersion = checkinVersion.calculateNextFinal();
-    createPackage(vspId, finalVersion, user);
-    return finalVersion;
-  }
-
-  @Override
-  public void deleteVsp(String vspId, String user) {
+  public void deleteVsp(String vspId) {
     MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("VSP id", vspId);
 
     MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
@@ -862,88 +578,16 @@
   }
 
   @Override
-  public void heal(String vspId, Version version, String user) {
-    MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("VSP id", vspId);
-
-    VersionInfo versionInfo = getVersionInfo(vspId, VersionableEntityAction.Read, user);
-
-    version = VersionStatus.Locked.equals(versionInfo.getStatus())
-        ? versionInfo.getActiveVersion()
-        : checkout(vspId, user);
-    version.setStatus(VersionStatus.Locked);
-
-    Optional<String> errorMessages =
-        healingManager.healAll(getHealingParamsAsMap(vspId, version, user));
-
-    VspDetails vspDetails = new VspDetails(vspId, version);
-    vspDetails.setOldVersion(null);
-    vspInfoDao.updateOldVersionIndication(vspDetails);
-
-    LOGGER.audit("Healed VSP " + vspDetails.getId());
-    MDC_DATA_DEBUG_MESSAGE.debugExitMessage("VSP id", vspId);
-
-    errorMessages.ifPresent(s -> {
-      throw new CoreException(new ErrorCode.ErrorCodeBuilder().withId("HEALING_ERROR")
-              .withCategory(ErrorCategory.APPLICATION).withMessage(s).build());
-    });
-  }
-
-  private void autoHeal(String vspId, Version checkoutVersion, VspDetails vspDetails, String user) {
-    MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("VSP id", vspId);
-
-    checkoutVersion.setStatus(VersionStatus.Locked);
-    Map<String, Object> healingParams = getHealingParamsAsMap(vspId, checkoutVersion, user);
-
-    Optional<String> errorMessages = healingManager.healAll(healingParams);
-
-    vspDetails.setVersion(checkoutVersion);
-    vspDetails.setOldVersion(null);
-    vspInfoDao.updateOldVersionIndication(vspDetails);
-
-    LOGGER.audit("Healed VSP " + vspDetails.getName());
-    MDC_DATA_DEBUG_MESSAGE.debugExitMessage("VSP id", vspId);
-
-    errorMessages.ifPresent(s -> {
-      throw new CoreException(new ErrorCode.ErrorCodeBuilder().withId("HEALING_ERROR")
-              .withCategory(ErrorCategory.APPLICATION).withMessage(s).build());
-    });
-  }
-
-  private Map<String, Object> getHealingParamsAsMap(String vspId, Version version, String user) {
-    Map<String, Object> healingParams = new HashMap<>();
-
-    healingParams.put(SdcCommon.VSP_ID, vspId);
-    healingParams.put(SdcCommon.VERSION, version);
-    healingParams.put(SdcCommon.USER, user);
-
-    return healingParams;
-  }
-
-  @Override
   public List<PackageInfo> listPackages(String category, String subCategory) {
     return packageInfoDao.listByCategory(category, subCategory);
   }
 
   @Override
-  public File getTranslatedFile(String vspId, Version version, String user) {
+  public File getTranslatedFile(String vspId, Version version) {
     MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("VSP id", vspId);
     String errorMessage;
-    if (version == null) {
-      errorMessage = "Package not found";
-      MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
-          LoggerTragetServiceName.GET_TRANSLATED_FILE, ErrorLevel.ERROR.name(),
-          LoggerErrorCode.DATA_ERROR.getErrorCode(), errorMessage);
-      throw new CoreException(new PackageNotFoundErrorBuilder(vspId).build());
-    } else if (!version.isFinal()) {
-      errorMessage = "Invalid requested version";
-      MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
-          LoggerTragetServiceName.GET_VERSION_INFO, ErrorLevel.ERROR.name(),
-          LoggerErrorCode.DATA_ERROR.getErrorCode(), errorMessage);
-      throw new CoreException(new RequestedVersionInvalidErrorBuilder().build());
-    }
 
-    PackageInfo packageInfo =
-        packageInfoDao.get(new PackageInfo(vspId, version));
+    PackageInfo packageInfo = packageInfoDao.get(new PackageInfo(vspId, version));
     if (packageInfo == null) {
       errorMessage = "Package not found";
       MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
@@ -981,10 +625,10 @@
 
   @Override
 
-  public byte[] getOrchestrationTemplateFile(String vspId, Version version, String user) {
+  public byte[] getOrchestrationTemplateFile(String vspId, Version version) {
     MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("VSP id", vspId);
 
-    UploadDataEntity uploadData = orchestrationTemplateDao.getOrchestrationTemplate(vspId, version);
+    OrchestrationTemplateEntity uploadData = orchestrationTemplateDao.get(vspId, version);
     ByteBuffer contentData = uploadData.getContentData();
     if (contentData == null) {
       return null;
@@ -993,7 +637,7 @@
     ByteArrayOutputStream baos = new ByteArrayOutputStream();
 
     try (final ZipOutputStream zos = new ZipOutputStream(baos);
-         ZipInputStream zipStream = new ZipInputStream(
+         ZipInputStream ignored = new ZipInputStream(
              new ByteArrayInputStream(contentData.array()))) {
       zos.write(contentData.array());
     } catch (IOException exception) {
@@ -1008,29 +652,25 @@
   }
 
   @Override
-  public PackageInfo createPackage(String vspId, Version version, String user) throws IOException {
-    MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("VSP id", vspId);
+  public OrchestrationTemplateEntity getOrchestrationTemplateInfo(String vspId, Version version) {
+    return orchestrationTemplateDao.getInfo(vspId, version);
+  }
 
-    if (!version.isFinal()) {
-      MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
-          LoggerTragetServiceName.CREATE_PACKAGE, ErrorLevel.ERROR.name(),
-          LoggerErrorCode.PERMISSION_ERROR.getErrorCode(), "Can't create package");
-      throw new CoreException(
-          new CreatePackageForNonFinalVendorSoftwareProductErrorBuilder(vspId, version)
-              .build());
-    }
+  @Override
+  public PackageInfo createPackage(String vspId, Version version) throws IOException {
+    MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("VSP id", vspId);
 
     ToscaServiceModel toscaServiceModel = enrichedServiceModelDao.getServiceModel(vspId, version);
     VspDetails vspDetails = vspInfoDao.get(new VspDetails(vspId, version));
     Version vlmVersion = vspDetails.getVlmVersion();
 
-    PackageInfo packageInfo = createPackageInfo(vspId, vspDetails);
+    PackageInfo packageInfo = createPackageInfo(vspDetails);
 
     ToscaFileOutputServiceCsarImpl toscaServiceTemplateServiceCsar =
         new ToscaFileOutputServiceCsarImpl();
     FileContentHandler licenseArtifacts = licenseArtifactsService
         .createLicenseArtifacts(vspDetails.getId(), vspDetails.getVendorId(), vlmVersion,
-            vspDetails.getFeatureGroups(), user);
+            vspDetails.getFeatureGroups());
     //todo add tosca validation here
     packageInfo.setTranslatedFile(ByteBuffer.wrap(
         toscaServiceTemplateServiceCsar.createOutputFile(toscaServiceModel, licenseArtifacts)));
@@ -1043,10 +683,8 @@
     return packageInfo;
   }
 
-  private PackageInfo createPackageInfo(String vspId, VspDetails vspDetails) {
-    PackageInfo packageInfo = new PackageInfo();
-    packageInfo.setVspId(vspId);
-    packageInfo.setVersion(vspDetails.getVersion());
+  private PackageInfo createPackageInfo(VspDetails vspDetails) {
+    PackageInfo packageInfo = new PackageInfo(vspDetails.getId(), vspDetails.getVersion());
     packageInfo.setVspName(vspDetails.getName());
     packageInfo.setVspDescription(vspDetails.getDescription());
     packageInfo.setCategory(vspDetails.getCategory());
@@ -1059,7 +697,7 @@
 
   @Override
 
-  public QuestionnaireResponse getVspQuestionnaire(String vspId, Version version, String user) {
+  public QuestionnaireResponse getVspQuestionnaire(String vspId, Version version) {
     MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("VSP id", vspId);
 
     VspQuestionnaireEntity retrieved = vspInfoDao.getQuestionnaire(vspId, version);
@@ -1078,8 +716,7 @@
   }
 
   @Override
-  public void updateVspQuestionnaire(String vspId, Version version, String questionnaireData,
-                                     String user) {
+  public void updateVspQuestionnaire(String vspId, Version version, String questionnaireData) {
     MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("VSP id", vspId);
 
     vspInfoDao.updateQuestionnaireData(vspId, version, questionnaireData);
@@ -1088,21 +725,19 @@
   }
 
 
-  private Map<String, List<ErrorMessage>> validateUploadData(UploadDataEntity uploadData,
-                                                             VspDetails vspDetails)
-      throws IOException {
+  private Map<String, List<ErrorMessage>> validateOrchestrationTemplate(
+      OrchestrationTemplateEntity orchestrationTemplate) throws IOException {
 
-    Map<String, List<ErrorMessage>> validationErrors = new HashMap<>();
-    if (uploadData == null || uploadData.getContentData() == null) {
+    if (!isOrchestrationTemplateExist(orchestrationTemplate)) {
       return null;
     }
+    Map<String, List<ErrorMessage>> validationErrors = new HashMap<>();
 
-    FileContentHandler fileContentMap =
-        CommonUtil.validateAndUploadFileContent(OnboardingTypesEnum.getOnboardingTypesEnum
-                (vspDetails.getOnboardingOrigin()),
-            uploadData.getContentData().array());
+    FileContentHandler fileContentMap = CommonUtil.validateAndUploadFileContent(
+        OnboardingTypesEnum.getOnboardingTypesEnum(orchestrationTemplate.getFileSuffix()),
+        orchestrationTemplate.getContentData().array());
 
-    if (CommonUtil.isFileOriginFromZip(vspDetails.getOnboardingOrigin())) {
+    if (CommonUtil.isFileOriginFromZip(orchestrationTemplate.getFileSuffix())) {
       ValidationManager validationManager =
           ValidationManagerUtil.initValidationManager(fileContentMap);
       validationErrors.putAll(validationManager.validate());
@@ -1113,14 +748,6 @@
             ? null : validationErrors;
   }
 
-  private VersionInfo getVersionInfo(String vendorSoftwareProductId, VersionableEntityAction action,
-                                     String user) {
-    return versioningManager.getEntityVersionInfo(
-        VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE,
-        vendorSoftwareProductId, user, action);
-  }
-
-
   private QuestionnaireValidationResult validateQuestionnaire(String vspId, Version version,
                                                               String onboardingMethod) {
     MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("VSP id", vspId);
@@ -1132,7 +759,7 @@
     compositionEntityDataManager
         .addEntity(vspInfoDao.getQuestionnaire(vspId, version), null);
 
-    Collection<NicEntity> nics = vendorSoftwareProductDao.listNicsByVsp(vspId, version);
+    Collection<NicEntity> nics = nicDao.listByVsp(vspId, version);
 
     Map<String, List<String>> nicNamesByComponent = new HashMap<>();
     for (NicEntity nicEntity : nics) {
@@ -1147,16 +774,16 @@
     }
 
     Collection<ComponentEntity> components =
-        vendorSoftwareProductDao.listComponentsCompositionAndQuestionnaire(vspId, version);
+        componentDao.listCompositionAndQuestionnaire(vspId, version);
     components.forEach(component -> compositionEntityDataManager.addEntity(component,
         new ComponentQuestionnaireSchemaInput(nicNamesByComponent.get(component.getId()),
             JsonUtil.json2Object(component.getQuestionnaireData(), Map.class))));
 
-    Collection<ComputeEntity> computes = vendorSoftwareProductDao.listComputesByVsp(vspId, version);
+    Collection<ComputeEntity> computes = computeDao.listByVsp(vspId, version);
     computes.forEach(compute -> compositionEntityDataManager.addEntity(compute, null));
 
-    if ("Manual".equals(onboardingMethod)) {
-      Collection<ImageEntity> images = vendorSoftwareProductDao.listImagesByVsp(vspId, version);
+    if (OnboardingMethod.Manual.name().equals(onboardingMethod)) {
+      Collection<ImageEntity> images = imageDao.listByVsp(vspId, version);
       images.forEach(image -> compositionEntityDataManager.addEntity(image, null));
     }
 
@@ -1179,7 +806,7 @@
   }
 
   @Override
-  public File getInformationArtifact(String vspId, Version version, String user) {
+  public File getInformationArtifact(String vspId, Version version) {
     MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("VSP id", vspId);
     VspDetails vspDetails = vspInfoDao.get(new VspDetails(vspId, version));
 
@@ -1209,14 +836,11 @@
     return infoArtifactFile;
   }
 
-  void validateUniqueName(String vspName) {
-    UniqueValueUtil.validateUniqueValue(
-        VendorSoftwareProductConstants.UniqueValues.VENDOR_SOFTWARE_PRODUCT_NAME, vspName);
-  }
-
-  void createUniqueName(String vspName) {
-    UniqueValueUtil.createUniqueValue(
-        VendorSoftwareProductConstants.UniqueValues.VENDOR_SOFTWARE_PRODUCT_NAME, vspName);
+  String getVspQuestionnaireSchema(SchemaTemplateInput schemaInput) {
+    MDC_DATA_DEBUG_MESSAGE.debugEntryMessage(null);
+    MDC_DATA_DEBUG_MESSAGE.debugExitMessage(null);
+    return SchemaGenerator
+        .generate(SchemaTemplateContext.questionnaire, CompositionEntityType.vsp, schemaInput);
   }
 
   void updateUniqueName(String oldVspName, String newVspName) {
@@ -1226,13 +850,22 @@
   }
 
   @Override
-  public Collection<ComputeEntity> getComputeByVsp(String vspId, Version version,
-                                                   String user) {
-    return vendorSoftwareProductDao.listComputesByVsp(vspId, version);
+  public Collection<ComputeEntity> getComputeByVsp(String vspId, Version version) {
+    return computeDao.listByVsp(vspId, version);
+  }
+
+  private boolean isOrchestrationTemplateExist(OrchestrationTemplateEntity orchestrationTemplate) {
+    return orchestrationTemplate != null &&
+        orchestrationTemplate.getContentData() != null &&
+        orchestrationTemplate.getFileSuffix() != null &&
+        orchestrationTemplate.getFileName() != null;
+  }
+
+  private boolean isServiceModelExist(ToscaServiceModel serviceModel) {
+    return serviceModel != null && serviceModel.getEntryDefinitionServiceTemplate() != null;
   }
 
   private void auditIfContainsErrors(List<ErrorMessage> errorList, String vspId, String auditType) {
-
     errorList.forEach(errorMessage -> {
       if (errorMessage.getLevel().equals(ErrorLevel.ERROR)) {
         LOGGER.audit(AuditMessages.AUDIT_MSG + String.format(auditType, errorMessage.getMessage(),
@@ -1240,4 +873,6 @@
       }
     });
   }
+
+
 }
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VspManagerFactoryImpl.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VspManagerFactoryImpl.java
index 5615f8f..a2c0aea 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VspManagerFactoryImpl.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VspManagerFactoryImpl.java
@@ -22,38 +22,38 @@
 
 import org.openecomp.core.model.dao.EnrichedServiceModelDaoFactory;
 import org.openecomp.core.model.dao.ServiceModelDaoFactory;
-import org.openecomp.sdc.activityLog.ActivityLogManagerFactory;
-import org.openecomp.sdc.healing.factory.HealingManagerFactory;
 import org.openecomp.sdc.vendorlicense.VendorLicenseArtifactServiceFactory;
 import org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacadeFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductManager;
 import org.openecomp.sdc.vendorsoftwareproduct.VspManagerFactory;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDaoFactory;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDependencyModelDaoFactory;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.ComputeDaoFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.DeploymentFlavorDaoFactory;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.ImageDaoFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.NicDaoFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.OrchestrationTemplateDaoFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.PackageInfoDaoFactory;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDaoFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDaoFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.factory.InformationArtifactGeneratorFactory;
-import org.openecomp.sdc.versioning.VersioningManagerFactory;
 
 public class VspManagerFactoryImpl extends VspManagerFactory {
   private static final VendorSoftwareProductManager INSTANCE =
       new VendorSoftwareProductManagerImpl(
-          VersioningManagerFactory.getInstance().createInterface(),
-          VendorSoftwareProductDaoFactory.getInstance().createInterface(),
           OrchestrationTemplateDaoFactory.getInstance().createInterface(),
           VendorSoftwareProductInfoDaoFactory.getInstance().createInterface(),
           VendorLicenseFacadeFactory.getInstance().createInterface(),
           ServiceModelDaoFactory.getInstance().createInterface(),
           EnrichedServiceModelDaoFactory.getInstance().createInterface(),
-          HealingManagerFactory.getInstance().createInterface(),
           VendorLicenseArtifactServiceFactory.getInstance().createInterface(),
           InformationArtifactGeneratorFactory.getInstance().createInterface(),
           PackageInfoDaoFactory.getInstance().createInterface(),
-          ActivityLogManagerFactory.getInstance().createInterface(),
           DeploymentFlavorDaoFactory.getInstance().createInterface(),
+          ComponentDaoFactory.getInstance().createInterface(),
+          ComponentDependencyModelDaoFactory.getInstance().createInterface(),
           NicDaoFactory.getInstance().createInterface(),
+          ComputeDaoFactory.getInstance().createInterface(),
+          ImageDaoFactory.getInstance().createInterface(),
           new ManualVspToscaManagerImpl());
 
   @Override
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/BaseOrchestrationTemplateHandler.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/BaseOrchestrationTemplateHandler.java
index c7fb437..d20dc07 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/BaseOrchestrationTemplateHandler.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/BaseOrchestrationTemplateHandler.java
@@ -14,87 +14,94 @@
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
 import org.openecomp.sdc.vendorsoftwareproduct.services.filedatastructuremodule.CandidateService;
 import org.openecomp.sdc.vendorsoftwareproduct.types.UploadFileResponse;
-import org.openecomp.sdc.versioning.dao.types.Version;
 
 import java.io.InputStream;
 import java.util.Optional;
+
 import static org.openecomp.core.validation.errors.ErrorMessagesFormatBuilder.getErrorWithParameters;
+
 public abstract class BaseOrchestrationTemplateHandler implements OrchestrationTemplateFileHandler {
-    protected static final Logger logger =
-            LoggerFactory.getLogger(BaseOrchestrationTemplateHandler.class);
-    protected static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage();
+  protected static final Logger logger =
+      LoggerFactory.getLogger(BaseOrchestrationTemplateHandler.class);
+  protected static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage();
 
-    @Override
-    public UploadFileResponse upload(String vspId, Version version, InputStream fileToUpload, String user,
-                                     CandidateService candidateService, VspDetails vspDetails) {
-        UploadFileResponse uploadFileResponse = new UploadFileResponse();
-        uploadFileResponse.setOnboardingType(getHandlerType());
-        if (isNotEmptyFileToUpload(fileToUpload, uploadFileResponse, candidateService)) {
-            return uploadFileResponse;
-        }
-
-        byte[] uploadedFileData = FileUtils.toByteArray(fileToUpload);
-        if (isInvalidRawZipData(uploadFileResponse, uploadedFileData, candidateService)) {
-            return uploadFileResponse;
-        }
-
-        Optional<FileContentHandler> optionalContentMap =
-                getFileContentMap(uploadFileResponse, uploadedFileData);
-        if (!optionalContentMap.isPresent()) {
-            logger.error(getErrorWithParameters(Messages.FILE_CONTENT_MAP.getErrorMessage(), getHandlerType().toString()));
-            uploadFileResponse
-                    .addStructureError(
-                            SdcCommon.UPLOAD_FILE,
-                            new ErrorMessage(ErrorLevel.ERROR,
-                                    getErrorWithParameters(Messages.FILE_CONTENT_MAP.getErrorMessage(), getHandlerType().toString())));
-
-            mdcDataDebugMessage.debugExitMessage("VSP id", vspId);
-            return uploadFileResponse;
-        }
-
-        if (!MapUtils.isEmpty(uploadFileResponse.getErrors())) {
-
-            mdcDataDebugMessage.debugExitMessage("VSP id", vspId);
-            return uploadFileResponse;
-        }
-        if (updateCandidateData(vspId, user, candidateService, vspDetails, uploadFileResponse,
-                uploadedFileData, optionalContentMap))
-            return uploadFileResponse;
-
-        mdcDataDebugMessage.debugExitMessage("VSP id", vspId);
-        return uploadFileResponse;
-
+  @Override
+  public UploadFileResponse upload(VspDetails vspDetails, InputStream fileToUpload,
+                                   String fileSuffix, String networkPackageName,
+                                   CandidateService candidateService) {
+    UploadFileResponse uploadFileResponse = new UploadFileResponse();
+    uploadFileResponse.setOnboardingType(getHandlerType());
+    if (isNotEmptyFileToUpload(fileToUpload, uploadFileResponse, candidateService)) {
+      return uploadFileResponse;
     }
 
-    protected abstract boolean updateCandidateData(String vspId, String user, CandidateService candidateService,
-                                                   VspDetails vspDetails, UploadFileResponse uploadFileResponse,
-                                                   byte[] uploadedFileData,
-                                                   Optional<FileContentHandler> optionalContentMap);
-
-
-    private boolean isNotEmptyFileToUpload(InputStream fileToUpload,
-                                           UploadFileResponse uploadFileResponse, CandidateService candidateService) {
-        Optional<ErrorMessage> errorMessage =
-                candidateService.validateNonEmptyFileToUpload(fileToUpload);
-        if (errorMessage.isPresent()) {
-            uploadFileResponse.addStructureError(SdcCommon.UPLOAD_FILE, errorMessage.get());
-            return true;
-        }
-        return false;
+    byte[] uploadedFileData = FileUtils.toByteArray(fileToUpload);
+    if (isInvalidRawZipData(uploadFileResponse, uploadedFileData, candidateService)) {
+      return uploadFileResponse;
     }
 
-    protected boolean isInvalidRawZipData(UploadFileResponse uploadFileResponse,
-                                        byte[] uploadedFileData, CandidateService candidateService) {
-        Optional<ErrorMessage> errorMessage;
-        errorMessage = candidateService.validateRawZipData(uploadedFileData);
-        if (errorMessage.isPresent()) {
-            uploadFileResponse.addStructureError(SdcCommon.UPLOAD_FILE, errorMessage.get());
-            return true;
-        }
-        return false;
+    Optional<FileContentHandler> optionalContentMap =
+        getFileContentMap(uploadFileResponse, uploadedFileData);
+    if (!optionalContentMap.isPresent()) {
+      logger.error(getErrorWithParameters(Messages.FILE_CONTENT_MAP.getErrorMessage(),
+          getHandlerType().toString()));
+      uploadFileResponse.addStructureError(SdcCommon.UPLOAD_FILE, new ErrorMessage(ErrorLevel.ERROR,
+          getErrorWithParameters(Messages.FILE_CONTENT_MAP.getErrorMessage(),
+              getHandlerType().toString())));
+
+      mdcDataDebugMessage.debugExitMessage("VSP id", vspDetails.getId());
+      return uploadFileResponse;
     }
 
-    public abstract Optional<FileContentHandler> getFileContentMap(UploadFileResponse uploadFileResponse,
-                                                                   byte[] uploadedFileData);
-    protected abstract OnboardingTypesEnum getHandlerType();
+    if (!MapUtils.isEmpty(uploadFileResponse.getErrors())) {
+      mdcDataDebugMessage.debugExitMessage("VSP id", vspDetails.getId());
+      return uploadFileResponse;
+    }
+    if (updateCandidateData(vspDetails, uploadedFileData, optionalContentMap.get(), fileSuffix,
+        networkPackageName, candidateService, uploadFileResponse)) {
+      return uploadFileResponse;
+    }
+
+    mdcDataDebugMessage.debugExitMessage("VSP id", vspDetails.getId());
+    return uploadFileResponse;
+
+  }
+
+  protected abstract boolean updateCandidateData(VspDetails vspDetails,
+                                                 byte[] uploadedFileData,
+                                                 FileContentHandler contentMap,
+                                                 String fileSuffix,
+                                                 String networkPackageName,
+                                                 CandidateService candidateService,
+                                                 UploadFileResponse uploadFileResponse);
+
+  private boolean isNotEmptyFileToUpload(InputStream fileToUpload,
+                                         UploadFileResponse uploadFileResponse,
+                                         CandidateService candidateService) {
+    Optional<ErrorMessage> errorMessage =
+        candidateService.validateNonEmptyFileToUpload(fileToUpload);
+    if (errorMessage.isPresent()) {
+      uploadFileResponse.addStructureError(SdcCommon.UPLOAD_FILE, errorMessage.get());
+      return true;
+    }
+    return false;
+  }
+
+  protected boolean isInvalidRawZipData(UploadFileResponse uploadFileResponse,
+                                        byte[] uploadedFileData,
+                                        CandidateService candidateService) {
+    Optional<ErrorMessage> errorMessage;
+    errorMessage = candidateService.validateRawZipData(uploadedFileData);
+    if (errorMessage.isPresent()) {
+      uploadFileResponse.addStructureError(SdcCommon.UPLOAD_FILE, errorMessage.get());
+      return true;
+    }
+    return false;
+  }
+
+  public abstract Optional<FileContentHandler> getFileContentMap(
+      UploadFileResponse uploadFileResponse,
+      byte[] uploadedFileData);
+
+  protected abstract OnboardingTypesEnum getHandlerType();
 }
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/OrchestrationTemplateCSARHandler.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/OrchestrationTemplateCSARHandler.java
index db0851c..1614755 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/OrchestrationTemplateCSARHandler.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/OrchestrationTemplateCSARHandler.java
@@ -30,131 +30,139 @@
 import static org.openecomp.sdc.vendorsoftwareproduct.impl.orchestration.csar.CSARConstants.MAIN_SERVICE_TEMPLATE_YAML_FILE_NAME;
 
 public class OrchestrationTemplateCSARHandler extends BaseOrchestrationTemplateHandler
-        implements OrchestrationTemplateFileHandler {
+    implements OrchestrationTemplateFileHandler {
 
 
-    @Override
-    public Optional<FileContentHandler> getFileContentMap(UploadFileResponse uploadFileResponse,
-                                                          byte[] uploadedFileData) {
-        FileContentHandler contentMap = null;
-        List<String> folderList = new ArrayList<>();
-        try {
-            Pair<FileContentHandler, List<String>> fileContentMapFromOrchestrationCandidateZip = CommonUtil.getFileContentMapFromOrchestrationCandidateZip(uploadedFileData);
-            contentMap = fileContentMapFromOrchestrationCandidateZip.getKey();
-            folderList = fileContentMapFromOrchestrationCandidateZip.getRight();
-        } catch (IOException exception) {
-            uploadFileResponse.addStructureError(
-                    SdcCommon.UPLOAD_FILE,
-                    new ErrorMessage(ErrorLevel.ERROR, Messages.INVALID_CSAR_FILE.getErrorMessage()));
-        } catch (CoreException coreException) {
-            uploadFileResponse.addStructureError(
-                    SdcCommon.UPLOAD_FILE, new ErrorMessage(ErrorLevel.ERROR, coreException.getMessage()));
-        }
-        validateContent(uploadFileResponse, contentMap, folderList);
-        return Optional.ofNullable(contentMap);
+  @Override
+  public Optional<FileContentHandler> getFileContentMap(UploadFileResponse uploadFileResponse,
+                                                        byte[] uploadedFileData) {
+    FileContentHandler contentMap = null;
+    List<String> folderList = new ArrayList<>();
+    try {
+      Pair<FileContentHandler, List<String>> fileContentMapFromOrchestrationCandidateZip =
+          CommonUtil.getFileContentMapFromOrchestrationCandidateZip(uploadedFileData);
+      contentMap = fileContentMapFromOrchestrationCandidateZip.getKey();
+      folderList = fileContentMapFromOrchestrationCandidateZip.getRight();
+    } catch (IOException exception) {
+      uploadFileResponse.addStructureError(
+          SdcCommon.UPLOAD_FILE,
+          new ErrorMessage(ErrorLevel.ERROR, Messages.INVALID_CSAR_FILE.getErrorMessage()));
+    } catch (CoreException coreException) {
+      uploadFileResponse.addStructureError(
+          SdcCommon.UPLOAD_FILE, new ErrorMessage(ErrorLevel.ERROR, coreException.getMessage()));
+    }
+    validateContent(uploadFileResponse, contentMap, folderList);
+    return Optional.ofNullable(contentMap);
+  }
+
+  private void validateContent(UploadFileResponse uploadFileResponse, FileContentHandler contentMap,
+                               List<String> folderList) {
+    validateManifest(uploadFileResponse, contentMap);
+    validateFileExist(uploadFileResponse, contentMap, MAIN_SERVICE_TEMPLATE_YAML_FILE_NAME);
+    validateNoExtraFiles(uploadFileResponse, contentMap);
+    validateFolders(uploadFileResponse, folderList);
+  }
+
+  private void validateManifest(UploadFileResponse uploadFileResponse,
+                                FileContentHandler contentMap) {
+
+    if (!validateFileExist(uploadFileResponse, contentMap, MAIN_SERVICE_TEMPLATE_MF_FILE_NAME)) {
+      return;
     }
 
-    private void validateContent(UploadFileResponse uploadFileResponse, FileContentHandler contentMap, List<String> folderList) {
-        validateManifest(uploadFileResponse, contentMap);
-        validateFileExist(uploadFileResponse, contentMap, MAIN_SERVICE_TEMPLATE_YAML_FILE_NAME);
-        validateNoExtraFiles(uploadFileResponse, contentMap);
-        validateFolders(uploadFileResponse, folderList);
+    try (InputStream fileContent = contentMap.getFileContent(MAIN_SERVICE_TEMPLATE_MF_FILE_NAME)) {
+
+      OnboardingManifest onboardingManifest = new OnboardingManifest(fileContent);
+      if (!onboardingManifest.isValid()) {
+        onboardingManifest.getErrors().forEach(error -> uploadFileResponse.addStructureError(
+            SdcCommon.UPLOAD_FILE, new ErrorMessage(ErrorLevel.ERROR, error)));
+      }
+
+    } catch (IOException e) {
+      // convert to runtime to keep the throws unchanged
+      throw new RuntimeException("Failed to validate manifest", e);
     }
+  }
 
-    private void validateManifest(UploadFileResponse uploadFileResponse, FileContentHandler contentMap) {
-
-        if (!validateFileExist(uploadFileResponse, contentMap, MAIN_SERVICE_TEMPLATE_MF_FILE_NAME)){
-            return;
-        }
-
-        try (InputStream fileContent = contentMap.getFileContent(MAIN_SERVICE_TEMPLATE_MF_FILE_NAME)) {
-
-            OnboardingManifest onboardingManifest = new OnboardingManifest(fileContent);
-            if (!onboardingManifest.isValid()) {
-                onboardingManifest.getErrors().forEach(error -> uploadFileResponse.addStructureError(
-                        SdcCommon.UPLOAD_FILE, new ErrorMessage(ErrorLevel.ERROR, error)));
-            }
-
-        } catch (IOException e) {
-            // convert to runtime to keep the throws unchanged
-            throw new RuntimeException("Failed to validate manifest", e);
-        }
+  private void validateNoExtraFiles(UploadFileResponse uploadFileResponse,
+                                    FileContentHandler contentMap) {
+    List<String> unwantedFiles = contentMap.getFileList().stream()
+        .filter(this::filterFiles).collect(Collectors.toList());
+    if (!unwantedFiles.isEmpty()) {
+      unwantedFiles.stream().filter(this::filterFiles).forEach(unwantedFile ->
+          uploadFileResponse.addStructureError(
+              SdcCommon.UPLOAD_FILE, new ErrorMessage(ErrorLevel.ERROR,
+                  getErrorWithParameters(Messages.CSAR_FILES_NOT_ALLOWED.getErrorMessage(),
+                      unwantedFile))));
     }
+  }
 
-    private void validateNoExtraFiles(UploadFileResponse uploadFileResponse,  FileContentHandler contentMap) {
-        List<String> unwantedFiles = contentMap.getFileList().stream()
-                .filter(this::filterFiles).collect(Collectors.toList());
-        if (!unwantedFiles.isEmpty()) {
-            unwantedFiles.stream().filter(this::filterFiles).forEach(unwantedFile ->
-                    uploadFileResponse.addStructureError(
-                            SdcCommon.UPLOAD_FILE, new ErrorMessage(ErrorLevel.ERROR,
-                                    getErrorWithParameters(Messages.CSAR_FILES_NOT_ALLOWED.getErrorMessage(),
-                                            unwantedFile))));
-        }
-    }
-
-    private void validateFolders(UploadFileResponse uploadFileResponse, List<String> folderList) {
-        List<String> filterResult = folderList.stream().filter(this::filterFolders).collect(Collectors.toList());
-        if (!filterResult.isEmpty()) {
-            folderList.stream().filter(this::filterFolders).forEach( unwantedFolder ->
-                    uploadFileResponse.addStructureError(
-                            SdcCommon.UPLOAD_FILE, new ErrorMessage(ErrorLevel.ERROR,
-                                    getErrorWithParameters(Messages.CSAR_DIRECTORIES_NOT_ALLOWED.getErrorMessage(),
-                                            unwantedFolder))));
-
-        }
-    }
-    private boolean filterFiles(String inFileName) {
-        boolean valid = ELIGIBLE_FILES.stream().anyMatch(fileName -> fileName.equals(inFileName));
-        return !valid && filterFolders(inFileName);
-    }
-
-    private boolean filterFolders(String fileName) {
-        return ELIGBLE_FOLDERS.stream().noneMatch(fileName::startsWith);
-    }
-
-    private boolean validateFileExist(UploadFileResponse uploadFileResponse, FileContentHandler contentMap, String fileName) {
-
-        boolean containsFile = contentMap.containsFile(fileName);
-        if (!containsFile) {
-            uploadFileResponse.addStructureError(
-                    SdcCommon.UPLOAD_FILE, new ErrorMessage(ErrorLevel.ERROR,
-                            getErrorWithParameters(Messages.CSAR_FILE_NOT_FOUND.getErrorMessage(), fileName)));
-        }
-        return containsFile;
-    }
-
-    @Override
-    protected boolean updateCandidateData(String vspId, String user, CandidateService candidateService,
-                                          VspDetails vspDetails, UploadFileResponse uploadFileResponse,
-                                          byte[] uploadedFileData, Optional<FileContentHandler> optionalContentMap) {
-        try {
-            candidateService.updateCandidateUploadData(new OrchestrationTemplateCandidateData(
-                    ByteBuffer.wrap(uploadedFileData), ""), vspDetails.getId());
-        } catch (Exception exception) {
-            logger.error(getErrorWithParameters(Messages.FILE_CONTENT_MAP.getErrorMessage(),
-                    getHandlerType().toString()), exception);
-            uploadFileResponse
-                    .addStructureError(
-                            SdcCommon.UPLOAD_FILE,
-                            new ErrorMessage(ErrorLevel.ERROR, exception.getMessage()));
-
-            mdcDataDebugMessage.debugExitMessage("VSP id", vspId);
-            return true;
-        }
-        return false;
-    }
-
-
-    @Override
-    protected OnboardingTypesEnum getHandlerType() {
-        return OnboardingTypesEnum.CSAR;
-    }
-
-    @Override
-    protected boolean isInvalidRawZipData(UploadFileResponse uploadFileResponse,
-                                          byte[] uploadedFileData, CandidateService candidateService) {
-        return super.isInvalidRawZipData(uploadFileResponse, uploadedFileData, candidateService);
+  private void validateFolders(UploadFileResponse uploadFileResponse, List<String> folderList) {
+    List<String> filterResult =
+        folderList.stream().filter(this::filterFolders).collect(Collectors.toList());
+    if (!filterResult.isEmpty()) {
+      folderList.stream().filter(this::filterFolders).forEach(unwantedFolder ->
+          uploadFileResponse.addStructureError(
+              SdcCommon.UPLOAD_FILE, new ErrorMessage(ErrorLevel.ERROR,
+                  getErrorWithParameters(Messages.CSAR_DIRECTORIES_NOT_ALLOWED.getErrorMessage(),
+                      unwantedFolder))));
 
     }
+  }
+
+  private boolean filterFiles(String inFileName) {
+    boolean valid = ELIGIBLE_FILES.stream().anyMatch(fileName -> fileName.equals(inFileName));
+    return !valid && filterFolders(inFileName);
+  }
+
+  private boolean filterFolders(String fileName) {
+    return ELIGBLE_FOLDERS.stream().noneMatch(fileName::startsWith);
+  }
+
+  private boolean validateFileExist(UploadFileResponse uploadFileResponse,
+                                    FileContentHandler contentMap, String fileName) {
+
+    boolean containsFile = contentMap.containsFile(fileName);
+    if (!containsFile) {
+      uploadFileResponse.addStructureError(
+          SdcCommon.UPLOAD_FILE, new ErrorMessage(ErrorLevel.ERROR,
+              getErrorWithParameters(Messages.CSAR_FILE_NOT_FOUND.getErrorMessage(), fileName)));
+    }
+    return containsFile;
+  }
+
+  @Override
+  protected boolean updateCandidateData(VspDetails vspDetails, byte[] uploadedFileData,
+                                        FileContentHandler contentMap,
+                                        String fileSuffix, String networkPackageName,
+                                        CandidateService candidateService,
+                                        UploadFileResponse uploadFileResponse) {
+    try {
+      candidateService.updateCandidateUploadData(vspDetails.getId(), vspDetails.getVersion(),
+          new OrchestrationTemplateCandidateData(ByteBuffer.wrap(uploadedFileData), "", fileSuffix,
+              networkPackageName));
+    } catch (Exception exception) {
+      logger.error(getErrorWithParameters(Messages.FILE_CONTENT_MAP.getErrorMessage(),
+          getHandlerType().toString()), exception);
+      uploadFileResponse.addStructureError(SdcCommon.UPLOAD_FILE,
+          new ErrorMessage(ErrorLevel.ERROR, exception.getMessage()));
+
+      mdcDataDebugMessage.debugExitMessage("VSP id", vspDetails.getId());
+      return true;
+    }
+    return false;
+  }
+
+
+  @Override
+  protected OnboardingTypesEnum getHandlerType() {
+    return OnboardingTypesEnum.CSAR;
+  }
+
+  @Override
+  protected boolean isInvalidRawZipData(UploadFileResponse uploadFileResponse,
+                                        byte[] uploadedFileData,
+                                        CandidateService candidateService) {
+    return super.isInvalidRawZipData(uploadFileResponse, uploadedFileData, candidateService);
+  }
 }
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/OrchestrationTemplateFileHandler.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/OrchestrationTemplateFileHandler.java
index 3f7d18d..5e006a2 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/OrchestrationTemplateFileHandler.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/OrchestrationTemplateFileHandler.java
@@ -3,10 +3,12 @@
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
 import org.openecomp.sdc.vendorsoftwareproduct.services.filedatastructuremodule.CandidateService;
 import org.openecomp.sdc.vendorsoftwareproduct.types.UploadFileResponse;
-import org.openecomp.sdc.versioning.dao.types.Version;
 
 import java.io.InputStream;
+
 public interface OrchestrationTemplateFileHandler {
-    UploadFileResponse upload(String vspId, Version version, InputStream fileToUpload, String user,
-                              CandidateService candidateService, VspDetails vspDetails);
+
+  UploadFileResponse upload(VspDetails vspDetails, InputStream fileToUpload,
+                            String fileSuffix, String networkPackageName,
+                            CandidateService candidateService);
 }
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/OrchestrationTemplateZipHandler.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/OrchestrationTemplateZipHandler.java
index 626d941..343c746 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/OrchestrationTemplateZipHandler.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/OrchestrationTemplateZipHandler.java
@@ -15,41 +15,47 @@
 import java.util.Optional;
 
 import static org.openecomp.core.validation.errors.ErrorMessagesFormatBuilder.getErrorWithParameters;
+
 public class OrchestrationTemplateZipHandler extends BaseOrchestrationTemplateHandler
-        implements OrchestrationTemplateFileHandler {
+    implements OrchestrationTemplateFileHandler {
 
-    @Override
-    public  Optional<FileContentHandler> getFileContentMap(UploadFileResponse uploadFileResponse,
-                                                           byte[] uploadedFileData) {
-       return   OrchestrationUtil.getFileContentMap(OnboardingTypesEnum.ZIP, uploadFileResponse, uploadedFileData);
+  @Override
+  public Optional<FileContentHandler> getFileContentMap(UploadFileResponse uploadFileResponse,
+                                                        byte[] uploadedFileData) {
+    return OrchestrationUtil
+        .getFileContentMap(OnboardingTypesEnum.ZIP, uploadFileResponse, uploadedFileData);
+  }
+
+  @Override
+  protected boolean updateCandidateData(VspDetails vspDetails, byte[] uploadedFileData,
+                                        FileContentHandler contentMap,
+                                        String fileSuffix, String networkPackageName,
+                                        CandidateService candidateService,
+                                        UploadFileResponse uploadFileResponse) {
+    try {
+      OrchestrationTemplateCandidateData candidateData =
+          new CandidateEntityBuilder(candidateService)
+              .buildCandidateEntityFromZip(vspDetails, uploadedFileData, contentMap,
+                  uploadFileResponse.getErrors());
+      candidateData.setFileSuffix(fileSuffix);
+      candidateData.setFileName(networkPackageName);
+
+      candidateService
+          .updateCandidateUploadData(vspDetails.getId(), vspDetails.getVersion(), candidateData);
+    } catch (Exception exception) {
+      logger.error(getErrorWithParameters(Messages.FILE_CONTENT_MAP.getErrorMessage(),
+          getHandlerType().toString()), exception);
+      uploadFileResponse.addStructureError(SdcCommon.UPLOAD_FILE,
+          new ErrorMessage(ErrorLevel.ERROR, exception.getMessage()));
+
+      mdcDataDebugMessage.debugExitMessage("VSP id", vspDetails.getId());
+      return true;
     }
+    return false;
+  }
 
-    @Override
-    protected boolean updateCandidateData(String vspId, String user, CandidateService candidateService,
-                                          VspDetails vspDetails, UploadFileResponse uploadFileResponse,
-                                          byte[] uploadedFileData, Optional<FileContentHandler> optionalContentMap) {
-        try {
-            OrchestrationTemplateCandidateData candidateData =
-                    new CandidateEntityBuilder(candidateService)
-                            .buildCandidateEntityFromZip(vspDetails, uploadedFileData, optionalContentMap.get(),
-                                    uploadFileResponse.getErrors(), user);
-            candidateService.updateCandidateUploadData(candidateData, vspDetails.getId());
-        } catch (Exception exception) {
-            logger.error(getErrorWithParameters(Messages.FILE_CONTENT_MAP.getErrorMessage(),
-                    getHandlerType().toString()),exception);
-            uploadFileResponse
-                    .addStructureError(
-                            SdcCommon.UPLOAD_FILE,
-                            new ErrorMessage(ErrorLevel.ERROR, exception.getMessage()));
-
-            mdcDataDebugMessage.debugExitMessage("VSP id", vspId);
-            return true;
-        }
-        return false;
-    }
-
-    @Override
-    protected OnboardingTypesEnum getHandlerType() {
-        return OnboardingTypesEnum.ZIP;
-    }
+  @Override
+  protected OnboardingTypesEnum getHandlerType() {
+    return OnboardingTypesEnum.ZIP;
+  }
 }
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/OrchestrationUploadFactory.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/OrchestrationUploadFactory.java
index 99b311e..3c3ab81 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/OrchestrationUploadFactory.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/OrchestrationUploadFactory.java
@@ -24,8 +24,8 @@
 
     }
 
-    public static final OrchestrationTemplateFileHandler createOrchestrationTemplateFileHandler(String filePrefix) {
-        String fileExtension = filePrefix.toLowerCase();
+    public static final OrchestrationTemplateFileHandler createOrchestrationTemplateFileHandler(String fileSuffix) {
+        String fileExtension = fileSuffix.toLowerCase();
         ImplementationConfiguration orchestrationTemplateFileHandler = fileHanlders.get(fileExtension);
 
         if(Objects.isNull(orchestrationTemplateFileHandler)){
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/OrchestrationUtil.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/OrchestrationUtil.java
index 2ee7b26..e312e7c 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/OrchestrationUtil.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/OrchestrationUtil.java
@@ -1,8 +1,5 @@
 package org.openecomp.sdc.vendorsoftwareproduct.impl.orchestration;
 
-import static org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants.GENERAL_COMPONENT_ID;
-import static org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants.UniqueValues.PROCESS_NAME;
-
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.collections4.MapUtils;
 import org.openecomp.core.model.dao.ServiceModelDao;
@@ -35,14 +32,16 @@
 import org.openecomp.sdc.vendorsoftwareproduct.dao.OrchestrationTemplateDaoFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.ProcessDao;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.ProcessDaoFactory;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDaoFactory;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDaoFactory;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.VspMergeDaoFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentDependencyModelEntity;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentMonitoringUploadEntity;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.OrchestrationTemplateCandidateData;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.OrchestrationTemplateEntity;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.UploadData;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
 import org.openecomp.sdc.vendorsoftwareproduct.factory.CompositionDataExtractorFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.factory.CompositionEntityDataManagerFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.services.composition.CompositionDataExtractor;
@@ -62,13 +61,13 @@
 import java.util.Set;
 import java.util.stream.Collectors;
 
+import static org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants.UniqueValues.PROCESS_NAME;
+
 public class OrchestrationUtil {
 
   public static final String ORCHESTRATION_CONFIG_NAMESPACE = "orchestration";
   public static final String ORCHESTRATION_IMPL_KEY = "orchestration_impl";
 
-
-  private VendorSoftwareProductDao vendorSoftwareProductDao;
   private NicDao nicDao;
   private ComponentArtifactDao componentArtifactDao;
   private ProcessDao processDao;
@@ -80,8 +79,7 @@
   private CompositionDataExtractor compositionDataExtractor;
 
   public OrchestrationUtil() {
-    this (VendorSoftwareProductDaoFactory.getInstance().createInterface(),
-          NicDaoFactory.getInstance().createInterface(),
+    this(NicDaoFactory.getInstance().createInterface(),
         MonitoringUploadDaoFactory.getInstance().createInterface(),
         ProcessDaoFactory.getInstance().createInterface(),
         OrchestrationTemplateDaoFactory.getInstance().createInterface(),
@@ -93,7 +91,6 @@
   }
 
   public OrchestrationUtil(
-      VendorSoftwareProductDao vendorSoftwareProductDao,
       NicDao nicDao,
       ComponentArtifactDao componentArtifactDao,
       ProcessDao processDao,
@@ -103,7 +100,6 @@
       ComponentDependencyModelDao componentDependencyModelDao,
       CompositionEntityDataManager compositionEntityDataManager,
       CompositionDataExtractor compositionDataExtractor) {
-    this.vendorSoftwareProductDao = vendorSoftwareProductDao;
     this.nicDao = nicDao;
     this.componentArtifactDao = componentArtifactDao;
     this.processDao = processDao;
@@ -116,8 +112,7 @@
   }
 
   public static Optional<FileContentHandler> getFileContentMap(OnboardingTypesEnum type,
-                                                               UploadFileResponse
-                                                                   uploadFileResponse,
+                                                               UploadFileResponse uploadFileResponse,
                                                                byte[] uploadedFileData) {
     FileContentHandler contentMap = null;
     try {
@@ -133,95 +128,63 @@
     return Optional.ofNullable(contentMap);
   }
 
-  public void backupComponentsQuestionnaireBeforeDelete(String vspId, Version activeVersion,
-                                           Map<String, String> componentsQustanniare,
-                                           Map<String, Map<String, String>>
-                                               componentNicsQustanniare,
-                                           Map<String, Collection<ComponentMonitoringUploadEntity>>
-                                               componentMibList,
-                                           Map<String, Collection<ProcessEntity>>
-                                               componentProcesses,
-                                           Map<String, ProcessEntity> processArtifact) {
-    //backup VSP processes
-    backupProcess(vspId, activeVersion, GENERAL_COMPONENT_ID, GENERAL_COMPONENT_ID,
-        componentProcesses, processArtifact);
-    Collection<ComponentEntity> componentsCompositionAndQuestionnaire = vendorSoftwareProductDao
-        .listComponentsCompositionAndQuestionnaire(vspId,
-            activeVersion);
+  public void backupComponentsQuestionnaireBeforeDelete(String vspId, Version version,
+                                                        Map<String, String> componentsQustanniare,
+                                                        Map<String, Map<String, String>>
+                                                            componentNicsQustanniare,
+                                                        Map<String, Collection<ComponentMonitoringUploadEntity>>
+                                                            componentMibList,
+                                                        Map<String, Collection<ProcessEntity>>
+                                                            componentProcesses,
+                                                        Map<String, ProcessEntity> processArtifact) {
+
+    Collection<ComponentEntity> componentsCompositionAndQuestionnaire =
+        componentDao.listCompositionAndQuestionnaire(vspId, version);
     componentsCompositionAndQuestionnaire.forEach(componentEntity ->
-        backupComponentQuestionnaire(vspId, activeVersion, componentEntity, componentsQustanniare,
+        backupComponentQuestionnaire(vspId, version, componentEntity, componentsQustanniare,
             componentNicsQustanniare, componentMibList, componentProcesses, processArtifact));
   }
 
-  private void backupComponentQuestionnaire(String vspId, Version activeVersion,
-                                            ComponentEntity componentEntity,
-                                            Map<String, String> componentsQustanniare,
-                                            Map<String, Map<String, String>>
-                                                componentNicsQustanniare,
-                                            Map<String, Collection<ComponentMonitoringUploadEntity>>
-                                                componentMibList,
-                                            Map<String, Collection<ProcessEntity>>
-                                                componentProcesses,
-                                            Map<String, ProcessEntity> processArtifact) {
+  private void backupComponentQuestionnaire(
+      String vspId, Version version,
+      ComponentEntity componentEntity,
+      Map<String, String> componentsQustanniare,
+      Map<String, Map<String, String>> componentNicsQustanniare,
+      Map<String, Collection<ComponentMonitoringUploadEntity>> componentMibList,
+      Map<String, Collection<ProcessEntity>> componentProcesses,
+      Map<String, ProcessEntity> processArtifact) {
     String componentName = componentEntity.getComponentCompositionData().getName();
-    backupMibData(componentsQustanniare, componentMibList, componentName, componentEntity, vspId,
-        activeVersion);
-    backupComponentProcessData(componentNicsQustanniare, vspId, activeVersion, componentName,
-        componentEntity, componentProcesses, processArtifact);
+    componentsQustanniare.put(componentName, componentEntity.getQuestionnaireData());
+    backupMibData(vspId, version, componentEntity, componentName, componentMibList);
+    backupProcess(vspId, version, componentEntity.getId(), componentName, componentProcesses,
+        processArtifact);
+    backupNicsQuestionnaire(vspId, version, componentEntity, componentName,
+        componentNicsQustanniare);
   }
 
-  private void backupMibData(Map<String, String> componentsQustanniare,
-                             Map<String, Collection<ComponentMonitoringUploadEntity>>
-                                 componentMibList,
-                             String componentName, ComponentEntity componentEntity,
-                             String vspId, Version activeVersion) {
-    componentsQustanniare.put(componentName, componentEntity.getQuestionnaireData());
-    //backup mib
+  private void backupMibData(String vspId, Version version, ComponentEntity componentEntity,
+                             String componentName,
+                             Map<String, Collection<ComponentMonitoringUploadEntity>> componentMibList) {
     Collection<ComponentMonitoringUploadEntity> componentMib =
         componentArtifactDao.listArtifacts(new
-            ComponentMonitoringUploadEntity(vspId, activeVersion, componentEntity.getId(), null));
+            ComponentMonitoringUploadEntity(vspId, version, componentEntity.getId(),
+            null));
     if (CollectionUtils.isNotEmpty(componentMib)) {
       componentMibList.put(componentName, componentMib);
     }
   }
 
-  private void backupComponentProcessData(Map<String, Map<String, String>> componentNicsQustanniare,
-                                          String vspId, Version activeVersion, String componentName,
-                                          ComponentEntity componentEntity,
-                                          Map<String, Collection<ProcessEntity>> componentProcesses,
-                                          Map<String, ProcessEntity> processArtifact) {
-    Collection<NicEntity>
-        nics = nicDao.list(new NicEntity(vspId, activeVersion, componentEntity.getId(), null));
-    //backup component processes
-    backupProcess(vspId, activeVersion, componentEntity.getId(), componentName,
-        componentProcesses, processArtifact);
-    if (CollectionUtils.isNotEmpty(nics)) {
-      Map<String, String> nicsQustanniare = new HashMap<>();
-      nics.forEach(nicEntity -> {
-        NicEntity nic = nicDao.get(new NicEntity(vspId, activeVersion, componentEntity.getId(),
-            nicEntity.getId()));
-        NicEntity nicQuestionnaire = nicDao.getQuestionnaireData(vspId, activeVersion,
-            componentEntity.getId(), nicEntity.getId());
-
-        nicsQustanniare
-            .put(nicEntity.getNicCompositionData().getName(),
-                nicQuestionnaire.getQuestionnaireData());
-      });
-      componentNicsQustanniare.put(componentName, nicsQustanniare);
-    }
-  }
-
-  private void backupProcess(String vspId, Version activeVersion, String componentId,
-                                    String componentName, Map<String,
+  private void backupProcess(String vspId, Version version, String componentId,
+                             String componentName, Map<String,
       Collection<ProcessEntity>> processes,
-                                    Map<String, ProcessEntity> processArtifact) {
-    Collection<ProcessEntity> processList = vendorSoftwareProductDao.listProcesses(vspId,
-        activeVersion, componentId);
+                             Map<String, ProcessEntity> processArtifact) {
+    Collection<ProcessEntity> processList =
+        processDao.list(new ProcessEntity(vspId, version, componentId, null));
     if (!processList.isEmpty()) {
       processes.put(componentName, processList);
       processList.forEach(process -> {
-        ProcessEntity artifact =
-            processDao.get(new ProcessEntity(vspId, activeVersion, componentId, process.getId()));
+        ProcessEntity artifact = processDao
+            .getArtifact(new ProcessEntity(vspId, version, componentId, process.getId()));
         if (artifact.getArtifact() != null) {
           processArtifact.put(process.getId(), artifact);
         }
@@ -229,29 +192,45 @@
     }
   }
 
-  public void retainComponentQuestionnaireData(String vspId, Version activeVersion,
-                          Map<String, String> componentsQustanniare,
-                          Map<String, Map<String, String>>
-                              componentNicsQustanniare,
-                          Map<String, Collection<ComponentMonitoringUploadEntity>> componentMibList,
-                          Map<String, Collection<ProcessEntity>> processes,
-                          Map<String, ProcessEntity> processArtifact) {
+  private void backupNicsQuestionnaire(String vspId, Version version,
+                                       ComponentEntity componentEntity,
+                                       String componentName,
+                                       Map<String, Map<String, String>> componentNicsQustanniare) {
+    Collection<NicEntity>
+        nics = nicDao.list(new NicEntity(vspId, version, componentEntity.getId(), null));
+    if (CollectionUtils.isNotEmpty(nics)) {
+      Map<String, String> nicsQuestionnaire = new HashMap<>();
+      nics.forEach(nicEntity -> {
+        NicEntity nicQuestionnaire = nicDao.getQuestionnaireData(vspId, version,
+            componentEntity.getId(), nicEntity.getId());
+
+        nicsQuestionnaire.put(nicEntity.getNicCompositionData().getName(),
+            nicQuestionnaire.getQuestionnaireData());
+      });
+      componentNicsQustanniare.put(componentName, nicsQuestionnaire);
+    }
+  }
+
+  public void retainComponentQuestionnaireData(String vspId, Version version,
+                                               Map<String, String> componentsQustanniare,
+                                               Map<String, Map<String, String>>
+                                                   componentNicsQustanniare,
+                                               Map<String, Collection<ComponentMonitoringUploadEntity>> componentMibList,
+                                               Map<String, Collection<ProcessEntity>> processes,
+                                               Map<String, ProcessEntity> processArtifact) {
     //VSP processes
-    restoreProcess(vspId, activeVersion, GENERAL_COMPONENT_ID, GENERAL_COMPONENT_ID, processes,
-        processArtifact);
-    Collection<ComponentEntity>
-        components = vendorSoftwareProductDao.listComponents(vspId, activeVersion);
+    restoreProcess(vspId, version, null, null, processes, processArtifact);
+    Collection<ComponentEntity> components =
+        componentDao.list(new ComponentEntity(vspId, version, null));
     components.forEach(componentEntity -> {
       String componentName = componentEntity.getComponentCompositionData().getName();
       if (componentsQustanniare.containsKey(componentName)) {
-        //Restore component questionnaire
-        componentDao.updateQuestionnaireData(vspId, activeVersion,
+        componentDao.updateQuestionnaireData(vspId, version,
             componentEntity.getId(),
             componentsQustanniare.get(componentEntity.getComponentCompositionData()
                 .getName()));
-        //Restore component nic questionnaire
         if (componentNicsQustanniare.containsKey(componentName)) {
-          restoreComponentNicQuestionnaire(vspId, activeVersion, componentName, componentEntity,
+          restoreComponentNicQuestionnaire(vspId, version, componentName, componentEntity,
               componentNicsQustanniare);
         }
         //MIB //todo add for VES_EVENTS
@@ -259,33 +238,30 @@
           restoreComponentMibData(componentName, componentEntity, componentMibList);
         }
         //VFC processes
-        restoreProcess(vspId, activeVersion, componentEntity.getId(), componentName, processes,
+        restoreProcess(vspId, version, componentEntity.getId(), componentName, processes,
             processArtifact);
       }
     });
   }
 
-  private void restoreComponentNicQuestionnaire(String vspId, Version activeVersion,
+  private void restoreComponentNicQuestionnaire(String vspId, Version version,
                                                 String componentName,
                                                 ComponentEntity componentEntity,
-                                                Map<String, Map<String, String>>
-                                                    componentNicsQustanniare) {
+                                                Map<String, Map<String, String>> componentNicsQustanniare) {
     Map<String, String> nicsQustanniare = componentNicsQustanniare.get(componentName);
     Collection<NicEntity> nics =
-        nicDao.list(new NicEntity(vspId, activeVersion, componentEntity.getId(), null));
+        nicDao.list(new NicEntity(vspId, version, componentEntity.getId(), null));
     nics.forEach(nicEntity -> {
       if (nicsQustanniare.containsKey(nicEntity.getNicCompositionData().getName())) {
-        nicDao.updateQuestionnaireData(vspId, activeVersion,
+        nicDao.updateQuestionnaireData(vspId, version,
             componentEntity.getId(), nicEntity.getId(),
             nicsQustanniare.get(nicEntity.getNicCompositionData().getName()));
       }
     });
   }
 
-  private void restoreComponentMibData(String componentName,
-                                       ComponentEntity componentEntity,
-                                       Map<String, Collection<ComponentMonitoringUploadEntity>>
-                                           componentMibList) {
+  private void restoreComponentMibData(String componentName, ComponentEntity componentEntity,
+                                       Map<String, Collection<ComponentMonitoringUploadEntity>> componentMibList) {
     Collection<ComponentMonitoringUploadEntity> mibList = componentMibList.get(componentName);
     mibList.forEach(mib -> {
       mib.setComponentId(componentEntity.getId());
@@ -293,54 +269,58 @@
     });
   }
 
-  private void restoreProcess(String vspId, Version activeVersion, String componentId,
-                                     String componentName,
-                                     Map<String, Collection<ProcessEntity>> processes,
-                                     Map<String, ProcessEntity> processArtifact) {
+  private void restoreProcess(String vspId, Version version, String componentId,
+                              String componentName,
+                              Map<String, Collection<ProcessEntity>> processes,
+                              Map<String, ProcessEntity> processArtifact) {
     if (processes.containsKey(componentName)) {
       Collection<ProcessEntity> processList = processes.get(componentName);
       processList.forEach(process -> {
-        //Reatin VFC process
-        if (!GENERAL_COMPONENT_ID.equals(componentId)
-            && processArtifact.containsKey(process.getId())) {
+        process.setComponentId(componentId);
+        UniqueValueUtil.createUniqueValue(PROCESS_NAME, vspId, version.getId(), componentId,
+            process.getName());
+        processDao.create(process);
+        if (processArtifact.containsKey(process.getId())) {
           ProcessEntity artifact = processArtifact.get(process.getId());
-          artifact.setComponentId(componentId);
-          UniqueValueUtil.createUniqueValue(PROCESS_NAME, vspId, activeVersion.toString(),
-              componentId, process.getName());
-          vendorSoftwareProductDao.createProcess(artifact);
+          processDao.uploadArtifact(artifact);
         }
       });
     }
   }
 
   public void deleteUploadDataAndContent(String vspId, Version version) {
-    //fixme change this when more tables are zusammenized
-    vendorSoftwareProductDao.deleteUploadData(vspId, version);
+    VendorSoftwareProductInfoDaoFactory.getInstance().createInterface()
+        .delete(new VspDetails(vspId, version));
   }
 
-  public void saveUploadData(String vspId, Version activeVersion,
-                                    InputStream uploadedFileData,
-                                    FileContentHandler fileContentMap, HeatStructureTree tree) {
+  public void saveUploadData(VspDetails vspDetails,
+                             OrchestrationTemplateCandidateData candidateData,
+                             InputStream uploadedFileData,
+                             FileContentHandler fileContentMap, HeatStructureTree tree) {
     Map<String, Object> manifestAsMap =
         fileContentMap.containsFile(SdcCommon.MANIFEST_NAME)
             ? (Map<String, Object>) JsonUtil.json2Object(fileContentMap.getFileContent(
             SdcCommon.MANIFEST_NAME), Map.class)
             : new HashMap<>();
 
-    UploadData uploadData = new UploadData();
+    OrchestrationTemplateEntity uploadData = new OrchestrationTemplateEntity();
+    uploadData.setFileSuffix(candidateData.getFileSuffix());
+    uploadData.setFileName(candidateData.getFileName());
     uploadData.setContentData(ByteBuffer.wrap(FileUtils.toByteArray(uploadedFileData)));
     uploadData.setValidationDataStructure(new ValidationStructureList(tree));
     uploadData.setPackageName(Objects.isNull(manifestAsMap.get("name")) ? null :
         (String) manifestAsMap.get("name"));
     uploadData.setPackageVersion(Objects.isNull(manifestAsMap.get("version")) ? null :
         (String) manifestAsMap.get("version"));
-    orchestrationTemplateDataDao.updateOrchestrationTemplateData(vspId, uploadData);
+    orchestrationTemplateDataDao.update(vspDetails.getId(), vspDetails.getVersion(), uploadData);
+
+    VspMergeDaoFactory.getInstance().createInterface()
+        .updateVspModelId(vspDetails.getId(), vspDetails.getVersion());
   }
 
-  public void saveServiceModel(String vspId,
-                                      Version version,
-                                      ToscaServiceModel serviceModelToExtract,
-                                      ToscaServiceModel serviceModelToStore) {
+  public void saveServiceModel(String vspId, Version version,
+                               ToscaServiceModel serviceModelToExtract,
+                               ToscaServiceModel serviceModelToStore) {
     if (serviceModelToExtract != null) {
       serviceModelDao.storeServiceModel(vspId, version, serviceModelToStore);
       //Extracting the compostion data from the output service model of the first phase of
@@ -358,15 +338,14 @@
     return heatTreeManager.getTree();
   }
 
-  public void updateVspComponentDependencies(String vspId, Version activeVersion,
-                                                    Map<String, String>
-                                                        vspComponentIdNameInfoBeforeProcess) {
-    Map<String, String> updatedVspComponentNameIdInfo = getVspComponentNameIdInfo(vspId,
-        activeVersion);
+  public void updateVspComponentDependencies(String vspId, Version version,
+                                             Map<String, String> vspComponentIdNameInfoBeforeProcess) {
+    Map<String, String> updatedVspComponentNameIdInfo = getVspComponentNameIdInfo(vspId, version);
     if (MapUtils.isNotEmpty(updatedVspComponentNameIdInfo)) {
       Set<String> updatedVspComponentNames = updatedVspComponentNameIdInfo.keySet();
       Collection<ComponentDependencyModelEntity> componentDependencies =
-          vendorSoftwareProductDao.listComponentDependencies(vspId, activeVersion);
+          componentDependencyModelDao.list(new ComponentDependencyModelEntity(vspId,
+              version, null));
       if (CollectionUtils.isNotEmpty(componentDependencies)) {
         updateComponentDependency(vspComponentIdNameInfoBeforeProcess, componentDependencies,
             updatedVspComponentNames, updatedVspComponentNameIdInfo);
@@ -374,7 +353,6 @@
     }
   }
 
-
   private void updateComponentDependency(Map<String, String> vspComponentIdNameInfoBeforeProcess,
                                          Collection<ComponentDependencyModelEntity>
                                              componentDependencies,
@@ -398,14 +376,14 @@
     }
   }
 
-  public Map<String, String> getVspComponentIdNameInfo(String vspId, Version activeVersion) {
+  public Map<String, String> getVspComponentIdNameInfo(String vspId, Version version) {
     Collection<ComponentEntity> updatedVspComponents =
-        vendorSoftwareProductDao.listComponents(vspId, activeVersion);
+        componentDao.list(new ComponentEntity(vspId, version, null));
     Map<String, String> vspComponentIdNameMap = new HashMap<>();
     if (CollectionUtils.isNotEmpty(updatedVspComponents)) {
       vspComponentIdNameMap = updatedVspComponents.stream()
           .filter(componentEntity -> componentEntity.getComponentCompositionData() != null)
-          .collect(Collectors.toMap(componentEntity -> componentEntity.getId(),
+          .collect(Collectors.toMap(ComponentEntity::getId,
               componentEntity -> componentEntity.getComponentCompositionData().getName()));
 
     }
@@ -413,15 +391,16 @@
   }
 
   private Map<String, String> getVspComponentNameIdInfo(String vspId,
-                                                              Version activeVersion) {
+                                                        Version version) {
     Collection<ComponentEntity> updatedVspComponents =
-        vendorSoftwareProductDao.listComponents(vspId, activeVersion);
+        componentDao.list(new ComponentEntity(vspId, version, null));
     Map<String, String> vspComponentNameIdMap = new HashMap<>();
     if (CollectionUtils.isNotEmpty(updatedVspComponents)) {
       vspComponentNameIdMap = updatedVspComponents.stream()
           .filter(componentEntity -> componentEntity.getComponentCompositionData() != null)
-          .collect(Collectors.toMap(componentEntity -> componentEntity
-            .getComponentCompositionData().getName(), componentEntity -> componentEntity.getId()));
+          .collect(Collectors
+              .toMap(componentEntity -> componentEntity.getComponentCompositionData().getName(),
+                  ComponentEntity::getId));
     }
     return vspComponentNameIdMap;
   }
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/csar/CSARConstants.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/csar/CSARConstants.java
index 0d204ef..cf04aad 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/csar/CSARConstants.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/csar/CSARConstants.java
@@ -1,6 +1,7 @@
 package org.openecomp.sdc.vendorsoftwareproduct.impl.orchestration.csar;
 
 import com.google.common.collect.ImmutableSet;
+
 import static com.google.common.collect.ImmutableSet.of;
 public class CSARConstants {
 
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/csar/OnboardingManifest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/csar/OnboardingManifest.java
index d88d883..c0da130 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/csar/OnboardingManifest.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/csar/OnboardingManifest.java
@@ -7,12 +7,22 @@
 import org.openecomp.sdc.logging.api.Logger;
 import org.openecomp.sdc.logging.api.LoggerFactory;
 
-import java.io.*;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
 import java.nio.charset.StandardCharsets;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 import static org.openecomp.core.validation.errors.ErrorMessagesFormatBuilder.getErrorWithParameters;
-import static org.openecomp.sdc.vendorsoftwareproduct.impl.orchestration.csar.CSARConstants.*;
+import static org.openecomp.sdc.vendorsoftwareproduct.impl.orchestration.csar.CSARConstants.METADATA_MF_ATTRIBUTE;
+import static org.openecomp.sdc.vendorsoftwareproduct.impl.orchestration.csar.CSARConstants.SEPERATOR_MF_ATTRIBUTE;
+import static org.openecomp.sdc.vendorsoftwareproduct.impl.orchestration.csar.CSARConstants.SOURCE_MF_ATTRIBUTE;
 
 public class OnboardingManifest {
     private static final Logger logger = LoggerFactory.getLogger(OnboardingManifest.class);
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/process/OrchestrationProcessFactory.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/process/OrchestrationProcessFactory.java
index 516d85c..6200b28 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/process/OrchestrationProcessFactory.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/process/OrchestrationProcessFactory.java
@@ -27,13 +27,13 @@
 
   }
 
-  public static Optional<OrchestrationTemplateProcessHandler> getInstance(String filePrefix) {
-    if (filePrefix == null) {
+  public static Optional<OrchestrationTemplateProcessHandler> getInstance(String fileSuffix) {
+    if (fileSuffix == null) {
       return Optional.empty();
     }
 
-    filePrefix = filePrefix.toLowerCase().trim();
-    OnboardingTypesEnum onboardingTypesEnum = OnboardingTypesEnum.getOnboardingTypesEnum(filePrefix);
+    fileSuffix = fileSuffix.toLowerCase().trim();
+    OnboardingTypesEnum onboardingTypesEnum = OnboardingTypesEnum.getOnboardingTypesEnum(fileSuffix);
     if (onboardingTypesEnum == null) {
       return Optional.empty();
     }
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/process/OrchestrationTemplateProcessCsarHandler.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/process/OrchestrationTemplateProcessCsarHandler.java
index d217c31..b0e1e17 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/process/OrchestrationTemplateProcessCsarHandler.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/process/OrchestrationTemplateProcessCsarHandler.java
@@ -1,7 +1,6 @@
 package org.openecomp.sdc.vendorsoftwareproduct.impl.orchestration.process;
 
 import org.apache.commons.collections4.MapUtils;
-import org.openecomp.core.converter.ToscaConverter;
 import org.openecomp.core.impl.ToscaConverterImpl;
 import org.openecomp.core.utilities.file.FileContentHandler;
 import org.openecomp.core.utilities.orchestration.OnboardingTypesEnum;
@@ -26,7 +25,6 @@
 import org.openecomp.sdc.vendorsoftwareproduct.services.filedatastructuremodule.CandidateService;
 import org.openecomp.sdc.vendorsoftwareproduct.types.OrchestrationTemplateActionResponse;
 import org.openecomp.sdc.vendorsoftwareproduct.types.UploadFileResponse;
-import org.openecomp.sdc.versioning.dao.types.Version;
 
 import java.io.ByteArrayInputStream;
 import java.io.IOException;
@@ -37,35 +35,35 @@
 import java.util.Map;
 import java.util.Optional;
 
-public class OrchestrationTemplateProcessCsarHandler implements OrchestrationTemplateProcessHandler {
-
-  private static final Logger logger = LoggerFactory.getLogger(OrchestrationTemplateProcessCsarHandler.class);
-  private CandidateService candidateService = CandidateServiceFactory.getInstance().createInterface();
+public class OrchestrationTemplateProcessCsarHandler
+    implements OrchestrationTemplateProcessHandler {
+  private static final Logger LOGGER =
+      LoggerFactory.getLogger(OrchestrationTemplateProcessCsarHandler.class);
+  private CandidateService candidateService =
+      CandidateServiceFactory.getInstance().createInterface();
   ToscaTreeManager toscaTreeManager = new ToscaTreeManager();
 
   @Override
   public OrchestrationTemplateActionResponse process(VspDetails vspDetails,
-                                                     OrchestrationTemplateCandidateData candidateData,
-                                                     String user) {
-    String vspId = vspDetails.getId();
-    Version version = vspDetails.getVersion();
-    logger.audit(AuditMessages.AUDIT_MSG + AuditMessages.CSAR_VALIDATION_STARTED + vspId);
-    OrchestrationTemplateActionResponse response = new OrchestrationTemplateActionResponse();
-    UploadFileResponse uploadFileResponse = new UploadFileResponse();
-    Optional<FileContentHandler> fileContent =
-        OrchestrationUtil
-            .getFileContentMap(
-                OnboardingTypesEnum.CSAR, uploadFileResponse, candidateData.getContentData().array());
+                                                     OrchestrationTemplateCandidateData candidateData) {
+    LOGGER.audit(
+        AuditMessages.AUDIT_MSG + AuditMessages.CSAR_VALIDATION_STARTED + vspDetails.getId());
 
-    if(fileContent.isPresent()){
+    UploadFileResponse uploadFileResponse = new UploadFileResponse();
+    Optional<FileContentHandler> fileContent = OrchestrationUtil
+        .getFileContentMap(OnboardingTypesEnum.CSAR, uploadFileResponse,
+            candidateData.getContentData().array());
+
+    OrchestrationTemplateActionResponse response = new OrchestrationTemplateActionResponse();
+    if (fileContent.isPresent()) {
       try {
         FileContentHandler fileContentHandler = fileContent.get();
-        processCsar(vspId, version, fileContentHandler, candidateData, response);
-      } catch (CoreException e){
-        logger.error(e.getMessage());
+        processCsar(vspDetails, fileContentHandler, candidateData, response);
+      } catch (CoreException e) {
+        LOGGER.error(e.getMessage());
         response.addErrorMessageToMap(e.code().id(), e.code().message(),ErrorLevel.ERROR);
       } catch (IOException ioe) {
-        logger.error(ioe.getMessage());
+        LOGGER.error(ioe.getMessage());
         ErrorCode errorCode = new GeneralErrorBuilder(ioe.getMessage()).build();
         response.addErrorMessageToMap(errorCode.id(), errorCode.message(),ErrorLevel.ERROR);
       }
@@ -77,13 +75,13 @@
     return response;
   }
 
-  private void processCsar(String vspId, Version version,
+  private void processCsar(VspDetails vspDetails,
                            FileContentHandler fileContentHandler,
                            OrchestrationTemplateCandidateData candidateData,
                            OrchestrationTemplateActionResponse response) throws IOException {
     response.setFileNames(new ArrayList<>(fileContentHandler.getFileList()));
-    Map<String, List<ErrorMessage>> errors = validateCsar(fileContentHandler, response);
-    if(!isValid(errors)){
+    Map<String, List<ErrorMessage>> errors = validateCsar(fileContentHandler);
+    if (!isValid(errors)) {
       return;
     }
 
@@ -95,32 +93,31 @@
     Map<String, Collection<ProcessEntity>> processes = new HashMap<>();
     Map<String, ProcessEntity> processArtifact = new HashMap<>();
     OrchestrationUtil orchestrationUtil = new OrchestrationUtil();
-    orchestrationUtil.backupComponentsQuestionnaireBeforeDelete(vspId,
-        version, componentsQuestionnaire,
+    orchestrationUtil.backupComponentsQuestionnaireBeforeDelete(vspDetails.getId(),
+        vspDetails.getVersion(), componentsQuestionnaire,
         componentNicsQuestionnaire, componentMibList, processes, processArtifact);
 
     Optional<ByteArrayInputStream> zipByteArrayInputStream = candidateService
-        .fetchZipFileByteArrayInputStream(vspId, candidateData, null, OnboardingTypesEnum.CSAR, errors);
+        .fetchZipFileByteArrayInputStream(vspDetails.getId(), candidateData, null,
+            OnboardingTypesEnum.CSAR, errors);
 
-    orchestrationUtil.deleteUploadDataAndContent(vspId, version);
-    orchestrationUtil.saveUploadData(
-        vspId, version, zipByteArrayInputStream.get(), fileContentHandler, tree);
+    orchestrationUtil.deleteUploadDataAndContent(vspDetails.getId(), vspDetails.getVersion());
+    orchestrationUtil.saveUploadData(vspDetails, candidateData, zipByteArrayInputStream.get(),
+            fileContentHandler, tree);
 
     ToscaServiceModel toscaServiceModel = new ToscaConverterImpl().convert(fileContentHandler);
-    orchestrationUtil.saveServiceModel(vspId, version, toscaServiceModel, toscaServiceModel);
+    orchestrationUtil.saveServiceModel(vspDetails.getId(), vspDetails.getVersion(), toscaServiceModel,
+        toscaServiceModel);
 
   }
 
-  private void addFiles(FileContentHandler fileContentHandler){
-    for(Map.Entry<String, byte[]> fileEntry : fileContentHandler.getFiles().entrySet()){
+  private void addFiles(FileContentHandler fileContentHandler) {
+    for (Map.Entry<String, byte[]> fileEntry : fileContentHandler.getFiles().entrySet()) {
       toscaTreeManager.addFile(fileEntry.getKey(), fileEntry.getValue());
     }
   }
 
-  private Map<String, List<ErrorMessage>> validateCsar(FileContentHandler fileContentHandler,
-                                         OrchestrationTemplateActionResponse response){
-
-
+  private Map<String, List<ErrorMessage>> validateCsar(FileContentHandler fileContentHandler) {
     Map<String, List<ErrorMessage>> errors = new HashMap<>();
     addFiles(fileContentHandler);
     toscaTreeManager.createTree();
@@ -129,7 +126,7 @@
     return errors;
   }
 
-  private boolean isValid(Map<String, List<ErrorMessage>> errors){
+  private boolean isValid(Map<String, List<ErrorMessage>> errors) {
     return MapUtils.isEmpty(MessageContainerUtil.getMessageByLevel(ErrorLevel.ERROR, errors));
   }
 }
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/process/OrchestrationTemplateProcessHandler.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/process/OrchestrationTemplateProcessHandler.java
index 8b513b4..1db48a5 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/process/OrchestrationTemplateProcessHandler.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/process/OrchestrationTemplateProcessHandler.java
@@ -6,7 +6,7 @@
 import org.openecomp.sdc.vendorsoftwareproduct.types.OrchestrationTemplateActionResponse;
 
 public interface OrchestrationTemplateProcessHandler {
+
   OrchestrationTemplateActionResponse process(VspDetails vspDetails,
-                                              OrchestrationTemplateCandidateData candidateData,
-                                              String user);
+                                              OrchestrationTemplateCandidateData candidateData);
 }
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/process/OrchestrationTemplateProcessZipHandler.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/process/OrchestrationTemplateProcessZipHandler.java
index 85ac262..da5cb01 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/process/OrchestrationTemplateProcessZipHandler.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/process/OrchestrationTemplateProcessZipHandler.java
@@ -1,19 +1,12 @@
 package org.openecomp.sdc.vendorsoftwareproduct.impl.orchestration.process;
 
-import static org.openecomp.sdc.logging.messages.AuditMessages.HEAT_VALIDATION_ERROR;
-
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.collections4.MapUtils;
-import org.openecomp.core.model.dao.ServiceModelDao;
-import org.openecomp.core.model.dao.ServiceModelDaoFactory;
 import org.openecomp.core.translator.datatypes.TranslatorOutput;
 import org.openecomp.core.utilities.file.FileContentHandler;
 import org.openecomp.core.utilities.json.JsonUtil;
 import org.openecomp.core.utilities.orchestration.OnboardingTypesEnum;
 import org.openecomp.core.validation.util.MessageContainerUtil;
-import org.openecomp.sdc.activityLog.ActivityLogManager;
-import org.openecomp.sdc.activityLog.ActivityLogManagerFactory;
-import org.openecomp.sdc.activitylog.dao.type.ActivityLogEntity;
 import org.openecomp.sdc.common.errors.Messages;
 import org.openecomp.sdc.common.utils.SdcCommon;
 import org.openecomp.sdc.datatypes.error.ErrorLevel;
@@ -31,18 +24,13 @@
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
 import org.openecomp.sdc.vendorsoftwareproduct.factory.CandidateServiceFactory;
-import org.openecomp.sdc.vendorsoftwareproduct.factory.CompositionDataExtractorFactory;
-import org.openecomp.sdc.vendorsoftwareproduct.factory.CompositionEntityDataManagerFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.impl.orchestration.OrchestrationUtil;
-import org.openecomp.sdc.vendorsoftwareproduct.services.composition.CompositionDataExtractor;
-import org.openecomp.sdc.vendorsoftwareproduct.services.composition.CompositionEntityDataManager;
 import org.openecomp.sdc.vendorsoftwareproduct.services.filedatastructuremodule.CandidateService;
 import org.openecomp.sdc.vendorsoftwareproduct.types.OrchestrationTemplateActionResponse;
 import org.openecomp.sdc.vendorsoftwareproduct.types.UploadFileResponse;
 import org.openecomp.sdc.vendorsoftwareproduct.types.candidateheat.FilesDataStructure;
 import org.openecomp.sdc.vendorsoftwareproduct.utils.VendorSoftwareProductUtils;
 import org.openecomp.sdc.versioning.dao.types.Version;
-import org.openecomp.sdcrests.activitylog.types.ActivityType;
 
 import java.io.ByteArrayInputStream;
 import java.util.Collection;
@@ -51,41 +39,29 @@
 import java.util.Map;
 import java.util.Optional;
 
+import static org.openecomp.sdc.logging.messages.AuditMessages.HEAT_VALIDATION_ERROR;
+
 public class OrchestrationTemplateProcessZipHandler implements OrchestrationTemplateProcessHandler {
-  Logger logger = LoggerFactory.getLogger(OrchestrationTemplateProcessZipHandler.class);
+  private Logger logger = LoggerFactory.getLogger(OrchestrationTemplateProcessZipHandler.class);
   private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage();
   private CandidateService candidateService =
       CandidateServiceFactory.getInstance().createInterface();
-  private ServiceModelDao serviceModelDao = ServiceModelDaoFactory.getInstance().createInterface();
-  private CompositionEntityDataManager compositionEntityDataManager =
-      CompositionEntityDataManagerFactory.getInstance().createInterface();
-  private CompositionDataExtractor compositionDataExtractor =
-      CompositionDataExtractorFactory.getInstance().createInterface();
-  private ActivityLogManager activityLogManager =
-      ActivityLogManagerFactory.getInstance().createInterface();
 
-
-  public OrchestrationTemplateProcessZipHandler(){}
-
+  @Override
   public OrchestrationTemplateActionResponse process(VspDetails vspDetails,
-                                                     OrchestrationTemplateCandidateData
-                                                         candidateData,
-                                                     String user) {
+                                                     OrchestrationTemplateCandidateData candidateData) {
     String vspId = vspDetails.getId();
     Version version = vspDetails.getVersion();
-    logger.audit(AuditMessages.AUDIT_MSG + AuditMessages.HEAT_VALIDATION_STARTED
-        + vspId);
+    logger.audit(AuditMessages.AUDIT_MSG + AuditMessages.HEAT_VALIDATION_STARTED + vspId);
     OrchestrationTemplateActionResponse response = new OrchestrationTemplateActionResponse();
     UploadFileResponse uploadFileResponse = new UploadFileResponse();
-    Optional<FileContentHandler> fileContent =
-        OrchestrationUtil
-            .getFileContentMap(
-                OnboardingTypesEnum.ZIP, uploadFileResponse,
-                candidateData.getContentData().array());
+    Optional<FileContentHandler> fileContent = OrchestrationUtil
+        .getFileContentMap(OnboardingTypesEnum.ZIP, uploadFileResponse,
+            candidateData.getContentData().array());
     if (!fileContent.isPresent()) {
       response.addStructureErrors(uploadFileResponse.getErrors());
       mdcDataDebugMessage.debugExitMessage("VSP id", vspId);
-      response.getErrors().values().forEach(errorList -> printAuditForErrors(errorList,vspId,
+      response.getErrors().values().forEach(errorList -> printAuditForErrors(errorList, vspId,
           HEAT_VALIDATION_ERROR));
       return response;
     }
@@ -100,7 +76,7 @@
           Messages.FOUND_UNASSIGNED_FILES.getErrorMessage(), ErrorLevel.ERROR);
 
       mdcDataDebugMessage.debugExitMessage("VSP id", vspId);
-      response.getErrors().values().forEach(errorList -> printAuditForErrors(errorList,vspId,
+      response.getErrors().values().forEach(errorList -> printAuditForErrors(errorList, vspId,
           HEAT_VALIDATION_ERROR));
       return response;
     }
@@ -113,8 +89,8 @@
         .fetchZipFileByteArrayInputStream(
             vspId, candidateData, manifest, OnboardingTypesEnum.ZIP, uploadErrors);
     if (!zipByteArrayInputStream.isPresent()) {
-      response.getErrors().values().forEach(errorList -> printAuditForErrors(errorList,vspId,
-          HEAT_VALIDATION_ERROR));
+      response.getErrors().values()
+          .forEach(errorList -> printAuditForErrors(errorList, vspId, HEAT_VALIDATION_ERROR));
       return response;
     }
 
@@ -129,18 +105,19 @@
     OrchestrationUtil orchestrationUtil = new OrchestrationUtil();
     Map<String, String> vspComponentIdNameInfoBeforeProcess =
         orchestrationUtil.getVspComponentIdNameInfo(vspId, version);
-    orchestrationUtil.backupComponentsQuestionnaireBeforeDelete(vspId,
-        version, componentsQuestionnaire,
-        componentNicsQuestionnaire, componentMibList, processes, processArtifact);
+    orchestrationUtil
+        .backupComponentsQuestionnaireBeforeDelete(vspId, version, componentsQuestionnaire,
+            componentNicsQuestionnaire, componentMibList, processes, processArtifact);
 
     orchestrationUtil.deleteUploadDataAndContent(vspId, version);
-    orchestrationUtil.saveUploadData(vspId, version, zipByteArrayInputStream.get(), fileContentMap,
-        tree);
+    orchestrationUtil
+        .saveUploadData(vspDetails, candidateData, zipByteArrayInputStream.get(), fileContentMap,
+            tree);
 
-    response.getErrors().values().forEach(errorList -> printAuditForErrors(errorList,vspId,
+    response.getErrors().values().forEach(errorList -> printAuditForErrors(errorList, vspId,
         HEAT_VALIDATION_ERROR));
-    if ( MapUtils.isEmpty(MessageContainerUtil.getMessageByLevel(ErrorLevel.ERROR,
-        response.getErrors()))) {
+    if (MapUtils
+        .isEmpty(MessageContainerUtil.getMessageByLevel(ErrorLevel.ERROR, response.getErrors()))) {
       logger.audit(AuditMessages.AUDIT_MSG + AuditMessages.HEAT_VALIDATION_COMPLETED + vspId);
     }
 
@@ -150,20 +127,17 @@
         HeatToToscaUtil.loadAndTranslateTemplateData(fileContentMap);
 
     ToscaServiceModel toscaServiceModel = translatorOutput.getToscaServiceModel();
-    orchestrationUtil.saveServiceModel(vspId, version, translatorOutput
-        .getNonUnifiedToscaServiceModel(), toscaServiceModel);
+    orchestrationUtil
+        .saveServiceModel(vspId, version, translatorOutput.getNonUnifiedToscaServiceModel(),
+            toscaServiceModel);
     orchestrationUtil.retainComponentQuestionnaireData(vspId, version, componentsQuestionnaire,
         componentNicsQuestionnaire, componentMibList, processes, processArtifact);
     orchestrationUtil.updateVspComponentDependencies(vspId, version,
         vspComponentIdNameInfoBeforeProcess);
+
     logger.audit(AuditMessages.AUDIT_MSG + AuditMessages.HEAT_TRANSLATION_COMPLETED + vspId);
     uploadFileResponse.addStructureErrors(uploadErrors);
 
-    ActivityLogEntity activityLogEntity =
-        new ActivityLogEntity(vspId, String.valueOf(version.getMajor() + 1),
-            ActivityType.UPLOAD_HEAT.toString(), user, true, "", "");
-    activityLogManager.addActionLog(activityLogEntity, user);
-
     mdcDataDebugMessage.debugExitMessage("VSP id", vspId);
     return response;
   }
@@ -182,8 +156,8 @@
 
     errorList.forEach(errorMessage -> {
       if (errorMessage.getLevel().equals(ErrorLevel.ERROR)) {
-        logger.audit(AuditMessages.AUDIT_MSG + String.format(auditType, errorMessage.getMessage(),
-            vspId));
+        logger.audit(
+            AuditMessages.AUDIT_MSG + String.format(auditType, errorMessage.getMessage(), vspId));
       }
     });
   }
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/GetFileDataStructureResponseDTO.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/GetFileDataStructureResponseDTO.java
deleted file mode 100644
index c309782..0000000
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/GetFileDataStructureResponseDTO.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * 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=========================================================
- */
-
-package org.openecomp.sdc.vendorsoftwareproduct.types;
-
-import org.openecomp.sdc.vendorsoftwareproduct.types.candidateheat.Module;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @author Avrahamg
- * @since November 07, 2016
- */
-public class GetFileDataStructureResponseDTO {
-    private List<Module> modules = new ArrayList<>();
-    private List<String> unassigned = new ArrayList<>();
-    private List<String> artifacts = new ArrayList<>();
-    private List<String> nested = new ArrayList<>();
-
-    public List<Module> getModules() {
-        return modules;
-    }
-
-    public void setModules(List<Module> modules) {
-        this.modules = modules;
-    }
-
-    public List<String> getUnassigned() {
-        return unassigned;
-    }
-
-    public void setUnassigned(List<String> unassigned) {
-        this.unassigned = unassigned;
-    }
-
-    public List<String> getArtifacts() {
-        return artifacts;
-    }
-
-    public void setArtifacts(List<String> artifacts) {
-        this.artifacts = artifacts;
-    }
-
-    public List<String> getNested() {
-        return nested;
-    }
-
-    public void setNested(List<String> nested) {
-        this.nested = nested;
-    }
-}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/ComputeTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/ComputeTest.java
index ab7a70b..3df06ba 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/ComputeTest.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/ComputeTest.java
@@ -1,33 +1,5 @@
 package org.openecomp.sdc.vendorsoftwareproduct;
 
-import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes.ADD_COMPUTE_NOT_ALLOWED_IN_HEAT_ONBOARDING;
-import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes.DUPLICATE_COMPUTE_NAME_NOT_ALLOWED;
-
-import org.openecomp.core.utilities.CommonMethods;
-import org.openecomp.sdc.common.errors.CoreException;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDaoFactory;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComputeEntity;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.DeploymentFlavorEntity;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
-import org.openecomp.sdc.vendorsoftwareproduct.impl.VendorSoftwareProductManagerImpl;
-import org.openecomp.sdc.vendorsoftwareproduct.types.CompositionEntityResponse;
-import org.openecomp.sdc.vendorsoftwareproduct.types.ListComputeResponse;
-import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentComputeAssociation;
-import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentData;
-import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComputeData;
-import org.openecomp.sdc.vendorsoftwareproduct.types.composition.DeploymentFlavor;
-import org.openecomp.sdc.versioning.dao.types.Version;
-import org.openecomp.sdc.versioning.errors.VersioningErrorCodes;
-import org.testng.Assert;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
 public class ComputeTest {
 
   /*private static final String USER1 = "componentsTestUser1";
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/DeploymentFlavorTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/DeploymentFlavorTest.java
index 45ba4fb..77c8111 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/DeploymentFlavorTest.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/DeploymentFlavorTest.java
@@ -1,33 +1,5 @@
 package org.openecomp.sdc.vendorsoftwareproduct;
 
-import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes.CREATE_DEPLOYMENT_FLAVOR_NOT_ALLOWED_IN_HEAT_ONBOARDING;
-import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes.DUPLICATE_DEPLOYMENT_FLAVOR_MODEL_NOT_ALLOWED;
-import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes.FEATURE_GROUP_NOT_EXIST_FOR_VSP;
-import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes.INVALID_COMPONENT_COMPUTE_ASSOCIATION;
-import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes.INVALID_COMPUTE_FLAVOR_ID;
-import static org.openecomp.sdc.versioning.errors.VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST;
-import static org.openecomp.sdc.versioning.errors.VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND;
-
-import org.openecomp.core.utilities.CommonMethods;
-import org.openecomp.sdc.common.errors.CoreException;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDaoFactory;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.DeploymentFlavorEntity;
-import org.openecomp.sdc.vendorsoftwareproduct.impl.VendorSoftwareProductManagerImpl;
-
-import org.openecomp.sdc.vendorsoftwareproduct.types.CompositionEntityResponse;
-import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentComputeAssociation;
-import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityValidationData;
-import org.openecomp.sdc.vendorsoftwareproduct.types.composition.DeploymentFlavor;
-import org.openecomp.sdc.versioning.dao.types.Version;
-import org.testng.Assert;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
 public class DeploymentFlavorTest {
   /*private static final String USER1 = "deploymentTestUser1";
   private static final String USER2 = "deploymentTestUser2";
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/ImagesTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/ImagesTest.java
index 5dcb7f9..d78f404 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/ImagesTest.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/ImagesTest.java
@@ -21,50 +21,48 @@
 
 public class ImagesTest {
 
-    private static String VSP_ID = "VSP_ID";
-    private static String COMP_ID = "COMP_ID";
-    private static String ID = "ID";
-    private static String USER = "USER";
-    public static final Version VERSION01 = new Version(0, 1);
+  private static String VSP_ID = "VSP_ID";
+  private static String COMP_ID = "COMP_ID";
+  private static String ID = "ID";
+  public static final Version VERSION01 = new Version("version_id");
 
-    @Mock
-    private VendorSoftwareProductInfoDao vendorSoftwareProductInfoDao;
+  @Mock
+  private VendorSoftwareProductInfoDao vendorSoftwareProductInfoDao;
 
-    @Mock
-    private CompositionEntityDataManager compositionEntityDataManager;
+  @Mock
+  private CompositionEntityDataManager compositionEntityDataManager;
 
-    @InjectMocks
-    @Spy
-    private ImageManagerImpl imageManager;
+  @InjectMocks
+  @Spy
+  private ImageManagerImpl imageManager;
 
-    @BeforeMethod
-    public void setUp() throws Exception {
-        MockitoAnnotations.initMocks(this);
+  @BeforeMethod
+  public void setUp() throws Exception {
+    MockitoAnnotations.initMocks(this);
+  }
+
+  @Test
+  public void createImage() {
+    ImageEntity imageEntity = new ImageEntity(VSP_ID, VERSION01, COMP_ID, ID);
+    doReturn(true).when(vendorSoftwareProductInfoDao).isManual(anyObject(), anyObject());
+
+    imageManager.createImage(imageEntity);
+    verify(compositionEntityDataManager).createImage(imageEntity);
+  }
+
+  @Test
+  public void createImageHeat() {
+    ImageEntity imageEntity = new ImageEntity(VSP_ID, VERSION01, COMP_ID, ID);
+    doReturn(false).when(vendorSoftwareProductInfoDao).isManual(anyObject(), anyObject());
+
+    try {
+      imageManager.createImage(imageEntity);
+      Assert.fail();
+    } catch (CoreException exception) {
+      Assert.assertEquals(exception.code().id(),
+          VendorSoftwareProductErrorCodes.ADD_IMAGE_NOT_ALLOWED_IN_HEAT_ONBOARDING);
     }
-
-    @Test
-    public void createImage()
-    {
-        ImageEntity imageEntity = new ImageEntity(VSP_ID, VERSION01, COMP_ID, ID);
-        doReturn(true).when(vendorSoftwareProductInfoDao).isManual(anyObject(), anyObject());
-
-        imageManager.createImage(imageEntity, USER);
-        verify(compositionEntityDataManager).createImage(imageEntity);
-    }
-
-    @Test
-    public void createImageHeat()
-    {
-        ImageEntity imageEntity = new ImageEntity(VSP_ID, VERSION01, COMP_ID, ID);
-        doReturn(false).when(vendorSoftwareProductInfoDao).isManual(anyObject(), anyObject());
-
-        try {
-            imageManager.createImage(imageEntity, USER);
-            Assert.fail();
-        } catch (CoreException exception) {
-            Assert.assertEquals(exception.code().id(), VendorSoftwareProductErrorCodes.ADD_IMAGE_NOT_ALLOWED_IN_HEAT_ONBOARDING);
-        }
-    }
+  }
   /*private static final String USER1 = "imageTestUser1";
   private static final String USER2 = "imageTestUser2";
   private static final Version VERSION01 = new Version(0, 1);
@@ -93,40 +91,40 @@
         vsp1 = vendorSoftwareProductManager.createNewVsp(VSPCommon
         .createVspDetails(null, null, "VSP_" + CommonMethods.nextUuId(), "Test-vsp1", "vendorName",
             "vlm1Id", "icon", "category", "subCategory", "123", null,
-            VSPCommon.OnboardingMethod.Manual.name()), USER1
+            VSPCommon.OnboardingMethod.Manual.name())1
         );
     vsp1Id = vsp1.getId();
 
     VspDetails vsp2 = vendorSoftwareProductManager.createNewVsp(VSPCommon
         .createVspDetails(null, null, "VSP_" + CommonMethods.nextUuId(), "Test-vsp2", "vendorName",
             "vlm1Id", "icon", "category", "subCategory", "123", null, VSPCommon.OnboardingMethod.
-                Manual.name()), USER1);
+                Manual.name())1);
     vsp2Id = vsp2.getId();
 
     VspDetails vsp3 = vendorSoftwareProductManager.createNewVsp(VSPCommon
         .createVspDetails(null, null, "VSP_" + CommonMethods.nextUuId(), "Test-vsp3",
             "vendorName",
             "vlm1Id", "icon", "category", "subCategory", "123", null, VSPCommon
-                .OnboardingMethod.HEAT.name()), USER1);
+                .OnboardingMethod.HEAT.name())1);
     vsp3Id = vsp3.getId();
 
     ComponentEntity comp = new ComponentEntity();
     comp.setVspId(vsp2Id);
     comp.setCompositionData(comp1);
-    ComponentEntity createdComp = vendorSoftwareProductManager.createComponent(comp, USER1);
+    ComponentEntity createdComp = vendorSoftwareProductManager.createComponent(comp1);
     comp1Id = createdComp.getId();
   }
 
   @Test
   public void testListImagesNonExistingVspId_negative() {
-    testList_negative("non existing vsp id", null, image1Id, USER1,
+    testList_negative("non existing vsp id", null, image1Id1,
         VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST,
         "Versionable entity VendorSoftwareProduct with id non existing vsp id does not exist." );
   }
 
   @Test
   public void testListImagesNonExistingVfcId_negative() {
-    testList_negative(vsp1Id, VERSION01, "444", USER1,
+    testList_negative(vsp1Id, VERSION01, "444"1,
         VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND,
         "Vendor Software Product Component with Id 444 does not exist for Vendor Software Product "
             + "with id "+vsp1Id+ " and version "+VERSION01);
@@ -137,20 +135,20 @@
     createImageEntity("media-vsrx-vmdisk-15.1X49-D40.6.aki", "aki");
     createImageEntity("riverbed-15.1X49-D40.6.vdi", "vdi");
     final Collection<ImageEntity> imageEntities =
-        vendorSoftwareProductManager.listImages(vsp2Id, VERSION01, comp1Id, USER1);
+        vendorSoftwareProductManager.listImages(vsp2Id, VERSION01, comp1Id1);
     System.out.println("size::"+imageEntities.size());
   }
 
   @Test
   public void testCreateNonExistingVspId_negative() {
-    testCreate_negative(new ImageEntity("non existing vsp id", null, null, null), USER1,
+    testCreate_negative(new ImageEntity("non existing vsp id", null, null, null)1,
         VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST,
         "Versionable entity VendorSoftwareProduct with id non existing vsp id does not exist.");
   }
 
   @Test
   public void testCreateNonExistingVfcId_negative() {
-    testCreate_negative(new ImageEntity(vsp1Id, VERSION01, "222", null), USER1,
+    testCreate_negative(new ImageEntity(vsp1Id, VERSION01, "222", null)1,
         VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND,
         "Vendor Software Product Component with Id 222 does not exist for Vendor Software Product "
             + "with id "+vsp1Id + " and version "+VERSION01);
@@ -158,8 +156,8 @@
 
   @Test(dependsOnMethods = "testUpdateNonExistingImageId_negative")
   public void testCreateOnAvailableVsp_negative() {
-    vendorSoftwareProductManager.checkin(vsp1Id, USER1);
-    testCreate_negative(new ImageEntity(vsp1Id, null, null, null), USER1,
+    vendorSoftwareProductManager.checkin(vsp1Id1);
+    testCreate_negative(new ImageEntity(vsp1Id, null, null, null)1,
         VersioningErrorCodes.EDIT_ON_UNLOCKED_ENTITY,
         "Can not edit versionable entity VendorSoftwareProduct with id "+vsp1Id+ " since it is not"
             + " checked out.");
@@ -167,8 +165,8 @@
 
   @Test(dependsOnMethods = "testCreateOnAvailableVsp_negative")
   public void testCreateOnVspOtherUser_negative() {
-    vendorSoftwareProductManager.checkout(vsp1Id, USER1);
-    testCreate_negative(new ImageEntity(vsp1Id, null, null, null), USER2,
+    vendorSoftwareProductManager.checkout(vsp1Id1);
+    testCreate_negative(new ImageEntity(vsp1Id, null, null, null)2,
         VersioningErrorCodes.EDIT_ON_ENTITY_LOCKED_BY_OTHER_USER,
         "Versionable entity VendorSoftwareProduct with id " +vsp1Id+
             " can not be edited since it is locked by other user "+ USER1+ ".");
@@ -180,11 +178,11 @@
     ComponentEntity comp = new ComponentEntity();
     comp.setVspId(vsp1Id);
     comp.setCompositionData(comp1);
-    ComponentEntity createdComp = vendorSoftwareProductManager.createComponent(comp, USER1);
+    ComponentEntity createdComp = vendorSoftwareProductManager.createComponent(comp1);
     String compId = createdComp.getId();
 
-    vendorSoftwareProductManager.checkin(vsp1Id, USER1);
-    vendorSoftwareProductManager.checkout(vsp1Id, USER1);
+    vendorSoftwareProductManager.checkin(vsp1Id1);
+    vendorSoftwareProductManager.checkout(vsp1Id1);
 
     for(int i = 1; i<=3; i++) {
       ImageEntity imageEntity = new ImageEntity();
@@ -197,17 +195,17 @@
       //image.setFormat("aki");
       //image.setMd5("233343DDDD");
       imageEntity.setImageCompositionData(image);
-      ImageEntity createdImage = vendorSoftwareProductManager.createImage(imageEntity, USER1);
+      ImageEntity createdImage = vendorSoftwareProductManager.createImage(imageEntity1);
     }
 
     Collection<ImageEntity> imageEntities =
-        vendorSoftwareProductManager.listImages(vsp1Id, null, compId, USER1);
+        vendorSoftwareProductManager.listImages(vsp1Id, null, compId1);
 
     Assert.assertEquals(imageEntities.size(), 3);
 
-    vendorSoftwareProductManager.undoCheckout(vsp1Id, USER1);
+    vendorSoftwareProductManager.undoCheckout(vsp1Id1);
 
-    imageEntities = vendorSoftwareProductManager.listImages(vsp1Id, null, compId, USER1);
+    imageEntities = vendorSoftwareProductManager.listImages(vsp1Id, null, compId1);
 
     Assert.assertEquals(imageEntities.size(), 0);
   }
@@ -217,7 +215,7 @@
     final ErrorCode addImageNotSupportedHeatOnboardMethodErrorBuilder =
         NotSupportedHeatOnboardMethodErrorBuilder
             .getAddImageNotSupportedHeatOnboardMethodErrorBuilder();
-    testCreate_negative(new ImageEntity(vsp3Id, null, null, null), USER1,
+    testCreate_negative(new ImageEntity(vsp3Id, null, null, null)1,
         addImageNotSupportedHeatOnboardMethodErrorBuilder.id(),
         addImageNotSupportedHeatOnboardMethodErrorBuilder.message()
         );
@@ -252,19 +250,19 @@
   @Test
   public void testGet() {
     ImageEntity createdImage = createImageEntity("read-riverbed-WX-IMG-9.2.0.qcow2", "qcow2");
-    testGet(vsp2Id, VERSION01, comp1Id, createdImage.getId(), USER1, createdImage);
+    testGet(vsp2Id, VERSION01, comp1Id, createdImage.getId()1, createdImage);
   }
 
   @Test
   public void testGetNonExistingVspId_negative() {
-    testGet_negative("non existing vsp id", null, null, image1Id, USER1,
+    testGet_negative("non existing vsp id", null, null, image1Id1,
         VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST,
         "Versionable entity VendorSoftwareProduct with id non existing vsp id does not exist." );
   }
 
   @Test
   public void testGetNonExistingVfcId_negative() {
-    testGet_negative(vsp1Id, VERSION01, "111", null, USER1,
+    testGet_negative(vsp1Id, VERSION01, "111", null1,
         VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND,
         "Vendor Software Product Component with Id 111 does not exist for Vendor Software Product "
             + "with id "+vsp1Id + " and version "+VERSION01);
@@ -274,7 +272,7 @@
   public void testUpdateNonExistingVspId_negative() {
     ImageEntity imageEntity = new ImageEntity("non existing vsp id", null, null, image1Id);
 
-    testUpdate_negative(imageEntity, USER1,
+    testUpdate_negative(imageEntity1,
         VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST,
         "Versionable entity VendorSoftwareProduct with id non existing vsp id does not exist." );
   }
@@ -283,7 +281,7 @@
   public void testUpdateNonExistingVfcId_negative() {
     ImageEntity imageEntity = new ImageEntity(vsp1Id, VERSION01, "111", null);
 
-    testUpdate_negative(imageEntity, USER1,
+    testUpdate_negative(imageEntity1,
         VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND,
         "Vendor Software Product Component with Id 111 does not exist for Vendor Software Product "
             + "with id "+vsp1Id + " and version "+VERSION01);
@@ -293,7 +291,7 @@
   public void testUpdateNonExistingImageId_negative() {
     ImageEntity imageEntity = new ImageEntity(vsp2Id, VERSION01, comp1Id, "222");
 
-    testUpdate_negative(imageEntity, USER1,
+    testUpdate_negative(imageEntity1,
         VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND,
         "Vendor Software Product Component Image with Id 222 does not exist for Vendor " +
             "Software Product with id "+vsp2Id+ " and version "+VERSION01 );
@@ -308,7 +306,7 @@
     //imageCompositionData.setVersion("10.0");
     imageCompositionData.setDescription("updated image");
 
-    vendorSoftwareProductManager.updateImage(imageEntity, USER1);
+    vendorSoftwareProductManager.updateImage(imageEntity1);
 
     testGet(vsp2Id, VERSION01, comp1Id, imageEntity.getId(),USER1, imageEntity );
     image2Id = imageEntity.getId();
@@ -318,7 +316,7 @@
   public void testUpdateNegative_UniqueName() {
     final CompositionEntityResponse<Image> image =
         vendorSoftwareProductManager.getImage(vsp2Id, VERSION01, comp1Id,
-            image2Id, USER1);
+            image2Id1);
     final Image data = image.getData();
 
     final Image imageCompositionData = data;
@@ -326,7 +324,7 @@
 
     ImageEntity entity = new ImageEntity(vsp2Id, VERSION01, comp1Id, image2Id );
     entity.setImageCompositionData(imageCompositionData);
-    testUpdate_negative(entity, USER1, ImageErrorBuilder.getDuplicateImageNameErrorBuilder(
+    testUpdate_negative(entity1, ImageErrorBuilder.getDuplicateImageNameErrorBuilder(
         "riverbed-WX-IMG-9.2.0.qcow2", comp1Id).id()
         ,ImageErrorBuilder.getDuplicateImageNameErrorBuilder("riverbed-WX-IMG-9.2.0.qcow2", comp1Id)
             .message() );
@@ -335,13 +333,13 @@
   @Test(dependsOnMethods = "testUpdateNegative_UniqueName")
   public void testDeleteImage() {
     CompositionEntityResponse<Image> image =
-        vendorSoftwareProductManager.getImage(vsp2Id, VERSION01, comp1Id, image2Id, USER1);
+        vendorSoftwareProductManager.getImage(vsp2Id, VERSION01, comp1Id, image2Id1);
 
     Assert.assertNotNull(image.getData());
 
-    vendorSoftwareProductManager.deleteImage(vsp2Id, comp1Id, image2Id, USER1);
+    vendorSoftwareProductManager.deleteImage(vsp2Id, comp1Id, image2Id1);
 
-    testGet_negative(vsp2Id, VERSION01, comp1Id, image2Id, USER1,
+    testGet_negative(vsp2Id, VERSION01, comp1Id, image2Id1,
         VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND,
         "Vendor Software Product Component Image with Id "+image2Id+ " does not exist for " +
             "Vendor Software Product with id "+vsp2Id+ " and version "+VERSION01 );
@@ -352,7 +350,7 @@
   public void testDeleteNonExistingVspId_negative() {
     ImageEntity imageEntity = new ImageEntity("non existing vsp id", null, null, image1Id);
 
-    testDelete_negative(imageEntity, USER1,
+    testDelete_negative(imageEntity1,
         VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST,
         "Versionable entity VendorSoftwareProduct with id non existing vsp id does not exist." );
   }
@@ -361,7 +359,7 @@
   public void testDeleteNonExistingVfcId_negative() {
     ImageEntity imageEntity = new ImageEntity(vsp1Id, VERSION01, "111", null);
 
-    testDelete_negative(imageEntity, USER1,
+    testDelete_negative(imageEntity1,
         VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND,
         "Vendor Software Product Component with Id 111 does not exist for Vendor Software Product "
             + "with id "+vsp1Id + " and version "+VERSION01);
@@ -371,7 +369,7 @@
   public void testDeleteNonExistingImageId_negative() {
     ImageEntity imageEntity = new ImageEntity(vsp2Id, VERSION01, comp1Id, "222");
 
-    testDelete_negative(imageEntity, USER1,
+    testDelete_negative(imageEntity1,
         VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND,
         "Vendor Software Product Component Image with Id 222 does not exist for Vendor " +
             "Software Product with id "+vsp2Id+ " and version "+VERSION01 );
@@ -386,7 +384,7 @@
 
     final QuestionnaireResponse imageQuestionnaire =
         vendorSoftwareProductManager.getImageQuestionnaire(vsp2Id, VERSION01, comp1Id,
-            imageEntity.getId(), USER1);
+            imageEntity.getId()1);
 
     String imageDetails = imageQuestionnaire.getData();
     Assert.assertEquals("vdi", JsonUtil.json2Object(imageDetails, ImageDetails.class).getFormat());
@@ -422,7 +420,7 @@
     // image.setMd5("233343DDDD");
     imageEntity.setImageCompositionData(image);
 
-    ImageEntity createdImage = vendorSoftwareProductManager.createImage(imageEntity, USER1);
+    ImageEntity createdImage = vendorSoftwareProductManager.createImage(imageEntity1);
     image1Id = createdImage.getId();
     return createdImage;
   }
@@ -430,7 +428,7 @@
   private void testGet(String vspId, Version version, String componentId, String imageId, String
       user, ImageEntity expected) {
     CompositionEntityResponse<Image>
-        response = vendorSoftwareProductManager.getImage(vspId, null, componentId, imageId, user);
+        response = vendorSoftwareProductManager.getImage(vspId, null, componentId, imageId);
     Assert.assertEquals(response.getId(), expected.getId());
     Assert.assertEquals(expected.getImageCompositionData().getFileName(), response.getData().
         getFileName());
@@ -442,7 +440,7 @@
   private void testCreate_negative(ImageEntity image, String user,
                                    String expectedErrorCode, String expectedErrorMsg) {
     try {
-      vendorSoftwareProductManager.createImage(image, user);
+      vendorSoftwareProductManager.createImage(image);
       Assert.fail();
     } catch (CoreException exception) {
       Assert.assertEquals(exception.code().id(), expectedErrorCode);
@@ -454,7 +452,7 @@
                                 String user,
                                 String expectedErrorCode, String expectedErrorMsg) {
     try {
-      vendorSoftwareProductManager.getImage(vspId, version, componentId, imageId, user);
+      vendorSoftwareProductManager.getImage(vspId, version, componentId, imageId);
       Assert.fail();
     } catch (CoreException exception) {
       Assert.assertEquals(exception.code().id(), expectedErrorCode);
@@ -465,7 +463,7 @@
   private void testList_negative(String vspId, Version version, String componentId, String user,
                                  String expectedErrorCode, String expectedErrorMsg) {
     try {
-      vendorSoftwareProductManager.listImages(vspId, version, componentId, user);
+      vendorSoftwareProductManager.listImages(vspId, version, componentId);
       Assert.fail();
     } catch (CoreException exception) {
       Assert.assertEquals(exception.code().id(), expectedErrorCode);
@@ -478,7 +476,7 @@
                                 String expectedErrorCode, String expectedErrorMsg) {
     try {
 
-      vendorSoftwareProductManager.updateImage(imageEntity, user);
+      vendorSoftwareProductManager.updateImage(imageEntity);
       Assert.fail();
     } catch (CoreException exception) {
       Assert.assertEquals(exception.code().id(), expectedErrorCode);
@@ -491,7 +489,7 @@
                                    String expectedErrorCode, String expectedErrorMsg) {
     try {
 
-      vendorSoftwareProductManager.updateImage(imageEntity, user);
+      vendorSoftwareProductManager.updateImage(imageEntity);
       Assert.fail();
     } catch (CoreException exception) {
       Assert.assertEquals(exception.code().id(), expectedErrorCode);
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/QuestionnaireDataServiceTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/QuestionnaireDataServiceTest.java
index b544d13..e8e0f2c 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/QuestionnaireDataServiceTest.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/QuestionnaireDataServiceTest.java
@@ -30,12 +30,10 @@
 import org.openecomp.core.model.dao.ServiceModelDao;
 import org.openecomp.core.model.types.ServiceElement;
 import org.openecomp.core.validation.util.MessageContainerUtil;
-import org.openecomp.sdc.activityLog.ActivityLogManager;
 import org.openecomp.sdc.activitylog.dao.type.ActivityLogEntity;
 import org.openecomp.sdc.datatypes.error.ErrorLevel;
 import org.openecomp.sdc.healing.api.HealingManager;
 import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao;
 import org.openecomp.sdc.vendorsoftwareproduct.impl.OrchestrationTemplateCandidateManagerImpl;
 import org.openecomp.sdc.vendorsoftwareproduct.informationArtifact.InformationArtifactData;
 import org.openecomp.sdc.vendorsoftwareproduct.questionnaire.QuestionnaireDataService;
@@ -54,16 +52,11 @@
 import java.util.List;
 import java.util.Objects;
 
-import static org.mockito.Mockito.verify;
-import static org.mockito.Matchers.eq;
-
 public class QuestionnaireDataServiceTest {
   public static final Version VERSION = new Version(0, 1);
   private QuestionnaireDataService questionnaireDataService;// = new QuestionnaireDataServiceImpl();
 
   @Mock
-  private VendorSoftwareProductDao vendorSoftwareProductDaoMock;
-  @Mock
   private CandidateService candidateServiceMock;
   @Mock
   private HealingManager healingManagerMock;
@@ -73,8 +66,6 @@
   private ServiceModelDao<ToscaServiceModel, ServiceElement> serviceModelDaoMock;
   @Mock
   private CompositionEntityDataManager compositionEntityDataManagerMock;
-  @Mock
-  private ActivityLogManager activityLogManagerMock;
 
   @Captor
   private ArgumentCaptor<ActivityLogEntity> activityLogEntityArg;
@@ -82,7 +73,7 @@
   @InjectMocks
   private OrchestrationTemplateCandidateManagerImpl candidateManager;
 
-  private final UploadFileTest uploadFileTest = new UploadFileTest();
+  private UploadFileTest uploadFileTest = new UploadFileTest();
 
   private static String vspId;
   private static Version vspActiveVersion;
@@ -110,31 +101,27 @@
 
   // TODO: 3/15/2017 fix and enable   //@Test
   public void testQuestionnaireDataAfterIllegalUpload() throws IOException {
-
     try (InputStream zipInputStream = uploadFileTest.getZipInputStream("/missingYml")) {
-      UploadFileResponse uploadFileResponse = candidateManager
-              .upload(vspId, VERSION, zipInputStream, USER1, "zip", "missingYml");
+      UploadFileResponse uploadFileResponse =
+              candidateManager.upload(vspId, VERSION, zipInputStream, "zip", "missingYml");
     }
-
     InformationArtifactData informationArtifactData = questionnaireDataService
         .generateQuestionnaireDataForInformationArtifact(vspId, vspActiveVersion);
 
   }
 
   private InformationArtifactData uploadFileAndValidateInformationArtifactData(String filePath,
-                                                                               int listSizeToCheck) throws IOException {
+                                                                               int listSizeToCheck)
+            throws IOException {
 
     try (InputStream zipInputStream = uploadFileTest.getZipInputStream(filePath)) {
-      UploadFileResponse uploadFileResponse = candidateManager
-              .upload(vspId, VERSION,
-                      zipInputStream, USER1, "zip", "file");
-
-      candidateManager.process(vspId, VERSION, USER1);
+      UploadFileResponse uploadFileResponse =
+              candidateManager.upload(vspId, VERSION, zipInputStream, "zip", "file");
+      candidateManager.process(vspId, VERSION);
 
       Assert.assertTrue(MapUtils.isEmpty(
               MessageContainerUtil.getMessageByLevel(ErrorLevel.ERROR, uploadFileResponse.getErrors())));
     }
-
     InformationArtifactData informationArtifactData = questionnaireDataService
         .generateQuestionnaireDataForInformationArtifact(vspId, vspActiveVersion);
     Assert.assertNotNull(informationArtifactData);
@@ -143,11 +130,6 @@
         informationArtifactData.getComponentQuestionnaires();
     Assert.assertEquals(componentQuestionnaireList.size(), listSizeToCheck);
 
-    verify(activityLogManagerMock).addActionLog(activityLogEntityArg.capture(),eq(USER1));
-    ActivityLogEntity activityLogEntity = activityLogEntityArg.getValue();
-    Assert.assertEquals(activityLogEntity.getVersionId(), String.valueOf(VERSION.getMajor()+1));
-    Assert.assertTrue(activityLogEntity.isSuccess());
-
     return informationArtifactData;
   }
 
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComponentDependencyModelTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComponentDependencyModelTest.java
index c3f78b6..a2cbaa7 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComponentDependencyModelTest.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComponentDependencyModelTest.java
@@ -6,136 +6,217 @@
 import org.mockito.MockitoAnnotations;
 import org.mockito.Spy;
 import org.openecomp.sdc.common.errors.CoreException;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.ComponentManager;
-import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductManager;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDao;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDependencyModelDao;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentDependencyModelEntity;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
 import org.openecomp.sdc.vendorsoftwareproduct.errors.ComponentDependencyModelErrorBuilder;
 import org.openecomp.sdc.versioning.dao.types.Version;
 import org.testng.Assert;
-import org.testng.annotations.BeforeClass;
+import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
 
+import static org.mockito.Matchers.anyObject;
+import static org.mockito.Mockito.when;
+
 public class ComponentDependencyModelTest {
 
-  private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName());
+  private static final String VSP_ID = "vsp_id";
+  private static final Version VERSION = new Version("version_id");
+  private static final String COMP_DEP_ID = "comp_dep_id";
+
+  private static final String COMP_ID_1 = "comp_id_1";
+  private static final String COMP_ID_2 = "comp_id_2";
+  private static final String COMP_ID_3 = "comp_id_3";
+  private static final String COMP_ID_4 = "comp_id_4";
 
   @Spy
   @InjectMocks
   private ComponentDependencyModelManagerImpl componentDependencyModelManager;
   @Mock
-  private VendorSoftwareProductManager vendorSoftwareProductManager;
-  @Mock
-  private VendorSoftwareProductDao vendorSoftwareProductDao;
-  @Mock
-  private ComponentDao componentDao;
-  @Mock
   private ComponentManager componentManager;
+  @Mock
+  private ComponentDependencyModelDao componentDependencyModelDao;
 
-  private static String vsp1Id;
-  private static String sourceComp1Id;
-  private static String sourceComp2Id;
-  private static String sourceComp3Id;
-  private static String sourceComp4Id;
-  private static final String USER1 = "TestUser1";
-  private static final String USER2 = "TestUser2";
-  private static final Version VERSION01 = new Version(0, 1);
-  private static String modelId = "model1";
-
-
-  @BeforeClass
+  @BeforeMethod
   private void init() {
     MockitoAnnotations.initMocks(this);
   }
 
-  public static VspDetails createVspDetails(String id, Version version, String name, String desc,
-                                            String vendorName, String vlm, String icon,
-                                            String category, String subCategory,
-                                            String licenseAgreement, List<String> featureGroups
-  ) {
-    VspDetails vspDetails = new VspDetails(id, version);
-    vspDetails.setName(name);
-    vspDetails.setDescription(desc);
-    vspDetails.setIcon(icon);
-    vspDetails.setCategory(category);
-    vspDetails.setSubCategory(subCategory);
-    vspDetails.setVendorName(vendorName);
-    vspDetails.setVendorId(vlm);
-    vspDetails.setVlmVersion(new Version(1, 0));
-    vspDetails.setLicenseAgreement(licenseAgreement);
-    vspDetails.setFeatureGroups(featureGroups);
-    return vspDetails;
+  @Test
+  public void testListDependency() {
+    List<ComponentDependencyModelEntity> entities = new ArrayList<>();
+    entities.add(createModelEntity(COMP_ID_1, COMP_ID_2));
+    entities.add(createModelEntity(COMP_ID_3, COMP_ID_4));
+
+    Mockito.when(componentDependencyModelDao
+        .list(new ComponentDependencyModelEntity(VSP_ID, VERSION, null)))
+        .thenReturn(entities);
+
+    Collection<ComponentDependencyModelEntity> list =
+        componentDependencyModelManager.list(VSP_ID, VERSION);
+
+    Mockito.verify(componentDependencyModelDao, Mockito.times(1))
+        .list(new ComponentDependencyModelEntity(VSP_ID, VERSION, null));
+
+    Assert.assertEquals(2, list.size());
   }
 
   @Test
-  public void testCreateNegative_NoSourceId() {
-    List<ComponentDependencyModelEntity> entities = new ArrayList<ComponentDependencyModelEntity>();
-    entities.add(createModelEntity(null, sourceComp2Id));
-    testCreate_negative(entities, vsp1Id, VERSION01, USER1,
-        ComponentDependencyModelErrorBuilder.getNoSourceComponentErrorBuilder().id(),
-        ComponentDependencyModelErrorBuilder.getNoSourceComponentErrorBuilder().message());
+  public void testCreateDependency() {
+    ComponentDependencyModelEntity modelEntity =
+        createModelEntity(COMP_ID_1, COMP_ID_2);
 
-    entities.clear();
-    entities.add(createModelEntity("", sourceComp2Id));
-    testCreate_negative(entities, vsp1Id, VERSION01, USER1,
-        ComponentDependencyModelErrorBuilder.getNoSourceComponentErrorBuilder().id(),
-        ComponentDependencyModelErrorBuilder.getNoSourceComponentErrorBuilder().message());
+    componentDependencyModelManager.createComponentDependency(modelEntity, VSP_ID, VERSION);
+    Mockito.verify(componentDependencyModelDao, Mockito.times(1)).create(modelEntity);
   }
 
   @Test
-  public void testCreateNegative_SameSourceTarget() {
-    List<ComponentDependencyModelEntity> entities = new ArrayList<ComponentDependencyModelEntity>();
-    entities.add(createModelEntity("sourceComp1Id", "sourceComp1Id"));
-    testCreate_negative(entities, vsp1Id, VERSION01, USER1,
+  public void testCreateDependencyNegative_SameSourceTarget() {
+    ComponentDependencyModelEntity modelEntity =
+        createModelEntity(COMP_ID_1, COMP_ID_1);
+    testCreateDependency_negative(modelEntity, VSP_ID, VERSION,
         ComponentDependencyModelErrorBuilder.getSourceTargetComponentEqualErrorBuilder().id(),
         ComponentDependencyModelErrorBuilder.getSourceTargetComponentEqualErrorBuilder().message());
   }
 
   @Test
-  public void testCreate() {
-    List<ComponentDependencyModelEntity> entities = new ArrayList<ComponentDependencyModelEntity>();
-    entities.add(createModelEntity("sourceComp1Id", "sourceComp2Id"));
-    entities.add(createModelEntity("sourceComp3Id", "sourceComp4Id"));
+  public void testCreateDependencyNegative_NoSourceId() {
 
-    componentDependencyModelManager.createComponentDependencyModel(entities, vsp1Id, VERSION01,
-        USER1);
-    Mockito.verify(vendorSoftwareProductDao, Mockito.times(1)).createComponentDependencyModel
-        (entities, vsp1Id,
-        VERSION01);
+    ComponentDependencyModelEntity modelEntity = createModelEntity(null, COMP_ID_1);
+    testCreateDependency_negative(modelEntity, VSP_ID, VERSION,
+        ComponentDependencyModelErrorBuilder.getNoSourceComponentErrorBuilder().id(),
+        ComponentDependencyModelErrorBuilder.getNoSourceComponentErrorBuilder().message());
+
+
+    ComponentDependencyModelEntity modelEntity1 = createModelEntity("", COMP_ID_1);
+    testCreateDependency_negative(modelEntity1, VSP_ID, VERSION,
+        ComponentDependencyModelErrorBuilder.getNoSourceComponentErrorBuilder().id(),
+        ComponentDependencyModelErrorBuilder.getNoSourceComponentErrorBuilder().message());
+  }
+
+  @Test
+  public void testUpdateDependency() {
+    ComponentDependencyModelEntity modelEntity =
+        createModelEntity(COMP_ID_1, COMP_ID_2);
+    modelEntity.setId(COMP_DEP_ID);
+
+    when(componentDependencyModelDao.get(anyObject())).thenReturn(modelEntity);
+
+    componentDependencyModelManager.update(modelEntity);
+    Mockito.verify(componentDependencyModelDao, Mockito.times(1)).update(modelEntity);
+  }
+
+  @Test
+  public void testUpdateDependencyNegative_NoSourceId() {
+
+    ComponentDependencyModelEntity modelEntity = createModelEntity(null, COMP_ID_1);
+    modelEntity.setId(COMP_DEP_ID);
+
+    when(componentDependencyModelDao.get(anyObject())).thenReturn(modelEntity);
+
+    testUpdateDependency_negative(modelEntity,
+        ComponentDependencyModelErrorBuilder.getNoSourceComponentErrorBuilder().id(),
+        ComponentDependencyModelErrorBuilder.getNoSourceComponentErrorBuilder().message());
+
+    ComponentDependencyModelEntity modelEntity1 = createModelEntity("", COMP_ID_1);
+    modelEntity1.setId(COMP_DEP_ID);
+
+    when(componentDependencyModelDao.get(anyObject())).thenReturn(modelEntity1);
+
+    testUpdateDependency_negative(modelEntity1,
+        ComponentDependencyModelErrorBuilder.getNoSourceComponentErrorBuilder().id(),
+        ComponentDependencyModelErrorBuilder.getNoSourceComponentErrorBuilder().message());
+  }
+
+  @Test
+  public void testUpdateDependencyNegative_SameSourceTarget() {
+    ComponentDependencyModelEntity modelEntity =
+        createModelEntity(COMP_ID_1, COMP_ID_1);
+    modelEntity.setId(COMP_DEP_ID);
+
+    when(componentDependencyModelDao.get(anyObject())).thenReturn(modelEntity);
+    testUpdateDependency_negative(modelEntity,
+        ComponentDependencyModelErrorBuilder.getSourceTargetComponentEqualErrorBuilder().id(),
+        ComponentDependencyModelErrorBuilder.getSourceTargetComponentEqualErrorBuilder().message());
+  }
+
+  @Test
+  public void testDeleteDependency() {
+    ComponentDependencyModelEntity modelEntity =
+        createModelEntity(COMP_ID_1, COMP_ID_2);
+    modelEntity.setId(COMP_DEP_ID);
+
+    when(componentDependencyModelDao.get(anyObject())).thenReturn(modelEntity);
+
+    componentDependencyModelManager.delete(VSP_ID, VERSION, COMP_DEP_ID);
+    Mockito.verify(componentDependencyModelDao, Mockito.times(1)).delete(modelEntity);
+  }
+
+  @Test
+  public void testDeleteInvalidDependency() {
+    ComponentDependencyModelEntity delModelEntity =
+        createModelEntity(COMP_ID_1, COMP_ID_2);
+    delModelEntity.setId(COMP_DEP_ID);
+
+    try {
+      componentDependencyModelManager.delete(VSP_ID, VERSION, COMP_DEP_ID);
+      Assert.fail();
+    } catch (CoreException exception) {
+      Assert.assertEquals(exception.code().id(), "VERSIONABLE_SUB_ENTITY_NOT_FOUND");
+      Assert.assertEquals(exception.getMessage(),
+          String.format("Vendor Software Product Component Dependency Model with Id %s " +
+                  "does not exist for Vendor Software Product with id %s and version %s",
+              COMP_DEP_ID, VSP_ID, VERSION.getId()));
+    }
+  }
+
+
+  @Test
+  public void testGetDependency() {
+    ComponentDependencyModelEntity modelEntity =
+        createModelEntity(COMP_ID_1, COMP_ID_2);
+    modelEntity.setId(COMP_DEP_ID);
+
+    when(componentDependencyModelDao.get(anyObject())).thenReturn(modelEntity);
+
+    ComponentDependencyModelEntity retrieved =
+        componentDependencyModelManager.get(VSP_ID, VERSION, COMP_DEP_ID);
+
+    Assert.assertEquals(retrieved.getSourceComponentId(), COMP_ID_1);
+
   }
 
   private ComponentDependencyModelEntity createModelEntity(String sourceId, String targetId) {
     ComponentDependencyModelEntity entity =
-        new ComponentDependencyModelEntity(vsp1Id, VERSION01, modelId);
+        new ComponentDependencyModelEntity(VSP_ID, VERSION, COMP_DEP_ID);
     entity.setSourceComponentId(sourceId);
     entity.setTargetComponentId(targetId);
     entity.setRelation("dependsOn");
     return entity;
   }
 
-  private Collection<ComponentDependencyModelEntity> getDependencyModel(String vspId,
-                                                                        Version version,
-                                                                        String user) {
-    return componentDependencyModelManager.list(vspId, version, user);
-  }
-
-  private void testCreate_negative(List<ComponentDependencyModelEntity> entities, String vspId,
-                                   Version version, String user,
-                                   String expectedErrorCode, String expectedErrorMsg) {
+  private void testCreateDependency_negative(ComponentDependencyModelEntity entity, String vspId,
+                                             Version version, String expectedErrorCode,
+                                             String expectedErrorMsg) {
     try {
-      componentDependencyModelManager.createComponentDependencyModel(entities, vspId, version,
-        user);
+      componentDependencyModelManager.createComponentDependency(entity, vspId, version);
       Assert.fail();
     } catch (CoreException exception) {
-      log.debug("",exception);
+      Assert.assertEquals(exception.code().id(), expectedErrorCode);
+      Assert.assertEquals(exception.getMessage(), expectedErrorMsg);
+    }
+  }
+
+  private void testUpdateDependency_negative(ComponentDependencyModelEntity entity,
+                                             String expectedErrorCode, String expectedErrorMsg) {
+    try {
+      componentDependencyModelManager.update(entity);
+      Assert.fail();
+    } catch (CoreException exception) {
       Assert.assertEquals(exception.code().id(), expectedErrorCode);
       Assert.assertEquals(exception.getMessage(), expectedErrorMsg);
     }
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComponentManagerImplTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComponentManagerImplTest.java
index ee8295ca..c7aa818 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComponentManagerImplTest.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComponentManagerImplTest.java
@@ -2,12 +2,9 @@
 
 import org.mockito.InjectMocks;
 import org.mockito.Mock;
-import org.mockito.Mockito;
 import org.mockito.MockitoAnnotations;
 import org.mockito.Spy;
 import org.openecomp.sdc.common.errors.CoreException;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.NicManager;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDao;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDao;
@@ -37,16 +34,13 @@
 import static org.mockito.Mockito.verify;
 
 public class ComponentManagerImplTest {
-
-  private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName());
-
-  private static final String COMP_NOT_EXIST_MSG =
-      "Vendor Software Product Component with Id 1 does not exist for Vendor Software Product with id VSP_ID and version 0.1";
-  private static final String USER = "componentsTestUser";
   private static final String VSP_ID = "VSP_ID";
-  private static final Version VERSION = new Version(0, 1);
-  private static final String COMP1_ID = "1";
-  private static final String COMP2_ID = "2";
+  private static final Version VERSION = new Version("version_id");
+  private static final String COMP1_ID = "comp1";
+  private static final String COMP2_ID = "comp2";
+  private static final String COMP_NOT_EXIST_MSG =
+      "Vendor Software Product Component with Id comp1 does not exist " +
+          "for Vendor Software Product with id VSP_ID and version version_id";
 
   @Mock
   private ComponentDao componentDaoMock;
@@ -67,20 +61,15 @@
 
   @Test
   public void testListWhenNone() {
-    Collection<ComponentEntity> components =
-        componentManager.listComponents(VSP_ID, VERSION, USER);
+    Collection<ComponentEntity> components = componentManager.listComponents(VSP_ID, VERSION);
     Assert.assertEquals(components.size(), 0);
   }
 
   @Test(expectedExceptions = CoreException.class,
-      expectedExceptionsMessageRegExp = "Vendor Software Product Component with Id dummyComponentId " +
-          "does not exist for Vendor Software Product with id dummyVsp and version 1.0")
+      expectedExceptionsMessageRegExp = COMP_NOT_EXIST_MSG)
   public void validateExceptionWhenTryingToRetriveNotExistingComponentEntity() {
-    Version version = Mockito.mock(Version.class);
-    doReturn("1.0").when(version).toString();
     doReturn(null).when(componentDaoMock).get(anyObject());
-    componentManager.validateComponentExistence("dummyVsp", version, "dummyComponentId",
-        "dummyUser");
+    componentManager.validateComponentExistence(VSP_ID, VERSION, COMP1_ID);
   }
 
   @Test
@@ -90,21 +79,20 @@
         createComponent(VSP_ID, VERSION, COMP2_ID)))
         .when(componentDaoMock).list(anyObject());
 
-    Collection<ComponentEntity> actual =
-        componentManager.listComponents(VSP_ID, VERSION, USER);
+    Collection<ComponentEntity> actual = componentManager.listComponents(VSP_ID, VERSION);
     Assert.assertEquals(actual.size(), 2);
   }
 
   @Test
   public void testDeleteListOnUploadVsp_negative() {
-    testDeleteList_negative(VSP_ID, VERSION, USER,
+    testDeleteList_negative(VSP_ID, VERSION,
         VendorSoftwareProductErrorCodes.VSP_COMPOSITION_EDIT_NOT_ALLOWED);
   }
 
-/*    @Test
-    public void testCreate() {
-        COMP1_ID = testCreate(VSP_ID);
-    }*/
+  /*    @Test
+      public void testCreate() {
+          COMP1_ID = testCreate(VSP_ID);
+      }*/
   @Test
   public void testCreate() {
     ComponentEntity expected = new ComponentEntity(VSP_ID, null, null);
@@ -113,12 +101,12 @@
     compData.setDescription("comp1 desc");
     expected.setComponentCompositionData(compData);
 
-    doReturn(true).when(vspInfoDao).isManual(anyObject(),anyObject());
+    doReturn(true).when(vspInfoDao).isManual(anyObject(), anyObject());
     Collection<ComponentEntity> vspComponentList = new ArrayList<>();
     doReturn(vspComponentList).when(componentDaoMock).list(anyObject());
     doReturn(expected).when(compositionEntityDataManagerMock).createComponent(anyObject());
 
-    ComponentEntity created = componentManager.createComponent(expected, USER);
+    ComponentEntity created = componentManager.createComponent(expected);
     Assert.assertNotNull(created);
     //expected.setId(created.getId());
     //expected.setVersion(VERSION);
@@ -137,15 +125,14 @@
     compData.setDescription("comp1 desc");
     expected.setComponentCompositionData(compData);
 
-    doReturn(true).when(vspInfoDao).isManual(anyObject(),anyObject());
+    doReturn(true).when(vspInfoDao).isManual(anyObject(), anyObject());
     Collection<ComponentEntity> vspComponentList = new ArrayList<>();
     vspComponentList.add(expected);
     doReturn(vspComponentList).when(componentDaoMock).list(anyObject());
 
     try {
-      ComponentEntity created = componentManager.createComponent(expected, USER);
-    }  catch (CoreException exception) {
-      log.debug("",exception);
+      ComponentEntity created = componentManager.createComponent(expected);
+    } catch (CoreException exception) {
       Assert.assertEquals("Creation of only one VFC per VSP allowed.", exception.code().message());
       Assert.assertEquals(VendorSoftwareProductErrorCodes.VSP_VFC_COUNT_EXCEED,
           exception.code().id());
@@ -161,14 +148,14 @@
     expected.setComponentCompositionData(compData);
 
     doReturn(expected).when(componentDaoMock).get(anyObject());
-    doReturn(true).when(vspInfoDao).isManual(anyObject(),anyObject());
+    doReturn(true).when(vspInfoDao).isManual(anyObject(), anyObject());
     Collection<ComponentEntity> vspComponentList = new ArrayList<>();
     vspComponentList.add(expected);
     doReturn(vspComponentList).when(componentDaoMock).list(anyObject());
-    doReturn(new CompositionEntityValidationData(null,null)).when(compositionEntityDataManagerMock)
-        .validateEntity(anyObject(),anyObject(),anyObject());
+    doReturn(new CompositionEntityValidationData(null, null)).when(compositionEntityDataManagerMock)
+        .validateEntity(anyObject(), anyObject(), anyObject());
 
-    CompositionEntityValidationData created = componentManager.updateComponent(expected, USER);
+    CompositionEntityValidationData created = componentManager.updateComponent(expected);
     Assert.assertNotNull(created);
   }
 
@@ -182,20 +169,19 @@
     expected.setComponentCompositionData(compData);
 
     doReturn(expected).when(componentDaoMock).get(anyObject());
-    doReturn(true).when(vspInfoDao).isManual(anyObject(),anyObject());
+    doReturn(true).when(vspInfoDao).isManual(anyObject(), anyObject());
     Collection<ComponentEntity> vspComponentList = new ArrayList<>();
     vspComponentList.add(expected);
-    ComponentEntity expected2 = new ComponentEntity(VSP_ID+"2", null, COMP1_ID+"2");
+    ComponentEntity expected2 = new ComponentEntity(VSP_ID + "2", null, COMP1_ID + "2");
     expected2.setComponentCompositionData(compData);
     vspComponentList.add(expected2);
     doReturn(vspComponentList).when(componentDaoMock).list(anyObject());
-    doReturn(new CompositionEntityValidationData(null,null)).when(compositionEntityDataManagerMock)
-        .validateEntity(anyObject(),anyObject(),anyObject());
+    doReturn(new CompositionEntityValidationData(null, null)).when(compositionEntityDataManagerMock)
+        .validateEntity(anyObject(), anyObject(), anyObject());
 
     try {
-      CompositionEntityValidationData created = componentManager.updateComponent(expected, USER);
-    }  catch (CoreException exception) {
-      log.debug("",exception);
+      CompositionEntityValidationData created = componentManager.updateComponent(expected);
+    } catch (CoreException exception) {
       Assert.assertEquals("VFC with specified name already present in given VSP.",
           exception.code().message());
       Assert.assertEquals(VendorSoftwareProductErrorCodes.VSP_VFC_DUPLICATE_NAME,
@@ -220,7 +206,7 @@
 
   @Test
   public void testCreateOnUploadVsp_negative() {
-    testCreate_negative(new ComponentEntity(VSP_ID, VERSION, null), USER,
+    testCreate_negative(new ComponentEntity(VSP_ID, VERSION, null),
         VendorSoftwareProductErrorCodes.VFC_ADD_NOT_ALLOWED_IN_HEAT_ONBOARDING);
   }
 
@@ -229,7 +215,7 @@
     String componentId = "non existing component id";
     doReturn(null).when(componentDaoMock).get(anyObject());
 
-    testUpdate_negative(VSP_ID, VERSION, componentId, USER,
+    testUpdate_negative(VSP_ID, VERSION, componentId,
         VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
   }
 
@@ -254,7 +240,7 @@
 
 
     CompositionEntityValidationData validationData =
-        componentManager.updateComponent(component, USER);
+        componentManager.updateComponent(component);
     Assert.assertTrue(validationData == null || validationData.getErrors() == null);
     verify(componentDaoMock).update(component);
   }
@@ -277,7 +263,7 @@
     component.setComponentCompositionData(compData);
 
     CompositionEntityValidationData validationData =
-        componentManager.updateComponent(component, USER);
+        componentManager.updateComponent(component);
     Assert.assertNotNull(validationData);
     Assert.assertEquals(validationData.getErrors().size(), 2);
 
@@ -289,7 +275,7 @@
     String componentId = "non existing component id";
     doReturn(null).when(componentDaoMock).get(anyObject());
 
-    testGet_negative(VSP_ID, VERSION, componentId, USER,
+    testGet_negative(VSP_ID, VERSION, componentId,
         VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
   }
 
@@ -300,7 +286,7 @@
 
     doReturn("schema string").when(componentManager).getComponentCompositionSchema(anyObject());
 
-    testGet(VSP_ID, VERSION, COMP1_ID, USER, expected);
+    testGet(VSP_ID, VERSION, COMP1_ID, expected);
   }
 
 
@@ -329,14 +315,14 @@
 
   @Test
   public void testDeleteOnUploadVsp_negative() {
-    testDelete_negative(VSP_ID, VERSION, COMP1_ID, USER,
+    testDelete_negative(VSP_ID, VERSION, COMP1_ID,
         VendorSoftwareProductErrorCodes.VSP_COMPOSITION_EDIT_NOT_ALLOWED);
   }
 
   @Test(expectedExceptions = CoreException.class,
       expectedExceptionsMessageRegExp = COMP_NOT_EXIST_MSG)
   public void testGetNonExistingComponentQuestionnaire() throws Exception {
-    componentManager.getQuestionnaire(VSP_ID, VERSION, COMP1_ID, USER);
+    componentManager.getQuestionnaire(VSP_ID, VERSION, COMP1_ID);
   }
 
   @Test
@@ -347,7 +333,7 @@
     doReturn(schema).when(componentManager).getComponentQuestionnaireSchema(anyObject());
 
     QuestionnaireResponse questionnaire =
-        componentManager.getQuestionnaire(VSP_ID, VERSION, COMP1_ID, USER);
+        componentManager.getQuestionnaire(VSP_ID, VERSION, COMP1_ID);
     Assert.assertNotNull(questionnaire);
     Assert.assertEquals(questionnaire.getData(), null);
     Assert.assertEquals(questionnaire.getSchema(), schema);
@@ -372,13 +358,13 @@
     nicEntity2.setNicCompositionData(nic2);
 
     doReturn(Arrays.asList(nicEntity1, nicEntity2))
-        .when(nicManagerMock).listNics(VSP_ID, VERSION, COMP1_ID, USER);
+        .when(nicManagerMock).listNics(VSP_ID, VERSION, COMP1_ID);
 
     String schema = "schema string";
     doReturn(schema).when(componentManager).getComponentQuestionnaireSchema(anyObject());
 
     QuestionnaireResponse questionnaire =
-        componentManager.getQuestionnaire(VSP_ID, VERSION, COMP1_ID, USER);
+        componentManager.getQuestionnaire(VSP_ID, VERSION, COMP1_ID);
     Assert.assertNotNull(questionnaire);
     Assert.assertEquals(questionnaire.getData(), component.getQuestionnaireData());
     Assert.assertEquals(questionnaire.getSchema(), schema);
@@ -389,7 +375,7 @@
       expectedExceptionsMessageRegExp = COMP_NOT_EXIST_MSG)
   public void testUpdateNonExistingComponentQuestionnaire() throws Exception {
     doReturn(null).when(componentDaoMock).get(anyObject());
-    componentManager.updateQuestionnaire(VSP_ID, VERSION, COMP1_ID, "questionnaire data", USER);
+    componentManager.updateQuestionnaire(VSP_ID, VERSION, COMP1_ID, "questionnaire data");
   }
 
   @Test
@@ -397,7 +383,7 @@
     ComponentEntity component = createComponent(VSP_ID, VERSION, COMP1_ID);
     doReturn(component).when(componentDaoMock).get(anyObject());
 
-    componentManager.updateQuestionnaire(VSP_ID, VERSION, COMP1_ID, "questionnaire data", USER);
+    componentManager.updateQuestionnaire(VSP_ID, VERSION, COMP1_ID, "questionnaire data");
 
     verify(componentDaoMock)
         .updateQuestionnaireData(VSP_ID, VERSION, COMP1_ID, "questionnaire data");
@@ -417,79 +403,72 @@
         Assert.assertEquals(actual.size(), 0);
     }*/
 
-  private void testGet(String vspId, Version version, String componentId, String user,
+  private void testGet(String vspId, Version version, String componentId,
                        ComponentEntity expected) {
 
     CompositionEntityResponse<ComponentData>
-        response = componentManager.getComponent(vspId, version, componentId, user);
+        response = componentManager.getComponent(vspId, version, componentId);
     Assert.assertEquals(response.getId(), expected.getId());
     Assert.assertEquals(response.getData(), expected.getComponentCompositionData());
     Assert.assertNotNull(response.getSchema());
   }
 
-  private void testCreate_negative(ComponentEntity component, String user,
+  private void testCreate_negative(ComponentEntity component,
                                    String expectedErrorCode) {
     try {
-      componentManager.createComponent(component, user);
+      componentManager.createComponent(component);
       Assert.fail();
     } catch (CoreException exception) {
-      log.debug("",exception);
       Assert.assertEquals(exception.code().id(), expectedErrorCode);
     }
   }
 
-  private void testGet_negative(String vspId, Version version, String componentId, String user,
+  private void testGet_negative(String vspId, Version version, String componentId,
                                 String expectedErrorCode) {
     try {
-      componentManager.getComponent(vspId, version, componentId, user);
+      componentManager.getComponent(vspId, version, componentId);
       Assert.fail();
     } catch (CoreException exception) {
-      log.debug("",exception);
       Assert.assertEquals(exception.code().id(), expectedErrorCode);
     }
   }
 
-  private void testUpdate_negative(String vspId, Version version, String componentId, String user,
+  private void testUpdate_negative(String vspId, Version version, String componentId,
                                    String expectedErrorCode) {
     try {
-      componentManager
-          .updateComponent(new ComponentEntity(vspId, version, componentId), user);
+      componentManager.updateComponent(new ComponentEntity(vspId, version, componentId));
       Assert.fail();
     } catch (CoreException exception) {
-      log.debug("",exception);
       Assert.assertEquals(exception.code().id(), expectedErrorCode);
     }
   }
 
-  private void testList_negative(String vspId, Version version, String user,
+  private void testList_negative(String vspId, Version version,
                                  String expectedErrorCode) {
     try {
-      componentManager.listComponents(vspId, version, user);
+      componentManager.listComponents(vspId, version);
       Assert.fail();
     } catch (CoreException exception) {
-      log.debug("",exception);
       Assert.assertEquals(exception.code().id(), expectedErrorCode);
     }
   }
 
-  private void testDeleteList_negative(String vspId, Version version, String user,
+  private void testDeleteList_negative(String vspId, Version version,
                                        String expectedErrorCode) {
     try {
-      componentManager.deleteComponents(vspId, version, user);
+      componentManager.deleteComponents(vspId, version);
       Assert.fail();
     } catch (CoreException exception) {
-      log.debug("",exception);
       Assert.assertEquals(exception.code().id(), expectedErrorCode);
     }
   }
 
-  private void testDelete_negative(String vspId, Version version, String componentId, String user,
+  private void testDelete_negative(String vspId, Version version, String componentId,
                                    String expectedErrorCode) {
     try {
-      componentManager.deleteComponent(vspId, version, componentId, user);
+      componentManager.deleteComponent(vspId, version, componentId);
       Assert.fail();
     } catch (CoreException exception) {
-      log.debug("",exception);
       Assert.assertEquals(exception.code().id(), expectedErrorCode);
     }
   }
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComputeManagerImplTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComputeManagerImplTest.java
index eda5693..9058a73 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComputeManagerImplTest.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComputeManagerImplTest.java
@@ -1,378 +1,348 @@
 package org.openecomp.sdc.vendorsoftwareproduct.impl;
 
-import static org.mockito.Matchers.anyObject;
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.never;
-import static org.mockito.Mockito.verify;
-
 import org.mockito.InjectMocks;
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
 import org.mockito.Spy;
 import org.openecomp.sdc.common.errors.CoreException;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
-import org.openecomp.sdc.vendorsoftwareproduct.NetworkManager;
+import org.openecomp.sdc.common.errors.ErrorCategory;
+import org.openecomp.sdc.common.errors.ErrorCode;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.ComputeDao;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.DeploymentFlavorDao;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDao;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComputeEntity;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.DeploymentFlavorEntity;
 import org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes;
 import org.openecomp.sdc.vendorsoftwareproduct.services.composition.CompositionEntityDataManager;
 import org.openecomp.sdc.vendorsoftwareproduct.types.CompositionEntityResponse;
 import org.openecomp.sdc.vendorsoftwareproduct.types.ListComputeResponse;
 import org.openecomp.sdc.vendorsoftwareproduct.types.QuestionnaireResponse;
-import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentComputeAssociation;
 import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityType;
 import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityValidationData;
 import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComputeData;
-import org.openecomp.sdc.vendorsoftwareproduct.types.composition.DeploymentFlavor;
 import org.openecomp.sdc.versioning.dao.types.Version;
 import org.openecomp.sdc.versioning.errors.VersioningErrorCodes;
 import org.testng.Assert;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
-import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
-import java.util.List;
+
+import static org.mockito.Matchers.anyObject;
+import static org.mockito.Mockito.doNothing;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.doThrow;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.verify;
 
 public class ComputeManagerImplTest {
 
-    private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName());
+  private static final String COMPUTE_NOT_EXIST_MSG =
+      "Vendor Software Product COMPUTE with Id compute1 does not exist for Vendor Software Product with " +
+          "id VSP_ID and version version_id";
 
-    private static final String COMPUTE_NOT_EXIST_MSG =
-            "Vendor Software Product COMPUTE with Id compute1 does not exist for Vendor Software Product with " +
-                    "id VSP_ID and version 0.1";
-
-    private static final String USER = "computeTestUser";
-    private static final String VSP_ID = "VSP_ID";
-    private static final Version VERSION = new Version(0, 1);
-    private static final String COMPONENT_ID = "COMPONENT_ID";
-    private static final String COMPUTE1_ID = "compute1";
-    private static final String COMPUTE2_ID = "compute2";
+  private static final String VSP_ID = "VSP_ID";
+  private static final Version VERSION = new Version("version_id");
+  private static final String COMPONENT_ID = "COMPONENT_ID";
+  private static final String COMPUTE1_ID = "compute1";
+  private static final String COMPUTE2_ID = "compute2";
 
   @Mock
   private ComputeDao computeDao;
-
   @Mock
   private CompositionEntityDataManager compositionEntityDataManagerMock;
-
-  @Mock
-  private NetworkManager networkManagerMock;
-
   @Mock
   private VendorSoftwareProductInfoDao vspInfoDao;
-
-  @Mock
-  private ComputeEntity computeEntity;
-
-  @Mock
-  private ListComputeResponse listComputeResponse;
-
-  @Mock
-  private DeploymentFlavorEntity deploymentFlavorEntity;
-
   @Mock
   private DeploymentFlavorDao deploymentFlavorDao;
-
-  @Mock
-  private ComponentComputeAssociation componentComputeAssociation;
-
-  @Mock
-  DeploymentFlavor deploymentFlavor;
-
   @InjectMocks
   @Spy
   private ComputeManagerImpl computeManager;
 
   @BeforeMethod
   public void setUp() throws Exception {
-      MockitoAnnotations.initMocks(this);
+    MockitoAnnotations.initMocks(this);
   }
 
-   @Test
+  @Test
   public void testListWhenNone() {
-    Collection<ListComputeResponse> computes = computeManager.listCompute(VSP_ID, VERSION, COMPONENT_ID, USER);
+    Collection<ListComputeResponse> computes =
+        computeManager.listComputes(VSP_ID, VERSION, COMPONENT_ID);
     Assert.assertEquals(computes.size(), 0);
   }
 
   @Test
-  public void testList(){
-      doReturn(Arrays.asList(
+  public void testList() {
+    doReturn(Arrays.asList(
         createCompute(VSP_ID, VERSION, COMPONENT_ID, COMPUTE1_ID),
         createCompute(VSP_ID, VERSION, COMPONENT_ID, COMPUTE2_ID)))
-              .when(computeDao).list(anyObject());
+        .when(computeDao).list(anyObject());
 
 
-      Collection<ListComputeResponse> computes = computeManager.listCompute(VSP_ID, VERSION, COMPONENT_ID, USER);
-      Assert.assertEquals(computes.size(), 2);
-      for (ListComputeResponse compute : computes) {
-          Assert.assertEquals(compute.getComputeEntity().getComputeCompositionData().getName(),
-                  COMPUTE1_ID.equals(compute.getComputeEntity().getId())
-                          ? "compute1name"
-                          : "compute2name");
-      };
+    Collection<ListComputeResponse> computes =
+        computeManager.listComputes(VSP_ID, VERSION, COMPONENT_ID);
+    Assert.assertEquals(computes.size(), 2);
+    for (ListComputeResponse compute : computes) {
+      Assert.assertEquals(compute.getComputeEntity().getComputeCompositionData().getName(),
+          COMPUTE1_ID.equals(compute.getComputeEntity().getId())
+              ? "compute1name"
+              : "compute2name");
+    }
   }
 
-    @Test
-    public void testCreateOnNotManualCompute_negative() {
-
-        testCreate_negative(new ComputeEntity(VSP_ID, VERSION, COMPONENT_ID, null), USER,
-                VendorSoftwareProductErrorCodes.ADD_COMPUTE_NOT_ALLOWED_IN_HEAT_ONBOARDING);
-    }
-
-    @Test
-    public void testCreateManualCompute() {
-        ComputeEntity expected = createCompute(VSP_ID, VERSION, COMPONENT_ID, COMPUTE1_ID);
-        doReturn(true).when(vspInfoDao).isManual(anyObject(), anyObject());
-        computeManager.createCompute(expected, USER);
-        verify(compositionEntityDataManagerMock).createCompute(expected);
-        verify(compositionEntityDataManagerMock).createCompute(expected);
-    }
-
-    @Test
-    public void testCreateManualComputeWithDuplicateName() {
-        ComputeEntity expected = createCompute(VSP_ID, VERSION, COMPONENT_ID, COMPUTE1_ID);
-        doReturn(true).when(vspInfoDao).isManual(anyObject(), anyObject());
-
-        ComputeEntity expectedDiffName = createCompute(VSP_ID, VERSION, COMPONENT_ID, COMPUTE1_ID);
-        expectedDiffName.setId(COMPUTE1_ID + "Name");
-        ComputeData computeData = expectedDiffName.getComputeCompositionData();
-        computeData.setName(COMPUTE1_ID + "Name");
-        expectedDiffName.setComputeCompositionData(computeData);
-        List<ComputeEntity> vfcImageList = new ArrayList<ComputeEntity>();
-        vfcImageList.add(expectedDiffName);
-        doReturn(vfcImageList).when(computeDao).list(anyObject());
-
-        try {
-            computeManager.createCompute(expected, USER);
-            Assert.fail();
-        }
-        catch (CoreException ex) {
-          log.debug("",ex);
-            Assert.assertEquals(VendorSoftwareProductErrorCodes.DUPLICATE_COMPUTE_NAME_NOT_ALLOWED,
-                    ex.code().id());
-        }
-    }
-
-    @Test
-    public void testUpdateNonExistingComputeId_negative() {
-
-        testUpdate_negative(VSP_ID, VERSION, COMPONENT_ID, COMPUTE1_ID, USER,
-                VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
-    }
-
-    @Test
-    public void testUpdateCompute() {
-        doReturn(createCompute(VSP_ID, VERSION, COMPONENT_ID, COMPUTE1_ID))
-                .when(computeDao).get(anyObject());
-
-        doReturn(new CompositionEntityValidationData(CompositionEntityType.compute, COMPUTE1_ID))
-                .when(compositionEntityDataManagerMock)
-                .validateEntity(anyObject(), anyObject(), anyObject());
-
-        ComputeEntity computeEntity = new ComputeEntity(VSP_ID, VERSION, COMPONENT_ID, COMPUTE1_ID);
-        ComputeData computeData = new ComputeData();
-        computeData.setName(COMPUTE1_ID + "name");
-        computeData.setDescription(COMPUTE1_ID + "desc updated");
-        computeEntity.setComputeCompositionData(computeData);
-
-        CompositionEntityValidationData validationData =
-                computeManager.updateCompute(computeEntity, USER);
-        Assert.assertTrue(validationData == null || validationData.getErrors() == null);
-        verify(computeDao).update(computeEntity);
-    }
-
-    @Test
-    public void testIllegalComputeUpdate() {
-        doReturn(createCompute(VSP_ID, VERSION, COMPONENT_ID, COMPUTE1_ID))
-                .when(computeDao).get(anyObject());
-
-        doReturn(true).when(vspInfoDao).isManual(anyObject(), anyObject());
-
-        CompositionEntityValidationData toBeReturned =
-                new CompositionEntityValidationData(CompositionEntityType.compute, COMPUTE1_ID);
-        toBeReturned.setErrors(Arrays.asList("error1", "error2"));
-        doReturn(toBeReturned)
-                .when(compositionEntityDataManagerMock)
-                .validateEntity(anyObject(), anyObject(), anyObject());
-
-        ComputeEntity computeEntity = new ComputeEntity(VSP_ID, VERSION, COMPONENT_ID, COMPUTE1_ID);
-        ComputeData computeData = new ComputeData();
-        computeData.setName(COMPUTE1_ID + "_name_updated");
-        computeData.setDescription(COMPUTE1_ID + " desc updated");
-        computeEntity.setComputeCompositionData(computeData);
-
-        CompositionEntityValidationData validationData = computeManager.updateCompute(computeEntity, USER);
-        Assert.assertNotNull(validationData);
-        Assert.assertEquals(validationData.getErrors().size(), 2);
-
-        verify(computeDao, never()).update(computeEntity);
-    }
-
-    @Test
-    public void testUpdateHEATComputeName() throws Exception {
-        doReturn(createCompute(VSP_ID, VERSION, COMPONENT_ID, COMPUTE1_ID))
-                .when(computeDao).get(anyObject());
-        ComputeEntity computeEntity = new ComputeEntity(VSP_ID, VERSION, COMPONENT_ID, COMPUTE1_ID);
-        ComputeData computeData = new ComputeData();
-        computeData.setName(COMPUTE1_ID + " name updated");
-        computeData.setDescription(COMPUTE1_ID + " desc updated");
-        computeEntity.setComputeCompositionData(computeData);
-
-        try {
-            computeManager.updateCompute(computeEntity, USER);
-        }
-        catch (CoreException ex) {
-          log.debug("",ex);
-            Assert.assertEquals(ex.code().id(), VendorSoftwareProductErrorCodes.UPDATE_COMPUTE_NOT_ALLOWED);
-        }
-
-    }
-
-    @Test
-    public void testUpdateManualComputeQuestionnaire() throws Exception {
-        String json = "{\"md5\" :\"FFDSD33SS\"}";
-        doReturn(true).when(vspInfoDao).isManual(anyObject(), anyObject());
-        doReturn(new ComputeEntity(null,null,null,null)).when(computeDao).get(anyObject());
-
-        computeManager.updateComputeQuestionnaire(VSP_ID, VERSION, COMPONENT_ID, COMPUTE1_ID, json, USER);
-        verify(computeDao).updateQuestionnaireData(VSP_ID, VERSION, COMPONENT_ID, COMPUTE1_ID, json);
-    }
-
-    @Test
-    public void testGetNonExistingComputeId_negative() {
-        testGet_negative(VSP_ID, VERSION, COMPONENT_ID, "non existing compute id", USER,
-                VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
-    }
-
-    @Test
-    public void testGet() {
-        ComputeEntity expected = createCompute(VSP_ID, VERSION, COMPONENT_ID, COMPUTE1_ID);
-        doReturn(expected).when(computeDao).get(anyObject());
-        String compositionSchema = "schema string";
-        doReturn(compositionSchema).when(computeManager).getComputeCompositionSchema(anyObject());
-
-        CompositionEntityResponse<ComputeData> response =
-                computeManager.getCompute(VSP_ID, VERSION, COMPONENT_ID, COMPUTE1_ID, USER);
-        Assert.assertEquals(response.getId(), expected.getId());
-        Assert.assertEquals(response.getData().getName(), expected.getComputeCompositionData().getName());
-        Assert.assertEquals(response.getData().getDescription(), expected.getComputeCompositionData().
-                getDescription());
-        Assert.assertEquals(response.getSchema(), compositionSchema);
-    }
-
-    @Test
-    public void testGetQuestionnaire() throws Exception {
-        ComputeEntity compute = new ComputeEntity(VSP_ID, VERSION, COMPONENT_ID, COMPUTE1_ID);
-        compute.setQuestionnaireData("{}");
-        doReturn(compute).when(computeDao).getQuestionnaireData(VSP_ID, VERSION, COMPONENT_ID, COMPUTE1_ID);
-
-        String schema = "schema string";
-
-
-        doReturn(schema).when(computeManager).getComputeQuestionnaireSchema(anyObject());
-
-        QuestionnaireResponse questionnaire =
-                computeManager.getComputeQuestionnaire(VSP_ID, VERSION, COMPONENT_ID, COMPUTE1_ID, USER);
-
-        Assert.assertNotNull(questionnaire);
-        Assert.assertEquals(questionnaire.getData(), compute.getQuestionnaireData());
-        Assert.assertEquals(questionnaire.getSchema(), schema);
-        Assert.assertNull(questionnaire.getErrorMessage());
-    }
-
-    @Test
-    public void testDeleteOnNotManualCompute() {
-        ComputeEntity expected = createCompute(VSP_ID, VERSION, COMPONENT_ID, COMPUTE1_ID);
-        doReturn(expected).when(computeDao).get(anyObject());
-        testDelete_negative(VSP_ID, VERSION, COMPONENT_ID, COMPUTE1_ID, USER,
-                VendorSoftwareProductErrorCodes.VSP_COMPOSITION_EDIT_NOT_ALLOWED);
-    }
-
-    @Test
-    public void testDeleteOnManualCompute() {
-        ComputeEntity expected = createCompute(VSP_ID, VERSION, COMPONENT_ID, COMPUTE1_ID);
-        doReturn(expected).when(computeDao).get(anyObject());
-        doReturn(true).when(vspInfoDao).isManual(anyObject(), anyObject());
-        computeManager.deleteCompute(VSP_ID, VERSION, COMPONENT_ID, COMPUTE1_ID, USER);
-        verify(computeDao).delete(anyObject());
-    }
-
-    @Test
-    public void testDeleteOnNotExistCompute() {
-        testDelete_negative(VSP_ID, VERSION, COMPONENT_ID, COMPUTE1_ID, USER,
-                VendorSoftwareProductErrorCodes.VSP_COMPOSITION_EDIT_NOT_ALLOWED);
-    }
-
-
-    private void testDelete_negative(String vspId, Version version, String componentId, String computeId,
-                                     String user,
-                                     String expectedErrorCode) {
-        try {
-            computeManager.deleteCompute(vspId, version, componentId, computeId, user);
-            Assert.fail();
-        } catch (CoreException exception) {
-          log.debug("",exception);
-            Assert.assertEquals(exception.code().id(), expectedErrorCode);
-        }
-    }
-
-    private void testGet_negative(String vspId, Version version, String componentId, String computeId,
-                                String user, String expectedErrorCode) {
-      try {
-          computeManager.getCompute(vspId, version, componentId, computeId, user);
-          Assert.fail();
-      } catch (CoreException exception) {
-        log.debug("",exception);
-          Assert.assertEquals(exception.code().id(), expectedErrorCode);
-      }
+  @Test
+  public void testCreateOnNotManualCompute_negative() {
+    testCreate_negative(new ComputeEntity(VSP_ID, VERSION, COMPONENT_ID, null),
+        VendorSoftwareProductErrorCodes.ADD_COMPUTE_NOT_ALLOWED_IN_HEAT_ONBOARDING);
   }
 
-    private void testList_negative(String vspId, Version version, String componentId, String user,
-                                   String expectedErrorCode, String expectedErrorMsg) {
-        try {
-            computeManager.listCompute(vspId, version, componentId, user);
-            Assert.fail();
-        } catch (CoreException exception) {
-          log.debug("",exception);
-            Assert.assertEquals(exception.code().id(), expectedErrorCode);
-            Assert.assertEquals(exception.getMessage(), expectedErrorMsg);
-        }
+  @Test
+  public void testCreateManualCompute() {
+    ComputeEntity expected = createCompute(VSP_ID, VERSION, COMPONENT_ID, COMPUTE1_ID);
+    doReturn(true).when(vspInfoDao).isManual(anyObject(), anyObject());
+    doNothing().when(computeManager)
+        .validateUniqueName(VSP_ID, VERSION, COMPONENT_ID,
+            expected.getComputeCompositionData().getName());
+    doNothing().when(computeManager)
+        .createUniqueName(VSP_ID, VERSION, COMPONENT_ID,
+            expected.getComputeCompositionData().getName());
+    String questionnaireSchema = "{}";
+    doReturn(questionnaireSchema).when(computeManager).getComputeQuestionnaireSchema(anyObject());
+
+    computeManager.createCompute(expected);
+    verify(computeDao).create(expected);
+  }
+
+  @Test(expectedExceptions = CoreException.class)
+  public void testCreateManualComputeWithDuplicateName() {
+    ComputeEntity expected = createCompute(VSP_ID, VERSION, COMPONENT_ID, COMPUTE1_ID);
+    doReturn(true).when(vspInfoDao).isManual(anyObject(), anyObject());
+
+    doThrow(new CoreException(
+        new ErrorCode.ErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION).build()))
+        .when(computeManager).validateUniqueName(VSP_ID, VERSION, COMPONENT_ID,
+        expected.getComputeCompositionData().getName());
+
+    computeManager.createCompute(expected);
+  }
+
+  @Test
+  public void testUpdateNonExistingComputeId_negative() {
+    testUpdate_negative(VSP_ID, VERSION, COMPONENT_ID, COMPUTE1_ID,
+        VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
+  }
+
+  @Test
+  public void testUpdateCompute() {
+    ComputeEntity retrieved = createCompute(VSP_ID, VERSION, COMPONENT_ID, COMPUTE1_ID);
+    doReturn(retrieved).when(computeDao).get(anyObject());
+
+    doReturn(new CompositionEntityValidationData(CompositionEntityType.compute, COMPUTE1_ID))
+        .when(compositionEntityDataManagerMock)
+        .validateEntity(anyObject(), anyObject(), anyObject());
+
+    ComputeEntity computeEntity = new ComputeEntity(VSP_ID, VERSION, COMPONENT_ID, COMPUTE1_ID);
+    ComputeData computeData = new ComputeData();
+    computeData.setName(COMPUTE1_ID + "name");
+    computeData.setDescription(COMPUTE1_ID + "desc updated");
+    computeEntity.setComputeCompositionData(computeData);
+
+    doNothing().when(computeManager)
+        .updateUniqueName(VSP_ID, VERSION, COMPONENT_ID, retrieved.getComputeCompositionData().getName(),
+            computeData.getName());
+
+    CompositionEntityValidationData validationData =
+        computeManager.updateCompute(computeEntity);
+    Assert.assertTrue(validationData == null || validationData.getErrors() == null);
+    verify(computeDao).update(computeEntity);
+  }
+
+  @Test
+  public void testIllegalComputeUpdate() {
+    doReturn(createCompute(VSP_ID, VERSION, COMPONENT_ID, COMPUTE1_ID))
+        .when(computeDao).get(anyObject());
+
+    doReturn(true).when(vspInfoDao).isManual(anyObject(), anyObject());
+
+    CompositionEntityValidationData toBeReturned =
+        new CompositionEntityValidationData(CompositionEntityType.compute, COMPUTE1_ID);
+    toBeReturned.setErrors(Arrays.asList("error1", "error2"));
+    doReturn(toBeReturned)
+        .when(compositionEntityDataManagerMock)
+        .validateEntity(anyObject(), anyObject(), anyObject());
+
+    ComputeEntity computeEntity = new ComputeEntity(VSP_ID, VERSION, COMPONENT_ID, COMPUTE1_ID);
+    ComputeData computeData = new ComputeData();
+    computeData.setName(COMPUTE1_ID + "_name_updated");
+    computeData.setDescription(COMPUTE1_ID + " desc updated");
+    computeEntity.setComputeCompositionData(computeData);
+
+    CompositionEntityValidationData validationData =
+        computeManager.updateCompute(computeEntity);
+    Assert.assertNotNull(validationData);
+    Assert.assertEquals(validationData.getErrors().size(), 2);
+
+    verify(computeDao, never()).update(computeEntity);
+  }
+
+  @Test
+  public void testUpdateHEATComputeName() throws Exception {
+    doReturn(createCompute(VSP_ID, VERSION, COMPONENT_ID, COMPUTE1_ID))
+        .when(computeDao).get(anyObject());
+    ComputeEntity computeEntity = new ComputeEntity(VSP_ID, VERSION, COMPONENT_ID, COMPUTE1_ID);
+    ComputeData computeData = new ComputeData();
+    computeData.setName(COMPUTE1_ID + " name updated");
+    computeData.setDescription(COMPUTE1_ID + " desc updated");
+    computeEntity.setComputeCompositionData(computeData);
+
+    try {
+      computeManager.updateCompute(computeEntity);
+    } catch (CoreException ex) {
+      Assert
+          .assertEquals(ex.code().id(), VendorSoftwareProductErrorCodes.UPDATE_COMPUTE_NOT_ALLOWED);
     }
+  }
+
+  @Test
+  public void testUpdateManualComputeQuestionnaire() throws Exception {
+    String json = "{\"md5\" :\"FFDSD33SS\"}";
+    doReturn(true).when(vspInfoDao).isManual(anyObject(), anyObject());
+    doReturn(new ComputeEntity(null, null, null, null)).when(computeDao).get(anyObject());
+
+    computeManager
+        .updateComputeQuestionnaire(VSP_ID, VERSION, COMPONENT_ID, COMPUTE1_ID, json);
+    verify(computeDao).updateQuestionnaireData(VSP_ID, VERSION, COMPONENT_ID, COMPUTE1_ID, json);
+  }
+
+  @Test
+  public void testGetNonExistingComputeId_negative() {
+    testGet_negative(VSP_ID, VERSION, COMPONENT_ID, "non existing compute id",
+        VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
+  }
+
+  @Test
+  public void testGet() {
+    ComputeEntity expected = createCompute(VSP_ID, VERSION, COMPONENT_ID, COMPUTE1_ID);
+    doReturn(expected).when(computeDao).get(anyObject());
+    String compositionSchema = "schema string";
+    doReturn(compositionSchema).when(computeManager).getComputeCompositionSchema(anyObject());
+
+    CompositionEntityResponse<ComputeData> response =
+        computeManager.getCompute(VSP_ID, VERSION, COMPONENT_ID, COMPUTE1_ID);
+    Assert.assertEquals(response.getId(), expected.getId());
+    Assert
+        .assertEquals(response.getData().getName(), expected.getComputeCompositionData().getName());
+    Assert.assertEquals(response.getData().getDescription(), expected.getComputeCompositionData().
+        getDescription());
+    Assert.assertEquals(response.getSchema(), compositionSchema);
+  }
+
+  @Test
+  public void testGetQuestionnaire() throws Exception {
+    ComputeEntity compute = new ComputeEntity(VSP_ID, VERSION, COMPONENT_ID, COMPUTE1_ID);
+    compute.setQuestionnaireData("{}");
+    doReturn(compute).when(computeDao)
+        .getQuestionnaireData(VSP_ID, VERSION, COMPONENT_ID, COMPUTE1_ID);
+
+    String schema = "schema string";
+
+    doReturn(schema).when(computeManager).getComputeQuestionnaireSchema(anyObject());
+
+    QuestionnaireResponse questionnaire =
+        computeManager.getComputeQuestionnaire(VSP_ID, VERSION, COMPONENT_ID, COMPUTE1_ID);
+
+    Assert.assertNotNull(questionnaire);
+    Assert.assertEquals(questionnaire.getData(), compute.getQuestionnaireData());
+    Assert.assertEquals(questionnaire.getSchema(), schema);
+    Assert.assertNull(questionnaire.getErrorMessage());
+  }
+
+  @Test
+  public void testDeleteOnNotManualCompute() {
+    ComputeEntity expected = createCompute(VSP_ID, VERSION, COMPONENT_ID, COMPUTE1_ID);
+    doReturn(expected).when(computeDao).get(anyObject());
+    testDelete_negative(VSP_ID, VERSION, COMPONENT_ID, COMPUTE1_ID,
+        VendorSoftwareProductErrorCodes.VSP_COMPOSITION_EDIT_NOT_ALLOWED);
+  }
+
+  @Test
+  public void testDeleteOnManualCompute() {
+    ComputeEntity expected = createCompute(VSP_ID, VERSION, COMPONENT_ID, COMPUTE1_ID);
+    doReturn(expected).when(computeDao).get(anyObject());
+    doReturn(true).when(vspInfoDao).isManual(anyObject(), anyObject());
+    doNothing().when(computeManager).deleteUniqueValue(VSP_ID, VERSION, COMPONENT_ID,
+        expected.getComputeCompositionData().getName());
+
+    computeManager.deleteCompute(VSP_ID, VERSION, COMPONENT_ID, COMPUTE1_ID);
+    verify(computeDao).delete(anyObject());
+  }
+
+  @Test
+  public void testDeleteOnNotExistCompute() {
+    testDelete_negative(VSP_ID, VERSION, COMPONENT_ID, COMPUTE1_ID,
+        VendorSoftwareProductErrorCodes.VSP_COMPOSITION_EDIT_NOT_ALLOWED);
+  }
 
 
-
-    private void testUpdate_negative(String vspId, Version version, String componentId, String computeId,
-                                 String user, String expectedErrorCode) {
-  try {
-    computeManager.updateCompute(new ComputeEntity(vspId, version, componentId, computeId), user);
-    Assert.fail();
-  } catch (CoreException exception) {
-    log.debug("",exception);
+  private void testDelete_negative(String vspId, Version version, String componentId,
+                                   String computeId,
+                                   String expectedErrorCode) {
+    try {
+      computeManager.deleteCompute(vspId, version, componentId, computeId);
+      Assert.fail();
+    } catch (CoreException exception) {
       Assert.assertEquals(exception.code().id(), expectedErrorCode);
     }
   }
 
-  private void testCreate_negative(ComputeEntity computeEntity1, String user, String expectedErrorCode) {
-        try {
-            computeManager.createCompute(computeEntity1, user);
-            Assert.fail();
-        } catch (CoreException exception) {
-          log.debug("",exception);
-            Assert.assertEquals(exception.code().id(), expectedErrorCode);
-        }
+  private void testGet_negative(String vspId, Version version, String componentId, String computeId,
+                                String expectedErrorCode) {
+    try {
+      computeManager.getCompute(vspId, version, componentId, computeId);
+      Assert.fail();
+    } catch (CoreException exception) {
+      Assert.assertEquals(exception.code().id(), expectedErrorCode);
     }
+  }
 
-  static ComputeEntity createCompute(String vspId, Version version, String compId, String computeId){
-      ComputeEntity computeEntity1 = new ComputeEntity(vspId, version, compId, computeId);
-      ComputeData computeData = new ComputeData();
-      computeData.setName(computeId+"name");
-      computeData.setDescription(computeId+"desc");
-      computeEntity1.setComputeCompositionData(computeData);
-      return computeEntity1;
+  private void testList_negative(String vspId, Version version, String componentId,
+                                 String expectedErrorCode, String expectedErrorMsg) {
+    try {
+      computeManager.listComputes(vspId, version, componentId);
+      Assert.fail();
+    } catch (CoreException exception) {
+      Assert.assertEquals(exception.code().id(), expectedErrorCode);
+      Assert.assertEquals(exception.getMessage(), expectedErrorMsg);
+    }
+  }
+
+
+  private void testUpdate_negative(String vspId, Version version, String componentId,
+                                   String computeId, String expectedErrorCode) {
+    try {
+      computeManager.updateCompute(new ComputeEntity(vspId, version, componentId, computeId));
+      Assert.fail();
+    } catch (CoreException exception) {
+      Assert.assertEquals(exception.code().id(), expectedErrorCode);
+    }
+  }
+
+  private void testCreate_negative(ComputeEntity computeEntity1, String expectedErrorCode) {
+    try {
+      computeManager.createCompute(computeEntity1);
+      Assert.fail();
+    } catch (CoreException exception) {
+      Assert.assertEquals(exception.code().id(), expectedErrorCode);
+    }
+  }
+
+  private static ComputeEntity createCompute(String vspId, Version version, String compId,
+                                             String computeId) {
+    ComputeEntity computeEntity1 = new ComputeEntity(vspId, version, compId, computeId);
+    ComputeData computeData = new ComputeData();
+    computeData.setName(computeId + "name");
+    computeData.setDescription(computeId + "desc");
+    computeEntity1.setComputeCompositionData(computeData);
+    return computeEntity1;
   }
 }
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/DeplomentFlavorManagerImplTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/DeplomentFlavorManagerImplTest.java
deleted file mode 100644
index 598b97b..0000000
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/DeplomentFlavorManagerImplTest.java
+++ /dev/null
@@ -1,463 +0,0 @@
-package org.openecomp.sdc.vendorsoftwareproduct.impl;
-
-
-import static org.mockito.Matchers.anyObject;
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.verify;
-
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-import org.mockito.Spy;
-import org.openecomp.core.utilities.json.JsonUtil;
-import org.openecomp.sdc.common.errors.CoreException;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDao;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.ComputeDao;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.DeploymentFlavorDao;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDao;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComputeEntity;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.DeploymentFlavorEntity;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
-import org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes;
-import org.openecomp.sdc.vendorsoftwareproduct.services.composition.CompositionEntityDataManager;
-import org.openecomp.sdc.vendorsoftwareproduct.types.CompositionEntityResponse;
-import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentComputeAssociation;
-import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityType;
-import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityValidationData;
-import org.openecomp.sdc.vendorsoftwareproduct.types.composition.DeploymentFlavor;
-import org.openecomp.sdc.versioning.dao.types.Version;
-import org.openecomp.sdc.versioning.errors.VersioningErrorCodes;
-import org.testng.Assert;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.List;
-
-public class DeplomentFlavorManagerImplTest {
-  private static final String USER = "depFlavorTestUser";
-  private static final String VSP_ID = "VSP_ID";
-  private static final Version VERSION = new Version(0, 1);
-  private static final String COMPONENT_ID = "COMPONENT_ID";
-  private static final String DF1_ID = "df1";
-  private static final String DF2_ID = "df2";
-
-  @Mock
-  private CompositionEntityDataManager compositionEntityDataManagerMock;
-  @Mock
-  private VendorSoftwareProductInfoDao vspInfoDao;
-  @Mock
-  DeploymentFlavorDao deploymentFlavorDaoMock;
-  @Mock
-  ComponentDao componentDaoMock;
-  @Mock
-  ComputeDao computeDaoMock;
-  @InjectMocks
-  @Spy
-  private DeploymentFlavorManagerImpl deploymentFlavorManager;
-
-  @BeforeMethod
-  public void setUp() throws Exception {
-    MockitoAnnotations.initMocks(this);
-  }
-
-  @Test
-  public void testListWhenNone() {
-    final Collection<DeploymentFlavorEntity> deploymentFlavorEntities =
-        deploymentFlavorManager.listDeploymentFlavors(VSP_ID, VERSION,  USER);
-    Assert.assertEquals(deploymentFlavorEntities.size(), 0);
-  }
-
-  @Test
-  public void testCreateOnNotManual_negative() {
-
-    testCreate_negative(new DeploymentFlavorEntity(VSP_ID, VERSION,  null), USER,
-        VendorSoftwareProductErrorCodes.CREATE_DEPLOYMENT_FLAVOR_NOT_ALLOWED_IN_HEAT_ONBOARDING);
-  }
-
-  @Test
-  public void testCreateManualDepFlavor() {
-    DeploymentFlavorEntity expected = createDeploymentFlavor(VSP_ID, VERSION,  DF1_ID);
-    doReturn(true).when(vspInfoDao).isManual(anyObject(), anyObject());
-
-    VspDetails vspDetails = new VspDetails(VSP_ID, VERSION);
-    doReturn(vspDetails).when(vspInfoDao).get(anyObject());
-
-    deploymentFlavorManager.createDeploymentFlavor(expected, USER);
-    verify(compositionEntityDataManagerMock).createDeploymentFlavor(expected);
-  }
-
-  @Test
-  public void testCreateManualDepFlavorWithDuplicateName() {
-    DeploymentFlavorEntity expected = createDeploymentFlavor(VSP_ID, VERSION, DF1_ID);
-    doReturn(true).when(vspInfoDao).isManual(anyObject(), anyObject());
-
-    DeploymentFlavorEntity expectedDiffName = createDeploymentFlavor(VSP_ID, VERSION, DF1_ID);
-    DeploymentFlavor deploymentFlavor = expectedDiffName.getDeploymentFlavorCompositionData();
-    deploymentFlavor.setModel(DF1_ID + "Name");
-    expectedDiffName.setDeploymentFlavorCompositionData(deploymentFlavor);
-    List<DeploymentFlavorEntity> list = new ArrayList<DeploymentFlavorEntity>();
-    list.add(expectedDiffName);
-    doReturn(list).when(deploymentFlavorDaoMock).list(anyObject());
-
-    try {
-      deploymentFlavorManager.createDeploymentFlavor(expected, USER);
-      Assert.fail();
-    }
-    catch (CoreException ex) {
-      Assert.assertEquals(VendorSoftwareProductErrorCodes.DUPLICATE_DEPLOYMENT_FLAVOR_MODEL_NOT_ALLOWED,
-          ex.code().id());
-    }
-  }
-
-  @Test
-  public void testCreateManualDepFlavorWithIncorrectNameFormat() {
-    DeploymentFlavorEntity expected = createDeploymentFlavor(VSP_ID, VERSION, DF1_ID);
-    doReturn(true).when(vspInfoDao).isManual(anyObject(), anyObject());
-
-    DeploymentFlavorEntity expectedDiffName = createDeploymentFlavor(VSP_ID, VERSION, DF1_ID);
-    DeploymentFlavor deploymentFlavor = expectedDiffName.getDeploymentFlavorCompositionData();
-    deploymentFlavor.setModel(DF1_ID + "Name/*");
-    expectedDiffName.setDeploymentFlavorCompositionData(deploymentFlavor);
-    List<DeploymentFlavorEntity> list = new ArrayList<DeploymentFlavorEntity>();
-    list.add(expectedDiffName);
-    doReturn(list).when(deploymentFlavorDaoMock).list(anyObject());
-
-    try {
-      deploymentFlavorManager.createDeploymentFlavor(expectedDiffName, USER);
-      Assert.fail();
-    }
-    catch (CoreException ex) {
-      Assert.assertEquals(VendorSoftwareProductErrorCodes.DEPLOYMENT_FLAVOR_NAME_FORMAT_NOT_ALLOWED,
-              ex.code().id());
-    }
-  }
-  @Test
-  public void testCreateManualDepFlavorWithFGNotInVSP() {
-    DeploymentFlavorEntity expected = createDeploymentFlavor(VSP_ID, VERSION, DF1_ID);
-    final DeploymentFlavor deploymentFlavor =
-        JsonUtil.json2Object(expected.getCompositionData(), DeploymentFlavor.class);
-    deploymentFlavor.setFeatureGroupId("fg3");
-    expected.setCompositionData(JsonUtil.object2Json(deploymentFlavor));
-
-    doReturn(true).when(vspInfoDao).isManual(anyObject(), anyObject());
-
-    List<String> featureGrps = new ArrayList<String>();
-    featureGrps.add("fg1");
-    featureGrps.add("fg2");
-
-    VspDetails vspDetails = new VspDetails(VSP_ID, VERSION);
-    vspDetails.setFeatureGroups(featureGrps);
-    doReturn(vspDetails).when(vspInfoDao).get(anyObject());
-
-
-    try {
-      deploymentFlavorManager.createDeploymentFlavor(expected, USER);
-      Assert.fail();
-    }
-    catch (CoreException ex) {
-      Assert.assertEquals(VendorSoftwareProductErrorCodes.FEATURE_GROUP_NOT_EXIST_FOR_VSP,
-          ex.code().id());
-    }
-  }
-
-  @Test
-  public void testCreateManualDepFlavorWithNullCompInAssociation() {
-    DeploymentFlavorEntity expected = createDeploymentFlavor(VSP_ID, VERSION,  DF1_ID);
-    final DeploymentFlavor deploymentFlavor =
-        JsonUtil.json2Object(expected.getCompositionData(), DeploymentFlavor.class);
-    ComponentComputeAssociation association = new ComponentComputeAssociation();
-    association.setComponentId(null);
-    association.setComputeFlavorId("CF1");
-    List<ComponentComputeAssociation> list = new ArrayList<ComponentComputeAssociation>();
-    list.add(association);
-    deploymentFlavor.setComponentComputeAssociations(list);
-    expected.setCompositionData(JsonUtil.object2Json(deploymentFlavor));
-
-    doReturn(true).when(vspInfoDao).isManual(anyObject(), anyObject());
-
-    VspDetails vspDetails = new VspDetails(VSP_ID, VERSION);
-    doReturn(vspDetails).when(vspInfoDao).get(anyObject());
-
-    try {
-      deploymentFlavorManager.createDeploymentFlavor(expected, USER);
-    }
-    catch (CoreException ex) {
-      Assert.assertEquals(VendorSoftwareProductErrorCodes.INVALID_COMPONENT_COMPUTE_ASSOCIATION,
-          ex.code().id());
-      Assert.assertEquals("Invalid request,for valid association please provide ComponentId for Compute Flavor",
-          ex.getMessage());
-    }
-  }
-
-  @Test
-  public void testCreateManualDepFlavorWithInvalidComputeInAssociation() {
-    DeploymentFlavorEntity expected = createDeploymentFlavor(VSP_ID, VERSION,  DF1_ID);
-    final DeploymentFlavor deploymentFlavor =
-        JsonUtil.json2Object(expected.getCompositionData(), DeploymentFlavor.class);
-    ComponentComputeAssociation association = new ComponentComputeAssociation();
-    association.setComponentId(COMPONENT_ID);
-    association.setComputeFlavorId("CF1");
-    List<ComponentComputeAssociation> list = new ArrayList<ComponentComputeAssociation>();
-    list.add(association);
-    deploymentFlavor.setComponentComputeAssociations(list);
-    expected.setCompositionData(JsonUtil.object2Json(deploymentFlavor));
-
-    doReturn(true).when(vspInfoDao).isManual(anyObject(), anyObject());
-
-    VspDetails vspDetails = new VspDetails(VSP_ID, VERSION);
-    doReturn(vspDetails).when(vspInfoDao).get(anyObject());
-
-    ComponentEntity component = new ComponentEntity(VSP_ID, VERSION, USER);
-    doReturn(component).when(componentDaoMock).get(anyObject());
-
-    doReturn(null).when(computeDaoMock).get(anyObject());
-
-    try {
-      deploymentFlavorManager.createDeploymentFlavor(expected, USER);
-    }
-    catch (CoreException ex) {
-      Assert.assertEquals(VendorSoftwareProductErrorCodes.INVALID_COMPUTE_FLAVOR_ID,
-          ex.code().id());
-    }
-  }
-
-  @Test
-  public void testCreateManualDepFlavorWithDuplicateVfcAssociation() {
-    DeploymentFlavorEntity expected = createDeploymentFlavor(VSP_ID, VERSION,  DF1_ID);
-    final DeploymentFlavor deploymentFlavor =
-        JsonUtil.json2Object(expected.getCompositionData(), DeploymentFlavor.class);
-    ComponentComputeAssociation association = new ComponentComputeAssociation();
-    association.setComponentId(COMPONENT_ID);
-    association.setComputeFlavorId("CF1");
-    List<ComponentComputeAssociation> list = new ArrayList<ComponentComputeAssociation>();
-    list.add(association);
-    list.add(association);
-    deploymentFlavor.setComponentComputeAssociations(list);
-    expected.setCompositionData(JsonUtil.object2Json(deploymentFlavor));
-
-    doReturn(true).when(vspInfoDao).isManual(anyObject(), anyObject());
-
-    VspDetails vspDetails = new VspDetails(VSP_ID, VERSION);
-    doReturn(vspDetails).when(vspInfoDao).get(anyObject());
-
-    ComponentEntity component = new ComponentEntity(VSP_ID, VERSION, USER);
-    doReturn(component).when(componentDaoMock).get(anyObject());
-
-    ComputeEntity computeEntity = new ComputeEntity(VSP_ID, VERSION, COMPONENT_ID, "CF1");
-    doReturn(computeEntity).when(computeDaoMock).get(anyObject());
-
-    try {
-      deploymentFlavorManager.createDeploymentFlavor(expected, USER);
-    }
-    catch (CoreException ex) {
-      Assert.assertEquals(VendorSoftwareProductErrorCodes.SAME_VFC_ASSOCIATION_MORE_THAN_ONCE_NOT_ALLOWED,
-          ex.code().id());
-    }
-  }
-
-  @Test
-  public void testList() {
-
-    doReturn(Arrays.asList(
-        createDeploymentFlavor(VSP_ID, VERSION,  DF1_ID),
-        createDeploymentFlavor(VSP_ID, VERSION,  DF2_ID)))
-        .when(deploymentFlavorDaoMock).list(anyObject());
-
-
-    final Collection<DeploymentFlavorEntity> deploymentFlavorEntities =
-        deploymentFlavorManager.listDeploymentFlavors(VSP_ID, VERSION,  USER);
-    Assert.assertEquals(deploymentFlavorEntities.size(), 2);
-    for (DeploymentFlavorEntity deploymentFlavorEntity : deploymentFlavorEntities) {
-      Assert.assertEquals(deploymentFlavorEntity.getDeploymentFlavorCompositionData().getModel()
-          , DF1_ID.equals(deploymentFlavorEntity.getId()) ? DF1_ID+"name" : DF2_ID+"name" );
-    }
-  }
-
-  @Test
-  public void testUpdateHeatDepFlavor() {
-    testUpdate_negative(VSP_ID, VERSION, DF1_ID, USER,
-        VendorSoftwareProductErrorCodes.EDIT_DEPLOYMENT_FLAVOR_NOT_ALLOWED_IN_HEAT_ONBOARDING);
-  }
-
-  @Test
-  public void testUpdateNonExistingManualDepFlavorId_negative() {
-    doReturn(true).when(vspInfoDao).isManual(anyObject(), anyObject());
-    testUpdate_negative(VSP_ID, VERSION, DF1_ID, USER,
-        VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
-  }
-
-  @Test
-  public void testManualUpdateDepFlavor() {
-    doReturn(true).when(vspInfoDao).isManual(anyObject(), anyObject());
-
-    doReturn(createDeploymentFlavor(VSP_ID, VERSION, DF1_ID))
-        .when(deploymentFlavorDaoMock).get(anyObject());
-
-    doReturn(new CompositionEntityValidationData(CompositionEntityType.image, DF1_ID))
-        .when(compositionEntityDataManagerMock)
-        .validateEntity(anyObject(), anyObject(), anyObject());
-
-    VspDetails vspDetails = new VspDetails(VSP_ID, VERSION);
-    doReturn(vspDetails).when(vspInfoDao).get(anyObject());
-
-    DeploymentFlavorEntity deploymentFlavorEntity = new DeploymentFlavorEntity(VSP_ID, VERSION, DF1_ID);
-    DeploymentFlavor deploymentFlavor = new DeploymentFlavor();
-    deploymentFlavor.setModel(DF1_ID + "_name");
-    deploymentFlavor.setDescription(DF1_ID + " desc updated");
-    deploymentFlavorEntity.setDeploymentFlavorCompositionData(deploymentFlavor);
-
-    CompositionEntityValidationData validationData =
-        deploymentFlavorManager.updateDeploymentFlavor(deploymentFlavorEntity, USER);
-    Assert.assertTrue(validationData == null || validationData.getErrors() == null);
-    verify(deploymentFlavorDaoMock).update(deploymentFlavorEntity);
-  }
-
-    @Test
-    public void testManualUpdateDepFlavorIncorrectNameFormat() {
-        doReturn(true).when(vspInfoDao).isManual(anyObject(), anyObject());
-
-        doReturn(createDeploymentFlavor(VSP_ID, VERSION, DF1_ID))
-                .when(deploymentFlavorDaoMock).get(anyObject());
-
-        doReturn(new CompositionEntityValidationData(CompositionEntityType.image, DF1_ID))
-                .when(compositionEntityDataManagerMock)
-                .validateEntity(anyObject(), anyObject(), anyObject());
-
-        VspDetails vspDetails = new VspDetails(VSP_ID, VERSION);
-        doReturn(vspDetails).when(vspInfoDao).get(anyObject());
-
-        DeploymentFlavorEntity deploymentFlavorEntity = new DeploymentFlavorEntity(VSP_ID, VERSION, DF1_ID);
-        DeploymentFlavor deploymentFlavor = new DeploymentFlavor();
-        deploymentFlavor.setModel(DF1_ID + "_name/*");
-        deploymentFlavor.setDescription(DF1_ID + " desc updated");
-        deploymentFlavorEntity.setDeploymentFlavorCompositionData(deploymentFlavor);
-
-        try {
-            deploymentFlavorManager.updateDeploymentFlavor(deploymentFlavorEntity, USER);
-            Assert.fail();
-        }
-        catch (CoreException ex) {
-            Assert.assertEquals(VendorSoftwareProductErrorCodes.DEPLOYMENT_FLAVOR_NAME_FORMAT_NOT_ALLOWED,
-                    ex.code().id());
-        }
-    }
-
-  @Test
-  public void testGetNonExistingDepFlavorId_negative() {
-    testGet_negative(VSP_ID, VERSION, "non existing image id", USER,
-        VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
-  }
-
-  @Test
-  public void testGet() {
-    DeploymentFlavorEntity expected = createDeploymentFlavor(VSP_ID, VERSION, DF1_ID);
-    doReturn(expected).when(deploymentFlavorDaoMock).get(anyObject());
-
-    VspDetails vspDetails = new VspDetails(VSP_ID, VERSION);
-    doReturn(vspDetails).when(vspInfoDao).get(anyObject());
-
-    CompositionEntityResponse<DeploymentFlavor> response =
-        deploymentFlavorManager.getDeploymentFlavor(VSP_ID, VERSION, DF1_ID, USER);
-    Assert.assertEquals(response.getId(), expected.getId());
-    Assert.assertEquals(response.getData().getModel(), expected.getDeploymentFlavorCompositionData().
-        getModel());
-    Assert.assertEquals(response.getData().getDescription(), expected.getDeploymentFlavorCompositionData().
-        getDescription());
-  }
-
-  @Test
-  public void testDeleteDepFlavorOnHEAT() {
-    DeploymentFlavorEntity expected = createDeploymentFlavor(VSP_ID, VERSION, DF1_ID);
-    doReturn(expected).when(deploymentFlavorDaoMock).get(anyObject());
-    testDelete_negative(VSP_ID, VERSION,  DF1_ID, USER,
-        VendorSoftwareProductErrorCodes.DELETE_DEPLOYMENT_FLAVOR_NOT_ALLOWED_IN_HEAT_ONBOARDING);
-  }
-
-  @Test
-  public void testDeleteOnNotExistImage() {
-    testDelete_negative(VSP_ID, VERSION,  DF1_ID, USER,
-        VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
-  }
-
-  @Test
-  public void testDeleteOnManualImage() {
-    DeploymentFlavorEntity expected = createDeploymentFlavor(VSP_ID, VERSION, DF1_ID);
-    doReturn(expected).when(deploymentFlavorDaoMock).get(anyObject());
-    doReturn(true).when(vspInfoDao).isManual(anyObject(), anyObject());
-    deploymentFlavorManager.deleteDeploymentFlavor(VSP_ID, VERSION, DF1_ID, USER);
-    verify(deploymentFlavorDaoMock).delete(anyObject());
-  }
-
-  private void testList_negative(String vspId, Version version, String componentId, String user,
-                                 String expectedErrorCode, String expectedErrorMsg) {
-    try {
-      deploymentFlavorManager.listDeploymentFlavors(vspId, version, user);
-      Assert.fail();
-    } catch (CoreException exception) {
-      Assert.assertEquals(exception.code().id(), expectedErrorCode);
-      Assert.assertEquals(exception.getMessage(), expectedErrorMsg);
-    }
-  }
-
-  private void testCreate_negative(DeploymentFlavorEntity deploymentFlavorEntity, String user, String
-      expectedErrorCode) {
-    try {
-      deploymentFlavorManager.createDeploymentFlavor(deploymentFlavorEntity, user);
-      Assert.fail();
-    } catch (CoreException exception) {
-      Assert.assertEquals(exception.code().id(), expectedErrorCode);
-    }
-  }
-
-  private void testDelete_negative(String vspId, Version version, String deploymentFlavorId,
-                                   String user,
-                                   String expectedErrorCode) {
-    try {
-      deploymentFlavorManager.deleteDeploymentFlavor(vspId, version, deploymentFlavorId, user);
-      Assert.fail();
-    } catch (CoreException exception) {
-      Assert.assertEquals(exception.code().id(), expectedErrorCode);
-    }
-  }
-
-  static DeploymentFlavorEntity createDeploymentFlavor(String vspId, Version version, String deploymentFlavorId) {
-
-    DeploymentFlavorEntity deploymentFlavorEntity = new DeploymentFlavorEntity(vspId, version, deploymentFlavorId);
-    DeploymentFlavor deploymentFlavor = new DeploymentFlavor();
-    deploymentFlavor.setModel(deploymentFlavorId + "name");
-    deploymentFlavor.setDescription(deploymentFlavorId + " desc");
-
-    deploymentFlavorEntity.setDeploymentFlavorCompositionData(deploymentFlavor);
-    return deploymentFlavorEntity;
-  }
-
-  private void testUpdate_negative(String vspId, Version version, String
-      deploymentFlavorId, String user, String expectedErrorCode) {
-    try {
-      DeploymentFlavorEntity deploymentFlavorEntity = new DeploymentFlavorEntity(vspId, version, deploymentFlavorId);
-      DeploymentFlavor deploymentFlavor = new DeploymentFlavor();
-      deploymentFlavor.setModel("Name");
-      deploymentFlavorEntity.setDeploymentFlavorCompositionData(deploymentFlavor);
-      deploymentFlavorManager
-          .updateDeploymentFlavor(deploymentFlavorEntity, user);
-      Assert.fail();
-    } catch (CoreException exception) {
-      Assert.assertEquals(exception.code().id(), expectedErrorCode);
-    }
-  }
-
-  private void testGet_negative(String vspId, Version version, String deploymentFlavorId,
-                                String user, String expectedErrorCode) {
-    try {
-      deploymentFlavorManager.getDeploymentFlavor(vspId, version, deploymentFlavorId, user);
-      Assert.fail();
-    } catch (CoreException exception) {
-      Assert.assertEquals(exception.code().id(), expectedErrorCode);
-    }
-  }
-
-}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/DeploymentFlavorManagerImplTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/DeploymentFlavorManagerImplTest.java
index 82715d3..6a5e7fa 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/DeploymentFlavorManagerImplTest.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/DeploymentFlavorManagerImplTest.java
@@ -1,18 +1,12 @@
 package org.openecomp.sdc.vendorsoftwareproduct.impl;
 
 
-import static org.mockito.Matchers.anyObject;
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.verify;
-
 import org.mockito.InjectMocks;
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
 import org.mockito.Spy;
 import org.openecomp.core.utilities.json.JsonUtil;
 import org.openecomp.sdc.common.errors.CoreException;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDao;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.ComputeDao;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.DeploymentFlavorDao;
@@ -23,7 +17,6 @@
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
 import org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes;
 import org.openecomp.sdc.vendorsoftwareproduct.services.composition.CompositionEntityDataManager;
-import org.openecomp.sdc.vendorsoftwareproduct.types.CompositionEntityResponse;
 import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentComputeAssociation;
 import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityType;
 import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityValidationData;
@@ -39,13 +32,13 @@
 import java.util.Collection;
 import java.util.List;
 
+import static org.mockito.Matchers.anyObject;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.verify;
+
 public class DeploymentFlavorManagerImplTest {
-
-  private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName());
-
-  private static final String USER = "depFlavorTestUser";
   private static final String VSP_ID = "VSP_ID";
-  private static final Version VERSION = new Version(0, 1);
+  private static final Version VERSION = new Version("version_id");
   private static final String COMPONENT_ID = "COMPONENT_ID";
   private static final String DF1_ID = "df1";
   private static final String DF2_ID = "df2";
@@ -55,11 +48,11 @@
   @Mock
   private VendorSoftwareProductInfoDao vspInfoDao;
   @Mock
-  DeploymentFlavorDao deploymentFlavorDaoMock;
+  private DeploymentFlavorDao deploymentFlavorDaoMock;
   @Mock
-  ComponentDao componentDaoMock;
+  private ComponentDao componentDaoMock;
   @Mock
-  ComputeDao computeDaoMock;
+  private ComputeDao computeDaoMock;
   @InjectMocks
   @Spy
   private DeploymentFlavorManagerImpl deploymentFlavorManager;
@@ -72,26 +65,26 @@
   @Test
   public void testListWhenNone() {
     final Collection<DeploymentFlavorEntity> deploymentFlavorEntities =
-        deploymentFlavorManager.listDeploymentFlavors(VSP_ID, VERSION,  USER);
+        deploymentFlavorManager.listDeploymentFlavors(VSP_ID, VERSION);
     Assert.assertEquals(deploymentFlavorEntities.size(), 0);
   }
 
   @Test
   public void testCreateOnNotManual_negative() {
 
-    testCreate_negative(new DeploymentFlavorEntity(VSP_ID, VERSION,  null), USER,
+    testCreate_negative(new DeploymentFlavorEntity(VSP_ID, VERSION, null),
         VendorSoftwareProductErrorCodes.CREATE_DEPLOYMENT_FLAVOR_NOT_ALLOWED_IN_HEAT_ONBOARDING);
   }
 
   @Test
   public void testCreateManualDepFlavor() {
-    DeploymentFlavorEntity expected = createDeploymentFlavor(VSP_ID, VERSION,  DF1_ID);
+    DeploymentFlavorEntity expected = createDeploymentFlavor(VSP_ID, VERSION, DF1_ID);
     doReturn(true).when(vspInfoDao).isManual(anyObject(), anyObject());
 
     VspDetails vspDetails = new VspDetails(VSP_ID, VERSION);
     doReturn(vspDetails).when(vspInfoDao).get(anyObject());
 
-    deploymentFlavorManager.createDeploymentFlavor(expected, USER);
+    deploymentFlavorManager.createDeploymentFlavor(expected);
     verify(compositionEntityDataManagerMock).createDeploymentFlavor(expected);
   }
 
@@ -104,17 +97,16 @@
     DeploymentFlavor deploymentFlavor = expectedDiffName.getDeploymentFlavorCompositionData();
     deploymentFlavor.setModel(DF1_ID + "Name");
     expectedDiffName.setDeploymentFlavorCompositionData(deploymentFlavor);
-    List<DeploymentFlavorEntity> list = new ArrayList<DeploymentFlavorEntity>();
+    List<DeploymentFlavorEntity> list = new ArrayList<>();
     list.add(expectedDiffName);
     doReturn(list).when(deploymentFlavorDaoMock).list(anyObject());
 
     try {
-      deploymentFlavorManager.createDeploymentFlavor(expected, USER);
+      deploymentFlavorManager.createDeploymentFlavor(expected);
       Assert.fail();
-    }
-    catch (CoreException ex) {
-      log.debug("",ex);
-      Assert.assertEquals(VendorSoftwareProductErrorCodes.DUPLICATE_DEPLOYMENT_FLAVOR_MODEL_NOT_ALLOWED,
+    } catch (CoreException ex) {
+      Assert.assertEquals(
+          VendorSoftwareProductErrorCodes.DUPLICATE_DEPLOYMENT_FLAVOR_MODEL_NOT_ALLOWED,
           ex.code().id());
     }
   }
@@ -129,7 +121,7 @@
 
     doReturn(true).when(vspInfoDao).isManual(anyObject(), anyObject());
 
-    List<String> featureGrps = new ArrayList<String>();
+    List<String> featureGrps = new ArrayList<>();
     featureGrps.add("fg1");
     featureGrps.add("fg2");
 
@@ -139,11 +131,9 @@
 
 
     try {
-      deploymentFlavorManager.createDeploymentFlavor(expected, USER);
+      deploymentFlavorManager.createDeploymentFlavor(expected);
       Assert.fail();
-    }
-    catch (CoreException ex) {
-      log.debug("",ex);
+    } catch (CoreException ex) {
       Assert.assertEquals(VendorSoftwareProductErrorCodes.FEATURE_GROUP_NOT_EXIST_FOR_VSP,
           ex.code().id());
     }
@@ -151,13 +141,13 @@
 
   @Test
   public void testCreateManualDepFlavorWithNullCompInAssociation() {
-    DeploymentFlavorEntity expected = createDeploymentFlavor(VSP_ID, VERSION,  DF1_ID);
+    DeploymentFlavorEntity expected = createDeploymentFlavor(VSP_ID, VERSION, DF1_ID);
     final DeploymentFlavor deploymentFlavor =
         JsonUtil.json2Object(expected.getCompositionData(), DeploymentFlavor.class);
     ComponentComputeAssociation association = new ComponentComputeAssociation();
     association.setComponentId(null);
     association.setComputeFlavorId("CF1");
-    List<ComponentComputeAssociation> list = new ArrayList<ComponentComputeAssociation>();
+    List<ComponentComputeAssociation> list = new ArrayList<>();
     list.add(association);
     deploymentFlavor.setComponentComputeAssociations(list);
     expected.setCompositionData(JsonUtil.object2Json(deploymentFlavor));
@@ -168,26 +158,25 @@
     doReturn(vspDetails).when(vspInfoDao).get(anyObject());
 
     try {
-      deploymentFlavorManager.createDeploymentFlavor(expected, USER);
-    }
-    catch (CoreException ex) {
-      log.debug("",ex);
+      deploymentFlavorManager.createDeploymentFlavor(expected);
+    } catch (CoreException ex) {
       Assert.assertEquals(VendorSoftwareProductErrorCodes.INVALID_COMPONENT_COMPUTE_ASSOCIATION,
           ex.code().id());
-      Assert.assertEquals("Invalid request,for valid association please provide ComponentId for Compute Flavor",
+      Assert.assertEquals(
+          "Invalid request,for valid association please provide ComponentId for Compute Flavor",
           ex.getMessage());
     }
   }
 
   @Test
   public void testCreateManualDepFlavorWithInvalidComputeInAssociation() {
-    DeploymentFlavorEntity expected = createDeploymentFlavor(VSP_ID, VERSION,  DF1_ID);
+    DeploymentFlavorEntity expected = createDeploymentFlavor(VSP_ID, VERSION, DF1_ID);
     final DeploymentFlavor deploymentFlavor =
         JsonUtil.json2Object(expected.getCompositionData(), DeploymentFlavor.class);
     ComponentComputeAssociation association = new ComponentComputeAssociation();
     association.setComponentId(COMPONENT_ID);
     association.setComputeFlavorId("CF1");
-    List<ComponentComputeAssociation> list = new ArrayList<ComponentComputeAssociation>();
+    List<ComponentComputeAssociation> list = new ArrayList<>();
     list.add(association);
     deploymentFlavor.setComponentComputeAssociations(list);
     expected.setCompositionData(JsonUtil.object2Json(deploymentFlavor));
@@ -197,16 +186,14 @@
     VspDetails vspDetails = new VspDetails(VSP_ID, VERSION);
     doReturn(vspDetails).when(vspInfoDao).get(anyObject());
 
-    ComponentEntity component = new ComponentEntity(VSP_ID, VERSION, USER);
+    ComponentEntity component = new ComponentEntity(VSP_ID, VERSION, null);
     doReturn(component).when(componentDaoMock).get(anyObject());
 
     doReturn(null).when(computeDaoMock).get(anyObject());
 
     try {
-      deploymentFlavorManager.createDeploymentFlavor(expected, USER);
-    }
-    catch (CoreException ex) {
-      log.debug("",ex);
+      deploymentFlavorManager.createDeploymentFlavor(expected);
+    } catch (CoreException ex) {
       Assert.assertEquals(VendorSoftwareProductErrorCodes.INVALID_COMPUTE_FLAVOR_ID,
           ex.code().id());
     }
@@ -214,13 +201,13 @@
 
   @Test
   public void testCreateManualDepFlavorWithDuplicateVfcAssociation() {
-    DeploymentFlavorEntity expected = createDeploymentFlavor(VSP_ID, VERSION,  DF1_ID);
+    DeploymentFlavorEntity expected = createDeploymentFlavor(VSP_ID, VERSION, DF1_ID);
     final DeploymentFlavor deploymentFlavor =
         JsonUtil.json2Object(expected.getCompositionData(), DeploymentFlavor.class);
     ComponentComputeAssociation association = new ComponentComputeAssociation();
     association.setComponentId(COMPONENT_ID);
     association.setComputeFlavorId("CF1");
-    List<ComponentComputeAssociation> list = new ArrayList<ComponentComputeAssociation>();
+    List<ComponentComputeAssociation> list = new ArrayList<>();
     list.add(association);
     list.add(association);
     deploymentFlavor.setComponentComputeAssociations(list);
@@ -231,18 +218,17 @@
     VspDetails vspDetails = new VspDetails(VSP_ID, VERSION);
     doReturn(vspDetails).when(vspInfoDao).get(anyObject());
 
-    ComponentEntity component = new ComponentEntity(VSP_ID, VERSION, USER);
+    ComponentEntity component = new ComponentEntity(VSP_ID, VERSION, null);
     doReturn(component).when(componentDaoMock).get(anyObject());
 
     ComputeEntity computeEntity = new ComputeEntity(VSP_ID, VERSION, COMPONENT_ID, "CF1");
     doReturn(computeEntity).when(computeDaoMock).get(anyObject());
 
     try {
-      deploymentFlavorManager.createDeploymentFlavor(expected, USER);
-    }
-    catch (CoreException ex) {
-      log.debug("",ex);
-      Assert.assertEquals(VendorSoftwareProductErrorCodes.SAME_VFC_ASSOCIATION_MORE_THAN_ONCE_NOT_ALLOWED,
+      deploymentFlavorManager.createDeploymentFlavor(expected);
+    } catch (CoreException ex) {
+      Assert.assertEquals(
+          VendorSoftwareProductErrorCodes.SAME_VFC_ASSOCIATION_MORE_THAN_ONCE_NOT_ALLOWED,
           ex.code().id());
     }
   }
@@ -251,30 +237,30 @@
   public void testList() {
 
     doReturn(Arrays.asList(
-        createDeploymentFlavor(VSP_ID, VERSION,  DF1_ID),
-        createDeploymentFlavor(VSP_ID, VERSION,  DF2_ID)))
+        createDeploymentFlavor(VSP_ID, VERSION, DF1_ID),
+        createDeploymentFlavor(VSP_ID, VERSION, DF2_ID)))
         .when(deploymentFlavorDaoMock).list(anyObject());
 
 
     final Collection<DeploymentFlavorEntity> deploymentFlavorEntities =
-        deploymentFlavorManager.listDeploymentFlavors(VSP_ID, VERSION,  USER);
+        deploymentFlavorManager.listDeploymentFlavors(VSP_ID, VERSION);
     Assert.assertEquals(deploymentFlavorEntities.size(), 2);
     for (DeploymentFlavorEntity deploymentFlavorEntity : deploymentFlavorEntities) {
       Assert.assertEquals(deploymentFlavorEntity.getDeploymentFlavorCompositionData().getModel()
-          , DF1_ID.equals(deploymentFlavorEntity.getId()) ? DF1_ID+"name" : DF2_ID+"name" );
+          , DF1_ID.equals(deploymentFlavorEntity.getId()) ? DF1_ID + "name" : DF2_ID + "name");
     }
   }
 
   @Test
   public void testUpdateHeatDepFlavor() {
-    testUpdate_negative(VSP_ID, VERSION, DF1_ID, USER,
+    testUpdate_negative(VSP_ID, VERSION, DF1_ID,
         VendorSoftwareProductErrorCodes.EDIT_DEPLOYMENT_FLAVOR_NOT_ALLOWED_IN_HEAT_ONBOARDING);
   }
 
   @Test
   public void testUpdateNonExistingManualDepFlavorId_negative() {
     doReturn(true).when(vspInfoDao).isManual(anyObject(), anyObject());
-    testUpdate_negative(VSP_ID, VERSION, DF1_ID, USER,
+    testUpdate_negative(VSP_ID, VERSION, DF1_ID,
         VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
   }
 
@@ -292,21 +278,22 @@
     VspDetails vspDetails = new VspDetails(VSP_ID, VERSION);
     doReturn(vspDetails).when(vspInfoDao).get(anyObject());
 
-    DeploymentFlavorEntity deploymentFlavorEntity = new DeploymentFlavorEntity(VSP_ID, VERSION, DF1_ID);
+    DeploymentFlavorEntity deploymentFlavorEntity =
+        new DeploymentFlavorEntity(VSP_ID, VERSION, DF1_ID);
     DeploymentFlavor deploymentFlavor = new DeploymentFlavor();
     deploymentFlavor.setModel(DF1_ID + "_name");
     deploymentFlavor.setDescription(DF1_ID + " desc updated");
     deploymentFlavorEntity.setDeploymentFlavorCompositionData(deploymentFlavor);
 
     CompositionEntityValidationData validationData =
-        deploymentFlavorManager.updateDeploymentFlavor(deploymentFlavorEntity, USER);
+        deploymentFlavorManager.updateDeploymentFlavor(deploymentFlavorEntity);
     Assert.assertTrue(validationData == null || validationData.getErrors() == null);
     verify(deploymentFlavorDaoMock).update(deploymentFlavorEntity);
   }
 
   @Test
   public void testGetNonExistingDepFlavorId_negative() {
-    testGet_negative(VSP_ID, VERSION, "non existing image id", USER,
+    testGet_negative(VSP_ID, VERSION, "non existing image id",
         VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
   }
 
@@ -320,25 +307,27 @@
     doReturn(vspDetails).when(vspInfoDao).get(anyObject());
 
     CompositionEntityResponse<DeploymentFlavor> response =
-        deploymentFlavorManager.getDeploymentFlavor(VSP_ID, VERSION, DF1_ID, USER);
+        deploymentFlavorManager.getDeploymentFlavor(VSP_ID, VERSION, DF1_ID);
     Assert.assertEquals(response.getId(), expected.getId());
-    Assert.assertEquals(response.getData().getModel(), expected.getDeploymentFlavorCompositionData().
-        getModel());
-    Assert.assertEquals(response.getData().getDescription(), expected.getDeploymentFlavorCompositionData().
-        getDescription());
+    Assert
+        .assertEquals(response.getData().getModel(), expected.getDeploymentFlavorCompositionData().
+            getModel());
+    Assert.assertEquals(response.getData().getDescription(),
+        expected.getDeploymentFlavorCompositionData().
+            getDescription());
   }
 */
   @Test
   public void testDeleteDepFlavorOnHEAT() {
     DeploymentFlavorEntity expected = createDeploymentFlavor(VSP_ID, VERSION, DF1_ID);
     doReturn(expected).when(deploymentFlavorDaoMock).get(anyObject());
-    testDelete_negative(VSP_ID, VERSION,  DF1_ID, USER,
+    testDelete_negative(VSP_ID, VERSION, DF1_ID,
         VendorSoftwareProductErrorCodes.DELETE_DEPLOYMENT_FLAVOR_NOT_ALLOWED_IN_HEAT_ONBOARDING);
   }
 
   @Test
   public void testDeleteOnNotExistImage() {
-    testDelete_negative(VSP_ID, VERSION,  DF1_ID, USER,
+    testDelete_negative(VSP_ID, VERSION, DF1_ID,
         VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
   }
 
@@ -347,48 +336,35 @@
     DeploymentFlavorEntity expected = createDeploymentFlavor(VSP_ID, VERSION, DF1_ID);
     doReturn(expected).when(deploymentFlavorDaoMock).get(anyObject());
     doReturn(true).when(vspInfoDao).isManual(anyObject(), anyObject());
-    deploymentFlavorManager.deleteDeploymentFlavor(VSP_ID, VERSION, DF1_ID, USER);
+    deploymentFlavorManager.deleteDeploymentFlavor(VSP_ID, VERSION, DF1_ID);
     verify(deploymentFlavorDaoMock).delete(anyObject());
   }
 
-  private void testList_negative(String vspId, Version version, String componentId, String user,
-                                 String expectedErrorCode, String expectedErrorMsg) {
+  private void testCreate_negative(DeploymentFlavorEntity deploymentFlavorEntity,
+                                   String expectedErrorCode) {
     try {
-      deploymentFlavorManager.listDeploymentFlavors(vspId, version, user);
+      deploymentFlavorManager.createDeploymentFlavor(deploymentFlavorEntity);
       Assert.fail();
     } catch (CoreException exception) {
-      log.debug("",exception);
-      Assert.assertEquals(exception.code().id(), expectedErrorCode);
-      Assert.assertEquals(exception.getMessage(), expectedErrorMsg);
-    }
-  }
-
-  private void testCreate_negative(DeploymentFlavorEntity deploymentFlavorEntity, String user, String
-      expectedErrorCode) {
-    try {
-      deploymentFlavorManager.createDeploymentFlavor(deploymentFlavorEntity, user);
-      Assert.fail();
-    } catch (CoreException exception) {
-      log.debug("",exception);
       Assert.assertEquals(exception.code().id(), expectedErrorCode);
     }
   }
 
   private void testDelete_negative(String vspId, Version version, String deploymentFlavorId,
-                                   String user,
                                    String expectedErrorCode) {
     try {
-      deploymentFlavorManager.deleteDeploymentFlavor(vspId, version, deploymentFlavorId, user);
+      deploymentFlavorManager.deleteDeploymentFlavor(vspId, version, deploymentFlavorId);
       Assert.fail();
     } catch (CoreException exception) {
-      log.debug("",exception);
       Assert.assertEquals(exception.code().id(), expectedErrorCode);
     }
   }
 
-  static DeploymentFlavorEntity createDeploymentFlavor(String vspId, Version version, String deploymentFlavorId) {
+  private static DeploymentFlavorEntity createDeploymentFlavor(String vspId, Version version,
+                                                               String deploymentFlavorId) {
 
-    DeploymentFlavorEntity deploymentFlavorEntity = new DeploymentFlavorEntity(vspId, version, deploymentFlavorId);
+    DeploymentFlavorEntity deploymentFlavorEntity =
+        new DeploymentFlavorEntity(vspId, version, deploymentFlavorId);
     DeploymentFlavor deploymentFlavor = new DeploymentFlavor();
     deploymentFlavor.setModel(deploymentFlavorId + "name");
     deploymentFlavor.setDescription(deploymentFlavorId + " desc");
@@ -397,29 +373,28 @@
     return deploymentFlavorEntity;
   }
 
-  private void testUpdate_negative(String vspId, Version version, String
-      deploymentFlavorId, String user, String expectedErrorCode) {
+  private void testUpdate_negative(String vspId, Version version, String deploymentFlavorId,
+                                   String expectedErrorCode) {
     try {
-      DeploymentFlavorEntity deploymentFlavorEntity = new DeploymentFlavorEntity(vspId, version, deploymentFlavorId);
+      DeploymentFlavorEntity deploymentFlavorEntity =
+          new DeploymentFlavorEntity(vspId, version, deploymentFlavorId);
       DeploymentFlavor deploymentFlavor = new DeploymentFlavor();
       deploymentFlavor.setModel("Name");
       deploymentFlavorEntity.setDeploymentFlavorCompositionData(deploymentFlavor);
       deploymentFlavorManager
-          .updateDeploymentFlavor(deploymentFlavorEntity, user);
+          .updateDeploymentFlavor(new DeploymentFlavorEntity(vspId, version, deploymentFlavorId));
       Assert.fail();
     } catch (CoreException exception) {
-      log.debug("",exception);
       Assert.assertEquals(exception.code().id(), expectedErrorCode);
     }
   }
 
   private void testGet_negative(String vspId, Version version, String deploymentFlavorId,
-                                String user, String expectedErrorCode) {
+                                String expectedErrorCode) {
     try {
-      deploymentFlavorManager.getDeploymentFlavor(vspId, version, deploymentFlavorId, user);
+      deploymentFlavorManager.getDeploymentFlavor(vspId, version, deploymentFlavorId);
       Assert.fail();
     } catch (CoreException exception) {
-      log.debug("",exception);
       Assert.assertEquals(exception.code().id(), expectedErrorCode);
     }
   }
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ImageManagerImplTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ImageManagerImplTest.java
index 9f932b9..d9b4188 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ImageManagerImplTest.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ImageManagerImplTest.java
@@ -1,18 +1,11 @@
 package org.openecomp.sdc.vendorsoftwareproduct.impl;
 
 
-import static org.mockito.Matchers.anyObject;
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.never;
-import static org.mockito.Mockito.verify;
-
 import org.mockito.InjectMocks;
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
 import org.mockito.Spy;
 import org.openecomp.sdc.common.errors.CoreException;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.ImageDao;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDao;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ImageEntity;
@@ -29,21 +22,20 @@
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
-import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
-import java.util.List;
+
+import static org.mockito.Matchers.anyObject;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.verify;
 
 public class ImageManagerImplTest {
 
-  private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName());
-
   private static final String IMAGE_NOT_EXIST_MSG =
-          "Vendor Software Product Image with Id image1 does not exist for Vendor Software Product with" +
-                  " " +
-                  "id VSP_ID and version 0.1";
+      "Vendor Software Product Image with Id image1 does not exist for Vendor Software Product with" +
+          " id VSP_ID and version 0.1";
 
-  private static final String USER = "imageTestUser";
   private static final String VSP_ID = "VSP_ID";
   private static final Version VERSION = new Version(0, 1);
   private static final String COMPONENT_ID = "COMPONENT_ID";
@@ -68,7 +60,7 @@
   @Test
   public void testListWhenNone() {
     final Collection<ImageEntity> imageEntities =
-            imageManager.listImages(VSP_ID, VERSION, COMPONENT_ID, USER);
+        imageManager.listImages(VSP_ID, VERSION, COMPONENT_ID);
     Assert.assertEquals(imageEntities.size(), 0);
   }
 
@@ -76,32 +68,32 @@
   public void testList() {
 
     doReturn(Arrays.asList(
-            createImage(VSP_ID, VERSION, COMPONENT_ID, IMAGE1_ID),
-            createImage(VSP_ID, VERSION, COMPONENT_ID, IMAGE2_ID)))
-            .when(imageDao).list(anyObject());
+        createImage(VSP_ID, VERSION, COMPONENT_ID, IMAGE1_ID),
+        createImage(VSP_ID, VERSION, COMPONENT_ID, IMAGE2_ID)))
+        .when(imageDao).list(anyObject());
 
 
     final Collection<ImageEntity> images =
-            imageManager.listImages(VSP_ID, VERSION, COMPONENT_ID, USER);
+        imageManager.listImages(VSP_ID, VERSION, COMPONENT_ID);
     Assert.assertEquals(images.size(), 2);
     for (ImageEntity image : images) {
       Assert.assertEquals(image.getImageCompositionData().getFileName(),
-              IMAGE1_ID.equals(image.getId()) ? IMAGE1_ID+"_name" : IMAGE2_ID+"_name" );
+          IMAGE1_ID.equals(image.getId()) ? IMAGE1_ID + "_name" : IMAGE2_ID + "_name");
     }
   }
 
   @Test
   public void testCreateOnNotManualImage_negative() {
 
-    testCreate_negative(new ImageEntity(VSP_ID, VERSION, COMPONENT_ID, null), USER,
-            VendorSoftwareProductErrorCodes.ADD_IMAGE_NOT_ALLOWED_IN_HEAT_ONBOARDING);
+    testCreate_negative(new ImageEntity(VSP_ID, VERSION, COMPONENT_ID, null),
+        VendorSoftwareProductErrorCodes.ADD_IMAGE_NOT_ALLOWED_IN_HEAT_ONBOARDING);
   }
 
   @Test
   public void testCreateManualImage() {
     ImageEntity expected = createImage(VSP_ID, VERSION, COMPONENT_ID, IMAGE1_ID);
     doReturn(true).when(vspInfoDao).isManual(anyObject(), anyObject());
-    imageManager.createImage(expected, USER);
+    imageManager.createImage(expected);
     verify(compositionEntityDataManagerMock).createImage(expected);
     verify(compositionEntityDataManagerMock).createImage(expected);
   }
@@ -115,14 +107,13 @@
     Image image = expectedDiffName.getImageCompositionData();
     image.setFileName(IMAGE1_ID + "_Name");
     expectedDiffName.setImageCompositionData(image);
-    List<ImageEntity> vfcImageList = new ArrayList<ImageEntity>();
+    List<ImageEntity> vfcImageList = new ArrayList<>();
     vfcImageList.add(expectedDiffName);
     doReturn(vfcImageList).when(imageDao).list(anyObject());
     try {
-      imageManager.createImage(expected, USER);
+      imageManager.createImage(expected);
       Assert.fail();
-    }
-    catch (CoreException ex) {
+    } catch (CoreException ex) {
       Assert.assertEquals(VendorSoftwareProductErrorCodes.DUPLICATE_IMAGE_NAME_NOT_ALLOWED,
           ex.code().id());
     }
@@ -130,18 +121,18 @@
 
   @Test
   public void testUpdateNonExistingImageId_negative() {
-    testUpdate_negative(VSP_ID, VERSION, COMPONENT_ID, IMAGE1_ID, USER,
-            VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
+    testUpdate_negative(VSP_ID, VERSION, COMPONENT_ID, IMAGE1_ID,
+        VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
   }
 
   @Test
   public void testUpdateImage() {
     doReturn(createImage(VSP_ID, VERSION, COMPONENT_ID, IMAGE1_ID))
-            .when(imageDao).get(anyObject());
+        .when(imageDao).get(anyObject());
 
     doReturn(new CompositionEntityValidationData(CompositionEntityType.image, IMAGE1_ID))
-            .when(compositionEntityDataManagerMock)
-            .validateEntity(anyObject(), anyObject(), anyObject());
+        .when(compositionEntityDataManagerMock)
+        .validateEntity(anyObject(), anyObject(), anyObject());
 
     ImageEntity imageEntity = new ImageEntity(VSP_ID, VERSION, COMPONENT_ID, IMAGE1_ID);
     Image imageData = new Image();
@@ -150,7 +141,7 @@
     imageEntity.setImageCompositionData(imageData);
 
     CompositionEntityValidationData validationData =
-            imageManager.updateImage(imageEntity, USER);
+        imageManager.updateImage(imageEntity);
     Assert.assertTrue(validationData == null || validationData.getErrors() == null);
     verify(imageDao).update(imageEntity);
   }
@@ -158,16 +149,16 @@
   @Test
   public void testIllegalImageUpdate() {
     doReturn(createImage(VSP_ID, VERSION, COMPONENT_ID, IMAGE1_ID))
-            .when(imageDao).get(anyObject());
+        .when(imageDao).get(anyObject());
 
     doReturn(true).when(vspInfoDao).isManual(anyObject(), anyObject());
 
     CompositionEntityValidationData toBeReturned =
-            new CompositionEntityValidationData(CompositionEntityType.image, IMAGE1_ID);
+        new CompositionEntityValidationData(CompositionEntityType.image, IMAGE1_ID);
     toBeReturned.setErrors(Arrays.asList("error1", "error2"));
     doReturn(toBeReturned)
-            .when(compositionEntityDataManagerMock)
-            .validateEntity(anyObject(), anyObject(), anyObject());
+        .when(compositionEntityDataManagerMock)
+        .validateEntity(anyObject(), anyObject(), anyObject());
 
     ImageEntity imageEntity = new ImageEntity(VSP_ID, VERSION, COMPONENT_ID, IMAGE1_ID);
     Image imageData = new Image();
@@ -175,7 +166,7 @@
     imageData.setDescription(IMAGE1_ID + " desc updated");
     imageEntity.setImageCompositionData(imageData);
 
-    CompositionEntityValidationData validationData = imageManager.updateImage(imageEntity, USER);
+    CompositionEntityValidationData validationData = imageManager.updateImage(imageEntity);
     Assert.assertNotNull(validationData);
     Assert.assertEquals(validationData.getErrors().size(), 2);
 
@@ -185,7 +176,7 @@
   @Test
   public void testUpdateHEATImageFileName() throws Exception {
     doReturn(createImage(VSP_ID, VERSION, COMPONENT_ID, IMAGE1_ID))
-            .when(imageDao).get(anyObject());
+        .when(imageDao).get(anyObject());
     ImageEntity imageEntity = new ImageEntity(VSP_ID, VERSION, COMPONENT_ID, IMAGE1_ID);
     Image imageData = new Image();
     imageData.setFileName(IMAGE1_ID + " name updated");
@@ -193,10 +184,8 @@
     imageEntity.setImageCompositionData(imageData);
 
     try {
-      imageManager.updateImage(imageEntity, USER);
-    }
-    catch (CoreException ex) {
-      log.debug("",ex);
+      imageManager.updateImage(imageEntity);
+    } catch (CoreException ex) {
       Assert.assertEquals(ex.code().id(), VendorSoftwareProductErrorCodes.UPDATE_IMAGE_NOT_ALLOWED);
     }
 
@@ -204,8 +193,8 @@
 
   @Test
   public void testGetNonExistingImageId_negative() {
-    testGet_negative(VSP_ID, VERSION, COMPONENT_ID, "non existing image id", USER,
-            VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
+    testGet_negative(VSP_ID, VERSION, COMPONENT_ID, "non existing image id",
+        VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
   }
 
   @Test
@@ -216,12 +205,12 @@
     doReturn(compositionSchema).when(imageManager).getImageCompositionSchema(anyObject());
 
     CompositionEntityResponse<Image> response =
-            imageManager.getImage(VSP_ID, VERSION, COMPONENT_ID, IMAGE1_ID, USER);
+        imageManager.getImage(VSP_ID, VERSION, COMPONENT_ID, IMAGE1_ID);
     Assert.assertEquals(response.getId(), expected.getId());
     Assert.assertEquals(response.getData().getFileName(), expected.getImageCompositionData().
-            getFileName());
+        getFileName());
     Assert.assertEquals(response.getData().getDescription(), expected.getImageCompositionData().
-            getDescription());
+        getDescription());
     Assert.assertEquals(response.getSchema(), compositionSchema);
   }
 
@@ -229,14 +218,14 @@
   public void testDeleteOnNotManualImage() {
     ImageEntity expected = createImage(VSP_ID, VERSION, COMPONENT_ID, IMAGE1_ID);
     doReturn(expected).when(imageDao).get(anyObject());
-    testDelete_negative(VSP_ID, VERSION, COMPONENT_ID, IMAGE1_ID, USER,
-            VendorSoftwareProductErrorCodes.DELETE_IMAGE_NOT_ALLOWED);
+    testDelete_negative(VSP_ID, VERSION, COMPONENT_ID, IMAGE1_ID,
+        VendorSoftwareProductErrorCodes.DELETE_IMAGE_NOT_ALLOWED);
   }
 
   @Test
   public void testDeleteOnNotExistImage() {
-    testDelete_negative(VSP_ID, VERSION, COMPONENT_ID, IMAGE1_ID, USER,
-            VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
+    testDelete_negative(VSP_ID, VERSION, COMPONENT_ID, IMAGE1_ID,
+        VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
   }
 
   @Test
@@ -244,7 +233,7 @@
     ImageEntity expected = createImage(VSP_ID, VERSION, COMPONENT_ID, IMAGE1_ID);
     doReturn(expected).when(imageDao).get(anyObject());
     doReturn(true).when(vspInfoDao).isManual(anyObject(), anyObject());
-    imageManager.deleteImage(VSP_ID, VERSION, COMPONENT_ID, IMAGE1_ID, USER);
+    imageManager.deleteImage(VSP_ID, VERSION, COMPONENT_ID, IMAGE1_ID);
     verify(imageDao).delete(anyObject());
   }
 
@@ -258,7 +247,7 @@
     doReturn(schema).when(imageManager).getImageQuestionnaireSchema(anyObject());
 
     QuestionnaireResponse questionnaire =
-            imageManager.getImageQuestionnaire(VSP_ID, VERSION, COMPONENT_ID, IMAGE1_ID, USER);
+        imageManager.getImageQuestionnaire(VSP_ID, VERSION, COMPONENT_ID, IMAGE1_ID);
     Assert.assertNotNull(questionnaire);
     Assert.assertEquals(questionnaire.getData(), image.getQuestionnaireData());
     Assert.assertEquals(questionnaire.getSchema(), schema);
@@ -270,7 +259,8 @@
     String json = "{\"md5\" :\"FFDSD33SS\"}";
     doReturn(true).when(vspInfoDao).isManual(anyObject(), anyObject());
     doReturn(new ImageEntity()).when(imageDao).get(anyObject());
-    imageManager.updateImageQuestionnaire(VSP_ID, VERSION, COMPONENT_ID, IMAGE1_ID, json, USER);
+
+    imageManager.updateImageQuestionnaire(VSP_ID, VERSION, COMPONENT_ID, IMAGE1_ID, json);
     verify(imageDao).updateQuestionnaireData(VSP_ID, VERSION, COMPONENT_ID, IMAGE1_ID, json);
   }
 
@@ -291,10 +281,9 @@
         doReturn(imageEntities).when(imageDao).list(anyObject());
         doReturn(imageEntities.get(0)).when(imageDao).getQuestionnaireData(anyObject(), anyObject(), anyObject(), anyObject());
 
-        imageManager.updateImageQuestionnaire(VSP_ID, VERSION, COMPONENT_ID, IMAGE1_ID, json, USER);
+        imageManager.updateImageQuestionnaire(VSP_ID, VERSION, COMPONENT_ID, IMAGE1_ID, json);
         Assert.fail();
     } catch (CoreException exception) {
-        log.debug("",exception);
         Assert.assertEquals(exception.code().id(), VendorSoftwareProductErrorCodes.DUPLICATE_IMAGE_VERSION_NOT_ALLOWED);
 
     }
@@ -316,12 +305,9 @@
 
     String updJson = "{\"format\" :\"aki\"}";
     try {
-      imageManager.updateImageQuestionnaire(VSP_ID, VERSION, COMPONENT_ID, IMAGE1_ID, updJson,
-          USER);
+      imageManager.updateImageQuestionnaire(VSP_ID, VERSION, COMPONENT_ID, IMAGE1_ID, updJson);
       Assert.fail();
-    }
-    catch(CoreException ex) {
-      log.debug("",ex);
+    } catch (CoreException ex) {
       Assert.assertEquals(ex.code().id(), VendorSoftwareProductErrorCodes.UPDATE_IMAGE_NOT_ALLOWED);
     }
   }
@@ -337,51 +323,34 @@
 
     String updJson = "{\"format\" :\"a22\"}";
     try {
-      imageManager.updateImageQuestionnaire(VSP_ID, VERSION, COMPONENT_ID, IMAGE1_ID, updJson,
-              USER);
+      imageManager.updateImageQuestionnaire(VSP_ID, VERSION, COMPONENT_ID, IMAGE1_ID, updJson);
       Assert.fail();
-    }
-    catch(CoreException ex) {
-      log.debug("",ex);
+    } catch (CoreException ex) {
       Assert.assertEquals(ex.code().id(), VendorSoftwareProductErrorCodes.VFC_IMAGE_INVALID_FORMAT);
     }
   }
 
-  private void testList_negative(String vspId, Version version, String componentId, String user,
-                                 String expectedErrorCode, String expectedErrorMsg) {
+  private void testCreate_negative(ImageEntity image, String expectedErrorCode) {
     try {
-      imageManager.listImages(vspId, version, componentId, user);
+      imageManager.createImage(image);
       Assert.fail();
     } catch (CoreException exception) {
-      log.debug("",exception);
-      Assert.assertEquals(exception.code().id(), expectedErrorCode);
-      Assert.assertEquals(exception.getMessage(), expectedErrorMsg);
-    }
-  }
-
-  private void testCreate_negative(ImageEntity image, String user, String expectedErrorCode) {
-    try {
-      imageManager.createImage(image, user);
-      Assert.fail();
-    } catch (CoreException exception) {
-      log.debug("",exception);
       Assert.assertEquals(exception.code().id(), expectedErrorCode);
     }
   }
 
   private void testDelete_negative(String vspId, Version version, String componentId, String nicId,
-                                   String user,
                                    String expectedErrorCode) {
     try {
-      imageManager.deleteImage(vspId, version, componentId, nicId, user);
+      imageManager.deleteImage(vspId, version, componentId, nicId);
       Assert.fail();
     } catch (CoreException exception) {
-      log.debug("",exception);
       Assert.assertEquals(exception.code().id(), expectedErrorCode);
     }
   }
 
-  static ImageEntity createImage(String vspId, Version version, String compId, String imageId) {
+  private static ImageEntity createImage(String vspId, Version version, String compId,
+                                         String imageId) {
     ImageEntity imageEntity = new ImageEntity(vspId, version, compId, imageId);
     Image imageData = new Image();
     imageData.setFileName(imageId + "_name");
@@ -390,21 +359,20 @@
     return imageEntity;
   }
 
-  private void testUpdate_negative(String vspId, Version version, String componentId, String
-          imageId, String user, String expectedErrorCode) {
+  private void testUpdate_negative(String vspId, Version version, String componentId,
+                                   String imageId, String expectedErrorCode) {
     try {
-      imageManager.updateImage(new ImageEntity(vspId, version, componentId, imageId), user);
+      imageManager.updateImage(new ImageEntity(vspId, version, componentId, imageId));
       Assert.fail();
     } catch (CoreException exception) {
-      log.debug("",exception);
       Assert.assertEquals(exception.code().id(), expectedErrorCode);
     }
   }
 
   private void testGet_negative(String vspId, Version version, String componentId, String imageId,
-                                String user, String expectedErrorCode) {
+                                String expectedErrorCode) {
     try {
-      imageManager.getImage(vspId, version, componentId, imageId, user);
+      imageManager.getImage(vspId, version, componentId, imageId);
       Assert.fail();
     } catch (CoreException exception) {
       Assert.assertEquals(exception.code().id(), expectedErrorCode);
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ManualVspToscaManagerImplTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ManualVspToscaManagerImplTest.java
index ecfe0e6..2360dc7 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ManualVspToscaManagerImplTest.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ManualVspToscaManagerImplTest.java
@@ -1,57 +1,10 @@
 package org.openecomp.sdc.vendorsoftwareproduct.impl;
 
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.doThrow;
-import static org.openecomp.sdc.generator.util.GeneratorConstants.ALLOWED_FLAVORS_PROPERTY;
-import static org.openecomp.sdc.generator.util.GeneratorConstants.IMAGES_PROPERTY;
-import static org.openecomp.sdc.generator.util.GeneratorConstants.PORT_NODE_TEMPLATE_ID_SUFFIX;
-import static org.openecomp.sdc.tosca.services.ToscaConstants.BINDING_REQUIREMENT_ID;
-import static org.openecomp.sdc.tosca.services.ToscaConstants.COUNT_PROPERTY_NAME;
-import static org.openecomp.sdc.tosca.services.ToscaConstants.SERVICE_TEMPLATE_FILTER_PROPERTY_NAME;
-import static org.openecomp.sdc.tosca.services.ToscaConstants.SUBSTITUTE_SERVICE_TEMPLATE_PROPERTY_NAME;
-import static org.openecomp.sdc.translator.services.heattotosca.Constants.GLOBAL_SUBSTITUTION_TYPES_TEMPLATE_NAME;
-
-import org.junit.Assert;
-import org.junit.Test;
 import org.mockito.InjectMocks;
 import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
 import org.mockito.Spy;
-import org.openecomp.sdc.generator.core.utils.GeneratorUtils;
-import org.openecomp.sdc.generator.datatypes.tosca.ComputeFlavor;
-import org.openecomp.sdc.generator.datatypes.tosca.DeploymentFlavorModel;
-import org.openecomp.sdc.generator.datatypes.tosca.LicenseFlavor;
-import org.openecomp.sdc.generator.datatypes.tosca.MultiFlavorVfcImage;
-import org.openecomp.sdc.generator.datatypes.tosca.VendorInfo;
-import org.openecomp.sdc.generator.datatypes.tosca.VspModelInfo;
-import org.openecomp.sdc.generator.util.GeneratorConstants;
-import org.openecomp.sdc.tosca.datatypes.ToscaCapabilityType;
-import org.openecomp.sdc.tosca.datatypes.ToscaNodeType;
-import org.openecomp.sdc.tosca.datatypes.ToscaRelationshipType;
-import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel;
-import org.openecomp.sdc.tosca.datatypes.model.CapabilityDefinition;
-import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate;
-import org.openecomp.sdc.tosca.datatypes.model.NodeType;
-import org.openecomp.sdc.tosca.datatypes.model.PropertyDefinition;
-import org.openecomp.sdc.tosca.datatypes.model.PropertyType;
-import org.openecomp.sdc.tosca.datatypes.model.RequirementAssignment;
-import org.openecomp.sdc.tosca.datatypes.model.RequirementDefinition;
-import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
-import org.openecomp.sdc.tosca.datatypes.model.SubstitutionMapping;
-import org.openecomp.sdc.tosca.services.ToscaConstants;
-import org.openecomp.sdc.tosca.services.ToscaUtil;
-import org.openecomp.sdc.tosca.services.impl.ToscaAnalyzerServiceImpl;
 import org.openecomp.sdc.vendorsoftwareproduct.ManualVspToscaManager;
-import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Nic;
 import org.openecomp.sdc.vendorsoftwareproduct.services.ManualVspDataCollectionService;
-import org.openecomp.sdc.versioning.dao.types.Version;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
 
 public class ManualVspToscaManagerImplTest {
 
@@ -96,36 +49,27 @@
   private ManualVspDataCollectionService manualVspDataCollectionServiceMock;
   /*
 
-  private static List<String> supportedCapabilities = new ArrayList<>();
-  private static List<String> supportedRequirements = new ArrayList<>();
-
-  static {
-    //TODO : Read from configuration
-    supportedCapabilities.addAll(Arrays.asList("host", "os", "endpoint", "scalable"));
-    supportedRequirements.addAll(Arrays.asList("link"));
-  }
-
   @Test
   public void testGatherVspInformationInvalidVsp() {
     MockitoAnnotations.initMocks(this);
     VspModelInfo expectedVspData = new VspModelInfo();
     doThrow(new RuntimeException())
         .when(manualVspDataCollectionServiceMock)
-        .getReleaseVendor(INVALID_VSP_ID, Version.valueOf(VSP_VERSION), USER);
+        .getReleaseVendor(INVALID_VSP_ID, Version.valueOf(VSP_VERSION));
     doThrow(new RuntimeException())
         .when(manualVspDataCollectionServiceMock)
-        .getAllowedFlavors(INVALID_VSP_ID, Version.valueOf(VSP_VERSION), USER);
+        .getAllowedFlavors(INVALID_VSP_ID, Version.valueOf(VSP_VERSION));
     doThrow(new RuntimeException())
         .when(manualVspDataCollectionServiceMock)
-        .getVspComponentImages(INVALID_VSP_ID, Version.valueOf(VSP_VERSION), USER);
+        .getVspComponentImages(INVALID_VSP_ID, Version.valueOf(VSP_VERSION));
     doThrow(new RuntimeException())
         .when(manualVspDataCollectionServiceMock)
-        .getVspComponents(INVALID_VSP_ID, Version.valueOf(VSP_VERSION), USER);
+        .getVspComponents(INVALID_VSP_ID, Version.valueOf(VSP_VERSION));
     doThrow(new RuntimeException())
         .when(manualVspDataCollectionServiceMock)
-        .getVspComponentNics(INVALID_VSP_ID, Version.valueOf(VSP_VERSION), USER);
+        .getVspComponentNics(INVALID_VSP_ID, Version.valueOf(VSP_VERSION));
     VspModelInfo vspModelInfo = manualVspToscaManagerMock.gatherVspInformation(INVALID_VSP_ID,
-        Version.valueOf(VSP_VERSION), USER);
+        Version.valueOf(VSP_VERSION));
     Assert.assertEquals(expectedVspData, vspModelInfo);
   }
 
@@ -138,17 +82,17 @@
     Map<String, String> componentData = getComponentData();
     Map<String, List<MultiFlavorVfcImage>> vfcImageData = getVfcImageData();
     doReturn(Optional.of(RELEASE_VENDOR)).when(manualVspDataCollectionServiceMock)
-        .getReleaseVendor(VSP_ID, Version.valueOf(VSP_VERSION), USER);
+        .getReleaseVendor(VSP_ID, Version.valueOf(VSP_VERSION));
     doReturn(deploymentFlavorData).when(manualVspDataCollectionServiceMock)
-        .getAllowedFlavors(VSP_ID, Version.valueOf(VSP_VERSION), USER);
+        .getAllowedFlavors(VSP_ID, Version.valueOf(VSP_VERSION));
     doReturn(vfcImageData).when(manualVspDataCollectionServiceMock)
-        .getVspComponentImages(VSP_ID, Version.valueOf(VSP_VERSION), USER);
+        .getVspComponentImages(VSP_ID, Version.valueOf(VSP_VERSION));
     doReturn(componentData).when(manualVspDataCollectionServiceMock)
-        .getVspComponents(VSP_ID, Version.valueOf(VSP_VERSION), USER);
+        .getVspComponents(VSP_ID, Version.valueOf(VSP_VERSION));
     doReturn(componentNics).when(manualVspDataCollectionServiceMock)
-        .getVspComponentNics(VSP_ID, Version.valueOf(VSP_VERSION), USER);
+        .getVspComponentNics(VSP_ID, Version.valueOf(VSP_VERSION));
     VspModelInfo vspModelInfo = manualVspToscaManagerMock.gatherVspInformation(VSP_ID,
-        Version.valueOf(VSP_VERSION), USER);
+        Version.valueOf(VSP_VERSION));
 
     VspModelInfo expectedVspData = new VspModelInfo();
     expectedVspData.setReleaseVendor(RELEASE_VENDOR);
@@ -449,9 +393,9 @@
 
   private void validateSubstitutionCapabilities(Map<String, List<String>> capabilities,
                                                 String componentName) {
-    List<String> SupportedCapabilities = supportedCapabilities;
-    Assert.assertEquals(SupportedCapabilities.size(), capabilities.size());
-    for (String capability : SupportedCapabilities) {
+    List<String> supportedCapabilities = GeneratorUtils.supportedCapabilities;
+    Assert.assertEquals(supportedCapabilities.size(), capabilities.size());
+    for (String capability : supportedCapabilities) {
       String expectedCapabilityId = capability + "_" + componentName;
       Assert.assertEquals(true, capabilities.containsKey(expectedCapabilityId));
       List<String> expectedCapabilityValue = new ArrayList<>(2);
@@ -464,10 +408,10 @@
 
   private void validateSubstitutionRequirements(Map<String, List<String>> requirements,
                                                 List<Nic> nics) {
-    List<String> SupportedRequirements = supportedRequirements;
+    List<String> supportedRequirements = GeneratorUtils.supportedRequirements;
     for(Nic nic : nics) {
       String nicNodeTemplateId = nic.getName() + PORT_NODE_TEMPLATE_ID_SUFFIX;
-      for (String requirement : SupportedRequirements) {
+      for (String requirement : supportedRequirements) {
         String expectedRequirementId = requirement + "_" + nicNodeTemplateId;
         Assert.assertEquals(true, requirements.containsKey(expectedRequirementId));
         List<String> expectedRequirementValue = new ArrayList<>(2);
@@ -508,11 +452,11 @@
 
     List<Map<String, RequirementDefinition>> requirements =
         deploymentFlavorNodeType.getRequirements();
-    List<String> SupportedRequirements = supportedRequirements;
+    List<String> supportedRequirements = GeneratorUtils.supportedRequirements;
     for (Nic nic : nics) {
       boolean found = false;
       String nicNodeTemplateId = nic.getName() + PORT_NODE_TEMPLATE_ID_SUFFIX;
-      for (String requirementId : SupportedRequirements) {
+      for (String requirementId : supportedRequirements) {
         String expectedRequirementId = requirementId + "_" + nicNodeTemplateId;
         for (Map<String, RequirementDefinition> requirement : requirements) {
           if (requirement.containsKey(expectedRequirementId)) {
@@ -525,8 +469,8 @@
     }
 
     Map<String, CapabilityDefinition> capabilities = deploymentFlavorNodeType.getCapabilities();
-    List<String> SupportedCapabilities = supportedCapabilities;
-    for (String capabilityId : SupportedCapabilities) {
+    List<String> supportedCapabilities = GeneratorUtils.supportedCapabilities;
+    for (String capabilityId : supportedCapabilities) {
       String expectedCapabilityId = capabilityId + "_" + componentName;
       Assert.assertEquals (true, capabilities.containsKey(expectedCapabilityId));
     }
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/MonitoringUploadsManagerImplTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/MonitoringUploadsManagerImplTest.java
index 966e1f2..5e735ff 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/MonitoringUploadsManagerImplTest.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/MonitoringUploadsManagerImplTest.java
@@ -28,10 +28,9 @@
 
 public class MonitoringUploadsManagerImplTest {
 
-  private static final String USER1 = "ComponentsUploadTestUser";
   private static final String COMPONENT_ID = "COMPONENT_ID";
   private static final String VSP_ID = "vspId";
-  private static final Version VERSION = new Version(0, 1);
+  private static final Version VERSION = new Version("version_id");
   private static final String TRAP_FILE_NAME = "MMSC.zip";
   private static final String POLL_FILE_NAME = "MNS OAM FW.zip";
   private static final String VES_FILE_NAME = "vesTest-yml_only.zip";
@@ -54,22 +53,19 @@
   @Test(expectedExceptions = CoreException.class)
   public void testUploadEmptyZip() {
     processFile(ZIP_DIR + EMPTY_ZIP_FILE_NAME, inputStream ->
-      monitoringUploadsManager.upload(inputStream, EMPTY_ZIP_FILE_NAME, VSP_ID, VERSION, COMPONENT_ID,
-          MonitoringUploadType.SNMP_TRAP, USER1));
+        monitoringUploadsManager
+            .upload(inputStream, EMPTY_ZIP_FILE_NAME, VSP_ID, VERSION, COMPONENT_ID,
+                MonitoringUploadType.SNMP_TRAP));
   }
 
-  @Test
+  @Test(expectedExceptions = CoreException.class, expectedExceptionsMessageRegExp =
+      "Monitoring file uploaded for vendor software product with Id vspId and version version_id " +
+          "is invalid: Invalid zip file")
   public void testUploadInvalidZip() {
-
-    try {
-      processFile("/notZipFile", inputStream ->
+    processFile("/notZipFile", inputStream ->
         monitoringUploadsManager
             .upload(inputStream, NOT_ZIP_FILE_NAME, VSP_ID, VERSION, COMPONENT_ID,
-                    MonitoringUploadType.VES_EVENTS, USER1));
-      Assert.fail();
-    } catch (Exception exception) {
-      Assert.assertEquals(exception.getMessage(), "Invalid zip file");
-    }
+                MonitoringUploadType.VES_EVENTS));
   }
 
   @Test
@@ -78,7 +74,7 @@
     try {
       processFile(ZIP_DIR + ZIP_WITH_FOLDERS_FILE_NAME, inputStream -> monitoringUploadsManager
           .upload(inputStream, ZIP_WITH_FOLDERS_FILE_NAME, VSP_ID, VERSION, COMPONENT_ID,
-              MonitoringUploadType.SNMP_TRAP, USER1));
+              MonitoringUploadType.SNMP_TRAP));
       Assert.fail();
     } catch (Exception exception) {
       Assert.assertEquals(exception.getMessage(), "Zip file should not contain folders");
@@ -91,7 +87,7 @@
     try {
       processFile(ZIP_DIR + INVALID_VES_FILE_NAME, inputStream -> monitoringUploadsManager
           .upload(inputStream, INVALID_VES_FILE_NAME, VSP_ID, VERSION, COMPONENT_ID,
-              MonitoringUploadType.VES_EVENTS, USER1));
+              MonitoringUploadType.VES_EVENTS));
       Assert.fail();
     } catch (Exception exception) {
       Assert.assertEquals(exception.getMessage(),
@@ -122,18 +118,18 @@
         .when(componentArtifactDaoMock).list(anyObject());
 
     MonitoringUploadStatus monitoringUploadStatus =
-        monitoringUploadsManager.listFilenames(VSP_ID, VERSION, COMPONENT_ID, USER1);
+        monitoringUploadsManager.listFilenames(VSP_ID, VERSION, COMPONENT_ID);
 
     Assert.assertEquals(monitoringUploadStatus.getSnmpTrap(), TRAP_FILE_NAME);
     Assert.assertEquals(monitoringUploadStatus.getSnmpPoll(), POLL_FILE_NAME);
     Assert.assertEquals(monitoringUploadStatus.getVesEvent(), VES_FILE_NAME);
   }
 
-  @Test (expectedExceptions = CoreException.class)
+  @Test(expectedExceptions = CoreException.class)
   public void testDeleteComponentMibWhenNone() {
     doReturn(Optional.empty()).when(componentArtifactDaoMock).getByType(any());
     monitoringUploadsManager
-        .delete(VSP_ID, VERSION, COMPONENT_ID, MonitoringUploadType.SNMP_POLL, USER1);
+        .delete(VSP_ID, VERSION, COMPONENT_ID, MonitoringUploadType.SNMP_POLL);
 
     verify(componentArtifactDaoMock, never()).delete(anyObject());
   }
@@ -146,7 +142,7 @@
             (componentArtifactDaoMock).getByType(anyObject());
 
     monitoringUploadsManager
-        .delete(VSP_ID, VERSION, COMPONENT_ID, MonitoringUploadType.SNMP_POLL, USER1);
+        .delete(VSP_ID, VERSION, COMPONENT_ID, MonitoringUploadType.SNMP_POLL);
 
     verify(componentArtifactDaoMock).delete(anyObject());
   }
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/NetworkManagerImplTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/NetworkManagerImplTest.java
index ebdbc6a..54687dc 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/NetworkManagerImplTest.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/NetworkManagerImplTest.java
@@ -53,10 +53,8 @@
 
   private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName());
 
-  private static final String USER1 = "networksTestUser1";
-  private static final String USER2 = "networksTestUser2";
   private static final String VSP_ID = "vsp";
-  private static final Version VERSION = new Version(0, 1);
+  private static final Version VERSION = new Version("version_id");
   private static final String NETWORK1_ID = "network1";
   private static final String NETWORK2_ID = "network2";
 
@@ -85,7 +83,7 @@
   @Test
   public void testListWhenNone() {
     Collection<NetworkEntity> networks =
-        networkManager.listNetworks(VSP_ID, null, USER1);
+        networkManager.listNetworks(VSP_ID, null);
     Assert.assertEquals(networks.size(), 0);
   }
 
@@ -96,7 +94,7 @@
         createNetwork(VSP_ID, VERSION, NETWORK2_ID)))
         .when(networkDaoMock).list(anyObject());
 
-    Collection<NetworkEntity> actual = networkManager.listNetworks(VSP_ID, VERSION, USER1);
+    Collection<NetworkEntity> actual = networkManager.listNetworks(VSP_ID, VERSION);
     Assert.assertEquals(actual.size(), 2);
   }
 
@@ -113,7 +111,7 @@
         expected.setNetworkCompositionData(networkData);
 
 
-        NetworkEntity created = networkManager.createNetwork(expected, USER1);
+        NetworkEntity created = networkManager.createNetwork(expected);
         Assert.assertNotNull(created);
         expected.setId(created.getId());
         expected.setVersion(VERSION01);
@@ -131,12 +129,12 @@
         networkData.setName("network1 name");
         networkData.setDhcp(true);
         network.setNetworkCompositionData(networkData);
-        testCreate_negative(network, USER1, UniqueValueUtil.UNIQUE_VALUE_VIOLATION);
+        testCreate_negative(network, UniqueValueUtil.UNIQUE_VALUE_VIOLATION);
     }*/
 
   @Test
   public void testCreateOnUploadVsp_negative() {
-    testCreate_negative(new NetworkEntity(VSP_ID, VERSION, null), USER1,
+    testCreate_negative(new NetworkEntity(VSP_ID, VERSION, null),
         VendorSoftwareProductErrorCodes.VSP_COMPOSITION_EDIT_NOT_ALLOWED);
   }
 
@@ -148,7 +146,7 @@
 
   @Test
   public void testUpdateNonExistingNetworkId_negative() {
-    testUpdate_negative(VSP_ID, VERSION, NETWORK1_ID, USER1,
+    testUpdate_negative(VSP_ID, VERSION, NETWORK1_ID,
         VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
   }
 
@@ -171,7 +169,7 @@
     networkEntity.setNetworkCompositionData(networkData);
 
     CompositionEntityValidationData validationData =
-        networkManager.updateNetwork(networkEntity, USER1);
+        networkManager.updateNetwork(networkEntity);
     Assert.assertNotNull(validationData);
     Assert.assertEquals(validationData.getErrors().size(), 2);
 
@@ -180,7 +178,7 @@
 
   @Test
   public void testGetNonExistingNetworkId_negative() {
-    testGet_negative(VSP_ID, VERSION, NETWORK1_ID, USER1,
+    testGet_negative(VSP_ID, VERSION, NETWORK1_ID,
         VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
   }
 
@@ -192,7 +190,7 @@
     doReturn("schema string").when(networkManager).getCompositionSchema(anyObject());
 
     CompositionEntityResponse<Network> response =
-        networkManager.getNetwork(VSP_ID, VERSION, NETWORK1_ID, USER1);
+        networkManager.getNetwork(VSP_ID, VERSION, NETWORK1_ID);
     Assert.assertEquals(response.getId(), network.getId());
     Assert.assertEquals(response.getData(), network.getNetworkCompositionData());
     Assert.assertNotNull(response.getSchema());
@@ -206,13 +204,13 @@
 
     @Test(dependsOnMethods = "testList")
     public void testDeleteNonExistingNetworkId_negative() {
-        testDelete_negative(VSP_ID, "non existing network id", USER1, VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
+        testDelete_negative(VSP_ID, "non existing network id", VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
     }*/
 
 /*
            @Test(dependsOnMethods = "testList")
            public void testDelete() {
-               networkManager.deleteNetwork(VSP_ID, NETWORK1_ID, USER1);
+               networkManager.deleteNetwork(VSP_ID, NETWORK1_ID);
                NetworkEntity actual = networkDaoMock.getNetwork(VSP_ID, VERSION01, NETWORK1_ID);
                Assert.assertNull(actual);
            }
@@ -224,70 +222,69 @@
                NetworkEntity network3 = new NetworkEntity(VSP_ID, null, null);
                network3.setName("network3 name");
                network3.setDescription("network3 desc");
-               networkManager.createNetwork(network3, USER1);
+               networkManager.createNetwork(network3);
 
-               networkManager.deleteNetworks(VSP_ID, USER1);
+               networkManager.deleteNetworks(VSP_ID);
 
-               Collection<NetworkEntity> actual = networkManager.listNetworks(VSP_ID, null, USER1);
+               Collection<NetworkEntity> actual = networkManager.listNetworks(VSP_ID, null);
                Assert.assertEquals(actual.size(), 0);
            }*/
 
   @Test(dependsOnMethods = "testList")
   public void testDeleteOnUploadVsp_negative() {
-    testDelete_negative(VSP_ID, VERSION, NETWORK1_ID, USER1,
+    testDelete_negative(VSP_ID, VERSION, NETWORK1_ID,
         VendorSoftwareProductErrorCodes.VSP_COMPOSITION_EDIT_NOT_ALLOWED);
   }
 
-  private void testCreate_negative(NetworkEntity network, String user, String expectedErrorCode) {
+  private void testCreate_negative(NetworkEntity network, String expectedErrorCode) {
     try {
-      networkManager.createNetwork(network, user);
+      networkManager.createNetwork(network);
       Assert.fail();
     } catch (CoreException exception) {
-      log.debug("",exception);
+      log.debug("", exception);
       Assert.assertEquals(exception.code().id(), expectedErrorCode);
     }
   }
 
-  private void testGet_negative(String vspId, Version version, String networkId, String user,
+  private void testGet_negative(String vspId, Version version, String networkId,
                                 String expectedErrorCode) {
     try {
-      networkManager.getNetwork(vspId, version, networkId, user);
+      networkManager.getNetwork(vspId, version, networkId);
       Assert.fail();
     } catch (CoreException exception) {
-      log.debug("",exception);
+      log.debug("", exception);
       Assert.assertEquals(exception.code().id(), expectedErrorCode);
     }
   }
 
-  private void testUpdate_negative(String vspId, Version version, String networkId, String user,
+  private void testUpdate_negative(String vspId, Version version, String networkId,
                                    String expectedErrorCode) {
     try {
-      networkManager.updateNetwork(new NetworkEntity(vspId, version, networkId), user);
+      networkManager.updateNetwork(new NetworkEntity(vspId, version, networkId));
       Assert.fail();
     } catch (CoreException exception) {
-      log.debug("",exception);
+      log.debug("", exception);
       Assert.assertEquals(exception.code().id(), expectedErrorCode);
     }
   }
 
-  private void testList_negative(String vspId, Version version, String user,
-                                 String expectedErrorCode) {
+  private void testList_negative(String vspId, Version version, String expectedErrorCode) {
     try {
-      networkManager.listNetworks(vspId, version, user);
+      networkManager.listNetworks(vspId, version);
       Assert.fail();
     } catch (CoreException exception) {
-      log.debug("",exception);
+      log.debug("", exception);
       Assert.assertEquals(exception.code().id(), expectedErrorCode);
     }
   }
 
-  private void testDelete_negative(String vspId, Version version, String networkId, String user,
+  private void testDelete_negative(String vspId, Version version, String networkId,
                                    String expectedErrorCode) {
     try {
-      networkManager.deleteNetwork(vspId, version, networkId, user);
+      networkManager.deleteNetwork(vspId, version, networkId);
       Assert.fail();
     } catch (CoreException exception) {
-      log.debug("",exception);
+      log.debug("", exception);
       Assert.assertEquals(exception.code().id(), expectedErrorCode);
     }
   }
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/NicManagerImplTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/NicManagerImplTest.java
index ba04e91..959b501 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/NicManagerImplTest.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/NicManagerImplTest.java
@@ -1,10 +1,5 @@
 package org.openecomp.sdc.vendorsoftwareproduct.impl;
 
-import static org.mockito.Matchers.anyObject;
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.never;
-import static org.mockito.Mockito.verify;
-
 import org.mockito.InjectMocks;
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
@@ -35,17 +30,21 @@
 import java.util.Arrays;
 import java.util.Collection;
 
+import static org.mockito.Matchers.anyObject;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.verify;
+
 public class NicManagerImplTest {
 
   private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName());
 
   private static final String NIC_NOT_EXIST_MSG =
       "Vendor Software Product NIC with Id nic1 does not exist for Vendor Software Product with " +
-          "id VSP_ID and version 0.1";
+          "id VSP_ID and version version_id";
 
-  private static final String USER = "nicTestUser";
   private static final String VSP_ID = "VSP_ID";
-  private static final Version VERSION = new Version(0, 1);
+  private static final Version VERSION = new Version("version_id");
   private static final String COMPONENT_ID = "COMPONENT_ID";
   private static final String NIC1_ID = "nic1";
   private static final String NIC2_ID = "nic2";
@@ -71,7 +70,7 @@
 
   @Test
   public void testListWhenNone() {
-    Collection<NicEntity> nics = nicManager.listNics(VSP_ID, VERSION, COMPONENT_ID, USER);
+    Collection<NicEntity> nics = nicManager.listNics(VSP_ID, VERSION, COMPONENT_ID);
     Assert.assertEquals(nics.size(), 0);
   }
 
@@ -85,9 +84,9 @@
     NetworkEntity network1 = NetworkManagerImplTest.createNetwork(VSP_ID, VERSION, NETWORK1_ID);
     NetworkEntity network2 = NetworkManagerImplTest.createNetwork(VSP_ID, VERSION, NETWORK2_ID);
     doReturn(Arrays.asList(network1, network2))
-        .when(networkManagerMock).listNetworks(VSP_ID, VERSION, USER);
+        .when(networkManagerMock).listNetworks(VSP_ID, VERSION);
 
-    Collection<NicEntity> nics = nicManager.listNics(VSP_ID, VERSION, COMPONENT_ID, USER);
+    Collection<NicEntity> nics = nicManager.listNics(VSP_ID, VERSION, COMPONENT_ID);
     Assert.assertEquals(nics.size(), 2);
     for (NicEntity nic : nics) {
       Assert.assertEquals(nic.getNicCompositionData().getNetworkName(),
@@ -103,12 +102,12 @@
     Nic nic = nicEntity.getNicCompositionData();
     nic.setNetworkType(NetworkType.Internal);
     nicEntity.setNicCompositionData(nic);
-    doReturn(true).when(vspInfoDao).isManual(anyObject(),anyObject());
+    doReturn(true).when(vspInfoDao).isManual(anyObject(), anyObject());
     Collection<NicEntity> nicEntities = new ArrayList<>();
     doReturn(nicEntities).when(nicDao).list(anyObject());
     doReturn(nicEntity).when(compositionEntityDataManagerMock).createNic(anyObject());
 
-    NicEntity created = nicManager.createNic(nicEntity,USER);
+    NicEntity created = nicManager.createNic(nicEntity);
     Assert.assertNotNull(created);
   }
 
@@ -118,7 +117,7 @@
     Nic nic = nicEntity.getNicCompositionData();
     nic.setNetworkType(NetworkType.Internal);
     nicEntity.setNicCompositionData(nic);
-    doReturn(true).when(vspInfoDao).isManual(anyObject(),anyObject());
+    doReturn(true).when(vspInfoDao).isManual(anyObject(), anyObject());
     Collection<NicEntity> nicEntities = new ArrayList<>();
 
     NicEntity nicEntityDiffName = createNic(VSP_ID, VERSION, COMPONENT_ID, NIC1_ID, NETWORK1_ID);
@@ -130,11 +129,11 @@
     doReturn(nicEntity).when(compositionEntityDataManagerMock).createNic(anyObject());
 
     try {
-      NicEntity created = nicManager.createNic(nicEntity,USER);
-    }  catch (CoreException exception) {
-      log.debug("",exception);
-            Assert.assertEquals(VendorSoftwareProductErrorCodes.NIC_NAME_FORMAT_NOT_ALLOWED,
-              exception.code().id());
+      NicEntity created = nicManager.createNic(nicEntity);
+    } catch (CoreException exception) {
+      log.debug("", exception);
+      Assert.assertEquals(VendorSoftwareProductErrorCodes.NIC_NAME_FORMAT_NOT_ALLOWED,
+          exception.code().id());
     }
   }
 
@@ -144,7 +143,7 @@
     Nic nic = nicEntity.getNicCompositionData();
     nic.setNetworkType(NetworkType.Internal);
     nicEntity.setNicCompositionData(nic);
-    doReturn(true).when(vspInfoDao).isManual(anyObject(),anyObject());
+    doReturn(true).when(vspInfoDao).isManual(anyObject(), anyObject());
     Collection<NicEntity> nicEntities = new ArrayList<>();
 
     NicEntity nicEntityDiffName = createNic(VSP_ID, VERSION, COMPONENT_ID, NIC1_ID, NETWORK1_ID);
@@ -156,11 +155,11 @@
     doReturn(nicEntity).when(compositionEntityDataManagerMock).createNic(anyObject());
 
     try {
-      NicEntity created = nicManager.createNic(nicEntity,USER);
-    }  catch (CoreException exception) {
-      log.debug("",exception);
-      Assert.assertEquals("Invalid request, NIC with name "+ nic.getName() +
-          " already exist for component with ID "+ nicEntity.getComponentId() +".",
+      NicEntity created = nicManager.createNic(nicEntity);
+    } catch (CoreException exception) {
+      log.debug("", exception);
+      Assert.assertEquals("Invalid request, NIC with name " + nic.getName() +
+              " already exist for component with ID " + nicEntity.getComponentId() + ".",
           exception.code().message());
       Assert.assertEquals(VendorSoftwareProductErrorCodes.DUPLICATE_NIC_NAME_NOT_ALLOWED,
           exception.code().id());
@@ -173,19 +172,20 @@
     Nic nic = nicEntity.getNicCompositionData();
     nic.setNetworkType(NetworkType.External);
     nicEntity.setNicCompositionData(nic);
-    doReturn(true).when(vspInfoDao).isManual(anyObject(),anyObject());
+    doReturn(true).when(vspInfoDao).isManual(anyObject(), anyObject());
     Collection<NicEntity> nicEntities = new ArrayList<>();
     doReturn(nicEntities).when(nicDao).list(anyObject());
     doReturn(nicEntity).when(compositionEntityDataManagerMock).createNic(anyObject());
 
     try {
-      NicEntity created = nicManager.createNic(nicEntity,USER);
-    }  catch (CoreException exception) {
-      log.debug("",exception);
+      NicEntity created = nicManager.createNic(nicEntity);
+    } catch (CoreException exception) {
+      log.debug("", exception);
       Assert.assertEquals("Invalid request,NetworkId not allowed for External Networks",
           exception.code().message());
-      Assert.assertEquals(VendorSoftwareProductErrorCodes.NETWORKID_NOT_ALLOWED_FOR_EXTERNAL_NETWORK,
-          exception.code().id());
+      Assert
+          .assertEquals(VendorSoftwareProductErrorCodes.NETWORKID_NOT_ALLOWED_FOR_EXTERNAL_NETWORK,
+              exception.code().id());
     }
   }
 
@@ -196,29 +196,29 @@
     nic.setNetworkType(NetworkType.Internal);
     nic.setNetworkDescription(NIC1_ID);
     nicEntity.setNicCompositionData(nic);
-    doReturn(true).when(vspInfoDao).isManual(anyObject(),anyObject());
+    doReturn(true).when(vspInfoDao).isManual(anyObject(), anyObject());
     Collection<NicEntity> nicEntities = new ArrayList<>();
     doReturn(nicEntities).when(nicDao).list(anyObject());
     doReturn(nicEntity).when(compositionEntityDataManagerMock).createNic(anyObject());
 
     try {
-      NicEntity created = nicManager.createNic(nicEntity,USER);
-    }  catch (CoreException exception) {
-      log.debug("",exception);
+      NicEntity created = nicManager.createNic(nicEntity);
+    } catch (CoreException exception) {
+      log.debug("", exception);
       Assert.assertEquals("Invalid request, Network Description not allowed for Internal Networks",
           exception.code().message());
       Assert.assertEquals(VendorSoftwareProductErrorCodes
-          .NETWORK_DESCRIPTION_NOT_ALLOWED_FOR_INTERNAL_NETWORK,exception.code().id());
+          .NETWORK_DESCRIPTION_NOT_ALLOWED_FOR_INTERNAL_NETWORK, exception.code().id());
     }
   }
 
   @Test
   public void testDeleteNic() {
     NicEntity nicEntity = createNic(VSP_ID, VERSION, COMPONENT_ID, NIC1_ID, NETWORK1_ID);
-    doReturn(true).when(vspInfoDao).isManual(anyObject(),anyObject());
+    doReturn(true).when(vspInfoDao).isManual(anyObject(), anyObject());
     doReturn(nicEntity).when(nicDao).get(anyObject());
 
-    nicManager.deleteNic(VSP_ID,new Version(0,1),COMPONENT_ID,NIC1_ID,USER);
+    nicManager.deleteNic(VSP_ID, VERSION, COMPONENT_ID, NIC1_ID);
 
   }
 
@@ -227,9 +227,12 @@
     NicEntity nicEntity = createNic(VSP_ID, VERSION, COMPONENT_ID, NIC1_ID, NETWORK1_ID);
 
     doReturn(nicEntity).when(nicDao).get(anyObject());
+    doReturn("{}").when(nicManager).getNicCompositionSchema(anyObject());
 
-    nicManager.updateNicQuestionnaire(VSP_ID,new Version(0,1),COMPONENT_ID,NIC1_ID,"Ques",USER);
+    nicManager
+        .updateNicQuestionnaire(VSP_ID, VERSION, COMPONENT_ID, NIC1_ID, "Ques");
 
+    verify(nicDao).updateQuestionnaireData(VSP_ID, VERSION, COMPONENT_ID, NIC1_ID, "Ques");
   }
 
 //    @Test(dependsOnMethods = "testListWhenNone")
@@ -243,7 +246,7 @@
         Nic nicData = new Nic();
         nicData.setName("nic1 name");
         nic.setNicCompositionData(nicData);
-        testCreate_negative(nic, USER, UniqueValueUtil.UNIQUE_VALUE_VIOLATION);
+        testCreate_negative(nic, UniqueValueUtil.UNIQUE_VALUE_VIOLATION);
     }*/
 
 //    @Test(dependsOnMethods = {"testCreate"})
@@ -254,7 +257,7 @@
 //        compData12.setDescription("comp12 desc");
 //        component12.setComponentCompositionData(compData12);
 //
-//        String component12Id = nicManager.createComponent(component12, USER).getId();
+//        String component12Id = nicManager.createComponent(component12).getId();
 //        testCreate(VSP_ID, component12Id, NETWORK1_ID, NETWORK1_ID.getNetworkCompositionData().getName());
 //    }
 
@@ -266,7 +269,7 @@
   @Test
   public void testCreateOnUploadVsp_negative() {
 
-    testCreate_negative(new NicEntity(VSP_ID, VERSION, COMPONENT_ID, null), USER,
+    testCreate_negative(new NicEntity(VSP_ID, VERSION, COMPONENT_ID, null),
         VendorSoftwareProductErrorCodes.ADD_NIC_NOT_ALLOWED_IN_HEAT_ONBOARDING);
   }
 
@@ -274,7 +277,7 @@
   public void testUpdateNonExistingNicId_negative() {
     doReturn(null).when(nicDao).get(anyObject());
 
-    testUpdate_negative(VSP_ID, VERSION, COMPONENT_ID, NIC1_ID, USER,
+    testUpdate_negative(VSP_ID, VERSION, COMPONENT_ID, NIC1_ID,
         VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
   }
 
@@ -295,7 +298,7 @@
     nicEntity.setNicCompositionData(nicData);
 
     CompositionEntityValidationData validationData =
-        nicManager.updateNic(nicEntity, USER);
+        nicManager.updateNic(nicEntity);
     Assert.assertTrue(validationData == null || validationData.getErrors() == null);
     verify(nicDao).update(nicEntity);
   }
@@ -319,7 +322,7 @@
     nicData.setNetworkId(NETWORK1_ID);
     nicEntity.setNicCompositionData(nicData);
 
-    CompositionEntityValidationData validationData = nicManager.updateNic(nicEntity, USER);
+    CompositionEntityValidationData validationData = nicManager.updateNic(nicEntity);
     Assert.assertNotNull(validationData);
     Assert.assertEquals(validationData.getErrors().size(), 2);
 
@@ -329,14 +332,14 @@
   @Test
   public void testUpdateIncorrectNameFormat() {
     doReturn(createNic(VSP_ID, VERSION, COMPONENT_ID, NIC1_ID, NETWORK1_ID))
-            .when(nicDao).get(anyObject());
+        .when(nicDao).get(anyObject());
 
     CompositionEntityValidationData toBeReturned =
-            new CompositionEntityValidationData(CompositionEntityType.nic, NIC1_ID);
+        new CompositionEntityValidationData(CompositionEntityType.nic, NIC1_ID);
     toBeReturned.setErrors(Arrays.asList("error1", "error2"));
     doReturn(toBeReturned)
-            .when(compositionEntityDataManagerMock)
-            .validateEntity(anyObject(), anyObject(), anyObject());
+        .when(compositionEntityDataManagerMock)
+        .validateEntity(anyObject(), anyObject(), anyObject());
     doReturn(true).when(vspInfoDao).isManual(anyObject(), anyObject());
 
     NicEntity nicEntity = new NicEntity(VSP_ID, VERSION, COMPONENT_ID, NIC1_ID);
@@ -347,20 +350,19 @@
     nicEntity.setNicCompositionData(nicData);
 
     try {
-      nicManager.updateNic(nicEntity, USER);
+      nicManager.updateNic(nicEntity);
       Assert.fail();
-    }
-    catch (CoreException ex) {
-      log.debug("",ex);
+    } catch (CoreException ex) {
+      log.debug("", ex);
       Assert.assertEquals(VendorSoftwareProductErrorCodes.NIC_NAME_FORMAT_NOT_ALLOWED,
-              ex.code().id());
+          ex.code().id());
     }
   }
 
 
   @Test
   public void testGetNonExistingNicId_negative() {
-    testGet_negative(VSP_ID, VERSION, COMPONENT_ID, "non existing nic id", USER,
+    testGet_negative(VSP_ID, VERSION, COMPONENT_ID, "non existing nic id",
         VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
   }
 
@@ -373,7 +375,7 @@
     doReturn(compositionSchema).when(nicManager).getNicCompositionSchema(anyObject());
 
     CompositionEntityResponse<Nic> response =
-        nicManager.getNic(VSP_ID, VERSION, COMPONENT_ID, NIC1_ID, USER);
+        nicManager.getNic(VSP_ID, VERSION, COMPONENT_ID, NIC1_ID);
     Assert.assertEquals(response.getId(), expected.getId());
     Assert.assertEquals(response.getData(), expected.getNicCompositionData());
     Assert.assertEquals(response.getSchema(), compositionSchema);
@@ -387,32 +389,32 @@
 
     @Test
     public void testDeleteNonExistingNicId_negative() {
-        testDelete_negative(VSP_ID, COMPONENT_ID, "non existing nic id", USER, VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
+        testDelete_negative(VSP_ID, COMPONENT_ID, "non existing nic id", VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
     }
 
     @Test(dependsOnMethods = "testList")
     public void testDeleteNonExistingComponentId_negative() {
-        testDelete_negative(VSP_ID, "non existing component id", NIC1_ID, USER, VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
+        testDelete_negative(VSP_ID, "non existing component id", NIC1_ID, VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
     }*/
 
 /*
     @Test(dependsOnMethods = "testList")
     public void testDelete() {
-        nicManager.deleteNic(VSP_ID, COMPONENT_ID, NIC1_ID, USER);
+        nicManager.deleteNic(VSP_ID, COMPONENT_ID, NIC1_ID);
         NicEntity actual = vendorSoftwareProductDao.getNic(VSP_ID, VERSION, COMPONENT_ID, NIC1_ID);
         Assert.assertNull(actual);
     }*/
 
   @Test
   public void testDeleteOnUploadVsp_negative() {
-    testDelete_negative(VSP_ID, VERSION, COMPONENT_ID, NIC1_ID, USER,
+    testDelete_negative(VSP_ID, VERSION, COMPONENT_ID, NIC1_ID,
         VendorSoftwareProductErrorCodes.DELETE_NIC_NOT_ALLOWED);
   }
 
   @Test(expectedExceptions = CoreException.class,
       expectedExceptionsMessageRegExp = NIC_NOT_EXIST_MSG)
   public void testGetNonExistingNicQuestionnaire() throws Exception {
-    nicManager.getNicQuestionnaire(VSP_ID, VERSION, COMPONENT_ID, NIC1_ID, USER);
+    nicManager.getNicQuestionnaire(VSP_ID, VERSION, COMPONENT_ID, NIC1_ID);
   }
 
   @Test
@@ -425,7 +427,7 @@
     doReturn(schema).when(nicManager).getNicQuestionnaireSchema(anyObject());
 
     QuestionnaireResponse questionnaire =
-        nicManager.getNicQuestionnaire(VSP_ID, VERSION, COMPONENT_ID, NIC1_ID, USER);
+        nicManager.getNicQuestionnaire(VSP_ID, VERSION, COMPONENT_ID, NIC1_ID);
     Assert.assertNotNull(questionnaire);
     Assert.assertEquals(questionnaire.getData(), nic.getQuestionnaireData());
     Assert.assertEquals(questionnaire.getSchema(), schema);
@@ -437,7 +439,7 @@
   public void testUpdateNonExistingNicQuestionnaire() throws Exception {
     doReturn(null).when(nicDao).get(anyObject());
     nicManager
-        .updateNicQuestionnaire(VSP_ID, VERSION, COMPONENT_ID, NIC1_ID, "questionnaire data", USER);
+        .updateNicQuestionnaire(VSP_ID, VERSION, COMPONENT_ID, NIC1_ID, "questionnaire data");
   }
 
   @Test
@@ -445,46 +447,45 @@
 
   }
 
-  private void testCreate_negative(NicEntity nic, String user, String expectedErrorCode) {
+  private void testCreate_negative(NicEntity nic, String expectedErrorCode) {
     try {
-      nicManager.createNic(nic, user);
+      nicManager.createNic(nic);
       Assert.fail();
     } catch (CoreException exception) {
-      log.debug("",exception);
+      log.debug("", exception);
       Assert.assertEquals(exception.code().id(), expectedErrorCode);
     }
   }
 
   private void testGet_negative(String vspId, Version version, String componentId, String nicId,
-                                String user, String expectedErrorCode) {
+                                String expectedErrorCode) {
     try {
-      nicManager.getNic(vspId, version, componentId, nicId, user);
+      nicManager.getNic(vspId, version, componentId, nicId);
       Assert.fail();
     } catch (CoreException exception) {
-      log.debug("",exception);
+      log.debug("", exception);
       Assert.assertEquals(exception.code().id(), expectedErrorCode);
     }
   }
 
   private void testUpdate_negative(String vspId, Version version, String componentId, String nicId,
-                                   String user, String expectedErrorCode) {
+                                   String expectedErrorCode) {
     try {
-      nicManager.updateNic(new NicEntity(vspId, version, componentId, nicId), user);
+      nicManager.updateNic(new NicEntity(vspId, version, componentId, nicId));
       Assert.fail();
     } catch (CoreException exception) {
-      log.debug("",exception);
+      log.debug("", exception);
       Assert.assertEquals(exception.code().id(), expectedErrorCode);
     }
   }
 
   private void testDelete_negative(String vspId, Version version, String componentId, String nicId,
-                                   String user,
                                    String expectedErrorCode) {
     try {
-      nicManager.deleteNic(vspId, version, componentId, nicId, user);
+      nicManager.deleteNic(vspId, version, componentId, nicId);
       Assert.fail();
     } catch (CoreException exception) {
-      log.debug("",exception);
+      log.debug("", exception);
       Assert.assertEquals(exception.code().id(), expectedErrorCode);
     }
   }
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/OrchestrationTemplateCandidateManagerImplTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/OrchestrationTemplateCandidateManagerImplTest.java
index d1cba65..26ec917 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/OrchestrationTemplateCandidateManagerImplTest.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/OrchestrationTemplateCandidateManagerImplTest.java
@@ -1,18 +1,14 @@
 package org.openecomp.sdc.vendorsoftwareproduct.impl;
 
-import static org.mockito.Matchers.anyObject;
-import static org.mockito.Matchers.eq;
-import static org.mockito.Mockito.doReturn;
-
 import org.mockito.InjectMocks;
 import org.mockito.Mock;
 import org.mockito.Mockito;
 import org.mockito.MockitoAnnotations;
 import org.openecomp.core.utilities.file.FileUtils;
 import org.openecomp.core.utilities.orchestration.OnboardingTypesEnum;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDao;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDependencyModelDao;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.OrchestrationTemplateDao;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDao;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentDependencyModelEntity;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity;
@@ -37,10 +33,13 @@
 import java.util.Map;
 import java.util.Optional;
 
+import static org.mockito.Matchers.anyObject;
+import static org.mockito.Matchers.eq;
+import static org.mockito.Mockito.doReturn;
+
 public class OrchestrationTemplateCandidateManagerImplTest {
-  private static final String USER1 = "vspTestUser1";
   private static final String VSP_ID = "vspId";
-  private static final Version VERSION01 = new Version(0, 1);
+  private static final Version VERSION01 = new Version("versionId");
 
   private static final String COMPONENT_ORIG_ID_1 = "Component_Pd_Server_Id_Orig";
   private static final String COMPONENT_ORIG_ID_2 = "Component_Sm_Server_Id_Orig";
@@ -58,8 +57,6 @@
   private static final String COMPONENT_NAME_4 = "ps_server";
 
   @Mock
-  private VendorSoftwareProductDao vendorSoftwareProductDaoMock;
-  @Mock
   private VendorSoftwareProductInfoDao vspInfoDaoMock;
   @Mock
   private CandidateService candidateServiceMock;
@@ -67,6 +64,8 @@
   private OrchestrationTemplateDao orchestrationTemplateDaoMock;
   @Mock
   private ComponentDependencyModelDao componentDependencyModelDaoMock;
+  @Mock
+  private ComponentDao componentDaoMock;
 
   @InjectMocks
   private OrchestrationTemplateCandidateManagerImpl candidateManager;
@@ -100,7 +99,7 @@
     doReturn(new VspDetails(VSP_ID, VERSION01))
         .when(vspInfoDaoMock).get(anyObject());
     doReturn(null)
-        .when(orchestrationTemplateDaoMock).getValidationData(anyObject(), anyObject());
+        .when(orchestrationTemplateDaoMock).getInfo(anyObject(), anyObject());
 
     doReturn("{}").when(candidateServiceMock).createManifest(anyObject(), anyObject());
     doReturn(Optional.empty()).when(candidateServiceMock)
@@ -109,7 +108,7 @@
 
 
     OrchestrationTemplateActionResponse response =
-        candidateManager.process(VSP_ID, VERSION01, USER1);
+        candidateManager.process(VSP_ID, VERSION01);
 
     Assert.assertNotNull(response);
   }
@@ -118,12 +117,11 @@
   public void testUpdateVspComponentDependenciesHeatReuploadMoreComponents() {
     Collection<ComponentDependencyModelEntity> existingComponentsDependencies =
         getExistingComponentDependencies();
-    doReturn(existingComponentsDependencies).
-        when(vendorSoftwareProductDaoMock).listComponentDependencies(anyObject(), anyObject());
+    doReturn(existingComponentsDependencies).when(componentDependencyModelDaoMock)
+        .list(anyObject());
     Collection<ComponentEntity> componentListWithMoreComponentsInHeat =
         getComponentListWithMoreComponentsInHeat();
-    doReturn(componentListWithMoreComponentsInHeat).when(vendorSoftwareProductDaoMock)
-        .listComponents(anyObject(), anyObject());
+    doReturn(componentListWithMoreComponentsInHeat).when(componentDaoMock).list(anyObject());
     Map<String, String> componentIdNameInfoBeforeProcess = getVspInitComponentIdNameInfo();
     orchestrationUtil.updateVspComponentDependencies(anyObject(), anyObject(),
         componentIdNameInfoBeforeProcess);
@@ -136,14 +134,14 @@
     Collection<ComponentDependencyModelEntity> existingComponentsDependencies =
         getExistingComponentDependencies();
     doReturn(existingComponentsDependencies).
-        when(vendorSoftwareProductDaoMock).listComponentDependencies(anyObject(), anyObject());
+        when(componentDependencyModelDaoMock).list(anyObject());
     Collection<ComponentEntity> componentListWithLessComponentsInHeat =
         getComponentListWithLessComponentsInHeat();
-    doReturn(componentListWithLessComponentsInHeat).when(vendorSoftwareProductDaoMock)
-        .listComponents(anyObject(), anyObject());
+    doReturn(componentListWithLessComponentsInHeat).when(componentDaoMock).list(anyObject());
     Map<String, String> componentIdNameInfoBeforeProcess = getVspInitComponentIdNameInfo();
-    orchestrationUtil.updateVspComponentDependencies(anyObject(), anyObject(),
-        componentIdNameInfoBeforeProcess);
+    orchestrationUtil
+        .updateVspComponentDependencies(anyObject(), anyObject(),
+            componentIdNameInfoBeforeProcess);
     Mockito.verify(componentDependencyModelDaoMock, Mockito.times(1)).update(anyObject());
     Mockito.verify(componentDependencyModelDaoMock, Mockito.times(1)).delete(anyObject());
   }
@@ -152,12 +150,11 @@
   public void testUpdateVspComponentDependenciesHeatReuploadSameComponents() {
     Collection<ComponentDependencyModelEntity> existingComponentsDependencies =
         getExistingComponentDependencies();
-    doReturn(existingComponentsDependencies).
-        when(vendorSoftwareProductDaoMock).listComponentDependencies(anyObject(), anyObject());
+    doReturn(existingComponentsDependencies).when(componentDependencyModelDaoMock)
+        .list(anyObject());
     Collection<ComponentEntity> componentListWithSameComponentsInHeat =
         getComponentListWithSameComponentsInHeat();
-    doReturn(componentListWithSameComponentsInHeat).when(vendorSoftwareProductDaoMock)
-        .listComponents(anyObject(), anyObject());
+    doReturn(componentListWithSameComponentsInHeat).when(componentDaoMock).list(anyObject());
     Map<String, String> componentIdNameInfoBeforeProcess = getVspInitComponentIdNameInfo();
     orchestrationUtil.updateVspComponentDependencies(anyObject(), anyObject(),
         componentIdNameInfoBeforeProcess);
@@ -169,12 +166,11 @@
   public void testUpdateVspComponentDependenciesHeatReuploadNoComponents() {
     Collection<ComponentDependencyModelEntity> existingComponentsDependencies =
         getExistingComponentDependencies();
-    doReturn(existingComponentsDependencies).
-        when(vendorSoftwareProductDaoMock).listComponentDependencies(anyObject(), anyObject());
+    doReturn(existingComponentsDependencies).when(componentDependencyModelDaoMock)
+        .list(anyObject());
     Collection<ComponentEntity> componentListWithMoreComponentsInHeat =
         new ArrayList<>();
-    doReturn(componentListWithMoreComponentsInHeat).when(vendorSoftwareProductDaoMock)
-        .listComponents(anyObject(), anyObject());
+    doReturn(componentListWithMoreComponentsInHeat).when(componentDaoMock).list(anyObject());
     Map<String, String> componentIdNameInfoBeforeProcess = getVspInitComponentIdNameInfo();
     orchestrationUtil.updateVspComponentDependencies(anyObject(), anyObject(),
         componentIdNameInfoBeforeProcess);
@@ -193,8 +189,7 @@
   @Test
   public void testVspComponentIdNameInfo() {
     Collection<ComponentEntity> initialVspComponents = getInitialVspComponents();
-    doReturn(initialVspComponents).when(vendorSoftwareProductDaoMock)
-        .listComponents(anyObject(), anyObject());
+    doReturn(initialVspComponents).when(componentDaoMock).list(anyObject());
     Map<String, String> vspComponentIdNameInfo =
         orchestrationUtil.getVspComponentIdNameInfo(anyObject(), anyObject());
     Assert.assertEquals(vspComponentIdNameInfo.size(), 3);
@@ -210,8 +205,7 @@
     componentEntity.setId(COMPONENT_ORIG_ID_4);
     initialVspComponents.add(componentEntity);
 
-    doReturn(initialVspComponents).when(vendorSoftwareProductDaoMock)
-        .listComponents(anyObject(), anyObject());
+    doReturn(initialVspComponents).when(componentDaoMock).list(anyObject());
     Map<String, String> vspComponentIdNameInfo =
         orchestrationUtil.getVspComponentIdNameInfo(anyObject(), anyObject());
     Assert.assertEquals(vspComponentIdNameInfo.size(), 3);
@@ -250,7 +244,7 @@
 
   private Collection<ComponentEntity> getComponentListWithLessComponentsInHeat() {
     Collection<ComponentEntity> vspComponents = getInitialVspComponents();
-    for (Iterator<ComponentEntity> iterator = vspComponents.iterator(); iterator.hasNext();) {
+    for (Iterator<ComponentEntity> iterator = vspComponents.iterator(); iterator.hasNext(); ) {
       ComponentEntity componentEntity = iterator.next();
       if (componentEntity.getComponentCompositionData().getName().equals(COMPONENT_NAME_1)) {
         iterator.remove();
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/OrchestrationTemplateProcessCsarHandlerTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/OrchestrationTemplateProcessCsarHandlerTest.java
index c2a207d..bc37273 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/OrchestrationTemplateProcessCsarHandlerTest.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/OrchestrationTemplateProcessCsarHandlerTest.java
@@ -6,14 +6,12 @@
 import org.openecomp.core.factory.impl.AbstractFactoryBase;
 import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.PackageInfoDaoFactory;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDaoFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.OrchestrationTemplateCandidateData;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
 import org.openecomp.sdc.vendorsoftwareproduct.factory.CandidateServiceFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.impl.mock.CandidateServiceFactoryMock;
 import org.openecomp.sdc.vendorsoftwareproduct.impl.mock.NoSqlDbFactoryMock;
 import org.openecomp.sdc.vendorsoftwareproduct.impl.mock.PackageInfoDaoFactoryImplMock;
-import org.openecomp.sdc.vendorsoftwareproduct.impl.mock.VendorSoftwareProductDaoFactoryMock;
 import org.openecomp.sdc.vendorsoftwareproduct.impl.orchestration.process.OrchestrationTemplateProcessCsarHandler;
 import org.openecomp.sdc.vendorsoftwareproduct.types.OrchestrationTemplateActionResponse;
 import org.openecomp.sdc.versioning.dao.types.Version;
@@ -21,27 +19,31 @@
 import java.nio.ByteBuffer;
 
 import static org.junit.Assert.assertFalse;
+
 public class OrchestrationTemplateProcessCsarHandlerTest {
 
 
-    @Before
-    public void insertMocks(){
-        EnrichmentManagerFactory.getInstance();
-        AbstractFactoryBase.registerFactory(NoSqlDbFactory.class, NoSqlDbFactoryMock.class);
-        AbstractFactoryBase.registerFactory(PackageInfoDaoFactory.class, PackageInfoDaoFactoryImplMock.class);
-        AbstractFactoryBase.registerFactory(PackageInfoDaoFactory.class, PackageInfoDaoFactoryImplMock.class);
-        AbstractFactoryBase.registerFactory(VendorSoftwareProductDaoFactory.class, VendorSoftwareProductDaoFactoryMock.class);
-        AbstractFactoryBase.registerFactory(CandidateServiceFactory.class, CandidateServiceFactoryMock.class);
-    }
+  @Before
+  public void insertMocks() {
+    EnrichmentManagerFactory.getInstance();
+    AbstractFactoryBase.registerFactory(NoSqlDbFactory.class, NoSqlDbFactoryMock.class);
+    AbstractFactoryBase
+        .registerFactory(PackageInfoDaoFactory.class, PackageInfoDaoFactoryImplMock.class);
+    AbstractFactoryBase
+        .registerFactory(PackageInfoDaoFactory.class, PackageInfoDaoFactoryImplMock.class);
+    AbstractFactoryBase
+        .registerFactory(CandidateServiceFactory.class, CandidateServiceFactoryMock.class);
+  }
 
 
-
-    @Test
-    public void validateErrorHandling(){
-        VspDetails vspDetails = new VspDetails("dummyId", new Version(1, 0));
-        OrchestrationTemplateCandidateData orchestrationTemplateCandidateData = new OrchestrationTemplateCandidateData(ByteBuffer.wrap("".getBytes()),"");
-        OrchestrationTemplateProcessCsarHandler handler = new OrchestrationTemplateProcessCsarHandler();
-        OrchestrationTemplateActionResponse response = handler.process(vspDetails, orchestrationTemplateCandidateData, "007");
-        assertFalse(response.getErrors().isEmpty());
-    }
+  @Test
+  public void validateErrorHandling() {
+    VspDetails vspDetails = new VspDetails("dummyId", new Version(1, 0));
+    OrchestrationTemplateCandidateData orchestrationTemplateCandidateData =
+        new OrchestrationTemplateCandidateData(ByteBuffer.wrap("".getBytes()), "", "zip", "file");
+    OrchestrationTemplateProcessCsarHandler handler = new OrchestrationTemplateProcessCsarHandler();
+    OrchestrationTemplateActionResponse response =
+        handler.process(vspDetails, orchestrationTemplateCandidateData);
+    assertFalse(response.getErrors().isEmpty());
+  }
 }
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ProcessManagerImplTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ProcessManagerImplTest.java
index 478bdfb..b925ab9 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ProcessManagerImplTest.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ProcessManagerImplTest.java
@@ -1,19 +1,18 @@
 package org.openecomp.sdc.vendorsoftwareproduct.impl;
 
+import org.mockito.ArgumentCaptor;
+import org.mockito.Captor;
 import org.mockito.InjectMocks;
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
 import org.mockito.Spy;
-import org.mockito.ArgumentCaptor;
-import org.mockito.Captor;
-import org.openecomp.sdc.activityLog.ActivityLogManager;
 import org.openecomp.sdc.activitylog.dao.type.ActivityLogEntity;
 import org.openecomp.sdc.common.errors.CoreException;
 import org.openecomp.sdc.common.errors.ErrorCategory;
 import org.openecomp.sdc.common.errors.ErrorCode;
 import org.openecomp.sdc.logging.api.Logger;
 import org.openecomp.sdc.logging.api.LoggerFactory;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.ProcessDao;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessType;
 import org.openecomp.sdc.versioning.dao.types.Version;
@@ -28,12 +27,13 @@
 import java.util.Arrays;
 import java.util.Collection;
 
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.eq;
 import static org.mockito.Mockito.doNothing;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.doThrow;
 import static org.mockito.Mockito.never;
 import static org.mockito.Mockito.verify;
-import static org.mockito.Matchers.eq;
 
 public class ProcessManagerImplTest {
 
@@ -48,9 +48,7 @@
   private static final String ARTIFACT_NAME = "artifact.sh";
 
   @Mock
-  private VendorSoftwareProductDao vendorSoftwareProductDaoMock;
-  @Mock
-  private ActivityLogManager activityLogManagerMock;
+  private ProcessDao processDaoMock;
 
   @InjectMocks
   @Spy
@@ -66,7 +64,7 @@
   @Test
   public void testListWhenNone() {
     Collection<ProcessEntity> processes =
-        processManager.listProcesses(VSP_ID, VERSION, COMPONENT_ID, USER1);
+        processManager.listProcesses(VSP_ID, VERSION, COMPONENT_ID);
     Assert.assertEquals(processes.size(), 0);
   }
 
@@ -75,17 +73,17 @@
     doReturn(Arrays.asList(
         createProcess(VSP_ID, VERSION, COMPONENT_ID, PROCESS1_ID),
         createProcess(VSP_ID, VERSION, COMPONENT_ID, PROCESS2_ID)))
-        .when(vendorSoftwareProductDaoMock).listProcesses(VSP_ID, VERSION, COMPONENT_ID);
+        .when(processDaoMock).list(any(ProcessEntity.class));
 
     Collection<ProcessEntity> actual =
-        processManager.listProcesses(VSP_ID, VERSION, COMPONENT_ID, USER1);
+        processManager.listProcesses(VSP_ID, VERSION, COMPONENT_ID);
     Assert.assertEquals(actual.size(), 2);
   }
 
   @Test
   public void testDeleteListWhenNone() {
-    processManager.deleteProcesses(VSP_ID, VERSION, COMPONENT_ID, USER1);
-    verify(vendorSoftwareProductDaoMock, never()).deleteProcesses(VSP_ID, VERSION, COMPONENT_ID);
+    processManager.deleteProcesses(VSP_ID, VERSION, COMPONENT_ID);
+    verify(processDaoMock, never()).delete(any(ProcessEntity.class));
   }
 
   @Test
@@ -93,15 +91,15 @@
     ProcessEntity process1 = createProcess(VSP_ID, VERSION, COMPONENT_ID, PROCESS1_ID);
     ProcessEntity process2 = createProcess(VSP_ID, VERSION, COMPONENT_ID, PROCESS2_ID);
     doReturn(Arrays.asList(process1, process2))
-        .when(vendorSoftwareProductDaoMock).listProcesses(VSP_ID, VERSION, COMPONENT_ID);
+        .when(processDaoMock).list(any(ProcessEntity.class));
     doNothing().when(processManager)
         .deleteUniqueValue(VSP_ID, VERSION, COMPONENT_ID, process1.getName());
     doNothing().when(processManager)
         .deleteUniqueValue(VSP_ID, VERSION, COMPONENT_ID, process2.getName());
 
-    processManager.deleteProcesses(VSP_ID, VERSION, COMPONENT_ID, USER1);
+    processManager.deleteProcesses(VSP_ID, VERSION, COMPONENT_ID);
 
-    verify(vendorSoftwareProductDaoMock).deleteProcesses(VSP_ID, VERSION, COMPONENT_ID);
+    verify(processDaoMock).deleteAll(eq(new ProcessEntity(VSP_ID, VERSION, COMPONENT_ID, null)));
     verify(processManager)
         .deleteUniqueValue(VSP_ID, VERSION, COMPONENT_ID, process1.getName());
     verify(processManager)
@@ -118,7 +116,7 @@
     doNothing().when(processManager)
         .createUniqueName(VSP_ID, VERSION, COMPONENT_ID, processToCreate.getName());
 
-    ProcessEntity process = processManager.createProcess(processToCreate, USER1);
+    ProcessEntity process = processManager.createProcess(processToCreate);
     Assert.assertNotNull(process);
     process.setId(process.getId());
 
@@ -134,13 +132,12 @@
         new ErrorCode.ErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION).build()))
         .when(processManager).validateUniqueName(VSP_ID, VERSION, COMPONENT_ID, process.getName());
 
-    processManager.createProcess(process, USER1);
+    processManager.createProcess(process);
   }
 
   @Test
   public void testUpdateNonExistingProcessId_negative() {
-    doReturn(null).when(vendorSoftwareProductDaoMock)
-        .getProcess(VSP_ID, VERSION, COMPONENT_ID, PROCESS1_ID);
+    doReturn(null).when(processDaoMock).get(any(ProcessEntity.class));
 
     testUpdate_negative(VSP_ID, VERSION, COMPONENT_ID, PROCESS1_ID, USER1,
         VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND);
@@ -149,8 +146,7 @@
   @Test(expectedExceptions = CoreException.class)
   public void testUpdateWithExistingName_negative() {
     ProcessEntity existingProcess = createProcess(VSP_ID, VERSION, COMPONENT_ID, PROCESS1_ID);
-    doReturn(existingProcess).when
-        (vendorSoftwareProductDaoMock).getProcess(VSP_ID, VERSION, COMPONENT_ID, PROCESS1_ID);
+    doReturn(existingProcess).when(processDaoMock).get(any(ProcessEntity.class));
 
     ProcessEntity processToUpdate = createProcess(VSP_ID, VERSION, COMPONENT_ID, PROCESS1_ID);
     doThrow(new CoreException(
@@ -159,22 +155,21 @@
         .updateUniqueName(VSP_ID, VERSION, COMPONENT_ID, existingProcess.getName(),
             processToUpdate.getName());
 
-    processManager.updateProcess(processToUpdate, USER1);
+    processManager.updateProcess(processToUpdate);
   }
 
   @Test
   public void testUpdate() {
     ProcessEntity existingProcess = createProcess(VSP_ID, VERSION, COMPONENT_ID, PROCESS1_ID);
-    doReturn(existingProcess).when
-        (vendorSoftwareProductDaoMock).getProcess(VSP_ID, VERSION, COMPONENT_ID, PROCESS1_ID);
+    doReturn(existingProcess).when(processDaoMock).get(any(ProcessEntity.class));
 
     ProcessEntity processToUpdate = createProcess(VSP_ID, VERSION, COMPONENT_ID, PROCESS1_ID);
     doNothing().when(processManager)
         .updateUniqueName(VSP_ID, VERSION, COMPONENT_ID, existingProcess.getName(),
             processToUpdate.getName());
 
-    processManager.updateProcess(processToUpdate, USER1);
-    verify(vendorSoftwareProductDaoMock).updateProcess(processToUpdate);
+    processManager.updateProcess(processToUpdate);
+    verify(processDaoMock).update(processToUpdate);
   }
 
 
@@ -187,10 +182,9 @@
   @Test
   public void testGet() {
     ProcessEntity process = createProcess(VSP_ID, VERSION, COMPONENT_ID, PROCESS1_ID);
-    doReturn(process).when
-        (vendorSoftwareProductDaoMock).getProcess(VSP_ID, VERSION, COMPONENT_ID, PROCESS1_ID);
+    doReturn(process).when(processDaoMock).get(any(ProcessEntity.class));
     ProcessEntity actual =
-        processManager.getProcess(VSP_ID, VERSION, COMPONENT_ID, PROCESS1_ID, USER1);
+        processManager.getProcess(VSP_ID, VERSION, COMPONENT_ID, PROCESS1_ID);
     Assert.assertEquals(actual, process);
     Assert.assertNull(actual.getArtifactName());
   }
@@ -199,29 +193,28 @@
   public void testGetAfterUploadArtifact() {
     ProcessEntity process = createProcess(VSP_ID, VERSION, COMPONENT_ID, PROCESS1_ID);
     process.setArtifactName(ARTIFACT_NAME);
-    doReturn(process).when
-        (vendorSoftwareProductDaoMock).getProcess(VSP_ID, VERSION, COMPONENT_ID, PROCESS1_ID);
+    doReturn(process).when(processDaoMock).get(any(ProcessEntity.class));
     ProcessEntity actual =
-        processManager.getProcess(VSP_ID, VERSION, COMPONENT_ID, PROCESS1_ID, USER1);
+        processManager.getProcess(VSP_ID, VERSION, COMPONENT_ID, PROCESS1_ID);
     Assert.assertEquals(actual, process);
     Assert.assertEquals(actual.getArtifactName(), ARTIFACT_NAME);
   }
 
   @Test(expectedExceptions = CoreException.class)
   public void testDeleteNonExistingProcessId_negative() {
-    processManager.deleteProcess(VSP_ID, VERSION, COMPONENT_ID, PROCESS1_ID, USER1);
+    processManager.deleteProcess(VSP_ID, VERSION, COMPONENT_ID, PROCESS1_ID);
   }
 
   @Test
   public void testDelete() {
     ProcessEntity processToDelete = createProcess(VSP_ID, VERSION, COMPONENT_ID, PROCESS1_ID);
-    doReturn(processToDelete).when
-        (vendorSoftwareProductDaoMock).getProcess(VSP_ID, VERSION, COMPONENT_ID, PROCESS1_ID);
+    doReturn(processToDelete).when(processDaoMock)
+        .get(any(ProcessEntity.class));
     doNothing().when(processManager).deleteUniqueValue(VSP_ID, VERSION, COMPONENT_ID,
         processToDelete.getName());
 
-    processManager.deleteProcess(VSP_ID, VERSION, COMPONENT_ID, PROCESS1_ID, USER1);
-    verify(vendorSoftwareProductDaoMock).deleteProcess(VSP_ID, VERSION, COMPONENT_ID, PROCESS1_ID);
+    processManager.deleteProcess(VSP_ID, VERSION, COMPONENT_ID, PROCESS1_ID);
+    verify(processDaoMock).delete(any(ProcessEntity.class));
     verify(processManager)
         .deleteUniqueValue(VSP_ID, VERSION, COMPONENT_ID, processToDelete.getName());
   }
@@ -235,21 +228,13 @@
   @Test
   public void testUploadArtifact() {
     ProcessEntity process = createProcess(VSP_ID, VERSION, COMPONENT_ID, PROCESS1_ID);
-    doReturn(process).when
-        (vendorSoftwareProductDaoMock).getProcess(VSP_ID, VERSION, COMPONENT_ID, PROCESS1_ID);
+    doReturn(process).when(processDaoMock).get(any(ProcessEntity.class));
 
     byte[] artifactBytes = "bla bla".getBytes();
     processManager
         .uploadProcessArtifact(new ByteArrayInputStream(artifactBytes), ARTIFACT_NAME,
-            VSP_ID, VERSION, COMPONENT_ID, PROCESS1_ID, USER1);
-    verify(vendorSoftwareProductDaoMock)
-        .uploadProcessArtifact(VSP_ID, VERSION, COMPONENT_ID, PROCESS1_ID, artifactBytes,
-            ARTIFACT_NAME);
-
-    verify(activityLogManagerMock).addActionLog(activityLogEntityArg.capture(), eq(USER1));
-    ActivityLogEntity activityLogEntity = activityLogEntityArg.getValue();
-    Assert.assertEquals(activityLogEntity.getVersionId(), String.valueOf(VERSION.getMajor()+1));
-    Assert.assertTrue(activityLogEntity.isSuccess());
+            VSP_ID, VERSION, COMPONENT_ID, PROCESS1_ID);
+    verify(processDaoMock).uploadArtifact(any(ProcessEntity.class));
   }
 
   @Test
@@ -269,11 +254,11 @@
     ProcessEntity processArtifact =
         new ProcessEntity(VSP_ID, VERSION, COMPONENT_ID, PROCESS1_ID);
     processArtifact.setArtifact(ByteBuffer.wrap("bla bla".getBytes()));
-    doReturn(processArtifact).when(vendorSoftwareProductDaoMock)
-        .getProcessArtifact(VSP_ID, VERSION, COMPONENT_ID, PROCESS1_ID);
+    doReturn(processArtifact).when(processDaoMock)
+        .getArtifact(any(ProcessEntity.class));
 
     File actual =
-        processManager.getProcessArtifact(VSP_ID, VERSION, COMPONENT_ID, PROCESS1_ID, USER1);
+        processManager.getProcessArtifact(VSP_ID, VERSION, COMPONENT_ID, PROCESS1_ID);
     Assert.assertNotNull(actual);
   }
 
@@ -294,12 +279,12 @@
     ProcessEntity processArtifact =
         new ProcessEntity(VSP_ID, VERSION, COMPONENT_ID, PROCESS1_ID);
     processArtifact.setArtifact(ByteBuffer.wrap("bla bla".getBytes()));
-    doReturn(processArtifact).when(vendorSoftwareProductDaoMock)
-        .getProcessArtifact(VSP_ID, VERSION, COMPONENT_ID, PROCESS1_ID);
+    doReturn(processArtifact).when(processDaoMock)
+        .getArtifact(any(ProcessEntity.class));
 
-    processManager.deleteProcessArtifact(VSP_ID, VERSION, COMPONENT_ID, PROCESS1_ID, USER1);
-    verify(vendorSoftwareProductDaoMock)
-        .deleteProcessArtifact(VSP_ID, VERSION, COMPONENT_ID, PROCESS1_ID);
+    processManager.deleteProcessArtifact(VSP_ID, VERSION, COMPONENT_ID, PROCESS1_ID);
+    verify(processDaoMock)
+        .deleteArtifact(any(ProcessEntity.class));
   }
 
 
@@ -315,10 +300,10 @@
   private void testGet_negative(String vspId, Version version, String componentId, String processId,
                                 String user, String expectedErrorCode) {
     try {
-      processManager.getProcess(vspId, version, componentId, processId, user);
+      processManager.getProcess(vspId, version, componentId, processId);
       Assert.fail();
     } catch (CoreException exception) {
-      log.debug("",exception);
+      log.debug("", exception);
       Assert.assertEquals(exception.code().id(), expectedErrorCode);
     }
   }
@@ -328,10 +313,10 @@
                                    String expectedErrorCode) {
     try {
       processManager
-          .updateProcess(new ProcessEntity(vspId, version, componentId, processId), user);
+          .updateProcess(new ProcessEntity(vspId, version, componentId, processId));
       Assert.fail();
     } catch (CoreException exception) {
-      log.debug("",exception);
+      log.debug("", exception);
       Assert.assertEquals(exception.code().id(), expectedErrorCode);
     }
   }
@@ -339,10 +324,10 @@
   private void testGetFile_negative(String vspId, Version version, String componentId,
                                     String processId, String user, String expectedErrorCode) {
     try {
-      processManager.getProcessArtifact(vspId, version, componentId, processId, user);
+      processManager.getProcessArtifact(vspId, version, componentId, processId);
       Assert.fail();
     } catch (CoreException exception) {
-      log.debug("",exception);
+      log.debug("", exception);
       Assert.assertEquals(exception.code().id(), expectedErrorCode);
     }
   }
@@ -353,10 +338,10 @@
     try {
       processManager
           .uploadProcessArtifact(new ByteArrayInputStream("bla bla".getBytes()), "artifact.sh",
-              vspId, version, componentId, processId, user);
+              vspId, version, componentId, processId);
       Assert.fail();
     } catch (CoreException exception) {
-      log.error("",exception);
+      log.error("", exception);
       Assert.assertEquals(exception.code().id(), expectedErrorCode);
     }
   }
@@ -364,10 +349,10 @@
   private void testDeleteArtifact_negative(String vspId, String componentId, String processId,
                                            String user, String expectedErrorCode) {
     try {
-      processManager.deleteProcessArtifact(vspId, VERSION, componentId, processId, user);
+      processManager.deleteProcessArtifact(vspId, VERSION, componentId, processId);
       Assert.fail();
     } catch (CoreException exception) {
-      log.debug("",exception);
+      log.debug("", exception);
       Assert.assertEquals(exception.code().id(), expectedErrorCode);
     }
   }
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImplTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImplTest.java
index 5199dfd..7721817 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImplTest.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImplTest.java
@@ -33,15 +33,12 @@
 import org.openecomp.core.model.types.ServiceElement;
 import org.openecomp.core.utilities.file.FileContentHandler;
 import org.openecomp.core.utilities.file.FileUtils;
-import org.openecomp.sdc.activityLog.ActivityLogManager;
 import org.openecomp.sdc.activitylog.dao.type.ActivityLogEntity;
 import org.openecomp.sdc.common.errors.CoreException;
 import org.openecomp.sdc.common.errors.ErrorCategory;
 import org.openecomp.sdc.common.errors.ErrorCode;
 import org.openecomp.sdc.common.errors.Messages;
 import org.openecomp.sdc.healing.api.HealingManager;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel;
 import org.openecomp.sdc.tosca.datatypes.model.CapabilityDefinition;
 import org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacade;
@@ -53,18 +50,16 @@
 import org.openecomp.sdc.vendorsoftwareproduct.dao.DeploymentFlavorDao;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.OrchestrationTemplateDao;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.PackageInfoDao;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDao;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.DeploymentFlavorEntity;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.OrchestrationTemplateEntity;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.PackageInfo;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.UploadDataEntity;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
 import org.openecomp.sdc.vendorsoftwareproduct.impl.mock.EnrichmentManagerFactoryImpl;
 import org.openecomp.sdc.vendorsoftwareproduct.informationArtifact.InformationArtifactGenerator;
 import org.openecomp.sdc.vendorsoftwareproduct.services.composition.CompositionEntityDataManager;
 import org.openecomp.sdc.vendorsoftwareproduct.types.UploadFileResponse;
 import org.openecomp.sdc.vendorsoftwareproduct.types.ValidationResponse;
-import org.openecomp.sdc.vendorsoftwareproduct.types.VersionedVendorSoftwareProductInfo;
 import org.openecomp.sdc.vendorsoftwareproduct.types.composition.DeploymentFlavor;
 import org.openecomp.sdc.versioning.VersioningManager;
 import org.openecomp.sdc.versioning.dao.types.Version;
@@ -94,7 +89,6 @@
 
 import static org.mockito.Matchers.any;
 import static org.mockito.Matchers.anyObject;
-import static org.mockito.Matchers.eq;
 import static org.mockito.Mockito.doNothing;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.doThrow;
@@ -103,13 +97,10 @@
 
 
 public class VendorSoftwareProductManagerImplTest {
-
-  private static final Logger LOG = LoggerFactory.getLogger(VendorSoftwareProductManagerImplTest.class);
-
   private static final String INVALID_VERSION_MSG = "Invalid requested version.";
 
-  private static final String VSP_ID = "vspId";
-  private static final String VERSION_ID = "versionId";
+  private static String VSP_ID = "vspId";
+  private static String VERSION_ID = "versionId";
   public static final Version VERSION01 = new Version(0, 1);
   private static final Version VERSION10 = new Version(1, 0);
   private static final String USER1 = "vspTestUser1";
@@ -121,8 +112,6 @@
   @Mock
   private VersioningManager versioningManagerMock;
   @Mock
-  private VendorSoftwareProductDao vendorSoftwareProductDaoMock; // todo get rid of
-  @Mock
   private OrchestrationTemplateDao orchestrationTemplateDataDaoMock;
   @Mock
   private VendorLicenseFacade vendorLicenseFacadeMock;
@@ -139,8 +128,6 @@
   @Mock
   private InformationArtifactGenerator informationArtifactGeneratorMock;
   @Mock
-  private ActivityLogManager activityLogManagerMock;
-  @Mock
   private PackageInfoDao packageInfoDao;
   @Mock
   private VendorSoftwareProductInfoDao vspInfoDaoMock;
@@ -164,14 +151,14 @@
   public void setUp() throws Exception {
     MockitoAnnotations.initMocks(this);
   }
-
+/*
   @Test
   public void testListWhenNone() {
     doReturn(new HashMap<>()).when(versioningManagerMock).listEntitiesVersionInfo
-            (VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, USER1,
-                    VersionableEntityAction.Read);
+        (VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, USER1,
+            VersionableEntityAction.Read);
     List<VersionedVendorSoftwareProductInfo> vsps =
-            vendorSoftwareProductManager.listVsps(null, USER1);
+        vendorSoftwareProductManager.listVsps(null);
     Assert.assertEquals(vsps.size(), 0);
   }
 
@@ -190,16 +177,16 @@
     vspsTobeReturned.put(vsp2id, versionInfo2);
 
     doReturn(vspsTobeReturned).when(versioningManagerMock).listEntitiesVersionInfo
-            (VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, USER1,
-                    VersionableEntityAction.Read);
+        (VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, USER1,
+            VersionableEntityAction.Read);
 
     VspDetails vsp1 = new VspDetails(vsp1id, VERSION01);
     vsp1.setWritetimeMicroSeconds(8L);
     doReturn(vsp1).when(vspInfoDaoMock)
-            .get(any(VspDetails.class));
+        .get(any(VspDetails.class));
 
     List<VersionedVendorSoftwareProductInfo> vsps =
-            vendorSoftwareProductManager.listVsps(null, USER1);
+        vendorSoftwareProductManager.listVsps(null);
     Assert.assertEquals(vsps.size(), 2);
   }
 
@@ -218,11 +205,11 @@
     vspsTobeReturned.put(vsp2id, versionInfo2);
 
     doReturn(vspsTobeReturned).when(versioningManagerMock).listEntitiesVersionInfo
-            (VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, USER1,
-                    VersionableEntityAction.Read);
+        (VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, USER1,
+            VersionableEntityAction.Read);
 
     List<VersionedVendorSoftwareProductInfo> vsps =
-            vendorSoftwareProductManager.listVsps(VersionStatus.Final.name(), USER1);
+        vendorSoftwareProductManager.listVsps(VersionStatus.Certified.name());
     Assert.assertEquals(vsps.size(), 0);
   }
 
@@ -242,53 +229,36 @@
     vspsTobeReturned.put(vsp2id, versionInfo2);
 
     doReturn(vspsTobeReturned).when(versioningManagerMock).listEntitiesVersionInfo
-            (VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, USER1,
-                    VersionableEntityAction.Read);
+        (VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, USER1,
+            VersionableEntityAction.Read);
 
     VspDetails vsp2 = new VspDetails(vsp2id, VERSION10);
     vsp2.setWritetimeMicroSeconds(8L);
     doReturn(vsp2).when(vspInfoDaoMock)
-            .get(any(VspDetails.class));
+        .get(any(VspDetails.class));
 
     List<VersionedVendorSoftwareProductInfo> vsps =
-            vendorSoftwareProductManager.listVsps(VersionStatus.Final.name(), USER1);
+        vendorSoftwareProductManager.listVsps(VersionStatus.Certified.name());
     Assert.assertEquals(vsps.size(), 1);
-  }
+  }*/
 
-  @Test(expectedExceptions = CoreException.class)
-  public void testCreateWithExistingName_negative() {
-    doThrow(new CoreException(
-            new ErrorCode.ErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION).build()))
-            .when(vendorSoftwareProductManager).validateUniqueName("Vsp1");
-    VspDetails expectedVsp =
-            createVspDetails(null, null, "Vsp1", "Test-vsp", "vendorName", "vlm1Id", "icon",
-                    "category", "subCategory", "123", null);
-
-    vendorSoftwareProductManager.createVsp(expectedVsp, USER1);
-  }
 
   @Test
   public void testCreate() {
-    doNothing().when(vendorSoftwareProductManager).validateUniqueName("Vsp1");
-    doNothing().when(vendorSoftwareProductManager).createUniqueName("Vsp1");
-    doReturn(VERSION01).when(versioningManagerMock).create(anyObject(), anyObject(), anyObject());
+    //doReturn(VERSION01).when(versioningManagerMock).create(anyObject(), anyObject(), anyObject());
     doReturn("{}")
-            .when(vendorSoftwareProductManager).getVspQuestionnaireSchema(anyObject());
+        .when(vendorSoftwareProductManager).getVspQuestionnaireSchema(anyObject());
 
     VspDetails vspToCreate =
-            createVspDetails(null, null, "Vsp1", "Test-vsp", "vendorName", "vlm1Id", "icon",
-                    "category", "subCategory", "123", null);
+        createVspDetails(null, null, "Vsp1", "Test-vsp", "vendorName", "vlm1Id", "icon",
+            "category", "subCategory", "123", null);
 
-    VspDetails vsp = vendorSoftwareProductManager.createVsp(vspToCreate, USER1);
+    VspDetails vsp = vendorSoftwareProductManager.createVsp(vspToCreate);
 
     Assert.assertNotNull(vsp);
     vspToCreate.setId(vsp.getId());
     vspToCreate.setVersion(VERSION01);
     assertVspsEquals(vsp, vspToCreate);
-    verify(activityLogManagerMock).addActionLog(activityLogEntityArg.capture(), eq(USER1));
-    ActivityLogEntity activityLogEntity = activityLogEntityArg.getValue();
-    Assert.assertEquals(activityLogEntity.getVersionId(), String.valueOf(VERSION01.getMajor() + 1));
-    Assert.assertTrue(activityLogEntity.isSuccess());
   }
 
   @Test(expectedExceptions = CoreException.class)
@@ -296,23 +266,23 @@
     VersionInfo versionInfo = new VersionInfo();
     versionInfo.setActiveVersion(VERSION01);
     doReturn(versionInfo).when(versioningManagerMock).getEntityVersionInfo(
-            VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, VSP_ID, USER1,
-            VersionableEntityAction.Write);
+        VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, VSP_ID, USER1,
+        VersionableEntityAction.Write);
 
     VspDetails existingVsp =
-            createVspDetails(VSP_ID, VERSION01, "Vsp1", "Test-existingVsp", "vendorName", "vlm1Id",
-                    "icon", "category", "subCategory", "123", null);
+        createVspDetails(VSP_ID, VERSION01, "Vsp1", "Test-existingVsp", "vendorName", "vlm1Id",
+            "icon", "category", "subCategory", "123", null);
     VspDetails updatedVsp =
-            createVspDetails(VSP_ID, VERSION01, "Vsp1_updated", "Test-existingVsp", "vendorName",
-                    "vlm1Id", "icon", "category", "subCategory", "123", null);
+        createVspDetails(VSP_ID, VERSION01, "Vsp1_updated", "Test-existingVsp", "vendorName",
+            "vlm1Id", "icon", "category", "subCategory", "123", null);
     doReturn(existingVsp).when(vspInfoDaoMock)
-            .get(any(VspDetails.class));
+        .get(any(VspDetails.class));
     doThrow(new CoreException(
-            new ErrorCode.ErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION).build()))
-            .when(vendorSoftwareProductManager)
-            .updateUniqueName(existingVsp.getName(), updatedVsp.getName());
+        new ErrorCode.ErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION).build()))
+        .when(vendorSoftwareProductManager)
+        .updateUniqueName(existingVsp.getName(), updatedVsp.getName());
 
-    vendorSoftwareProductManager.updateVsp(updatedVsp, USER1);
+    vendorSoftwareProductManager.updateVsp(updatedVsp);
   }
 
   @Test
@@ -320,23 +290,23 @@
     VersionInfo versionInfo = new VersionInfo();
     versionInfo.setActiveVersion(VERSION01);
     doReturn(versionInfo).when(versioningManagerMock).getEntityVersionInfo(
-            VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, VSP_ID, USER1,
-            VersionableEntityAction.Write);
+        VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, VSP_ID, USER1,
+        VersionableEntityAction.Write);
     VspDetails existingVsp =
-            createVspDetails(VSP_ID, VERSION01, "VSP1", null, "vendorName", "vlm1Id", "icon",
-                    "category",
-                    "subCategory", "456", null);
+        createVspDetails(VSP_ID, VERSION01, "VSP1", null, "vendorName", "vlm1Id", "icon",
+            "category",
+            "subCategory", "456", null);
     VspDetails updatedVsp =
-            createVspDetails(VSP_ID, VERSION01, "VSP1_updated", null, "vendorName", "vlm1Id", "icon",
-                    "category_updated",
-                    "subCategory", "456", null);
+        createVspDetails(VSP_ID, VERSION01, "VSP1_updated", null, "vendorName", "vlm1Id", "icon",
+            "category_updated",
+            "subCategory", "456", null);
     existingVsp.setWritetimeMicroSeconds(8L);
     doReturn(existingVsp).when(vspInfoDaoMock)
-            .get(any(VspDetails.class));
+        .get(any(VspDetails.class));
     doNothing().when(vendorSoftwareProductManager)
-            .updateUniqueName(existingVsp.getName(), updatedVsp.getName());
+        .updateUniqueName(existingVsp.getName(), updatedVsp.getName());
 
-    vendorSoftwareProductManager.updateVsp(updatedVsp, USER1);
+    vendorSoftwareProductManager.updateVsp(updatedVsp);
 
     verify(vspInfoDaoMock).update(updatedVsp);
   }
@@ -346,40 +316,41 @@
     VersionInfo versionInfo = new VersionInfo();
     versionInfo.setActiveVersion(VERSION01);
     doReturn(versionInfo).when(versioningManagerMock).getEntityVersionInfo(
-            VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, VSP_ID, USER1,
-            VersionableEntityAction.Write);
-    List<String> fgs = new ArrayList<>();
-    fgs.add("fg1"); fgs.add("fg2");
+        VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, VSP_ID, USER1,
+        VersionableEntityAction.Write);
+    List<String> fgs = new ArrayList<String>();
+    fgs.add("fg1");
+    fgs.add("fg2");
     VspDetails existingVsp =
-            createVspDetails(VSP_ID, VERSION01, "VSP1", null, "vendorName", "vlm1Id", "icon",
-                    "category",
-                    "subCategory", "456", fgs);
+        createVspDetails(VSP_ID, VERSION01, "VSP1", null, "vendorName", "vlm1Id", "icon",
+            "category",
+            "subCategory", "456", fgs);
 
-    List<String> updFgs = new ArrayList<>();
-    updFgs.add("fg2");
+    List<String> updFgs = new ArrayList<String>();
+    //updFgs.add("fg2");
     VspDetails updatedVsp =
-            createVspDetails(VSP_ID, VERSION01, "VSP1_updated", null, "vendorName", "vlm1Id", "icon",
-                    "category_updated",
-                    "subCategory", "456", updFgs);
+        createVspDetails(VSP_ID, VERSION01, "VSP1_updated", null, "vendorName", "vlm1Id", "icon",
+            "category_updated",
+            "subCategory", "456", updFgs);
     existingVsp.setWritetimeMicroSeconds(8L);
     doReturn(existingVsp).when(vspInfoDaoMock)
-            .get(any(VspDetails.class));
+        .get(any(VspDetails.class));
     doNothing().when(vendorSoftwareProductManager)
-            .updateUniqueName(existingVsp.getName(), updatedVsp.getName());
+        .updateUniqueName(existingVsp.getName(), updatedVsp.getName());
 
-    DeploymentFlavorEntity dfEntity = new DeploymentFlavorEntity(VSP_ID,VERSION01,"DF_ID");
+    DeploymentFlavorEntity dfEntity = new DeploymentFlavorEntity(VSP_ID, VERSION01, "DF_ID");
     DeploymentFlavor flavor = new DeploymentFlavor();
     flavor.setFeatureGroupId("fg1");
     dfEntity.setDeploymentFlavorCompositionData(flavor);
 
-    List<DeploymentFlavorEntity> dfList = new ArrayList<>();
+    List<DeploymentFlavorEntity> dfList = new ArrayList<DeploymentFlavorEntity>();
     dfList.add(dfEntity);
 
     doReturn(dfList).when(deploymentFlavorDaoMock).list(anyObject());
 
-    vendorSoftwareProductManager.updateVsp(updatedVsp, USER1);
+    vendorSoftwareProductManager.updateVsp(updatedVsp);
 
-    verify(vendorSoftwareProductDaoMock).updateDeploymentFlavor(dfEntity);
+    verify(deploymentFlavorDaoMock).update(dfEntity);
 
     Assert.assertNull(dfEntity.getDeploymentFlavorCompositionData().getFeatureGroupId());
 
@@ -389,7 +360,7 @@
   public void testGetNonExistingVersion_negative() {
     Version notExistversion = new Version(43, 8);
     doReturn(null).when(vspInfoDaoMock).get(any(VspDetails.class));
-    vendorSoftwareProductManager.getVsp(VSP_ID, notExistversion, USER1);
+    vendorSoftwareProductManager.getVsp(VSP_ID, notExistversion);
   }
 
   @Test
@@ -399,18 +370,18 @@
     versionInfo.setStatus(VersionStatus.Locked);
     versionInfo.setLockingUser(USER1);
     doReturn(versionInfo).when(versioningManagerMock).getEntityVersionInfo(
-            VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, VSP_ID, USER1,
-            VersionableEntityAction.Read);
+        VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, VSP_ID, USER1,
+        VersionableEntityAction.Read);
 
     VspDetails existingVsp =
-            createVspDetails(VSP_ID, VERSION01, "VSP1", null, "vendorName", "vlm1Id", "icon",
-                    "category",
-                    "subCategory", "456", null);
+        createVspDetails(VSP_ID, VERSION01, "VSP1", null, "vendorName", "vlm1Id", "icon",
+            "category",
+            "subCategory", "456", null);
     existingVsp.setWritetimeMicroSeconds(8L);
     doReturn(existingVsp).when(vspInfoDaoMock).get(any(VspDetails.class));
 
     VspDetails actualVsp =
-            vendorSoftwareProductManager.getVsp(VSP_ID, VERSION01, USER1);
+        vendorSoftwareProductManager.getVsp(VSP_ID, VERSION01);
 
     assertVspsEquals(actualVsp, existingVsp);
   }
@@ -423,84 +394,26 @@
     versionInfo.setStatus(VersionStatus.Locked);
     versionInfo.setLockingUser(USER2);
     doReturn(versionInfo).when(versioningManagerMock).getEntityVersionInfo(
-            VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, VSP_ID, USER1,
-            VersionableEntityAction.Read);
+        VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, VSP_ID, USER1,
+        VersionableEntityAction.Read);
 
     VspDetails existingVsp =
-            createVspDetails(VSP_ID, VERSION01, "VSP1", null, "vendorName", "vlm1Id", "icon",
-                    "category",
-                    "subCategory", "456", null);
+        createVspDetails(VSP_ID, VERSION01, "VSP1", null, "vendorName", "vlm1Id", "icon",
+            "category",
+            "subCategory", "456", null);
     existingVsp.setWritetimeMicroSeconds(8L);
     doReturn(existingVsp)
-            .when(vspInfoDaoMock).get(any(VspDetails.class));
+        .when(vspInfoDaoMock).get(any(VspDetails.class));
 
     VspDetails actualVsp =
-            vendorSoftwareProductManager.getVsp(VSP_ID, VERSION01, USER1);
+        vendorSoftwareProductManager.getVsp(VSP_ID, VERSION01);
 
     VspDetails expectedVsp =
-            vspInfoDaoMock
-                    .get(new VspDetails(VSP_ID, VERSION01));
+        vspInfoDaoMock
+            .get(new VspDetails(VSP_ID, VERSION01));
     assertVspsEquals(actualVsp, expectedVsp);
   }
 
-  @Test
-  public void testCheckin() {
-    doReturn(VERSION01).when(versioningManagerMock)
-            .checkin(VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, VSP_ID,
-                    USER1, null);
-    Version version = vendorSoftwareProductManager.checkin(VSP_ID, USER1);
-
-    Assert.assertEquals(version, VERSION01);
-    verify(versioningManagerMock)
-            .checkin(VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, VSP_ID,
-                    USER1, null);
-    verify(activityLogManagerMock).addActionLog(activityLogEntityArg.capture(), eq(USER1));
-    ActivityLogEntity activityLogEntity = activityLogEntityArg.getValue();
-    Assert.assertEquals(activityLogEntity.getVersionId(), String.valueOf(VERSION01.getMajor() + 1));
-    Assert.assertTrue(activityLogEntity.isSuccess());
-  }
-
-  @Test
-  public void testCheckout() {
-    doReturn(VERSION01).when(versioningManagerMock)
-            .checkout(VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, VSP_ID,
-                    USER1);
-    Version version = vendorSoftwareProductManager.checkout(VSP_ID, USER1);
-
-    Assert.assertEquals(version, VERSION01);
-    verify(versioningManagerMock)
-            .checkout(VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, VSP_ID,
-                    USER1);
-
-    verify(activityLogManagerMock).addActionLog(activityLogEntityArg.capture(), eq(USER1));
-    ActivityLogEntity activityLogEntity = activityLogEntityArg.getValue();
-    Assert.assertEquals(activityLogEntity.getVersionId(), String.valueOf(VERSION01.getMajor() + 1));
-    Assert.assertTrue(activityLogEntity.isSuccess());
-  }
-
-
-  @Test
-  public void testUndoCheckout() {
-    Version existingVersion = new Version(0, 2);
-    VersionInfo versionInfo = new VersionInfo();
-    versionInfo.setActiveVersion(existingVersion);
-    doReturn(versionInfo).when(versioningManagerMock).getEntityVersionInfo(
-            VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE,
-            VSP_ID, USER1, VersionableEntityAction.Read);
-
-    doReturn(VERSION01).when(versioningManagerMock).undoCheckout(VendorSoftwareProductConstants
-            .VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, VSP_ID, USER1);
-
-    VspDetails vsp = new VspDetails(VSP_ID, existingVersion);
-    vsp.setName("ExistingName");
-    doReturn(vsp).when(vspInfoDaoMock).get(anyObject());
-    doNothing().when(vendorSoftwareProductManager).updateUniqueName(vsp.getName(), vsp.getName());
-
-    Version undoCheckoutVersion = vendorSoftwareProductManager.undoCheckout(VSP_ID, USER1);
-
-    Assert.assertEquals(undoCheckoutVersion, VERSION01);
-  }
-
 /*
   @Test
   public void testSubmitWithMissingData() throws IOException {
@@ -551,35 +464,33 @@
     VersionInfo versionInfo = new VersionInfo();
     versionInfo.setActiveVersion(VERSION01);
     doReturn(versionInfo).when(versioningManagerMock).getEntityVersionInfo(
-            VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE,
-            VSP_ID, USER1, VersionableEntityAction.Read);
+        VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE,
+        VSP_ID, USER1, VersionableEntityAction.Read);
 
     VspDetails vsp =
-            createVspDetails(VSP_ID, VERSION01, "Vsp1", "Test-vsp", "vendorName", "vlm1Id", "icon",
-                    "category", "subCategory", "licenseAgreementId",
-                    Collections.singletonList("featureGroupId"));
+        createVspDetails(VSP_ID, VERSION01, "Vsp1", "Test-vsp", "vendorName", "vlm1Id", "icon",
+            "category", "subCategory", "licenseAgreementId",
+            Collections.singletonList("featureGroupId"));
     doReturn(vsp).when(vspInfoDaoMock).get(anyObject());
-    UploadDataEntity uploadData = new UploadDataEntity(VSP_ID, VERSION01);
+    OrchestrationTemplateEntity uploadData = new OrchestrationTemplateEntity(VSP_ID, VERSION01);
     uploadData.setContentData(
-            ByteBuffer.wrap(getBytes("/emptyComposition")));
+        ByteBuffer.wrap(FileUtils.toByteArray(getFileInputStream("/emptyComposition"))));
     doReturn(uploadData).when(orchestrationTemplateDataDaoMock)
-            .getOrchestrationTemplate(anyObject(), anyObject());
+        .get(anyObject(), anyObject());
     doReturn(new ToscaServiceModel(new FileContentHandler(), new HashMap<>(),
-            "MainServiceTemplate.yaml"))
-            .when(serviceModelDaoMock).getServiceModel(VSP_ID, VERSION01);
+        "MainServiceTemplate.yaml"))
+        .when(serviceModelDaoMock).getServiceModel(VSP_ID, VERSION01);
 
-    ValidationResponse validationResponse = vendorSoftwareProductManager.submit(VSP_ID, USER1);
+    ValidationResponse validationResponse =
+        vendorSoftwareProductManager.validate(VSP_ID, VERSION01);
     Assert.assertNotNull(validationResponse);
     Assert.assertFalse(validationResponse.isValid());
     Assert.assertNull(validationResponse.getVspErrors());
-    Assert.assertEquals(validationResponse.getLicensingDataErrors(), 1);
+    Assert.assertEquals(validationResponse.getLicensingDataErrors().size(), 1);
 
     verify(versioningManagerMock, never())
-            .submit(VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, VSP_ID,
-                    USER1, null);
-
-    //TODO - check..
-    verify(activityLogManagerMock, never()).addActionLog(any(ActivityLogEntity.class), eq(USER1));
+        .submit(VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, VSP_ID,
+            USER1, null);
   }
 
   // TODO: 3/15/2017 fix and enable
@@ -589,40 +500,32 @@
 
     EnrichmentManagerFactory.getInstance();
     AbstractFactoryBase
-            .registerFactory(EnrichmentManagerFactory.class, EnrichmentManagerFactoryImpl.class);
+        .registerFactory(EnrichmentManagerFactory.class, EnrichmentManagerFactoryImpl.class);
 
     VspDetails vsp =
-            createVspDetails(VSP_ID, VERSION01, "Vsp1", "Test-vsp", "vendorName", "vlm1Id", "icon",
-                    "category", "subCategory", "123", Collections.singletonList("fg1"));
+        createVspDetails(VSP_ID, VERSION01, "Vsp1", "Test-vsp", "vendorName", "vlm1Id", "icon",
+            "category", "subCategory", "123", Collections.singletonList("fg1"));
     doReturn(vsp).when(vspInfoDaoMock).get(anyObject());
-    UploadDataEntity uploadData = new UploadDataEntity(VSP_ID, VERSION01);
+    OrchestrationTemplateEntity uploadData = new OrchestrationTemplateEntity(VSP_ID, VERSION01);
     uploadData.setContentData(
-            ByteBuffer.wrap(getBytes("/emptyComposition")));
+        ByteBuffer.wrap(FileUtils.toByteArray(getFileInputStream("/emptyComposition"))));
     doReturn(uploadData).when(orchestrationTemplateDataDaoMock)
-            .getOrchestrationTemplate(anyObject(), anyObject());
+        .get(anyObject(), anyObject());
     doReturn(new ToscaServiceModel(new FileContentHandler(), new HashMap<>(),
-            "MainServiceTemplate.yaml"))
-            .when(serviceModelDaoMock).getServiceModel(VSP_ID, VERSION01);
+        "MainServiceTemplate.yaml"))
+        .when(serviceModelDaoMock).getServiceModel(VSP_ID, VERSION01);
 
-    ValidationResponse validationResponse = vendorSoftwareProductManager.submit(VSP_ID, USER1);
+    ValidationResponse validationResponse =
+        vendorSoftwareProductManager.validate(VSP_ID, VERSION01);
     Assert.assertTrue(validationResponse.isValid());
 
-/*    Assert.assertEquals(vsp2.getVersionInfo().getActiveVersion(), VERSION10);
-    Assert.assertEquals(vsp2.getVersionInfo().getStatus(), VersionStatus.Final);
+/*    Assert.assertEquals(vsp2.getVersionInfo().getVersion(), VERSION10);
+    Assert.assertEquals(vsp2.getVersionInfo().getStatus(), VersionStatus.Certified);
     Assert.assertNull(vsp2.getVersionInfo().getLockingUser());*/
 
     verify(versioningManagerMock)
-            .submit(VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, VSP_ID,
-                    USER1, null);
-    verify(activityLogManagerMock).addActionLog(activityLogEntityArg.capture(), eq(USER1));
-    ActivityLogEntity activityLogEntity = activityLogEntityArg.getValue();
-    Assert.assertEquals(activityLogEntity.getVersionId(), String.valueOf(VERSION10.getMajor()));
-    Assert.assertTrue(activityLogEntity.isSuccess());
-  }
-
-  @Test(expectedExceptions = CoreException.class)
-  public void testCreatePackageOnNonFinalVersion_negative() throws IOException {
-    vendorSoftwareProductManager.createPackage(VSP_ID, VERSION01, USER1);
+        .submit(VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, VSP_ID,
+            USER1, null);
   }
 
   @Test
@@ -632,11 +535,11 @@
     VersionInfo versionInfo = new VersionInfo();
     versionInfo.setActiveVersion(VERSION10);
     doReturn(versionInfo).when(versioningManagerMock).getEntityVersionInfo(
-            VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, VSP_ID, USER1,
-            VersionableEntityAction.Read);
+        VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, VSP_ID, USER1,
+        VersionableEntityAction.Read);
 
     doReturn(new ToscaServiceModel(new FileContentHandler(), new HashMap<>(), "")).when
-            (enrichedServiceModelDaoMock).getServiceModel(VSP_ID, VERSION10);
+        (enrichedServiceModelDaoMock).getServiceModel(VSP_ID, VERSION10);
 
     VspDetails vsp = new VspDetails(VSP_ID, VERSION10);
     vsp.setVendorId("vendorId");
@@ -645,20 +548,20 @@
     doReturn(vsp).when(vspInfoDaoMock).get(any(VspDetails.class));
 
     doReturn(new FileContentHandler()).when(licenseArtifactsServiceMock)
-            .createLicenseArtifacts(VSP_ID, vsp.getVendorId(), VERSION10, vsp.getFeatureGroups(),
-                    USER1);
+        .createLicenseArtifacts(VSP_ID, vsp.getVendorId(), VERSION10, vsp.getFeatureGroups()
+        );
 
-    PackageInfo packageInfo = vendorSoftwareProductManager.createPackage(VSP_ID, VERSION10, USER1);
+    PackageInfo packageInfo = vendorSoftwareProductManager.createPackage(VSP_ID, VERSION10);
     Assert.assertNotNull(packageInfo.getVspId());
   }
 
   // TODO: 3/15/2017 fix and enable
   //@Test(dependsOnMethods = {"testListFinals"})
   public void testUploadFileMissingFile() throws IOException {
+    try (InputStream zis = getFileInputStream("/vspmanager/zips/missingYml.zip")) {
 
-    try (InputStream zis = this.getClass().getResourceAsStream("/vspmanager/zips/missingYml.zip")) {
       UploadFileResponse uploadFileResponse =
-              candidateManager.upload(VSP_ID, VERSION01, zis, USER1, "zip", "missingYml");
+              candidateManager.upload(VSP_ID, VERSION01, zis, "zip", "file");
 
       Assert.assertEquals(uploadFileResponse.getErrors().size(), 0);
     }
@@ -667,38 +570,130 @@
   // TODO: 3/15/2017 fix and enable
   //@Test(dependsOnMethods = {"testUploadFileMissingFile"})
   public void testUploadNotZipFile() throws IOException {
-
     URL url = this.getClass().getResource("/notZipFile");
 
-    try (InputStream inputStream = url.openStream()) {
-      candidateManager
-              .upload(VSP_ID, VERSION01,
-                      inputStream, USER1, "zip", "notZipFile");
-      candidateManager.process(VSP_ID, VERSION01, USER1);
+    try {
+      candidateManager.upload(VSP_ID, VERSION01, url.openStream(), "zip", "file");
+      candidateManager.process(VSP_ID, VERSION01);
     } catch (Exception ce) {
       Assert.assertEquals(ce.getMessage(), Messages.CREATE_MANIFEST_FROM_ZIP.getErrorMessage());
     }
+  }
+/*
+  @Test
+  public void testEnrichModelInSubmit() {
+    UniqueValueUtil
+        .deleteUniqueValue(VendorSoftwareProductConstants.UniqueValues.VENDOR_SOFTWARE_PRODUCT_NAME,
+            "VSP_syb");
+    VspDetails vspDetails = vendorSoftwareProductManager.createVsp(
+        createVspDetails(null, null, "VSP_syb", "Test-vsp_syb", "vendorName", "vlm1Id", "icon",
+            "category", "subCategory", "456", null), USER1);
+    String id = vspDetails.getId();
 
-    verify(activityLogManagerMock, never()).addActionLog(any(ActivityLogEntity.class), eq(USER1));
+    //upload file
+    InputStream zis = getFileInputStream("/vspmanager/zips/fullComposition.zip");
+    candidateManager.upload(id, VERSION01, zis, USER1);
+    OrchestrationTemplateActionResponse uploadFileResponse =
+        candidateManager.process(id, VERSION01, USER1);
+
+    //check in
+    vendorSoftwareProductManager.checkin(id, USER1);
+    //submit
+    try {
+      ValidationResponse result = vendorSoftwareProductManager.submit(id, USER1);
+    } catch (IOException exception) {
+      Assert.fail();
+    }
+    VersionedVendorSoftwareProductInfo details =
+        vendorSoftwareProductManager.getVsp(id, null, USER1);
+    Collection<ComponentEntity> components =vendorSoftwareProductManager
+        .listComponents(id, details.getVersionInfo().getVersion(), USER1);
+
+    ToscaServiceModel model =
+        (ToscaServiceModel) EnrichedServiceModelDaoFactory.getInstance().createInterface()
+            .getServiceModel(id, details.getVersionInfo().getVersion());
+
+    Map<String, CapabilityDefinition> capabilities = new HashMap<>();
+    for (ComponentEntity component : components) {
+      model.getServiceTemplates().
+          entrySet().
+          stream().
+          filter(entryValue -> entryValue.getValue() != null &&
+              entryValue.getValue().getNode_types() != null &&
+              entryValue.getValue().
+                  getNode_types().
+                  containsKey(component.getComponentCompositionData().getName())).
+          forEach(entryValue -> entryValue.getValue().getNode_types().
+              values().
+              stream().
+              filter(type -> MapUtils.isNotEmpty(type.getCapabilities())).
+              forEach(type -> type.getCapabilities().
+                  entrySet().
+                  forEach(entry -> addCapability(entryValue.getKey(), capabilities, entry.getKey(),
+                      entry.getValue()))));
+
+    }
+
+    Assert.assertNotNull(capabilities);
   }
 
+  @Test(dependsOnMethods = {"testCreatePackage"})
+  public void testEnrichedFilesDeletedOnNewUpload() throws IOException {
+    Version activeVersion;
+
+    createPackageFromUpload(VSP_ID, USER1, "/fullComposition");
+    activeVersion = vendorSoftwareProductManager.getVsp(VSP_ID, null, USER1).getVersionInfo()
+        .getVersion();
+
+    List<ServiceArtifact> firstExternalArtifacts = enrichedServiceModelDaoMock
+        .getExternalArtifacts(VSP_ID, activeVersion);
+    ToscaServiceModel firstServiceModel = enrichedServiceModelDaoMock.getServiceModel(VSP_ID,
+        activeVersion);
+
+    createPackageFromUpload(VSP_ID, USER1, "/emptyComposition");
+    activeVersion = vendorSoftwareProductManager.getVsp(VSP_ID, null, USER1).getVersionInfo()
+        .getVersion();
+
+    List<ServiceArtifact> secondExternalArtifacts = enrichedServiceModelDaoMock
+        .getExternalArtifacts(VSP_ID, activeVersion);
+    ToscaServiceModel secondServiceModel = enrichedServiceModelDaoMock.getServiceModel(VSP_ID,
+        activeVersion);
+
+    Assert.assertNotEquals(firstExternalArtifacts, secondExternalArtifacts);
+    Assert.assertNotEquals(firstServiceModel, secondServiceModel);
+
+  }
+
+  @Test(dependsOnMethods = {"testMibsDeletedInCsar"})
+  public void testServiceTemplatesAreDeletedInCsarOnNewUpload() throws IOException {
+    String nestedPath = "Definitions" + File.separator + "nested";
+
+    uploadFileAndProcess(VSP_ID, USER1, "/vspmanager/zips/fullCompositionNested.zip");
+    checkinSubmitCreatePackage(VSP_ID, USER1);
+    List<String> nestedFileNamesServiceTemplates =
+        getWantedFileNamesFromCsar(nestedPath);
+
+    uploadFileAndProcess(VSP_ID, USER1, "/vspmanager/zips/fullComposition.zip");
+    checkinSubmitCreatePackage(VSP_ID, USER1);
+    List<String> emptyNestedNamesList = getWantedFileNamesFromCsar(nestedPath);
+
+    Assert.assertEquals(emptyNestedNamesList.size(), 0);
+    Assert.assertNotEquals(emptyNestedNamesList.size(), nestedFileNamesServiceTemplates.size());
+  }*/
 
   private List<String> getWantedFileNamesFromCsar(String pathInCsar)
-          throws IOException {
-    File translatedFile = vendorSoftwareProductManager.getTranslatedFile(VSP_ID, VERSION10, USER1);
+      throws IOException {
+    File translatedFile = vendorSoftwareProductManager.getTranslatedFile(VSP_ID, VERSION10);
 
     return getFileNamesFromFolderInCsar(translatedFile,
-            pathInCsar);
+        pathInCsar);
   }
 
   private List<String> getFileNamesFromFolderInCsar(File csar, String folderName)
-          throws IOException {
-
+      throws IOException {
     List<String> fileNames = new ArrayList<>();
 
-    try (FileInputStream fileInputStream = new FileInputStream(csar);
-         ZipInputStream zip = new ZipInputStream(fileInputStream)) {
-
+    try (ZipInputStream zip = new ZipInputStream(new FileInputStream(csar))) {
       ZipEntry ze;
 
       while ((ze = zip.getNextEntry()) != null) {
@@ -711,28 +706,26 @@
 
     return fileNames;
   }
+  /*
+  //Disabled for sonar null pointer issue for componentEntities
+  private Pair<String, String> uploadMib(String vspId, String user, String filePath,
+                                         String fileName) {
+    List<ComponentEntity> componentEntities = null;
+    //(List<ComponentEntity>) vendorSoftwareProductManager.listComponents(vspId, null, user);
+    monitoringUploadsManager.upload(getFileInputStream(filePath),
+        fileName, vspId,
+<<<<<<< HEAD
+        VERSION01, componentEntities.get(0).getId(), ArtifactType.SNMP_POLL);
+    //TODO: add validate of logActivity() func call
+=======
+        VERSION01, componentEntities.get(0).getId(), MonitoringUploadType.SNMP_POLL, user);
+    //TODO: add validate of addActionLog() func call
+>>>>>>> feature/Amdocs-ASDC-1710
 
-  private void createPackageFromUpload(String vspId, String user, String filePath)
-          throws IOException {
-    uploadFileAndProcess(vspId, user, filePath);
-    checkinSubmitCreatePackage(vspId, user);
-  }
-
-  private void uploadFileAndProcess(String vspId, String user, String filePath) throws IOException {
-    vendorSoftwareProductManager.checkout(vspId, user);
-
-    try (InputStream inputStream = this.getClass().getResourceAsStream(filePath)) {
-      candidateManager.upload(vspId, VERSION01, inputStream, user, "zip", "file");
-      candidateManager.process(vspId, VERSION01, user);
-    }
-  }
-
-  private void checkinSubmitCreatePackage(String vspId, String user) throws IOException {
-    vendorSoftwareProductManager.checkin(vspId, user);
-    ValidationResponse submitResponse = vendorSoftwareProductManager.submit(vspId, user);
-    Assert.assertTrue(submitResponse.isValid());
-    vendorSoftwareProductManager.createPackage(vspId, VERSION10, user);
-  }
+    return new ImmutablePair<>(componentEntities.get(0).getId(),
+        componentEntities.get(0).getComponentCompositionData()
+            .getDisplayName());
+  }*/
 
   // TODO: 3/15/2017 fix and enable
 /*
@@ -781,11 +774,11 @@
 */
 
   private void testLegalUpload(String vspId, Version version, InputStream upload, String user) {
-    candidateManager.upload(vspId, VERSION01, upload, USER1, "zip", "file");
-    candidateManager.process(vspId, VERSION01, user);
+    candidateManager.upload(vspId, VERSION01, upload, "zip", "file");
+    candidateManager.process(vspId, VERSION01);
 
-    UploadDataEntity uploadData =
-            orchestrationTemplateDataDaoMock.getOrchestrationTemplate(vspId, version);
+    OrchestrationTemplateEntity uploadData =
+        orchestrationTemplateDataDaoMock.get(vspId, version);
     Assert.assertNotNull(uploadData);
   }
 
@@ -795,20 +788,40 @@
     capabilities.put(entryValueKey + "_" + key, value);
   }
 
-  private byte[] getBytes(String fileName) throws IOException {
+  public InputStream getFileInputStream(String fileName) {
     URL url = this.getClass().getResource(fileName);
-    try (InputStream inputStream = url.openStream()) {
-      return FileUtils.toByteArray(inputStream);
+    try {
+      return url.openStream();
+    } catch (IOException exception) {
+      exception.printStackTrace();
+      return null;
     }
   }
 
-  private void assertVSPInWantedLocationInVSPList(String vspId, int location, String user) {
+/*  private void assertVSPInWantedLocationInVSPList(String vspId, int location, String user) {
     List<VersionedVendorSoftwareProductInfo> vspList =
-            vendorSoftwareProductManager.listVsps(null, user);
+        vendorSoftwareProductManager.listVsps(null);
     Assert.assertEquals(vspList.get(location).getVspDetails().getId(), vspId);
-  }
+  }*/
 
 
+  //  private void assertInfoArtifactIsInRightPathInCsar(String vspId, String zipFileName)
+//      throws IOException {
+//    ZipInputStream inputZipStream = new ZipInputStream(new FileInputStream(new File(zipFileName)));
+//    boolean isInfoArtifactInZip = false;
+//
+//    ZipEntry zipEntry;
+//    while ((zipEntry = inputZipStream.getNextEntry()) != null) {
+//      String currentEntryName = zipEntry.getName();
+//      if(currentEntryName.equals("Artifacts\\Informative\\Guide\\VSP_" +
+//          vspId + "_Information.txt")){
+//        isInfoArtifactInZip = true;
+//        break;
+//      }
+//    }
+//
+//    Assert.assertTrue(isInfoArtifactInZip);
+//  }
   static VspDetails createVspDetails(String id, Version version, String name, String desc,
                                      String vendorName, String vlm, String icon,
                                      String category, String subCategory,
@@ -842,30 +855,68 @@
     Assert.assertEquals(actual.getFeatureGroups(), expected.getFeatureGroups());
   }
 
- // todo ********************** move to common **************************************
+
+//    @Test
+//    public void testDownloadFile() throws IOException {
+//        VspDetails expectedVsp = VSPCommon.createVspDetails(null, null, String.format("VSP-test-%s", vlm1Id), "Test-vsp", "vendorName", "vlm1Id", "icon", "category", "subCategory", "123", null);
+//        VspDetails createdVsp = vendorSoftwareProductManager.createVsp(expectedVsp, USER1);
+//
+//        id005 = createdVsp.getId();
+//        Assert.assertNotNull(id005);
+//        Assert.assertNotNull(createdVsp.getVersion());
+//
+//        try (InputStream zipInputStream = new ZipFileUtils().getZipInputStream("/legalUploadWithWarning")) {
+//
+//            UploadFileResponse uploadFileResponse = vendorSoftwareProductManager.upload(id005, zipInputStream, USER1);
+//            vendorSoftwareProductManager.process(id005, USER1);
+//            Optional<File> fileCandidate = vendorSoftwareProductManager.get(id005, USER1);
+//
+//            File latestHeatPackage = fileCandidate.get();
+//
+//            zipInputStream.reset();
+//            byte[] uploaded = IOUtils.toByteArray(zipInputStream);
+//
+//            Optional<FileContentHandler> zipContentMap = vendorSoftwareProductManager.getZipContentMap(uploadFileResponse, uploaded);
+//            FileContentHandler fileContentHandler = new FileContentHandler();
+//            if(zipContentMap.isPresent()){
+//                 fileContentHandler = zipContentMap.get();
+//            }
+//
+//            uploaded = IOUtils.toByteArray(fileContentHandler.getFiles().values());
+//
+//            byte[] downloaded;
+//            try (BufferedInputStream fileStream = new BufferedInputStream(new FileInputStream(latestHeatPackage))) {
+//                downloaded = IOUtils.toByteArray(fileStream);
+//            }
+//
+//            Assert.assertTrue(Arrays.equals(uploaded, downloaded));
+//        }
+//    }
+
+  // todo ********************** move to common **************************************
 
   private void mockVersioning(VersionableEntityAction action) {
     VersionInfo versionInfo = new VersionInfo();
     versionInfo.setActiveVersion(VERSION01);
     doReturn(versionInfo).when(versioningManagerMock).getEntityVersionInfo(
-            VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, VSP_ID, USER1,
-            action);
+        VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, VSP_ID, USER1,
+        action);
   }
 
   private void mockVersioningEntityNotExist(VersionableEntityAction action, String vspId) {
     doThrow(new CoreException(new EntityNotExistErrorBuilder(
-            VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, vspId).build()))
-            .when(versioningManagerMock).getEntityVersionInfo(
-            VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, vspId, USER1,
-            action);
+        VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, vspId).build()))
+        .when(versioningManagerMock).getEntityVersionInfo(
+        VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, vspId, USER1,
+        action);
   }
 
   private void MockVersioningEntityLocked(VersionableEntityAction action) {
     doThrow(new CoreException(new EditOnEntityLockedByOtherErrorBuilder(
-            VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, VSP_ID, USER1)
-            .build()))
-            .when(versioningManagerMock).getEntityVersionInfo(
-            VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, VSP_ID, USER2,
-            action);
+        VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, VSP_ID, USER1)
+        .build()))
+        .when(versioningManagerMock).getEntityVersionInfo(
+        VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, VSP_ID, USER2,
+        action);
   }
 }
\ No newline at end of file
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/mock/VendorSoftwareProductDaoFactoryMock.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/mock/VendorSoftwareProductDaoFactoryMock.java
deleted file mode 100644
index ede8620..0000000
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/mock/VendorSoftwareProductDaoFactoryMock.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package org.openecomp.sdc.vendorsoftwareproduct.impl.mock;
-
-import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDaoFactory;
-
-public class VendorSoftwareProductDaoFactoryMock extends VendorSoftwareProductDaoFactory {
-
-    @Override
-    public VendorSoftwareProductDao createInterface() {
-        return null;
-    }
-}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/CandidateServiceImplTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/CandidateServiceImplTest.java
index 3d98ab7..1c9d61b 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/CandidateServiceImplTest.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/CandidateServiceImplTest.java
@@ -30,7 +30,6 @@
 import org.openecomp.sdc.heat.datatypes.manifest.FileData;
 import org.openecomp.sdc.heat.datatypes.manifest.ManifestContent;
 import org.openecomp.sdc.heat.datatypes.structure.HeatStructureTree;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
 import org.openecomp.sdc.vendorsoftwareproduct.services.filedatastructuremodule.ManifestCreator;
 import org.openecomp.sdc.vendorsoftwareproduct.services.impl.filedatastructuremodule.CandidateServiceImpl;
@@ -57,8 +56,6 @@
 public class CandidateServiceImplTest {
   @Mock
   private ManifestCreator manifestCreatorMock;
-  @Mock
-  private VendorSoftwareProductDao vendorSoftwareProductDaoMock;
   @InjectMocks
   private CandidateServiceImpl candidateService;
 
@@ -95,7 +92,8 @@
     //vspDetails.setOnboardingMethod(VSPCommon.OnboardingMethod.HEAT.name());
     vspDetails.setOnboardingMethod("HEAT");
 
-    FilesDataStructure structure = JsonUtil.json2Object(getExpectedJson(), FilesDataStructure.class);
+    FilesDataStructure structure =
+        JsonUtil.json2Object(getExpectedJson(), FilesDataStructure.class);
 
     Optional<ManifestContent> expectedManifest = getExpectedManifestJson();
     doReturn(expectedManifest)
@@ -191,7 +189,8 @@
     fileData = createFileData("file1.yaml", true, FileData.Type.HEAT, null);
     mockFileData.add(fileData);
     fileData = createFileData("file1_vol.yaml", null, FileData.Type.HEAT_VOL, fileData);
-    fileData = createFileData("file1.env", null, FileData.Type.HEAT_ENV, mockFileData.get(1).getData().get(0));
+    fileData = createFileData("file1.env", null, FileData.Type.HEAT_ENV,
+        mockFileData.get(1).getData().get(0));
     mockFileData.add(createFileData("file2.sh", null, FileData.Type.OTHER, null));
     mockFileData.add(createFileData("file3.yml", null, FileData.Type.OTHER, null));
     mock.setData(mockFileData);
@@ -202,7 +201,7 @@
                                   FileData fileDataToAddTo) {
     FileData fileData = new FileData();
     fileData.setFile(fileName);
-    if(isBase != null) {
+    if (isBase != null) {
       fileData.setBase(isBase);
     }
     fileData.setType(fileType);
@@ -211,11 +210,9 @@
   }
 
   private void addFileDataToList(FileData fileDataToAddTo, FileData fileData) {
-    if(fileDataToAddTo != null)
-    {
+    if (fileDataToAddTo != null) {
       List<FileData> list = fileDataToAddTo.getData();
-      if(CollectionUtils.isEmpty(list))
-      {
+      if (CollectionUtils.isEmpty(list)) {
         list = new ArrayList<>();
       }
       list.add(fileData);
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/composition/CompositionDataExtractorImplTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/composition/CompositionDataExtractorImplTest.java
index 2f85f30..9385d4a 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/composition/CompositionDataExtractorImplTest.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/composition/CompositionDataExtractorImplTest.java
@@ -27,8 +27,8 @@
 import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel;
 import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
-import org.openecomp.sdc.tosca.services.ToscaUtil;
 import org.openecomp.sdc.tosca.services.ToscaExtensionYamlUtil;
+import org.openecomp.sdc.tosca.services.ToscaUtil;
 import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Component;
 import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionData;
 import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Network;
@@ -110,11 +110,12 @@
       try (InputStream yamlFile = new FileInputStream(file)) {
         ServiceTemplate serviceTemplateFromYaml =
             toscaExtensionYamlUtil.yamlToObject(yamlFile, ServiceTemplate.class);
-        serviceTemplates.put(ToscaUtil.getServiceTemplateFileName(serviceTemplateFromYaml), serviceTemplateFromYaml);
+        serviceTemplates.put(ToscaUtil.getServiceTemplateFileName(serviceTemplateFromYaml),
+            serviceTemplateFromYaml);
         try {
           yamlFile.close();
         } catch (IOException ignore) {
-          log.debug("",ignore);
+          log.debug("", ignore);
         }
       } catch (FileNotFoundException exception) {
         throw exception;
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/composition/CompositionEntityDataManagerImplTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/composition/CompositionEntityDataManagerImplTest.java
index 1acd58d..0d9245d 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/composition/CompositionEntityDataManagerImplTest.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/composition/CompositionEntityDataManagerImplTest.java
@@ -22,12 +22,10 @@
 
 import org.apache.commons.collections.CollectionUtils;
 import org.mockito.InjectMocks;
-import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
 import org.mockito.Spy;
 import org.openecomp.core.utilities.file.FileUtils;
 import org.openecomp.sdc.common.errors.CoreException;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity;
@@ -43,6 +41,7 @@
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
 import java.util.Map;
@@ -90,8 +89,6 @@
       "}";
 
   private Map<CompositionEntityId, Collection<String>> errorsById;
-  @Mock
-  private VendorSoftwareProductDao vendorSoftwareProductDaoMock;
   @InjectMocks
   @Spy
   private CompositionEntityDataManagerImpl compositionEntityDataManager;
@@ -248,7 +245,7 @@
 
     Map<CompositionEntityId, Collection<String>> errorsById =
         compositionEntityDataManager.validateEntitiesQuestionnaire();
-    Assert.assertEquals(errorsById.size(), 0);
+    Assert.assertEquals(errorsById.size(), 1);
   }
 
   @Test(dependsOnMethods = "testNicAndComponentValidQuestionnaire")
@@ -259,9 +256,9 @@
 
     Map<CompositionEntityId, Collection<String>> errorsById =
         compositionEntityDataManager.validateEntitiesQuestionnaire();
-    Assert.assertEquals(errorsById.size(), 1);
+    Assert.assertEquals(errorsById.size(), 2);
 
-    CompositionEntityId component = errorsById.keySet().iterator().next();
+    CompositionEntityId component = new ArrayList<>(errorsById.keySet()).get(1);
     List<String> errors = (List<String>) errorsById.get(component);
     Assert.assertEquals(errors.size(), 1);
     Assert.assertEquals(errors.get(0),
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/services/schemagenerator/SchemaGeneratorTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/services/schemagenerator/SchemaGeneratorTest.java
index acd76a1..237e9cc 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/services/schemagenerator/SchemaGeneratorTest.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/services/schemagenerator/SchemaGeneratorTest.java
@@ -20,27 +20,6 @@
 
 package org.openecomp.sdc.vendorsoftwareproduct.services.schemagenerator;
 
-import org.everit.json.schema.EmptySchema;
-import org.everit.json.schema.loader.SchemaLoader;
-import org.json.JSONObject;
-import org.openecomp.core.utilities.json.JsonUtil;
-import org.openecomp.sdc.vendorsoftwareproduct.services.schemagenerator.SchemaGenerator;
-import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentData;
-import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityType;
-import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Network;
-import org.openecomp.sdc.vendorsoftwareproduct.types.composition.NetworkType;
-import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Nic;
-import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.ComponentCompositionSchemaInput;
-import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.ComponentQuestionnaireSchemaInput;
-import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.NetworkCompositionSchemaInput;
-import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.NicCompositionSchemaInput;
-import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.SchemaTemplateContext;
-import org.testng.Assert;
-import org.testng.annotations.Test;
-
-import java.util.Arrays;
-import java.util.Map;
-
 public class SchemaGeneratorTest {
   /*
 
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/tree/UploadFileTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/tree/UploadFileTest.java
index df386b1..2a475fe 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/tree/UploadFileTest.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/tree/UploadFileTest.java
@@ -21,9 +21,6 @@
 package org.openecomp.sdc.vendorsoftwareproduct.tree;
 
 
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.doReturn;
-
 import org.mockito.InjectMocks;
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
@@ -32,13 +29,10 @@
 import org.openecomp.core.model.types.ServiceElement;
 import org.openecomp.core.utilities.orchestration.OnboardingTypesEnum;
 import org.openecomp.sdc.healing.api.HealingManager;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.OrchestrationTemplateDao;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDao;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.UploadDataEntity;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.OrchestrationTemplateEntity;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
 import org.openecomp.sdc.vendorsoftwareproduct.impl.OrchestrationTemplateCandidateManagerImpl;
 import org.openecomp.sdc.vendorsoftwareproduct.services.composition.CompositionDataExtractor;
@@ -50,7 +44,11 @@
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
-import java.io.*;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
 import java.net.URL;
 import java.util.zip.ZipOutputStream;
 
@@ -59,70 +57,69 @@
 import static org.testng.Assert.assertEquals;
 
 public class UploadFileTest {
-    private static final String USER1 = "vspTestUser1";
+  private static final String USER1 = "vspTestUser1";
 
-    public static final Version VERSION01 = new Version(0, 1);
-    @Mock
-    private VendorSoftwareProductDao vendorSoftwareProductDaoMock;
-    @Mock
-    private OrchestrationTemplateDao orchestrationTemplateDataDaoMock;
-    @Spy
-    private CandidateServiceImpl candidateService;
-    @Mock
-    private HealingManager healingManagerMock;
-    @Mock
-    private CompositionDataExtractor compositionDataExtractorMock;
-    @Mock
-    private ServiceModelDao<ToscaServiceModel, ServiceElement> serviceModelDaoMock;
-    @Mock
-    private CompositionEntityDataManager compositionEntityDataManagerMock;
-    @Mock
-    private VendorSoftwareProductInfoDao vspInfoDaoMock;
+  public static final Version VERSION01 = new Version(0, 1);
 
-    @InjectMocks
-    private OrchestrationTemplateCandidateManagerImpl candidateManager;
+  @Mock
+  private OrchestrationTemplateDao orchestrationTemplateDataDaoMock;
+  @Spy
+  private CandidateServiceImpl candidateService;
+  @Mock
+  private HealingManager healingManagerMock;
+  @Mock
+  private CompositionDataExtractor compositionDataExtractorMock;
+  @Mock
+  private ServiceModelDao<ToscaServiceModel, ServiceElement> serviceModelDaoMock;
+  @Mock
+  private CompositionEntityDataManager compositionEntityDataManagerMock;
+  @Mock
+  private VendorSoftwareProductInfoDao vspInfoDaoMock;
 
-    private static String vlm1Id;
-    public static String id001 = null;
-    public static String id002 = null;
+  @InjectMocks
+  private OrchestrationTemplateCandidateManagerImpl candidateManager;
 
-    public static Version activeVersion002 = null;
+  private static String vlm1Id;
+  public static String id001 = null;
+  public static String id002 = null;
+
+  public static Version activeVersion002 = null;
 
 
-    @BeforeMethod
-    public void setUp() throws Exception {
-        MockitoAnnotations.initMocks(this);
+  @BeforeMethod
+  public void setUp() throws Exception {
+    MockitoAnnotations.initMocks(this);
+  }
+
+  @Test
+  public void testUploadFile() {
+    VspDetails vspDetails = new VspDetails("dummyId", new Version(1, 0));
+    doReturn(vspDetails).when(vspInfoDaoMock).get(any(VspDetails.class));
+    candidateManager.upload(id001, activeVersion002, getZipInputStream("/legalUpload"),
+        OnboardingTypesEnum.ZIP.toString(), "legalUpload");
+  }
+
+
+  private void testLegalUpload(String vspId, Version version, InputStream upload, String user) {
+    UploadFileResponse uploadFileResponse = candidateManager.upload(vspId, activeVersion002,
+        upload, OnboardingTypesEnum.ZIP.toString(), "file");
+    assertEquals(uploadFileResponse.getOnboardingType(), OnboardingTypesEnum.ZIP);
+    OrchestrationTemplateEntity uploadData = orchestrationTemplateDataDaoMock.get(vspId, version);
+
+  }
+
+  public InputStream getZipInputStream(String name) {
+    URL url = this.getClass().getResource(name);
+    File templateDir = new File(url.getFile());
+
+    ByteArrayOutputStream baos = new ByteArrayOutputStream();
+    try (ZipOutputStream zos = new ZipOutputStream(baos)) {
+      VSPCommon.zipDir(templateDir, "", zos, true);
+    } catch (IOException e) {
+      e.printStackTrace();
     }
-
-    @Test
-    public void testUploadFile() {
-        VspDetails vspDetails = new VspDetails("dummyId", new Version(1, 0));
-        doReturn(vspDetails).when(vspInfoDaoMock).get(any(VspDetails.class));
-        candidateManager.upload(id001, activeVersion002, getZipInputStream("/legalUpload"), USER1, OnboardingTypesEnum.ZIP.toString(), "legalUpload");
-    }
-
-
-    private void testLegalUpload(String vspId, Version version, InputStream upload, String user) {
-        UploadFileResponse uploadFileResponse = candidateManager.upload(vspId, activeVersion002,
-            upload, user, OnboardingTypesEnum.ZIP.toString(),"file" );
-        assertEquals(uploadFileResponse.getOnboardingType(), OnboardingTypesEnum.ZIP);
-        UploadDataEntity uploadData =
-                orchestrationTemplateDataDaoMock.getOrchestrationTemplate(vspId, version);
-
-    }
-
-    public InputStream getZipInputStream(String name) {
-        URL url = this.getClass().getResource(name);
-        File templateDir = new File(url.getFile());
-
-        ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        try (ZipOutputStream zos = new ZipOutputStream(baos)) {
-            VSPCommon.zipDir(templateDir, "", zos, true);
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
-        return new ByteArrayInputStream(baos.toByteArray());
-    }
+    return new ByteArrayInputStream(baos.toByteArray());
+  }
 
 
 }
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/upload/HeatCleanup/HeatCleanupOnNewUploadTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/upload/HeatCleanup/HeatCleanupOnNewUploadTest.java
index 4d925c0..13f3859 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/upload/HeatCleanup/HeatCleanupOnNewUploadTest.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/upload/HeatCleanup/HeatCleanupOnNewUploadTest.java
@@ -38,7 +38,7 @@
     UploadDataEntity uploadDataEntity =
         vendorSoftwareProductDao.getUploadData(new UploadDataEntity(vspId, vspActiveVersion));
     Assert.assertTrue((uploadDataEntity.getContentData() != null) == exist);
-    Assert.assertTrue((uploadDataEntity.getValidationData() != null) == exist);
+    Assert.assertTrue((uploadDataEntity.getInfo() != null) == exist);
     Assert.assertTrue((uploadDataEntity.getPackageName() != null) == exist);
     Assert.assertTrue((uploadDataEntity.getPackageVersion() != null) == exist);
     //TODO: talio - delete enrich data on new upload
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/upload/csar/ManifestParsingTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/upload/csar/ManifestParsingTest.java
index 3332e81..ee451e0 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/upload/csar/ManifestParsingTest.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/upload/csar/ManifestParsingTest.java
@@ -7,52 +7,55 @@
 import java.io.IOException;
 import java.io.InputStream;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
 
 public class ManifestParsingTest {
 
-    @Test
-    public void testSuccessfulParsing() throws IOException {
-        try (InputStream is = getClass().getResourceAsStream("/vspmanager.csar/manifest/ValidTosca.mf")) {
-            OnboardingManifest onboardingManifest = new OnboardingManifest(is);
-            assertTrue(onboardingManifest.isValid());
-            assertEquals(onboardingManifest.getMetadata().size(), 4);
-            assertEquals(onboardingManifest.getSources().size(), 5);
-        }
+  @Test
+  public void testSuccessfulParsing() throws IOException {
+    try (InputStream is = getClass()
+        .getResourceAsStream("/vspmanager.csar/manifest/ValidTosca.mf")) {
+      OnboardingManifest onboardingManifest = new OnboardingManifest(is);
+      assertTrue(onboardingManifest.isValid());
+      assertEquals(onboardingManifest.getMetadata().size(), 4);
+      assertEquals(onboardingManifest.getSources().size(), 5);
     }
+  }
 
-    @Test
-    public void testNoMetadataParsing() throws IOException {
-        try (InputStream is = getClass().getResourceAsStream("/vspmanager.csar/manifest/InvalidTosca1.mf")) {
-            OnboardingManifest onboardingManifest = new OnboardingManifest(is);
-            assertFalse(onboardingManifest.isValid());
-            assertTrue(onboardingManifest.getErrors().stream().
-                    filter(error -> error.contains(Messages.MANIFEST_INVALID_LINE.getErrorMessage().substring(0, 10)))
-                    .findAny().isPresent());
-        }
+  @Test
+  public void testNoMetadataParsing() throws IOException {
+    try (InputStream is = getClass()
+        .getResourceAsStream("/vspmanager.csar/manifest/InvalidTosca1.mf")) {
+      OnboardingManifest onboardingManifest = new OnboardingManifest(is);
+      assertFalse(onboardingManifest.isValid());
+      assertTrue(onboardingManifest.getErrors().stream().anyMatch(error -> error
+          .contains(Messages.MANIFEST_INVALID_LINE.getErrorMessage().substring(0, 10))));
     }
+  }
 
-    @Test
-    public void testBrokenMDParsing() throws IOException {
-        try (InputStream is = getClass().getResourceAsStream("/vspmanager.csar/manifest/InvalidTosca2.mf")) {
-            OnboardingManifest onboardingManifest = new OnboardingManifest(is);
-            assertFalse(onboardingManifest.isValid());
-            assertTrue(onboardingManifest.getErrors().stream().
-                    filter(error -> error.contains(Messages.MANIFEST_INVALID_LINE.getErrorMessage().substring(0, 10)))
-                    .findAny().isPresent());
-        }
+  @Test
+  public void testBrokenMDParsing() throws IOException {
+    try (InputStream is = getClass()
+        .getResourceAsStream("/vspmanager.csar/manifest/InvalidTosca2.mf")) {
+      OnboardingManifest onboardingManifest = new OnboardingManifest(is);
+      assertFalse(onboardingManifest.isValid());
+      assertTrue(onboardingManifest.getErrors().stream().anyMatch(error -> error
+          .contains(Messages.MANIFEST_INVALID_LINE.getErrorMessage().substring(0, 10))));
     }
+  }
 
-    @Test
-    public void testNoMetaParsing() throws IOException {
-        try (InputStream is = getClass().getResourceAsStream("/vspmanager.csar/manifest/InvalidTosca4.mf")) {
-            OnboardingManifest onboardingManifest = new OnboardingManifest(is);
-            assertFalse(onboardingManifest.isValid());
-            assertTrue(onboardingManifest.getErrors().stream().
-                    filter(error -> error.contains(Messages.MANIFEST_NO_METADATA.getErrorMessage().substring(0, 10)))
-                    .findAny().isPresent());
-        }
+  @Test
+  public void testNoMetaParsing() throws IOException {
+    try (InputStream is = getClass()
+        .getResourceAsStream("/vspmanager.csar/manifest/InvalidTosca4.mf")) {
+      OnboardingManifest onboardingManifest = new OnboardingManifest(is);
+      assertFalse(onboardingManifest.isValid());
+      assertTrue(onboardingManifest.getErrors().stream().anyMatch(error -> error
+          .contains(Messages.MANIFEST_NO_METADATA.getErrorMessage().substring(0, 10))));
     }
+  }
 
 
 }
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/upload/csar/UploadCSARFileTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/upload/csar/UploadCSARFileTest.java
index a7fc0e1..d574c9e 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/upload/csar/UploadCSARFileTest.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/upload/csar/UploadCSARFileTest.java
@@ -33,7 +33,6 @@
 import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.OrchestrationTemplateCandidateDao;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.OrchestrationTemplateDao;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDao;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
 import org.openecomp.sdc.vendorsoftwareproduct.impl.OrchestrationTemplateCandidateManagerImpl;
@@ -51,171 +50,163 @@
 import java.util.List;
 import java.util.function.Predicate;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
 import static org.mockito.Matchers.any;
 import static org.mockito.Mockito.doReturn;
 
 public class UploadCSARFileTest {
-    private static final String USER1 = "vspTestUser1";
 
-    public static final Version VERSION01 = new Version(0, 1);
+  public static final Version VERSION01 = new Version("0.1");
 
-    @Mock
-    private VendorSoftwareProductDao vendorSoftwareProductDaoMock;
-    @Mock
-    private OrchestrationTemplateDao orchestrationTemplateDataDaoMock;
+  @Mock
+  private OrchestrationTemplateDao orchestrationTemplateDataDaoMock;
+  @Spy
+  private CandidateServiceImpl candidateService;
+  @Mock
+  private HealingManager healingManagerMock;
+  @Mock
+  private CompositionDataExtractor compositionDataExtractorMock;
+  @Mock
+  private ServiceModelDao<ToscaServiceModel, ServiceElement> serviceModelDaoMock;
+  @Mock
+  private CompositionEntityDataManager compositionEntityDataManagerMock;
+  @Mock
+  private VendorSoftwareProductInfoDao vspInfoDaoMock;
+  @Mock
+  private OrchestrationTemplateCandidateDao orchestrationTemplateCandidateDao;
+  @Mock
+  private ManifestCreatorNamingConventionImpl manifestCreator;
 
-    @Spy
-    private CandidateServiceImpl candidateService;
-    @Mock
-    private HealingManager healingManagerMock;
-    @Mock
-    private CompositionDataExtractor compositionDataExtractorMock;
-    @Mock
-    private ServiceModelDao<ToscaServiceModel, ServiceElement> serviceModelDaoMock;
-    @Mock
-    private CompositionEntityDataManager compositionEntityDataManagerMock;
-    @Mock
-    private VendorSoftwareProductInfoDao vspInfoDaoMock;
-    @Mock
-    private OrchestrationTemplateCandidateDao orchestrationTemplateCandidateDao;
-    @Mock
-    private ManifestCreatorNamingConventionImpl manifestCreator;
-
-    private OrchestrationTemplateCandidateManagerImpl candidateManager;
+  private OrchestrationTemplateCandidateManagerImpl candidateManager;
 
 
-    public static String id001 = null;
+  public static String id001 = null;
 
-    public static Version activeVersion002 = null;
+  public static Version activeVersion002 = null;
 
 
-    @BeforeMethod
-    public void setUp() throws Exception {
-        MockitoAnnotations.initMocks(this);
-        candidateService = new CandidateServiceImpl(manifestCreator,orchestrationTemplateCandidateDao);
-        candidateManager = new OrchestrationTemplateCandidateManagerImpl( vendorSoftwareProductDaoMock,
-                vspInfoDaoMock,
-                orchestrationTemplateDataDaoMock,
-                candidateService,  healingManagerMock,
-                compositionDataExtractorMock,
-                serviceModelDaoMock,
-                compositionEntityDataManagerMock,
-                null,
-                null,
-                null,
-                null,
-                null);
+  @BeforeMethod
+  public void setUp() throws Exception {
+    MockitoAnnotations.initMocks(this);
+    candidateService = new CandidateServiceImpl(manifestCreator, orchestrationTemplateCandidateDao);
+    candidateManager = new OrchestrationTemplateCandidateManagerImpl(vspInfoDaoMock,
+        candidateService, healingManagerMock);
+  }
+
+  @Test
+  public void testSuccessfulUploadFile() throws Exception {
+    VspDetails vspDetails = new VspDetails("dummyId", new Version(1, 0));
+    doReturn(vspDetails).when(vspInfoDaoMock).get(any(VspDetails.class));
+
+    try (InputStream is = getClass().getResourceAsStream("/vspmanager.csar/SDCmock.csar")) {
+      UploadFileResponse uploadFileResponse =
+          candidateManager.upload(id001, activeVersion002, is, "csar", "SDCmock");
+      assertEquals(uploadFileResponse.getOnboardingType(), OnboardingTypesEnum.CSAR);
+      assertEquals(0, uploadFileResponse.getErrors().size());
+      assertTrue(uploadFileResponse.getErrors().isEmpty());
     }
+  }
 
-    @Test
-    public void testSuccessfulUploadFile() throws Exception {
-        VspDetails vspDetails = new VspDetails("dummyId", new Version(1, 0));
-        doReturn(vspDetails).when(vspInfoDaoMock).get(any(VspDetails.class));
+  @Test
+  public void testFail1UploadFile() throws Exception {
+    VspDetails vspDetails = new VspDetails("dummyId", new Version(1, 0));
+    doReturn(vspDetails).when(vspInfoDaoMock).get(any(VspDetails.class));
 
-        try (InputStream is = getClass().getResourceAsStream("/vspmanager.csar/SDCmock.csar")) {
-            UploadFileResponse uploadFileResponse = candidateManager.upload(id001, activeVersion002, is, USER1, "csar", "SDCmock");
-            assertEquals(uploadFileResponse.getOnboardingType(), OnboardingTypesEnum.CSAR);
-            assertEquals(0, uploadFileResponse.getErrors().size());
-            assertTrue(uploadFileResponse.getErrors().isEmpty());
-        }
+    try (InputStream is = getClass().getResourceAsStream("/vspmanager.csar/SDCmockFail1.csar")) {
+      UploadFileResponse uploadFileResponse =
+          candidateManager.upload(id001, activeVersion002, is,
+              "csar", "SDCmockFail1");
+      assertEquals(uploadFileResponse.getOnboardingType(), OnboardingTypesEnum.CSAR);
+      assertEquals(1, uploadFileResponse.getErrors().size());
+      assertTrue(uploadFileResponse.getErrors().values().stream().anyMatch(
+          getListPredicate(Messages.CSAR_FILES_NOT_ALLOWED.getErrorMessage().substring(0, 7))));
     }
+  }
 
-    @Test
-    public void testFail1UploadFile() throws Exception {
-        VspDetails vspDetails = new VspDetails("dummyId", new Version(1, 0));
-        doReturn(vspDetails).when(vspInfoDaoMock).get(any(VspDetails.class));
+  private Predicate<List<ErrorMessage>> getListPredicate(String substring) {
+    return error -> isEquals(substring, error);
+  }
 
-        try (InputStream is = getClass().getResourceAsStream("/vspmanager.csar/SDCmockFail1.csar")) {
-            UploadFileResponse uploadFileResponse = candidateManager.upload(id001, activeVersion002, is, USER1,
-                    "csar", "SDCmockFail1");
-            assertEquals(uploadFileResponse.getOnboardingType(), OnboardingTypesEnum.CSAR);
-            assertEquals(1, uploadFileResponse.getErrors().size());
-            assertTrue( uploadFileResponse.getErrors().values().stream()
-                    .filter(getListPredicate(Messages.CSAR_FILES_NOT_ALLOWED
-                            .getErrorMessage().substring(0, 7))).findAny().isPresent());
-        }
+  private boolean isEquals(String substring, List<ErrorMessage> error) {
+    return error.iterator().next().getMessage().contains(substring);
+  }
+
+  @Test
+  public void testFail2UploadFile() throws Exception {
+    VspDetails vspDetails = new VspDetails("dummyId", new Version(1, 0));
+    doReturn(vspDetails).when(vspInfoDaoMock).get(any(VspDetails.class));
+
+    try (InputStream is = getClass().getResourceAsStream("/vspmanager.csar/SDCmockFail2.csar")) {
+      UploadFileResponse uploadFileResponse =
+          candidateManager.upload(id001, activeVersion002, is,
+              "csar", "SDCmockFail2");
+      assertEquals(uploadFileResponse.getOnboardingType(), OnboardingTypesEnum.CSAR);
+      assertEquals(1, uploadFileResponse.getErrors().size());
+      assertTrue(uploadFileResponse.getErrors().values().stream().anyMatch(
+          getListPredicate(Messages.CSAR_FILE_NOT_FOUND.getErrorMessage().substring(0, 7))));
     }
+  }
 
-    private Predicate<List<ErrorMessage>> getListPredicate(String substring) {
-        return error -> isEquals(substring, error);
+  @Test
+  public void testFail3UploadFile() throws Exception {
+    VspDetails vspDetails = new VspDetails("dummyId", new Version(1, 0));
+    doReturn(vspDetails).when(vspInfoDaoMock).get(any(VspDetails.class));
+
+    try (InputStream is = getClass().getResourceAsStream("/vspmanager.csar/SDCmockFail3.csar")) {
+      UploadFileResponse uploadFileResponse =
+          candidateManager.upload(id001, activeVersion002, is,
+              "csar", "SDCmockFail3");
+      assertEquals(uploadFileResponse.getOnboardingType(), OnboardingTypesEnum.CSAR);
+      assertEquals(1, uploadFileResponse.getErrors().size());
     }
+  }
 
-    private boolean isEquals(String substring, List<ErrorMessage> error) {
-        return error.iterator().next().getMessage().contains(substring);
+  @Test
+  public void testUploadFileIsNotZip() throws Exception {
+    VspDetails vspDetails = new VspDetails("dummyId", new Version(1, 0));
+    doReturn(vspDetails).when(vspInfoDaoMock).get(any(VspDetails.class));
+
+    try (InputStream is = new ByteArrayInputStream("Thia is not a zip file".getBytes());) {
+      UploadFileResponse uploadFileResponse =
+          candidateManager.upload(id001, activeVersion002, is,
+              "csar", "file");
+      assertEquals(uploadFileResponse.getOnboardingType(), OnboardingTypesEnum.CSAR);
+      assertFalse(uploadFileResponse.getErrors().isEmpty());
+      assertTrue(uploadFileResponse.getErrors().values().stream().anyMatch(
+          getListPredicate(Messages.CSAR_FILE_NOT_FOUND.getErrorMessage().substring(0, 7))));
     }
+  }
 
-    @Test
-    public void testFail2UploadFile() throws Exception {
-        VspDetails vspDetails = new VspDetails("dummyId", new Version(1, 0));
-        doReturn(vspDetails).when(vspInfoDaoMock).get(any(VspDetails.class));
+  @Test
+  public void testUploadFileIsEmpty() throws Exception {
+    VspDetails vspDetails = new VspDetails("dummyId", new Version(1, 0));
+    doReturn(vspDetails).when(vspInfoDaoMock).get(any(VspDetails.class));
 
-        try (InputStream is = getClass().getResourceAsStream("/vspmanager.csar/SDCmockFail2.csar")) {
-            UploadFileResponse uploadFileResponse = candidateManager.upload(id001, activeVersion002, is, USER1,
-                    "csar", "SDCmockFail2");
-            assertEquals(uploadFileResponse.getOnboardingType(), OnboardingTypesEnum.CSAR);
-            assertEquals(1, uploadFileResponse.getErrors().size());
-            assertTrue( uploadFileResponse.getErrors().values().stream()
-                    .filter(getListPredicate(Messages.CSAR_FILE_NOT_FOUND
-                            .getErrorMessage().substring(0,7))).findAny().isPresent());
-        }
+    try (InputStream is = new ByteArrayInputStream(new byte[]{})) {
+      UploadFileResponse uploadFileResponse = candidateManager.upload(id001,
+          activeVersion002, is, "csar", "file");
+      assertEquals(uploadFileResponse.getOnboardingType(), OnboardingTypesEnum.CSAR);
+      assertEquals(1, uploadFileResponse.getErrors().size());
     }
-    @Test
-    public void testFail3UploadFile() throws Exception {
-        VspDetails vspDetails = new VspDetails("dummyId", new Version(1, 0));
-        doReturn(vspDetails).when(vspInfoDaoMock).get(any(VspDetails.class));
+  }
 
-        try (InputStream is = getClass().getResourceAsStream("/vspmanager.csar/SDCmockFail3.csar")) {
-            UploadFileResponse uploadFileResponse = candidateManager.upload(id001, activeVersion002, is, USER1,
-                    "csar", "SDCmockFail3");
-            assertEquals(uploadFileResponse.getOnboardingType(), OnboardingTypesEnum.CSAR);
-            assertEquals(1, uploadFileResponse.getErrors().size());
-        }
+  @Test
+  public void testMFError() throws Exception {
+    VspDetails vspDetails = new VspDetails("dummyId", new Version(1, 0));
+    doReturn(vspDetails).when(vspInfoDaoMock).get(any(VspDetails.class));
+
+    try (InputStream is = getClass().getResourceAsStream("/vspmanager.csar/SDCmockBrokenMF.csar")) {
+      UploadFileResponse uploadFileResponse =
+          candidateManager.upload(id001, activeVersion002, is, "csar", "SDCmockBrokenMF");
+      assertEquals(uploadFileResponse.getOnboardingType(), OnboardingTypesEnum.CSAR);
+      assertEquals(1, uploadFileResponse.getErrors().size());
+      assertTrue(uploadFileResponse.getErrors().values().stream()
+          .anyMatch(getListPredicate(Messages.MANIFEST_NO_METADATA.getErrorMessage())));
+
     }
-
-    @Test
-    public void testUploadFileIsNotZip() throws Exception {
-        VspDetails vspDetails = new VspDetails("dummyId", new Version(1, 0));
-        doReturn(vspDetails).when(vspInfoDaoMock).get(any(VspDetails.class));
-
-        try (InputStream is = new ByteArrayInputStream( "Thia is not a zip file".getBytes() );) {
-            UploadFileResponse uploadFileResponse = candidateManager.upload(id001, activeVersion002, is, USER1,
-                    "csar", "file");
-            assertEquals(uploadFileResponse.getOnboardingType(), OnboardingTypesEnum.CSAR);
-            assertFalse(uploadFileResponse.getErrors().isEmpty());
-            assertTrue( uploadFileResponse.getErrors().values().stream()
-                    .filter(getListPredicate(Messages.CSAR_FILE_NOT_FOUND
-                            .getErrorMessage().substring(0,7))).findAny().isPresent());
-        }
-    }
-    @Test
-    public void testUploadFileIsEmpty() throws Exception {
-        VspDetails vspDetails = new VspDetails("dummyId", new Version(1, 0));
-        doReturn(vspDetails).when(vspInfoDaoMock).get(any(VspDetails.class));
-
-        try (InputStream is = new ByteArrayInputStream( new byte[]{} )) {
-            UploadFileResponse uploadFileResponse = candidateManager.upload(id001,
-                activeVersion002, is, USER1, "csar", "file");
-            assertEquals(uploadFileResponse.getOnboardingType(), OnboardingTypesEnum.CSAR);
-            assertEquals(1, uploadFileResponse.getErrors().size());
-        }
-    }
-
-    @Test
-    public void testMFError() throws Exception {
-        VspDetails vspDetails = new VspDetails("dummyId", new Version(1, 0));
-        doReturn(vspDetails).when(vspInfoDaoMock).get(any(VspDetails.class));
-
-        try (InputStream is = getClass().getResourceAsStream("/vspmanager.csar/SDCmockBrokenMF.csar")) {
-            UploadFileResponse uploadFileResponse = candidateManager.upload(id001, activeVersion002, is, USER1, "csar", "SDCmockBrokenMF");
-            assertEquals(uploadFileResponse.getOnboardingType(), OnboardingTypesEnum.CSAR);
-            assertEquals(1, uploadFileResponse.getErrors().size());
-            assertTrue( uploadFileResponse.getErrors()
-                    .values().stream()
-                    .filter(getListPredicate(Messages.MANIFEST_NO_METADATA.getErrorMessage())).findAny().isPresent());
-
-        }
-    }
+  }
 
 
 }
diff --git a/openecomp-be/backend/pom.xml b/openecomp-be/backend/pom.xml
index a627ed0..2d98aa5 100644
--- a/openecomp-be/backend/pom.xml
+++ b/openecomp-be/backend/pom.xml
@@ -23,6 +23,8 @@
         <module>openecomp-sdc-application-config-manager</module>
         <module>openecomp-sdc-activity-log-manager</module>
         <module>openecomp-sdc-healthcheck-manager</module>
+        <module>openecomp-sdc-conflict-manager</module>
+        <module>openecomp-sdc-item-permissions-manager</module>
     </modules>
 
     
diff --git a/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/Messages.java b/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/Messages.java
index de33804..565e60e 100644
--- a/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/Messages.java
+++ b/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/Messages.java
@@ -39,6 +39,8 @@
   FAILED_TO_TRANSLATE_ZIP_FILE("Failed to translate zip file"),
   ZIP_NOT_EXIST("Zip file doesn't exist"),
 
+  PERMISSIONS_ERROR("Permissions Error. The user does not have permission to perform this action."),
+
   ZIP_SHOULD_NOT_CONTAIN_FOLDERS("Zip file should not contain folders"),
   VES_ZIP_SHOULD_CONTAIN_YML_ONLY(
       "Wrong VES EVENT Artifact was uploaded - all files contained in Artifact must be YAML files" +
@@ -148,7 +150,11 @@
           + "Contrail 2 resources can be found in %s. Contrail 3 resources can be found in %s"),
   CONTRAIL_VM_TYPE_NAME_NOT_ALIGNED_WITH_NAMING_CONVENSION(
       "Service Template naming convention in Image and Flavor "
-          + "properties is not consistent in Resource, Resource ID %s");
+          + "properties is not consistent in Resource, Resource ID %s"),
+
+  /* Notifications */
+  FAILED_TO_MARK_NOTIFICATION_AS_READ("Failed to mark notifications as read"),
+  FAILED_TO_UPDATE_LAST_SEEN_NOTIFICATION("Failed to update last seen notification for user %s");
 
   private String errorMessage;
 
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspCreationDto.java b/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/SdcRuntimeException.java
similarity index 63%
copy from openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspCreationDto.java
copy to openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/SdcRuntimeException.java
index f77005f..6e41d58 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspCreationDto.java
+++ b/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/SdcRuntimeException.java
@@ -7,9 +7,9 @@
  * 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.
@@ -18,19 +18,25 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.sdcrests.vendorsoftwareproducts.types;
+package org.openecomp.sdc.common.errors;
 
-/**
- * Created by TALIO on 4/26/2016.
- */
-public class VspCreationDto {
-  private String vspId;
-
-  public String getVspId() {
-    return vspId;
+public class SdcRuntimeException extends RuntimeException {
+  public SdcRuntimeException() {
   }
 
-  public void setVspId(String vspId) {
-    this.vspId = vspId;
+  public SdcRuntimeException(String message) {
+    super(message);
+  }
+
+  public SdcRuntimeException(String message, Throwable cause) {
+    super(message, cause);
+  }
+
+  public SdcRuntimeException(Throwable cause) {
+    super(cause);
+  }
+
+  public SdcRuntimeException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
+    super(message, cause, enableSuppression, writableStackTrace);
   }
 }
diff --git a/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/utils/SdcCommon.java b/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/utils/SdcCommon.java
index 24da836..9de0e7b 100644
--- a/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/utils/SdcCommon.java
+++ b/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/utils/SdcCommon.java
@@ -33,6 +33,7 @@
   public static final String PARENT = "parent";
 
   public static final String VSP_ID = "vspId";
+  public static final String VLM_ID = "vlmId";
   public static final String VERSION = "version";
   public static final String USER = "user";
 }
diff --git a/openecomp-be/lib/openecomp-conflict-lib/openecomp-conflict-api/pom.xml b/openecomp-be/lib/openecomp-conflict-lib/openecomp-conflict-api/pom.xml
new file mode 100644
index 0000000..413cae7
--- /dev/null
+++ b/openecomp-be/lib/openecomp-conflict-lib/openecomp-conflict-api/pom.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+
+    <parent>
+        <groupId>org.openecomp.sdc</groupId>
+        <artifactId>openecomp-conflict-lib</artifactId>
+        <version>1.2.0-SNAPSHOT</version>
+        <relativePath>..</relativePath>
+    </parent>
+
+    <artifactId>openecomp-conflict-api</artifactId>
+
+
+    <dependencies>
+        <dependency>
+            <groupId>org.openecomp.sdc.core</groupId>
+            <artifactId>openecomp-facade-core</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.openecomp.sdc.core</groupId>
+            <artifactId>openecomp-facade-api</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.openecomp.sdc</groupId>
+            <artifactId>openecomp-sdc-versioning-api</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
+
+
+
+</project>
\ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-conflict-lib/openecomp-conflict-api/src/main/java/org/openecomp/conflicts/ItemMergeHandler.java b/openecomp-be/lib/openecomp-conflict-lib/openecomp-conflict-api/src/main/java/org/openecomp/conflicts/ItemMergeHandler.java
new file mode 100644
index 0000000..189e4ce
--- /dev/null
+++ b/openecomp-be/lib/openecomp-conflict-lib/openecomp-conflict-api/src/main/java/org/openecomp/conflicts/ItemMergeHandler.java
@@ -0,0 +1,27 @@
+package org.openecomp.conflicts;
+
+import org.openecomp.conflicts.types.Conflict;
+import org.openecomp.conflicts.types.ConflictResolution;
+import org.openecomp.conflicts.types.ItemVersionConflict;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+import java.util.Optional;
+
+public interface ItemMergeHandler {
+
+  boolean isConflicted(String itemId, Version version);
+
+  void finalizeMerge(String itemId, Version version);
+
+  void postListConflicts(String itemId, Version version, ItemVersionConflict conflicts);
+
+  Optional<Conflict> getConflict(String itemId, Version version, String conflictId);
+
+  void postGetConflict(String itemId, Version version, Conflict conflict);
+
+  void preResolveConflict(String itemId, Version version, String conflictId,
+                          ConflictResolution resolution);
+
+  boolean resolveConflict(String itemId, Version version, String conflictId,
+                          ConflictResolution resolution);
+}
diff --git a/openecomp-be/lib/openecomp-conflict-lib/openecomp-conflict-api/src/main/java/org/openecomp/conflicts/ItemMergeHandlerFactory.java b/openecomp-be/lib/openecomp-conflict-lib/openecomp-conflict-api/src/main/java/org/openecomp/conflicts/ItemMergeHandlerFactory.java
new file mode 100644
index 0000000..8fb0a48
--- /dev/null
+++ b/openecomp-be/lib/openecomp-conflict-lib/openecomp-conflict-api/src/main/java/org/openecomp/conflicts/ItemMergeHandlerFactory.java
@@ -0,0 +1,16 @@
+package org.openecomp.conflicts;
+
+import org.openecomp.core.factory.api.AbstractComponentFactory;
+import org.openecomp.core.factory.api.AbstractFactory;
+
+import java.util.Optional;
+
+public abstract class ItemMergeHandlerFactory
+    extends AbstractComponentFactory<ItemMergeHandler> {
+
+  public static ItemMergeHandlerFactory getInstance() {
+    return AbstractFactory.getInstance(ItemMergeHandlerFactory.class);
+  }
+
+  public abstract Optional<ItemMergeHandler> createInterface(String itemId);
+}
\ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-conflict-lib/openecomp-conflict-api/src/main/java/org/openecomp/conflicts/dao/ConflictsDao.java b/openecomp-be/lib/openecomp-conflict-lib/openecomp-conflict-api/src/main/java/org/openecomp/conflicts/dao/ConflictsDao.java
new file mode 100644
index 0000000..273233a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-conflict-lib/openecomp-conflict-api/src/main/java/org/openecomp/conflicts/dao/ConflictsDao.java
@@ -0,0 +1,18 @@
+package org.openecomp.conflicts.dao;
+
+import org.openecomp.conflicts.types.Conflict;
+import org.openecomp.conflicts.types.ConflictResolution;
+import org.openecomp.conflicts.types.ItemVersionConflict;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+public interface ConflictsDao {
+
+  boolean isConflicted(String itemId, Version version);
+
+  ItemVersionConflict getConflict(String itemId, Version version);
+
+  Conflict getConflict(String itemId, Version version, String conflictId);
+
+  void resolveConflict(String itemId, Version version, String conflictId,
+                       ConflictResolution conflictResolution);
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/UploadDataDaoFactory.java b/openecomp-be/lib/openecomp-conflict-lib/openecomp-conflict-api/src/main/java/org/openecomp/conflicts/dao/ConflictsDaoFactory.java
similarity index 79%
copy from openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/UploadDataDaoFactory.java
copy to openecomp-be/lib/openecomp-conflict-lib/openecomp-conflict-api/src/main/java/org/openecomp/conflicts/dao/ConflictsDaoFactory.java
index 9654551..e4c88d6 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/UploadDataDaoFactory.java
+++ b/openecomp-be/lib/openecomp-conflict-lib/openecomp-conflict-api/src/main/java/org/openecomp/conflicts/dao/ConflictsDaoFactory.java
@@ -7,9 +7,9 @@
  * 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.
@@ -18,14 +18,15 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.sdc.vendorsoftwareproduct.dao;
+package org.openecomp.conflicts.dao;
 
 import org.openecomp.core.factory.api.AbstractComponentFactory;
 import org.openecomp.core.factory.api.AbstractFactory;
 
-public abstract class UploadDataDaoFactory extends AbstractComponentFactory<UploadDataDao> {
+public abstract class ConflictsDaoFactory
+    extends AbstractComponentFactory<ConflictsDao> {
 
-  public static UploadDataDaoFactory getInstance() {
-    return AbstractFactory.getInstance(UploadDataDaoFactory.class);
+  public static ConflictsDaoFactory getInstance() {
+    return AbstractFactory.getInstance(ConflictsDaoFactory.class);
   }
 }
diff --git a/openecomp-be/lib/openecomp-conflict-lib/openecomp-conflict-api/src/main/java/org/openecomp/conflicts/types/Conflict.java b/openecomp-be/lib/openecomp-conflict-lib/openecomp-conflict-api/src/main/java/org/openecomp/conflicts/types/Conflict.java
new file mode 100644
index 0000000..bc324af
--- /dev/null
+++ b/openecomp-be/lib/openecomp-conflict-lib/openecomp-conflict-api/src/main/java/org/openecomp/conflicts/types/Conflict.java
@@ -0,0 +1,30 @@
+package org.openecomp.conflicts.types;
+
+import org.openecomp.sdc.datatypes.model.ElementType;
+
+public class Conflict<T> extends ConflictInfo {
+  private T yours;
+  private T theirs;
+
+  public Conflict(String id, ElementType type, String name) {
+    super(id, type, name);
+  }
+
+  public T getYours() {
+    return yours;
+  }
+
+  public void setYours(T yours) {
+    this.yours = yours;
+  }
+
+  public T getTheirs() {
+    return theirs;
+  }
+
+  public void setTheirs(T theirs) {
+    this.theirs = theirs;
+  }
+
+
+}
diff --git a/openecomp-be/lib/openecomp-conflict-lib/openecomp-conflict-api/src/main/java/org/openecomp/conflicts/types/ConflictInfo.java b/openecomp-be/lib/openecomp-conflict-lib/openecomp-conflict-api/src/main/java/org/openecomp/conflicts/types/ConflictInfo.java
new file mode 100644
index 0000000..ff58f00
--- /dev/null
+++ b/openecomp-be/lib/openecomp-conflict-lib/openecomp-conflict-api/src/main/java/org/openecomp/conflicts/types/ConflictInfo.java
@@ -0,0 +1,39 @@
+package org.openecomp.conflicts.types;
+
+import org.openecomp.sdc.datatypes.model.ElementType;
+
+public class ConflictInfo {
+  private String id;
+  private ElementType type;
+  private String name;
+
+  public ConflictInfo(String id, ElementType type, String name) {
+    this.id = id;
+    this.type = type;
+    this.name = name;
+  }
+
+  public String getId() {
+    return id;
+  }
+
+  public void setId(String id) {
+    this.id = id;
+  }
+
+  public ElementType getType() {
+    return type;
+  }
+
+  public void setType(ElementType type) {
+    this.type = type;
+  }
+
+  public String getName() {
+    return name;
+  }
+
+  public void setName(String name) {
+    this.name = name;
+  }
+}
diff --git a/openecomp-be/lib/openecomp-conflict-lib/openecomp-conflict-api/src/main/java/org/openecomp/conflicts/types/ConflictResolution.java b/openecomp-be/lib/openecomp-conflict-lib/openecomp-conflict-api/src/main/java/org/openecomp/conflicts/types/ConflictResolution.java
new file mode 100644
index 0000000..961f908
--- /dev/null
+++ b/openecomp-be/lib/openecomp-conflict-lib/openecomp-conflict-api/src/main/java/org/openecomp/conflicts/types/ConflictResolution.java
@@ -0,0 +1,32 @@
+package org.openecomp.conflicts.types;
+
+import java.util.Map;
+
+public class ConflictResolution {
+  private Resolution resolution;
+  // sits in lower level...
+  private Map<String, Object> otherResolution;
+
+  public ConflictResolution() {
+  }
+
+  public ConflictResolution(Resolution resolution) {
+    this.resolution = resolution;
+  }
+
+  public Resolution getResolution() {
+    return resolution;
+  }
+
+  public void setResolution(Resolution resolution) {
+    this.resolution = resolution;
+  }
+
+  public Map<String, Object> getOtherResolution() {
+    return otherResolution;
+  }
+
+  public void setOtherResolution(Map<String, Object> otherResolution) {
+    this.otherResolution = otherResolution;
+  }
+}
diff --git a/openecomp-be/lib/openecomp-conflict-lib/openecomp-conflict-api/src/main/java/org/openecomp/conflicts/types/ItemVersionConflict.java b/openecomp-be/lib/openecomp-conflict-lib/openecomp-conflict-api/src/main/java/org/openecomp/conflicts/types/ItemVersionConflict.java
new file mode 100644
index 0000000..a4749f3
--- /dev/null
+++ b/openecomp-be/lib/openecomp-conflict-lib/openecomp-conflict-api/src/main/java/org/openecomp/conflicts/types/ItemVersionConflict.java
@@ -0,0 +1,31 @@
+package org.openecomp.conflicts.types;
+
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+public class ItemVersionConflict {
+  private Conflict<Version> versionConflict;
+  private Collection<ConflictInfo> elementConflicts = new ArrayList<>();
+
+  public Conflict<Version> getVersionConflict() {
+    return versionConflict;
+  }
+
+  public void setVersionConflict(Conflict<Version> versionConflict) {
+    this.versionConflict = versionConflict;
+  }
+
+  public Collection<ConflictInfo> getElementConflicts() {
+    return elementConflicts;
+  }
+
+  public void setElementConflicts(Collection<ConflictInfo> elementConflicts) {
+    this.elementConflicts = elementConflicts;
+  }
+
+  public void addElementConflictInfo(ConflictInfo conflictInfo) {
+    elementConflicts.add(conflictInfo);
+  }
+}
diff --git a/openecomp-be/lib/openecomp-conflict-lib/openecomp-conflict-api/src/main/java/org/openecomp/conflicts/types/Resolution.java b/openecomp-be/lib/openecomp-conflict-lib/openecomp-conflict-api/src/main/java/org/openecomp/conflicts/types/Resolution.java
new file mode 100644
index 0000000..2222f81
--- /dev/null
+++ b/openecomp-be/lib/openecomp-conflict-lib/openecomp-conflict-api/src/main/java/org/openecomp/conflicts/types/Resolution.java
@@ -0,0 +1,5 @@
+package org.openecomp.conflicts.types;
+
+public enum Resolution {
+  THEIRS,YOURS,OTHER
+}
diff --git a/openecomp-be/lib/openecomp-conflict-lib/openecomp-conflict-core/pom.xml b/openecomp-be/lib/openecomp-conflict-lib/openecomp-conflict-core/pom.xml
new file mode 100644
index 0000000..ddeb03d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-conflict-lib/openecomp-conflict-core/pom.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.openecomp.sdc</groupId>
+        <artifactId>openecomp-conflict-lib</artifactId>
+        <version>1.2.0-SNAPSHOT</version>
+        <relativePath>..</relativePath>
+    </parent>
+
+    <artifactId>openecomp-conflict-core</artifactId>
+    <dependencies>
+        <dependency>
+            <groupId>org.openecomp.sdc</groupId>
+            <artifactId>openecomp-conflict-api</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.openecomp.sdc.core</groupId>
+            <artifactId>openecomp-zusammen-api</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.openecomp.sdc</groupId>
+            <artifactId>openecomp-sdc-vendor-software-product-core</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.openecomp.sdc</groupId>
+            <artifactId>openecomp-sdc-vendor-license-core</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
+</project>
\ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-conflict-lib/openecomp-conflict-core/src/main/java/org/openecomp/conflicts/ItemMergeHandlerFactoryImpl.java b/openecomp-be/lib/openecomp-conflict-lib/openecomp-conflict-core/src/main/java/org/openecomp/conflicts/ItemMergeHandlerFactoryImpl.java
new file mode 100644
index 0000000..4c981ac
--- /dev/null
+++ b/openecomp-be/lib/openecomp-conflict-lib/openecomp-conflict-core/src/main/java/org/openecomp/conflicts/ItemMergeHandlerFactoryImpl.java
@@ -0,0 +1,40 @@
+package org.openecomp.conflicts;
+
+import org.openecomp.conflicts.dao.ConflictsDaoFactory;
+import org.openecomp.conflicts.impl.VspMergeHandler;
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.datatypes.model.ItemType;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.VspMergeDaoFactory;
+import org.openecomp.sdc.versioning.ItemManagerFactory;
+import org.openecomp.sdc.versioning.errors.EntityNotExistErrorBuilder;
+import org.openecomp.sdc.versioning.types.Item;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Optional;
+
+public class ItemMergeHandlerFactoryImpl extends ItemMergeHandlerFactory {
+  // TODO: 11/1/2017 read this map from configuration, move Vsp merge handler to vsp lib, rearrange lib deps
+  private static final Map<ItemType, ItemMergeHandler> MERGE_HANDLER_BY_ITEM_TYPE =
+      new HashMap<>();
+
+  static {
+    MERGE_HANDLER_BY_ITEM_TYPE.put(ItemType.vsp,
+        new VspMergeHandler(ConflictsDaoFactory.getInstance().createInterface(),
+            VspMergeDaoFactory.getInstance().createInterface()));
+  }
+
+  @Override
+  public Optional<ItemMergeHandler> createInterface(String itemId) {
+    Item item = ItemManagerFactory.getInstance().createInterface().get(itemId);
+    if (item == null) {
+      throw new CoreException(new EntityNotExistErrorBuilder("", itemId).build());
+    }
+    return Optional.ofNullable(MERGE_HANDLER_BY_ITEM_TYPE.get(ItemType.valueOf(item.getType())));
+  }
+
+  @Override
+  public ItemMergeHandler createInterface() {
+    return null; // call the one with the item id arg
+  }
+}
diff --git a/openecomp-be/lib/openecomp-conflict-lib/openecomp-conflict-core/src/main/java/org/openecomp/conflicts/dao/impl/zusammen/ConflictsDaoFactoryImpl.java b/openecomp-be/lib/openecomp-conflict-lib/openecomp-conflict-core/src/main/java/org/openecomp/conflicts/dao/impl/zusammen/ConflictsDaoFactoryImpl.java
new file mode 100644
index 0000000..7cb3598
--- /dev/null
+++ b/openecomp-be/lib/openecomp-conflict-lib/openecomp-conflict-core/src/main/java/org/openecomp/conflicts/dao/impl/zusammen/ConflictsDaoFactoryImpl.java
@@ -0,0 +1,17 @@
+package org.openecomp.conflicts.dao.impl.zusammen;
+
+
+import org.openecomp.conflicts.dao.ConflictsDao;
+import org.openecomp.conflicts.dao.ConflictsDaoFactory;
+import org.openecomp.core.zusammen.api.ZusammenAdaptorFactory;
+
+public class ConflictsDaoFactoryImpl extends ConflictsDaoFactory {
+
+  private static final ConflictsDao INSTANCE = new
+      ConflictsDaoImpl(ZusammenAdaptorFactory.getInstance().createInterface());
+
+  @Override
+  public ConflictsDao createInterface() {
+    return INSTANCE;
+  }
+}
diff --git a/openecomp-be/lib/openecomp-conflict-lib/openecomp-conflict-core/src/main/java/org/openecomp/conflicts/dao/impl/zusammen/ConflictsDaoImpl.java b/openecomp-be/lib/openecomp-conflict-lib/openecomp-conflict-core/src/main/java/org/openecomp/conflicts/dao/impl/zusammen/ConflictsDaoImpl.java
new file mode 100644
index 0000000..eac1be3
--- /dev/null
+++ b/openecomp-be/lib/openecomp-conflict-lib/openecomp-conflict-core/src/main/java/org/openecomp/conflicts/dao/impl/zusammen/ConflictsDaoImpl.java
@@ -0,0 +1,175 @@
+package org.openecomp.conflicts.dao.impl.zusammen;
+
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.Element;
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.ElementConflict;
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.ElementInfo;
+import com.amdocs.zusammen.datatypes.Id;
+import com.amdocs.zusammen.datatypes.SessionContext;
+import com.amdocs.zusammen.datatypes.item.ElementContext;
+import com.amdocs.zusammen.datatypes.item.Item;
+import com.amdocs.zusammen.datatypes.item.ItemVersion;
+import com.amdocs.zusammen.datatypes.item.Resolution;
+import org.openecomp.conflicts.dao.ConflictsDao;
+import org.openecomp.conflicts.types.Conflict;
+import org.openecomp.conflicts.types.ConflictResolution;
+import org.openecomp.conflicts.types.ItemVersionConflict;
+import org.openecomp.convertor.ElementConvertor;
+import org.openecomp.core.zusammen.api.ZusammenAdaptor;
+import org.openecomp.sdc.datatypes.model.ElementType;
+import org.openecomp.sdc.vendorlicense.dao.impl.zusammen.convertor.ElementToEntitlementPoolConvertor;
+import org.openecomp.sdc.vendorlicense.dao.impl.zusammen.convertor.ElementToFeatureGroupConvertor;
+import org.openecomp.sdc.vendorlicense.dao.impl.zusammen.convertor.ElementToLicenseAgreementConvertor;
+import org.openecomp.sdc.vendorlicense.dao.impl.zusammen.convertor.ElementToLicenseKeyGroupConvertor;
+import org.openecomp.sdc.vendorlicense.dao.impl.zusammen.convertor.ElementToLimitConvertor;
+import org.openecomp.sdc.vendorlicense.dao.impl.zusammen.convertor.ElementToVLMGeneralConvertor;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.convertor.ElementToComponentConvertor;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.convertor.ElementToComponentDependencyModelConvertor;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.convertor.ElementToCompositionEntityConvertor;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.convertor.ElementToComputeConvertor;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.convertor.ElementToImageConvertor;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.convertor.ElementToMonitoringUploadMapConvertor;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.convertor.ElementToNetworkConvertor;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.convertor.ElementToNicConvertor;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.convertor.ElementToOrchestrationTemplateCandidateMapConvertor;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.convertor.ElementToProcessConvertor;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.convertor.ElementToServiceModelMapConvertor;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.convertor.ElementToVSPGeneralConvertor;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+import static org.openecomp.core.zusammen.api.ZusammenUtil.buildElement;
+import static org.openecomp.core.zusammen.api.ZusammenUtil.createSessionContext;
+
+public class ConflictsDaoImpl implements ConflictsDao {
+  private final ZusammenAdaptor zusammenAdaptor;
+
+  public ConflictsDaoImpl(ZusammenAdaptor zusammenAdaptor) {
+    this.zusammenAdaptor = zusammenAdaptor;
+  }
+
+  @Override
+  public boolean isConflicted(String itemId, Version version) {
+    com.amdocs.zusammen.adaptor.inbound.api.types.item.ItemVersionConflict itemVersionConflict =
+        zusammenAdaptor
+            .getVersionConflict(createSessionContext(), new Id(itemId), new Id(version.getId()));
+    return !(itemVersionConflict == null
+        || (itemVersionConflict.getVersionDataConflict() == null
+        && itemVersionConflict.getElementConflictInfos().isEmpty()));
+  }
+
+  @Override
+  public ItemVersionConflict getConflict(String itemId, Version version) {
+    return new ItemVersionConflictConvertorFromZusammen().convert(itemId, version,
+        zusammenAdaptor
+            .getVersionConflict(createSessionContext(), new Id(itemId), new Id(version.getId())));
+  }
+
+  @Override
+  public Conflict getConflict(String itemId, Version version, String conflictId) {
+    return zusammenAdaptor.getElementConflict(createSessionContext(),
+        new ElementContext(new Id(itemId), new Id(version.getId())), new Id(conflictId))
+        .map(elementConflict -> convertElementConflict(conflictId, elementConflict))
+        .orElse(null);
+  }
+
+  @Override
+  public void resolveConflict(String itemId, Version version, String conflictId,
+                              ConflictResolution conflictResolution) {
+    SessionContext context = createSessionContext();
+    ElementContext elementContext = new ElementContext(new Id(itemId), new Id(version.getId()));
+
+    // TODO: 7/31/2017 when 'OTHER' resolution will be supported - populate zusammen element with it
+    zusammenAdaptor.resolveElementConflict(context, elementContext,
+        buildElement(new Id(conflictId), null),
+        Resolution.valueOf(conflictResolution.getResolution().name()));
+  }
+
+  private Conflict convertElementConflict(String conflictId, ElementConflict elementConflict) {
+    Element element = elementConflict.getLocalElement() == null
+        ? elementConflict.getRemoteElement()
+        : elementConflict.getLocalElement();
+    ElementType elementType = ElementConvertor.getElementType(element);
+
+    Conflict conflict =
+        new Conflict(conflictId, elementType, ElementConvertor.getElementName(element));
+    ElementConvertor convertor = getConvertor(elementType);
+    if (elementConflict.getLocalElement() != null) {
+      conflict.setYours(convertor.convert(elementConflict.getLocalElement()));
+    }
+    if (elementConflict.getRemoteElement() != null) {
+      conflict.setTheirs(convertor.convert(elementConflict.getRemoteElement()));
+    }
+    return conflict;
+  }
+
+  private ElementConvertor getConvertor(ElementType type) {
+    switch (type) {
+      case VendorSoftwareProduct:
+        return new ElementToVSPGeneralConvertor();
+      case Process:
+        return new ElementToProcessConvertor();
+      case Nic:
+        return new ElementToNicConvertor();
+      case Network:
+        return new ElementToNetworkConvertor();
+      case SNMP_POLL:
+      case SNMP_TRAP:
+      case VES_EVENTS:
+        return new ElementToMonitoringUploadMapConvertor();
+      case Image:
+        return new ElementToImageConvertor();
+      case Compute:
+        return new ElementToComputeConvertor();
+      case Component:
+        return new ElementToComponentConvertor();
+      case ComponentDependencies:
+        return new ElementToComponentDependencyModelConvertor();
+      case VendorLicenseModel:
+        return new ElementToVLMGeneralConvertor();
+      case LicenseAgreement:
+        return new ElementToLicenseAgreementConvertor();
+      case FeatureGroup:
+        return new ElementToFeatureGroupConvertor();
+      case LicenseKeyGroup:
+        return new ElementToLicenseKeyGroupConvertor();
+      case EntitlementPool:
+        return new ElementToEntitlementPoolConvertor();
+      case Limit:
+        return new ElementToLimitConvertor();
+      case OrchestrationTemplateCandidate:
+        return new ElementToOrchestrationTemplateCandidateMapConvertor();
+      case ServiceModel:
+        return new ElementToServiceModelMapConvertor();
+      case VSPQuestionnaire:
+      case ImageQuestionnaire:
+      case ComponentQuestionnaire:
+      case ComputeQuestionnaire:
+      case NicQuestionnaire:
+        return new ElementToCompositionEntityConvertor();
+      default:
+        return new EchoConvertor();
+    }
+  }
+
+  public static class EchoConvertor extends ElementConvertor {
+
+    @Override
+    public Object convert(Element element) {
+      return element;
+    }
+
+    @Override
+    public Object convert(Item item) {
+      return item;
+    }
+
+    @Override
+    public Object convert(ElementInfo elementInfo) {
+      return elementInfo;
+    }
+
+    @Override
+    public Object convert(ItemVersion itemVersion) {
+      return null;
+    }
+  }
+}
diff --git a/openecomp-be/lib/openecomp-conflict-lib/openecomp-conflict-core/src/main/java/org/openecomp/conflicts/dao/impl/zusammen/ItemVersionConflictConvertorFromZusammen.java b/openecomp-be/lib/openecomp-conflict-lib/openecomp-conflict-core/src/main/java/org/openecomp/conflicts/dao/impl/zusammen/ItemVersionConflictConvertorFromZusammen.java
new file mode 100644
index 0000000..4dffaf8
--- /dev/null
+++ b/openecomp-be/lib/openecomp-conflict-lib/openecomp-conflict-core/src/main/java/org/openecomp/conflicts/dao/impl/zusammen/ItemVersionConflictConvertorFromZusammen.java
@@ -0,0 +1,73 @@
+package org.openecomp.conflicts.dao.impl.zusammen;
+
+
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.ElementConflictInfo;
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.ElementInfo;
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.ItemVersionConflict;
+import com.amdocs.zusammen.datatypes.Id;
+import com.amdocs.zusammen.datatypes.item.ItemVersion;
+import com.amdocs.zusammen.datatypes.item.ItemVersionData;
+import com.amdocs.zusammen.datatypes.item.ItemVersionDataConflict;
+import org.openecomp.conflicts.types.Conflict;
+import org.openecomp.conflicts.types.ConflictInfo;
+import org.openecomp.sdc.datatypes.model.ElementType;
+import org.openecomp.sdc.versioning.dao.impl.zusammen.convertor.ItemVersionToVersionConvertor;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.types.ElementPropertyName;
+
+import java.util.stream.Collectors;
+
+public class ItemVersionConflictConvertorFromZusammen {
+  public org.openecomp.conflicts.types.ItemVersionConflict convert(String itemId, Version version,
+                                                                   ItemVersionConflict source) {
+    org.openecomp.conflicts.types.ItemVersionConflict target =
+        new org.openecomp.conflicts.types.ItemVersionConflict();
+
+    target.setVersionConflict(
+        convertVersionDataConflict(itemId, version, source.getVersionDataConflict()));
+    target.setElementConflicts(source.getElementConflictInfos().stream()
+        .map(this::convertElementConflictInfo)
+        .collect(Collectors.toList()));
+
+    return target;
+  }
+
+
+  private Conflict<Version> convertVersionDataConflict(String itemId, Version version,
+                                                       ItemVersionDataConflict versionDataConflict) {
+    if (versionDataConflict == null) {
+      return null;
+    }
+
+    Conflict<Version> conflict =
+        new Conflict<>(version.getId(), ElementType.itemVersion, null);
+
+    ItemVersionToVersionConvertor convertor = new ItemVersionToVersionConvertor();
+    conflict.setYours(convertor.convert(
+        getItemVersion(version.getId(), versionDataConflict.getLocalData())));
+    conflict.setTheirs(convertor.convert(
+        getItemVersion(version.getId(), versionDataConflict.getRemoteData())));
+    return conflict;
+  }
+
+  private ItemVersion getItemVersion(String versionId, ItemVersionData versionData) {
+    if (versionData == null) {
+      return null;
+    }
+    ItemVersion itemVersion = new ItemVersion();
+    itemVersion.setId(new Id(versionId));
+    itemVersion.setData(versionData);
+    return itemVersion;
+  }
+
+  private ConflictInfo convertElementConflictInfo(ElementConflictInfo elementConflictInfo) {
+    ElementInfo elementInfo = elementConflictInfo.getLocalElementInfo() == null
+        ? elementConflictInfo.getRemoteElementInfo()
+        : elementConflictInfo.getLocalElementInfo();
+
+    return new ConflictInfo(elementInfo.getId().getValue(),
+        ElementType
+            .valueOf(elementInfo.getInfo().getProperty(ElementPropertyName.elementType.name())),
+        elementInfo.getInfo().getName());
+  }
+}
diff --git a/openecomp-be/lib/openecomp-conflict-lib/openecomp-conflict-core/src/main/java/org/openecomp/conflicts/impl/VspMergeHandler.java b/openecomp-be/lib/openecomp-conflict-lib/openecomp-conflict-core/src/main/java/org/openecomp/conflicts/impl/VspMergeHandler.java
new file mode 100644
index 0000000..f7d0bca
--- /dev/null
+++ b/openecomp-be/lib/openecomp-conflict-lib/openecomp-conflict-core/src/main/java/org/openecomp/conflicts/impl/VspMergeHandler.java
@@ -0,0 +1,204 @@
+package org.openecomp.conflicts.impl;
+
+import org.openecomp.conflicts.ItemMergeHandler;
+import org.openecomp.conflicts.dao.ConflictsDao;
+import org.openecomp.conflicts.types.Conflict;
+import org.openecomp.conflicts.types.ConflictInfo;
+import org.openecomp.conflicts.types.ConflictResolution;
+import org.openecomp.conflicts.types.ItemVersionConflict;
+import org.openecomp.conflicts.types.Resolution;
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.common.errors.ErrorCategory;
+import org.openecomp.sdc.common.errors.ErrorCode;
+import org.openecomp.sdc.datatypes.model.ElementType;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.VspMergeDao;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+import static org.openecomp.sdc.datatypes.model.ElementType.NetworkPackage;
+import static org.openecomp.sdc.datatypes.model.ElementType.OrchestrationTemplate;
+import static org.openecomp.sdc.datatypes.model.ElementType.OrchestrationTemplateCandidate;
+import static org.openecomp.sdc.datatypes.model.ElementType.OrchestrationTemplateCandidateContent;
+import static org.openecomp.sdc.datatypes.model.ElementType.OrchestrationTemplateValidationData;
+import static org.openecomp.sdc.datatypes.model.ElementType.VspModel;
+
+public class VspMergeHandler implements ItemMergeHandler {
+
+  private static final String VSP_MODEL_CONFLICT_ID = "vspModelConflictId";
+  private static final String ELEMENT_CONFLICT_NOT_EXIST_ERR_ID = "ELEMENT_CONFLICT_NOT_EXIST";
+  private static final String ELEMENT_CONFLICT_NOT_EXISTS_MSG =
+      "Item Id %s, version Id %s, element conflict with Id %s does not exists.";
+  private static final Set<ElementType> FILTERED_OUT_TYPES = Stream
+      .of(OrchestrationTemplateCandidateContent, OrchestrationTemplateValidationData)
+      .collect(Collectors.toSet());
+  private static final Map<ElementType, Set<ElementType>> ELEMENT_TYPE_TO_CONFLICT_DEPENDANT_TYPES =
+      new HashMap<>();
+
+  static {
+    ELEMENT_TYPE_TO_CONFLICT_DEPENDANT_TYPES.put(OrchestrationTemplateCandidate,
+        Collections.singleton(OrchestrationTemplateCandidateContent));
+    ELEMENT_TYPE_TO_CONFLICT_DEPENDANT_TYPES.put(OrchestrationTemplate,
+        Collections.singleton(OrchestrationTemplateValidationData));
+  }
+
+  private ConflictsDao conflictsDao;
+  private VspMergeDao vspMergeDao;
+
+  public VspMergeHandler(ConflictsDao conflictsDao, VspMergeDao vspMergeDao) {
+    this.conflictsDao = conflictsDao;
+    this.vspMergeDao = vspMergeDao;
+  }
+
+  @Override
+  public boolean isConflicted(String itemId, Version version) {
+    return vspMergeDao.isVspModelConflicted(itemId, version);
+  }
+
+  @Override
+  public void finalizeMerge(String itemId, Version version) {
+    if (!conflictsDao.isConflicted(itemId, version)) {
+      vspMergeDao.applyVspModelConflictResolution(itemId, version);
+    }
+  }
+
+  @Override
+  public void postListConflicts(String itemId, Version version, ItemVersionConflict conflicts) {
+    List<ConflictInfo> elementConflicts = new ArrayList<>();
+
+    boolean vspModelConflicted = false;
+    for (ConflictInfo elementConflict : conflicts.getElementConflicts()) {
+      if (elementConflict.getType() == VspModel) {
+        elementConflicts.add(
+            new ConflictInfo(elementConflict.getId(), NetworkPackage, NetworkPackage.name()));
+        vspModelConflicted = true;
+        continue;
+      }
+      if (!FILTERED_OUT_TYPES.contains(elementConflict.getType())) {
+        elementConflicts.add(elementConflict);
+      }
+    }
+
+    if (!vspModelConflicted && vspMergeDao.isVspModelConflicted(itemId, version)) {
+      elementConflicts
+          .add(new ConflictInfo(VSP_MODEL_CONFLICT_ID, NetworkPackage, NetworkPackage.name()));
+    }
+
+    conflicts.setElementConflicts(elementConflicts);
+  }
+
+  @Override
+  public Optional<Conflict> getConflict(String itemId, Version version, String conflictId) {
+    return VSP_MODEL_CONFLICT_ID.equals(conflictId)
+        ? Optional.of(buildVspModelConflict(conflictId))
+        : Optional.empty();
+  }
+
+  @Override
+  public void postGetConflict(String itemId, Version version, Conflict conflict) {
+    if (conflict.getType() == VspModel) {
+      Conflict vspModelConflict = buildVspModelConflict(null);
+      conflict.setType(vspModelConflict.getType());
+      conflict.setName(vspModelConflict.getName());
+      conflict.setYours(vspModelConflict.getYours());
+      conflict.setTheirs(vspModelConflict.getTheirs());
+    }
+  }
+
+  @Override
+  public void preResolveConflict(String itemId, Version version, String conflictId,
+                                 ConflictResolution resolution) {
+    if (VSP_MODEL_CONFLICT_ID.equals(conflictId)) {
+      return;
+    }
+    resolveDependantConflicts(itemId, version, conflictId, resolution);
+  }
+
+  @Override
+  public boolean resolveConflict(String itemId, Version version, String conflictId,
+                                 ConflictResolution resolution) {
+    if (VSP_MODEL_CONFLICT_ID.equals(conflictId)) {
+      vspMergeDao.updateVspModelConflictResolution(itemId, version,
+          com.amdocs.zusammen.datatypes.item.Resolution.valueOf(resolution.getResolution().name()));
+      return true;
+    }
+    Conflict conflict = conflictsDao.getConflict(itemId, version, conflictId);
+    if (conflict == null) {
+      throw getConflictNotExistException(itemId, version, conflictId);
+    }
+    if (conflict.getType() == VspModel) {
+      vspMergeDao.updateVspModelConflictResolution(itemId, version,
+          com.amdocs.zusammen.datatypes.item.Resolution.valueOf(resolution.getResolution().name()));
+
+      conflictsDao.resolveConflict(itemId, version, conflictId, new ConflictResolution(
+          conflict.getTheirs() == null ? Resolution.YOURS : Resolution.THEIRS));
+      return true;
+    }
+    return false;
+  }
+
+  private void resolveDependantConflicts(String itemId, Version version, String conflictId,
+                                         ConflictResolution resolution) {
+    ItemVersionConflict conflicts = conflictsDao.getConflict(itemId, version);
+
+    Set<ElementType> conflictDependantTypes =
+        ELEMENT_TYPE_TO_CONFLICT_DEPENDANT_TYPES
+            .get(findConflictById(conflicts, conflictId).getType());
+
+    if (conflictDependantTypes == null) {
+      return;
+    }
+
+    findConflictsByTypes(conflicts, conflictDependantTypes)
+        .forEach(dependantConflict ->
+            conflictsDao.resolveConflict(itemId, version, dependantConflict.getId(), resolution));
+  }
+
+  private ConflictInfo findConflictById(ItemVersionConflict versionConflicts,
+                                        String conflictId) {
+    return versionConflicts.getElementConflicts().stream()
+        .filter(elementConflict -> conflictId.equals(elementConflict.getId()))
+        .findFirst()
+        .orElseThrow(() -> new IllegalStateException(
+            String.format("Conflict Id %s does not exist on conflicts list", conflictId)));
+  }
+
+  private Collection<ConflictInfo> findConflictsByTypes(ItemVersionConflict versionConflicts,
+                                                        Set<ElementType> elementTypes) {
+    return versionConflicts.getElementConflicts().stream()
+        .filter(elementConflict -> elementTypes.contains(elementConflict.getType()))
+        .collect(Collectors.toList());
+  }
+
+  private Conflict buildVspModelConflict(String conflictId) {
+    Conflict conflict = new Conflict(conflictId, NetworkPackage, NetworkPackage.name());
+
+    Map<String, String> yours = new HashMap<>();
+    yours.put("File", "Local (Me)");
+    conflict.setYours(yours);
+
+    Map<String, String> theirs = new HashMap<>();
+    theirs.put("File", "Last Committed");
+    conflict.setTheirs(theirs);
+    return conflict;
+  }
+
+  private CoreException getConflictNotExistException(String itemId, Version version,
+                                                     String conflictId) {
+    return new CoreException(new ErrorCode.ErrorCodeBuilder()
+        .withCategory(ErrorCategory.APPLICATION)
+        .withId(ELEMENT_CONFLICT_NOT_EXIST_ERR_ID)
+        .withMessage(
+            String.format(ELEMENT_CONFLICT_NOT_EXISTS_MSG, itemId, version.getId(), conflictId))
+        .build());
+  }
+}
diff --git a/openecomp-be/lib/openecomp-conflict-lib/openecomp-conflict-core/src/main/resources/factoryConfiguration.json b/openecomp-be/lib/openecomp-conflict-lib/openecomp-conflict-core/src/main/resources/factoryConfiguration.json
new file mode 100644
index 0000000..ec9f370
--- /dev/null
+++ b/openecomp-be/lib/openecomp-conflict-lib/openecomp-conflict-core/src/main/resources/factoryConfiguration.json
@@ -0,0 +1,4 @@
+{
+  "org.openecomp.conflicts.ItemMergeHandlerFactory": "org.openecomp.conflicts.ItemMergeHandlerFactoryImpl",
+  "org.openecomp.conflicts.dao.ConflictsDaoFactory": "org.openecomp.conflicts.dao.impl.zusammen.ConflictsDaoFactoryImpl"
+}
\ No newline at end of file
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/activity-log-rest/pom.xml b/openecomp-be/lib/openecomp-conflict-lib/pom.xml
similarity index 65%
copy from openecomp-be/api/openecomp-sdc-rest-webapp/activity-log-rest/pom.xml
copy to openecomp-be/lib/openecomp-conflict-lib/pom.xml
index 0b3c83c..de6bcd6 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/activity-log-rest/pom.xml
+++ b/openecomp-be/lib/openecomp-conflict-lib/pom.xml
@@ -4,19 +4,17 @@
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
-    <groupId>org.openecomp.sdc</groupId>
-    <artifactId>activity-log-rest</artifactId>
-    <packaging>pom</packaging>
-
     <parent>
         <groupId>org.openecomp.sdc</groupId>
-        <artifactId>openecomp-sdc-rest-webapp</artifactId>
+        <artifactId>openecomp-sdc-lib</artifactId>
         <version>1.2.0-SNAPSHOT</version>
+        <relativePath>..</relativePath>
     </parent>
 
+    <artifactId>openecomp-conflict-lib</artifactId>
+    <packaging>pom</packaging>
     <modules>
-        <module>activity-log-rest-services</module>
-        <module>activity-log-rest-types</module>
+        <module>openecomp-conflict-api</module>
+        <module>openecomp-conflict-core</module>
     </modules>
-    
-</project>
+</project>
\ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/test/java/org/openecomp/sdc/applicationconfig/dao/ApplicationConfigImplDaoTest.java b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/test/java/org/openecomp/sdc/applicationconfig/dao/ApplicationConfigImplDaoTest.java
index 6b5c5f9..e3d8765 100644
--- a/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/test/java/org/openecomp/sdc/applicationconfig/dao/ApplicationConfigImplDaoTest.java
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/test/java/org/openecomp/sdc/applicationconfig/dao/ApplicationConfigImplDaoTest.java
@@ -20,23 +20,6 @@
 
 package org.openecomp.sdc.applicationconfig.dao;
 
-import org.openecomp.core.utilities.applicationconfig.ApplicationConfig;
-import org.openecomp.core.utilities.applicationconfig.ApplicationConfigFactory;
-import org.openecomp.core.utilities.applicationconfig.dao.ApplicationConfigDao;
-import org.openecomp.core.utilities.applicationconfig.dao.ApplicationConfigDaoFactory;
-import org.openecomp.core.utilities.applicationconfig.dao.type.ApplicationConfigEntity;
-import org.openecomp.core.utilities.applicationconfig.type.ConfigurationData;
-import org.openecomp.core.utilities.file.FileUtils;
-import org.openecomp.sdc.common.errors.CoreException;
-import org.openecomp.sdc.common.errors.ErrorCategory;
-import org.openecomp.sdc.common.errors.ErrorCode;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
-import org.testng.Assert;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
-
-
 public class ApplicationConfigImplDaoTest {
 
   /*
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-api/src/main/java/org/openecomp/core/factory/impl/AbstractFactoryBase.java b/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-api/src/main/java/org/openecomp/core/factory/impl/AbstractFactoryBase.java
index 9353de6..7b53f34 100644
--- a/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-api/src/main/java/org/openecomp/core/factory/impl/AbstractFactoryBase.java
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-api/src/main/java/org/openecomp/core/factory/impl/AbstractFactoryBase.java
@@ -21,9 +21,6 @@
 package org.openecomp.core.factory.impl;
 
 
-import static org.openecomp.core.utilities.CommonMethods.isEmpty;
-import static org.openecomp.core.utilities.CommonMethods.newInstance;
-
 import org.openecomp.sdc.common.errors.CoreException;
 import org.openecomp.sdc.common.errors.ErrorCategory;
 import org.openecomp.sdc.common.errors.ErrorCode;
@@ -32,6 +29,9 @@
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 
+import static org.openecomp.core.utilities.CommonMethods.isEmpty;
+import static org.openecomp.core.utilities.CommonMethods.newInstance;
+
 public abstract class AbstractFactoryBase {
 
   /**
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/util/UniqueValueUtil.java b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/util/UniqueValueUtil.java
index dce34a1..15e9cee 100644
--- a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/util/UniqueValueUtil.java
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/util/UniqueValueUtil.java
@@ -32,7 +32,7 @@
 import java.util.Optional;
 
 public class UniqueValueUtil {
-  public static final String UNIQUE_VALUE_VIOLATION = "UNIQUE_VALUE_VIOLATION";
+  private static final String UNIQUE_VALUE_VIOLATION = "UNIQUE_VALUE_VIOLATION";
   private static final String UNIQUE_VALUE_VIOLATION_MSG = "%s with the value '%s' already exists.";
 
   private static final UniqueValueDao uniqueValueDao =
@@ -46,9 +46,7 @@
    * @param uniqueCombination the unique combination
    */
   public static void createUniqueValue(String type, String... uniqueCombination) {
-
-
-    mdcDataDebugMessage.debugEntryMessage(null, null);
+    mdcDataDebugMessage.debugEntryMessage(null);
 
     Optional<String> value = formatValue(uniqueCombination);
     if (!value.isPresent()) {
@@ -57,7 +55,7 @@
     validateUniqueValue(type, value.get(), uniqueCombination);
     uniqueValueDao.create(new UniqueValueEntity(type, value.get()));
 
-    mdcDataDebugMessage.debugExitMessage(null, null);
+    mdcDataDebugMessage.debugExitMessage(null);
   }
 
   /**
@@ -69,7 +67,7 @@
   public static void deleteUniqueValue(String type, String... uniqueCombination) {
 
 
-    mdcDataDebugMessage.debugEntryMessage(null, null);
+    mdcDataDebugMessage.debugEntryMessage(null);
 
     Optional<String> value = formatValue(uniqueCombination);
     if (!value.isPresent()) {
@@ -77,7 +75,7 @@
     }
     uniqueValueDao.delete(new UniqueValueEntity(type, value.get()));
 
-    mdcDataDebugMessage.debugExitMessage(null, null);
+    mdcDataDebugMessage.debugExitMessage(null);
   }
 
   /**
@@ -92,17 +90,14 @@
                                        String... uniqueContext) {
 
 
-    mdcDataDebugMessage.debugEntryMessage(null, null);
+    mdcDataDebugMessage.debugEntryMessage(null);
 
-    boolean nonEqual = (newValue != null) && (oldValue != null)
-            && !newValue.toLowerCase().equals(oldValue.toLowerCase());
-
-    if (nonEqual || newValue == null || oldValue == null) {
+    if (newValue == null || oldValue == null || !newValue.equalsIgnoreCase(oldValue)) {
       createUniqueValue(type, CommonMethods.concat(uniqueContext, new String[]{newValue}));
       deleteUniqueValue(type, CommonMethods.concat(uniqueContext, new String[]{oldValue}));
     }
 
-    mdcDataDebugMessage.debugExitMessage(null, null);
+    mdcDataDebugMessage.debugExitMessage(null);
   }
 
   /**
@@ -112,7 +107,7 @@
    * @param uniqueCombination the unique combination
    */
   public static void validateUniqueValue(String type, String... uniqueCombination) {
-    mdcDataDebugMessage.debugEntryMessage(null, null);
+    mdcDataDebugMessage.debugEntryMessage(null);
 
     Optional<String> value = formatValue(uniqueCombination);
     if (!value.isPresent()) {
@@ -120,11 +115,11 @@
     }
     validateUniqueValue(type, value.get(), uniqueCombination);
 
-    mdcDataDebugMessage.debugExitMessage(null, null);
+    mdcDataDebugMessage.debugExitMessage(null);
   }
 
   private static void validateUniqueValue(String type, String value, String... uniqueCombination) {
-    mdcDataDebugMessage.debugEntryMessage(null, null);
+    mdcDataDebugMessage.debugEntryMessage(null);
 
     if (uniqueValueDao.get(new UniqueValueEntity(type, value)) != null) {
       throw new CoreException(new ErrorCode.ErrorCodeBuilder()
@@ -134,13 +129,13 @@
               uniqueCombination[uniqueCombination.length - 1])).build());
     }
 
-    mdcDataDebugMessage.debugExitMessage(null, null);
+    mdcDataDebugMessage.debugExitMessage(null);
   }
 
   private static Optional<String> formatValue(String[] uniqueCombination) {
 
 
-    mdcDataDebugMessage.debugEntryMessage(null, null);
+    mdcDataDebugMessage.debugEntryMessage(null);
 
     if (uniqueCombination == null || uniqueCombination.length == 0
         || uniqueCombination[uniqueCombination.length - 1] == null) {
@@ -150,7 +145,7 @@
     uniqueCombination[uniqueCombination.length - 1] =
         uniqueCombination[uniqueCombination.length - 1].toLowerCase();
 
-    mdcDataDebugMessage.debugExitMessage(null, null);
+    mdcDataDebugMessage.debugExitMessage(null);
     return Optional.of(CommonMethods.arrayToSeparatedString(uniqueCombination, '_'));
   }
 }
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/impl/cassandra/CassandraNoSqlDbImpl.java b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/impl/cassandra/CassandraNoSqlDbImpl.java
index 93410bc..2172e1b 100644
--- a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/impl/cassandra/CassandraNoSqlDbImpl.java
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/impl/cassandra/CassandraNoSqlDbImpl.java
@@ -20,7 +20,11 @@
 
 package org.openecomp.core.nosqldb.impl.cassandra;
 
-import com.datastax.driver.core.*;
+import com.datastax.driver.core.BoundStatement;
+import com.datastax.driver.core.Host;
+import com.datastax.driver.core.PreparedStatement;
+import com.datastax.driver.core.ResultSet;
+import com.datastax.driver.core.Session;
 import com.datastax.driver.mapping.MappingManager;
 import org.openecomp.core.nosqldb.api.NoSqlDb;
 import org.openecomp.core.nosqldb.util.CassandraUtils;
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/test/java/org/openecomp/core/nosqldb/NoSqlDbTest.java b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/test/java/org/openecomp/core/nosqldb/NoSqlDbTest.java
index 5c4f951..2bab7e0 100644
--- a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/test/java/org/openecomp/core/nosqldb/NoSqlDbTest.java
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/test/java/org/openecomp/core/nosqldb/NoSqlDbTest.java
@@ -20,14 +20,7 @@
 
 package org.openecomp.core.nosqldb;
 
-import com.datastax.driver.core.ResultSet;
-import com.datastax.driver.core.Row;
 import org.openecomp.core.nosqldb.api.NoSqlDb;
-import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
-import org.testng.Assert;
-import org.testng.annotations.Test;
-
-import java.util.List;
 
 
 public class NoSqlDbTest {
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/test/java/org/openecomp/core/nosqldb/util/ConfigurationManagerTest.java b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/test/java/org/openecomp/core/nosqldb/util/ConfigurationManagerTest.java
index f8d5d2d..7a6343d 100644
--- a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/test/java/org/openecomp/core/nosqldb/util/ConfigurationManagerTest.java
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/test/java/org/openecomp/core/nosqldb/util/ConfigurationManagerTest.java
@@ -7,7 +7,7 @@
 import java.io.IOException;
 import java.lang.reflect.Field;
 
-import static org.testng.Assert.*;
+import static org.testng.Assert.assertNotNull;
 
 /**
  * @author EVITALIY
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-session-lib/pom.xml b/openecomp-be/lib/openecomp-core-lib/openecomp-session-lib/pom.xml
new file mode 100644
index 0000000..c0618ba
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-session-lib/pom.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.openecomp.sdc.core</groupId>
+        <artifactId>openecomp-core-lib</artifactId>
+        <version>1.2.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>openecomp-session-lib</artifactId>
+
+
+    <dependencies>
+        <dependency>
+            <groupId>org.openecomp.sdc.core</groupId>
+            <artifactId>openecomp-facade-api</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.openecomp.sdc.core</groupId>
+            <artifactId>openecomp-facade-core</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
+
+
+</project>
\ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-session-lib/src/main/java/org/openecomp/sdc/common/session/SessionContext.java b/openecomp-be/lib/openecomp-core-lib/openecomp-session-lib/src/main/java/org/openecomp/sdc/common/session/SessionContext.java
new file mode 100644
index 0000000..a1b410c
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-session-lib/src/main/java/org/openecomp/sdc/common/session/SessionContext.java
@@ -0,0 +1,8 @@
+package org.openecomp.sdc.common.session;
+
+public interface SessionContext {
+
+  User getUser();
+
+  String getTenant();
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-session-lib/src/main/java/org/openecomp/sdc/common/session/SessionContextProvider.java b/openecomp-be/lib/openecomp-core-lib/openecomp-session-lib/src/main/java/org/openecomp/sdc/common/session/SessionContextProvider.java
new file mode 100644
index 0000000..8efbbd1
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-session-lib/src/main/java/org/openecomp/sdc/common/session/SessionContextProvider.java
@@ -0,0 +1,10 @@
+package org.openecomp.sdc.common.session;
+
+public interface SessionContextProvider {
+
+  void create(String user);
+
+  SessionContext get();
+
+  void close();
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/UploadDataDaoFactory.java b/openecomp-be/lib/openecomp-core-lib/openecomp-session-lib/src/main/java/org/openecomp/sdc/common/session/SessionContextProviderFactory.java
similarity index 77%
copy from openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/UploadDataDaoFactory.java
copy to openecomp-be/lib/openecomp-core-lib/openecomp-session-lib/src/main/java/org/openecomp/sdc/common/session/SessionContextProviderFactory.java
index 9654551..cfa6a34 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/UploadDataDaoFactory.java
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-session-lib/src/main/java/org/openecomp/sdc/common/session/SessionContextProviderFactory.java
@@ -7,9 +7,9 @@
  * 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.
@@ -18,14 +18,15 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.sdc.vendorsoftwareproduct.dao;
+package org.openecomp.sdc.common.session;
 
 import org.openecomp.core.factory.api.AbstractComponentFactory;
 import org.openecomp.core.factory.api.AbstractFactory;
 
-public abstract class UploadDataDaoFactory extends AbstractComponentFactory<UploadDataDao> {
+public abstract class SessionContextProviderFactory
+    extends AbstractComponentFactory<SessionContextProvider> {
 
-  public static UploadDataDaoFactory getInstance() {
-    return AbstractFactory.getInstance(UploadDataDaoFactory.class);
+  public static SessionContextProviderFactory getInstance() {
+    return AbstractFactory.getInstance(SessionContextProviderFactory.class);
   }
 }
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-session-lib/src/main/java/org/openecomp/sdc/common/session/User.java b/openecomp-be/lib/openecomp-core-lib/openecomp-session-lib/src/main/java/org/openecomp/sdc/common/session/User.java
new file mode 100644
index 0000000..5319a0b
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-session-lib/src/main/java/org/openecomp/sdc/common/session/User.java
@@ -0,0 +1,13 @@
+package org.openecomp.sdc.common.session;
+
+public class User {
+  private final String userId;
+
+  public User(String userId) {
+    this.userId = userId;
+  }
+
+  public String getUserId() {
+    return userId;
+  }
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-session-lib/src/main/java/org/openecomp/sdc/common/session/impl/AsdcSessionContextProvider.java b/openecomp-be/lib/openecomp-core-lib/openecomp-session-lib/src/main/java/org/openecomp/sdc/common/session/impl/AsdcSessionContextProvider.java
new file mode 100644
index 0000000..53a40a1
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-session-lib/src/main/java/org/openecomp/sdc/common/session/impl/AsdcSessionContextProvider.java
@@ -0,0 +1,50 @@
+package org.openecomp.sdc.common.session.impl;
+
+import org.openecomp.sdc.common.session.SessionContext;
+import org.openecomp.sdc.common.session.SessionContextProvider;
+import org.openecomp.sdc.common.session.User;
+
+public class AsdcSessionContextProvider implements SessionContextProvider {
+
+  private static final ThreadLocal<String> threadUserId = new ThreadLocal<>();
+
+  @Override
+  public void create(String userId) {
+    threadUserId.set(userId);
+  }
+
+  @Override
+  public SessionContext get() {
+    if (threadUserId.get() == null) {
+      throw new RuntimeException("UserId was not set for this thread");
+    }
+
+    return new AsdcSessionContext(new User(threadUserId.get()), "dox");
+  }
+
+  @Override
+  public void close() {
+    threadUserId.remove();
+  }
+
+  private static class AsdcSessionContext implements SessionContext {
+
+    private final User user;
+    private final String tenant;
+
+    private AsdcSessionContext(User user, String tenant) {
+      this.user = user;
+      this.tenant = tenant;
+    }
+
+    @Override
+    public User getUser() {
+      return user;
+    }
+
+    @Override
+    public String getTenant() {
+      return tenant;
+    }
+  }
+}
diff --git a/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activityLog/ActivityLogManager.java b/openecomp-be/lib/openecomp-core-lib/openecomp-session-lib/src/main/java/org/openecomp/sdc/common/session/impl/SessionContextProviderFactoryImpl.java
similarity index 68%
copy from openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activityLog/ActivityLogManager.java
copy to openecomp-be/lib/openecomp-core-lib/openecomp-session-lib/src/main/java/org/openecomp/sdc/common/session/impl/SessionContextProviderFactoryImpl.java
index a40e101..635aa5b 100644
--- a/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activityLog/ActivityLogManager.java
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-session-lib/src/main/java/org/openecomp/sdc/common/session/impl/SessionContextProviderFactoryImpl.java
@@ -18,14 +18,16 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.sdc.activityLog;
+package org.openecomp.sdc.common.session.impl;
 
-import org.openecomp.sdc.activitylog.dao.type.ActivityLogEntity;
-import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.common.session.SessionContextProvider;
+import org.openecomp.sdc.common.session.SessionContextProviderFactory;
 
-import java.util.Collection;
+public class SessionContextProviderFactoryImpl extends SessionContextProviderFactory {
+  private static final SessionContextProvider INSTANCE = new AsdcSessionContextProvider();
 
-public interface ActivityLogManager {
-    void addActionLog(ActivityLogEntity activityLogEntity, String user);
-    Collection<ActivityLogEntity> listActivityLogs(String itemId, Version versionId, String user);
+  @Override
+  public SessionContextProvider createInterface() {
+    return INSTANCE;
+  }
 }
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-session-lib/src/main/resources/factoryConfiguration.json b/openecomp-be/lib/openecomp-core-lib/openecomp-session-lib/src/main/resources/factoryConfiguration.json
new file mode 100644
index 0000000..cd1637a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-session-lib/src/main/resources/factoryConfiguration.json
@@ -0,0 +1,3 @@
+{
+  "org.openecomp.sdc.common.session.SessionContextProviderFactory": "org.openecomp.sdc.common.session.impl.SessionContextProviderFactoryImpl"
+}
\ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/file/FileUtils.java b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/file/FileUtils.java
index 6ab3f8b..5a8a2db 100644
--- a/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/file/FileUtils.java
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/file/FileUtils.java
@@ -23,12 +23,9 @@
 import org.apache.commons.io.FilenameUtils;
 import org.apache.commons.io.IOUtils;
 import org.openecomp.core.utilities.json.JsonUtil;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.openecomp.sdc.tosca.services.YamlUtil;
 
 import java.io.ByteArrayInputStream;
-import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.URL;
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/java/org/openecomp/core/utilities/file/FileContentHandlerTest.java b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/java/org/openecomp/core/utilities/file/FileContentHandlerTest.java
index 527ba22..be0686e 100644
--- a/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/java/org/openecomp/core/utilities/file/FileContentHandlerTest.java
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/java/org/openecomp/core/utilities/file/FileContentHandlerTest.java
@@ -6,7 +6,9 @@
 import java.util.Arrays;
 import java.util.Optional;
 
-import static org.testng.Assert.*;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertTrue;
 
 /**
  * @author EVITALIY
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-api/pom.xml b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-api/pom.xml
index 538a7fb..ee59b5b 100644
--- a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-api/pom.xml
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-api/pom.xml
@@ -20,6 +20,16 @@
         </dependency>
         <dependency>
             <groupId>org.openecomp.sdc.core</groupId>
+            <artifactId>openecomp-session-lib</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.openecomp.sdc</groupId>
+            <artifactId>openecomp-sdc-versioning-api</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.openecomp.sdc.core</groupId>
             <artifactId>openecomp-facade-api</artifactId>
             <version>${project.version}</version>
         </dependency>
@@ -43,6 +53,11 @@
             <artifactId>commons-lang3</artifactId>
             <version>3.4</version>
         </dependency>
+        <dependency>
+            <groupId>com.amdocs.zusammen</groupId>
+            <artifactId>zusammen-datatypes</artifactId>
+            <version>${zusammen.version}</version>
+        </dependency>
     </dependencies>
 
 
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-api/src/main/java/org/openecomp/convertor/ElementConvertor.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-api/src/main/java/org/openecomp/convertor/ElementConvertor.java
new file mode 100644
index 0000000..68c7098
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-api/src/main/java/org/openecomp/convertor/ElementConvertor.java
@@ -0,0 +1,37 @@
+package org.openecomp.convertor;
+
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.Element;
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.ElementInfo;
+import com.amdocs.zusammen.datatypes.item.Item;
+import com.amdocs.zusammen.datatypes.item.ItemVersion;
+import org.openecomp.sdc.datatypes.model.ElementType;
+import org.openecomp.types.ElementPropertyName;
+
+public abstract class ElementConvertor<T> {
+
+  public static ElementType getElementType(Element element) {
+    return ElementType
+        .valueOf(element.getInfo().getProperty(ElementPropertyName.elementType.name()));
+  }
+
+  public static String getElementName(Element element) {
+    return element.getInfo().getName();
+  }
+
+
+  abstract public T convert(Element element);
+
+  public T convert( ElementInfo elementInfo) {
+    throw new UnsupportedOperationException("convert elementInfo item is not supported ");
+  }
+
+
+  public T convert( Item item) {
+    throw new UnsupportedOperationException("convert from item is not supported ");
+  }
+
+
+  public T convert( ItemVersion itemVersion) {
+    throw new UnsupportedOperationException("convert from itemVersion is not supported ");
+  }
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-api/src/main/java/org/openecomp/core/zusammen/api/ZusammenAdaptor.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-api/src/main/java/org/openecomp/core/zusammen/api/ZusammenAdaptor.java
index 2ba447f..35c07cb 100644
--- a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-api/src/main/java/org/openecomp/core/zusammen/api/ZusammenAdaptor.java
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-api/src/main/java/org/openecomp/core/zusammen/api/ZusammenAdaptor.java
@@ -1,7 +1,9 @@
 package org.openecomp.core.zusammen.api;
 
 import com.amdocs.zusammen.adaptor.inbound.api.types.item.Element;
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.ElementConflict;
 import com.amdocs.zusammen.adaptor.inbound.api.types.item.ElementInfo;
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.ItemVersionConflict;
 import com.amdocs.zusammen.adaptor.inbound.api.types.item.ZusammenElement;
 import com.amdocs.zusammen.commons.health.data.HealthInfo;
 import com.amdocs.zusammen.datatypes.Id;
@@ -11,31 +13,53 @@
 import com.amdocs.zusammen.datatypes.item.Item;
 import com.amdocs.zusammen.datatypes.item.ItemVersion;
 import com.amdocs.zusammen.datatypes.item.ItemVersionData;
+import com.amdocs.zusammen.datatypes.item.ItemVersionStatus;
+import com.amdocs.zusammen.datatypes.item.Resolution;
 import com.amdocs.zusammen.datatypes.itemversion.Tag;
+import org.openecomp.sdc.versioning.dao.types.Revision;
 
 import java.util.Collection;
+import java.util.List;
 import java.util.Optional;
 
 public interface ZusammenAdaptor {
 
   Collection<Item> listItems(SessionContext context);
 
+  Item getItem(SessionContext context, Id itemId);
+
   Id createItem(SessionContext context, Info info);
 
   void updateItem(SessionContext context, Id itemId, Info info);
 
-  // TODO: 4/4/2017 fix this workaround when versionId will be recieved from UI
+  // TODO: 4/4/2017 remove this workaround when versionId will be recieved from UI
   Optional<ItemVersion> getFirstVersion(SessionContext context, Id itemId);
 
+  Collection<ItemVersion> listPublicVersions(SessionContext context, Id itemId);
+
+  ItemVersion getPublicVersion(SessionContext context, Id itemId, Id versionId);
+
   Id createVersion(SessionContext context, Id itemId, Id baseVersionId,
                    ItemVersionData itemVersionData);
 
   void updateVersion(SessionContext context, Id itemId, Id versionId,
                      ItemVersionData itemVersionData);
 
+  ItemVersion getVersion(SessionContext context, Id itemId, Id versionId);
+
+  ItemVersionStatus getVersionStatus(SessionContext context, Id itemId, Id versionId);
+
+  ItemVersionConflict getVersionConflict(SessionContext context, Id itemId, Id versionId);
+
   void tagVersion(SessionContext context, Id itemId, Id versionId, Tag tag);
 
-  void resetVersionHistory(SessionContext context, Id itemId, Id versionId, String changeRef);
+  void resetVersionHistory(SessionContext context, Id itemId, Id versionId, String version);
+
+  void publishVersion(SessionContext context, Id itemId, Id versionId, String message);
+
+  void syncVersion(SessionContext context, Id itemId, Id versionId);
+
+  void forceSyncVersion(SessionContext context, Id itemId, Id versionId);
 
   Optional<ElementInfo> getElementInfo(SessionContext context, ElementContext elementContext,
                                        Id elementId);
@@ -43,38 +67,39 @@
   Optional<Element> getElement(SessionContext context, ElementContext elementContext,
                                String elementId); // TODO: 4/3/2017 change to Id
 
-  Optional<Element> getElementByName(
-      SessionContext context, ElementContext elementContext, Id parentElementId,
-      String elementName);
+  Optional<Element> getElementByName(SessionContext context, ElementContext elementContext,
+                                     Id parentElementId, String elementName);
 
-  Collection<ElementInfo> listElements(SessionContext context,
-                                       ElementContext elementContext,
+  Collection<ElementInfo> listElements(SessionContext context, ElementContext elementContext,
                                        Id parentElementId);
 
-  Collection<Element> listElementData(SessionContext context,
-                                      ElementContext elementContext,
+  Collection<Element> listElementData(SessionContext context, ElementContext elementContext,
                                       Id parentElementId);
 
   /**
-   * Lists the sub elements of the element named <elementName> which is a sub element of <parentElementId>
-   * @param context
-   * @param elementContext
-   * @param parentElementId
-   * @param elementName
-   * @return
+   * Lists the sub elements of the element named elementName which is a sub element of
+   * parentElementId
    */
-  Collection<ElementInfo> listElementsByName(
-      SessionContext context, ElementContext elementContext, Id parentElementId,
-      String elementName);
+  Collection<ElementInfo> listElementsByName(SessionContext context, ElementContext elementContext,
+                                             Id parentElementId, String elementName);
 
-  Optional<ElementInfo> getElementInfoByName(
-      SessionContext context, ElementContext elementContext, Id parentElementId,
-      String elementName);
+  Optional<ElementInfo> getElementInfoByName(SessionContext context, ElementContext elementContext,
+                                             Id parentElementId, String elementName);
 
-  Optional<Element> saveElement(SessionContext context, ElementContext elementContext,
-                                ZusammenElement element, String message);
+  Optional<ElementConflict> getElementConflict(SessionContext context,
+                                               ElementContext elementContext, Id elementId);
+
+  Element saveElement(SessionContext context, ElementContext elementContext,
+                      ZusammenElement element, String message);
+
+  void resolveElementConflict(SessionContext context, ElementContext elementContext,
+                              ZusammenElement element, Resolution resolution);
 
   Collection<HealthInfo> checkHealth(SessionContext context);
 
-  String getVersion(SessionContext sessionContext);
+  String getVersion(SessionContext context);
+
+  void revert(SessionContext sessionContext, String itemId, String versionId, String revisionId);
+
+  List<Revision> listRevisions(SessionContext sessionContext, String itemId, String versionId);
 }
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-api/src/main/java/org/openecomp/core/zusammen/api/ZusammenUtil.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-api/src/main/java/org/openecomp/core/zusammen/api/ZusammenUtil.java
index 3df6151..623f958 100644
--- a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-api/src/main/java/org/openecomp/core/zusammen/api/ZusammenUtil.java
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-api/src/main/java/org/openecomp/core/zusammen/api/ZusammenUtil.java
@@ -1,40 +1,40 @@
 package org.openecomp.core.zusammen.api;
 
 import com.amdocs.zusammen.adaptor.inbound.api.types.item.ZusammenElement;
+import com.amdocs.zusammen.datatypes.Id;
 import com.amdocs.zusammen.datatypes.SessionContext;
 import com.amdocs.zusammen.datatypes.UserInfo;
 import com.amdocs.zusammen.datatypes.item.Action;
 import com.amdocs.zusammen.datatypes.item.Info;
-import com.amdocs.zusammen.datatypes.item.ItemVersionData;
+import org.openecomp.sdc.common.session.SessionContextProviderFactory;
+import org.openecomp.sdc.datatypes.model.ElementType;
+import org.openecomp.types.ElementPropertyName;
 
 public class ZusammenUtil {
-  // TODO: 3/19/2017 add user and tenant args
+
   public static SessionContext createSessionContext() {
+    org.openecomp.sdc.common.session.SessionContext asdcSessionContext =
+        SessionContextProviderFactory.getInstance().createInterface().get();
+
     SessionContext sessionContext = new SessionContext();
-    sessionContext.setUser(new UserInfo("GLOBAL_USER"));
-    sessionContext.setTenant("dox");
+    sessionContext.setUser(new UserInfo(asdcSessionContext.getUser().getUserId()));
+    sessionContext.setTenant(asdcSessionContext.getTenant());
     return sessionContext;
   }
 
-  public static ZusammenElement buildStructuralElement(String structureElementName,
-                                                       Action action) {
-    ZusammenElement element = new ZusammenElement();
+  public static ZusammenElement buildStructuralElement(ElementType elementType, Action action) {
+    ZusammenElement element = buildElement(null, action);
     Info info = new Info();
-    info.setName(structureElementName);
+    info.setName(elementType.name());
+    info.addProperty(ElementPropertyName.elementType.name(), elementType.name());
     element.setInfo(info);
-    if (action != null) {
-      element.setAction(action);
-    }
     return element;
   }
 
-  // TODO: 4/24/2017 remove upon working with more than one single version
-  public static ItemVersionData createFirstVersionData() {
-    Info info = new Info();
-    info.setName("main version");
-    ItemVersionData itemVersionData = new ItemVersionData();
-    itemVersionData.setInfo(info);
-    return itemVersionData;
+  public static ZusammenElement buildElement(Id elementId, Action action) {
+    ZusammenElement element = new ZusammenElement();
+    element.setElementId(elementId);
+    element.setAction(action);
+    return element;
   }
-
 }
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-api/src/main/java/org/openecomp/types/AsdcElement.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-api/src/main/java/org/openecomp/types/AsdcElement.java
new file mode 100644
index 0000000..ae9c1fc
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-api/src/main/java/org/openecomp/types/AsdcElement.java
@@ -0,0 +1,131 @@
+package org.openecomp.types;
+
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.Element;
+import com.amdocs.zusammen.datatypes.Id;
+import com.amdocs.zusammen.datatypes.item.Action;
+import com.amdocs.zusammen.datatypes.item.Info;
+import com.amdocs.zusammen.datatypes.item.Relation;
+import com.amdocs.zusammen.utils.fileutils.FileUtils;
+
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Map;
+
+public class AsdcElement implements Element {
+
+  private String type;
+  private String name;
+  private String description;
+
+  private Map<String, Object> properties;
+  private byte[] data;
+  private Collection<Relation> relations;
+  private Collection<Element> subElements = new ArrayList<>();
+  private Action action;
+  private Id elementId;
+
+  @Override
+  public Action getAction() {
+    return this.action;
+  }
+
+  @Override
+  public Id getElementId() {
+    return this.elementId;
+  }
+
+  @Override
+  public Info getInfo() {
+    Info info = new Info();
+    info.setProperties(this.properties);
+    info.addProperty(ElementPropertyName.elementType.name(), this.type != null ? this.type : this.name);
+    info.setName(this.name);
+    info.setDescription(this.description);
+
+    return info;
+  }
+
+  @Override
+  public Collection<Relation> getRelations() {
+    return this.relations;
+  }
+
+  @Override
+  public InputStream getData() {
+    return FileUtils.toInputStream(this.data);
+  }
+
+  @Override
+  public InputStream getSearchableData() {
+    return null;
+  }
+
+  @Override
+  public InputStream getVisualization() {
+    return null;
+  }
+
+
+  @Override
+  public Collection<Element> getSubElements() {
+    return this.subElements;
+  }
+
+  public void setElementId(Id elementId) {
+    this.elementId = elementId;
+  }
+
+  public void setData(InputStream data) {
+    this.data = FileUtils.toByteArray(data);
+  }
+
+  public void setRelations(Collection<Relation> relations) {
+    this.relations = relations;
+  }
+
+  public void setSubElements(Collection<Element> subElements) {
+    this.subElements = subElements;
+  }
+
+  public void setAction(Action action) {
+    this.action = action;
+  }
+
+  public AsdcElement addSubElement(Element element) {
+    this.subElements.add(element);
+    return this;
+  }
+
+  public String getType() {
+    return type;
+  }
+
+  public void setType(String type) {
+    this.type = type;
+  }
+
+  public String getName() {
+    return name;
+  }
+
+  public void setName(String name) {
+    this.name = name;
+  }
+
+  public String getDescription() {
+    return description;
+  }
+
+  public void setDescription(String description) {
+    this.description = description;
+  }
+
+  public Map<String, Object> getProperties() {
+    return properties;
+  }
+
+  public void setProperties(Map<String, Object> properties) {
+    this.properties = properties;
+  }
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-api/src/main/java/org/openecomp/types/ElementPropertyName.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-api/src/main/java/org/openecomp/types/ElementPropertyName.java
new file mode 100644
index 0000000..ddbef7d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-api/src/main/java/org/openecomp/types/ElementPropertyName.java
@@ -0,0 +1,6 @@
+package org.openecomp.types;
+
+public enum ElementPropertyName {
+  elementType,
+  compositionData
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-core/src/main/java/org/openecomp/core/zusammen/db/ZusammenConnector.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-core/src/main/java/org/openecomp/core/zusammen/db/ZusammenConnector.java
index 6381b2e..9005bb8 100644
--- a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-core/src/main/java/org/openecomp/core/zusammen/db/ZusammenConnector.java
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-core/src/main/java/org/openecomp/core/zusammen/db/ZusammenConnector.java
@@ -1,7 +1,9 @@
 package org.openecomp.core.zusammen.db;
 
 import com.amdocs.zusammen.adaptor.inbound.api.types.item.Element;
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.ElementConflict;
 import com.amdocs.zusammen.adaptor.inbound.api.types.item.ElementInfo;
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.ItemVersionConflict;
 import com.amdocs.zusammen.adaptor.inbound.api.types.item.ZusammenElement;
 import com.amdocs.zusammen.commons.health.data.HealthInfo;
 import com.amdocs.zusammen.datatypes.Id;
@@ -11,22 +13,31 @@
 import com.amdocs.zusammen.datatypes.item.Item;
 import com.amdocs.zusammen.datatypes.item.ItemVersion;
 import com.amdocs.zusammen.datatypes.item.ItemVersionData;
+import com.amdocs.zusammen.datatypes.item.ItemVersionStatus;
+import com.amdocs.zusammen.datatypes.item.Resolution;
+import com.amdocs.zusammen.datatypes.itemversion.ItemVersionRevisions;
 import com.amdocs.zusammen.datatypes.itemversion.Tag;
-import com.amdocs.zusammen.datatypes.response.Response;
 
 import java.util.Collection;
-import java.util.Optional;
 
 public interface ZusammenConnector {
 
+  Collection<HealthInfo> checkHealth(SessionContext sessionContext);
+
+  String getVersion(SessionContext sessionContext);
+
   Collection<Item> listItems(SessionContext context);
 
+  Item getItem(SessionContext context, Id itemId);
+
   Id createItem(SessionContext context, Info info);
 
   void updateItem(SessionContext context, Id itemId, Info info);
 
 
-  Collection<ItemVersion> listVersions(SessionContext context, Id itemId);
+  Collection<ItemVersion> listPublicVersions(SessionContext context, Id itemId);
+
+  ItemVersion getPublicVersion(SessionContext context, Id itemId, Id versionId);
 
   Id createVersion(SessionContext context, Id itemId, Id baseVersionId,
                    ItemVersionData itemVersionData);
@@ -34,23 +45,42 @@
   void updateVersion(SessionContext context, Id itemId, Id versionId,
                      ItemVersionData itemVersionData);
 
+  ItemVersion getVersion(SessionContext context, Id itemId, Id versionId);
+
+  ItemVersionStatus getVersionStatus(SessionContext context, Id itemId, Id versionId);
+
   void tagVersion(SessionContext context, Id itemId, Id versionId, Tag tag);
 
-  void resetVersionHistory(SessionContext context, Id itemId, Id versionId, String changeRef);
+  void resetVersionRevision(SessionContext context, Id itemId, Id versionId, Id revisionId);
+
+  void revertVersionRevision(SessionContext context, Id itemId, Id versionId, Id revisionId);
+
+  ItemVersionRevisions listVersionRevisions(SessionContext context, Id itemId, Id versionId);
+
+  void publishVersion(SessionContext context, Id itemId, Id versionId, String message);
+
+  void syncVersion(SessionContext context, Id itemId, Id versionId);
+
+  void forceSyncVersion(SessionContext context, Id itemId, Id versionId);
+
+  ItemVersionConflict getVersionConflict(SessionContext context, Id itemId, Id versionId);
 
 
   Collection<ElementInfo> listElements(SessionContext context, ElementContext elementContext,
                                        Id parentElementId);
 
-  Response<ElementInfo> getElementInfo(SessionContext context, ElementContext elementContext, Id
-      elementId);
+  ElementInfo getElementInfo(SessionContext context, ElementContext elementContext, Id elementId);
 
-  Response<Element> getElement(SessionContext context, ElementContext elementContext, Id elementId);
+  Element getElement(SessionContext context, ElementContext elementContext, Id elementId);
 
-  Optional<Element> saveElement(SessionContext context, ElementContext elementContext,
-                                ZusammenElement element, String message);
+  ElementConflict getElementConflict(SessionContext context, ElementContext elementContext,
+                                     Id elementId);
 
-  Collection<HealthInfo> checkHealth(SessionContext sessionContext);
+  Element saveElement(SessionContext context, ElementContext elementContext,
+                      ZusammenElement element, String message);
 
-  String getVersion(SessionContext sessionContext);
+  void resolveElementConflict(SessionContext context, ElementContext elementContext,
+                              ZusammenElement element, Resolution resolution);
+
+  void resetVersionHistory(SessionContext context, Id itemId, Id versionId, String changeRef);
 }
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-core/src/main/java/org/openecomp/core/zusammen/db/impl/ZusammenConnectorImpl.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-core/src/main/java/org/openecomp/core/zusammen/db/impl/ZusammenConnectorImpl.java
index deb5ffd..1d387b9 100644
--- a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-core/src/main/java/org/openecomp/core/zusammen/db/impl/ZusammenConnectorImpl.java
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-core/src/main/java/org/openecomp/core/zusammen/db/impl/ZusammenConnectorImpl.java
@@ -1,11 +1,14 @@
 package org.openecomp.core.zusammen.db.impl;
 
+import com.amdocs.zusammen.adaptor.inbound.api.health.HealthAdaptorFactory;
 import com.amdocs.zusammen.adaptor.inbound.api.item.ElementAdaptorFactory;
 import com.amdocs.zusammen.adaptor.inbound.api.item.ItemAdaptorFactory;
 import com.amdocs.zusammen.adaptor.inbound.api.item.ItemVersionAdaptorFactory;
-import com.amdocs.zusammen.adaptor.inbound.api.health.HealthAdaptorFactory;
 import com.amdocs.zusammen.adaptor.inbound.api.types.item.Element;
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.ElementConflict;
 import com.amdocs.zusammen.adaptor.inbound.api.types.item.ElementInfo;
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.ItemVersionConflict;
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.MergeResult;
 import com.amdocs.zusammen.adaptor.inbound.api.types.item.ZusammenElement;
 import com.amdocs.zusammen.commons.health.data.HealthInfo;
 import com.amdocs.zusammen.datatypes.Id;
@@ -16,6 +19,9 @@
 import com.amdocs.zusammen.datatypes.item.Item;
 import com.amdocs.zusammen.datatypes.item.ItemVersion;
 import com.amdocs.zusammen.datatypes.item.ItemVersionData;
+import com.amdocs.zusammen.datatypes.item.ItemVersionStatus;
+import com.amdocs.zusammen.datatypes.item.Resolution;
+import com.amdocs.zusammen.datatypes.itemversion.ItemVersionRevisions;
 import com.amdocs.zusammen.datatypes.itemversion.Tag;
 import com.amdocs.zusammen.datatypes.response.Response;
 import com.amdocs.zusammen.datatypes.response.ReturnCode;
@@ -28,14 +34,18 @@
 import org.openecomp.sdc.logging.types.LoggerErrorCode;
 
 import java.util.Collection;
-import java.util.Optional;
 
 public class ZusammenConnectorImpl implements ZusammenConnector {
 
+  private static final String GET_ELEMENT_ERR_MSG =
+      "Failed to get element. Item Id: %s, version Id: %s, element Id: %s message: %s";
+  private static final String GET_ELEMENT_IN_REV_ERR_MSG =
+      "Failed to get element. Item Id: %s, version Id: %s, revision Id: %s, element Id: %s message: %s";
   private ItemAdaptorFactory itemAdaptorFactory;
   private ItemVersionAdaptorFactory versionAdaptorFactory;
   private ElementAdaptorFactory elementAdaptorFactory;
   private HealthAdaptorFactory healthAdaptorFactory;
+
   public ZusammenConnectorImpl(
       ItemAdaptorFactory itemAdaptorFactory,
       ItemVersionAdaptorFactory versionAdaptorFactory,
@@ -69,14 +79,23 @@
   }
 
   @Override
+  public Item getItem(SessionContext context, Id itemId) {
+    Response<Item> response = itemAdaptorFactory.createInterface(context).get(context, itemId);
+    if (!response.isSuccessful()) {
+      throw new RuntimeException(
+          "Failed to get Item. message:" + response.getReturnCode().toString());
+    }
+    return response.getValue();
+  }
+
+  @Override
   public Id createItem(SessionContext context, Info info) {
     Response<Id> response = itemAdaptorFactory.createInterface(context).create(context, info);
-    if (response.isSuccessful()) {
-      return response.getValue();
-    } else {
+    if (!response.isSuccessful()) {
       throw new RuntimeException(
-          "failed to create Item. message:" + response.getReturnCode().toString());
+          "Failed to create Item. message:" + response.getReturnCode().toString());
     }
+    return response.getValue();
   }
 
   @Override
@@ -91,18 +110,30 @@
   }
 
   @Override
-  public Collection<ItemVersion> listVersions(SessionContext context, Id itemId) {
+  public Collection<ItemVersion> listPublicVersions(SessionContext context, Id itemId) {
     Response<Collection<ItemVersion>> versions =
-        versionAdaptorFactory.createInterface(context).list(context, Space.PRIVATE, itemId);
+        versionAdaptorFactory.createInterface(context).list(context, Space.PUBLIC, itemId);
     if (!versions.isSuccessful()) {
       logErrorMessageToMdc(ItemElementLoggerTargetServiceName.ITEM_VERSION_RETRIEVAL, versions
           .getReturnCode());
-      throw new RuntimeException(versions.getReturnCode().toString()); // TODO: 3/26/2017
+      throw new RuntimeException(versions.getReturnCode().toString());
     }
     return versions.getValue();
   }
 
   @Override
+  public ItemVersion getPublicVersion(SessionContext context, Id itemId, Id versionId) {
+    Response<ItemVersion> response = versionAdaptorFactory.createInterface(context)
+        .get(context, Space.PUBLIC, itemId, versionId);
+    if (!response.isSuccessful()) {
+      throw new RuntimeException(
+          String.format("failed to get public Item Version. ItemId: %s, versionId: %s, message: %s",
+              itemId.getValue(), versionId.getValue(), response.getReturnCode().toString()));
+    }
+    return response.getValue();
+  }
+
+  @Override
   public Id createVersion(SessionContext context, Id itemId, Id baseVersionId,
                           ItemVersionData itemVersionData) {
     Response<Id> response = versionAdaptorFactory.createInterface(context).create(context, itemId,
@@ -110,10 +141,9 @@
     if (response.isSuccessful()) {
       return response.getValue();
     } else {
-      throw new RuntimeException("failed to create Item Version. ItemId:" + itemId + " based " +
-          "on:" + baseVersionId +
-          " message:" + response
-          .getReturnCode().toString());
+      throw new RuntimeException(String.format(
+          "failed to create Item Version. ItemId: %s, base versionId: %s, message: %s",
+          itemId.getValue(), baseVersionId.getValue(), response.getReturnCode().toString()));
     }
   }
 
@@ -124,77 +154,233 @@
         .update(context, itemId, versionId, itemVersionData);
     if (!response.isSuccessful()) {
       throw new RuntimeException(
-          String.format("failed to create Item Version. ItemId: %s, versionId: %s, message: %s",
+          String.format("failed to update Item Version. ItemId: %s, versionId: %s, message: %s",
               itemId.getValue(), versionId.getValue(), response.getReturnCode().toString()));
     }
   }
 
   @Override
+  public ItemVersion getVersion(SessionContext context, Id itemId, Id versionId) {
+    Response<ItemVersion> response = versionAdaptorFactory.createInterface(context)
+        .get(context, Space.PRIVATE, itemId, versionId);
+    if (!response.isSuccessful()) {
+      throw new RuntimeException(
+          String.format("failed to get Item Version. ItemId: %s, versionId: %s, message: %s",
+              itemId.getValue(), versionId.getValue(), response.getReturnCode().toString()));
+    }
+    return response.getValue();
+  }
+
+  @Override
+  public ItemVersionStatus getVersionStatus(SessionContext context, Id itemId, Id versionId) {
+    Response<ItemVersionStatus> response =
+        versionAdaptorFactory.createInterface(context).getStatus(context, itemId, versionId);
+    if (!response.isSuccessful()) {
+      throw new RuntimeException(
+          String.format("failed to get Item Version status. ItemId: %s, versionId: %s, message: %s",
+              itemId.getValue(), versionId.getValue(), response.getReturnCode().toString()));
+    }
+    return response.getValue();
+  }
+
+  @Override
   public void tagVersion(SessionContext context, Id itemId, Id versionId, Tag tag) {
     Response<Void> response = versionAdaptorFactory.createInterface(context)
         .tag(context, itemId, versionId, null, tag);
     if (!response.isSuccessful()) {
       throw new RuntimeException(String.format(
           "failed to tag Item Version with tag %s. ItemId: %s, versionId: %s, message: %s",
-          tag.getName(), itemId.getValue(), versionId.getValue(), response.getReturnCode()
-              .getMessage()));
+          tag.getName(), itemId.getValue(), versionId.getValue(),
+          response.getReturnCode().toString()));
     }
   }
 
   @Override
-  public void resetVersionHistory(SessionContext context, Id itemId, Id versionId,
-                                  String changeRef) {
+  public void resetVersionRevision(SessionContext context, Id itemId, Id versionId,
+                                   Id revisionId) {
     Response<Void> response = versionAdaptorFactory.createInterface(context)
-        .resetHistory(context, itemId, versionId, changeRef);
+        .resetRevision(context, itemId, versionId, revisionId);
     if (!response.isSuccessful()) {
       throw new RuntimeException(String.format(
-          "failed to reset Item Version back to %s. ItemId: %s, versionId: %s, message: %s",
-          changeRef, itemId.getValue(), versionId.getValue(),
+          "failed to reset Item Version back to revision: %s. ItemId: %s, versionId: %s, message:" +
+              " %s",
+          revisionId.getValue(), itemId.getValue(), versionId.getValue(),
           response.getReturnCode().toString()));
     }
   }
 
   @Override
+  public void revertVersionRevision(SessionContext context, Id itemId, Id versionId,
+                                    Id revisionId) {
+    Response<Void> response = versionAdaptorFactory.createInterface(context)
+        .revertRevision(context, itemId, versionId, revisionId);
+    if (!response.isSuccessful()) {
+      throw new RuntimeException(String.format(
+          "failed to revert Item Version back to revision: %s. ItemId: %s, versionId: %s, " +
+              "message: %s",
+          revisionId.getValue(), itemId.getValue(), versionId.getValue(),
+          response.getReturnCode().toString()));
+    }
+  }
+
+  @Override
+  public ItemVersionRevisions listVersionRevisions(SessionContext context, Id itemId,
+                                                   Id versionId) {
+    Response<ItemVersionRevisions> response =
+        versionAdaptorFactory.createInterface(context)
+            .listRevisions(context, itemId, versionId);
+    if (!response.isSuccessful()) {
+      throw new RuntimeException(String.format(
+          "failed to list revisions of Item Version. ItemId: %s, versionId: %s, message: %s",
+          itemId.getValue(), versionId.getValue(), response.getReturnCode().toString()));
+    }
+    return response.getValue();
+  }
+
+
+  @Override
+  public void publishVersion(SessionContext context, Id itemId, Id versionId, String message) {
+    Response<Void> response =
+        versionAdaptorFactory.createInterface(context).publish(context, itemId, versionId, message);
+    if (!response.isSuccessful()) {
+      throw new RuntimeException(String.format(
+          "failed to publish item Version. ItemId: %s, versionId: %s, message: %s",
+          itemId.getValue(), versionId.getValue(), response.getReturnCode().toString()));
+    }
+  }
+
+  @Override
+  public void syncVersion(SessionContext context, Id itemId, Id versionId) {
+    Response<MergeResult> response =
+        versionAdaptorFactory.createInterface(context).sync(context, itemId, versionId);
+    if (!response.isSuccessful()) {
+      throw new RuntimeException(String.format(
+          "failed to sync item Version. ItemId: %s, versionId: %s, message: %s",
+          itemId.getValue(), versionId.getValue(), response.getReturnCode().toString()));
+    }
+  }
+
+  @Override
+  public void forceSyncVersion(SessionContext context, Id itemId, Id versionId) {
+    Response<MergeResult> response =
+        versionAdaptorFactory.createInterface(context).forceSync(context, itemId, versionId);
+    if (!response.isSuccessful()) {
+      throw new RuntimeException(String.format(
+          "failed to force sync item Version. ItemId: %s, versionId: %s, message: %s",
+          itemId.getValue(), versionId.getValue(), response.getReturnCode().toString()));
+    }
+  }
+
+  @Override
+  public ItemVersionConflict getVersionConflict(SessionContext context, Id itemId, Id versionId) {
+    Response<ItemVersionConflict> response =
+        versionAdaptorFactory.createInterface(context).getConflict(context, itemId, versionId);
+    if (!response.isSuccessful()) {
+      throw new RuntimeException(String
+          .format("failed to get Item Version conflict. ItemId: %s, versionId: %s, message: %s",
+              itemId.getValue(), versionId.getValue(), response.getReturnCode().toString()));
+    }
+    return response.getValue();
+  }
+
+  @Override
   public Collection<ElementInfo> listElements(SessionContext context,
                                               ElementContext elementContext,
                                               Id parentElementId) {
-    Response<Collection<ElementInfo>> elementInfosResponse = elementAdaptorFactory
+    Response<Collection<ElementInfo>> response = elementAdaptorFactory
         .createInterface(context).list(context, elementContext, parentElementId);
-    if (elementInfosResponse.isSuccessful()) {
-      return elementInfosResponse.getValue();
+    if (response.isSuccessful()) {
+      return response.getValue();
     } else {
       logErrorMessageToMdc(ItemElementLoggerTargetServiceName.ELEMENT_GET_BY_PROPERTY,
-          elementInfosResponse.getReturnCode());
-      throw new RuntimeException(elementInfosResponse.getReturnCode().toString());
+          response.getReturnCode());
+      throw new RuntimeException(response.getReturnCode().toString());
     }
   }
 
-  @Override
-  public Response<ElementInfo> getElementInfo(SessionContext context, ElementContext elementContext,
-                                              Id elementId) {
-    return elementAdaptorFactory.createInterface(context)
-        .getInfo(context, elementContext, elementId);
-  }
-
 
   @Override
-  public Response<Element> getElement(SessionContext context, ElementContext elementContext,
-                                      Id elementId) {
-    return elementAdaptorFactory.createInterface(context).get(context, elementContext, elementId);
+  public ElementInfo getElementInfo(SessionContext context, ElementContext elementContext,
+                                    Id elementId) {
+    Response<ElementInfo> response =
+        elementAdaptorFactory.createInterface(context).getInfo(context, elementContext, elementId);
+    if (!response.isSuccessful()) {
+      throw buildGetElementException(elementContext, elementId,
+          response.getReturnCode().toString());
+
+    }
+    return response.getValue();
   }
 
   @Override
-  public Optional<Element> saveElement(SessionContext context, ElementContext elementContext,
-                                       ZusammenElement element, String message) {
+  public Element getElement(SessionContext context, ElementContext elementContext,
+                            Id elementId) {
+    Response<Element> response =
+        elementAdaptorFactory.createInterface(context).get(context, elementContext, elementId);
+    if (!response.isSuccessful()) {
+      throw buildGetElementException(elementContext, elementId,
+          response.getReturnCode().toString());
+    }
+    return response.getValue();
+  }
+
+  @Override
+  public ElementConflict getElementConflict(SessionContext context, ElementContext elementContext,
+                                            Id elementId) {
+    Response<ElementConflict> response = elementAdaptorFactory.createInterface(context)
+        .getConflict(context, elementContext, elementId);
+    if (!response.isSuccessful()) {
+      throw new RuntimeException(String.format(
+          "Failed to get element conflict. Item Id: %s, version Id: %s, element Id: %s message: %s",
+          elementContext.getItemId().getValue(), elementContext.getVersionId().getValue(),
+          elementId.getValue(), response.getReturnCode().toString()));
+    }
+    return response.getValue();
+  }
+
+  @Override
+  public Element saveElement(SessionContext context, ElementContext elementContext,
+                             ZusammenElement element, String message) {
     Response<Element> response = elementAdaptorFactory.createInterface(context)
         .save(context, elementContext, element, message);
     if (!response.isSuccessful()) {
       throw new RuntimeException(String
-          .format("Failed to save element %s. ItemId: %s, versionId: %s, message: %s",
+          .format("Failed to create element %s. ItemId: %s, versionId: %s, message: %s",
               element.getElementId().getValue(), elementContext.getItemId().getValue(),
               elementContext.getVersionId().getValue(), response.getReturnCode().toString()));
     }
-    return Optional.of(response.getValue());
+    return response.getValue();
+  }
+
+  @Override
+  public void resolveElementConflict(SessionContext context, ElementContext elementContext,
+                                     ZusammenElement element,
+                                     Resolution resolution) {
+    Response<Void> response = elementAdaptorFactory.createInterface(context)
+        .resolveConflict(context, elementContext, element, resolution);
+    if (!response.isSuccessful()) {
+      throw new RuntimeException(
+          "Failed to resolve conflict. message:" + response.getReturnCode().toString());
+    }
+  }
+
+  @Override
+  public void resetVersionHistory(SessionContext context, Id itemId, Id versionId,
+                                  String revision_id) {
+
+  }
+
+  private RuntimeException buildGetElementException(ElementContext elementContext, Id elementId,
+                                                    String zusammenErrorMessage) {
+    if (elementContext.getRevisionId() == null) {
+      return new RuntimeException(String.format(GET_ELEMENT_ERR_MSG,
+          elementContext.getItemId().getValue(), elementContext.getVersionId().getValue(),
+          elementId.getValue(), zusammenErrorMessage));
+    }
+    return new RuntimeException(String.format(GET_ELEMENT_IN_REV_ERR_MSG,
+        elementContext.getItemId().getValue(), elementContext.getVersionId().getValue(),
+        elementContext.getRevisionId().getValue(),
+        elementId.getValue(), zusammenErrorMessage));
   }
 
   private void logErrorMessageToMdc(ItemElementLoggerTargetServiceName
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-core/src/main/java/org/openecomp/core/zusammen/impl/ZusammenAdaptorImpl.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-core/src/main/java/org/openecomp/core/zusammen/impl/ZusammenAdaptorImpl.java
index 41ce028..9bdbfd6 100644
--- a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-core/src/main/java/org/openecomp/core/zusammen/impl/ZusammenAdaptorImpl.java
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-core/src/main/java/org/openecomp/core/zusammen/impl/ZusammenAdaptorImpl.java
@@ -1,24 +1,30 @@
 package org.openecomp.core.zusammen.impl;
 
 import com.amdocs.zusammen.adaptor.inbound.api.types.item.Element;
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.ElementConflict;
 import com.amdocs.zusammen.adaptor.inbound.api.types.item.ElementInfo;
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.ItemVersionConflict;
 import com.amdocs.zusammen.adaptor.inbound.api.types.item.ZusammenElement;
 import com.amdocs.zusammen.commons.health.data.HealthInfo;
 import com.amdocs.zusammen.datatypes.Id;
 import com.amdocs.zusammen.datatypes.SessionContext;
-import com.amdocs.zusammen.datatypes.item.*;
+import com.amdocs.zusammen.datatypes.item.Action;
+import com.amdocs.zusammen.datatypes.item.ElementContext;
+import com.amdocs.zusammen.datatypes.item.Info;
+import com.amdocs.zusammen.datatypes.item.Item;
+import com.amdocs.zusammen.datatypes.item.ItemVersion;
+import com.amdocs.zusammen.datatypes.item.ItemVersionData;
+import com.amdocs.zusammen.datatypes.item.ItemVersionStatus;
+import com.amdocs.zusammen.datatypes.item.Resolution;
+import com.amdocs.zusammen.datatypes.itemversion.ItemVersionRevisions;
 import com.amdocs.zusammen.datatypes.itemversion.Tag;
-import com.amdocs.zusammen.datatypes.response.Response;
-import com.amdocs.zusammen.datatypes.response.ReturnCode;
 import org.openecomp.core.zusammen.api.ZusammenAdaptor;
 import org.openecomp.core.zusammen.db.ZusammenConnector;
-import org.openecomp.sdc.datatypes.error.ErrorLevel;
-import org.openecomp.sdc.logging.context.impl.MdcDataErrorMessage;
-import org.openecomp.sdc.logging.types.LoggerConstants;
-import org.openecomp.sdc.logging.types.LoggerErrorCode;
+import org.openecomp.sdc.versioning.dao.types.Revision;
 
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Comparator;
 import java.util.List;
 import java.util.Optional;
 import java.util.function.Predicate;
@@ -33,30 +39,15 @@
   }
 
   @Override
-  public Optional<ItemVersion> getFirstVersion(SessionContext context, Id itemId) {
-    Collection<ItemVersion> versions = connector.listVersions(context, itemId);
-    if(versions == null || versions.size()==0) {
-      return Optional.empty();
-    }
-    List<ItemVersion> itemVersions = new ArrayList<>(versions);
-    sortItemVersionListByModificationTimeDescOrder(itemVersions);
-    ItemVersion itemVersion = itemVersions.iterator().next();
-
-    return Optional.ofNullable(itemVersion);
-  }
-
-  @Override
   public Optional<ElementInfo> getElementInfo(SessionContext context, ElementContext elementContext,
                                               Id elementId) {
-    Response<ElementInfo> response = connector.getElementInfo(context, elementContext, elementId);
-    return response.isSuccessful() ? Optional.ofNullable(response.getValue()) : Optional.empty();
+    return Optional.ofNullable(connector.getElementInfo(context, elementContext, elementId));
   }
 
   @Override
   public Optional<Element> getElement(SessionContext context, ElementContext elementContext,
                                       String elementId) {
-    Response<Element> response = connector.getElement(context, elementContext, new Id(elementId));
-    return response.isSuccessful() ? Optional.ofNullable(response.getValue()) : Optional.empty();
+    return Optional.ofNullable(connector.getElement(context, elementContext, new Id(elementId)));
   }
 
   @Override
@@ -82,16 +73,14 @@
   public Collection<Element> listElementData(SessionContext context,
                                              ElementContext elementContext,
                                              Id parentElementId) {
-
     Collection<ElementInfo> elementInfoList = connector.listElements(context, elementContext,
         parentElementId);
-    if (elementInfoList != null) {
-      return elementInfoList.stream().map(elementInfo -> connector.getElement(context,
-          elementContext, elementInfo.getId()).getValue()).collect(Collectors.toList());
-    }
 
-    return new ArrayList<>();
-
+    return elementInfoList == null
+        ? new ArrayList<>()
+        : elementInfoList.stream()
+            .map(elementInfo -> connector.getElement(context, elementContext, elementInfo.getId()))
+            .collect(Collectors.toList());
   }
 
 
@@ -119,12 +108,24 @@
   }
 
   @Override
-  public Optional<Element> saveElement(SessionContext context, ElementContext elementContext,
-                                       ZusammenElement element, String message) {
+  public Optional<ElementConflict> getElementConflict(SessionContext context, ElementContext elementContext,
+                                                      Id elementId) {
+    return Optional.ofNullable(connector.getElementConflict(context, elementContext, elementId));
+  }
+
+  @Override
+  public Element saveElement(SessionContext context, ElementContext elementContext,
+                             ZusammenElement element, String message) {
     enrichElementHierarchyRec(context, elementContext, null, element);
     return connector.saveElement(context, elementContext, element, message);
   }
 
+  @Override
+  public void resolveElementConflict(SessionContext context, ElementContext elementContext,
+                                     ZusammenElement element, Resolution resolution) {
+    connector.resolveElementConflict(context, elementContext, element, resolution);
+  }
+
   private void enrichElementHierarchyRec(SessionContext context, ElementContext
       elementContext, Id parentElementId, ZusammenElement element) {
     if (element.getAction() == Action.CREATE) {
@@ -160,20 +161,14 @@
         .findFirst();
   }
 
-  private void logErrorMessageToMdc(ItemElementLoggerTargetServiceName
-                                        itemElementLoggerTargetServiceName,
-                                    ReturnCode returnCode) {
-    logErrorMessageToMdc(itemElementLoggerTargetServiceName, returnCode.toString());
+  @Override
+  public Collection<Item> listItems(SessionContext context) {
+    return connector.listItems(context);
   }
 
-  private void logErrorMessageToMdc(ItemElementLoggerTargetServiceName
-                                        itemElementLoggerTargetServiceName,
-                                    String message) {
-    MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
-        itemElementLoggerTargetServiceName.getDescription(),
-        ErrorLevel.ERROR.name(),
-        LoggerErrorCode.BUSINESS_PROCESS_ERROR.getErrorCode(),
-        message);
+  @Override
+  public Item getItem(SessionContext context, Id itemId) {
+    return connector.getItem(context, itemId);
   }
 
   @Override
@@ -182,15 +177,52 @@
   }
 
   @Override
-  public Id createVersion(SessionContext context, Id itemId, Id baseVersionId, ItemVersionData
-      itemVersionData) {
-    return connector.createVersion(context, itemId, baseVersionId, itemVersionData);
-
+  public void updateItem(SessionContext context, Id itemId, Info info) {
+    connector.updateItem(context, itemId, info);
   }
 
   @Override
-  public Collection<Item> listItems(SessionContext context) {
-    return connector.listItems(context);
+  public Optional<ItemVersion> getFirstVersion(SessionContext context, Id itemId) {
+    Collection<ItemVersion> versions = connector.listPublicVersions(context, itemId);
+    if (versions == null || versions.size() == 0) {
+      return Optional.empty();
+    }
+    List<ItemVersion> itemVersions = new ArrayList<>(versions);
+    sortItemVersionListByModificationTimeDescOrder(itemVersions);
+    ItemVersion itemVersion = itemVersions.iterator().next();
+
+    return Optional.ofNullable(itemVersion);
+  }
+
+  @Override
+  public Collection<ItemVersion> listPublicVersions(SessionContext context, Id itemId) {
+    return connector.listPublicVersions(context, itemId);
+  }
+
+  @Override
+  public ItemVersion getPublicVersion(SessionContext context, Id itemId, Id versionId) {
+    return connector.getPublicVersion(context, itemId, versionId);
+  }
+
+  @Override
+  public ItemVersion getVersion(SessionContext context, Id itemId, Id versionId) {
+    return connector.getVersion(context, itemId, versionId);
+  }
+
+  @Override
+  public ItemVersionStatus getVersionStatus(SessionContext context, Id itemId, Id versionId) {
+    return connector.getVersionStatus(context, itemId, versionId);
+  }
+
+  @Override
+  public ItemVersionConflict getVersionConflict(SessionContext context, Id itemId, Id versionId) {
+    return connector.getVersionConflict(context, itemId, versionId);
+  }
+
+  @Override
+  public Id createVersion(SessionContext context, Id itemId, Id baseVersionId, ItemVersionData
+      itemVersionData) {
+    return connector.createVersion(context, itemId, baseVersionId, itemVersionData);
   }
 
   @Override
@@ -210,25 +242,96 @@
     connector.resetVersionHistory(context, itemId, versionId, changeRef);
   }
 
+  /*@Override
+  public void revertVersionToRevision(SessionContext context, Id itemId, Id versionId,
+                                      Id revisionId) {
+    connector.resetVersionRevision(context, itemId, versionId, revisionId);
+  }*/
+
+  /*@Override
+  public ItemVersionRevisions listVersionRevisions(SessionContext context, Id itemId, Id
+      versionId) {
+    return connector.listVersionRevisions(context, itemId, versionId);
+  }*/
+
   @Override
-  public void updateItem(SessionContext context, Id itemId, Info info) {
-    connector.updateItem(context, itemId, info);
+  public void publishVersion(SessionContext context, Id itemId, Id versionId, String message) {
+    connector.publishVersion(context, itemId, versionId, message);
   }
 
+  @Override
+  public void syncVersion(SessionContext context, Id itemId, Id versionId) {
+    connector.syncVersion(context, itemId, versionId);
+  }
+
+  @Override
+  public void forceSyncVersion(SessionContext context, Id itemId, Id versionId) {
+    connector.forceSyncVersion(context, itemId, versionId);
+  }
 
   @Override
   public Collection<HealthInfo> checkHealth(SessionContext context) {
     return connector.checkHealth(context);
   }
 
-  private static void sortItemVersionListByModificationTimeDescOrder(
-      List<ItemVersion> itemVersions) {
-    itemVersions.sort((o1, o2) -> ((Integer)o2.getId().getValue().length())
-        .compareTo( (o1.getId().getValue().length())));
-  }
-
   @Override
   public String getVersion(SessionContext sessionContext) {
     return connector.getVersion(sessionContext);
   }
+
+  @Override
+  public void revert(SessionContext sessionContext, String itemId, String versionId,
+                     String revisionId) {
+    connector.revertVersionRevision(sessionContext, new Id(itemId), new Id(versionId),
+        new Id(revisionId));
+  }
+
+  @Override
+  public List<Revision> listRevisions(SessionContext sessionContext, String itemId,
+                                      String versionId) {
+    List<Revision> revisions = new ArrayList<>();
+    ItemVersionRevisions itemVersionRevisions =
+        connector.listVersionRevisions(sessionContext, new Id(itemId), new Id
+            (versionId));
+    if(itemVersionRevisions == null || itemVersionRevisions.getItemVersionRevisions()==null ||
+        itemVersionRevisions.getItemVersionRevisions().size()==0) {
+      return revisions;
+    }
+    else{
+      revisions =  itemVersionRevisions.getItemVersionRevisions().stream().map
+          (revision -> {
+        Revision rev = new Revision();
+        rev.setId(revision.getRevisionId().getValue());
+        rev.setTime(revision.getTime());
+        rev.setUser(revision.getUser());
+        rev.setMessage(revision.getMessage());
+        return rev;
+      }).collect(Collectors.toList());
+      revisions.sort(new Comparator<Revision>() {
+        @Override
+        public int compare(Revision o1, Revision o2) {
+          if(o1.getTime().before(o2.getTime())) return 1;
+          else return -1;
+        }
+      });
+      // when creating a new item an initial version is created with
+      // invalid data. this revision is not an applicable revision.
+      //the logic of identifying this revision is:
+      //1- only the first version of item has this issue
+      //2- only in the first item version there are 2 revisions created
+      //3- the second revision is in format "Initial {vlm/vsp}: {name of the vlm/vsp}
+      //4- only if a revision in this format exists we remove the first revision.
+      if(revisions.size()>1 && revisions.get(revisions.size()-2).getMessage().matches("Initial " +
+          ".*:.*")){
+        revisions.remove(revisions.size()-1);
+      }
+      return revisions;
+    }
+  }
+
+  private static void sortItemVersionListByModificationTimeDescOrder(
+      List<ItemVersion> itemVersions) {
+    itemVersions.sort((o1, o2) -> ((Integer) o2.getId().getValue().length())
+        .compareTo((o1.getId().getValue().length())));
+  }
 }
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/pom.xml b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/pom.xml
index fba7d56..f8cfcfd 100644
--- a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/pom.xml
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/pom.xml
@@ -33,5 +33,32 @@
             <artifactId>zusammen-state-store-cassandra-plugin</artifactId>
               <version>${zusammen-state-store.version}</version>
         </dependency>
+        <dependency>
+            <groupId>org.testng</groupId>
+            <artifactId>testng</artifactId>
+            <version>${testng.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.mockito</groupId>
+            <artifactId>mockito-all</artifactId>
+            <version>${mockito.all.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.amdocs.zusammen</groupId>
+            <artifactId>zusammen-commons-utils</artifactId>
+            <version>${zusammen.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.openecomp.sdc.core</groupId>
+            <artifactId>openecomp-facade-api</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.openecomp.sdc.core</groupId>
+            <artifactId>openecomp-session-lib</artifactId>
+            <version>${project.version}</version>
+        </dependency>
     </dependencies>
 </project>
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/ZusammenPluginUtil.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/ZusammenPluginUtil.java
index 59afa70..a973590 100644
--- a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/ZusammenPluginUtil.java
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/ZusammenPluginUtil.java
@@ -19,13 +19,30 @@
 import com.amdocs.zusammen.datatypes.Id;
 import com.amdocs.zusammen.datatypes.SessionContext;
 import com.amdocs.zusammen.datatypes.Space;
-import com.amdocs.zusammen.plugin.statestore.cassandra.dao.types.ElementEntityContext;
+import com.amdocs.zusammen.datatypes.item.Action;
+import com.amdocs.zusammen.datatypes.item.ElementContext;
+import com.amdocs.zusammen.datatypes.item.ItemVersion;
+import com.amdocs.zusammen.datatypes.item.ItemVersionChange;
+import com.amdocs.zusammen.datatypes.item.ItemVersionData;
+import com.amdocs.zusammen.datatypes.item.ItemVersionDataConflict;
 import com.amdocs.zusammen.sdk.collaboration.types.CollaborationElement;
+import com.amdocs.zusammen.sdk.collaboration.types.CollaborationElementChange;
+import com.amdocs.zusammen.sdk.collaboration.types.CollaborationElementConflict;
+import com.amdocs.zusammen.sdk.state.types.StateElement;
+import com.amdocs.zusammen.sdk.types.ElementDescriptor;
 import com.amdocs.zusammen.utils.fileutils.FileUtils;
+import com.amdocs.zusammen.utils.fileutils.json.JsonUtil;
 import org.openecomp.core.zusammen.plugin.dao.types.ElementEntity;
+import org.openecomp.core.zusammen.plugin.dao.types.VersionEntity;
 
 import java.io.ByteArrayInputStream;
 import java.nio.ByteBuffer;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.util.Base64;
+import java.util.Date;
+
+import static org.openecomp.core.zusammen.plugin.ZusammenPluginConstants.ROOT_ELEMENTS_PARENT_ID;
 
 public class ZusammenPluginUtil {
 
@@ -34,7 +51,7 @@
       case PUBLIC:
         return ZusammenPluginConstants.PUBLIC_SPACE;
       case PRIVATE:
-        return ZusammenPluginUtil.getPrivateSpaceName(context);
+        return getPrivateSpaceName(context);
       default:
         throw new IllegalArgumentException(String.format("Space %s is not supported.", space));
     }
@@ -44,14 +61,54 @@
     return context.getUser().getUserName();
   }
 
-  public static ElementEntity getElementEntity(CollaborationElement element) {
+  public static ElementContext getPrivateElementContext(ElementContext elementContext) {
+    return new ElementContext(elementContext.getItemId(),elementContext.getVersionId(),Id.ZERO);
+  }
+
+
+  public static VersionEntity convertToVersionEntity(Id versionId, Id baseVersionId,
+                                                     Date creationTime,
+                                                     Date modificationTime) {
+
+    return convertToVersionEntity(versionId, null, baseVersionId,
+        creationTime, modificationTime);
+  }
+
+  public static VersionEntity convertToVersionEntity(Id versionId, Id revisionId, Id baseVersionId,
+                                                     Date creationTime,
+                                                     Date modificationTime) {
+    VersionEntity version = new VersionEntity(versionId);
+    version.setBaseId(baseVersionId);
+    version.setCreationTime(creationTime);
+    version.setModificationTime(modificationTime);
+    return version;
+  }
+
+  public static ItemVersion convertToItemVersion(VersionEntity versionEntity,
+                                                 ItemVersionData itemVersionData) {
+    ItemVersion itemVersion = new ItemVersion();
+    itemVersion.setId(versionEntity.getId());
+
+    itemVersion.setBaseId(versionEntity.getBaseId());
+    itemVersion.setCreationTime(versionEntity.getCreationTime());
+    itemVersion.setModificationTime(versionEntity.getModificationTime());
+    itemVersion.setData(itemVersionData);
+    return itemVersion;
+  }
+
+  public static ElementEntity convertToElementEntity(CollaborationElement element) {
+
     ElementEntity elementEntity = new ElementEntity(element.getId());
     elementEntity.setNamespace(element.getNamespace());
     elementEntity.setParentId(element.getParentId() == null
-        ? ZusammenPluginConstants.ROOT_ELEMENTS_PARENT_ID
+        ? ROOT_ELEMENTS_PARENT_ID
         : element.getParentId());
+
+
     elementEntity.setInfo(element.getInfo());
+
     elementEntity.setRelations(element.getRelations());
+
     if (element.getData() != null) {
       elementEntity.setData(ByteBuffer.wrap(FileUtils.toByteArray(element.getData())));
     }
@@ -63,21 +120,29 @@
       elementEntity.setVisualization(
           ByteBuffer.wrap(FileUtils.toByteArray(element.getVisualization())));
     }
+    elementEntity.setElementHash(new Id(calculateElementHash(elementEntity)));
+
     return elementEntity;
   }
 
-  public static CollaborationElement getCollaborationElement(
-      ElementEntityContext elementEntityContext, ElementEntity elementEntity) {
-    Id parentId =
-        ZusammenPluginConstants.ROOT_ELEMENTS_PARENT_ID.equals(elementEntity.getParentId())
-            ? null
-            : elementEntity.getParentId();
-    CollaborationElement element = new CollaborationElement(elementEntityContext.getItemId(),
-        elementEntityContext.getVersionId(), elementEntity.getNamespace(), elementEntity.getId());
+  public static ElementDescriptor convertToElementDescriptor(
+      ElementContext elementContext, ElementEntity elementEntity) {
+    if (elementEntity == null) {
+      return null;
+    }
+    ElementDescriptor element = new ElementDescriptor(elementContext.getItemId(),
+        elementContext.getVersionId(), elementEntity.getNamespace(), elementEntity.getId());
 
-    element.setParentId(parentId);
-    element.setInfo(elementEntity.getInfo());
-    element.setRelations(elementEntity.getRelations());
+    mapElementEntityToDescriptor(elementEntity, element);
+    return element;
+  }
+
+  public static CollaborationElement convertToCollaborationElement(
+      ElementContext elementContext, ElementEntity elementEntity) {
+    CollaborationElement element = new CollaborationElement(elementContext.getItemId(),
+        elementContext.getVersionId(), elementEntity.getNamespace(), elementEntity.getId());
+
+    mapElementEntityToDescriptor(elementEntity, element);
 
     if (elementEntity.getData() != null) {
       element.setData(new ByteArrayInputStream(elementEntity.getData().array()));
@@ -89,7 +154,134 @@
     if (elementEntity.getVisualization() != null) {
       element.setVisualization(new ByteArrayInputStream(elementEntity.getVisualization().array()));
     }
+    return element;
+  }
+
+  public static CollaborationElementChange convertToElementChange(
+      ElementContext changedElementContext, ElementEntity changedElement, Action action) {
+    CollaborationElementChange elementChange = new CollaborationElementChange();
+    elementChange.setElement(convertToCollaborationElement(changedElementContext, changedElement));
+    elementChange.setAction(action);
+    return elementChange;
+  }
+
+  public static ItemVersionChange convertToVersionChange(ElementContext elementContext,
+                                                         ElementEntity versionDataElement,
+                                                         Action action) {
+    ItemVersionChange versionChange = new ItemVersionChange();
+
+    ItemVersion itemVersion = new ItemVersion();
+    itemVersion.setId(elementContext.getVersionId());
+
+    itemVersion.setData(convertToVersionData(versionDataElement));
+
+    versionChange.setItemVersion(itemVersion);
+    versionChange.setAction(action);
+    return versionChange;
+  }
+
+  public static ItemVersionDataConflict getVersionConflict(ElementEntity localVesionData,
+                                                           ElementEntity remoteVersionData) {
+    ItemVersionDataConflict versionConflict = new ItemVersionDataConflict();
+    versionConflict.setLocalData(convertToVersionData(localVesionData));
+    versionConflict.setRemoteData(convertToVersionData(remoteVersionData));
+    return versionConflict;
+  }
+
+  public static CollaborationElementConflict getElementConflict(ElementContext elementContext,
+                                                                ElementEntity localElement,
+                                                                ElementEntity remoteElement) {
+    CollaborationElementConflict elementConflict = new CollaborationElementConflict();
+    elementConflict
+        .setLocalElement(convertToCollaborationElement(elementContext, localElement));
+    elementConflict.setRemoteElement(
+        convertToCollaborationElement(elementContext, remoteElement));
+    return elementConflict;
+  }
+
+  public static ItemVersionData convertToVersionData(ElementEntity versionDataElement) {
+    ItemVersionData versionData = new ItemVersionData();
+    versionData.setInfo(versionDataElement.getInfo());
+    versionData.setRelations(versionDataElement.getRelations());
+    return versionData;
+  }
+
+  private static void mapElementEntityToDescriptor(ElementEntity elementEntity,
+                                                   ElementDescriptor elementDescriptor) {
+    Id parentId = ROOT_ELEMENTS_PARENT_ID.equals(elementEntity.getParentId())
+        ? null
+        : elementEntity.getParentId();
+
+    elementDescriptor.setParentId(parentId);
+    elementDescriptor.setInfo(elementEntity.getInfo());
+    elementDescriptor.setRelations(elementEntity.getRelations());
+    elementDescriptor.setSubElements(elementEntity.getSubElementIds());
+  }
+
+  public static String calculateElementHash(ElementEntity elementEntity) {
+    StringBuffer elementHash = new StringBuffer();
+    if (elementEntity.getData() != null) {
+      elementHash.append(calculateSHA1(elementEntity.getData().array()));
+    } else {
+      elementHash.append("0");
+    }
+    elementHash.append("_");
+    if (elementEntity.getVisualization() != null) {
+      elementHash.append(calculateSHA1(elementEntity.getVisualization().array()));
+    } else {
+      elementHash.append("0");
+    }
+    elementHash.append("_");
+
+    if (elementEntity.getSearchableData() != null) {
+      elementHash.append(calculateSHA1(elementEntity.getSearchableData().array()));
+    } else {
+      elementHash.append("0");
+    }
+    elementHash.append("_");
+
+    if (elementEntity.getInfo() != null) {
+      elementHash.append(calculateSHA1(JsonUtil.object2Json(elementEntity.getInfo()).getBytes()));
+    } else {
+      elementHash.append("0");
+    }
+    elementHash.append("_");
+
+    if (elementEntity.getRelations() != null) {
+      elementHash
+          .append(calculateSHA1(JsonUtil.object2Json(elementEntity.getRelations()).getBytes()));
+    } else {
+      elementHash.append("0");
+    }
+
+    return elementHash.toString();
+  }
+
+  private static String calculateSHA1(byte[] content2Convert) {
+    MessageDigest md = null;
+    try {
+      md = MessageDigest.getInstance("SHA-1");
+    } catch (NoSuchAlgorithmException e) {
+      throw new RuntimeException(e);
+    }
+    return Base64.getEncoder().encodeToString(md.digest(content2Convert));
+  }
+
+
+  public static StateElement getStateElement(ElementContext elementContext, ElementEntity
+      elementEntity) {
+    Id parentId = ROOT_ELEMENTS_PARENT_ID.equals(elementEntity.getParentId())
+        ? null
+        : elementEntity.getParentId();
+    StateElement element = new StateElement(elementContext.getItemId(),
+        elementContext.getVersionId(), elementEntity.getNamespace(), elementEntity.getId());
+
+    element.setParentId(parentId);
+    element.setInfo(elementEntity.getInfo());
+    element.setRelations(elementEntity.getRelations());
     element.setSubElements(elementEntity.getSubElementIds());
     return element;
   }
+
+
 }
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/CommitStagingService.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/CommitStagingService.java
new file mode 100644
index 0000000..45d5769
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/CommitStagingService.java
@@ -0,0 +1,100 @@
+package org.openecomp.core.zusammen.plugin.collaboration;
+
+import com.amdocs.zusammen.datatypes.Id;
+import com.amdocs.zusammen.datatypes.SessionContext;
+import com.amdocs.zusammen.datatypes.item.ElementContext;
+import org.openecomp.core.zusammen.plugin.dao.types.ElementEntity;
+import org.openecomp.core.zusammen.plugin.dao.types.StageEntity;
+import org.openecomp.core.zusammen.plugin.dao.types.VersionEntity;
+
+import java.util.Collection;
+import java.util.Optional;
+
+public class CommitStagingService {
+
+  private VersionPrivateStore versionPrivateStore;
+  private VersionStageStore versionStageStore;
+  private ElementPrivateStore elementPrivateStore;
+  private ElementStageStore elementStageStore;
+
+  public CommitStagingService(VersionPrivateStore versionPrivateStore,
+                              VersionStageStore versionStageStore,
+                              ElementPrivateStore elementPrivateStore,
+                              ElementStageStore elementStageStore) {
+    this.versionPrivateStore = versionPrivateStore;
+    this.versionStageStore = versionStageStore;
+    this.elementPrivateStore = elementPrivateStore;
+    this.elementStageStore = elementStageStore;
+  }
+
+  public void commitStaging(SessionContext context, Id itemId, Id versionId) {
+    Optional<StageEntity<VersionEntity>> versionStage =
+        versionStageStore.get(context, itemId, new VersionEntity(versionId));
+
+    final ElementContext elementContext = new ElementContext(itemId, versionId, Id.ZERO);
+    Collection<ElementEntity> stagedElementIds = elementStageStore.listIds(context, elementContext);
+
+    if ((!versionStage.isPresent() && stagedElementIds.isEmpty()) ||
+        elementStageStore.hasConflicts(context, elementContext)) {
+      return;
+    }
+
+    versionStage.ifPresent(verStage -> commitVersionStage(context, itemId, verStage));
+    commitElementsStage(context, elementContext, stagedElementIds);
+  }
+
+  private void commitVersionStage(SessionContext context, Id itemId,
+                                  StageEntity<VersionEntity> versionStage) {
+    switch (versionStage.getAction()) {
+      case CREATE:
+        versionPrivateStore.commitStagedCreate(context, itemId, versionStage.getEntity(),
+            versionStage.getPublishTime());
+        break;
+      case UPDATE:
+        versionPrivateStore.commitStagedUpdate(context, itemId, versionStage.getEntity(),
+            versionStage.getPublishTime());
+        break;
+      case IGNORE:
+        versionPrivateStore.commitStagedIgnore(context, itemId, versionStage.getEntity(),
+            versionStage.getPublishTime());
+        break;
+      default:
+        throw new UnsupportedOperationException(
+            "Version change other then Create/Update/Ignore is not supported");
+    }
+
+    versionStageStore.delete(context, itemId, versionStage.getEntity());
+  }
+
+  private void commitElementsStage(SessionContext context, ElementContext elementContext,
+                                   Collection<ElementEntity> stagedElementIds) {
+    for (ElementEntity stagedElementId : stagedElementIds) {
+      StageEntity<ElementEntity> stagedElement =
+          elementStageStore.get(context, elementContext, stagedElementId)
+              .orElseThrow(
+                  () -> new IllegalStateException("Element id returned by list must exist"));
+      switch (stagedElement.getAction()) {
+        case CREATE:
+          elementPrivateStore.commitStagedCreate(context, elementContext, stagedElement.getEntity(),
+              stagedElement.getPublishTime());
+          break;
+        case UPDATE:
+          elementPrivateStore.commitStagedUpdate(context, elementContext, stagedElement.getEntity(),
+              stagedElement.getPublishTime());
+          break;
+        case DELETE:
+          elementPrivateStore
+              .commitStagedDelete(context, elementContext, stagedElement.getEntity());
+          break;
+        case IGNORE:
+          elementPrivateStore.commitStagedIgnore(context, elementContext, stagedElement.getEntity(),
+              stagedElement.getPublishTime());
+          break;
+        default:
+          throw new UnsupportedOperationException(
+              "Element change other then Create/Update/Delete/Ignore is not supported");
+      }
+      elementStageStore.delete(context, elementContext, stagedElement.getEntity());
+    }
+  }
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/ElementCollaborationStore.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/ElementCollaborationStore.java
deleted file mode 100644
index ac103c0..0000000
--- a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/ElementCollaborationStore.java
+++ /dev/null
@@ -1,119 +0,0 @@
-package org.openecomp.core.zusammen.plugin.collaboration;
-
-import com.amdocs.zusammen.datatypes.Id;
-import com.amdocs.zusammen.datatypes.SessionContext;
-import com.amdocs.zusammen.datatypes.item.ElementContext;
-import com.amdocs.zusammen.plugin.statestore.cassandra.dao.types.ElementEntityContext;
-import com.amdocs.zusammen.sdk.collaboration.types.CollaborationElement;
-import org.openecomp.core.zusammen.plugin.ZusammenPluginConstants;
-import org.openecomp.core.zusammen.plugin.ZusammenPluginUtil;
-import org.openecomp.core.zusammen.plugin.dao.ElementRepository;
-import org.openecomp.core.zusammen.plugin.dao.ElementRepositoryFactory;
-import org.openecomp.core.zusammen.plugin.dao.types.ElementEntity;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Optional;
-
-import static org.openecomp.core.zusammen.plugin.ZusammenPluginUtil.getCollaborationElement;
-import static org.openecomp.core.zusammen.plugin.ZusammenPluginUtil.getSpaceName;
-
-
-public class ElementCollaborationStore {
-
-  private static final String SUB_ELEMENT_NOT_EXIST_ERROR_MSG =
-      "List sub elements error: item %s, version %s - " +
-          "element %s, which appears as sub element of element %s, does not exist";
-
-  public Collection<CollaborationElement> listElements(SessionContext context,
-                                                       ElementContext elementContext,
-                                                       Id elementId) {
-    ElementEntityContext elementEntityContext =
-        new ElementEntityContext(ZusammenPluginUtil.getPrivateSpaceName(context), elementContext);
-
-    if (elementId == null) {
-      elementId = ZusammenPluginConstants.ROOT_ELEMENTS_PARENT_ID;
-    }
-
-    ElementRepository elementRepository = getElementRepository(context);
-    String elementIdValue = elementId.getValue();
-    String versionIdValue = elementContext.getChangeRef() == null
-        ? elementContext.getVersionId().getValue()
-        : elementContext.getChangeRef();
-    Collection<CollaborationElement> subElements = new ArrayList<>();
-
-    Optional<ElementEntity> element =
-        elementRepository.get(context, elementEntityContext, new ElementEntity(elementId));
-    if (element.isPresent() && element.get().getSubElementIds() != null) {
-      for (Id subElementId : element.get().getSubElementIds()) {
-        ElementEntity subElement =
-            elementRepository.get(context, elementEntityContext, new ElementEntity(subElementId))
-                .orElseThrow(
-                    () -> new IllegalStateException(String.format(SUB_ELEMENT_NOT_EXIST_ERROR_MSG,
-                        elementContext.getItemId().getValue(), versionIdValue,
-                        subElementId.getValue(), elementIdValue)));
-        subElements.add(getCollaborationElement(elementEntityContext, subElement));
-      }
-    }
-    return subElements;
-  }
-
-  public CollaborationElement getElement(SessionContext context, ElementContext elementContext,
-                                         Id elementId) {
-    ElementEntityContext elementEntityContext =
-        new ElementEntityContext(ZusammenPluginUtil.getPrivateSpaceName(context), elementContext);
-    return getElementRepository(context)
-        .get(context, elementEntityContext, new ElementEntity(elementId))
-        .map(elementEntity -> getCollaborationElement(elementEntityContext, elementEntity))
-        .orElse(null);
-  }
-
-  public void createElement(SessionContext context, CollaborationElement element) {
-    getElementRepository(context)
-        .create(context,
-            new ElementEntityContext(getSpaceName(context, element.getSpace()),
-                element.getItemId(), element.getVersionId()),
-            ZusammenPluginUtil.getElementEntity(element));
-  }
-
-  public void updateElement(SessionContext context, CollaborationElement element) {
-    getElementRepository(context)
-        .update(context,
-            new ElementEntityContext(getSpaceName(context, element.getSpace()),
-                element.getItemId(), element.getVersionId()),
-            ZusammenPluginUtil.getElementEntity(element));
-  }
-
-  public void deleteElement(SessionContext context, CollaborationElement element) {
-    deleteElementHierarchy(getElementRepository(context),
-        context,
-        new ElementEntityContext(getSpaceName(context, element.getSpace()),
-            element.getItemId(), element.getVersionId()),
-        ZusammenPluginUtil.getElementEntity(element));
-  }
-
-  public boolean checkHealth(SessionContext sessionContext) {
-    return getElementRepository(sessionContext).checkHealth(sessionContext);
-  }
-
-  private void deleteElementHierarchy(ElementRepository elementRepository, SessionContext context,
-                                      ElementEntityContext elementEntityContext,
-                                      ElementEntity elementEntity) {
-    Optional<ElementEntity> retrieved =
-        elementRepository.get(context, elementEntityContext, elementEntity);
-    if (!retrieved.isPresent()) {
-      return;
-    }
-    retrieved.get().getSubElementIds().stream()
-        .map(ElementEntity::new)
-        .forEach(subElementEntity -> deleteElementHierarchy(
-            elementRepository, context, elementEntityContext, subElementEntity));
-
-    // only for the first one the parentId will populated (so it'll be removed from its parent)
-    elementRepository.delete(context, elementEntityContext, elementEntity);
-  }
-
-  protected ElementRepository getElementRepository(SessionContext context) {
-    return ElementRepositoryFactory.getInstance().createInterface(context);
-  }
-}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/ElementPrivateStore.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/ElementPrivateStore.java
new file mode 100644
index 0000000..045def2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/ElementPrivateStore.java
@@ -0,0 +1,48 @@
+package org.openecomp.core.zusammen.plugin.collaboration;
+
+import com.amdocs.zusammen.datatypes.Id;
+import com.amdocs.zusammen.datatypes.SessionContext;
+import com.amdocs.zusammen.datatypes.item.ElementContext;
+import org.openecomp.core.zusammen.plugin.dao.types.ElementEntity;
+import org.openecomp.core.zusammen.plugin.dao.types.SynchronizationStateEntity;
+
+import java.util.Collection;
+import java.util.Date;
+import java.util.Map;
+import java.util.Optional;
+
+public interface ElementPrivateStore extends ElementStore {
+
+  Map<Id, Id> listIds(SessionContext context, ElementContext elementContext);
+
+  Collection<ElementEntity> listSubs(SessionContext context, ElementContext elementContext,
+                                     Id elementId);
+
+  Optional<SynchronizationStateEntity> getSynchronizationState(SessionContext context,
+                                                               ElementContext elementContext,
+                                                               Id elementId);
+
+  void create(SessionContext context, ElementContext elementContext, ElementEntity element);
+
+  boolean update(SessionContext context, ElementContext elementContext, ElementEntity element);
+
+  void delete(SessionContext context, ElementContext elementContext, ElementEntity element);
+
+  void markAsPublished(SessionContext context, ElementContext elementContext, Id elementId,
+                       Date publishTime);
+
+  void markDeletionAsPublished(SessionContext context, ElementContext elementContext, Id elementId,
+                               Date publishTime);
+
+  void commitStagedCreate(SessionContext context, ElementContext elementContext,
+                          ElementEntity element, Date publishTime);
+
+  void commitStagedUpdate(SessionContext context, ElementContext elementContext,
+                          ElementEntity element, Date publishTime);
+
+  void commitStagedDelete(SessionContext context, ElementContext elementContext,
+                          ElementEntity element);
+
+  void commitStagedIgnore(SessionContext context, ElementContext elementContext,
+                          ElementEntity element, Date publishTime);
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/ElementPublicStore.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/ElementPublicStore.java
new file mode 100644
index 0000000..0f1790a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/ElementPublicStore.java
@@ -0,0 +1,23 @@
+package org.openecomp.core.zusammen.plugin.collaboration;
+
+import com.amdocs.zusammen.datatypes.Id;
+import com.amdocs.zusammen.datatypes.SessionContext;
+import com.amdocs.zusammen.datatypes.item.ElementContext;
+import org.openecomp.core.zusammen.plugin.dao.types.ElementEntity;
+
+import java.util.Date;
+import java.util.Map;
+
+public interface ElementPublicStore extends ElementStore {
+
+  void create(SessionContext context, ElementContext elementContext, ElementEntity element,
+              Date publishTime);
+
+  void update(SessionContext context, ElementContext elementContext, ElementEntity element,
+              Date publishTime);
+
+  void delete(SessionContext context, ElementContext elementContext, ElementEntity element,
+              Date publishTime);
+
+  Map<Id,Id> listIds(SessionContext context, ElementContext elementContext);
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/ElementStageStore.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/ElementStageStore.java
new file mode 100644
index 0000000..a923624
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/ElementStageStore.java
@@ -0,0 +1,35 @@
+package org.openecomp.core.zusammen.plugin.collaboration;
+
+import com.amdocs.zusammen.datatypes.SessionContext;
+import com.amdocs.zusammen.datatypes.item.ElementContext;
+import com.amdocs.zusammen.datatypes.item.Resolution;
+import org.openecomp.core.zusammen.plugin.dao.types.ElementEntity;
+import org.openecomp.core.zusammen.plugin.dao.types.StageEntity;
+
+import java.util.Collection;
+import java.util.Optional;
+
+public interface ElementStageStore {
+
+  Collection<ElementEntity> listIds(SessionContext context, ElementContext elementContext);
+
+  boolean hasConflicts(SessionContext context, ElementContext elementContext);
+
+  Collection<StageEntity<ElementEntity>> listConflictedDescriptors(SessionContext context,
+                                                                   ElementContext elementContext);
+
+  Optional<StageEntity<ElementEntity>> get(SessionContext context, ElementContext elementContext,
+                                           ElementEntity element);
+
+  Optional<StageEntity<ElementEntity>> getConflicted(SessionContext context,
+                                                     ElementContext elementContext,
+                                                     ElementEntity element);
+
+  void create(SessionContext context, ElementContext elementContext,
+              StageEntity<ElementEntity> elementStage);
+
+  void delete(SessionContext context, ElementContext elementContext, ElementEntity element);
+
+  void resolveConflict(SessionContext context, ElementContext elementContext, ElementEntity element,
+                       Resolution resolution);
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/ElementStore.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/ElementStore.java
new file mode 100644
index 0000000..1c26a81
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/ElementStore.java
@@ -0,0 +1,20 @@
+package org.openecomp.core.zusammen.plugin.collaboration;
+
+import com.amdocs.zusammen.datatypes.Id;
+import com.amdocs.zusammen.datatypes.SessionContext;
+import com.amdocs.zusammen.datatypes.item.ElementContext;
+import org.openecomp.core.zusammen.plugin.dao.types.ElementEntity;
+import org.openecomp.core.zusammen.plugin.dao.types.SynchronizationStateEntity;
+
+import java.util.Collection;
+import java.util.Optional;
+
+public interface ElementStore {
+  Optional<ElementEntity> get(SessionContext context, ElementContext elementContext, Id elementId);
+
+  Optional<ElementEntity> getDescriptor(SessionContext context, ElementContext elementContext,
+                                        Id elementId);
+
+  Collection<SynchronizationStateEntity> listSynchronizationStates(SessionContext context,
+                                                                   ElementContext elementContext);
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/ErrorCode.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/ErrorCode.java
new file mode 100644
index 0000000..3d09100
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/ErrorCode.java
@@ -0,0 +1,5 @@
+package org.openecomp.core.zusammen.plugin.collaboration;
+
+public class ErrorCode {
+  public static final int NO_CHANGES_TO_PUBLISH = 60000;
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/Message.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/Message.java
new file mode 100644
index 0000000..2816974
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/Message.java
@@ -0,0 +1,6 @@
+package org.openecomp.core.zusammen.plugin.collaboration;
+
+public class Message {
+  public static final String NO_CHANGES_TO_PUBLISH =
+      "Item Id %s, version Id %s: There are no changes to publish.";
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/PublishService.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/PublishService.java
new file mode 100644
index 0000000..7b043c8
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/PublishService.java
@@ -0,0 +1,201 @@
+package org.openecomp.core.zusammen.plugin.collaboration;
+
+import com.amdocs.zusammen.datatypes.Id;
+import com.amdocs.zusammen.datatypes.SessionContext;
+import com.amdocs.zusammen.datatypes.item.Action;
+import com.amdocs.zusammen.datatypes.item.ElementContext;
+import com.amdocs.zusammen.datatypes.response.ReturnCode;
+import com.amdocs.zusammen.datatypes.response.ZusammenException;
+import com.amdocs.zusammen.sdk.collaboration.types.CollaborationMergeChange;
+import com.amdocs.zusammen.sdk.collaboration.types.CollaborationPublishResult;
+import org.openecomp.core.zusammen.plugin.dao.types.ElementEntity;
+import org.openecomp.core.zusammen.plugin.dao.types.SynchronizationStateEntity;
+import org.openecomp.core.zusammen.plugin.dao.types.VersionEntity;
+
+import java.util.Collection;
+import java.util.Date;
+import java.util.Map;
+import java.util.Optional;
+import java.util.UUID;
+
+import static com.amdocs.zusammen.datatypes.response.Module.ZCSP;
+import static org.openecomp.core.zusammen.plugin.ZusammenPluginConstants.ROOT_ELEMENTS_PARENT_ID;
+import static org.openecomp.core.zusammen.plugin.ZusammenPluginUtil.convertToElementChange;
+import static org.openecomp.core.zusammen.plugin.ZusammenPluginUtil.convertToVersionChange;
+import static org.openecomp.core.zusammen.plugin.collaboration.ErrorCode.NO_CHANGES_TO_PUBLISH;
+
+public class PublishService {
+  // TODO: 6/29/2017 throw ZusammenException with ReturnCode when needed.
+  private static final String PUSH_NON_EXISTING_VERSION =
+      "Item Id %s, version Id %s: Non existing version cannot be pushed.";
+
+  private VersionPublicStore versionPublicStore;
+  private VersionPrivateStore versionPrivateStore;
+  private ElementPublicStore elementPublicStore;
+  private ElementPrivateStore elementPrivateStore;
+
+  public PublishService(VersionPublicStore versionPublicStore,
+                        VersionPrivateStore versionPrivateStore,
+                        ElementPublicStore elementPublicStore,
+                        ElementPrivateStore elementPrivateStore) {
+    this.versionPublicStore = versionPublicStore;
+    this.versionPrivateStore = versionPrivateStore;
+    this.elementPublicStore = elementPublicStore;
+    this.elementPrivateStore = elementPrivateStore;
+  }
+
+  public CollaborationPublishResult publish(SessionContext context, Id itemId, Id versionId,
+                                            String message) {
+    CollaborationPublishResult result = new CollaborationPublishResult();
+    result.setChange(new CollaborationMergeChange());
+
+    Date publishTime = new Date();
+    Id revisionId = new Id(UUID.randomUUID().toString());
+    boolean versionFirstPublication = publishVersion(context, itemId, versionId, revisionId,
+        publishTime,message);
+    if (versionFirstPublication) {
+      publishAllElements(context, new ElementContext(itemId, versionId, revisionId), publishTime,
+          result);
+    } else {
+      publishDirtyElements(context, new ElementContext(itemId, versionId, revisionId), publishTime,
+          result);
+    }
+    return result;
+  }
+
+  private boolean publishVersion(SessionContext context, Id itemId, Id versionId, Id revisionId,
+                                 Date publishTime, String message) {
+    SynchronizationStateEntity privateVersionSyncState =
+        versionPrivateStore.getSynchronizationState(context, itemId, versionId)
+            .orElseThrow(() -> new IllegalArgumentException(
+                String.format(PUSH_NON_EXISTING_VERSION, itemId.toString(), versionId.toString())));
+
+    if (!privateVersionSyncState.isDirty()) {
+      throw new ZusammenException(new ReturnCode(NO_CHANGES_TO_PUBLISH, ZCSP,
+          String.format(Message.NO_CHANGES_TO_PUBLISH, itemId, versionId), null));
+    }
+
+    Optional<SynchronizationStateEntity> publicVersionSyncState =
+        versionPublicStore.getSynchronizationState(context, itemId, versionId);
+
+    // private must be synced with public (if public exists)
+    if (publicVersionSyncState.isPresent() &&
+        !privateVersionSyncState.getPublishTime()
+            .equals(publicVersionSyncState.get().getPublishTime())) {
+      // should not happen as it is validated in zusammen-core
+      throw new UnsupportedOperationException("Out of sync item version can not be publish");
+    }
+
+    boolean versionFirstPublication;
+    Map<Id, Id> versionElementIds =
+        elementPublicStore.listIds(context, new ElementContext(itemId,
+            versionId));
+    if (publicVersionSyncState.isPresent()) {
+      versionPublicStore.update(context, itemId, new VersionEntity(versionId), revisionId,
+          versionElementIds,publishTime,message);
+      versionFirstPublication = false;
+    } else {
+      VersionEntity privateVersion = versionPrivateStore.get(context, itemId, versionId)
+          .orElseThrow(() -> new IllegalArgumentException(
+              String.format(PUSH_NON_EXISTING_VERSION, itemId.toString(), versionId.toString())));
+      versionPublicStore.create(context, itemId, privateVersion, revisionId,versionElementIds,
+          publishTime,message);
+      versionFirstPublication = true;
+    }
+    versionPrivateStore.markAsPublished(context, itemId, versionId, publishTime);
+    return versionFirstPublication;
+  }
+
+  private void publishAllElements(SessionContext context, ElementContext elementContext,
+                                  Date publishTime, CollaborationPublishResult result) {
+    Collection<SynchronizationStateEntity> privateElementSyncStates =
+        elementPrivateStore.listSynchronizationStates(context, elementContext);
+
+    for (SynchronizationStateEntity privateElementSyncState : privateElementSyncStates) {
+      Optional<ElementEntity> privateElement =
+          elementPrivateStore.get(context, elementContext, privateElementSyncState.getId());
+
+      if (!privateElement.isPresent()) {
+        continue;
+      }
+      ElementEntity elementToPublish = privateElement.get();
+
+      elementPublicStore.create(context, elementContext, elementToPublish,
+          privateElementSyncState.isDirty() ? publishTime
+              : privateElementSyncState.getPublishTime());
+
+      if (privateElementSyncState.isDirty()) {
+        elementPrivateStore
+            .markAsPublished(context, elementContext, privateElementSyncState.getId(), publishTime);
+      }
+      updateResult(elementContext, elementToPublish, Action.CREATE,
+          ROOT_ELEMENTS_PARENT_ID.equals(privateElementSyncState.getId()), result);
+    }
+  }
+
+  private void publishDirtyElements(SessionContext context, ElementContext elementContext,
+                                    Date publishTime, CollaborationPublishResult result) {
+
+    Id revisionId = elementContext.getRevisionId();
+    elementContext.setRevisionId(revisionId);
+    ElementContext privateElementContext = new ElementContext(elementContext.getItemId(),
+        elementContext.getVersionId(),Id.ZERO);
+    Collection<SynchronizationStateEntity> privateElementSyncStates =
+        elementPrivateStore.listSynchronizationStates(context, elementContext);
+
+    Collection<SynchronizationStateEntity> publicElementSyncStates =
+        elementPublicStore.listSynchronizationStates(context, elementContext);
+
+    for (SynchronizationStateEntity privateElementSyncState : privateElementSyncStates) {
+      if (!privateElementSyncState.isDirty()) {
+        continue;
+      }
+
+      Optional<ElementEntity> privateElement =
+          elementPrivateStore.get(context, privateElementContext, privateElementSyncState.getId());
+
+      ElementEntity elementToPublish;
+      Action actionOnPublic;
+      if (privateElement.isPresent()) {
+        elementToPublish = privateElement.get();
+
+        if (publicElementSyncStates.contains(privateElementSyncState)) {
+
+          elementPublicStore.update(context, elementContext, elementToPublish, publishTime);
+          actionOnPublic = Action.UPDATE;
+        } else {
+          elementPublicStore.create(context, elementContext, elementToPublish, publishTime);
+          actionOnPublic = Action.CREATE;
+        }
+
+        elementPrivateStore
+            .markAsPublished(context, privateElementContext, privateElementSyncState.getId(), publishTime);
+      } else {
+        elementToPublish =
+            elementPublicStore.get(context, elementContext, privateElementSyncState.getId())
+                .orElseThrow(() -> new IllegalStateException(
+                    "Element that should be deleted from public must exist there"));
+        elementPublicStore.delete(context, elementContext, elementToPublish, publishTime);
+        actionOnPublic = Action.DELETE;
+
+        elementPrivateStore
+            .markDeletionAsPublished(context, privateElementContext, privateElementSyncState.getId(),
+                publishTime);
+      }
+
+      updateResult(elementContext, elementToPublish, actionOnPublic,
+          ROOT_ELEMENTS_PARENT_ID.equals(privateElementSyncState.getId()), result);
+    }
+  }
+
+  private void updateResult(ElementContext elementContext, ElementEntity element,
+                            Action action, boolean versionDataElement,
+                            CollaborationPublishResult result) {
+    if (versionDataElement) {
+      result.getChange().setChangedVersion(convertToVersionChange(elementContext, element, action));
+    } else {
+      result.getChange().getChangedElements()
+          .add(convertToElementChange(elementContext, element, action));
+    }
+  }
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/RevertService.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/RevertService.java
new file mode 100644
index 0000000..0d2ea2c
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/RevertService.java
@@ -0,0 +1,161 @@
+package org.openecomp.core.zusammen.plugin.collaboration;
+
+import com.amdocs.zusammen.datatypes.Id;
+import com.amdocs.zusammen.datatypes.SessionContext;
+import com.amdocs.zusammen.datatypes.item.ElementContext;
+import org.openecomp.core.zusammen.plugin.dao.types.ElementEntity;
+import org.openecomp.core.zusammen.plugin.dao.types.SynchronizationStateEntity;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Optional;
+
+public class RevertService {
+
+  private ElementPublicStore elementPublicStore;
+  private ElementPrivateStore elementPrivateStore;
+
+  public RevertService(ElementPublicStore elementPublicStore,
+                       ElementPrivateStore elementPrivateStore) {
+    this.elementPublicStore = elementPublicStore;
+    this.elementPrivateStore = elementPrivateStore;
+  }
+
+  public void revert(SessionContext context, Id itemId, Id versionId, Id revisionId) {
+    ElementContext targetContext = new ElementContext(itemId, versionId);
+    ElementContext sourceContext = new ElementContext(itemId, versionId, revisionId);
+    copyElementsFromPublic(context, sourceContext, targetContext);
+  }
+
+  private void copyElementsFromPublic(SessionContext context, ElementContext sourceContext,
+                                      ElementContext targetContext) {
+    Collection<RevertElementAction> revertElementActions =
+        evaluateRevertElementActions(context, sourceContext, targetContext);
+
+    revertElementActions.forEach(revertElementAction -> revertElementAction.run(context));
+  }
+
+  private Collection<RevertElementAction> evaluateRevertElementActions(SessionContext context,
+                                                                       ElementContext sourceContext,
+                                                                       ElementContext targetContext) {
+
+    Map<Id, Id> sourceElements = elementPublicStore.listIds(context, sourceContext);
+    Map<Id, Id> targetPublicElements = elementPublicStore.listIds(context, targetContext);
+    Collection<SynchronizationStateEntity> synchronizationStateEntities =
+        elementPrivateStore.listSynchronizationStates(context, targetContext);
+
+    Map<Id, Id> targetElements =
+        evaluateTargetElements(targetPublicElements, synchronizationStateEntities);
+
+
+    Collection<RevertElementAction> revertElementActions = new ArrayList<>();
+
+    sourceElements.entrySet().forEach(entry -> {
+      Id sourceElementId = entry.getKey();
+      Id sourceElementRevisionId = entry.getValue();
+
+      if (!targetElements.containsKey(sourceElementId)) {
+        revertElementActions
+            .add(new RevertElementAction(sourceContext, sourceElementId, commands[CREATE]));
+      } else if (!targetElements.get(sourceElementId).equals(sourceElementRevisionId)) {
+        revertElementActions
+            .add(new RevertElementAction(sourceContext, sourceElementId, commands[UPDATE]));
+      }
+    });
+
+    targetElements.entrySet().forEach(entry -> {
+      Id targetElementId = entry.getKey();
+      if (!sourceElements.containsKey(targetElementId)) {
+        revertElementActions
+            .add(new RevertElementAction(targetContext, targetElementId, commands[DELETE]));
+      }
+    });
+
+    return revertElementActions;
+  }
+
+  private Map<Id, Id> evaluateTargetElements(Map<Id, Id> targetPublicElements,
+                                             Collection<SynchronizationStateEntity> syncStates) {
+    Map<Id, Id> targetElements = new HashMap<>(targetPublicElements);
+    syncStates.stream()
+        .filter(SynchronizationStateEntity::isDirty)
+        .forEach(syncState -> targetElements.put(syncState.getId(), Id.ZERO));
+    return targetElements;
+  }
+
+  private static class RevertElementAction {
+    private ElementContext elementContext;
+    private Id elementId;
+    private ActionCommand command;
+
+    private RevertElementAction(ElementContext elementContext, Id elementId,
+                                ActionCommand command) {
+      this.elementContext = elementContext;
+      this.elementId = elementId;
+      this.command = command;
+    }
+
+    public ElementContext getElementContext() {
+      return elementContext;
+    }
+
+    public Id getElementId() {
+      return elementId;
+    }
+
+    public void run(SessionContext context) {
+      command.run(context, elementContext, elementId);
+    }
+  }
+
+  private interface ActionCommand {
+    void run(SessionContext context, ElementContext elementContext, Id elementId);
+  }
+
+  private static int CREATE = 0;
+  private static int UPDATE = 1;
+  private static int DELETE = 2;
+
+  private ActionCommand[] commands = {new ActionCommand() {
+    @Override
+    public void run(SessionContext context, ElementContext elementContext, Id elementId) {
+      //create
+      Optional<ElementEntity> element = elementPublicStore.get(context, elementContext, elementId);
+      if (!element.isPresent()) {
+        throw getMissingElementException(elementContext, elementId);
+      }
+      elementPrivateStore.create(context, elementContext, element.get());
+    }
+  }, new ActionCommand() {
+    @Override
+    public void run(SessionContext context, ElementContext elementContext, Id elementId) {
+      //update
+      Optional<ElementEntity> element = elementPublicStore.get(context, elementContext, elementId);
+      if (!element.isPresent()) {
+        throw getMissingElementException(elementContext, elementId);
+      }
+      elementPrivateStore.update(context, elementContext, element.get());
+    }
+  }, new ActionCommand() {
+    @Override
+    public void run(SessionContext context, ElementContext elementContext, Id elementId) {
+      //delete
+      Optional<ElementEntity> element = elementPrivateStore.get(context, elementContext, elementId);
+      if (!element.isPresent()) {
+        return; // deleted by parent when hierarchy was deleted
+      }
+      elementPrivateStore.delete(context, elementContext, element.get());
+    }
+  }};
+
+  private RuntimeException getMissingElementException(ElementContext elementContext,
+                                                      Id elementId) {
+    return new IllegalStateException(
+        String.format("Item Id %s, version Id %s, revision Id %s: Missing element with Id %s",
+            elementContext.getItemId().getValue(), elementContext.getVersionId().getValue(),
+            elementContext.getRevisionId().getValue(), elementId.getValue())
+    );
+  }
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/SyncService.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/SyncService.java
new file mode 100644
index 0000000..04a7e9f
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/SyncService.java
@@ -0,0 +1,384 @@
+package org.openecomp.core.zusammen.plugin.collaboration;
+
+import com.amdocs.zusammen.datatypes.Id;
+import com.amdocs.zusammen.datatypes.SessionContext;
+import com.amdocs.zusammen.datatypes.item.Action;
+import com.amdocs.zusammen.datatypes.item.ElementContext;
+import com.amdocs.zusammen.sdk.collaboration.types.CollaborationMergeChange;
+import com.amdocs.zusammen.sdk.collaboration.types.CollaborationMergeConflict;
+import com.amdocs.zusammen.sdk.collaboration.types.CollaborationMergeResult;
+import org.openecomp.core.zusammen.plugin.dao.types.ElementEntity;
+import org.openecomp.core.zusammen.plugin.dao.types.StageEntity;
+import org.openecomp.core.zusammen.plugin.dao.types.SynchronizationStateEntity;
+import org.openecomp.core.zusammen.plugin.dao.types.VersionEntity;
+
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+import java.util.function.Function;
+import java.util.function.Predicate;
+import java.util.stream.Collectors;
+
+import static org.openecomp.core.zusammen.plugin.ZusammenPluginConstants.ROOT_ELEMENTS_PARENT_ID;
+
+public class SyncService {
+  private static final String PULL_NON_EXISTING_VERSION =
+      "Item Id %s, version Id %s: Non existing version cannot be synced.";
+  private static final String PUBLIC_SYNC_STATE_EXISTS_WITHOUT_ELEMENT =
+      "Item Id %s, version Id %s: Sync state of element with Id %s " +
+          "exists in public space while the element does not";
+  private static final String PRIVATE_UNPUBLISHED_SYNC_STATE_EXISTS_WITHOUT_ELEMENT =
+      "Item Id %s, version Id %s: Sync state of unpublished element with Id %s " +
+          "exists in private space while the element does not";
+
+  private VersionPublicStore versionPublicStore;
+  private VersionPrivateStore versionPrivateStore;
+  private VersionStageStore versionStageStore;
+  private ElementPublicStore elementPublicStore;
+  private ElementPrivateStore elementPrivateStore;
+  private ElementStageStore elementStageStore;
+
+  public SyncService(VersionPublicStore versionPublicStore,
+                     VersionPrivateStore versionPrivateStore,
+                     VersionStageStore versionStageStore,
+                     ElementPublicStore elementPublicStore,
+                     ElementPrivateStore elementPrivateStore,
+                     ElementStageStore elementStageStore) {
+    this.versionPublicStore = versionPublicStore;
+    this.versionPrivateStore = versionPrivateStore;
+    this.versionStageStore = versionStageStore;
+    this.elementPublicStore = elementPublicStore;
+    this.elementPrivateStore = elementPrivateStore;
+    this.elementStageStore = elementStageStore;
+  }
+
+  public CollaborationMergeResult sync(SessionContext context, Id itemId, Id versionId,
+                                       boolean force) {
+    SynchronizationStateEntity publicVersionSyncState =
+        versionPublicStore.getSynchronizationState(context, itemId, versionId)
+            .orElseThrow(() -> new IllegalStateException(
+                String.format(PULL_NON_EXISTING_VERSION, itemId.toString(), versionId.toString())));
+
+    Date publishTime = publicVersionSyncState.getPublishTime();
+
+    Optional<SynchronizationStateEntity> privateVersionSyncState =
+        versionPrivateStore.getSynchronizationState(context, itemId, versionId);
+
+    if (force || !privateVersionSyncState.isPresent() ||
+        !publishTime.equals(privateVersionSyncState.get().getPublishTime())) {
+      ElementContext elementContext =
+          new ElementContext(itemId, versionId, publicVersionSyncState.getRevisionId());
+
+      Collection<SynchronizationStateEntity> publicSyncStates =
+          elementPublicStore.listSynchronizationStates(context, elementContext);
+      Collection<SynchronizationStateEntity> privateSyncStates =
+          elementPrivateStore.listSynchronizationStates(context, elementContext);
+      Map<Id, SynchronizationStateEntity> publicSyncStateById = toMapById(publicSyncStates);
+
+      Set<Id> syncedElements = new HashSet<>();
+      if (force) {
+        List<SynchronizationStateEntity> dirtyPrivateSyncStates = privateSyncStates.stream()
+            .filter(SynchronizationStateEntity::isDirty)
+            .collect(Collectors.toList());
+
+        forceSyncDirtyElements(context, elementContext, dirtyPrivateSyncStates, publicSyncStateById,
+            syncedElements);
+      }
+
+      if (!privateVersionSyncState.isPresent() ||
+          !publishTime.equals(privateVersionSyncState.get().getPublishTime())) {
+        syncVersion(context, itemId, versionId, publishTime, privateVersionSyncState.isPresent());
+        syncElements(context, elementContext,
+            privateVersionSyncState.map(SynchronizationStateEntity::getPublishTime).orElse(null),
+            publicSyncStates, privateSyncStates, publicSyncStateById, syncedElements);
+      }
+    }
+
+    return createResult();
+  }
+
+  private CollaborationMergeResult createResult() {
+    CollaborationMergeResult result = new CollaborationMergeResult();
+    result.setChange(new CollaborationMergeChange());
+    result.setConflict(new CollaborationMergeConflict());
+    return result;
+  }
+
+  private void syncVersion(SessionContext context, Id itemId, Id versionId, Date publishTime,
+                           boolean versionExistOnPrivate) {
+    if (versionExistOnPrivate) {
+      stageVersion(context, itemId, new VersionEntity(versionId), Action.UPDATE, publishTime);
+    } else {
+      stageVersion(context, itemId, versionPublicStore.get(context, itemId, versionId)
+              .orElseThrow(() -> new IllegalArgumentException(String
+                  .format(PULL_NON_EXISTING_VERSION, itemId.toString(), versionId.toString()))),
+          Action.CREATE, publishTime);
+    }
+  }
+
+  private void syncElements(SessionContext context, ElementContext elementContext,
+                            Date previousSyncedPublishTime,
+                            Collection<SynchronizationStateEntity> publicSyncStates,
+                            Collection<SynchronizationStateEntity> privateSyncStates,
+                            Map<Id, SynchronizationStateEntity> publicSyncStateById,
+                            Set<Id> syncedElements) {
+    Map<Id, SynchronizationStateEntity> privateSyncStateById = toMapById(privateSyncStates);
+
+    Collection<SynchronizationStateEntity> updatedPublicSyncStates =
+        previousSyncedPublishTime == null
+            ? publicSyncStates
+            : publicSyncStates.stream()
+                .filter(syncState -> syncState.getPublishTime().after(previousSyncedPublishTime))
+                .collect(Collectors.toList());
+
+    syncPublicUpdatedElements(context, elementContext, updatedPublicSyncStates,
+        publicSyncStateById, privateSyncStateById, syncedElements);
+
+    List<SynchronizationStateEntity> onlyOnPrivatePublishedSyncStates =
+        privateSyncStates.stream()
+            .filter(syncState -> !publicSyncStateById.containsKey(syncState.getId()) &&
+                syncState.getPublishTime() != null)
+            .collect(Collectors.toList());
+
+    syncPublicDeletedElements(context, elementContext, onlyOnPrivatePublishedSyncStates,
+        publicSyncStateById, privateSyncStateById, syncedElements);
+  }
+
+  private void syncPublicUpdatedElements(SessionContext context, ElementContext elementContext,
+                                         Collection<SynchronizationStateEntity> updatedPublicSyncStates,
+                                         Map<Id, SynchronizationStateEntity> publicSyncStateById,
+                                         Map<Id, SynchronizationStateEntity> privateSyncStateById,
+                                         Set<Id> syncedElements) {
+    for (SynchronizationStateEntity publicSyncState : updatedPublicSyncStates) {
+      if (syncedElements.contains(publicSyncState.getId())) {
+        continue;
+      }
+
+      ElementEntity publicElement =
+          elementPublicStore.get(context, elementContext, publicSyncState.getId()).orElseThrow(
+              () -> new IllegalStateException(String
+                  .format(PUBLIC_SYNC_STATE_EXISTS_WITHOUT_ELEMENT,
+                      elementContext.getItemId().getValue(),
+                      elementContext.getVersionId().getValue(),
+                      publicSyncState.getId().getValue())));
+
+      SynchronizationStateEntity privateSyncState =
+          privateSyncStateById.get(publicSyncState.getId());
+
+      if (privateSyncState != null) {
+        if (!privateSyncState.isDirty()) {
+          // not changed on private
+          stageElement(context, elementContext, publicElement,
+              publicSyncState.getPublishTime(),
+              Action.UPDATE, false, null);
+          syncedElements.add(publicSyncState.getId());
+        } else {
+          Optional<ElementEntity> privateElement =
+              elementPrivateStore.get(context, elementContext, publicSyncState.getId());
+
+          if (privateElement.isPresent()) {
+            // updated on private - conflict if it has different hash
+            stageElement(context, elementContext, publicElement,
+                publicSyncState.getPublishTime(), Action.UPDATE,
+                !publicElement.getElementHash().equals(privateElement.get().getElementHash()),
+                null);
+
+            syncedElements.add(publicSyncState.getId());
+          } else {
+            // deleted on private - conflict tree
+            Set<Id> changeTreeElementIds =
+                stagePublicElementTree(context, elementContext, publicElement, publicSyncStateById,
+                    (treeElementIds) -> true);
+            syncedElements.addAll(changeTreeElementIds);
+          }
+        }
+      } else {
+        // not existing on private - new creation on public
+        Set<Id> changeTreeElementIds =
+            stagePublicElementTree(context, elementContext, publicElement, publicSyncStateById,
+                (treeElementIds) -> containsDirty(treeElementIds, privateSyncStateById));
+        syncedElements.addAll(changeTreeElementIds);
+      }
+    }
+  }
+
+  private void syncPublicDeletedElements(
+      SessionContext context, ElementContext elementContext,
+      Collection<SynchronizationStateEntity> onlyOnPrivatePublishedSyncStates,
+      Map<Id, SynchronizationStateEntity> publicSyncStateById,
+      Map<Id, SynchronizationStateEntity> privateSyncStateById,
+      Set<Id> syncedElements) {
+    for (SynchronizationStateEntity privateSyncState : onlyOnPrivatePublishedSyncStates) {
+      if (syncedElements.contains(privateSyncState.getId())) {
+        continue;
+      }
+
+      Optional<ElementEntity> privateElement =
+          elementPrivateStore.get(context, elementContext, privateSyncState.getId());
+
+      if (!privateElement.isPresent()) {
+        // deleted on private as well
+        stageElement(context, elementContext, new ElementEntity(privateSyncState.getId()),
+            null, Action.DELETE, false, null);
+        syncedElements.add(privateSyncState.getId());
+      } else {
+        Set<Id> changeTreeElementIds =
+            stageElementTree(context, elementContext, privateElement.get(),
+                elementPrivateStore, publicSyncStateById::containsKey,
+                (treeElementIds) -> containsDirty(treeElementIds, privateSyncStateById),
+                (elementId) -> null, Action.DELETE);
+        syncedElements.addAll(changeTreeElementIds);
+      }
+    }
+  }
+
+  private void forceSyncDirtyElements(SessionContext context, ElementContext elementContext,
+                                      List<SynchronizationStateEntity> dirtyPrivateSyncStates,
+                                      Map<Id, SynchronizationStateEntity> publicSyncStateById,
+                                      Set<Id> syncedElements) {
+    for (SynchronizationStateEntity privateSyncState : dirtyPrivateSyncStates) {
+      Optional<ElementEntity> privateElement =
+          elementPrivateStore.get(context, elementContext, privateSyncState.getId());
+      if (privateSyncState.getPublishTime() == null) {
+        stageElement(context, elementContext,
+            privateElement.orElseThrow(() -> new IllegalStateException(
+                String.format(PRIVATE_UNPUBLISHED_SYNC_STATE_EXISTS_WITHOUT_ELEMENT,
+                    elementContext.getItemId().getValue(),
+                    elementContext.getVersionId().getValue(),
+                    privateSyncState.getId().getValue()))),
+            null, Action.DELETE, false, null);
+      } else {
+        SynchronizationStateEntity publicSyncState =
+            publicSyncStateById.get(privateSyncState.getId());
+        if (publicSyncState != null) {
+          ElementEntity publicElement =
+              elementPublicStore.get(context, elementContext, privateSyncState.getId()).orElseThrow(
+                  () -> new IllegalStateException(String
+                      .format(PUBLIC_SYNC_STATE_EXISTS_WITHOUT_ELEMENT,
+                          elementContext.getItemId().getValue(),
+                          elementContext.getVersionId().getValue(),
+                          privateSyncState.getId().getValue())));
+
+          stageElement(context, elementContext, publicElement, publicSyncState.getPublishTime(),
+              privateElement.isPresent() ? Action.UPDATE : Action.CREATE, false, null);
+        } else {
+          stageElement(context, elementContext, privateElement.isPresent()
+                  ? privateElement.get()
+                  : new ElementEntity(privateSyncState.getId()),
+              null, Action.DELETE, false, null);
+        }
+      }
+      syncedElements.add(privateSyncState.getId());
+    }
+  }
+
+  private Set<Id> stagePublicElementTree(SessionContext context,
+                                         ElementContext elementContext,
+                                         ElementEntity publicElement,
+                                         Map<Id, SynchronizationStateEntity> publicSyncStateById,
+                                         Predicate<Set<Id>> isElementTreeConflicted) {
+
+
+    return stageElementTree(context, elementContext, publicElement,
+        elementPublicStore,
+        (elementId) -> elementPrivateStore.getDescriptor(context, elementContext, elementId)
+            .isPresent(),
+        isElementTreeConflicted,
+        (elementId) -> publicSyncStateById.get(elementId).getPublishTime(),
+        Action.CREATE);
+  }
+
+  private Set<Id> stageElementTree(SessionContext context, ElementContext elementContext,
+                                   ElementEntity element,
+                                   ElementStore elementStore,
+                                   Predicate<Id> isElementExist,
+                                   Predicate<Set<Id>> isElementTreeConflicted,
+                                   Function<Id, Date> stagePublishTimeGetter,
+                                   Action stageAction) {
+    ElementEntity elementTreeRoot = findRootElementOfChange(context, elementContext,
+        elementStore, isElementExist, element);
+
+    Set<Id> elementTreeIds = new HashSet<>();
+    elementTreeIds.add(elementTreeRoot.getId());
+
+    Set<Id> subElementIds = stageElementSubs(context, elementContext, elementStore, elementTreeRoot,
+        stagePublishTimeGetter, stageAction);
+    elementTreeIds.addAll(subElementIds);
+
+    boolean conflicted = isElementTreeConflicted.test(elementTreeIds);
+    stageElement(context, elementContext, elementTreeRoot,
+        stagePublishTimeGetter.apply(elementTreeRoot.getId()), stageAction, conflicted,
+        conflicted ? subElementIds : null);
+    return elementTreeIds;
+  }
+
+  private ElementEntity findRootElementOfChange(SessionContext context,
+                                                ElementContext elementContext,
+                                                ElementStore elementStore,
+                                                Predicate<Id> isElementExistOnOppositeStore,
+                                                ElementEntity element) {
+    return element.getId().equals(ROOT_ELEMENTS_PARENT_ID) ||
+        isElementExistOnOppositeStore.test(element.getParentId())
+        ? element
+        : findRootElementOfChange(context, elementContext, elementStore,
+            isElementExistOnOppositeStore,
+            elementStore.get(context, elementContext, element.getParentId())
+                .orElseThrow(() -> new IllegalStateException(
+                    String.format("Element %s exists while its parent element %s does not",
+                        element.getId(), element.getParentId()))));
+  }
+
+  private boolean containsDirty(Set<Id> elementIds,
+                                Map<Id, SynchronizationStateEntity> syncStateById) {
+    return elementIds.stream().anyMatch(elementId -> {
+      SynchronizationStateEntity privateSyncState = syncStateById.get(elementId);
+      return privateSyncState != null && privateSyncState.isDirty();
+    });
+  }
+
+  private Set<Id> stageElementSubs(SessionContext context, ElementContext elementContext,
+                                   ElementStore elementStore, ElementEntity parentElement,
+                                   Function<Id, Date> stagePublishTimeGetter, Action stageAction) {
+    Set<Id> elementTreeIds = new HashSet<>();
+    for (Id elementId : parentElement.getSubElementIds()) {
+      ElementEntity element = elementStore.get(context, elementContext, elementId).get();
+
+      stageElement(context, elementContext, element, stagePublishTimeGetter.apply(elementId),
+          stageAction, false, null);
+
+      elementTreeIds.add(elementId);
+      elementTreeIds.addAll(
+          stageElementSubs(context, elementContext, elementStore, element, stagePublishTimeGetter,
+              stageAction));
+    }
+    return elementTreeIds;
+  }
+
+  private void stageElement(SessionContext context, ElementContext elementContext,
+                            ElementEntity element, Date publishTime, Action action,
+                            boolean conflicted, Set<Id> conflictDependents) {
+    StageEntity<ElementEntity> elementStage =
+        new StageEntity<>(element, publishTime, action, conflicted);
+    if (conflictDependents != null) {
+      elementStage.setConflictDependents(
+          conflictDependents.stream().map(ElementEntity::new).collect(Collectors.toSet()));
+    }
+    elementStageStore.create(context, elementContext, elementStage);
+  }
+
+  private void stageVersion(SessionContext context, Id itemId, VersionEntity stageVersion,
+                            Action stageAction, Date publishTime) {
+    versionStageStore
+        .create(context, itemId, new StageEntity<>(stageVersion, publishTime, stageAction, false));
+  }
+
+  private Map<Id, SynchronizationStateEntity> toMapById(
+      Collection<SynchronizationStateEntity> syncStates) {
+    return syncStates.stream()
+        .collect(Collectors.toMap(SynchronizationStateEntity::getId, Function.identity()));
+  }
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/VersionCollaborationStore.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/VersionCollaborationStore.java
deleted file mode 100644
index db3066c..0000000
--- a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/VersionCollaborationStore.java
+++ /dev/null
@@ -1,110 +0,0 @@
-package org.openecomp.core.zusammen.plugin.collaboration;
-
-import com.amdocs.zusammen.datatypes.Id;
-import com.amdocs.zusammen.datatypes.SessionContext;
-import com.amdocs.zusammen.datatypes.Space;
-import com.amdocs.zusammen.datatypes.item.Action;
-import com.amdocs.zusammen.datatypes.itemversion.Tag;
-import com.amdocs.zusammen.plugin.statestore.cassandra.dao.types.ElementEntityContext;
-import com.amdocs.zusammen.sdk.collaboration.types.CollaborationElementChange;
-import com.amdocs.zusammen.sdk.collaboration.types.CollaborationMergeChange;
-import org.openecomp.core.zusammen.plugin.ZusammenPluginUtil;
-import org.openecomp.core.zusammen.plugin.dao.ElementRepository;
-import org.openecomp.core.zusammen.plugin.dao.ElementRepositoryFactory;
-import org.openecomp.core.zusammen.plugin.dao.types.ElementEntity;
-
-import java.util.Collection;
-import java.util.List;
-import java.util.stream.Collectors;
-
-import static org.openecomp.core.zusammen.plugin.ZusammenPluginConstants.ROOT_ELEMENTS_PARENT_ID;
-import static org.openecomp.core.zusammen.plugin.ZusammenPluginUtil.getSpaceName;
-
-public class VersionCollaborationStore {
-
-  public void tagItemVersion(SessionContext context, Id itemId, Id versionId, Id changeId,
-                             Tag tag) {
-    if (changeId != null) {
-      throw new UnsupportedOperationException(
-          "In this plugin implementation tag is supported only on versionId");
-    }
-    String space = getSpaceName(context, Space.PRIVATE);
-    ElementEntityContext targetContext = new ElementEntityContext(space, itemId, versionId);
-    targetContext.setChangeRef(tag.getName());
-    copyElements(context, new ElementEntityContext(space, itemId, versionId), targetContext,
-        getElementRepository(context));
-  }
-
-  public CollaborationMergeChange resetItemVersionHistory(SessionContext context, Id itemId,
-                                                          Id versionId, String changeRef) {
-    ElementRepository elementRepository = getElementRepository(context);
-
-    String spaceName = getSpaceName(context, Space.PRIVATE);
-    ElementEntityContext versionContext = new ElementEntityContext(spaceName, itemId, versionId);
-
-    Collection<ElementEntity> deletedElements =
-        deleteElements(context, versionContext, elementRepository);
-
-    ElementEntityContext changeRefContext = new ElementEntityContext(spaceName, itemId, versionId);
-    changeRefContext.setChangeRef(changeRef);
-
-    Collection<ElementEntity> createdElements =
-        copyElements(context, changeRefContext, versionContext, elementRepository);
-
-    // TODO: 4/19/2017 version change...
-    return createCollaborationMergeChange(versionContext, deletedElements, createdElements);
-  }
-
-  private Collection<ElementEntity> deleteElements(SessionContext context,
-                                                   ElementEntityContext elementContext,
-                                                   ElementRepository elementRepository) {
-    Collection<ElementEntity> elements = elementRepository.list(context, elementContext);
-    elements.forEach(element -> elementRepository
-        .delete(context, elementContext, new ElementEntity(element.getId())));
-    elementRepository.delete(context, elementContext, new ElementEntity(ROOT_ELEMENTS_PARENT_ID));
-    return elements;
-  }
-
-  private Collection<ElementEntity> copyElements(SessionContext context,
-                                                 ElementEntityContext sourceElementContext,
-                                                 ElementEntityContext targetElementContext,
-                                                 ElementRepository elementRepository) {
-    Collection<ElementEntity> elements = elementRepository.list(context, sourceElementContext);
-    elements.forEach(elementEntity ->
-        elementRepository.create(context, targetElementContext, elementEntity));
-    return elements;
-  }
-
-  private CollaborationMergeChange createCollaborationMergeChange(
-      ElementEntityContext versionContext,
-      Collection<ElementEntity> deletedElements,
-      Collection<ElementEntity> createdElements) {
-    CollaborationMergeChange mergeChange = new CollaborationMergeChange();
-    mergeChange.getChangedElements().addAll(
-        convertToCollaborationElementChanges(versionContext, deletedElements, Action.DELETE));
-    mergeChange.getChangedElements().addAll(
-        convertToCollaborationElementChanges(versionContext, createdElements, Action.CREATE));
-    return mergeChange;
-  }
-
-  private List<CollaborationElementChange> convertToCollaborationElementChanges(
-      ElementEntityContext elementContext, Collection<ElementEntity> changedElements,
-      Action action) {
-    return changedElements.stream()
-        .map(element -> convertToCollaborationElementChange(element, elementContext, action))
-        .collect(Collectors.toList());
-  }
-
-  private CollaborationElementChange convertToCollaborationElementChange(
-      ElementEntity elementEntity, ElementEntityContext elementContext, Action action) {
-    CollaborationElementChange elementChange = new CollaborationElementChange();
-    elementChange
-        .setElement(ZusammenPluginUtil.getCollaborationElement(elementContext, elementEntity));
-    elementChange.setAction(action);
-    return elementChange;
-  }
-
-  protected ElementRepository getElementRepository(SessionContext context) {
-    return ElementRepositoryFactory.getInstance().createInterface(context);
-  }
-}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/VersionPrivateStore.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/VersionPrivateStore.java
new file mode 100644
index 0000000..a024327
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/VersionPrivateStore.java
@@ -0,0 +1,38 @@
+package org.openecomp.core.zusammen.plugin.collaboration;
+
+import com.amdocs.zusammen.datatypes.Id;
+import com.amdocs.zusammen.datatypes.SessionContext;
+import org.openecomp.core.zusammen.plugin.dao.types.SynchronizationStateEntity;
+import org.openecomp.core.zusammen.plugin.dao.types.VersionEntity;
+
+import java.util.Date;
+import java.util.Optional;
+
+public interface VersionPrivateStore {
+  Optional<VersionEntity> get(SessionContext context, Id itemId, Id versionId);
+
+  Optional<SynchronizationStateEntity> getSynchronizationState(SessionContext context, Id itemId,
+                                                               Id versionId);
+
+  void create(SessionContext context, Id itemId, VersionEntity version);
+
+  void update(SessionContext context, Id itemId, VersionEntity version);
+
+  void update(SessionContext context, Id itemId, VersionEntity version, Date publishTime,
+              boolean dirty);
+
+  void delete(SessionContext context, Id itemId, VersionEntity version);
+
+  void markAsPublished(SessionContext context, Id itemId, Id versionId, Date publishTime);
+
+  void commitStagedCreate(SessionContext context, Id itemId, VersionEntity version,
+                          Date publishTime);
+
+  void commitStagedUpdate(SessionContext context, Id itemId, VersionEntity version,
+                          Date publishTime);
+
+  void commitStagedIgnore(SessionContext context, Id itemId, VersionEntity version,
+                          Date publishTime);
+
+
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/VersionPublicStore.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/VersionPublicStore.java
new file mode 100644
index 0000000..c86db0e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/VersionPublicStore.java
@@ -0,0 +1,29 @@
+package org.openecomp.core.zusammen.plugin.collaboration;
+
+import com.amdocs.zusammen.datatypes.Id;
+import com.amdocs.zusammen.datatypes.SessionContext;
+import com.amdocs.zusammen.datatypes.itemversion.ItemVersionRevisions;
+import org.openecomp.core.zusammen.plugin.dao.types.SynchronizationStateEntity;
+import org.openecomp.core.zusammen.plugin.dao.types.VersionEntity;
+
+import java.util.Date;
+import java.util.Map;
+import java.util.Optional;
+
+public interface VersionPublicStore {
+
+  Optional<VersionEntity> get(SessionContext context, Id itemId, Id versionId);
+
+  Optional<SynchronizationStateEntity> getSynchronizationState(SessionContext context,
+                                                               Id itemId, Id versionId);
+
+  void create(SessionContext context, Id itemId, VersionEntity version, Id revisionId,
+              Map<Id, Id> versionElementIds, Date publishTime, String message);
+
+  void update(SessionContext context, Id itemId, VersionEntity version, Id revisionId,
+              Map<Id, Id> versionElementIds, Date publishTime, String message);
+
+  boolean checkHealth(SessionContext context);
+
+  ItemVersionRevisions listItemVersionRevisions(SessionContext context, Id itemId, Id versionId);
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/VersionStageStore.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/VersionStageStore.java
new file mode 100644
index 0000000..5058a26
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/VersionStageStore.java
@@ -0,0 +1,18 @@
+package org.openecomp.core.zusammen.plugin.collaboration;
+
+import com.amdocs.zusammen.datatypes.Id;
+import com.amdocs.zusammen.datatypes.SessionContext;
+import org.openecomp.core.zusammen.plugin.dao.types.StageEntity;
+import org.openecomp.core.zusammen.plugin.dao.types.VersionEntity;
+
+import java.util.Optional;
+
+public interface VersionStageStore {
+
+  Optional<StageEntity<VersionEntity>> get(SessionContext context, Id itemId,
+                                           VersionEntity versionEntity);
+
+  void create(SessionContext context, Id itemId, StageEntity<VersionEntity> versionStage);
+
+  void delete(SessionContext context, Id itemId, VersionEntity version);
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/impl/ElementPrivateStoreImpl.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/impl/ElementPrivateStoreImpl.java
new file mode 100644
index 0000000..9f54ee3
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/impl/ElementPrivateStoreImpl.java
@@ -0,0 +1,269 @@
+package org.openecomp.core.zusammen.plugin.collaboration.impl;
+
+import com.amdocs.zusammen.datatypes.Id;
+import com.amdocs.zusammen.datatypes.SessionContext;
+import com.amdocs.zusammen.datatypes.item.ElementContext;
+import com.amdocs.zusammen.plugin.statestore.cassandra.dao.types.ElementEntityContext;
+import org.openecomp.core.zusammen.plugin.ZusammenPluginConstants;
+import org.openecomp.core.zusammen.plugin.collaboration.ElementPrivateStore;
+import org.openecomp.core.zusammen.plugin.dao.ElementRepository;
+import org.openecomp.core.zusammen.plugin.dao.ElementRepositoryFactory;
+import org.openecomp.core.zusammen.plugin.dao.ElementSynchronizationStateRepository;
+import org.openecomp.core.zusammen.plugin.dao.ElementSynchronizationStateRepositoryFactory;
+import org.openecomp.core.zusammen.plugin.dao.types.ElementEntity;
+import org.openecomp.core.zusammen.plugin.dao.types.SynchronizationStateEntity;
+
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
+import java.util.stream.Collectors;
+
+import static org.openecomp.core.zusammen.plugin.ZusammenPluginUtil.getPrivateElementContext;
+import static org.openecomp.core.zusammen.plugin.ZusammenPluginUtil.getPrivateSpaceName;
+
+public class ElementPrivateStoreImpl implements ElementPrivateStore {
+  private static final Id REVISION_ID = Id.ZERO; // the private revision id is Id.ZERO 0000000...
+
+  @Override
+  public Map<Id, Id> listIds(SessionContext context, ElementContext elementContext) {
+    return getElementRepository(context)
+        .listIds(context, new ElementEntityContext(getPrivateSpaceName(context), elementContext));
+  }
+
+  @Override
+  public Collection<ElementEntity> listSubs(SessionContext context, ElementContext elementContext,
+                                            Id elementId) {
+    if (elementId == null) {
+      elementId = ZusammenPluginConstants.ROOT_ELEMENTS_PARENT_ID;
+    }
+
+    ElementRepository elementRepository = getElementRepository(context);
+    ElementEntityContext privateContext =
+        new ElementEntityContext(getPrivateSpaceName(context), elementContext);
+    privateContext.setRevisionId(REVISION_ID);
+    return elementRepository.get(context, privateContext, new ElementEntity(elementId))
+        .map(ElementEntity::getSubElementIds).orElse(new HashSet<>()).stream()
+        .map(subElementId -> elementRepository
+            .get(context, privateContext, new ElementEntity(subElementId)).get())
+        .filter(Objects::nonNull)
+        .collect(Collectors.toList());
+  }
+
+  @Override
+  public Optional<ElementEntity> get(SessionContext context, ElementContext elementContext,
+                                     Id elementId) {
+    ElementEntityContext privateElementContext =
+        new ElementEntityContext(getPrivateSpaceName(context), elementContext);
+    privateElementContext.setRevisionId(REVISION_ID);
+    return getElementRepository(context)
+        .get(context, privateElementContext,
+            new ElementEntity(elementId));
+  }
+
+  @Override
+  public Optional<ElementEntity> getDescriptor(SessionContext context,
+                                               ElementContext elementContext, Id elementId) {
+    return getElementRepository(context)
+        .getDescriptor(context,
+            new ElementEntityContext(getPrivateSpaceName(context), getPrivateElementContext
+                (elementContext)),
+            new ElementEntity(elementId));
+  }
+
+  @Override
+  public Collection<SynchronizationStateEntity> listSynchronizationStates(SessionContext context,
+                                                                          ElementContext elementContext) {
+    ElementEntityContext privateElementContext =
+        new ElementEntityContext(getPrivateSpaceName(context), elementContext);
+    return getElementSyncStateRepository(context)
+        .list(context, privateElementContext);
+  }
+
+  @Override
+  public Optional<SynchronizationStateEntity> getSynchronizationState(SessionContext context,
+                                                                      ElementContext elementContext,
+                                                                      Id elementId) {
+
+    ElementEntityContext privateElementContext =
+        new ElementEntityContext(getPrivateSpaceName(context), getPrivateElementContext
+            (elementContext));
+    return getElementSyncStateRepository(context)
+        .get(context, privateElementContext,
+            new SynchronizationStateEntity(elementId, REVISION_ID));
+  }
+
+  @Override
+  public void create(SessionContext context, ElementContext elementContext, ElementEntity element) {
+    create(context, elementContext, element, true, null);
+  }
+
+  @Override
+  public boolean update(SessionContext context, ElementContext elementContext,
+                        ElementEntity element) {
+    ElementEntityContext privateContext =
+        new ElementEntityContext(getPrivateSpaceName(context), elementContext);
+    privateContext.setRevisionId(REVISION_ID);
+
+    if (!isElementChanged(context, privateContext, element)) {
+      return false;
+    }
+
+    getElementRepository(context).update(context, privateContext, element);
+    getElementSyncStateRepository(context).markAsDirty(context, privateContext,
+        new SynchronizationStateEntity(element.getId(), REVISION_ID));
+    return true;
+  }
+
+  @Override
+  public void delete(SessionContext context, ElementContext elementContext, ElementEntity element) {
+
+    ElementEntityContext privateElementContext =
+        new ElementEntityContext(getPrivateSpaceName(context), elementContext);
+    privateElementContext.setRevisionId(REVISION_ID);
+    deleteElementHierarchy(context, getElementRepository(context),
+        getElementSyncStateRepository(context),
+        privateElementContext, element);
+  }
+
+  @Override
+  public void markAsPublished(SessionContext context, ElementContext elementContext, Id elementId,
+                              Date publishTime) {
+    ElementEntityContext privateContext =
+        new ElementEntityContext(getPrivateSpaceName(context), elementContext);
+    privateContext.setRevisionId(REVISION_ID);
+    getElementSyncStateRepository(context).update(context,
+        privateContext,
+        new SynchronizationStateEntity(elementId, REVISION_ID, publishTime, false));
+  }
+
+  @Override
+  public void markDeletionAsPublished(SessionContext context, ElementContext elementContext,
+                                      Id elementId, Date publishTime) {
+
+    ElementEntityContext privateContext =
+        new ElementEntityContext(getPrivateSpaceName(context), elementContext);
+    privateContext.setRevisionId(REVISION_ID);
+    getElementSyncStateRepository(context).delete(context,
+        privateContext,
+        new SynchronizationStateEntity(elementId, REVISION_ID));
+  }
+
+  @Override
+  public void commitStagedCreate(SessionContext context, ElementContext elementContext,
+                                 ElementEntity element, Date publishTime) {
+    create(context, elementContext, element, false, publishTime);
+  }
+
+  @Override
+  public void commitStagedUpdate(SessionContext context, ElementContext elementContext,
+                                 ElementEntity element, Date publishTime) {
+    ElementEntityContext privateContext =
+        new ElementEntityContext(getPrivateSpaceName(context), elementContext);
+    privateContext.setRevisionId(REVISION_ID);
+
+    getElementRepository(context).update(context, privateContext, element);
+    // Currently Resolution='Other' is not supported so this is invoked after conflict was
+    // resolved with Resolution='Theirs' so dirty flag should be turned off.
+    // (if there was no conflict it's off anyway)
+    getElementSyncStateRepository(context).update(context, privateContext,
+        new SynchronizationStateEntity(element.getId(), REVISION_ID, publishTime, false));
+  }
+
+  @Override
+  public void commitStagedDelete(SessionContext context, ElementContext elementContext,
+                                 ElementEntity element) {
+    ElementEntityContext privateContext =
+        new ElementEntityContext(getPrivateSpaceName(context), elementContext);
+    privateContext.setRevisionId(REVISION_ID);
+    getElementRepository(context).delete(context, privateContext, element);
+    getElementSyncStateRepository(context)
+        .delete(context, privateContext,
+            new SynchronizationStateEntity(element.getId(), REVISION_ID));
+  }
+
+  @Override
+  public void commitStagedIgnore(SessionContext context, ElementContext elementContext,
+                                 ElementEntity element, Date publishTime) {
+    // publish time - updated to mark that this element was already synced with this publish time
+    // (even though the local data was preferred) and to prevent this conflict again.
+    // dirty - turned on because the local data which is different than the public one was
+    // preferred. It will enable future publication of this data.
+    getElementSyncStateRepository(context).update(context,
+        new ElementEntityContext(getPrivateSpaceName(context), elementContext),
+        new SynchronizationStateEntity(element.getId(), REVISION_ID, publishTime, true));
+  }
+
+  private void create(SessionContext context, ElementContext elementContext,
+                      ElementEntity element, boolean dirty, Date publishTime) {
+    ElementEntityContext privateContext =
+        new ElementEntityContext(getPrivateSpaceName(context), elementContext);
+    privateContext.setRevisionId(REVISION_ID);
+    getElementRepository(context).create(context, privateContext, element);
+    getElementSyncStateRepository(context).create(context, privateContext,
+        new SynchronizationStateEntity(element.getId(), REVISION_ID, publishTime, dirty));
+  }
+
+
+  private void deleteElementHierarchy(
+      SessionContext context, ElementRepository elementRepository,
+      ElementSynchronizationStateRepository elementSyncStateRepository,
+      ElementEntityContext elementContext, ElementEntity element) {
+
+    Optional<ElementEntity> retrieved = elementRepository.get(context, elementContext, element);
+    if (!retrieved.isPresent()) {
+      return;
+    }
+    retrieved.get().getSubElementIds().stream()
+        .map(ElementEntity::new)
+        .forEach(subElementEntity -> deleteElementHierarchy(
+            context, elementRepository, elementSyncStateRepository, elementContext,
+            subElementEntity));
+
+    // only for the first one the parentId will populated (so it'll be removed from its parent)
+    elementRepository.delete(context, elementContext, element);
+    handleDeletedElementSyncState(context, elementSyncStateRepository, elementContext, element);
+  }
+
+  private void handleDeletedElementSyncState(SessionContext context,
+                                             ElementSynchronizationStateRepository elementSyncStateRepository,
+                                             ElementEntityContext elementContext,
+                                             ElementEntity element) {
+    SynchronizationStateEntity elementSyncState = new SynchronizationStateEntity(element.getId(),
+        REVISION_ID);
+    if (elementSyncStateRepository.get(context, elementContext, elementSyncState).
+        orElseThrow(
+            () -> new IllegalStateException("Synchronization state must exist for an element"))
+        .getPublishTime() == null) {
+      elementSyncStateRepository.delete(context, elementContext, elementSyncState);
+    } else {
+      elementSyncStateRepository.markAsDirty(context, elementContext, elementSyncState);
+    }
+  }
+
+  private boolean isElementChanged(SessionContext context,
+                                   ElementEntityContext elementContext,
+                                   ElementEntity newElement) {
+    return getElementHash(context, elementContext, new ElementEntity(newElement.getId()))
+        .map(existingHash -> !newElement.getElementHash().equals(existingHash))
+        .orElse(true);
+  }
+
+  private Optional<Id> getElementHash(SessionContext context,
+                                      ElementEntityContext elementEntityContext,
+                                      ElementEntity element) {
+    return getElementRepository(context).getHash(context, elementEntityContext, element);
+  }
+
+  protected ElementRepository getElementRepository(SessionContext context) {
+    return ElementRepositoryFactory.getInstance().createInterface(context);
+  }
+
+  protected ElementSynchronizationStateRepository getElementSyncStateRepository(
+      SessionContext context) {
+    return ElementSynchronizationStateRepositoryFactory.getInstance().createInterface(context);
+  }
+
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/impl/ElementPublicStoreImpl.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/impl/ElementPublicStoreImpl.java
new file mode 100644
index 0000000..d946a52
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/impl/ElementPublicStoreImpl.java
@@ -0,0 +1,189 @@
+package org.openecomp.core.zusammen.plugin.collaboration.impl;
+
+import com.amdocs.zusammen.datatypes.Id;
+import com.amdocs.zusammen.datatypes.SessionContext;
+import com.amdocs.zusammen.datatypes.Space;
+import com.amdocs.zusammen.datatypes.item.ElementContext;
+import com.amdocs.zusammen.plugin.statestore.cassandra.dao.types.ElementEntityContext;
+import org.openecomp.core.zusammen.plugin.collaboration.ElementPublicStore;
+import org.openecomp.core.zusammen.plugin.dao.ElementRepository;
+import org.openecomp.core.zusammen.plugin.dao.ElementRepositoryFactory;
+import org.openecomp.core.zusammen.plugin.dao.ElementSynchronizationStateRepository;
+import org.openecomp.core.zusammen.plugin.dao.ElementSynchronizationStateRepositoryFactory;
+import org.openecomp.core.zusammen.plugin.dao.types.ElementEntity;
+import org.openecomp.core.zusammen.plugin.dao.types.SynchronizationStateEntity;
+
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Optional;
+
+import static org.openecomp.core.zusammen.plugin.ZusammenPluginUtil.getSpaceName;
+
+public class ElementPublicStoreImpl implements ElementPublicStore {
+
+  @Override
+  public Optional<ElementEntity> get(SessionContext context,
+                                     ElementContext elementContext, Id elementId) {
+    return getElementRepository(context)
+        .get(context, new ElementEntityContext(getSpaceName(context, Space.PUBLIC), elementContext),
+            new ElementEntity(elementId));
+  }
+
+  @Override
+  public Optional<ElementEntity> getDescriptor(SessionContext context,
+                                               ElementContext elementContext, Id elementId) {
+    return getElementRepository(context).getDescriptor(context,
+        new ElementEntityContext(getSpaceName(context, Space.PUBLIC), elementContext),
+        new ElementEntity(elementId));
+  }
+
+  @Override
+  public Collection<SynchronizationStateEntity> listSynchronizationStates(
+      SessionContext context, ElementContext elementContext) {
+    ElementEntityContext entityContext = new ElementEntityContext(getSpaceName
+        (context, Space.PUBLIC), elementContext);
+
+    ElementSynchronizationStateRepository elementSyncStateRepository =
+        getElementSyncStateRepository(context);
+    Map<Id, Id> ids = getElementRepository(context).listIds(context, entityContext);
+
+    Collection<SynchronizationStateEntity> synchronizationStateEntities = new HashSet<>();
+    for (Map.Entry<Id, Id> elementEntry : ids.entrySet()) {
+      Optional<SynchronizationStateEntity> synchronizationStateEntity = elementSyncStateRepository.
+          get(context, entityContext, new SynchronizationStateEntity(elementEntry.getKey(),
+              elementEntry.getValue()));
+      if (synchronizationStateEntity.isPresent()) {
+        synchronizationStateEntities.add(synchronizationStateEntity.get());
+      } else {
+        /*throw new IllegalStateException(String.format(
+            "list Synchronization States error: " + "element %s revision %s, which appears as an " +
+                "element of " +
+                "item" +
+                " %s version %s, does not exist",
+            elementEntry.getKey(), elementEntry.getValue(), elementContext.getItemId().getValue(),
+            elementContext.getVersionId().getValue()));*/
+      }
+    }
+
+    return synchronizationStateEntities;
+  }
+
+  @Override
+  public void create(SessionContext context, ElementContext elementContext,
+                     ElementEntity element, Date publishTime) {
+    ElementEntityContext publicContext =
+        new ElementEntityContext(getSpaceName(context, Space.PUBLIC), elementContext);
+
+
+    if (element.getParentId() != null) {
+      createParentElement(context, elementContext, element.getParentId(), publishTime);
+    }
+    getElementRepository(context).create(context, publicContext, element);
+    getElementSyncStateRepository(context).create(context, publicContext,
+        new SynchronizationStateEntity(element.getId(), elementContext.getRevisionId(),
+            publishTime, false));
+  }
+
+  @Override
+  public void update(SessionContext context, ElementContext elementContext,
+                     ElementEntity element, Date publishTime) {
+    //todo - update in public should be create new entry with new revision_id in public - this is a
+    // new revision
+    ElementEntityContext publicContext =
+        new ElementEntityContext(getSpaceName(context, Space.PUBLIC), elementContext);
+
+    Optional<ElementEntity> publicElement = getElementRepository(context).get(context,
+        publicContext, new ElementEntity(element.getId()));
+    if (publicElement.isPresent()) {
+      getElementRepository(context).update(context, publicContext, element);
+    } else {
+       publicElement = get(context,new ElementContext(publicContext.getItemId(),publicContext
+           .getVersionId()),element.getId());
+       element.setSubElementIds(publicElement.get().getSubElementIds());
+      getElementRepository(context).create(context, publicContext, element);
+    }
+    getElementSyncStateRepository(context).update(context, publicContext,
+        new SynchronizationStateEntity(element.getId(), elementContext.getRevisionId(), publishTime,
+            false));
+  }
+
+  @Override
+  public void delete(SessionContext context, ElementContext elementContext,
+                     ElementEntity element, Date publishTime) {
+    ElementEntityContext publicContext =
+        new ElementEntityContext(getSpaceName(context, Space.PUBLIC), elementContext);
+
+    if (element.getParentId() != null) {
+      Optional<ElementEntity> parentElement = get(context, elementContext, element.getParentId());
+      if (parentElement.isPresent()) {
+        createParentElement(context, elementContext, element.getParentId(), publishTime);
+      }
+    }
+
+    getElementRepository(context).delete(context, publicContext, element);
+    getElementSyncStateRepository(context)
+        .delete(context, publicContext, new SynchronizationStateEntity(element.getId(),
+            elementContext.getRevisionId()));
+  }
+
+  @Override
+  public Map<Id, Id> listIds(SessionContext context, ElementContext elementContext) {
+
+    return getElementRepository(context)
+        .listIds(context,
+            new ElementEntityContext(getSpaceName(context, Space.PUBLIC), elementContext));
+
+  }
+
+  private void createParentElement(SessionContext context, ElementContext elementContext,
+                                   Id parentElementId, Date publishTime
+  ) {
+    ElementEntityContext publicContext =
+        new ElementEntityContext(getSpaceName(context, Space.PUBLIC), elementContext);
+
+    Optional<ElementEntity> parentElement =
+        getElementRepository(context).get(context, new ElementEntityContext
+                (publicContext.getSpace(), publicContext.getItemId(), publicContext.getVersionId(),
+                    elementContext.getRevisionId()),
+            new ElementEntity(parentElementId));
+    if(parentElement.isPresent()) {
+      update(context, elementContext, parentElement.get(), publishTime);
+    }
+
+
+   /* Id elementRevisionId = getElementRevision(context, publicContext, elementContext.getRevisionId()
+        , parentElementId);
+
+    if (elementRevisionId != null && !elementRevisionId.equals(elementContext.getRevisionId())) {
+      Optional<ElementEntity> parentElement =
+          getElementRepository(context).get(context, new ElementEntityContext
+                  (publicContext.getSpace(), publicContext.getItemId(), publicContext.getVersionId(),
+                      elementContext.getRevisionId()),
+              new ElementEntity(parentElementId));
+      elementRevisionId = getElementRevision(context, publicContext, elementContext.getRevisionId()
+          , parentElement.get().getId());
+      if (elementRevisionId != null) {
+        update(context, elementContext, parentElement.get(), publishTime);
+      } else {
+        create(context, elementContext, parentElement.get(), publishTime);
+      }
+
+    }*/
+  }
+
+
+
+
+  protected ElementRepository getElementRepository(SessionContext context) {
+    return ElementRepositoryFactory.getInstance().createInterface(context);
+  }
+
+  protected ElementSynchronizationStateRepository getElementSyncStateRepository(
+      SessionContext context) {
+    return ElementSynchronizationStateRepositoryFactory.getInstance().createInterface(context);
+  }
+
+
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/impl/ElementStageStoreImpl.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/impl/ElementStageStoreImpl.java
new file mode 100644
index 0000000..f6c2943
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/impl/ElementStageStoreImpl.java
@@ -0,0 +1,133 @@
+package org.openecomp.core.zusammen.plugin.collaboration.impl;
+
+import com.amdocs.zusammen.datatypes.SessionContext;
+import com.amdocs.zusammen.datatypes.item.Action;
+import com.amdocs.zusammen.datatypes.item.ElementContext;
+import com.amdocs.zusammen.datatypes.item.Resolution;
+import com.amdocs.zusammen.plugin.statestore.cassandra.dao.types.ElementEntityContext;
+import org.openecomp.core.zusammen.plugin.collaboration.ElementStageStore;
+import org.openecomp.core.zusammen.plugin.dao.ElementStageRepository;
+import org.openecomp.core.zusammen.plugin.dao.ElementStageRepositoryFactory;
+import org.openecomp.core.zusammen.plugin.dao.types.ElementEntity;
+import org.openecomp.core.zusammen.plugin.dao.types.StageEntity;
+
+import java.util.Collection;
+import java.util.Optional;
+import java.util.stream.Collectors;
+
+import static org.openecomp.core.zusammen.plugin.ZusammenPluginUtil.getPrivateElementContext;
+import static org.openecomp.core.zusammen.plugin.ZusammenPluginUtil.getPrivateSpaceName;
+
+public class ElementStageStoreImpl implements ElementStageStore {
+
+  @Override
+  public Collection<ElementEntity> listIds(SessionContext context, ElementContext elementContext) {
+    return getElementStageRepository(context)
+        .listIds(context, new ElementEntityContext(getPrivateSpaceName(context),
+            getPrivateElementContext(elementContext)));
+  }
+
+  @Override
+  public Optional<StageEntity<ElementEntity>> get(SessionContext context,
+                                                  ElementContext elementContext,
+                                                  ElementEntity element) {
+    return getElementStageRepository(context).get(context,
+        new ElementEntityContext(getPrivateSpaceName(context),
+            getPrivateElementContext(elementContext)),
+        element);
+  }
+
+  @Override
+  public Optional<StageEntity<ElementEntity>> getConflicted(SessionContext context,
+                                                            ElementContext elementContext,
+                                                            ElementEntity element) {
+    return get(context, elementContext, element).filter(StageEntity::isConflicted);
+  }
+
+  @Override
+  public boolean hasConflicts(SessionContext context, ElementContext elementContext) {
+    return !getElementStageRepository(context).listConflictedIds(context,
+        new ElementEntityContext(getPrivateSpaceName(context), getPrivateElementContext(elementContext))).isEmpty();
+  }
+
+  @Override
+  public Collection<StageEntity<ElementEntity>> listConflictedDescriptors(SessionContext context,
+                                                                          ElementContext elementContext) {
+    ElementEntityContext privateContext =
+        new ElementEntityContext(getPrivateSpaceName(context), getPrivateElementContext
+            (elementContext));
+    ElementStageRepository elementStageRepository = getElementStageRepository(context);
+
+    return elementStageRepository.listConflictedIds(context, privateContext).stream()
+        .map(conflictedElement -> elementStageRepository
+            .getDescriptor(context, privateContext, conflictedElement).get())
+        .collect(Collectors.toList());
+  }
+
+  @Override
+  public void create(SessionContext context, ElementContext elementContext,
+                     StageEntity<ElementEntity> elementStage) {
+    getElementStageRepository(context)
+        .create(context,
+            new ElementEntityContext(getPrivateSpaceName(context), getPrivateElementContext(elementContext)),
+            elementStage);
+  }
+
+  @Override
+  public void delete(SessionContext context, ElementContext elementContext, ElementEntity element) {
+    getElementStageRepository(context)
+        .delete(context,
+            new ElementEntityContext(getPrivateSpaceName(context), getPrivateElementContext(elementContext)),
+            element);
+  }
+
+
+  @Override
+  public void resolveConflict(SessionContext context, ElementContext elementContext,
+                              ElementEntity element, Resolution resolution) {
+    Optional<StageEntity<ElementEntity>> stagedElement =
+        getConflicted(context, elementContext, element);
+    if (!stagedElement.isPresent()) {
+      return;
+    }
+
+    ElementEntityContext privateContext =
+        new ElementEntityContext(getPrivateSpaceName(context), getPrivateElementContext
+            (elementContext));
+
+    switch (resolution) {
+      case YOURS:
+        resolveConflictByYours(context, privateContext, stagedElement.get());
+        break;
+      case THEIRS:
+        resolveConflictByTheirs(context, privateContext, stagedElement.get());
+        break;
+      case OTHER: // other = data updates only? no data deletions? if so, then:
+        // conflicted = false
+        // element = the input of resolve
+        // action = update
+        throw new UnsupportedOperationException("'Other' conflict resolution is not yet supported");
+      default:
+        break;
+    }
+  }
+
+  private void resolveConflictByYours(SessionContext context, ElementEntityContext privateContext,
+                                      StageEntity<ElementEntity> stagedElement) {
+    getElementStageRepository(context)
+        .markAsNotConflicted(context, privateContext, stagedElement.getEntity(), Action.IGNORE);
+    stagedElement.getConflictDependents().forEach(conflictDependant ->
+        getElementStageRepository(context)
+            .markAsNotConflicted(context, privateContext, conflictDependant, Action.IGNORE));
+  }
+
+  private void resolveConflictByTheirs(SessionContext context, ElementEntityContext privateContext,
+                                       StageEntity<ElementEntity> stagedElement) {
+    getElementStageRepository(context)
+        .markAsNotConflicted(context, privateContext, stagedElement.getEntity());
+  }
+
+  protected ElementStageRepository getElementStageRepository(SessionContext context) {
+    return ElementStageRepositoryFactory.getInstance().createInterface(context);
+  }
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/impl/VersionPrivateStoreImpl.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/impl/VersionPrivateStoreImpl.java
new file mode 100644
index 0000000..11e61ab
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/impl/VersionPrivateStoreImpl.java
@@ -0,0 +1,117 @@
+package org.openecomp.core.zusammen.plugin.collaboration.impl;
+
+import com.amdocs.zusammen.datatypes.Id;
+import com.amdocs.zusammen.datatypes.SessionContext;
+import org.openecomp.core.zusammen.plugin.collaboration.VersionPrivateStore;
+import org.openecomp.core.zusammen.plugin.dao.VersionDao;
+import org.openecomp.core.zusammen.plugin.dao.VersionDaoFactory;
+import org.openecomp.core.zusammen.plugin.dao.VersionSynchronizationStateRepository;
+import org.openecomp.core.zusammen.plugin.dao.VersionSynchronizationStateRepositoryFactory;
+import org.openecomp.core.zusammen.plugin.dao.types.SynchronizationStateEntity;
+import org.openecomp.core.zusammen.plugin.dao.types.VersionContext;
+import org.openecomp.core.zusammen.plugin.dao.types.VersionEntity;
+
+import java.util.Date;
+import java.util.Optional;
+
+import static org.openecomp.core.zusammen.plugin.ZusammenPluginUtil.getPrivateSpaceName;
+
+public class VersionPrivateStoreImpl implements VersionPrivateStore {
+
+  Id revisionId = Id.ZERO;
+
+  @Override
+  public Optional<VersionEntity> get(SessionContext context, Id itemId, Id versionId) {
+    return getVersionDao(context).get(context, getPrivateSpaceName(context), itemId, versionId);
+  }
+
+  @Override
+  public Optional<SynchronizationStateEntity> getSynchronizationState(SessionContext context,
+                                                                      Id itemId, Id versionId) {
+
+    return getVersionSyncStateRepository(context)
+        .get(context, new VersionContext(getPrivateSpaceName(context), itemId),
+            new SynchronizationStateEntity(versionId, revisionId));
+  }
+
+  @Override
+  public void create(SessionContext context, Id itemId, VersionEntity version) {
+    String privateSpace = getPrivateSpaceName(context);
+
+
+    getVersionDao(context).create(context, privateSpace, itemId, version);
+    getVersionSyncStateRepository(context).create(context, new VersionContext(privateSpace,
+            itemId),
+        new SynchronizationStateEntity(version.getId(), revisionId, null, true));
+  }
+
+  @Override
+  public void update(SessionContext context, Id itemId, VersionEntity version) {
+
+    getVersionDao(context)
+        .updateModificationTime(context, getPrivateSpaceName(context), itemId, version.getId(),
+            version.getModificationTime());
+  }
+
+  @Override
+  public void update(SessionContext context, Id itemId, VersionEntity version, Date publishTime,
+                     boolean dirty) {
+    getVersionSyncStateRepository(context).updatePublishTime(context,
+        new VersionContext(getPrivateSpaceName(context), itemId),
+        new SynchronizationStateEntity(version.getId(), revisionId, publishTime, dirty));
+  }
+
+  @Override
+  public void delete(SessionContext context, Id itemId, VersionEntity version) {
+    String privateSpace = getPrivateSpaceName(context);
+
+    getVersionDao(context).delete(context, privateSpace, itemId, version.getId());
+    getVersionSyncStateRepository(context).delete(context, new VersionContext(privateSpace,
+            itemId),
+        new SynchronizationStateEntity(version.getId(), revisionId));
+  }
+
+  @Override
+  public void markAsPublished(SessionContext context, Id itemId, Id versionId, Date publishTime) {
+    getVersionSyncStateRepository(context)
+        .updatePublishTime(context, new VersionContext(getPrivateSpaceName(context), itemId),
+            new SynchronizationStateEntity(versionId, revisionId, publishTime, false));
+  }
+
+  @Override
+  public void commitStagedCreate(SessionContext context, Id itemId, VersionEntity version,
+                                 Date publishTime) {
+    String privateSpace = getPrivateSpaceName(context);
+
+    getVersionDao(context).create(context, privateSpace, itemId, version);
+    getVersionSyncStateRepository(context).create(context, new VersionContext(privateSpace,
+            itemId),
+        new SynchronizationStateEntity(version.getId(), revisionId, publishTime, false));
+  }
+
+  @Override
+  public void commitStagedUpdate(SessionContext context, Id itemId, VersionEntity version,
+                                 Date publishTime) {
+    update(context, itemId, version, publishTime, false);
+  }
+
+  @Override
+  public void commitStagedIgnore(SessionContext context, Id itemId, VersionEntity version,
+                                 Date publishTime) {
+    getVersionSyncStateRepository(context).updatePublishTime(context,
+        new VersionContext(getPrivateSpaceName(context), itemId),
+        new SynchronizationStateEntity(version.getId(), revisionId, publishTime, false));
+  }
+
+
+
+
+  protected VersionDao getVersionDao(SessionContext context) {
+    return VersionDaoFactory.getInstance().createInterface(context);
+  }
+
+  protected VersionSynchronizationStateRepository getVersionSyncStateRepository(
+      SessionContext context) {
+    return VersionSynchronizationStateRepositoryFactory.getInstance().createInterface(context);
+  }
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/impl/VersionPublicStoreImpl.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/impl/VersionPublicStoreImpl.java
new file mode 100644
index 0000000..aa628eb
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/impl/VersionPublicStoreImpl.java
@@ -0,0 +1,135 @@
+package org.openecomp.core.zusammen.plugin.collaboration.impl;
+
+import com.amdocs.zusammen.datatypes.Id;
+import com.amdocs.zusammen.datatypes.SessionContext;
+import com.amdocs.zusammen.datatypes.Space;
+import com.amdocs.zusammen.datatypes.itemversion.ItemVersionRevisions;
+import com.amdocs.zusammen.datatypes.itemversion.Revision;
+import org.openecomp.core.zusammen.plugin.collaboration.VersionPublicStore;
+import org.openecomp.core.zusammen.plugin.dao.VersionDao;
+import org.openecomp.core.zusammen.plugin.dao.VersionDaoFactory;
+import org.openecomp.core.zusammen.plugin.dao.VersionSynchronizationStateRepository;
+import org.openecomp.core.zusammen.plugin.dao.VersionSynchronizationStateRepositoryFactory;
+import org.openecomp.core.zusammen.plugin.dao.types.SynchronizationStateEntity;
+import org.openecomp.core.zusammen.plugin.dao.types.VersionContext;
+import org.openecomp.core.zusammen.plugin.dao.types.VersionEntity;
+
+import java.util.Comparator;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+
+import static org.openecomp.core.zusammen.plugin.ZusammenPluginUtil.getSpaceName;
+
+public class VersionPublicStoreImpl implements VersionPublicStore {
+  @Override
+  public Optional<VersionEntity> get(SessionContext context, Id itemId, Id versionId) {
+    return getVersionDao(context)
+        .get(context, getSpaceName(context, Space.PUBLIC), itemId, versionId);
+  }
+
+  @Override
+  public Optional<SynchronizationStateEntity> getSynchronizationState(SessionContext context,
+                                                                      Id itemId, Id versionId) {
+    Id revisionId = getLastItemVersionRevision(context, itemId,
+        versionId);
+    if (revisionId == null) {
+      return Optional.empty();
+    }
+
+    return getVersionSyncStateRepository(context)
+        .get(context, new VersionContext(getSpaceName(context, Space.PUBLIC), itemId),
+            new SynchronizationStateEntity(versionId, revisionId));
+  }
+
+
+  @Override
+  public void create(SessionContext context, Id itemId, VersionEntity version, Id revisionId,
+                     Map<Id, Id> versionElementIds, Date
+                         publishTime, String message) {
+    String publicSpace = getSpaceName(context, Space.PUBLIC);
+
+    getVersionDao(context).create(context, publicSpace, itemId, version);
+
+    getVersionDao(context).createVersionElements(context, publicSpace, itemId, version.getId(),
+        revisionId, versionElementIds, publishTime,message);
+
+    getVersionSyncStateRepository(context).create(context, new VersionContext(publicSpace,
+            itemId),
+        new SynchronizationStateEntity(version.getId(), revisionId, publishTime, false));
+  }
+
+  @Override
+  public void update(SessionContext context, Id itemId, VersionEntity version,
+                     Id revisionId, Map<Id, Id> versionElementIds, Date publishTime, String message) {
+    String publicSpace = getSpaceName(context, Space.PUBLIC);
+
+    getVersionDao(context).
+        createVersionElements(context, publicSpace, itemId, version.getId(),
+            revisionId, versionElementIds, publishTime,message);
+
+    getVersionSyncStateRepository(context).
+        updatePublishTime(context, new VersionContext(publicSpace, itemId),
+            new SynchronizationStateEntity(version.getId(), revisionId, publishTime, false));
+  }
+
+  @Override
+  public boolean checkHealth(SessionContext context) {
+    return getVersionDao(context).checkHealth(context);
+  }
+
+  @Override
+  public ItemVersionRevisions listItemVersionRevisions(SessionContext context, Id itemId,
+                                                       Id versionId) {
+    VersionContext entityContext = new VersionContext(getSpaceName(context, Space.PUBLIC), itemId);
+    List<SynchronizationStateEntity> versionRevisions = getVersionSyncStateRepository(context)
+        .list(context, entityContext, new VersionEntity(versionId));
+
+    if (versionRevisions == null || versionRevisions.size() == 0) {
+      return null;
+    }
+
+    versionRevisions.sort(new Comparator<SynchronizationStateEntity>() {
+      @Override
+      public int compare(SynchronizationStateEntity o1, SynchronizationStateEntity o2) {
+        if (o1.getPublishTime().after(o2.getPublishTime())) {
+          return -1;
+        } else {
+          return 1;
+        }
+      }
+    });
+    ItemVersionRevisions itemVersionRevisions = new ItemVersionRevisions();
+    versionRevisions.forEach(synchronizationStateEntity -> itemVersionRevisions.addChange
+        (convertSyncState2Revision(synchronizationStateEntity)));
+    return itemVersionRevisions;
+  }
+
+  private Revision convertSyncState2Revision(
+      SynchronizationStateEntity synchronizationStateEntity) {
+    Revision revision = new Revision();
+    revision.setRevisionId(synchronizationStateEntity.getRevisionId());
+    revision.setTime(synchronizationStateEntity.getPublishTime());
+    revision.setMessage(synchronizationStateEntity.getMessage());
+    revision.setUser(synchronizationStateEntity.getUser());
+    return revision;
+  }
+
+
+  private Id getLastItemVersionRevision(SessionContext context, Id itemId, Id versionId) {
+
+    ItemVersionRevisions versionRevisions = listItemVersionRevisions(context, itemId, versionId);
+    if(versionRevisions ==null ) return null;
+    return versionRevisions.getItemVersionRevisions().get(0).getRevisionId();
+  }
+
+  protected VersionDao getVersionDao(SessionContext context) {
+    return VersionDaoFactory.getInstance().createInterface(context);
+  }
+
+  protected VersionSynchronizationStateRepository getVersionSyncStateRepository(
+      SessionContext context) {
+    return VersionSynchronizationStateRepositoryFactory.getInstance().createInterface(context);
+  }
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/impl/VersionStageStoreImpl.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/impl/VersionStageStoreImpl.java
new file mode 100644
index 0000000..dac9d25
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/collaboration/impl/VersionStageStoreImpl.java
@@ -0,0 +1,39 @@
+package org.openecomp.core.zusammen.plugin.collaboration.impl;
+
+import com.amdocs.zusammen.datatypes.Id;
+import com.amdocs.zusammen.datatypes.SessionContext;
+import org.openecomp.core.zusammen.plugin.collaboration.VersionStageStore;
+import org.openecomp.core.zusammen.plugin.dao.VersionStageRepository;
+import org.openecomp.core.zusammen.plugin.dao.VersionStageRepositoryFactory;
+import org.openecomp.core.zusammen.plugin.dao.types.StageEntity;
+import org.openecomp.core.zusammen.plugin.dao.types.VersionContext;
+import org.openecomp.core.zusammen.plugin.dao.types.VersionEntity;
+
+import java.util.Optional;
+
+import static org.openecomp.core.zusammen.plugin.ZusammenPluginUtil.getPrivateSpaceName;
+
+public class VersionStageStoreImpl implements VersionStageStore {
+  @Override
+  public Optional<StageEntity<VersionEntity>> get(SessionContext context, Id itemId,
+                                                  VersionEntity versionEntity) {
+    return getVersionStageRepository(context)
+        .get(context, new VersionContext(getPrivateSpaceName(context), itemId), versionEntity);
+  }
+
+  @Override
+  public void create(SessionContext context, Id itemId, StageEntity<VersionEntity> versionStage) {
+    getVersionStageRepository(context)
+        .create(context, new VersionContext(getPrivateSpaceName(context), itemId), versionStage);
+  }
+
+  @Override
+  public void delete(SessionContext context, Id itemId, VersionEntity version) {
+    getVersionStageRepository(context)
+        .delete(context, new VersionContext(getPrivateSpaceName(context), itemId), version);
+  }
+
+  protected VersionStageRepository getVersionStageRepository(SessionContext context) {
+    return VersionStageRepositoryFactory.getInstance().createInterface(context);
+  }
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/ElementRepository.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/ElementRepository.java
index 967814c..7681327 100644
--- a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/ElementRepository.java
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/ElementRepository.java
@@ -1,15 +1,18 @@
 package org.openecomp.core.zusammen.plugin.dao;
 
+import com.amdocs.zusammen.datatypes.Id;
 import com.amdocs.zusammen.datatypes.SessionContext;
 import com.amdocs.zusammen.plugin.statestore.cassandra.dao.types.ElementEntityContext;
 import org.openecomp.core.zusammen.plugin.dao.types.ElementEntity;
 
-import java.util.Collection;
+import java.util.Map;
 import java.util.Optional;
 
 public interface ElementRepository {
 
-  Collection<ElementEntity> list(SessionContext context, ElementEntityContext elementContext);
+  Map<Id,Id> listIds(SessionContext context, ElementEntityContext elementContext);
+
+/*  void createVersionData(SessionContext context, ElementEntityContext elementContext, VersionDataElement element);*/
 
   void create(SessionContext context, ElementEntityContext elementContext, ElementEntity element);
 
@@ -20,8 +23,28 @@
   Optional<ElementEntity> get(SessionContext context, ElementEntityContext elementContext,
                               ElementEntity element);
 
+  Optional<ElementEntity> getDescriptor(SessionContext context, ElementEntityContext elementContext,
+                                        ElementEntity element);
+
   void createNamespace(SessionContext context, ElementEntityContext elementContext,
                        ElementEntity element);
 
-  boolean checkHealth(SessionContext context);
+  Optional<Id> getHash(SessionContext context, ElementEntityContext elementEntityContext,
+               ElementEntity element);
+
+
+
+
+/*  Collection<SynchronizationStateEntity> listSynchronizationStates(SessionContext context,
+                                              ElementEntityContext elementContext);
+
+  void updateSynchronizationState(SessionContext context, ElementEntityContext elementContext,
+              SynchronizationStateEntity elementSyncState);
+
+  void markAsDirty(SessionContext context, ElementEntityContext elementContext,
+                   SynchronizationStateEntity elementSyncState);
+
+  Optional<SynchronizationStateEntity> getSynchronizationState(SessionContext context,
+                                           ElementEntityContext elementContext,
+                                           SynchronizationStateEntity elementSyncState);*/
 }
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/ElementStageRepository.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/ElementStageRepository.java
new file mode 100644
index 0000000..ac3dc4e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/ElementStageRepository.java
@@ -0,0 +1,34 @@
+package org.openecomp.core.zusammen.plugin.dao;
+
+import com.amdocs.zusammen.datatypes.SessionContext;
+import com.amdocs.zusammen.datatypes.item.Action;
+import com.amdocs.zusammen.plugin.statestore.cassandra.dao.types.ElementEntityContext;
+import org.openecomp.core.zusammen.plugin.dao.types.ElementEntity;
+import org.openecomp.core.zusammen.plugin.dao.types.StageEntity;
+
+import java.util.Collection;
+import java.util.Optional;
+
+public interface ElementStageRepository
+    extends StageRepository<ElementEntityContext, ElementEntity> {
+
+  Optional<StageEntity<ElementEntity>> getDescriptor(SessionContext context,
+                                                     ElementEntityContext elementContext,
+                                                     ElementEntity element);
+
+  Collection<ElementEntity> listIds(SessionContext context,
+                                    ElementEntityContext elementContext);
+
+  Collection<ElementEntity> listConflictedIds(SessionContext context,
+                                              ElementEntityContext elementContext);
+
+  void markAsNotConflicted(SessionContext context, ElementEntityContext entityContext,
+                           ElementEntity entity, Action action);
+
+  void markAsNotConflicted(SessionContext context, ElementEntityContext entityContext,
+                           ElementEntity entity);
+
+  void update(SessionContext context, ElementEntityContext entityContext, ElementEntity entity,
+              Action action, boolean conflicted);
+
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/ElementStageRepositoryFactory.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/ElementStageRepositoryFactory.java
new file mode 100644
index 0000000..1e41308
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/ElementStageRepositoryFactory.java
@@ -0,0 +1,14 @@
+package org.openecomp.core.zusammen.plugin.dao;
+
+import com.amdocs.zusammen.datatypes.SessionContext;
+import com.amdocs.zusammen.utils.facade.api.AbstractComponentFactory;
+import com.amdocs.zusammen.utils.facade.api.AbstractFactory;
+
+public abstract class ElementStageRepositoryFactory
+    extends AbstractComponentFactory<ElementStageRepository> {
+  public static ElementStageRepositoryFactory getInstance() {
+    return AbstractFactory.getInstance(ElementStageRepositoryFactory.class);
+  }
+
+  public abstract ElementStageRepository createInterface(SessionContext context);
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/ElementSynchronizationStateRepository.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/ElementSynchronizationStateRepository.java
new file mode 100644
index 0000000..53c029b
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/ElementSynchronizationStateRepository.java
@@ -0,0 +1,21 @@
+package org.openecomp.core.zusammen.plugin.dao;
+
+import com.amdocs.zusammen.datatypes.SessionContext;
+import com.amdocs.zusammen.plugin.statestore.cassandra.dao.types.ElementEntityContext;
+import org.openecomp.core.zusammen.plugin.dao.types.SynchronizationStateEntity;
+
+import java.util.Collection;
+
+public interface ElementSynchronizationStateRepository
+    extends SynchronizationStateRepository<ElementEntityContext> {
+
+  Collection<SynchronizationStateEntity> list(SessionContext context,
+                                              ElementEntityContext elementContext);
+
+  void update(SessionContext context, ElementEntityContext entityContext,
+              SynchronizationStateEntity syncStateEntity);
+
+  void markAsDirty(SessionContext context, ElementEntityContext entityContext,
+                   SynchronizationStateEntity syncStateEntity);
+
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/ElementSynchronizationStateRepositoryFactory.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/ElementSynchronizationStateRepositoryFactory.java
new file mode 100644
index 0000000..26f3bb4
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/ElementSynchronizationStateRepositoryFactory.java
@@ -0,0 +1,14 @@
+package org.openecomp.core.zusammen.plugin.dao;
+
+import com.amdocs.zusammen.datatypes.SessionContext;
+import com.amdocs.zusammen.utils.facade.api.AbstractComponentFactory;
+import com.amdocs.zusammen.utils.facade.api.AbstractFactory;
+
+public abstract class ElementSynchronizationStateRepositoryFactory
+    extends AbstractComponentFactory<ElementSynchronizationStateRepository> {
+  public static ElementSynchronizationStateRepositoryFactory getInstance() {
+    return AbstractFactory.getInstance(ElementSynchronizationStateRepositoryFactory.class);
+  }
+
+  public abstract ElementSynchronizationStateRepository createInterface(SessionContext context);
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/StageRepository.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/StageRepository.java
new file mode 100644
index 0000000..98b0d82
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/StageRepository.java
@@ -0,0 +1,15 @@
+package org.openecomp.core.zusammen.plugin.dao;
+
+import com.amdocs.zusammen.datatypes.SessionContext;
+import org.openecomp.core.zusammen.plugin.dao.types.StageEntity;
+
+import java.util.Optional;
+
+public interface StageRepository<C, E> {
+
+  Optional<StageEntity<E>> get(SessionContext context, C entityContext, E entity);
+
+  void create(SessionContext context, C entityContext, StageEntity<E> stageEntity);
+
+  void delete(SessionContext context, C entityContext, E entity);
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/SynchronizationStateRepository.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/SynchronizationStateRepository.java
new file mode 100644
index 0000000..f227b0c
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/SynchronizationStateRepository.java
@@ -0,0 +1,16 @@
+package org.openecomp.core.zusammen.plugin.dao;
+
+import com.amdocs.zusammen.datatypes.SessionContext;
+import org.openecomp.core.zusammen.plugin.dao.types.SynchronizationStateEntity;
+
+import java.util.Optional;
+
+public interface SynchronizationStateRepository<C> {
+
+  void create(SessionContext context, C entityContext, SynchronizationStateEntity syncStateEntity);
+
+  void delete(SessionContext context, C entityContext, SynchronizationStateEntity syncStateEntity);
+
+  Optional<SynchronizationStateEntity> get(SessionContext context, C entityContext,
+                                           SynchronizationStateEntity syncStateEntity);
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/VersionDao.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/VersionDao.java
new file mode 100644
index 0000000..f8ad040
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/VersionDao.java
@@ -0,0 +1,29 @@
+package org.openecomp.core.zusammen.plugin.dao;
+
+
+import com.amdocs.zusammen.datatypes.Id;
+import com.amdocs.zusammen.datatypes.SessionContext;
+import org.openecomp.core.zusammen.plugin.dao.types.VersionEntity;
+
+import java.util.Collection;
+import java.util.Date;
+import java.util.Map;
+import java.util.Optional;
+
+public interface VersionDao {
+  Collection<VersionEntity> list(SessionContext context, String space, Id itemId);
+
+  Optional<VersionEntity> get(SessionContext context, String space, Id itemId, Id versionId);
+
+  void create(SessionContext context, String space, Id itemId, VersionEntity version);
+
+  void updateModificationTime(SessionContext context, String space, Id itemId, Id versionId, Date modificationTime);
+
+  void delete(SessionContext context, String space, Id itemId, Id versionId);
+
+  boolean checkHealth(SessionContext context);
+
+  void createVersionElements(SessionContext context, String publicSpace, Id itemId, Id versionId,
+                             Id revisionId, Map<Id, Id> versionElementIds, Date publishTime,
+                             String message);
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/VersionDaoFactory.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/VersionDaoFactory.java
new file mode 100644
index 0000000..2847959
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/VersionDaoFactory.java
@@ -0,0 +1,13 @@
+package org.openecomp.core.zusammen.plugin.dao;
+
+import com.amdocs.zusammen.datatypes.SessionContext;
+import com.amdocs.zusammen.utils.facade.api.AbstractComponentFactory;
+import com.amdocs.zusammen.utils.facade.api.AbstractFactory;
+
+public abstract class VersionDaoFactory extends AbstractComponentFactory<VersionDao> {
+  public static VersionDaoFactory getInstance() {
+    return AbstractFactory.getInstance(VersionDaoFactory.class);
+  }
+
+  public abstract VersionDao createInterface(SessionContext context);
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/VersionStageRepository.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/VersionStageRepository.java
new file mode 100644
index 0000000..568e0c9
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/VersionStageRepository.java
@@ -0,0 +1,9 @@
+package org.openecomp.core.zusammen.plugin.dao;
+
+
+import org.openecomp.core.zusammen.plugin.dao.types.VersionContext;
+import org.openecomp.core.zusammen.plugin.dao.types.VersionEntity;
+
+public interface VersionStageRepository extends StageRepository<VersionContext, VersionEntity> {
+
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/VersionStageRepositoryFactory.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/VersionStageRepositoryFactory.java
new file mode 100644
index 0000000..fc9e772
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/VersionStageRepositoryFactory.java
@@ -0,0 +1,13 @@
+package org.openecomp.core.zusammen.plugin.dao;
+
+import com.amdocs.zusammen.datatypes.SessionContext;
+import com.amdocs.zusammen.utils.facade.api.AbstractComponentFactory;
+import com.amdocs.zusammen.utils.facade.api.AbstractFactory;
+
+public abstract class VersionStageRepositoryFactory extends AbstractComponentFactory<VersionStageRepository> {
+  public static VersionStageRepositoryFactory getInstance() {
+    return AbstractFactory.getInstance(VersionStageRepositoryFactory.class);
+  }
+
+  public abstract VersionStageRepository createInterface(SessionContext context);
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/VersionSynchronizationStateRepository.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/VersionSynchronizationStateRepository.java
new file mode 100644
index 0000000..9134392
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/VersionSynchronizationStateRepository.java
@@ -0,0 +1,18 @@
+package org.openecomp.core.zusammen.plugin.dao;
+
+import com.amdocs.zusammen.datatypes.SessionContext;
+import org.openecomp.core.zusammen.plugin.dao.types.SynchronizationStateEntity;
+import org.openecomp.core.zusammen.plugin.dao.types.VersionContext;
+import org.openecomp.core.zusammen.plugin.dao.types.VersionEntity;
+
+import java.util.List;
+
+public interface VersionSynchronizationStateRepository
+    extends SynchronizationStateRepository<VersionContext> {
+
+  void updatePublishTime(SessionContext context, VersionContext entityContext,
+                         SynchronizationStateEntity syncStateEntity);
+
+  List<SynchronizationStateEntity> list(SessionContext context, VersionContext entityContext,
+                                                  VersionEntity versionEntity);
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/VersionSynchronizationStateRepositoryFactory.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/VersionSynchronizationStateRepositoryFactory.java
new file mode 100644
index 0000000..dfedb58
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/VersionSynchronizationStateRepositoryFactory.java
@@ -0,0 +1,14 @@
+package org.openecomp.core.zusammen.plugin.dao;
+
+import com.amdocs.zusammen.datatypes.SessionContext;
+import com.amdocs.zusammen.utils.facade.api.AbstractComponentFactory;
+import com.amdocs.zusammen.utils.facade.api.AbstractFactory;
+
+public abstract class VersionSynchronizationStateRepositoryFactory
+    extends AbstractComponentFactory<VersionSynchronizationStateRepository> {
+  public static VersionSynchronizationStateRepositoryFactory getInstance() {
+    return AbstractFactory.getInstance(VersionSynchronizationStateRepositoryFactory.class);
+  }
+
+  public abstract VersionSynchronizationStateRepository createInterface(SessionContext context);
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/impl/CassandraElementRepository.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/impl/CassandraElementRepository.java
deleted file mode 100644
index 6cc1350..0000000
--- a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/impl/CassandraElementRepository.java
+++ /dev/null
@@ -1,375 +0,0 @@
-/*
- * Copyright © 2016-2017 European Support Limited
- *
- * 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.
- */
-
-package org.openecomp.core.zusammen.plugin.dao.impl;
-
-import com.amdocs.zusammen.datatypes.Id;
-import com.amdocs.zusammen.datatypes.Namespace;
-import com.amdocs.zusammen.datatypes.SessionContext;
-import com.amdocs.zusammen.datatypes.item.Info;
-import com.amdocs.zusammen.datatypes.item.Relation;
-import com.amdocs.zusammen.plugin.statestore.cassandra.dao.types.ElementEntityContext;
-import com.amdocs.zusammen.utils.fileutils.json.JsonUtil;
-import com.datastax.driver.core.ResultSet;
-import com.datastax.driver.core.Row;
-import com.datastax.driver.mapping.annotations.Accessor;
-import com.datastax.driver.mapping.annotations.Param;
-import com.datastax.driver.mapping.annotations.Query;
-import com.google.gson.reflect.TypeToken;
-import org.openecomp.core.zusammen.plugin.dao.ElementRepository;
-import org.openecomp.core.zusammen.plugin.dao.types.ElementEntity;
-
-import java.lang.reflect.Type;
-import java.nio.ByteBuffer;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Optional;
-import java.util.Set;
-import java.util.stream.Collectors;
-
-public class CassandraElementRepository implements ElementRepository {
-
-  private static final String VERSION_ELEMENT_NOT_EXIST_ERROR_MSG =
-      "List version elements error: " +
-          "element %s, which appears as an element of item %s version %s, does not exist";
-
-  @Override
-  public Collection<ElementEntity> list(SessionContext context,
-                                        ElementEntityContext elementContext) {
-    Set<String> elementIds = getVersionElementIds(context, elementContext);
-
-    Collection<ElementEntity> elements = new ArrayList<>();
-    for (String elementId : elementIds) {
-      elements.add(get(context, elementContext, new ElementEntity(new Id(elementId)))
-          .orElseThrow(
-              () -> new IllegalStateException(String.format(VERSION_ELEMENT_NOT_EXIST_ERROR_MSG,
-                  elementId, elementContext.getItemId().getValue(),
-                  getVersionId(elementContext)))));
-    }
-    return elements;
-  }
-
-  @Override
-  public void create(SessionContext context, ElementEntityContext elementContext,
-                     ElementEntity element) {
-    createElement(context, elementContext, element);
-    addElementToParent(context, elementContext, element);
-  }
-
-  @Override
-  public void update(SessionContext context, ElementEntityContext elementContext,
-                     ElementEntity element) {
-    updateElement(context, elementContext, element);
-  }
-
-  @Override
-  public void delete(SessionContext context, ElementEntityContext elementContext,
-                     ElementEntity element) {
-    removeElementFromParent(context, elementContext, element);
-    deleteElement(context, elementContext, element);
-  }
-
-  @Override
-  public Optional<ElementEntity> get(SessionContext context, ElementEntityContext elementContext,
-                                     ElementEntity element) {
-    Row row = getElementAccessor(context).get(
-        elementContext.getSpace(),
-        elementContext.getItemId().toString(),
-        getVersionId(elementContext),
-        element.getId().toString()).one();
-
-    return row == null ? Optional.empty() : Optional.of(getElementEntity(element, row));
-  }
-
-  @Override
-  public void createNamespace(SessionContext context, ElementEntityContext elementContext,
-                              ElementEntity element) {
-    getElementNamespaceAccessor(context).create(
-        elementContext.getSpace(),
-        elementContext.getItemId().toString(),
-        element.getId().toString(),
-        element.getNamespace().toString());
-  }
-
-  @Override
-  public boolean checkHealth(SessionContext context) {
-    ResultSet resultSet = getVersionElementsAccessor(context).checkHealth();
-    return resultSet.getColumnDefinitions().contains("element_ids");
-  }
-
-  private String getVersionId(ElementEntityContext elementContext) {
-    return elementContext.getChangeRef() == null
-        ? elementContext.getVersionId().toString()
-        : elementContext.getChangeRef();
-  }
-
-  private ElementNamespaceAccessor getElementNamespaceAccessor(SessionContext context) {
-    return CassandraDaoUtils.getAccessor(context, ElementNamespaceAccessor.class);
-  }
-
-  private ElementAccessor getElementAccessor(SessionContext context) {
-    return CassandraDaoUtils.getAccessor(context, ElementAccessor.class);
-  }
-
-  private VersionElementsAccessor getVersionElementsAccessor(SessionContext context) {
-    return CassandraDaoUtils.getAccessor(context, VersionElementsAccessor.class);
-  }
-
-  private void createElement(SessionContext context, ElementEntityContext elementContext,
-                             ElementEntity element) {
-    Set<String> subElementIds =
-        element.getSubElementIds().stream().map(Id::toString).collect(Collectors.toSet());
-    String versionId = getVersionId(elementContext);
-
-    getElementAccessor(context).create(
-        elementContext.getSpace(),
-        elementContext.getItemId().toString(),
-        versionId,
-        element.getId().toString(),
-        element.getParentId().toString(),
-        element.getNamespace().toString(),
-        JsonUtil.object2Json(element.getInfo()),
-        JsonUtil.object2Json(element.getRelations()),
-        element.getData(),
-        element.getSearchableData(),
-        element.getVisualization(),
-        subElementIds);
-
-    getVersionElementsAccessor(context).addElements(
-        Collections.singleton(element.getId().toString()),
-        elementContext.getSpace(),
-        elementContext.getItemId().toString(),
-        versionId);
-  }
-
-  private void updateElement(SessionContext context, ElementEntityContext elementContext,
-                             ElementEntity element) {
-    getElementAccessor(context).update(
-        JsonUtil.object2Json(element.getInfo()),
-        JsonUtil.object2Json(element.getRelations()),
-        element.getData(),
-        element.getSearchableData(),
-        element.getVisualization(),
-        elementContext.getSpace(),
-        elementContext.getItemId().toString(),
-        elementContext.getVersionId().toString(),
-        element.getId().toString());
-  }
-
-  private void deleteElement(SessionContext context, ElementEntityContext elementContext,
-                             ElementEntity element) {
-    String versionId = getVersionId(elementContext);
-
-    getElementAccessor(context).delete(
-        elementContext.getSpace(),
-        elementContext.getItemId().toString(),
-        versionId,
-        element.getId().toString());
-
-    getVersionElementsAccessor(context).removeElements(
-        Collections.singleton(element.getId().toString()),
-        elementContext.getSpace(),
-        elementContext.getItemId().toString(),
-        versionId);
-  }
-
-  private void addElementToParent(SessionContext context, ElementEntityContext elementContext,
-                                  ElementEntity element) {
-    getElementAccessor(context).addSubElements(
-        Collections.singleton(element.getId().toString()),
-        elementContext.getSpace(),
-        elementContext.getItemId().toString(),
-        getVersionId(elementContext),
-        element.getParentId().toString());
-  }
-
-  private void removeElementFromParent(SessionContext context, ElementEntityContext elementContext,
-                                       ElementEntity element) {
-    if (element.getParentId() == null) {
-      return;
-    }
-    getElementAccessor(context).removeSubElements(
-        Collections.singleton(element.getId().toString()),
-        elementContext.getSpace(),
-        elementContext.getItemId().toString(),
-        getVersionId(elementContext),
-        element.getParentId().toString());
-  }
-
-  private ElementEntity getElementEntity(ElementEntity element, Row row) {
-    element.setNamespace(getNamespace(row.getString(ElementField.NAMESPACE)));
-    element.setParentId(new Id(row.getString(ElementField.PARENT_ID)));
-    element.setInfo(json2Object(row.getString(ElementField.INFO), Info.class));
-    element.setRelations(
-        json2Object(row.getString(ElementField.RELATIONS), new TypeToken<ArrayList<Relation>>() {
-        }.getType()));
-    element.setData(row.getBytes(ElementField.DATA));
-    element.setSearchableData(row.getBytes(ElementField.SEARCHABLE_DATA));
-    element.setVisualization(row.getBytes(ElementField.VISUALIZATION));
-    element.setSubElementIds(row.getSet(ElementField.SUB_ELEMENT_IDS, String.class)
-        .stream().map(Id::new).collect(Collectors.toSet()));
-    return element;
-  }
-
-  private Namespace getNamespace(String namespaceStr) {
-    Namespace namespace = new Namespace();
-    if (namespaceStr != null) {
-      namespace.setValue(namespaceStr);
-    }
-    return namespace;
-  }
-
-  private static <T> T json2Object(String json, Type typeOfT) {
-    return json == null ? null : JsonUtil.json2Object(json, typeOfT);
-  }
-
-  private Set<String> getVersionElementIds(SessionContext context,
-                                           ElementEntityContext elementContext) {
-    Row row = getVersionElementsAccessor(context).get(
-        elementContext.getSpace(),
-        elementContext.getItemId().toString(),
-        getVersionId(elementContext)).one();
-    return row == null
-        ? new HashSet<>()
-        : row.getSet(CassandraElementRepository.VersionElementsField.ELEMENT_IDS, String.class);
-  }
-
-  /*
-CREATE TABLE IF NOT EXISTS element_namespace (
-	space text,
-	item_id text,
-	element_id text,
-	namespace text,
-	PRIMARY KEY (( space, item_id, element_id ))
-);
-   */
-  @Accessor
-  interface ElementNamespaceAccessor {
-    @Query(
-        "UPDATE element_namespace SET namespace=:ns " +
-            "WHERE space=:space AND item_id=:item AND element_id=:id ")
-    void create(@Param("space") String space,
-                @Param("item") String itemId,
-                @Param("id") String elementId,
-                @Param("ns") String namespace);
-  }
-
-  /*
-CREATE TABLE IF NOT EXISTS element (
-	space text,
-	item_id text,
-	version_id text,
-	element_id text,
-	parent_id text,
-	namespace text,
-	info text,
-	relations text,
-	data blob,
-	searchable_data blob,
-	visualization blob,
-	sub_element_ids set<text>,
-	PRIMARY KEY (( space, item_id, version_id, element_id ))
-);
-   */
-  @Accessor
-  interface ElementAccessor {
-    @Query(
-        "UPDATE element SET parent_id=:parentId, namespace=:ns, info=:info, relations=:rels, " +
-            "data=:data, searchable_data=:searchableData, visualization=:visualization, " +
-            "sub_element_ids=sub_element_ids+:subs " +
-            "WHERE space=:space AND item_id=:item AND version_id=:ver AND element_id=:id ")
-    void create(@Param("space") String space,
-                @Param("item") String itemId,
-                @Param("ver") String versionId,
-                @Param("id") String elementId,
-                @Param("parentId") String parentElementId,
-                @Param("ns") String namespace,
-                @Param("info") String info,
-                @Param("rels") String relations,
-                @Param("data") ByteBuffer data,
-                @Param("searchableData") ByteBuffer searchableData,
-                @Param("visualization") ByteBuffer visualization,
-                @Param("subs") Set<String> subElementIds);
-
-    @Query("UPDATE element SET info=?, relations=?, data=?, searchable_data=?, visualization=?" +
-        " WHERE space=? AND item_id=? AND version_id=? AND element_id=?  ")
-    void update(String info, String relations, ByteBuffer data, ByteBuffer searchableData,
-                ByteBuffer visualization, String space, String itemId, String versionId,
-                String elementId);
-
-    @Query("DELETE FROM element WHERE space=? AND item_id=? AND version_id=? AND element_id=?")
-    void delete(String space, String itemId, String versionId, String elementId);
-
-    @Query("SELECT parent_id, namespace, info, relations, data, searchable_data, visualization, " +
-        "sub_element_ids FROM element " +
-        "WHERE space=? AND item_id=? AND version_id=? AND element_id=? ")
-    ResultSet get(String space, String itemId, String versionId, String elementId);
-
-    @Query("UPDATE element SET sub_element_ids=sub_element_ids+? " +
-        " WHERE space=? AND item_id=? AND version_id=? AND element_id=?  ")
-    void addSubElements(Set<String> subElementIds, String space, String itemId, String versionId,
-                        String elementId);
-
-    @Query("UPDATE element SET sub_element_ids=sub_element_ids-? " +
-        " WHERE space=? AND item_id=? AND version_id=? AND element_id=? ")
-    void removeSubElements(Set<String> subElementIds, String space, String itemId, String versionId,
-                           String elementId);
-  }
-
-  private static final class ElementField {
-    private static final String NAMESPACE = "namespace";
-    private static final String PARENT_ID = "parent_id";
-    private static final String INFO = "info";
-    private static final String RELATIONS = "relations";
-    private static final String DATA = "data";
-    private static final String SEARCHABLE_DATA = "searchable_data";
-    private static final String VISUALIZATION = "visualization";
-    private static final String SUB_ELEMENT_IDS = "sub_element_ids";
-  }
-
-  /*
-  CREATE TABLE IF NOT EXISTS version_elements (
-    space text,
-    item_id text,
-    version_id text,
-    element_ids set<text>,
-    PRIMARY KEY (( space, item_id, version_id ))
-  );
-   */
-  @Accessor
-  interface VersionElementsAccessor {
-
-    @Query("UPDATE version_elements SET element_ids=element_ids+? " +
-        "WHERE space=? AND item_id=? AND version_id=?")
-    void addElements(Set<String> elementIds, String space, String itemId, String versionId);
-
-    @Query("UPDATE version_elements SET element_ids=element_ids-? " +
-        "WHERE space=? AND item_id=? AND version_id=?")
-    void removeElements(Set<String> elementIds, String space, String itemId, String versionId);
-
-    @Query("SELECT element_ids FROM version_elements WHERE space=? AND item_id=? AND version_id=?")
-    ResultSet get(String space, String itemId, String versionId);
-
-    @Query("SELECT element_ids FROM version_elements LIMIT 1")
-    ResultSet checkHealth();
-  }
-
-  private static final class VersionElementsField {
-    private static final String ELEMENT_IDS = "element_ids";
-  }
-}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/impl/CassandraDaoUtils.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/impl/cassandra/CassandraDaoUtils.java
similarity index 93%
rename from openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/impl/CassandraDaoUtils.java
rename to openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/impl/cassandra/CassandraDaoUtils.java
index 20a1e18..b6cb9e4 100644
--- a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/impl/CassandraDaoUtils.java
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/impl/cassandra/CassandraDaoUtils.java
@@ -1,9 +1,9 @@
-package org.openecomp.core.zusammen.plugin.dao.impl;
+package org.openecomp.core.zusammen.plugin.dao.impl.cassandra;
 
-import com.datastax.driver.core.Session;
 import com.amdocs.zusammen.commons.db.api.cassandra.CassandraConnectorFactory;
 import com.amdocs.zusammen.commons.db.api.cassandra.types.CassandraContext;
 import com.amdocs.zusammen.datatypes.SessionContext;
+import com.datastax.driver.core.Session;
 
 class CassandraDaoUtils {
 
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/impl/CassandraElementRepositoryFactory.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/impl/cassandra/ElementRepositoryFactoryImpl.java
similarity index 80%
rename from openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/impl/CassandraElementRepositoryFactory.java
rename to openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/impl/cassandra/ElementRepositoryFactoryImpl.java
index f3072a6..8540816 100644
--- a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/impl/CassandraElementRepositoryFactory.java
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/impl/cassandra/ElementRepositoryFactoryImpl.java
@@ -14,15 +14,15 @@
  * limitations under the License.
  */
 
-package org.openecomp.core.zusammen.plugin.dao.impl;
+package org.openecomp.core.zusammen.plugin.dao.impl.cassandra;
 
 import com.amdocs.zusammen.datatypes.SessionContext;
 import org.openecomp.core.zusammen.plugin.dao.ElementRepository;
 import org.openecomp.core.zusammen.plugin.dao.ElementRepositoryFactory;
 
-public class CassandraElementRepositoryFactory extends ElementRepositoryFactory {
+public class ElementRepositoryFactoryImpl extends ElementRepositoryFactory {
 
-  private static final ElementRepository INSTANCE = new CassandraElementRepository();
+  private static final ElementRepository INSTANCE = new ElementRepositoryImpl();
 
   @Override
   public ElementRepository createInterface(SessionContext context) {
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/impl/cassandra/ElementRepositoryImpl.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/impl/cassandra/ElementRepositoryImpl.java
new file mode 100644
index 0000000..bb3b1cf
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/impl/cassandra/ElementRepositoryImpl.java
@@ -0,0 +1,565 @@
+/*
+ * Copyright © 2016-2017 European Support Limited
+ *
+ * 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.
+ */
+
+package org.openecomp.core.zusammen.plugin.dao.impl.cassandra;
+
+import com.amdocs.zusammen.datatypes.Id;
+import com.amdocs.zusammen.datatypes.Namespace;
+import com.amdocs.zusammen.datatypes.SessionContext;
+import com.amdocs.zusammen.datatypes.item.Info;
+import com.amdocs.zusammen.datatypes.item.Relation;
+import com.amdocs.zusammen.plugin.statestore.cassandra.dao.types.ElementEntityContext;
+import com.amdocs.zusammen.utils.fileutils.json.JsonUtil;
+import com.datastax.driver.core.ResultSet;
+import com.datastax.driver.core.Row;
+import com.datastax.driver.mapping.annotations.Accessor;
+import com.datastax.driver.mapping.annotations.Param;
+import com.datastax.driver.mapping.annotations.Query;
+import com.google.gson.reflect.TypeToken;
+import org.openecomp.core.zusammen.plugin.ZusammenPluginConstants;
+import org.openecomp.core.zusammen.plugin.dao.ElementRepository;
+import org.openecomp.core.zusammen.plugin.dao.types.ElementEntity;
+
+import java.lang.reflect.Type;
+import java.nio.ByteBuffer;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+import java.util.TreeMap;
+import java.util.stream.Collectors;
+
+public class ElementRepositoryImpl implements ElementRepository {
+
+  @Override
+  public Map<Id, Id> listIds(SessionContext context, ElementEntityContext elementContext) {
+
+    if (elementContext.getRevisionId() == null) {
+      String revisionId = calculateLastRevisionId(context, elementContext);
+      if (revisionId == null) {
+        return new HashMap<>();
+      }
+
+      elementContext.setRevisionId(new Id(revisionId));
+    }
+    return getVersionElementIds(context, elementContext).entrySet().stream().collect(Collectors
+        .toMap(entry -> new Id(entry.getKey()), entry -> new Id(entry.getValue())));
+
+   /* return getVersionElementIds(context, elementContext).stream()
+        .map(Id::new)
+        .collect(Collectors.toList());*/
+
+  }
+
+  @Override
+  public void create(SessionContext context, ElementEntityContext elementContext,
+                     ElementEntity element) {
+    createElement(context, elementContext, element);
+    addElementToParent(context, elementContext, element);
+  }
+
+  @Override
+  public void update(SessionContext context, ElementEntityContext elementContext,
+                     ElementEntity element) {
+
+    Id elementRevisionId = getElementRevision(context, elementContext, element.getId());
+    if (elementRevisionId.equals(elementContext.getRevisionId())) {
+      updateElement(context, elementContext, element);
+    } else {
+      createElement(context, elementContext, element);
+    }
+  }
+
+  @Override
+  public void delete(SessionContext context, ElementEntityContext elementContext,
+                     ElementEntity element) {
+    removeElementFromParent(context, elementContext, element);
+    deleteElement(context, elementContext, element);
+  }
+
+  @Override
+  public Optional<ElementEntity> get(SessionContext context, ElementEntityContext elementContext,
+                                     ElementEntity element) {
+    String revisionId = calculateElementRevisionId(context, elementContext, element);
+    if (revisionId == null) {
+      return Optional.empty();
+    }
+
+    Row row = getElementAccessor(context).get(
+        elementContext.getSpace(),
+        elementContext.getItemId().toString(),
+        elementContext.getVersionId().toString(),
+        element.getId().toString(),
+        revisionId).one();
+
+    return row == null ? Optional.empty() : Optional.of(getElementEntity(element, row));
+  }
+
+  @Override
+  public Optional<ElementEntity> getDescriptor(SessionContext context,
+                                               ElementEntityContext elementContext,
+                                               ElementEntity element) {
+    String revisionId = calculateElementRevisionId(context, elementContext, element);
+    if (revisionId == null) {
+      return Optional.empty();
+    }
+
+    Row row = getElementAccessor(context).getDescriptor(
+        elementContext.getSpace(),
+        elementContext.getItemId().toString(),
+        elementContext.getVersionId().toString(),
+        element.getId().toString(),
+        revisionId).one();
+
+    return row == null ? Optional.empty() : Optional.of(getElementEntityDescriptor(element, row));
+  }
+
+  @Override
+  public void createNamespace(SessionContext context, ElementEntityContext elementContext,
+                              ElementEntity element) {
+    getElementNamespaceAccessor(context).create(elementContext.getItemId().toString(),
+        element.getId().toString(),
+        element.getNamespace().toString());
+  }
+
+  @Override
+  public Optional<Id> getHash(SessionContext context, ElementEntityContext elementContext,
+                              ElementEntity element) {
+    String revisionId = calculateElementRevisionId(context, elementContext, element);
+    if (revisionId == null) {
+      return Optional.empty();
+    }
+
+    Row row = getElementAccessor(context).getHash(
+        elementContext.getSpace(),
+        elementContext.getItemId().toString(),
+        elementContext.getVersionId().getValue(),
+        element.getId().toString(),
+        revisionId).one();
+
+    return row == null ? Optional.empty() : Optional.of(getElementHash(row));
+  }
+
+  private String calculateElementRevisionId(SessionContext context,
+                                            ElementEntityContext elementContext,
+                                            ElementEntity element) {
+
+    if (elementContext.getSpace().equals(ZusammenPluginConstants.PUBLIC_SPACE)) {
+
+      String versionRevision;
+      if (elementContext.getRevisionId() == null) {
+        versionRevision = calculateLastRevisionId(context, elementContext);
+      } else {
+        versionRevision = elementContext.getRevisionId().getValue();
+      }
+
+      elementContext.setRevisionId(new Id(versionRevision));
+      Map<String, String> elementIds = getVersionElementIds(context, elementContext);
+      if (elementIds.containsKey(element.getId().getValue())) {
+        return elementIds.get(element.getId().getValue());
+      } else {
+        return null;
+      }
+
+    } else {
+      return Id.ZERO.getValue();
+    }
+  }
+
+  private String calculateLastRevisionId(SessionContext context, ElementEntityContext
+      elementContext) {
+    List<Row> rows = getVersionElementsAccessor(context).listRevisions(elementContext.getSpace(),
+        elementContext
+            .getItemId().toString(), elementContext.getVersionId().toString()).all();
+    if (rows == null || rows.size() == 0) {
+      return null;
+    }
+    rows.sort((o1, o2) -> o1.getDate(VersionElementsField.PUBLISH_TIME)
+        .after(o2.getDate(VersionElementsField.PUBLISH_TIME)) ? -1 : 1);
+    return rows.get(0).getString(VersionElementsField.REVISION_ID);
+  }
+
+  /*private static String getVersionId(ElementEntityContext elementContext) {
+    return elementContext.getRevisionId() == null
+        ? elementContext.getVersionId().toString()
+        : elementContext.getRevisionId().getValue();
+  }*/
+
+  private ElementNamespaceAccessor getElementNamespaceAccessor(SessionContext context) {
+    return CassandraDaoUtils.getAccessor(context, ElementNamespaceAccessor.class);
+  }
+
+  private ElementAccessor getElementAccessor(SessionContext context) {
+    return CassandraDaoUtils.getAccessor(context, ElementAccessor.class);
+  }
+
+  private VersionElementsAccessor getVersionElementsAccessor(SessionContext context) {
+    return CassandraDaoUtils.getAccessor(context, VersionElementsAccessor.class);
+  }
+
+  private void createElement(SessionContext context, ElementEntityContext elementContext,
+                             ElementEntity element) {
+    createElementRow(context, elementContext, element);
+
+    Map<String, String> elementIds = new TreeMap<>();
+    elementIds.put(element.getId().toString(), elementContext.getRevisionId().getValue());
+    getVersionElementsAccessor(context).addElements(
+        elementIds,
+        elementContext.getSpace(),
+        elementContext.getItemId().toString(),
+        elementContext.getVersionId().getValue(),
+        elementContext.getRevisionId().getValue());
+  }
+
+  private void createElementRow(SessionContext context, ElementEntityContext elementContext,
+                                ElementEntity element) {
+    Set<String> subElementIds =
+        element.getSubElementIds().stream().map(Id::toString).collect(Collectors.toSet());
+
+    getElementAccessor(context).create(
+        elementContext.getSpace(),
+        elementContext.getItemId().toString(),
+        elementContext.getVersionId().getValue(),
+        element.getId().toString(),
+        elementContext.getRevisionId().getValue(),
+        element.getParentId() == null ? null : element.getParentId().toString(),
+        element.getNamespace() == null ? null : element.getNamespace().toString(),
+        JsonUtil.object2Json(element.getInfo()),
+        JsonUtil.object2Json(element.getRelations()),
+        element.getData(),
+        element.getSearchableData(),
+        element.getVisualization(),
+        subElementIds,
+        element.getElementHash().getValue());
+  }
+
+  private void updateElement(SessionContext context, ElementEntityContext elementContext,
+                             ElementEntity element) {
+
+
+    if (element.getParentId() == null) {
+      getElementAccessor(context).update(
+          JsonUtil.object2Json(element.getInfo()),
+          JsonUtil.object2Json(element.getRelations()),
+          element.getData(),
+          element.getSearchableData(),
+          element.getVisualization(),
+          element.getElementHash().getValue(),
+          elementContext.getSpace(),
+          elementContext.getItemId().toString(),
+          elementContext.getVersionId().toString(),
+          element.getId().toString(),
+          elementContext.getRevisionId().getValue());
+    } else {
+      getElementAccessor(context).update(
+          JsonUtil.object2Json(element.getInfo()),
+          JsonUtil.object2Json(element.getRelations()),
+          element.getData(),
+          element.getSearchableData(),
+          element.getVisualization(),
+          element.getElementHash().getValue(),
+          element.getParentId().getValue(),
+          elementContext.getSpace(),
+          elementContext.getItemId().toString(),
+          elementContext.getVersionId().toString(),
+          element.getId().getValue(),
+          elementContext.getRevisionId().getValue());
+    }
+
+    Map<String, String> elementIds = new TreeMap<>();
+    elementIds.put(element.getId().getValue(), elementContext.getRevisionId().getValue());
+    getVersionElementsAccessor(context).addElements(
+        elementIds,
+        elementContext.getSpace(),
+        elementContext.getItemId().toString(),
+        elementContext.getVersionId().getValue(),
+        elementContext.getRevisionId().getValue());
+  }
+
+  private void deleteElement(SessionContext context, ElementEntityContext elementContext,
+                             ElementEntity element) {
+
+
+    getElementAccessor(context).delete(
+        elementContext.getSpace(),
+        elementContext.getItemId().toString(),
+        elementContext.getVersionId().toString(),
+        element.getId().toString(),
+        elementContext.getRevisionId().getValue());
+
+    getVersionElementsAccessor(context).removeElements(
+        Collections.singleton(element.getId().toString()),
+        elementContext.getSpace(),
+        elementContext.getItemId().toString(),
+        elementContext.getVersionId().toString(),
+        elementContext.getRevisionId().getValue());
+  }
+
+  private void addElementToParent(SessionContext context, ElementEntityContext elementContext,
+                                  ElementEntity element) {
+    if (element.getParentId() == null) {
+      return;
+    }
+
+
+    getElementAccessor(context).addSubElements(
+        Collections.singleton(element.getId().toString()),
+        elementContext.getSpace(),
+        elementContext.getItemId().toString(),
+        elementContext.getVersionId().toString(),
+        element.getParentId().toString(),
+        elementContext.getRevisionId().getValue());
+
+    Map<String, String> elementIds = new TreeMap<>();
+    elementIds.put(element.getParentId().toString(), elementContext.getRevisionId().getValue());
+    getVersionElementsAccessor(context).addElements(elementIds, elementContext.getSpace(),
+        elementContext.getItemId().getValue(), elementContext.getVersionId().getValue(),
+        elementContext.getRevisionId().getValue());
+  }
+
+  private void removeElementFromParent(SessionContext context, ElementEntityContext elementContext,
+                                       ElementEntity element) {
+
+    if (element.getParentId() == null) {
+      return;
+    }
+
+    Optional<ElementEntity> parentElement =
+        get(context, elementContext, new ElementEntity(element.getParentId()));
+    if (!parentElement.isPresent()) {
+      return;
+    }
+    getElementAccessor(context).removeSubElements(
+        Collections.singleton(element.getId().toString()),
+        elementContext.getSpace(),
+        elementContext.getItemId().toString(),
+        elementContext.getVersionId().toString(),
+        element.getParentId().toString(),
+        elementContext.getRevisionId().getValue());
+
+    getVersionElementsAccessor(context)
+        .removeElements(Collections.singleton(element.getId().toString()),
+            elementContext.getSpace(),
+            elementContext.getItemId().getValue(), elementContext.getVersionId().getValue(),
+            elementContext.getRevisionId().getValue());
+
+    Map<String, String> elementIds = new TreeMap<>();
+    elementIds.put(element.getParentId().toString(), elementContext.getRevisionId().getValue());
+    getVersionElementsAccessor(context).addElements(elementIds, elementContext.getSpace(),
+        elementContext.getItemId().getValue(), elementContext.getVersionId().getValue(),
+        elementContext.getRevisionId().getValue());
+  }
+
+  static ElementEntity getElementEntityDescriptor(ElementEntity element, Row row) {
+    element.setNamespace(getNamespace(row.getString(ElementField.NAMESPACE)));
+    element.setParentId(getParentId(row.getString(ElementField.PARENT_ID)));
+    element.setInfo(json2Object(row.getString(ElementField.INFO), Info.class));
+    element.setRelations(
+        json2Object(row.getString(ElementField.RELATIONS), new TypeToken<ArrayList<Relation>>() {
+        }.getType()));
+
+    element.setSubElementIds(row.getSet(ElementField.SUB_ELEMENT_IDS, String.class)
+        .stream().map(Id::new).collect(Collectors.toSet()));
+    return element;
+  }
+
+  static ElementEntity getElementEntity(ElementEntity element, Row row) {
+    getElementEntityDescriptor(element, row);
+
+    element.setData(row.getBytes(ElementField.DATA));
+    element.setSearchableData(row.getBytes(ElementField.SEARCHABLE_DATA));
+    element.setVisualization(row.getBytes(ElementField.VISUALIZATION));
+    element.setElementHash(new Id(row.getString(ElementField.ELEMENT_HASH)));
+    return element;
+  }
+
+  private Id getElementHash(Row row) {
+    return new Id(row.getString(ElementField.ELEMENT_HASH));
+  }
+
+  private static Id getParentId(String parentIdStr) {
+    return parentIdStr == null ? null : new Id(parentIdStr);
+  }
+
+  private static Namespace getNamespace(String namespaceStr) {
+    Namespace namespace = new Namespace();
+    if (namespaceStr != null) {
+      namespace.setValue(namespaceStr);
+    }
+    return namespace;
+  }
+
+  private static <T> T json2Object(String json, Type typeOfT) {
+    return json == null ? null : JsonUtil.json2Object(json, typeOfT);
+  }
+
+  private Map<String, String> getVersionElementIds(SessionContext context,
+                                                   ElementEntityContext elementContext) {
+    Row row = getVersionElementsAccessor(context).get(
+        elementContext.getSpace(),
+        elementContext.getItemId().toString(),
+        elementContext.getVersionId().getValue(),
+        elementContext.getRevisionId().getValue()).one();
+    return row == null
+        ? new HashMap<>()
+        : row.getMap(ElementRepositoryImpl.VersionElementsField.ELEMENT_IDS, String.class, String
+            .class);
+  }
+
+  private Id getElementRevision(SessionContext context, ElementEntityContext elementContext
+      , Id elementId) {
+    Map<Id, Id> versionElementIds =
+        listIds(context, new ElementEntityContext
+            (elementContext.getSpace(), elementContext.getItemId(), elementContext.getVersionId(),
+                elementContext.getRevisionId()));
+    return versionElementIds.get(elementId);
+
+  }
+
+
+  /*
+CREATE TABLE IF NOT EXISTS element_namespace (
+	item_id text,
+	element_id text,
+	namespace text,
+	PRIMARY KEY (( item_id, element_id ))
+);
+   */
+  @Accessor
+  interface ElementNamespaceAccessor {
+    @Query("UPDATE element_namespace SET namespace=:ns " +
+        "WHERE item_id=:item AND element_id=:id ")
+    void create(@Param("item") String itemId,
+                @Param("id") String elementId,
+                @Param("ns") String namespace);
+  }
+
+  @Accessor
+  interface ElementAccessor {
+    @Query(
+        "UPDATE element SET parent_id=:parentId, namespace=:ns, info=:info, relations=:rels, " +
+            "data=:data, searchable_data=:searchableData, visualization=:visualization, " +
+            "sub_element_ids=sub_element_ids+:subs , element_hash=:elementHash " +
+            " WHERE space=:space AND item_id=:item AND version_id=:ver AND element_id=:id AND " +
+            "revision_id=:rev ")
+    void create(@Param("space") String space,
+                @Param("item") String itemId,
+                @Param("ver") String versionId,
+                @Param("id") String elementId,
+                @Param("rev") String revisionId,
+                @Param("parentId") String parentElementId,
+                @Param("ns") String namespace,
+                @Param("info") String info,
+                @Param("rels") String relations,
+                @Param("data") ByteBuffer data,
+                @Param("searchableData") ByteBuffer searchableData,
+                @Param("visualization") ByteBuffer visualization,
+                @Param("subs") Set<String> subElementIds,
+                @Param("elementHash") String elementHash);
+
+
+    @Query("UPDATE element SET info=?, relations=?, data=?, searchable_data=?, visualization=? ," +
+        "element_hash=? , parent_id=? " +
+        " WHERE space=? AND item_id=? AND version_id=? AND element_id=? AND revision_id=?  ")
+    void update(String info, String relations, ByteBuffer data, ByteBuffer searchableData,
+                ByteBuffer visualization, String elementHash, String parentId, String space, String
+                    itemId, String
+                    versionId, String elementId, String revisionId);
+
+    @Query("UPDATE element SET info=?, relations=?, data=?, searchable_data=?, visualization=? ," +
+        "element_hash=? " +
+        " WHERE space=? AND item_id=? AND version_id=? AND element_id=? AND revision_id=?  ")
+    void update(String info, String relations, ByteBuffer data, ByteBuffer searchableData,
+                ByteBuffer visualization, String elementHash, String space, String
+                    itemId, String
+                    versionId, String elementId, String revisionId);
+
+    @Query(
+        "DELETE FROM element WHERE space=? AND item_id=? AND version_id=? AND element_id=? AND revision_id=? ")
+    void delete(String space, String itemId, String versionId, String elementId, String revisionId);
+
+    @Query("SELECT parent_id, namespace, info, relations, data, searchable_data, visualization, " +
+        "sub_element_ids,element_hash FROM element " +
+        "WHERE space=? AND item_id=? AND version_id=? AND element_id=? AND revision_id=? ")
+    ResultSet get(String space, String itemId, String versionId, String elementId, String
+        revisionId);
+
+    @Query("SELECT parent_id, namespace, info, relations, sub_element_ids FROM element " +
+        "WHERE space=? AND item_id=? AND version_id=? AND element_id=? AND revision_id=? ")
+    ResultSet getDescriptor(String space, String itemId, String versionId, String elementId,
+                            String revisionId);
+
+    @Query("UPDATE element SET sub_element_ids=sub_element_ids+? " +
+        " WHERE space=? AND item_id=? AND version_id=? AND element_id=? AND revision_id=?  ")
+    void addSubElements(Set<String> subElementIds, String space, String itemId, String versionId,
+                        String elementId, String revisionId);
+
+    @Query("UPDATE element SET sub_element_ids=sub_element_ids-? " +
+        " WHERE space=? AND item_id=? AND version_id=? AND element_id=? AND revision_id=? ")
+    void removeSubElements(Set<String> subElementIds, String space, String itemId, String versionId,
+                           String elementId, String revisionId);
+
+    @Query("SELECT element_hash FROM element " +
+        "WHERE space=? AND item_id=? AND version_id=? AND element_id=? AND revision_id=? ")
+    ResultSet getHash(String space, String itemId, String versionId, String elementId, String
+        revisionId);
+  }
+
+  private static final class ElementField {
+    private static final String NAMESPACE = "namespace";
+    private static final String PARENT_ID = "parent_id";
+    private static final String INFO = "info";
+    private static final String RELATIONS = "relations";
+    private static final String DATA = "data";
+    private static final String SEARCHABLE_DATA = "searchable_data";
+    private static final String VISUALIZATION = "visualization";
+    private static final String SUB_ELEMENT_IDS = "sub_element_ids";
+    private static final String ELEMENT_HASH = "element_hash";
+  }
+
+  @Accessor
+  interface VersionElementsAccessor {
+
+    @Query("UPDATE version_elements SET element_ids=element_ids+ ? " +
+        "WHERE space=? AND item_id=? AND version_id=? AND revision_id=? ")
+    void addElements(Map<String, String> elementIds, String space, String itemId, String versionId,
+                     String versionRevisionId);
+
+    @Query("UPDATE version_elements SET element_ids=element_ids-? " +
+        "WHERE space=? AND item_id=? AND version_id=? AND revision_id=?")
+    void removeElements(Set<String> elementIds, String space, String itemId, String versionId,
+                        String revisionId);
+
+    @Query(
+        "SELECT element_ids FROM version_elements WHERE space=? AND item_id=? AND version_id=? AND revision_id=? ")
+    ResultSet get(String space, String itemId, String versionId, String revisionId);
+
+    @Query(
+        "SELECT revision_id,publish_time FROM version_elements WHERE space=? AND item_id=? AND " +
+            "version_id=? ")
+    ResultSet listRevisions(String space, String itemId, String versionId);
+
+  }
+
+  private static final class VersionElementsField {
+    private static final String ELEMENT_IDS = "element_ids";
+    private static final String REVISION_ID = "revision_id";
+    private static final String PUBLISH_TIME = "publish_time";
+  }
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/impl/CassandraElementRepositoryFactory.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/impl/cassandra/ElementStageRepositoryFactoryImpl.java
similarity index 60%
copy from openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/impl/CassandraElementRepositoryFactory.java
copy to openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/impl/cassandra/ElementStageRepositoryFactoryImpl.java
index f3072a6..02bec12 100644
--- a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/impl/CassandraElementRepositoryFactory.java
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/impl/cassandra/ElementStageRepositoryFactoryImpl.java
@@ -14,18 +14,18 @@
  * limitations under the License.
  */
 
-package org.openecomp.core.zusammen.plugin.dao.impl;
+package org.openecomp.core.zusammen.plugin.dao.impl.cassandra;
 
 import com.amdocs.zusammen.datatypes.SessionContext;
-import org.openecomp.core.zusammen.plugin.dao.ElementRepository;
-import org.openecomp.core.zusammen.plugin.dao.ElementRepositoryFactory;
+import org.openecomp.core.zusammen.plugin.dao.ElementStageRepository;
+import org.openecomp.core.zusammen.plugin.dao.ElementStageRepositoryFactory;
 
-public class CassandraElementRepositoryFactory extends ElementRepositoryFactory {
+public class ElementStageRepositoryFactoryImpl extends ElementStageRepositoryFactory {
 
-  private static final ElementRepository INSTANCE = new CassandraElementRepository();
+  private static final ElementStageRepository INSTANCE = new ElementStageRepositoryImpl();
 
   @Override
-  public ElementRepository createInterface(SessionContext context) {
+  public ElementStageRepository createInterface(SessionContext context) {
     return INSTANCE;
   }
 }
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/impl/cassandra/ElementStageRepositoryImpl.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/impl/cassandra/ElementStageRepositoryImpl.java
new file mode 100644
index 0000000..c215f82
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/impl/cassandra/ElementStageRepositoryImpl.java
@@ -0,0 +1,423 @@
+/*
+ * Copyright © 2016-2017 European Support Limited
+ *
+ * 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.
+ */
+
+package org.openecomp.core.zusammen.plugin.dao.impl.cassandra;
+
+import com.amdocs.zusammen.datatypes.Id;
+import com.amdocs.zusammen.datatypes.SessionContext;
+import com.amdocs.zusammen.datatypes.item.Action;
+import com.amdocs.zusammen.plugin.statestore.cassandra.dao.types.ElementEntityContext;
+import com.amdocs.zusammen.utils.fileutils.json.JsonUtil;
+import com.datastax.driver.core.ResultSet;
+import com.datastax.driver.core.Row;
+import com.datastax.driver.mapping.annotations.Accessor;
+import com.datastax.driver.mapping.annotations.Param;
+import com.datastax.driver.mapping.annotations.Query;
+import org.openecomp.core.zusammen.plugin.dao.ElementStageRepository;
+import org.openecomp.core.zusammen.plugin.dao.types.ElementEntity;
+import org.openecomp.core.zusammen.plugin.dao.types.StageEntity;
+
+import java.nio.ByteBuffer;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.Optional;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+public class ElementStageRepositoryImpl implements ElementStageRepository {
+
+  @Override
+  public Collection<ElementEntity> listIds(SessionContext context,
+                                           ElementEntityContext elementContext) {
+    return getElements(getStageElementIds(context, elementContext));
+  }
+
+  @Override
+  public Collection<ElementEntity> listConflictedIds(SessionContext context,
+                                                     ElementEntityContext elementContext) {
+    return getElements(getConflictedElementIds(context, elementContext));
+  }
+
+  @Override
+  public void create(SessionContext context, ElementEntityContext elementContext,
+                     StageEntity<ElementEntity> elementStage) {
+    createElement(context, elementContext, elementStage);
+    addElementToParent(context, elementContext, elementStage.getEntity());
+  }
+
+  @Override
+  public void markAsNotConflicted(SessionContext context, ElementEntityContext elementContext,
+                                  ElementEntity element, Action action) {
+    getElementStageAccessor(context).updateState(action, false,
+        elementContext.getSpace(),
+        elementContext.getItemId().toString(),
+        elementContext.getVersionId().toString(),
+        element.getId().toString());
+
+    getStageElementsAccessor(context).removeConflictElements(
+        Collections.singleton(element.getId().toString()),
+        elementContext.getSpace(),
+        elementContext.getItemId().toString(),
+        elementContext.getVersionId().toString(),
+        elementContext.getRevisionId().getValue());
+  }
+
+  @Override
+  public void markAsNotConflicted(SessionContext context, ElementEntityContext elementContext,
+                                  ElementEntity element) {
+    getElementStageAccessor(context).markAsNotConflicted(
+        elementContext.getSpace(),
+        elementContext.getItemId().toString(),
+        elementContext.getVersionId().toString(),
+        element.getId().toString());
+
+    getStageElementsAccessor(context).removeConflictElements(
+        Collections.singleton(element.getId().toString()),
+        elementContext.getSpace(),
+        elementContext.getItemId().toString(),
+        elementContext.getVersionId().toString(),
+        elementContext.getRevisionId().getValue());
+  }
+
+  @Override
+  public void update(SessionContext context, ElementEntityContext elementContext,
+                     ElementEntity element, Action action, boolean conflicted) {
+    getElementStageAccessor(context).update(
+        JsonUtil.object2Json(element.getInfo()),
+        JsonUtil.object2Json(element.getRelations()),
+        element.getData(),
+        element.getSearchableData(),
+        element.getVisualization(),
+        element.getElementHash().getValue(),
+        action,
+        conflicted,
+        elementContext.getSpace(),
+        elementContext.getItemId().toString(),
+        elementContext.getVersionId().toString(),
+        element.getId().toString());
+
+    if (!conflicted) {
+      getStageElementsAccessor(context).removeConflictElements(
+          Collections.singleton(element.getId().toString()),
+          elementContext.getSpace(),
+          elementContext.getItemId().toString(),
+          elementContext.getVersionId().toString(),
+          elementContext.getRevisionId().getValue());
+    }
+  }
+
+  @Override
+  public void delete(SessionContext context, ElementEntityContext elementContext,
+                     ElementEntity element) {
+    removeElementFromParent(context, elementContext, element);
+    deleteElement(context, elementContext, element);
+  }
+
+  @Override
+  public Optional<StageEntity<ElementEntity>> get(SessionContext context,
+                                                  ElementEntityContext elementContext,
+                                                  ElementEntity element) {
+    Row row = getElementStageAccessor(context).get(
+        elementContext.getSpace(),
+        elementContext.getItemId().toString(),
+        elementContext.getVersionId().getValue(),
+        element.getId().toString()).one();
+
+    return row == null ? Optional.empty() : Optional.of(getStageElement(row));
+  }
+
+  @Override
+  public Optional<StageEntity<ElementEntity>> getDescriptor(SessionContext context,
+                                                            ElementEntityContext elementContext,
+                                                            ElementEntity element) {
+    Row row = getElementStageAccessor(context).getDescriptor(
+        elementContext.getSpace(),
+        elementContext.getItemId().toString(),
+        elementContext.getVersionId().getValue(),
+        element.getId().toString()).one();
+
+    return row == null ? Optional.empty() : Optional.of(getStageElementDescriptor(row));
+  }
+
+
+
+  private Collection<ElementEntity> getElements(Set<String> elementIds) {
+    return elementIds.stream()
+        .map(id -> new ElementEntity(new Id(id)))
+        .collect(Collectors.toList());
+  }
+
+  private void createElement(SessionContext context, ElementEntityContext elementContext,
+                             StageEntity<ElementEntity> elementStage) {
+
+
+    ElementEntity element = elementStage.getEntity();
+    Set<String> subElementIds =
+        element.getSubElementIds().stream().map(Id::toString).collect(Collectors.toSet());
+    Set<String> conflictDependents = elementStage.getConflictDependents().stream()
+        .map(conflictDependent -> conflictDependent.getId().getValue())
+        .collect(Collectors.toSet());
+
+    getElementStageAccessor(context).create(
+        elementContext.getSpace(),
+        elementContext.getItemId().toString(),
+        elementContext.getVersionId().getValue(),
+        element.getId().toString(),
+        element.getParentId() == null ? null : element.getParentId().toString(),
+        element.getNamespace() == null ? null : element.getNamespace().toString(),
+        JsonUtil.object2Json(element.getInfo()),
+        JsonUtil.object2Json(element.getRelations()),
+        element.getData(),
+        element.getSearchableData(),
+        element.getVisualization(),
+        subElementIds,
+        element.getElementHash() == null ? null : element.getElementHash().getValue(),
+        elementStage.getPublishTime(),
+        elementStage.getAction(),
+        elementStage.isConflicted(),
+        conflictDependents);
+
+    getStageElementsAccessor(context).add(
+        Collections.singleton(element.getId().toString()),
+        elementContext.getSpace(),
+        elementContext.getItemId().toString(),
+        elementContext.getVersionId().getValue(),
+        elementContext.getRevisionId().getValue());
+
+    if (elementStage.isConflicted()) {
+      getStageElementsAccessor(context).addConflictElements(
+          Collections.singleton(element.getId().toString()),
+          elementContext.getSpace(),
+          elementContext.getItemId().toString(),
+          elementContext.getVersionId().getValue(),
+          elementContext.getRevisionId().getValue());
+    }
+  }
+
+  private void deleteElement(SessionContext context, ElementEntityContext elementContext,
+                             ElementEntity element) {
+
+
+    getElementStageAccessor(context).delete(
+        elementContext.getSpace(),
+        elementContext.getItemId().toString(),
+        elementContext.getVersionId().getValue(),
+        element.getId().toString());
+
+    getStageElementsAccessor(context).remove(
+        Collections.singleton(element.getId().toString()),
+        elementContext.getSpace(),
+        elementContext.getItemId().toString(),
+        elementContext.getVersionId().getValue(),
+        elementContext.getRevisionId().getValue());
+  }
+
+  private void addElementToParent(SessionContext context, ElementEntityContext elementContext,
+                                  ElementEntity element) {
+    if (element.getParentId() == null) {
+      return;
+    }
+    getElementStageAccessor(context).addSubElements(
+        Collections.singleton(element.getId().toString()),
+        elementContext.getSpace(),
+        elementContext.getItemId().toString(),
+        elementContext.getVersionId().getValue(),
+        element.getParentId().toString());
+  }
+
+  private void removeElementFromParent(SessionContext context, ElementEntityContext elementContext,
+                                       ElementEntity element) {
+    if (element.getParentId() == null) {
+      return;
+    }
+    getElementStageAccessor(context).removeSubElements(
+        Collections.singleton(element.getId().toString()),
+        elementContext.getSpace(),
+        elementContext.getItemId().toString(),
+        elementContext.getVersionId().getValue(),
+        element.getParentId().toString());
+  }
+
+  private StageEntity<ElementEntity> getStageElementDescriptor(Row row) {
+    return buildStageElement(ElementRepositoryImpl.getElementEntityDescriptor(
+        new ElementEntity(new Id(row.getString(ElementStageField.ID))), row), row);
+  }
+
+  private StageEntity<ElementEntity> getStageElement(Row row) {
+    return buildStageElement(ElementRepositoryImpl.getElementEntity(
+        new ElementEntity(new Id(row.getString(ElementStageField.ID))), row), row);
+  }
+
+
+  private StageEntity<ElementEntity> buildStageElement(ElementEntity element, Row row) {
+    StageEntity<ElementEntity> elementStage =
+        new StageEntity<>(element, row.getDate(ElementStageField.PUBLISH_TIME));
+    elementStage.setAction(Action.valueOf(row.getString(ElementStageField.ACTION)));
+    elementStage.setConflicted(row.getBool(ElementStageField.CONFLICTED));
+    elementStage.setConflictDependents(
+        row.getSet(ElementStageField.CONFLICT_DEPENDENTS, String.class).stream()
+            .map(conflictDependentId -> new ElementEntity(new Id(conflictDependentId)))
+            .collect(Collectors.toSet()));
+    return elementStage;
+  }
+
+  private Set<String> getStageElementIds(SessionContext context,
+                                         ElementEntityContext elementContext) {
+    Row row = getStageElementsAccessor(context).get(
+        elementContext.getSpace(),
+        elementContext.getItemId().toString(),
+        elementContext.getVersionId().getValue(),
+        elementContext.getRevisionId().getValue()).one();
+    return row == null ? new HashSet<>()
+        : row.getSet(StageElementsField.STAGE_ELEMENT_IDS, String.class);
+  }
+
+  private Set<String> getConflictedElementIds(SessionContext context,
+                                              ElementEntityContext elementContext) {
+    Row row = getStageElementsAccessor(context).getConflicted(
+        elementContext.getSpace(),
+        elementContext.getItemId().toString(),
+        elementContext.getVersionId().getValue(),
+        elementContext.getRevisionId().getValue()).one();
+    return row == null ? new HashSet<>()
+        : row.getSet(StageElementsField.CONFLICT_ELEMENT_IDS, String.class);
+  }
+
+  private ElementStageAccessor getElementStageAccessor(SessionContext context) {
+    return CassandraDaoUtils.getAccessor(context, ElementStageAccessor.class);
+  }
+
+  private StageElementsAccessor getStageElementsAccessor(SessionContext context) {
+    return CassandraDaoUtils.getAccessor(context, StageElementsAccessor.class);
+  }
+
+  @Accessor
+  interface ElementStageAccessor {
+    @Query(
+        "UPDATE element_stage SET parent_id=:parentId, namespace=:ns, info=:info, relations=:rels, " +
+            "data=:data, searchable_data=:searchableData, visualization=:visualization, " +
+            "publish_time=:publishTime, action=:action, " +
+            "conflicted=:conflicted, conflict_dependent_ids=:conflictDependents, " +
+            "sub_element_ids=sub_element_ids+:subs, element_hash=:elementHash " +
+            "WHERE space=:space AND item_id=:item AND version_id=:ver AND element_id=:id ")
+    void create(@Param("space") String space,
+                @Param("item") String itemId,
+                @Param("ver") String versionId,
+                @Param("id") String elementId,
+                @Param("parentId") String parentElementId,
+                @Param("ns") String namespace,
+                @Param("info") String info,
+                @Param("rels") String relations,
+                @Param("data") ByteBuffer data,
+                @Param("searchableData") ByteBuffer searchableData,
+                @Param("visualization") ByteBuffer visualization,
+                @Param("subs") Set<String> subElementIds,
+                @Param("elementHash") String elementHash,
+                @Param("publishTime") Date publishTime,
+                @Param("action") Action action,
+                @Param("conflicted") boolean conflicted,
+                @Param("conflictDependents") Set<String> conflictDependents);
+
+    @Query("UPDATE element_stage SET info=?, relations=?, data=?, searchable_data=?, " +
+        "visualization=?,element_hash=?, action=?, conflicted=? " +
+        " WHERE space=? AND item_id=? AND version_id=? AND element_id=?  ")
+    void update(String info, String relations, ByteBuffer data, ByteBuffer searchableData,
+                ByteBuffer visualization, String elementHash, Action action, boolean conflicted,
+                String space,
+                String itemId, String versionId, String elementId);
+
+    @Query("UPDATE element_stage SET action=?, conflicted=? " +
+        " WHERE space=? AND item_id=? AND version_id=? AND element_id=?  ")
+    void updateState(Action action, boolean conflicted, String space, String itemId,
+                     String versionId, String elementId);
+
+    @Query("UPDATE element_stage SET conflicted=false " +
+        " WHERE space=? AND item_id=? AND version_id=? AND element_id=?  ")
+    void markAsNotConflicted(String space, String itemId, String versionId, String elementId);
+
+    @Query(
+        "DELETE FROM element_stage WHERE space=? AND item_id=? AND version_id=? AND element_id=?")
+    void delete(String space, String itemId, String versionId, String elementId);
+
+    @Query("SELECT element_id, parent_id, namespace, info, relations, data, searchable_data, " +
+        "visualization, sub_element_ids,element_hash, publish_time, action, " +
+        "conflicted, conflict_dependent_ids FROM element_stage " +
+        "WHERE space=? AND item_id=? AND version_id=? AND element_id=? ")
+    ResultSet get(String space, String itemId, String versionId, String elementId);
+
+    @Query("SELECT element_id, parent_id, namespace, info, relations, " +
+        "sub_element_ids, publish_time, action, conflicted, conflict_dependent_ids " +
+        "FROM element_stage WHERE space=? AND item_id=? AND version_id=? AND element_id=? ")
+    ResultSet getDescriptor(String space, String itemId, String versionId, String elementId);
+
+    @Query("UPDATE element_stage SET sub_element_ids=sub_element_ids+? " +
+        " WHERE space=? AND item_id=? AND version_id=? AND element_id=?  ")
+    void addSubElements(Set<String> subElementIds, String space, String itemId, String versionId,
+                        String elementId);
+
+    @Query("UPDATE element_stage SET sub_element_ids=sub_element_ids-? " +
+        " WHERE space=? AND item_id=? AND version_id=? AND element_id=? ")
+    void removeSubElements(Set<String> subElementIds, String space, String itemId, String versionId,
+                           String elementId);
+  }
+
+  private static final class ElementStageField {
+    private static final String ID = "element_id";
+    private static final String PUBLISH_TIME = "publish_time";
+    private static final String ACTION = "action";
+    private static final String CONFLICTED = "conflicted";
+    private static final String CONFLICT_DEPENDENTS = "conflict_dependent_ids";
+  }
+
+  @Accessor
+  interface StageElementsAccessor {
+
+    @Query("UPDATE version_elements SET stage_element_ids=stage_element_ids+? " +
+        "WHERE space=? AND item_id=? AND version_id=? AND revision_id=? ")
+    void add(Set<String> elementIds, String space, String itemId, String versionId, String
+        revisionId);
+
+    @Query("UPDATE version_elements SET stage_element_ids=stage_element_ids-? " +
+        "WHERE space=? AND item_id=? AND version_id=? AND revision_id=? ")
+    void remove(Set<String> elementIds, String space, String itemId, String versionId, String
+        revisionId);
+
+    @Query("SELECT stage_element_ids FROM version_elements " +
+        "WHERE space=? AND item_id=? AND version_id=? AND revision_id=?")
+    ResultSet get(String space, String itemId, String versionId, String revisionId);
+
+    @Query("UPDATE version_elements SET conflict_element_ids=conflict_element_ids+? " +
+        "WHERE space=? AND item_id=? AND version_id=? AND revision_id=? ")
+    void addConflictElements(Set<String> elementIds, String space, String itemId, String
+        versionId, String revisionId);
+
+    @Query("UPDATE version_elements SET conflict_element_ids=conflict_element_ids-? " +
+        "WHERE space=? AND item_id=? AND version_id=? AND revision_id=? ")
+    void removeConflictElements(Set<String> elementIds, String space, String itemId,
+                                String versionId, String revisionId);
+
+    @Query("SELECT conflict_element_ids FROM version_elements " +
+        "WHERE space=? AND item_id=? AND version_id=? AND revision_id=? ")
+    ResultSet getConflicted(String space, String itemId, String versionId, String revisionId);
+  }
+
+  private static final class StageElementsField {
+    private static final String STAGE_ELEMENT_IDS = "stage_element_ids";
+    private static final String CONFLICT_ELEMENT_IDS = "conflict_element_ids";
+  }
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/impl/cassandra/ElementSynchronizationStateRepositoryFactoryImpl.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/impl/cassandra/ElementSynchronizationStateRepositoryFactoryImpl.java
new file mode 100644
index 0000000..ec7e1c3
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/impl/cassandra/ElementSynchronizationStateRepositoryFactoryImpl.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright © 2016-2017 European Support Limited
+ *
+ * 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.
+ */
+
+package org.openecomp.core.zusammen.plugin.dao.impl.cassandra;
+
+import com.amdocs.zusammen.datatypes.SessionContext;
+import org.openecomp.core.zusammen.plugin.dao.ElementSynchronizationStateRepository;
+import org.openecomp.core.zusammen.plugin.dao.ElementSynchronizationStateRepositoryFactory;
+
+public class ElementSynchronizationStateRepositoryFactoryImpl
+    extends ElementSynchronizationStateRepositoryFactory {
+
+  private static final ElementSynchronizationStateRepository INSTANCE =
+      new ElementSynchronizationStateRepositoryImpl();
+
+  @Override
+  public ElementSynchronizationStateRepository createInterface(SessionContext context) {
+    return INSTANCE;
+  }
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/impl/cassandra/ElementSynchronizationStateRepositoryImpl.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/impl/cassandra/ElementSynchronizationStateRepositoryImpl.java
new file mode 100644
index 0000000..d41d3d7
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/impl/cassandra/ElementSynchronizationStateRepositoryImpl.java
@@ -0,0 +1,209 @@
+package org.openecomp.core.zusammen.plugin.dao.impl.cassandra;
+
+import com.amdocs.zusammen.datatypes.Id;
+import com.amdocs.zusammen.datatypes.SessionContext;
+import com.amdocs.zusammen.plugin.statestore.cassandra.dao.types.ElementEntityContext;
+import com.datastax.driver.core.ResultSet;
+import com.datastax.driver.core.Row;
+import com.datastax.driver.mapping.annotations.Accessor;
+import com.datastax.driver.mapping.annotations.Query;
+import org.openecomp.core.zusammen.plugin.dao.ElementSynchronizationStateRepository;
+import org.openecomp.core.zusammen.plugin.dao.types.SynchronizationStateEntity;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Optional;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+public class ElementSynchronizationStateRepositoryImpl
+    implements ElementSynchronizationStateRepository {
+
+  @Override
+  public Collection<SynchronizationStateEntity> list(SessionContext context,
+                                                     ElementEntityContext elementContext) {
+    List<Row> rows = getAccessor(context)
+        .list(elementContext.getSpace(),
+            elementContext.getItemId().toString(),
+            elementContext.getVersionId().toString()).all();
+    return rows == null ? new HashSet<>()
+        : rows.stream().map(this::getSynchronizationStateEntity).collect(Collectors.toSet());
+
+  }
+
+  @Override
+  public void create(SessionContext context, ElementEntityContext elementContext,
+                     SynchronizationStateEntity elementSyncState) {
+    update(context, elementContext.getSpace(),
+        elementContext.getItemId(),
+        elementContext.getVersionId(),
+        elementContext.getRevisionId(),
+        elementSyncState.getRevisionId(),
+        elementSyncState.getId(),
+        elementSyncState.getPublishTime(),
+        elementSyncState.isDirty()
+
+    );
+  }
+
+  @Override
+  public void update(SessionContext context, ElementEntityContext elementContext,
+                     SynchronizationStateEntity elementSyncState) {
+    update(context, elementContext.getSpace(),
+        elementContext.getItemId(),
+        elementContext.getVersionId(),
+        elementContext.getRevisionId(),
+        elementSyncState.getRevisionId(),
+        elementSyncState.getId(),
+        elementSyncState.getPublishTime(),
+        elementSyncState.isDirty()
+
+    );
+  }
+
+  @Override
+  public void markAsDirty(SessionContext context, ElementEntityContext elementContext,
+                          SynchronizationStateEntity elementSyncState) {
+
+
+      getAccessor(context).updateDirty(true,
+          elementContext.getSpace(),
+          elementContext.getItemId().toString(),
+          elementContext.getVersionId().toString(),
+          elementSyncState.getId().toString(),
+          elementContext.getRevisionId().getValue());
+
+      getVersionElementsAccessor(context).addDirtyElements(
+          Collections.singleton(elementSyncState.getId().toString()), elementContext.getSpace(),
+          elementContext.getItemId().toString(),
+          elementContext.getVersionId().toString(),
+          elementContext.getRevisionId().getValue());
+  }
+
+  @Override
+  public void delete(SessionContext context, ElementEntityContext elementContext,
+                     SynchronizationStateEntity elementSyncState) {
+    getAccessor(context).delete(elementContext.getSpace(),
+        elementContext.getItemId().toString(),
+        elementContext.getVersionId().toString(),
+        elementSyncState.getId().toString(),
+        elementContext.getRevisionId().getValue());
+
+    getVersionElementsAccessor(context).removeDirtyElements(
+        Collections.singleton(elementSyncState.getId().toString()), elementContext.getSpace(),
+        elementContext.getItemId().toString(),
+        elementContext.getVersionId().toString(),
+        elementContext.getRevisionId().getValue());
+  }
+
+  @Override
+  public Optional<SynchronizationStateEntity> get(SessionContext context,
+                                                  ElementEntityContext elementContext,
+                                                  SynchronizationStateEntity elementSyncState) {
+
+    Row row = getAccessor(context)
+        .get(elementContext.getSpace(),
+            elementContext.getItemId().toString(),
+            elementContext.getVersionId().toString(),
+            elementSyncState.getId().toString(),
+            elementSyncState.getRevisionId().getValue()).one();
+
+    return row == null ? Optional.empty() : Optional.of(getSynchronizationStateEntity(row));
+  }
+
+  private void update(SessionContext context, String space, Id itemId, Id versionId, Id
+      versionRevisionId,Id elementRevisionId,Id elementId, Date publishTime, boolean isDirty) {
+    getAccessor(context).update(publishTime,
+        isDirty,
+        space,
+        itemId.toString(),
+        versionId.toString(),
+        elementId.toString(),
+        elementRevisionId.getValue());
+
+    if (isDirty) {
+      getVersionElementsAccessor(context).addDirtyElements(
+          Collections.singleton(elementId.toString()), space,
+          itemId.toString(),
+          versionId.toString(),
+          versionRevisionId.getValue());
+    } else {
+      getVersionElementsAccessor(context).removeDirtyElements(
+          Collections.singleton(elementId.toString()), space,
+          itemId.toString(),
+          versionId.toString(),
+          versionRevisionId.getValue());
+    }
+  }
+
+
+  private SynchronizationStateEntity getSynchronizationStateEntity(Row row) {
+    SynchronizationStateEntity entity =
+        new SynchronizationStateEntity(new Id(row.getString(SynchronizationStateField.ID)),
+            new Id(row.getString(SynchronizationStateField.REVISION_ID)),
+            row.getDate(SynchronizationStateField.PUBLISH_TIME),
+            row.getBool(SynchronizationStateField.DIRTY));
+    entity.setRevisionId(new Id(row.getString(SynchronizationStateField.REVISION_ID)));
+
+    return entity;
+
+  }
+
+  private ElementSynchronizationStateAccessor getAccessor(SessionContext context) {
+    return CassandraDaoUtils.getAccessor(context, ElementSynchronizationStateAccessor.class);
+  }
+
+  private VersionElementsAccessor getVersionElementsAccessor(SessionContext context) {
+    return CassandraDaoUtils.getAccessor(context, VersionElementsAccessor.class);
+  }
+
+  @Accessor
+  interface ElementSynchronizationStateAccessor {
+    @Query("UPDATE element_synchronization_state SET publish_time=?, dirty=? " +
+        "WHERE space=? AND item_id=? AND version_id=? AND element_id=? AND revision_id = ? ")
+    void update(Date publishTime, boolean dirty, String space, String itemId, String versionId,
+                String elementId, String revisionId);
+
+    @Query("UPDATE element_synchronization_state SET dirty=? " +
+        "WHERE space=? AND item_id=? AND version_id=? AND element_id=? AND revision_id = ? ")
+    void updateDirty(boolean dirty, String space, String itemId, String versionId,
+                     String elementId, String revisionId);
+
+    @Query("DELETE FROM element_synchronization_state " +
+        "WHERE space=? AND item_id=? AND version_id=? AND element_id=? AND revision_id = ? ")
+    void delete(String space, String itemId, String versionId, String elementId, String revisionId);
+
+    @Query("SELECT element_id,revision_id, publish_time, dirty FROM element_synchronization_state" +
+        " WHERE space=? AND item_id=? AND version_id=?")
+    ResultSet list(String space, String itemId, String versionId);
+
+    @Query("SELECT element_id,revision_id, publish_time, dirty FROM element_synchronization_state" +
+        " WHERE space=? AND item_id=? AND version_id=? AND element_id=? AND revision_id = ?  ")
+    ResultSet get(String space, String itemId, String versionId, String elementId, String
+        revisionId);
+  }
+
+  private static final class SynchronizationStateField {
+    private static final String ID = "element_id";
+    private static final String PUBLISH_TIME = "publish_time";
+    private static final String DIRTY = "dirty";
+    private static final String REVISION_ID = "revision_id";
+  }
+
+  @Accessor
+  interface VersionElementsAccessor {
+
+    @Query("UPDATE version_elements SET dirty_element_ids=dirty_element_ids+? " +
+        "WHERE space=? AND item_id=? AND version_id=? AND revision_id=?")
+    void addDirtyElements(Set<String> elementIds, String space, String itemId, String versionId,
+                          String revisionId);
+
+    @Query("UPDATE version_elements SET dirty_element_ids=dirty_element_ids-? " +
+        "WHERE space=? AND item_id=? AND version_id=? AND revision_id=? ")
+    void removeDirtyElements(Set<String> elementIds, String space, String itemId, String
+        versionId, String revisionId);
+  }
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/impl/cassandra/VersionDaoFactoryImpl.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/impl/cassandra/VersionDaoFactoryImpl.java
new file mode 100644
index 0000000..60dc9d17
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/impl/cassandra/VersionDaoFactoryImpl.java
@@ -0,0 +1,15 @@
+package org.openecomp.core.zusammen.plugin.dao.impl.cassandra;
+
+import com.amdocs.zusammen.datatypes.SessionContext;
+import org.openecomp.core.zusammen.plugin.dao.VersionDao;
+import org.openecomp.core.zusammen.plugin.dao.VersionDaoFactory;
+
+public class VersionDaoFactoryImpl extends VersionDaoFactory {
+
+  private static final VersionDao INSTANCE = new VersionDaoImpl();
+
+  @Override
+  public VersionDao createInterface(SessionContext context) {
+    return INSTANCE;
+  }
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/impl/cassandra/VersionDaoImpl.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/impl/cassandra/VersionDaoImpl.java
new file mode 100644
index 0000000..bba2ddf
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/impl/cassandra/VersionDaoImpl.java
@@ -0,0 +1,185 @@
+package org.openecomp.core.zusammen.plugin.dao.impl.cassandra;
+
+import com.amdocs.zusammen.datatypes.Id;
+import com.amdocs.zusammen.datatypes.SessionContext;
+import com.datastax.driver.core.ResultSet;
+import com.datastax.driver.core.Row;
+import com.datastax.driver.mapping.annotations.Accessor;
+import com.datastax.driver.mapping.annotations.Query;
+import org.openecomp.core.zusammen.plugin.dao.VersionDao;
+import org.openecomp.core.zusammen.plugin.dao.types.VersionEntity;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.stream.Collectors;
+
+import static java.util.stream.Collectors.toMap;
+
+public class VersionDaoImpl implements VersionDao {
+
+  @Override
+  public void create(SessionContext context, String space, Id itemId, VersionEntity version) {
+    String baseVersion = version.getBaseId() != null ? version.getBaseId().toString() : null;
+
+    getAccessor(context)
+        .create(space, itemId.toString(), version.getId().toString(),
+            baseVersion,
+            version.getCreationTime(), version.getModificationTime());
+
+  }
+
+  @Override
+  public void delete(SessionContext context, String space, Id itemId, Id versionId) {
+
+    getAccessor(context).delete(space, itemId.toString(), versionId.toString());
+  }
+
+  @Override
+  public void updateModificationTime(SessionContext context, String space, Id itemId,
+                                     Id versionId, Date modificationTime) {
+    getAccessor(context)
+        .updateModificationTime(modificationTime, space, itemId.toString(), versionId.toString());
+  }
+
+
+  @Override
+  public Collection<VersionEntity> list(SessionContext context, String space, Id itemId) {
+    List<Row> rows = getAccessor(context).list(space, itemId.toString()).all();
+    return rows == null ? new ArrayList<>() :
+        rows.stream().map(VersionDaoImpl::convertToVersionEntity).collect(Collectors.toList());
+  }
+
+
+  @Override
+  public Optional<VersionEntity> get(SessionContext context, String space, Id itemId,
+                                     Id versionId) {
+    Row row;
+
+    row = getAccessor(context).get(space, itemId.toString(), versionId.toString()).one();
+
+
+    return row == null ? Optional.empty() : Optional.of(convertToVersionEntity(row));
+  }
+
+  @Override
+  public boolean checkHealth(SessionContext context) {
+    return getAccessor(context).checkHealth().getColumnDefinitions()
+        .contains(VersionField.VERSION_ID);
+  }
+
+  @Override
+  public void createVersionElements(SessionContext context, String space, Id itemId,
+                                    Id versionId, Id revisionId, Map<Id, Id> versionElementIds,
+                                    Date publishTime, String message) {
+    Map<String, String> elementIds = versionElementIds==null?null:versionElementIds.
+        entrySet().
+        stream().
+        collect(toMap((Map.Entry<Id, Id>entry)->entry.getKey().getValue(),
+                      (Map.Entry<Id, Id>entry)->entry.getValue().getValue()));
+
+    getVersionElementsAccessor(context).create(space,itemId.toString(),versionId.toString(),
+        revisionId.getValue(),elementIds,publishTime,message,context.getUser().getUserName());
+  }
+
+
+  private static VersionEntity convertToVersionEntity(Row row) {
+
+    /*Id revisionId =  row.getColumnDefinitions().contains("revision_id")?new Id(row.getString
+        (VersionField.REVISION_ID)):null;*/
+
+    VersionEntity version = new VersionEntity(new Id(row.getString(VersionField.VERSION_ID)));
+    return enrichVersionEntity(version, row);
+  }
+
+  static VersionEntity enrichVersionEntity(VersionEntity version, Row row) {
+    version.setBaseId(new Id(row.getString(VersionField.BASE_VERSION_ID)));
+    version.setCreationTime(row.getDate(VersionField.CREATION_TIME));
+    version.setModificationTime(row.getDate(VersionField.MODIFICATION_TIME));
+    return version;
+  }
+
+  private VersionAccessor getAccessor(SessionContext context) {
+    return CassandraDaoUtils.getAccessor(context, VersionAccessor.class);
+  }
+
+  private VersionElementsAccessor getVersionElementsAccessor(SessionContext context) {
+    return CassandraDaoUtils.getAccessor(context, VersionElementsAccessor.class);
+  }
+
+  @Accessor
+  interface VersionAccessor {
+
+    @Query(
+        "INSERT INTO version (space, item_id, version_id, base_version_id, " +
+            "creation_time, " +
+            "modification_time) " +
+            "VALUES (?, ?, ?, ?, ?, ?)")
+    void create(String space, String itemId, String versionId, String baseVersionId,
+                Date creationTime, Date modificationTime);
+
+    @Query("UPDATE version SET modification_time=? WHERE space=? AND item_id=? AND version_id=? ")
+    void updateModificationTime(Date modificationTime, String space, String itemId,
+                                String versionId);
+
+    @Query("DELETE FROM version WHERE space=? AND item_id=? AND version_id=? ")
+    void delete(String space, String itemId, String versionId);
+
+    @Query("SELECT version_id, base_version_id, creation_time, modification_time " +
+        "FROM version WHERE space=? AND item_id=? AND version_id=?  ")
+    ResultSet get(String space, String itemId, String versionId);
+
+    /*@Query("SELECT version_id, base_version_id, creation_time, modification_time " +
+        "FROM version WHERE space=? AND item_id=? AND version_id=? ")
+    ResultSet get(String space, String itemId, String versionId);*/
+
+
+    @Query("SELECT version_id, base_version_id, creation_time, modification_time " +
+        "FROM version WHERE space=? AND item_id=?")
+    ResultSet list(String space, String itemId);
+
+    @Query("SELECT version_id FROM version LIMIT 1")
+    ResultSet checkHealth();
+  }
+
+  private static final class VersionField {
+    private static final String VERSION_ID = "version_id";
+    private static final String BASE_VERSION_ID = "base_version_id";
+    private static final String CREATION_TIME = "creation_time";
+    private static final String MODIFICATION_TIME = "modification_time";
+    //private static final String REVISION_ID = "revision_id";
+  }
+
+  @Accessor
+  interface VersionElementsAccessor {
+
+    @Query("INSERT INTO version_elements (space,item_id,version_id,revision_id,element_ids," +
+        "publish_time,message,user) " +
+        "VALUES (?,?,?,?,?,?,?,?)")
+    void create(String space,
+                String itemId,
+                String versionId,
+                String versionRevisionId,
+                Map<String,String> elementIds,
+                Date publishTime,
+                String message,
+                String user);
+
+
+
+  }
+
+ /* public static final class VersionElementsField {
+    private static final String SPACE = "space";
+    private static final String ITEM_ID = "item_id";
+    private static final String VERSION_ID = "version_id";
+    private static final String ELEMENT_IDS = "element_ids";
+    private static final String REVISION_ID = "revision_id";
+
+  }*/
+
+
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/impl/cassandra/VersionStageRepositoryFactoryImpl.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/impl/cassandra/VersionStageRepositoryFactoryImpl.java
new file mode 100644
index 0000000..547bf6a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/impl/cassandra/VersionStageRepositoryFactoryImpl.java
@@ -0,0 +1,15 @@
+package org.openecomp.core.zusammen.plugin.dao.impl.cassandra;
+
+import com.amdocs.zusammen.datatypes.SessionContext;
+import org.openecomp.core.zusammen.plugin.dao.VersionStageRepository;
+import org.openecomp.core.zusammen.plugin.dao.VersionStageRepositoryFactory;
+
+public class VersionStageRepositoryFactoryImpl extends VersionStageRepositoryFactory {
+
+  private static final VersionStageRepository INSTANCE = new VersionStageRepositoryImpl();
+
+  @Override
+  public VersionStageRepository createInterface(SessionContext context) {
+    return INSTANCE;
+  }
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/impl/cassandra/VersionStageRepositoryImpl.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/impl/cassandra/VersionStageRepositoryImpl.java
new file mode 100644
index 0000000..353f37b
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/impl/cassandra/VersionStageRepositoryImpl.java
@@ -0,0 +1,82 @@
+package org.openecomp.core.zusammen.plugin.dao.impl.cassandra;
+
+import com.amdocs.zusammen.datatypes.SessionContext;
+import com.amdocs.zusammen.datatypes.item.Action;
+import com.datastax.driver.core.ResultSet;
+import com.datastax.driver.core.Row;
+import com.datastax.driver.mapping.annotations.Accessor;
+import com.datastax.driver.mapping.annotations.Query;
+import org.openecomp.core.zusammen.plugin.dao.VersionStageRepository;
+import org.openecomp.core.zusammen.plugin.dao.types.StageEntity;
+import org.openecomp.core.zusammen.plugin.dao.types.VersionContext;
+import org.openecomp.core.zusammen.plugin.dao.types.VersionEntity;
+
+import java.util.Date;
+import java.util.Optional;
+
+public class VersionStageRepositoryImpl implements VersionStageRepository {
+
+  @Override
+  public Optional<StageEntity<VersionEntity>> get(SessionContext context,
+                                                  VersionContext entityContext,
+                                                  VersionEntity entity) {
+    Row row = getAccessor(context)
+        .get(entityContext.getSpace(), entityContext.getItemId().toString(),
+            entity.getId().toString()).one();
+    return row == null ? Optional.empty() : Optional.of(convertToVersionStage(entity, row));
+  }
+
+  @Override
+  public void create(SessionContext context, VersionContext entityContext,
+                     StageEntity<VersionEntity> stageEntity) {
+    VersionEntity entity = stageEntity.getEntity();
+    getAccessor(context).create(entityContext.getSpace(),
+        entityContext.getItemId().toString(),
+        entity.getId().toString(),
+        entity.getBaseId() == null ? null : entity.getBaseId().toString(),
+        entity.getCreationTime() == null ? null : entity.getCreationTime(),
+        entity.getModificationTime() == null ? null : entity.getModificationTime(),
+        stageEntity.getPublishTime(),
+        stageEntity.getAction());
+  }
+
+  @Override
+  public void delete(SessionContext context, VersionContext entityContext, VersionEntity entity) {
+    getAccessor(context).delete(entityContext.getSpace(), entityContext.getItemId().toString(),
+        entity.getId().toString());
+  }
+
+  private StageEntity<VersionEntity> convertToVersionStage(VersionEntity version, Row row) {
+    StageEntity<VersionEntity> versionStage =
+        new StageEntity<>(VersionDaoImpl.enrichVersionEntity(version, row),
+            row.getDate(VersionStageField.PUBLISH_TIME));
+    versionStage.setAction(Action.valueOf(row.getString(VersionStageField.ACTION)));
+    return versionStage;
+  }
+
+  private VersionStageAccessor getAccessor(SessionContext context) {
+    return CassandraDaoUtils.getAccessor(context, VersionStageAccessor.class);
+  }
+
+  @Accessor
+  interface VersionStageAccessor {
+
+    @Query("INSERT INTO version_stage (space, item_id, version_id, base_version_id, " +
+        "creation_time, modification_time, publish_time, action) " +
+        "VALUES (?, ?, ?, ?, ?, ?, ?, ?)")
+    void create(String space, String itemId, String versionId, String baseVersionId,
+                Date creationTime, Date modificationTime, Date publishTime, Action action);
+
+    @Query("DELETE FROM version_stage WHERE space=? AND item_id=? AND version_id=?")
+    void delete(String space, String itemId, String versionId);
+
+    @Query("SELECT base_version_id, creation_time, modification_time, publish_time, action " +
+        "FROM  version_stage WHERE space=? AND item_id=? AND version_id=?")
+    ResultSet get(String space, String itemId, String versionId);
+  }
+
+  private static final class VersionStageField {
+    private static final String PUBLISH_TIME = "publish_time";
+    private static final String ACTION = "action";
+  }
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/impl/cassandra/VersionSynchronizationStateRepositoryFactoryImpl.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/impl/cassandra/VersionSynchronizationStateRepositoryFactoryImpl.java
new file mode 100644
index 0000000..95c3ec2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/impl/cassandra/VersionSynchronizationStateRepositoryFactoryImpl.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright © 2016-2017 European Support Limited
+ *
+ * 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.
+ */
+
+package org.openecomp.core.zusammen.plugin.dao.impl.cassandra;
+
+import com.amdocs.zusammen.datatypes.SessionContext;
+import org.openecomp.core.zusammen.plugin.dao.VersionSynchronizationStateRepository;
+import org.openecomp.core.zusammen.plugin.dao.VersionSynchronizationStateRepositoryFactory;
+
+public class VersionSynchronizationStateRepositoryFactoryImpl
+    extends VersionSynchronizationStateRepositoryFactory {
+
+  private static final VersionSynchronizationStateRepository INSTANCE =
+      new VersionSynchronizationStateRepositoryImpl();
+
+  @Override
+  public VersionSynchronizationStateRepository createInterface(SessionContext context) {
+    return INSTANCE;
+  }
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/impl/cassandra/VersionSynchronizationStateRepositoryImpl.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/impl/cassandra/VersionSynchronizationStateRepositoryImpl.java
new file mode 100644
index 0000000..5fb9779
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/impl/cassandra/VersionSynchronizationStateRepositoryImpl.java
@@ -0,0 +1,137 @@
+package org.openecomp.core.zusammen.plugin.dao.impl.cassandra;
+
+import com.amdocs.zusammen.datatypes.Id;
+import com.amdocs.zusammen.datatypes.SessionContext;
+import com.datastax.driver.core.ResultSet;
+import com.datastax.driver.core.Row;
+import com.datastax.driver.mapping.annotations.Accessor;
+import com.datastax.driver.mapping.annotations.Query;
+import org.openecomp.core.zusammen.plugin.dao.VersionSynchronizationStateRepository;
+import org.openecomp.core.zusammen.plugin.dao.types.SynchronizationStateEntity;
+import org.openecomp.core.zusammen.plugin.dao.types.VersionContext;
+import org.openecomp.core.zusammen.plugin.dao.types.VersionEntity;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Optional;
+import java.util.stream.Collectors;
+
+public class VersionSynchronizationStateRepositoryImpl
+    implements VersionSynchronizationStateRepository {
+
+  @Override
+  public void create(SessionContext context, VersionContext entityContext,
+                     SynchronizationStateEntity syncStateEntity) {
+    updatePublishTime(context, entityContext, syncStateEntity);
+  }
+
+  @Override
+  public void updatePublishTime(SessionContext context, VersionContext entityContext,
+                                SynchronizationStateEntity syncStateEntity) {
+    getAccessor(context)
+        .updatePublishTime(syncStateEntity.getPublishTime(), entityContext.getSpace(),
+            entityContext.getItemId().toString(), syncStateEntity.getId().toString(),
+            syncStateEntity.getRevisionId().getValue());
+  }
+
+  @Override
+  public List<SynchronizationStateEntity> list(SessionContext context, VersionContext
+      entityContext, VersionEntity versionEntity) {
+
+    List<Row> rows = getAccessor(context).list(entityContext.getSpace(), entityContext.getItemId().toString
+        (),versionEntity.getId().toString()).all();
+    return rows == null ? new ArrayList<>():
+        rows.stream().map(VersionSynchronizationStateRepositoryImpl::getSynchronizationStateEntity).collect(Collectors.toList());
+  }
+
+
+
+  /*@Override
+  public List<SynchronizationStateEntity> listRevisions(SessionContext context,
+                                                        VersionContext entityContext,
+                                                        SynchronizationStateEntity syncStateEntity) {
+    List<Row> rows = getAccessor(context).list(entityContext.getSpace(), entityContext.getItemId()
+        .toString(), syncStateEntity.getId().toString()).all();
+    return rows == null ? new ArrayList<>() :rows.stream()
+        .map(VersionSynchronizationStateRepositoryImpl::getSynchronizationStateEntity)
+        .collect(Collectors.toList());
+
+
+
+
+    //forEach(row -> getSynchronizationStateEntity(syncStateEntity.getId(), row));
+
+
+  }*/
+
+
+  @Override
+  public void delete(SessionContext context, VersionContext entityContext,
+                     SynchronizationStateEntity syncStateEntity) {
+    // done by version dao
+  }
+
+  @Override
+  public Optional<SynchronizationStateEntity> get(SessionContext context,
+                                                  VersionContext entityContext,
+                                                  SynchronizationStateEntity syncStateEntity) {
+    Row row =
+        getAccessor(context).get(entityContext.getSpace(), entityContext.getItemId().toString(),
+            syncStateEntity.getId().toString(), syncStateEntity.getRevisionId().getValue()).one();
+
+    return row == null ? Optional.empty()
+        : Optional.of(getSynchronizationStateEntity(syncStateEntity.getId(), row));
+  }
+
+  private SynchronizationStateEntity getSynchronizationStateEntity(Id entityId, Row row) {
+    SynchronizationStateEntity syncStateEntity = new SynchronizationStateEntity(entityId,
+        new Id(row.getString(REVISION_ID_FIELD)));
+    syncStateEntity.setPublishTime(row.getDate(PUBLISH_TIME_FIELD));
+    syncStateEntity.setDirty(!row.getSet(DIRTY_ELEMENT_FIELD, String.class).isEmpty());
+    return syncStateEntity;
+  }
+
+  private static SynchronizationStateEntity getSynchronizationStateEntity(Row row) {
+    Id entityId = new Id(row.getColumnDefinitions().contains("version_id") ? row.getString
+        ("version_id") : row.getString("element_id"));
+    SynchronizationStateEntity syncStateEntity = new SynchronizationStateEntity(entityId,
+        new Id(row.getString(REVISION_ID_FIELD)));
+    syncStateEntity.setPublishTime(row.getDate(PUBLISH_TIME_FIELD));
+    syncStateEntity.setDirty(!row.getSet(DIRTY_ELEMENT_FIELD, String.class).isEmpty());
+    syncStateEntity.setRevisionId(new Id(row.getString(REVISION_ID_FIELD)));
+    syncStateEntity.setUser(row.getString(USER));
+    syncStateEntity.setMessage(row.getString(MESSAGE));
+    return syncStateEntity;
+  }
+
+  private VersionSyncStateAccessor getAccessor(SessionContext context) {
+    return CassandraDaoUtils.getAccessor(context, VersionSyncStateAccessor.class);
+  }
+
+  @Accessor
+  interface VersionSyncStateAccessor {
+    @Query(
+        "UPDATE version_elements SET publish_time=? WHERE space=? AND item_id=? AND version_id=? " +
+            "AND revision_id=? ")
+    void updatePublishTime(Date publishTime, String space, String itemId, String versionId, String
+        revisionId);
+
+    @Query("SELECT version_id,revision_id,publish_time, dirty_element_ids FROM version_elements " +
+        "WHERE space=? AND item_id=? AND version_id=? AND revision_id=? ")
+    ResultSet get(String space, String itemId, String versionId, String revisionId);
+
+    @Query("SELECT version_id,revision_id,publish_time,user,message, dirty_element_ids FROM " +
+        "version_elements " +
+        "WHERE space=? AND item_id=? AND version_id=? ")
+    ResultSet list(String space, String itemId, String versionId);
+
+  }
+
+
+  private static final String PUBLISH_TIME_FIELD = "publish_time";
+  private static final String DIRTY_ELEMENT_FIELD = "dirty_element_ids";
+  private static final String REVISION_ID_FIELD = "revision_id";
+  private static final String USER = "user";
+  private static final String MESSAGE = "message";
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/types/ElementEntity.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/types/ElementEntity.java
index 1663d83..1cd1510 100644
--- a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/types/ElementEntity.java
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/types/ElementEntity.java
@@ -30,6 +30,7 @@
   private Id id;
   private Id parentId;
   private Namespace namespace;
+  private Id elementHash;
   private Info info;
   private Collection<Relation> relations = Collections.emptyList();
   private ByteBuffer data;
@@ -41,6 +42,10 @@
     this.id = id;
   }
 
+  public Id getId() {
+    return id;
+  }
+
   public Id getParentId() {
     return parentId;
   }
@@ -49,14 +54,6 @@
     this.parentId = parentId;
   }
 
-  public Id getId() {
-    return id;
-  }
-
-  public void setId(Id id) {
-    this.id = id;
-  }
-
   public Namespace getNamespace() {
     return namespace;
   }
@@ -127,8 +124,17 @@
     return id.equals(that.id);
   }
 
+  public Id getElementHash() {
+    return elementHash;
+  }
+
+  public void setElementHash(Id elementHash) {
+    this.elementHash = elementHash;
+  }
+
   @Override
   public int hashCode() {
     return id.hashCode();
   }
+
 }
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/types/StageEntity.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/types/StageEntity.java
new file mode 100644
index 0000000..58ac0a9
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/types/StageEntity.java
@@ -0,0 +1,60 @@
+package org.openecomp.core.zusammen.plugin.dao.types;
+
+import com.amdocs.zusammen.datatypes.item.Action;
+
+import java.util.Collections;
+import java.util.Date;
+import java.util.Set;
+
+public class StageEntity<E> {
+  private E entity;
+  private Date publishTime;
+  private Action action = Action.IGNORE;
+  private boolean conflicted;
+  private Set<E> conflictDependents = Collections.emptySet();
+
+  // used by sync on stage creation
+  public StageEntity(E entity, Date publishTime) {
+    this.entity = entity;
+    this.publishTime = publishTime;
+  }
+
+  public StageEntity(E entity, Date publishTime, Action action, boolean conflicted) {
+    this.entity = entity;
+    this.publishTime = publishTime;
+    this.action = action;
+    this.conflicted = conflicted;
+  }
+
+  public E getEntity() {
+    return entity;
+  }
+
+  public Date getPublishTime() {
+    return publishTime;
+  }
+
+  public Action getAction() {
+    return action;
+  }
+
+  public void setAction(Action action) {
+    this.action = action;
+  }
+
+  public boolean isConflicted() {
+    return conflicted;
+  }
+
+  public void setConflicted(boolean conflicted) {
+    this.conflicted = conflicted;
+  }
+
+  public Set<E> getConflictDependents() {
+    return conflictDependents;
+  }
+
+  public void setConflictDependents(Set<E> conflictDependents) {
+    this.conflictDependents = conflictDependents;
+  }
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/types/SynchronizationStateEntity.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/types/SynchronizationStateEntity.java
new file mode 100644
index 0000000..510cef8
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/types/SynchronizationStateEntity.java
@@ -0,0 +1,116 @@
+/*
+ * Copyright © 2016-2017 European Support Limited
+ *
+ * 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.
+ */
+
+package org.openecomp.core.zusammen.plugin.dao.types;
+
+import com.amdocs.zusammen.datatypes.Id;
+
+import java.util.Date;
+
+/**
+ * Synchronization state of an entity:
+ * <ul>
+ * <li>On private entity edit (create/update/delete): marked as dirty</li>
+ * <li>On entity publication:
+ * <ul>
+ * <li>if the private entity exists - updated with the publish time, marked as not dirty</li>
+ * <li>Otherwise - deleted</li>
+ * </ul>
+ * </li>
+ * </ul>
+ */
+public class SynchronizationStateEntity {
+  private Id id;
+  private Id revisionId;
+  private Date publishTime;
+  private boolean dirty;
+  private String user;
+  private String message;
+
+  public SynchronizationStateEntity(Id id,Id revisionId) {
+    this.id = id;
+    this.revisionId = revisionId;
+  }
+
+  public SynchronizationStateEntity(Id id,Id revisionId, Date publishTime, boolean dirty) {
+    this(id,revisionId);
+    this.publishTime = publishTime;
+    this.dirty = dirty;
+  }
+
+  public Id getId() {
+    return id;
+  }
+
+  public Date getPublishTime() {
+    return publishTime;
+  }
+
+  public void setPublishTime(Date publishTime) {
+    this.publishTime = publishTime;
+  }
+
+  public boolean isDirty() {
+    return dirty;
+  }
+
+  public void setDirty(boolean dirty) {
+    this.dirty = dirty;
+  }
+
+  public Id getRevisionId() {
+    return revisionId;
+  }
+
+  public void setRevisionId(Id revisionId) {
+    this.revisionId = revisionId;
+  }
+
+  public String getUser() {
+    return user;
+  }
+
+  public void setUser(String user) {
+    this.user = user;
+  }
+
+  public String getMessage() {
+    return message;
+  }
+
+  public void setMessage(String message) {
+    this.message = message;
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (this == o) {
+      return true;
+    }
+    if (o == null || getClass() != o.getClass()) {
+      return false;
+    }
+
+    SynchronizationStateEntity that = (SynchronizationStateEntity) o;
+
+    return id.equals(that.id);
+  }
+
+  @Override
+  public int hashCode() {
+    return id.hashCode();
+  }
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/types/VersionContext.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/types/VersionContext.java
new file mode 100644
index 0000000..41a3e66
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/types/VersionContext.java
@@ -0,0 +1,23 @@
+package org.openecomp.core.zusammen.plugin.dao.types;
+
+import com.amdocs.zusammen.datatypes.Id;
+
+public class VersionContext {
+  private String space;
+  private Id itemId;
+
+
+  public VersionContext(String space, Id itemId) {
+    this.space = space;
+    this.itemId = itemId;
+  }
+
+  public String getSpace() {
+    return space;
+  }
+
+  public Id getItemId() {
+    return itemId;
+  }
+
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/types/VersionDataElement.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/types/VersionDataElement.java
new file mode 100644
index 0000000..48a52c0
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/types/VersionDataElement.java
@@ -0,0 +1,21 @@
+package org.openecomp.core.zusammen.plugin.dao.types;
+
+import com.amdocs.zusammen.datatypes.Id;
+import com.amdocs.zusammen.datatypes.item.ItemVersionData;
+import org.openecomp.core.zusammen.plugin.ZusammenPluginConstants;
+
+import static org.openecomp.core.zusammen.plugin.ZusammenPluginUtil.calculateElementHash;
+
+public class VersionDataElement extends ElementEntity {
+
+  public VersionDataElement() {
+    super(ZusammenPluginConstants.ROOT_ELEMENTS_PARENT_ID);
+  }
+
+  public VersionDataElement(ItemVersionData itemVersionData) {
+    this();
+    setInfo(itemVersionData.getInfo());
+    setRelations(itemVersionData.getRelations());
+    setElementHash(new Id(calculateElementHash(this)));
+  }
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/types/VersionEntity.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/types/VersionEntity.java
new file mode 100644
index 0000000..aeed998
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/dao/types/VersionEntity.java
@@ -0,0 +1,45 @@
+package org.openecomp.core.zusammen.plugin.dao.types;
+
+import com.amdocs.zusammen.datatypes.Id;
+
+import java.util.Date;
+
+public class VersionEntity {
+  private Id id;
+  private Id baseId;
+  private Date creationTime;
+  private Date modificationTime;
+
+  public VersionEntity(Id id) {
+    this.id = id;
+  }
+
+  public Id getId() {
+    return id;
+  }
+
+  public Id getBaseId() {
+    return baseId;
+  }
+
+  public void setBaseId(Id baseId) {
+    this.baseId = baseId;
+  }
+
+  public Date getCreationTime() {
+    return creationTime;
+  }
+
+  public void setCreationTime(Date creationTime) {
+    this.creationTime = creationTime;
+  }
+
+  public Date getModificationTime() {
+    return modificationTime;
+  }
+
+  public void setModificationTime(Date modificationTime) {
+    this.modificationTime = modificationTime;
+  }
+
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/main/CassandraCollaborationStorePluginImpl.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/main/CassandraCollaborationStorePluginImpl.java
index 90fd336..f9b6522 100644
--- a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/main/CassandraCollaborationStorePluginImpl.java
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/main/CassandraCollaborationStorePluginImpl.java
@@ -21,132 +21,297 @@
 import com.amdocs.zusammen.datatypes.Id;
 import com.amdocs.zusammen.datatypes.Namespace;
 import com.amdocs.zusammen.datatypes.SessionContext;
+import com.amdocs.zusammen.datatypes.Space;
+import com.amdocs.zusammen.datatypes.item.Action;
 import com.amdocs.zusammen.datatypes.item.ElementContext;
 import com.amdocs.zusammen.datatypes.item.Info;
+import com.amdocs.zusammen.datatypes.item.ItemVersion;
 import com.amdocs.zusammen.datatypes.item.ItemVersionData;
-import com.amdocs.zusammen.datatypes.itemversion.ItemVersionHistory;
+import com.amdocs.zusammen.datatypes.item.ItemVersionDataConflict;
+import com.amdocs.zusammen.datatypes.item.ItemVersionStatus;
+import com.amdocs.zusammen.datatypes.item.Resolution;
+import com.amdocs.zusammen.datatypes.itemversion.ItemVersionRevisions;
+import com.amdocs.zusammen.datatypes.itemversion.Revision;
 import com.amdocs.zusammen.datatypes.itemversion.Tag;
+import com.amdocs.zusammen.datatypes.response.ErrorCode;
+import com.amdocs.zusammen.datatypes.response.Module;
 import com.amdocs.zusammen.datatypes.response.Response;
+import com.amdocs.zusammen.datatypes.response.ReturnCode;
 import com.amdocs.zusammen.datatypes.response.ZusammenException;
 import com.amdocs.zusammen.sdk.collaboration.CollaborationStore;
 import com.amdocs.zusammen.sdk.collaboration.types.CollaborationElement;
+import com.amdocs.zusammen.sdk.collaboration.types.CollaborationElementChange;
+import com.amdocs.zusammen.sdk.collaboration.types.CollaborationElementConflict;
+import com.amdocs.zusammen.sdk.collaboration.types.CollaborationItemVersionConflict;
 import com.amdocs.zusammen.sdk.collaboration.types.CollaborationMergeChange;
 import com.amdocs.zusammen.sdk.collaboration.types.CollaborationMergeResult;
 import com.amdocs.zusammen.sdk.collaboration.types.CollaborationPublishResult;
-import org.openecomp.core.zusammen.plugin.collaboration.ElementCollaborationStore;
-import org.openecomp.core.zusammen.plugin.collaboration.VersionCollaborationStore;
+import com.amdocs.zusammen.sdk.types.ElementConflictDescriptor;
+import com.amdocs.zusammen.sdk.types.ElementDescriptor;
+import org.openecomp.core.zusammen.plugin.ZusammenPluginUtil;
+import org.openecomp.core.zusammen.plugin.collaboration.CommitStagingService;
+import org.openecomp.core.zusammen.plugin.collaboration.ElementPrivateStore;
+import org.openecomp.core.zusammen.plugin.collaboration.ElementPublicStore;
+import org.openecomp.core.zusammen.plugin.collaboration.ElementStageStore;
+import org.openecomp.core.zusammen.plugin.collaboration.PublishService;
+import org.openecomp.core.zusammen.plugin.collaboration.RevertService;
+import org.openecomp.core.zusammen.plugin.collaboration.SyncService;
+import org.openecomp.core.zusammen.plugin.collaboration.VersionPrivateStore;
+import org.openecomp.core.zusammen.plugin.collaboration.VersionPublicStore;
+import org.openecomp.core.zusammen.plugin.collaboration.VersionStageStore;
+import org.openecomp.core.zusammen.plugin.collaboration.impl.ElementPrivateStoreImpl;
+import org.openecomp.core.zusammen.plugin.collaboration.impl.ElementPublicStoreImpl;
+import org.openecomp.core.zusammen.plugin.collaboration.impl.ElementStageStoreImpl;
+import org.openecomp.core.zusammen.plugin.collaboration.impl.VersionPrivateStoreImpl;
+import org.openecomp.core.zusammen.plugin.collaboration.impl.VersionPublicStoreImpl;
+import org.openecomp.core.zusammen.plugin.collaboration.impl.VersionStageStoreImpl;
+import org.openecomp.core.zusammen.plugin.dao.types.ElementEntity;
+import org.openecomp.core.zusammen.plugin.dao.types.StageEntity;
+import org.openecomp.core.zusammen.plugin.dao.types.SynchronizationStateEntity;
+import org.openecomp.core.zusammen.plugin.dao.types.VersionDataElement;
+import org.openecomp.core.zusammen.plugin.dao.types.VersionEntity;
 
 import java.util.Collection;
+import java.util.Date;
+import java.util.List;
+import java.util.Optional;
+import java.util.stream.Collectors;
+
+import static com.amdocs.zusammen.datatypes.item.SynchronizationStatus.MERGING;
+import static com.amdocs.zusammen.datatypes.item.SynchronizationStatus.OUT_OF_SYNC;
+import static com.amdocs.zusammen.datatypes.item.SynchronizationStatus.UP_TO_DATE;
+import static org.openecomp.core.zusammen.plugin.ZusammenPluginConstants.ROOT_ELEMENTS_PARENT_ID;
+import static org.openecomp.core.zusammen.plugin.ZusammenPluginUtil.convertToCollaborationElement;
+import static org.openecomp.core.zusammen.plugin.ZusammenPluginUtil.convertToElementChange;
+import static org.openecomp.core.zusammen.plugin.ZusammenPluginUtil.convertToElementDescriptor;
+import static org.openecomp.core.zusammen.plugin.ZusammenPluginUtil.convertToElementEntity;
+import static org.openecomp.core.zusammen.plugin.ZusammenPluginUtil.convertToItemVersion;
+import static org.openecomp.core.zusammen.plugin.ZusammenPluginUtil.convertToVersionData;
+import static org.openecomp.core.zusammen.plugin.ZusammenPluginUtil.convertToVersionEntity;
 
 public class CassandraCollaborationStorePluginImpl implements CollaborationStore {
+  // TODO: 8/15/2017 inject
 
-  private VersionCollaborationStore versionCollaborationStore = new VersionCollaborationStore();
-  private ElementCollaborationStore elementCollaborationStore = new ElementCollaborationStore();
+  private VersionPrivateStore versionPrivateStore = new VersionPrivateStoreImpl();
+  private VersionPublicStore versionPublicStore = new VersionPublicStoreImpl();
+  private VersionStageStore versionStageStore = new VersionStageStoreImpl();
+
+  private ElementPrivateStore elementPrivateStore = new ElementPrivateStoreImpl();
+  private ElementPublicStore elementPublicStore = new ElementPublicStoreImpl();
+  private ElementStageStore elementStageStore = new ElementStageStoreImpl();
+
+  // TODO: 9/4/2017
+  private CommitStagingService commitStagingService =
+      new CommitStagingService(versionPrivateStore, versionStageStore, elementPrivateStore,
+          elementStageStore);
+  private PublishService publishService =
+      new PublishService(versionPublicStore, versionPrivateStore, elementPublicStore,
+          elementPrivateStore);
+  private SyncService syncService =
+      new SyncService(versionPublicStore, versionPrivateStore, versionStageStore,
+          elementPublicStore, elementPrivateStore, elementStageStore);
+
+  private RevertService revertService =
+      new RevertService(elementPublicStore, elementPrivateStore);
 
   @Override
-  public Response<Void> createItem(SessionContext context, Id id, Info info) {
+  public Response<Void> createItem(SessionContext context, Id itemId, Info info) {
     // done by state store
     return new Response(Void.TYPE);
   }
 
   @Override
-  public Response<Void> deleteItem(SessionContext context, Id id) {
+  public Response<Void> deleteItem(SessionContext context, Id itemId) {
     // done by state store
     return new Response(Void.TYPE);
   }
 
   @Override
-  public Response<Void> createItemVersion(SessionContext context, Id itemId, Id versionId, Id id2,
-                                          ItemVersionData itemVersionData) {
-    // done by state store
+  public Response<Void> createItemVersion(SessionContext context, Id itemId, Id baseVersionId,
+                                          Id versionId, ItemVersionData itemVersionData) {
+    Date creationTime = new Date();
+    versionPrivateStore.create(context, itemId,
+        convertToVersionEntity(versionId, baseVersionId, creationTime, creationTime));
+
+    ElementContext elementContext = new ElementContext(itemId, versionId);
+    VersionDataElement versionData = new VersionDataElement(itemVersionData);
+
+    if (baseVersionId == null) {
+      elementPrivateStore.create(context, elementContext, versionData);
+    } else {
+      copyElements(context, new ElementContext(itemId, baseVersionId), elementContext);
+      elementPrivateStore.update(context, elementContext, versionData);
+    }
+
     return new Response(Void.TYPE);
   }
 
   @Override
   public Response<Void> updateItemVersion(SessionContext context, Id itemId, Id versionId,
                                           ItemVersionData itemVersionData) {
-    // done by state store
+
+    if (elementPrivateStore.update(context, new ElementContext(itemId, versionId),
+        new VersionDataElement(itemVersionData))) {
+
+      VersionEntity version = new VersionEntity(versionId);
+      version.setModificationTime(new Date());
+      versionPrivateStore.update(context, itemId, version);
+    }
+
     return new Response(Void.TYPE);
   }
 
   @Override
   public Response<Void> deleteItemVersion(SessionContext context, Id itemId, Id versionId) {
-    // done by state store
+    elementPrivateStore
+        .delete(context, new ElementContext(itemId, versionId), new VersionDataElement());
+
+    versionPrivateStore.delete(context, itemId, new VersionEntity(versionId));
     return new Response(Void.TYPE);
   }
 
   @Override
-  public Response<Void> tagItemVersion(SessionContext context, Id itemId, Id versionId, Id changeId,
+  public Response<ItemVersionStatus> getItemVersionStatus(SessionContext context, Id itemId,
+                                                          Id versionId) {
+    if (versionStageStore.get(context, itemId, new VersionEntity(versionId)).isPresent()) {
+      return new Response<>(new ItemVersionStatus(MERGING, true));
+    }
+
+    Optional<SynchronizationStateEntity> publicSyncState =
+        versionPublicStore.getSynchronizationState(context, itemId, versionId);
+
+    if (!publicSyncState.isPresent()) {
+      return new Response<>(new ItemVersionStatus(UP_TO_DATE, true));
+    }
+
+    SynchronizationStateEntity privateSyncState =
+        versionPrivateStore.getSynchronizationState(context, itemId, versionId)
+            // TODO: 7/18/2017 ?
+            .orElseThrow(() -> new IllegalStateException("private version must exist"));
+
+    return new Response<>(new ItemVersionStatus(
+        privateSyncState.getPublishTime().equals(publicSyncState.get().getPublishTime())
+            ? UP_TO_DATE
+            : OUT_OF_SYNC,
+        privateSyncState.isDirty()));
+  }
+
+  @Override
+  public Response<Void> tagItemVersion(SessionContext context, Id itemId, Id versionId,
+                                       Id revisionId,
                                        Tag tag) {
-    versionCollaborationStore.tagItemVersion(context, itemId, versionId, changeId, tag);
+   /* if (revisionId != null) {
+      throw new UnsupportedOperationException(
+          "In this plugin implementation tag is supported only on versionId");
+    }
+
+    copyElements(context,
+        new ElementContext(itemId, versionId),
+        new ElementContext(itemId, versionId, tag.getName()));*/
+
     return new Response(Void.TYPE);
   }
 
   @Override
   public Response<CollaborationPublishResult> publishItemVersion(SessionContext context,
                                                                  Id itemId, Id versionId,
-                                                                 String s) {
-    throw new UnsupportedOperationException("publishItemVersion");
+                                                                 String message) {
+    try {
+      return new Response<>(publishService.publish(context, itemId, versionId, message));
+    } catch (ZusammenException ze) {
+      return new Response<>(
+          new ReturnCode(ErrorCode.CL_ITEM_VERSION_PUBLISH, Module.ZCSP, null, ze.getReturnCode()));
+    }
   }
 
   @Override
-  public Response<CollaborationMergeResult> syncItemVersion(SessionContext context, Id id,
-                                                            Id id1) {
-    throw new UnsupportedOperationException("syncItemVersion");
+  public Response<CollaborationMergeResult> syncItemVersion(SessionContext context, Id itemId,
+                                                            Id versionId) {
+    CollaborationMergeResult result = syncService.sync(context, itemId, versionId, false);
+    commitStagingService.commitStaging(context, itemId, versionId);
+
+    return new Response<>(result);
   }
 
   @Override
-  public Response<CollaborationMergeResult> mergeItemVersion(SessionContext context, Id id,
-                                                             Id id1, Id id2) {
+  public Response<CollaborationMergeResult> forceSyncItemVersion(SessionContext context, Id itemId,
+                                                                 Id versionId) {
+    CollaborationMergeResult result = syncService.sync(context, itemId, versionId, true);
+    commitStagingService.commitStaging(context, itemId, versionId);
+
+    return new Response<>(result);
+  }
+
+  @Override
+  public Response<CollaborationMergeResult> mergeItemVersion(SessionContext context, Id itemId,
+                                                             Id versionId, Id sourceVersionId) {
     throw new UnsupportedOperationException("mergeItemVersion");
   }
 
   @Override
-  public Response<ItemVersionHistory> listItemVersionHistory(SessionContext context, Id id,
-                                                             Id id1) {
-    throw new UnsupportedOperationException("listItemVersionHistory");
+  public Response<CollaborationItemVersionConflict> getItemVersionConflict(SessionContext context,
+                                                                           Id itemId,
+                                                                           Id versionId) {
+    ElementContext elementContext = new ElementContext(itemId, versionId, Id.ZERO);
+
+    Collection<StageEntity<ElementEntity>> conflictedStagedElementDescriptors =
+        elementStageStore.listConflictedDescriptors(context, elementContext);
+
+    CollaborationItemVersionConflict result = new CollaborationItemVersionConflict();
+    for (StageEntity<ElementEntity> stagedElementDescriptor : conflictedStagedElementDescriptors) {
+      if (ROOT_ELEMENTS_PARENT_ID.equals(stagedElementDescriptor.getEntity().getId())) {
+        result.setVersionDataConflict(
+            getVersionDataConflict(context, elementContext, stagedElementDescriptor));
+      } else {
+        result.getElementConflictDescriptors()
+            .add(getElementConflictDescriptor(context, elementContext, stagedElementDescriptor));
+      }
+    }
+    return new Response<>(result);
   }
 
   @Override
-  public Response<CollaborationMergeChange> resetItemVersionHistory(SessionContext context,
-                                                                    Id itemId, Id versionId,
-                                                                    String changeRef) {
-    return new Response<>(versionCollaborationStore.resetItemVersionHistory(context, itemId, versionId, changeRef));
+  public Response<ItemVersionRevisions> listItemVersionRevisions(SessionContext context, Id itemId,
+                                                                 Id versionId) {
+    return new Response<>(versionPublicStore.listItemVersionRevisions(context, itemId, versionId));
   }
 
   @Override
-  public Response<Collection<CollaborationElement>> listElements(SessionContext context,
-                                                                 ElementContext elementContext,
-                                                                 Namespace namespace,
-                                                                 Id elementId) {
-    return new Response<>(
-        elementCollaborationStore.listElements(context, elementContext, elementId));
+  public Response<Revision> getItemVersionRevision(SessionContext context, Id itemId, Id versionId,
+                                                   Id revisionId) {
+    throw new UnsupportedOperationException(
+        "get revision is not supported in the current cassandra plugin");
   }
 
   @Override
-  public Response<CollaborationElement> getElement(SessionContext context,
-                                                   ElementContext elementContext,
-                                                   Namespace namespace, Id elementId) {
-    return new Response<>(elementCollaborationStore.getElement(context, elementContext, elementId));
+  public Response<CollaborationMergeChange> resetItemVersionRevision(SessionContext context,
+                                                                     Id itemId, Id versionId,
+                                                                     Id revisionId) {
+    throw new UnsupportedOperationException("resetItemVersionRevision function not supported");
+
   }
 
   @Override
-  public Response<Void> createElement(SessionContext context, CollaborationElement element) {
-    elementCollaborationStore.createElement(context, element);
-    return new Response(Void.TYPE);
+  public Response<CollaborationMergeChange> revertItemVersionRevision(SessionContext context,
+                                                                      Id itemId, Id versionId,
+                                                                      Id revisionId) {
+    Optional<ItemVersion> itemVersion = getItemVersion(context, itemId, versionId, revisionId);
+    if (!itemVersion.isPresent()) {
+      throw new RuntimeException(String
+          .format("Item %s, version %s: Cannot revert to revision %s since it is not found",
+              itemId, versionId, revisionId));
+    }
+
+    // TODO: 12/4/2017 force sync is done in order to clear dirty element on private
+    // this is temp solution that should be fixed.
+    forceSyncItemVersion(context, itemId, versionId);
+
+    //updateItemVersion(context, itemId, versionId, itemVersion.get().getData());
+    revertService.revert(context, itemId, versionId, revisionId);
+
+    return new Response<>(new CollaborationMergeChange());
   }
 
-  @Override
-  public Response<Void> updateElement(SessionContext context, CollaborationElement element) {
-    elementCollaborationStore.updateElement(context, element);
-    return new Response(Void.TYPE);
-  }
-
-  @Override
-  public Response<Void> deleteElement(SessionContext context, CollaborationElement element) {
-    elementCollaborationStore.deleteElement(context, element);
-    return new Response(Void.TYPE);
-  }
 
   @Override
   public Response<Void> commitElements(SessionContext context, Id itemId, Id versionId, String s) {
@@ -155,16 +320,202 @@
   }
 
   @Override
-  public Response<HealthInfo> checkHealth(SessionContext sessionContext) throws ZusammenException {
+  public Response<Collection<CollaborationElement>> listElements(SessionContext context,
+                                                                 ElementContext elementContext,
+                                                                 Namespace namespace,
+                                                                 Id elementId) {
+    return new Response<>(elementPrivateStore.listSubs(context, elementContext, elementId).stream()
+        .map(elementEntity -> convertToCollaborationElement(elementContext, elementEntity))
+        .collect(Collectors.toList()));
+  }
 
-    boolean health = elementCollaborationStore.checkHealth(sessionContext);
-    HealthInfo healthInfo ;
-    if (health){
-      healthInfo = new HealthInfo("Collaboration", HealthStatus.UP,"");
-    } else {
-      healthInfo = new HealthInfo("Collaboration", HealthStatus.DOWN,"No Schema Available");
+  @Override
+  public Response<CollaborationElement> getElement(SessionContext context,
+                                                   ElementContext elementContext,
+                                                   Namespace namespace, Id elementId) {
+    return new Response<>(elementPrivateStore.get(context, elementContext, elementId)
+        .map(elementEntity -> convertToCollaborationElement(elementContext, elementEntity))
+        .orElse(null));
+  }
+
+  @Override
+  public Response<CollaborationElementConflict> getElementConflict(SessionContext context,
+                                                                   ElementContext elementContext,
+                                                                   Namespace namespace,
+                                                                   Id elementId) {
+    Optional<StageEntity<ElementEntity>> conflictedStagedElement =
+        elementStageStore
+            .getConflicted(context, elementContext, new ElementEntity(elementId));
+
+    return new Response<>(conflictedStagedElement
+        .map(stagedElement -> getElementConflict(context, elementContext, stagedElement))
+        .orElse(null));
+  }
+
+  @Override
+  public Response<Void> createElement(SessionContext context, CollaborationElement element) {
+    elementPrivateStore.create(context,
+        new ElementContext(element.getItemId(), element.getVersionId()),
+        convertToElementEntity(element));
+    return new Response(Void.TYPE);
+  }
+
+  @Override
+  public Response<Void> updateElement(SessionContext context, CollaborationElement element) {
+    elementPrivateStore.update(context,
+        new ElementContext(element.getItemId(), element.getVersionId()),
+        convertToElementEntity(element));
+    return new Response(Void.TYPE);
+  }
+
+  @Override
+  public Response<Void> deleteElement(SessionContext context, CollaborationElement element) {
+    elementPrivateStore
+        .delete(context, new ElementContext(element.getItemId(), element.getVersionId()),
+            convertToElementEntity(element));
+
+    return new Response(Void.TYPE);
+  }
+
+  @Override
+  public Response<CollaborationMergeResult> resolveElementConflict(SessionContext context,
+                                                                   CollaborationElement element,
+                                                                   Resolution resolution) {
+    ElementContext elementContext = new ElementContext(element.getItemId(), element.getVersionId());
+    elementStageStore
+        .resolveConflict(context, elementContext, convertToElementEntity(element), resolution);
+    commitStagingService.commitStaging(context, element.getItemId(), element.getVersionId());
+
+    return new Response<>(new CollaborationMergeResult());
+  }
+
+  @Override
+  public Response<ItemVersion> getItemVersion(SessionContext context, Space space, Id itemId,
+                                              Id versionId, Id revisionId) {
+    return new Response<>(getItemVersion(context, itemId, versionId, revisionId).orElse(null));
+  }
+
+  @Override
+  public Response<HealthInfo> checkHealth(SessionContext context) throws ZusammenException {
+    HealthInfo healthInfo = versionPublicStore.checkHealth(context)
+        ? new HealthInfo(Module.ZCSP.getDescription(), HealthStatus.UP, "")
+        : new HealthInfo(Module.ZCSP.getDescription(), HealthStatus.DOWN, "No Schema Available");
+
+    return new Response<>(healthInfo);
+  }
+
+  private Optional<ItemVersion> getItemVersion(SessionContext context, Id itemId, Id versionId,
+                                               Id revisionId) {
+    // since revisions are kept only on public - get from there
+    Optional<VersionEntity> versionEntity = versionPublicStore.get(context, itemId, versionId);
+    if (!versionEntity.isPresent()) {
+      return Optional.empty();
     }
-    return new Response<HealthInfo>(healthInfo);
 
+    return elementPublicStore
+        .getDescriptor(context, new ElementContext(itemId, versionId, revisionId),
+            ROOT_ELEMENTS_PARENT_ID)
+        .map(ZusammenPluginUtil::convertToVersionData)
+        .map(itemVersionData -> convertToItemVersion(versionEntity.get(), itemVersionData));
+  }
+
+  private List<ElementEntity> listVersionElements(SessionContext context,
+                                                  ElementContext elementContext) {
+    return elementPrivateStore.listIds(context, elementContext).entrySet().stream() // TODO:
+        // 9/5/2017 parallel
+        .map(entry -> elementPrivateStore.get(context, elementContext, entry.getKey()).get())
+        .collect(Collectors.toList());
+  }
+
+  private void copyElements(SessionContext context,
+                            ElementContext sourceContext, ElementContext targetContext) {
+    listVersionElements(context, sourceContext).forEach(element -> {
+      // publishTime copied as is and dirty is off
+      Date publishTime =
+          elementPrivateStore.getSynchronizationState(context, sourceContext, element.getId())
+              .get().getPublishTime();
+      elementPrivateStore.commitStagedCreate(context, targetContext, element, publishTime);
+    });
+  }
+
+  private ItemVersionDataConflict getVersionDataConflict(SessionContext context,
+                                                         ElementContext elementContext,
+                                                         StageEntity<ElementEntity> stagedElementDescriptor) {
+    ItemVersionDataConflict versionConflict = new ItemVersionDataConflict();
+    versionConflict.setRemoteData(convertToVersionData(stagedElementDescriptor.getEntity()));
+    if (stagedElementDescriptor.getAction() == Action.UPDATE) {
+      versionConflict.setLocalData(getPrivateVersionData(context, elementContext));
+    }
+    return versionConflict;
+  }
+
+  private ItemVersionData getPrivateVersionData(SessionContext context,
+                                                ElementContext elementContext) {
+    return elementPrivateStore.getDescriptor(context, elementContext, ROOT_ELEMENTS_PARENT_ID)
+        .map(ZusammenPluginUtil::convertToVersionData)
+        .orElseThrow(() -> new IllegalStateException("Version must have data"));
+  }
+
+  private ElementConflictDescriptor getElementConflictDescriptor(SessionContext context,
+                                                                 ElementContext elementContext,
+                                                                 StageEntity<ElementEntity> stagedElementDescriptor) {
+    ElementDescriptor elementDescriptorFromStage =
+        convertToElementDescriptor(elementContext, (stagedElementDescriptor.getEntity()));
+
+    ElementConflictDescriptor conflictDescriptor = new ElementConflictDescriptor();
+    switch (stagedElementDescriptor.getAction()) {
+      case CREATE:
+        conflictDescriptor.setRemoteElementDescriptor(elementDescriptorFromStage);
+        break;
+      case UPDATE:
+        conflictDescriptor.setRemoteElementDescriptor(elementDescriptorFromStage);
+        conflictDescriptor.setLocalElementDescriptor(convertToElementDescriptor(elementContext,
+            elementPrivateStore
+                .getDescriptor(context, elementContext, stagedElementDescriptor.getEntity().getId())
+                .orElse(null)));// updated on public while deleted from private
+        break;
+      case DELETE:
+        conflictDescriptor.setLocalElementDescriptor(elementDescriptorFromStage);
+        break;
+      default:
+        break;
+    }
+    return conflictDescriptor;
+  }
+
+  private void addElementsToChangedElements(ElementContext elementContext,
+                                            Collection<ElementEntity> elements,
+                                            Collection<CollaborationElementChange> changedElements,
+                                            Action action) {
+    elements.stream()
+        .map(elementEntity -> convertToElementChange(elementContext, elementEntity, action))
+        .forEach(changedElements::add);
+  }
+
+  private CollaborationElementConflict getElementConflict(SessionContext context,
+                                                          ElementContext entityContext,
+                                                          StageEntity<ElementEntity> stagedElement) {
+    CollaborationElement elementFromStage =
+        convertToCollaborationElement(entityContext, (stagedElement.getEntity()));
+
+    CollaborationElementConflict conflict = new CollaborationElementConflict();
+    switch (stagedElement.getAction()) {
+      case CREATE:
+        conflict.setRemoteElement(elementFromStage);
+        break;
+      case UPDATE:
+        conflict.setRemoteElement(elementFromStage);
+        conflict.setLocalElement(
+            elementPrivateStore.get(context, entityContext, stagedElement.getEntity().getId())
+                .map(element -> convertToCollaborationElement(entityContext, element))
+                .orElse(null));// updated on public while deleted from private
+        break;
+      case DELETE:
+        conflict.setLocalElement(elementFromStage);
+        break;
+      default:
+        break;
+    }
+    return conflict;
   }
 }
\ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/main/CassandraStateStorePluginImpl.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/main/CassandraStateStorePluginImpl.java
index b4767b2..3ed668e 100644
--- a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/main/CassandraStateStorePluginImpl.java
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/java/org/openecomp/core/zusammen/plugin/main/CassandraStateStorePluginImpl.java
@@ -17,18 +17,87 @@
 package org.openecomp.core.zusammen.plugin.main;
 
 
+import com.amdocs.zusammen.datatypes.Id;
 import com.amdocs.zusammen.datatypes.SessionContext;
+import com.amdocs.zusammen.datatypes.Space;
+import com.amdocs.zusammen.datatypes.item.ElementContext;
+import com.amdocs.zusammen.datatypes.item.ItemVersion;
+import com.amdocs.zusammen.datatypes.item.ItemVersionData;
 import com.amdocs.zusammen.datatypes.response.Response;
 import com.amdocs.zusammen.plugin.statestore.cassandra.StateStoreImpl;
 import com.amdocs.zusammen.plugin.statestore.cassandra.dao.types.ElementEntityContext;
 import com.amdocs.zusammen.sdk.state.types.StateElement;
+import org.openecomp.core.zusammen.plugin.ZusammenPluginUtil;
+import org.openecomp.core.zusammen.plugin.collaboration.ElementPrivateStore;
+import org.openecomp.core.zusammen.plugin.collaboration.impl.ElementPrivateStoreImpl;
+import org.openecomp.core.zusammen.plugin.dao.ElementRepository;
 import org.openecomp.core.zusammen.plugin.dao.ElementRepositoryFactory;
+import org.openecomp.core.zusammen.plugin.dao.VersionDao;
+import org.openecomp.core.zusammen.plugin.dao.VersionDaoFactory;
 import org.openecomp.core.zusammen.plugin.dao.types.ElementEntity;
+import org.openecomp.core.zusammen.plugin.dao.types.VersionDataElement;
+import org.openecomp.core.zusammen.plugin.dao.types.VersionEntity;
 
+import java.util.Collection;
+import java.util.Date;
+import java.util.stream.Collectors;
+
+import static org.openecomp.core.zusammen.plugin.ZusammenPluginUtil.convertToItemVersion;
 import static org.openecomp.core.zusammen.plugin.ZusammenPluginUtil.getSpaceName;
 
 public class CassandraStateStorePluginImpl extends StateStoreImpl {
 
+  private ElementPrivateStore elementPrivateStore = new ElementPrivateStoreImpl();
+
+  @Override
+  public Response<Collection<ItemVersion>> listItemVersions(SessionContext context, Space space,
+                                                            Id itemId) {
+    String spaceName = getSpaceName(context, space);
+    return new Response<>(getVersionDao(context).list(context, spaceName, itemId).stream()
+        .map(versionEntity -> getItemVersion(context, spaceName, itemId, versionEntity))
+        .collect(Collectors.toList()));
+  }
+
+  @Override
+  public Response<Boolean> isItemVersionExist(SessionContext context, Space space, Id itemId,
+                                              Id versionId) {
+    return new Response<>(
+        getVersionDao(context).get(context, getSpaceName(context, space), itemId, versionId)
+            .isPresent());
+  }
+
+  @Override
+  public Response<ItemVersion> getItemVersion(SessionContext context, Space space, Id itemId,
+                                              Id versionId) {
+    String spaceName = getSpaceName(context, space);
+    return new Response<>(getVersionDao(context).get(context, spaceName, itemId, versionId)
+        .map(versionEntity -> getItemVersion(context, spaceName, itemId, versionEntity))
+        .orElse(null));
+  }
+
+  @Override
+  public Response<Void> createItemVersion(SessionContext context, Space space, Id itemId,
+                                          Id baseVersionId, Id versionId, ItemVersionData data,
+                                          Date creationTime) {
+    // done by collaboration store
+    return new Response(Void.TYPE);
+  }
+
+  @Override
+  public Response<Void> updateItemVersion(SessionContext context, Space space, Id itemId,
+                                          Id versionId, ItemVersionData data,
+                                          Date modificationTime) {
+    // done by collaboration store
+    return new Response(Void.TYPE);
+  }
+
+  @Override
+  public Response<Void> deleteItemVersion(SessionContext context, Space space, Id itemId,
+                                          Id versionId) {
+    // done by collaboration store
+    return new Response(Void.TYPE);
+  }
+
   @Override
   public Response<Void> createElement(SessionContext context, StateElement element) {
     ElementEntity elementEntity = new ElementEntity(element.getId());
@@ -37,8 +106,7 @@
     ElementRepositoryFactory.getInstance().createInterface(context)
         .createNamespace(context,
             new ElementEntityContext(getSpaceName(context, element.getSpace()),
-                element.getItemId(), element.getVersionId()),
-            elementEntity);
+                element.getItemId(), element.getVersionId()), elementEntity);
     // create element is done by collaboration store
     return new Response(Void.TYPE);
   }
@@ -55,4 +123,46 @@
     return new Response(Void.TYPE);
   }
 
+  @Override
+  public Response<Collection<StateElement>> listElements(SessionContext context,
+                                                         ElementContext elementContext,
+                                                         Id elementId) {
+    return new Response(elementPrivateStore.listSubs(context, elementContext, elementId).stream()
+        .map(elementEntity -> ZusammenPluginUtil.getStateElement(elementContext, elementEntity))
+        .collect(Collectors.toList()));
+
+  }
+
+  @Override
+  public Response<StateElement> getElement(SessionContext context, ElementContext elementContext,
+                                           Id elementId) {
+
+    return new Response(elementPrivateStore.get(context, elementContext, elementId)
+        .map(elementEntity -> ZusammenPluginUtil
+            .getStateElement(elementContext, elementEntity))
+        .orElse
+            (null));
+
+
+  }
+
+  private ItemVersion getItemVersion(SessionContext context, String spaceName, Id itemId,
+                                     VersionEntity versionEntity) {
+
+    ItemVersionData itemVersionData = getElementRepository(context)
+        .get(context, new ElementEntityContext(spaceName, itemId, versionEntity.getId(), null),
+            new VersionDataElement())
+        .map(ZusammenPluginUtil::convertToVersionData)
+        .orElseThrow(() -> new IllegalStateException("Version must have data"));
+
+    return convertToItemVersion(versionEntity, itemVersionData);
+  }
+
+  protected VersionDao getVersionDao(SessionContext context) {
+    return VersionDaoFactory.getInstance().createInterface(context);
+  }
+
+  protected ElementRepository getElementRepository(SessionContext context) {
+    return ElementRepositoryFactory.getInstance().createInterface(context);
+  }
 }
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/resources/factoryConfiguration.json b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/resources/factoryConfiguration.json
index cd1e293..841e005 100644
--- a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/resources/factoryConfiguration.json
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/main/resources/factoryConfiguration.json
@@ -1,3 +1,8 @@
 {
-  "org.openecomp.core.zusammen.plugin.dao.ElementRepositoryFactory": "org.openecomp.core.zusammen.plugin.dao.impl.CassandraElementRepositoryFactory"
+  "org.openecomp.core.zusammen.plugin.dao.VersionDaoFactory": "org.openecomp.core.zusammen.plugin.dao.impl.cassandra.VersionDaoFactoryImpl",
+  "org.openecomp.core.zusammen.plugin.dao.ElementRepositoryFactory": "org.openecomp.core.zusammen.plugin.dao.impl.cassandra.ElementRepositoryFactoryImpl",
+  "org.openecomp.core.zusammen.plugin.dao.VersionSynchronizationStateRepositoryFactory": "org.openecomp.core.zusammen.plugin.dao.impl.cassandra.VersionSynchronizationStateRepositoryFactoryImpl",
+  "org.openecomp.core.zusammen.plugin.dao.ElementSynchronizationStateRepositoryFactory": "org.openecomp.core.zusammen.plugin.dao.impl.cassandra.ElementSynchronizationStateRepositoryFactoryImpl",
+  "org.openecomp.core.zusammen.plugin.dao.VersionStageRepositoryFactory": "org.openecomp.core.zusammen.plugin.dao.impl.cassandra.VersionStageRepositoryFactoryImpl",
+  "org.openecomp.core.zusammen.plugin.dao.ElementStageRepositoryFactory": "org.openecomp.core.zusammen.plugin.dao.impl.cassandra.ElementStageRepositoryFactoryImpl"
 }
\ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/test/java/org/openecomp/core/zusammen/plugin/collaboration/TestUtils.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/test/java/org/openecomp/core/zusammen/plugin/collaboration/TestUtils.java
new file mode 100644
index 0000000..79e918c
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/test/java/org/openecomp/core/zusammen/plugin/collaboration/TestUtils.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright © 2016-2017 European Support Limited
+ *
+ * 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.
+ */
+
+package org.openecomp.core.zusammen.plugin.collaboration;
+
+import com.amdocs.zusammen.datatypes.Id;
+import com.amdocs.zusammen.datatypes.SessionContext;
+import com.amdocs.zusammen.datatypes.UserInfo;
+import com.amdocs.zusammen.datatypes.item.ElementContext;
+import com.amdocs.zusammen.datatypes.item.Info;
+import com.amdocs.zusammen.datatypes.item.ItemVersion;
+import com.amdocs.zusammen.datatypes.item.ItemVersionData;
+import com.amdocs.zusammen.datatypes.item.Relation;
+
+import java.util.Arrays;
+
+public class TestUtils {
+
+  public static SessionContext createSessionContext(UserInfo user, String tenant) {
+    SessionContext context = new SessionContext();
+    context.setUser(user);
+    context.setTenant(tenant);
+    return context;
+  }
+
+  public static ElementContext createElementContext(Id itemId, Id versionId) {
+    ElementContext elementContext = new ElementContext();
+    elementContext.setItemId(itemId);
+    elementContext.setVersionId(versionId);
+    return elementContext;
+  }
+
+  public static Info createInfo(String value) {
+    Info info = new Info();
+    info.setName(value);
+    info.addProperty("Name", "name_" + value);
+    info.addProperty("Desc", "desc_" + value);
+    return info;
+  }
+
+  public static ItemVersion createItemVersion(Id id, Id baseId, String name, boolean dirty) {
+    ItemVersion version = new ItemVersion();
+    version.setId(id);
+    version.setBaseId(baseId);
+    ItemVersionData data = new ItemVersionData();
+    data.setInfo(TestUtils.createInfo(name));
+    data.setRelations(Arrays.asList(new Relation(), new Relation()));
+    version.setData(data);
+    return version;
+  }
+}
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/test/java/org/openecomp/core/zusammen/plugin/collaboration/VersionCollaborationStoreTest.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/test/java/org/openecomp/core/zusammen/plugin/collaboration/VersionCollaborationStoreTest.java
new file mode 100644
index 0000000..4c4621e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/test/java/org/openecomp/core/zusammen/plugin/collaboration/VersionCollaborationStoreTest.java
@@ -0,0 +1,237 @@
+package org.openecomp.core.zusammen.plugin.collaboration;
+
+public class VersionCollaborationStoreTest {/*
+  private static final String TENANT = "test";
+  private static final String USER = "ItemStateStoreTest_user";
+  private static final SessionContext context =
+      TestUtils.createSessionContext(new UserInfo(USER), TENANT);
+
+  @Mock
+  private VersionDao versionDaoMock;
+  @Mock
+  private ElementStore elementCollaborationStore;
+  @Spy
+  @InjectMocks
+  private VersionStore versionCollaborationStore;
+
+  @BeforeMethod
+  public void setUp() throws Exception {
+    MockitoAnnotations.initMocks(this);
+    when(versionCollaborationStore.getVersionDao(anyObject())).thenReturn(versionDaoMock);
+  }
+*//*
+  @Test
+  public void testListPrivateItemVersions() throws Exception {
+    testListItemVersions(Space.PRIVATE, USER);
+  }
+
+  @Test
+  public void testListPublicItemVersions() throws Exception {
+    testListItemVersions(Space.PUBLIC, ZusammenPluginConstants.PUBLIC_SPACE);
+  }
+
+  @Test
+  public void testIsPrivateItemVersionExist() throws Exception {
+    testIsItemVersionExist(Space.PRIVATE, USER);
+  }
+
+  @Test
+  public void testIsPublicItemVersionExist() throws Exception {
+    testIsItemVersionExist(Space.PUBLIC, ZusammenPluginConstants.PUBLIC_SPACE);
+  }
+
+  @Test
+  public void testIsItemVersionExistWhenNot() throws Exception {
+    Id itemId = new Id();
+    Id versionId = new Id();
+    doReturn(Optional.empty()).when(versionDaoMock).get(context, USER, itemId, versionId);
+
+    boolean itemExist =
+        versionCollaborationStore.isItemVersionExist(context, Space.PRIVATE, itemId, versionId);
+    Assert.assertFalse(itemExist);
+  }
+
+  @Test
+  public void testGetPrivateItemVersion() throws Exception {
+    testGetItemVersion(Space.PRIVATE, USER);
+  }
+
+  @Test
+  public void testGetPublicItemVersion() throws Exception {
+    testGetItemVersion(Space.PUBLIC, ZusammenPluginConstants.PUBLIC_SPACE);
+  }
+
+
+  @Test
+  public void testGetNonExistingItemVersion() throws Exception {
+    Id itemId = new Id();
+    Id versionId = new Id();
+    doReturn(Optional.empty()).when(versionDaoMock).get(context, USER, itemId, versionId);
+
+    ItemVersion itemVersion =
+        versionCollaborationStore.getItemVersion(context, Space.PRIVATE, itemId, versionId);
+    Assert.assertNull(itemVersion);
+  }*//*
+
+  @Test
+  public void testCreatePrivateItemVersion() throws Exception {
+    testCreateItemVersion(Space.PRIVATE, USER, null);
+  }
+
+  @Test
+  public void testCreatePrivateItemVersionBasedOn() throws Exception {
+    testCreateItemVersion(Space.PRIVATE, USER, new Id());
+  }
+
+  @Test
+  public void testCreatePublicItemVersion() throws Exception {
+    testCreateItemVersion(Space.PUBLIC, ZusammenPluginConstants.PUBLIC_SPACE, null);
+  }
+
+  @Test
+  public void testCreatePublicItemVersionBasedOn() throws Exception {
+    testCreateItemVersion(Space.PUBLIC, ZusammenPluginConstants.PUBLIC_SPACE, new Id());
+  }
+
+  @Test
+  public void testUpdatePrivateItemVersion() throws Exception {
+    testUpdateItemVersion(Space.PRIVATE, USER);
+  }
+
+  @Test
+  public void testUpdatePublicItemVersion() throws Exception {
+    testUpdateItemVersion(Space.PUBLIC, ZusammenPluginConstants.PUBLIC_SPACE);
+  }
+
+  @Test
+  public void testDeletePrivateItemVersion() throws Exception {
+    testDeleteItemVersion(Space.PRIVATE, USER);
+  }
+
+  @Test
+  public void testDeletePublicItemVersion() throws Exception {
+    testDeleteItemVersion(Space.PUBLIC, ZusammenPluginConstants.PUBLIC_SPACE);
+  }
+
+  @Test
+  public void testPublishItemVersionWhenNotDirty() throws Exception {
+    Id itemId = new Id();
+    ItemVersion version = TestUtils.createItemVersion(new Id(), null, "v1", false);
+    doReturn(Optional.of(version)).when(versionDaoMock).get(context, USER, itemId, version.getId());
+
+    versionCollaborationStore.publishItemVersion(context, itemId, version.getId(), "message");
+
+  }
+*//*
+  private void testIsItemVersionExist(Space space, String spaceName) {
+    Id itemId = new Id();
+    ItemVersion retrievedVersion = TestUtils.createItemVersion(new Id(), null, "v1");
+    doReturn(Optional.of(retrievedVersion)).when(versionDaoMock)
+        .get(context, spaceName, itemId, retrievedVersion.getId());
+
+    boolean itemExist =
+        versionCollaborationStore
+            .isItemVersionExist(context, space, itemId, retrievedVersion.getId());
+    Assert.assertTrue(itemExist);
+  }
+
+  private void testGetItemVersion(Space space, String spaceName) throws Exception {
+    Id itemId = new Id();
+    ItemVersion retrievedVersion = TestUtils.createItemVersion(new Id(), null, "v1");
+    doReturn(Optional.of(retrievedVersion)).when(versionDaoMock)
+        .get(context, spaceName, itemId, retrievedVersion.getId());
+
+    ItemVersion itemVersion =
+        versionCollaborationStore.getItemVersion(context, space, itemId, retrievedVersion.getId());
+    Assert.assertEquals(itemVersion, retrievedVersion);
+  }
+
+  private void testListItemVersions(Space space, String spaceName) {
+    Id itemId = new Id();
+    ItemVersion v1 = TestUtils.createItemVersion(new Id(), null, "v1");
+    ItemVersion v2 = TestUtils.createItemVersion(new Id(), v1.getId(), "v2");
+    ItemVersion v3 = TestUtils.createItemVersion(new Id(), v2.getId(), "v3");
+    List<ItemVersion> retrievedVersions = Arrays.asList(v1, v2, v3);
+    doReturn(retrievedVersions).when(versionDaoMock).list(context, spaceName, itemId);
+
+    Collection<ItemVersion> itemVersions =
+        versionCollaborationStore.listItemVersions(context, space, itemId);
+    Assert.assertEquals(itemVersions, retrievedVersions);
+  }*//*
+
+  private void testCreateItemVersion(Space space, String spaceName, Id baseId) {
+    Id itemId = new Id();
+    ItemVersion v1 = TestUtils.createItemVersion(new Id(), baseId, "v1", false);
+    List<ElementEntity> baseVersionElements = mockVersionElements(spaceName, itemId, baseId);
+
+    ArgumentCaptor<ItemVersion> versionCaptor = ArgumentCaptor.forClass(ItemVersion.class);
+
+    Date creationTime = new Date();
+    versionCollaborationStore
+        .createItemVersion(context, space, itemId, baseId, v1.getId(), v1.getData(), creationTime);
+
+    verify(versionDaoMock).create(eq(context), eq(spaceName), eq(itemId), versionCaptor.capture());
+    //baseId, v1.getId(),v1.getData(), creationTime);
+
+    ItemVersion capturedVersion = versionCaptor.getValue();
+    Assert.assertEquals(baseId, capturedVersion.getBaseId());
+    Assert.assertEquals(v1.getId(), capturedVersion.getId());
+    Assert.assertEquals(v1.getData(), capturedVersion.getData());
+    Assert.assertEquals(creationTime, capturedVersion.getCreationTime());
+*//*    verify(versionDaoMock)
+        .create(anyObject(), anyObject(), anyObject(), anyObject(), anyObject(), anyObject(),
+            anyObject());*//*
+
+*//*    if (baseId != null) {
+      baseVersionElements.forEach(element ->
+          verify(elementCollaborationStore).create(eq(context),
+              eq(new ElementEntityContext(spaceName, itemId, v1.getId())),
+              eq(element)));
+    } else {
+      verifyZeroInteractions(elementCollaborationStore);
+    }*//*
+  }
+
+  private void testUpdateItemVersion(Space space, String spaceName) {
+    Id itemId = new Id();
+    ItemVersion retrievedVersion = TestUtils.createItemVersion(new Id(), null, "v1", false);
+    doReturn(Optional.of(retrievedVersion)).when(versionDaoMock)
+        .get(context, spaceName, itemId, retrievedVersion.getId());
+
+    ItemVersionData updatedData = new ItemVersionData();
+    updatedData.setInfo(TestUtils.createInfo("v1 updated"));
+    updatedData.setRelations(
+        Arrays.asList(new Relation(), new Relation(), new Relation(), new Relation()));
+    versionCollaborationStore.updateItemVersion(
+        context, space, itemId, retrievedVersion.getId(), updatedData, new Date());
+
+    *//*verify(versionDaoMock)
+        .update(context, spaceName, itemId, retrievedVersion.getId(), updatedData, modificationTime);*//*
+    verify(versionDaoMock)
+        .update(anyObject(), anyObject(), anyObject(), anyObject());
+
+  }
+
+  private void testDeleteItemVersion(Space space, String spaceName) {
+    Id itemId = new Id();
+    Id versionId = new Id();
+
+    List<ElementEntity> versionElements = mockVersionElements(spaceName, itemId, versionId);
+    versionCollaborationStore.deleteItemVersion(context, space, itemId, versionId);
+
+*//*    versionElements.forEach(element ->
+        verify(elementCollaborationStore).delete(eq(context),
+            eq(new ElementEntityContext(spaceName, itemId, versionId)),
+            eq(element)));*//*
+    verify(versionDaoMock).delete(context, spaceName, itemId, versionId);
+  }
+
+  private List<ElementEntity> mockVersionElements(String spaceName, Id itemId, Id versionId) {
+    ElementEntity elm1 = new ElementEntity(new Id());
+    ElementEntity elm2 = new ElementEntity(new Id());
+    List<ElementEntity> baseVersionElements = Arrays.asList(elm1, elm2);
+*//*    doReturn(baseVersionElements).when(elementCollaborationStore)
+        .list(eq(context), eq(new ElementEntityContext(spaceName, itemId, versionId)));*//*
+    return baseVersionElements;
+  }*/
+}
\ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/test/java/org/openecomp/core/zusammen/plugin/collaboration/impl/ElementStageStoreImplTest.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/test/java/org/openecomp/core/zusammen/plugin/collaboration/impl/ElementStageStoreImplTest.java
new file mode 100644
index 0000000..7f137b0
--- /dev/null
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-plugin/src/test/java/org/openecomp/core/zusammen/plugin/collaboration/impl/ElementStageStoreImplTest.java
@@ -0,0 +1,167 @@
+package org.openecomp.core.zusammen.plugin.collaboration.impl;
+
+import com.amdocs.zusammen.datatypes.Id;
+import com.amdocs.zusammen.datatypes.SessionContext;
+import com.amdocs.zusammen.datatypes.UserInfo;
+import com.amdocs.zusammen.datatypes.item.Action;
+import com.amdocs.zusammen.datatypes.item.ElementContext;
+import com.amdocs.zusammen.datatypes.item.Resolution;
+import com.amdocs.zusammen.plugin.statestore.cassandra.dao.types.ElementEntityContext;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.mockito.Spy;
+import org.openecomp.core.zusammen.plugin.collaboration.TestUtils;
+import org.openecomp.core.zusammen.plugin.dao.ElementStageRepository;
+import org.openecomp.core.zusammen.plugin.dao.types.ElementEntity;
+import org.openecomp.core.zusammen.plugin.dao.types.StageEntity;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import java.util.Date;
+import java.util.HashSet;
+import java.util.Optional;
+import java.util.Set;
+
+import static org.mockito.Matchers.anyObject;
+import static org.mockito.Matchers.eq;
+import static org.mockito.Matchers.same;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+public class ElementStageStoreImplTest {
+  private static final UserInfo USER = new UserInfo("user");
+  private static final SessionContext context = TestUtils.createSessionContext(USER, "test");
+  private static final ElementContext elementContext =
+      TestUtils.createElementContext(new Id(), new Id());
+
+  @Mock
+  private ElementStageRepository elementStageRepositoryMock;
+  @Spy
+  private ElementStageStoreImpl elementStageStore;
+
+  @BeforeMethod
+  public void setUp() throws Exception {
+    MockitoAnnotations.initMocks(this);
+    when(elementStageStore.getElementStageRepository(anyObject()))
+        .thenReturn(elementStageRepositoryMock);
+  }
+
+  @Test
+  public void testListIds() throws Exception {
+
+  }
+
+  @Test
+  public void testGet() throws Exception {
+
+  }
+
+  @Test
+  public void testGetConflicted() throws Exception {
+
+  }
+
+  @Test
+  public void testHasConflicts() throws Exception {
+
+  }
+
+  @Test
+  public void testListConflictedDescriptors() throws Exception {
+
+  }
+
+  @Test
+  public void testCreate() throws Exception {
+
+  }
+
+  @Test
+  public void testDelete() throws Exception {
+
+  }
+
+  @Test
+  public void testResolveConflictWhenNotStaged() throws Exception {
+    doReturn(Optional.empty())
+        .when(elementStageRepositoryMock).get(anyObject(), anyObject(), anyObject());
+    elementStageStore
+        .resolveConflict(context, elementContext, new ElementEntity(new Id()), Resolution.YOURS);
+  }
+
+  @Test
+  public void testResolveConflictWhenNotConflicted() throws Exception {
+    Id elementId = new Id();
+    StageEntity<ElementEntity> stagedElement =
+        new StageEntity<>(new ElementEntity(elementId), new Date());
+    doReturn(Optional.of(stagedElement))
+        .when(elementStageRepositoryMock).get(anyObject(), anyObject(), anyObject());
+    elementStageStore
+        .resolveConflict(context, elementContext, new ElementEntity(elementId), Resolution.YOURS);
+  }
+
+  @Test
+  public void testResolveConflictByYours() throws Exception {
+    Id elementId = new Id();
+    StageEntity<ElementEntity> stagedElement =
+        new StageEntity<>(new ElementEntity(elementId), new Date());
+    stagedElement.setAction(Action.UPDATE);
+    stagedElement.setConflicted(true);
+
+    doReturn(Optional.of(stagedElement))
+        .when(elementStageRepositoryMock).get(anyObject(), anyObject(), anyObject());
+
+    elementStageStore
+        .resolveConflict(context, elementContext, new ElementEntity(elementId), Resolution.YOURS);
+
+    verify(elementStageRepositoryMock).markAsNotConflicted(same(context),
+        eq(new ElementEntityContext(USER.getUserName(), elementContext)),
+        same(stagedElement.getEntity()), same(Action.IGNORE));
+  }
+
+  @Test
+  public void testResolveConflictByYoursWithRelated() throws Exception {
+    Id elementId = new Id();
+    StageEntity<ElementEntity> stagedElement =
+        new StageEntity<>(new ElementEntity(elementId), new Date());
+    stagedElement.setAction(Action.UPDATE);
+    stagedElement.setConflicted(true);
+    ElementEntity relatedElement1 = new ElementEntity(new Id());
+    ElementEntity relatedElement2 = new ElementEntity(new Id());
+    ElementEntity relatedElement3 = new ElementEntity(new Id());
+    Set<ElementEntity> relatedElements = new HashSet<>();
+    relatedElements.add(relatedElement1);
+    relatedElements.add(relatedElement2);
+    relatedElements.add(relatedElement3);
+    stagedElement.setConflictDependents(relatedElements);
+
+    doReturn(Optional.of(stagedElement))
+        .when(elementStageRepositoryMock).get(anyObject(), anyObject(), anyObject());
+
+    elementStageStore
+        .resolveConflict(context, elementContext, new ElementEntity(elementId), Resolution.YOURS);
+
+    ElementEntityContext elementEntityContext =
+        new ElementEntityContext(USER.getUserName(), elementContext);
+    verify(elementStageRepositoryMock).markAsNotConflicted(same(context), eq(elementEntityContext),
+        same(stagedElement.getEntity()), same(Action.IGNORE));
+    verify(elementStageRepositoryMock).markAsNotConflicted(same(context), eq(elementEntityContext),
+        same(relatedElement1), same(Action.IGNORE));
+    verify(elementStageRepositoryMock).markAsNotConflicted(same(context), eq(elementEntityContext),
+        same(relatedElement2), same(Action.IGNORE));
+    verify(elementStageRepositoryMock).markAsNotConflicted(same(context), eq(elementEntityContext),
+        same(relatedElement3), same(Action.IGNORE));
+  }
+
+  @Test
+  public void testResolveConflictByTheirs() throws Exception {
+
+  }
+
+  @Test
+  public void testResolveConflictByTheirsWithRelated() throws Exception {
+
+  }
+
+}
\ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-core-lib/pom.xml b/openecomp-be/lib/openecomp-core-lib/pom.xml
index 3784593..51faa10 100644
--- a/openecomp-be/lib/openecomp-core-lib/pom.xml
+++ b/openecomp-be/lib/openecomp-core-lib/pom.xml
@@ -20,5 +20,6 @@
         <module>/openecomp-utilities-lib</module>
         <module>/openecomp-config-lib</module>
         <module>/openecomp-zusammen-lib</module>
+        <module>/openecomp-session-lib</module>
     </modules>
 </project>
diff --git a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/pom.xml b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/pom.xml
index 2900785..fa3533f 100644
--- a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/pom.xml
+++ b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/pom.xml
@@ -14,6 +14,23 @@
 
     <dependencies>
         <dependency>
+            <groupId>org.openecomp.sdc.common</groupId>
+            <artifactId>openecomp-configuration-management-core</artifactId>
+            <version>${openecomp.sdc.common.version}</version>
+            <scope>runtime</scope>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.slf4j</groupId>
+                    <artifactId>slf4j-log4j12</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.openecomp.sdc.common</groupId>
+            <artifactId>openecomp-configuration-management-api</artifactId>
+            <version>${openecomp.sdc.common.version}</version>
+        </dependency>
+        <dependency>
             <groupId>org.openecomp.sdc.core</groupId>
             <artifactId>openecomp-facade-core</artifactId>
             <version>${project.version}</version>
@@ -33,6 +50,11 @@
             <artifactId>openecomp-sdc-versioning-api</artifactId>
             <version>${project.version}</version>
         </dependency>
+        <dependency>
+            <groupId>org.openecomp.sdc</groupId>
+            <artifactId>openecomp-item-permissions-core</artifactId>
+            <version>${project.version}</version>
+        </dependency>
     </dependencies>
 
 </project>
diff --git a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src/main/java/org/openecomp/sdc/healing/api/HealingManager.java b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src/main/java/org/openecomp/sdc/healing/api/HealingManager.java
index 211d9a2..ca0a3c7 100644
--- a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src/main/java/org/openecomp/sdc/healing/api/HealingManager.java
+++ b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src/main/java/org/openecomp/sdc/healing/api/HealingManager.java
@@ -20,16 +20,24 @@
 
 package org.openecomp.sdc.healing.api;
 
+import org.openecomp.sdc.datatypes.model.ItemType;
 import org.openecomp.sdc.healing.types.HealCode;
+import org.openecomp.sdc.healing.types.HealerType;
+import org.openecomp.sdc.versioning.dao.types.Version;
 
-import java.util.Map;
 import java.util.Optional;
 
 /**
  * Created by Talio on 11/29/2016.
  */
 public interface HealingManager {
-    Object heal(HealCode code, Map<String, Object> healParameters);
 
-    Optional<String> healAll(Map<String, Object> healParameters);
+  /**
+   * @return healed version, if healing was not performed - Optional.empty.
+   */
+  Optional<Version> healItemVersion(String itemId, Version version, ItemType itemType,
+                                    boolean force);
+
+  Object heal(String itemId, Version version, HealerType healerType, HealCode code,
+              ItemType itemType);
 }
diff --git a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src/main/java/org/openecomp/sdc/healing/dao/HealingDao.java b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src/main/java/org/openecomp/sdc/healing/dao/HealingDao.java
new file mode 100644
index 0000000..b766bd8
--- /dev/null
+++ b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src/main/java/org/openecomp/sdc/healing/dao/HealingDao.java
@@ -0,0 +1,13 @@
+package org.openecomp.sdc.healing.dao;
+
+import java.util.Optional;
+
+/**
+ * Created by ayalaben on 10/17/2017
+ */
+public interface HealingDao {
+
+  Optional<Boolean> getItemHealingFlag(String space, String itemId, String versionId);
+
+  void setItemHealingFlag(boolean healingNeededFlag, String space, String itemId, String versionId);
+}
diff --git a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src/main/java/org/openecomp/sdc/healing/factory/HealingManagerFactory.java b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src/main/java/org/openecomp/sdc/healing/factory/HealingManagerFactory.java
index 8e8d633..5e375ee 100644
--- a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src/main/java/org/openecomp/sdc/healing/factory/HealingManagerFactory.java
+++ b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src/main/java/org/openecomp/sdc/healing/factory/HealingManagerFactory.java
@@ -20,9 +20,9 @@
 
 package org.openecomp.sdc.healing.factory;
 
-import org.openecomp.sdc.healing.api.HealingManager;
 import org.openecomp.core.factory.api.AbstractComponentFactory;
 import org.openecomp.core.factory.api.AbstractFactory;
+import org.openecomp.sdc.healing.api.HealingManager;
 
 /**
  * Created by Talio on 11/29/2016.
diff --git a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src/main/java/org/openecomp/sdc/healing/interfaces/Healer.java b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src/main/java/org/openecomp/sdc/healing/interfaces/Healer.java
index eb2f9a7..38afd13 100644
--- a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src/main/java/org/openecomp/sdc/healing/interfaces/Healer.java
+++ b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src/main/java/org/openecomp/sdc/healing/interfaces/Healer.java
@@ -20,11 +20,11 @@
 
 package org.openecomp.sdc.healing.interfaces;
 
-import java.util.Map;
+import org.openecomp.sdc.versioning.dao.types.Version;
 
 /**
  * Created by Talio on 11/29/2016.
  */
 public interface Healer {
-    Object heal(Map<String, Object> healingParams) throws Exception;
+    Object heal(String itemId, Version version) throws Exception;
 }
diff --git a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src/main/java/org/openecomp/sdc/healing/types/ConfigConstants.java b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src/main/java/org/openecomp/sdc/healing/types/ConfigConstants.java
new file mode 100644
index 0000000..0630127
--- /dev/null
+++ b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src/main/java/org/openecomp/sdc/healing/types/ConfigConstants.java
@@ -0,0 +1,5 @@
+package org.openecomp.sdc.healing.types;
+
+public class ConfigConstants {
+  public static final String HEALING_NAMESPACE = "healing";
+}
diff --git a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src/main/java/org/openecomp/sdc/healing/types/HealerType.java b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src/main/java/org/openecomp/sdc/healing/types/HealerType.java
new file mode 100644
index 0000000..3355a3c
--- /dev/null
+++ b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src/main/java/org/openecomp/sdc/healing/types/HealerType.java
@@ -0,0 +1,6 @@
+package org.openecomp.sdc.healing.types;
+
+public enum HealerType {
+  data,
+  structure
+}
diff --git a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src/main/java/org/openecomp/sdc/healing/types/HealingContext.java b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src/main/java/org/openecomp/sdc/healing/types/HealingContext.java
deleted file mode 100644
index 2ad143a..0000000
--- a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src/main/java/org/openecomp/sdc/healing/types/HealingContext.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package org.openecomp.sdc.healing.types;
-import org.openecomp.sdc.versioning.dao.types.Version;
-
-/**
- * Created by TALIO on 7/3/2017.
- */
-public class HealingContext {
-  private String vspId;
-  private Version version;
-  private String user;
-
-  public HealingContext(String vspId, Version version, String user) {
-    this.vspId = vspId;
-    this.version = version;
-    this.user = user;
-  }
-
-  public String getVspId() {
-    return vspId;
-  }
-
-  public void setVspId(String vspId) {
-    this.vspId = vspId;
-  }
-
-  public Version getVersion() {
-    return version;
-  }
-
-  public void setVersion(Version version) {
-    this.version = version;
-  }
-
-  public String getUser() {
-    return user;
-  }
-
-  public void setUser(String user) {
-    this.user = user;
-  }
-}
diff --git a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-core/src/main/java/org/openecomp/sdc/healing/dao/impl/HealingDaoImpl.java b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-core/src/main/java/org/openecomp/sdc/healing/dao/impl/HealingDaoImpl.java
new file mode 100644
index 0000000..921f418
--- /dev/null
+++ b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-core/src/main/java/org/openecomp/sdc/healing/dao/impl/HealingDaoImpl.java
@@ -0,0 +1,46 @@
+package org.openecomp.sdc.healing.dao.impl;
+
+import com.datastax.driver.core.ResultSet;
+import com.datastax.driver.mapping.annotations.Accessor;
+import com.datastax.driver.mapping.annotations.Query;
+import org.openecomp.core.nosqldb.api.NoSqlDb;
+import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
+import org.openecomp.sdc.healing.dao.HealingDao;
+
+import java.util.Optional;
+
+/**
+ * Created by ayalaben on 10/17/2017
+ */
+public class HealingDaoImpl implements HealingDao {
+
+  private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface();
+  private static HealingAccessor accessor =
+      noSqlDb.getMappingManager().createAccessor(HealingAccessor.class);
+
+  @Override
+  public Optional<Boolean> getItemHealingFlag(String space, String itemId, String versionId) {
+    ResultSet result = accessor.getItemHealingFlag(space, itemId, versionId);
+    return result.getAvailableWithoutFetching() < 1
+        ? Optional.empty()
+        : Optional.of(result.one().getBool("healing_needed"));
+  }
+
+  @Override
+  public void setItemHealingFlag(boolean healingNeededFlag, String space, String itemId,
+                                 String versionId) {
+    accessor.setItemHealingFlag(healingNeededFlag, space, itemId, versionId);
+  }
+
+
+  @Accessor
+  interface HealingAccessor {
+
+    @Query("SELECT healing_needed FROM healing WHERE space=? AND item_id=? AND version_id=?")
+    ResultSet getItemHealingFlag(String space, String itemId, String versionId);
+
+    @Query("UPDATE healing SET healing_needed=? WHERE space=? AND item_id=? AND version_id=?")
+    void setItemHealingFlag(boolean flag, String space, String itemId, String versionId);
+
+  }
+}
diff --git a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-core/src/main/java/org/openecomp/sdc/healing/impl/HealingManagerFactoryImpl.java b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-core/src/main/java/org/openecomp/sdc/healing/impl/HealingManagerFactoryImpl.java
index 84aff43..5a283f9 100644
--- a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-core/src/main/java/org/openecomp/sdc/healing/impl/HealingManagerFactoryImpl.java
+++ b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-core/src/main/java/org/openecomp/sdc/healing/impl/HealingManagerFactoryImpl.java
@@ -21,15 +21,17 @@
 package org.openecomp.sdc.healing.impl;
 
 import org.openecomp.sdc.healing.api.HealingManager;
+import org.openecomp.sdc.healing.dao.impl.HealingDaoImpl;
 import org.openecomp.sdc.healing.factory.HealingManagerFactory;
+import org.openecomp.sdc.versioning.VersioningManagerFactory;
 
 /**
  * Created by Talio on 11/29/2016.
  */
 public class HealingManagerFactoryImpl extends HealingManagerFactory {
-
     @Override
     public HealingManager createInterface() {
-        return new HealingManagerImpl();
+        return new HealingManagerImpl(
+            VersioningManagerFactory.getInstance().createInterface(), new HealingDaoImpl());
     }
 }
diff --git a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-core/src/main/java/org/openecomp/sdc/healing/impl/HealingManagerImpl.java b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-core/src/main/java/org/openecomp/sdc/healing/impl/HealingManagerImpl.java
index 1c895ff..59c6732 100644
--- a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-core/src/main/java/org/openecomp/sdc/healing/impl/HealingManagerImpl.java
+++ b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-core/src/main/java/org/openecomp/sdc/healing/impl/HealingManagerImpl.java
@@ -24,34 +24,147 @@
 import org.openecomp.core.utilities.file.FileUtils;
 import org.openecomp.core.utilities.json.JsonUtil;
 import org.openecomp.sdc.common.errors.Messages;
+import org.openecomp.sdc.common.session.SessionContextProviderFactory;
 import org.openecomp.sdc.datatypes.error.ErrorLevel;
+import org.openecomp.sdc.datatypes.model.ItemType;
 import org.openecomp.sdc.healing.api.HealingManager;
+import org.openecomp.sdc.healing.dao.HealingDao;
 import org.openecomp.sdc.healing.interfaces.Healer;
 import org.openecomp.sdc.healing.types.HealCode;
+import org.openecomp.sdc.healing.types.HealerType;
 import org.openecomp.sdc.logging.context.impl.MdcDataErrorMessage;
 import org.openecomp.sdc.logging.types.LoggerConstants;
 import org.openecomp.sdc.logging.types.LoggerErrorCode;
 import org.openecomp.sdc.logging.types.LoggerErrorDescription;
 import org.openecomp.sdc.logging.types.LoggerTragetServiceName;
+import org.openecomp.sdc.versioning.VersioningManager;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.versioning.dao.types.VersionStatus;
+import org.openecomp.sdc.versioning.types.VersionCreationMethod;
 
 import java.lang.reflect.InvocationTargetException;
 import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 import java.util.Optional;
+import java.util.stream.Collectors;
 
 /**
  * Created by Talio on 11/29/2016.
  */
 public class HealingManagerImpl implements HealingManager {
-  private static String HEALING_CONF_FILE = "healingConfiguration.json";
-  private static Map<String, String> healerCodeToImplClass = initHealers();
+
+  private static final String HEALERS_BY_ENTITY_TYPE_FILE = "entityHealingConfiguration.json";
+  private static final String HEALING_USER_SUFFIX = "_healer";
+  private static final String PUBLIC_USER = "public";
+
+  private HealingDao healingDao;
+  private VersioningManager versioningManager;
+
+  public HealingManagerImpl(VersioningManager versioningManager, HealingDao healingDao) {
+    this.versioningManager = versioningManager;
+    this.healingDao = healingDao;
+  }
 
   @Override
-  public Object heal(HealCode code, Map<String, Object> healParameters) {
+  public Optional<Version> healItemVersion(String itemId, Version version, ItemType itemType,
+                                           boolean force) {
+    String user = getUser();
+    if (force || isPrivateHealingNeededByFlag(itemId, version.getId(), user)) {
+      version = versioningManager.get(itemId, version);
+      Version origVersion = version;
+      if (version.getStatus() == VersionStatus.Certified) {
+        Optional<Version> newVersion = createNewVersion(itemId, version);
+        if (!newVersion.isPresent()) {
+          // do NOT turn off flag here (in thought of saving version calculate performance next
+          // time) because maybe next time the next version will be available (due to deletion of
+          // the taken one)
+          return Optional.empty();
+        }
+        version = newVersion.get();
+      }
+
+      doHeal(itemId, version, origVersion, itemType, user, force);
+      return Optional.of(version);
+    }
+    return Optional.empty();
+  }
+
+  private void doHeal(String itemId, Version version, Version origVersion,
+                      ItemType itemType, String user, boolean force) {
+    Optional<String> privateFailureMessages =
+        healPrivate(itemId, version, origVersion, getItemHealers(itemType), user);
+
+    Optional<String> publicFailureMessages =
+        force || origVersion.getStatus() == VersionStatus.Certified ||
+            isPublicHealingNeededByFlag(itemId, origVersion.getId())
+            ? healPublic(itemId, version, origVersion, getItemHealers(itemType), user)
+            : Optional.empty();
+
+    if (privateFailureMessages.isPresent() || publicFailureMessages.isPresent()) {
+      throw new RuntimeException(
+          publicFailureMessages.orElse("") + " " + privateFailureMessages.orElse(""));
+    }
+  }
+
+  private Optional<String> healPrivate(String itemId, Version version, Version origVersion,
+                                       Map<String, Map<String, String>> itemHealers, String user) {
+    if (origVersion.getStatus() != VersionStatus.Certified) {
+      itemHealers.remove(HealerType.structure.name());
+    }
+
+    Optional<String> privateHealingFailureMessages = executeHealers(itemId, version, itemHealers);
+    markAsHealed(itemId, origVersion.getId(), user);
+    return privateHealingFailureMessages;
+  }
+
+  private Optional<String> healPublic(String itemId, Version version, Version origVersion,
+                                      Map<String, Map<String, String>> itemHealers, String user) {
+    Optional<String> healingFailureMessages = origVersion.getStatus() == VersionStatus.Certified
+        ? Optional.empty()
+        : healPublic(itemId, version, itemHealers, user);
+
+    markAsHealed(itemId, origVersion.getId(), PUBLIC_USER);
+    return healingFailureMessages;
+  }
+
+  private Optional<String> healPublic(String itemId, Version version,
+                                      Map<String, Map<String, String>> itemHealers, String user) {
+    SessionContextProviderFactory.getInstance().createInterface()
+        .create(user + HEALING_USER_SUFFIX);
+
+    versioningManager.sync(itemId, version);
+
+    Optional<String> healingFailureMessages = executeHealers(itemId, version, itemHealers);
+    Version publicVersion = versioningManager.get(itemId, version);
+
+    if (Objects.nonNull(publicVersion.getState()) && publicVersion.getState().isDirty()) {
+      versioningManager.publish(itemId, version, "Healing vsp");
+    }
+
+    SessionContextProviderFactory.getInstance().createInterface().create(user);
+    return healingFailureMessages;
+  }
+
+  private Optional<Version> createNewVersion(String itemId, Version version) {
+    Version newVersion = new Version();
+    newVersion.setBaseId(version.getId());
+    try {
+      return Optional.of(versioningManager.create(itemId, newVersion, VersionCreationMethod.major));
+    } catch (Exception e) {
+      return Optional.empty();
+    }
+  }
+
+  @Override
+  public Object heal(String itemId, Version version, HealerType healerType, HealCode code,
+                     ItemType itemType) {
+    String healerClassName = getItemHealers(itemType).get(healerType.name()).get(code.name());
     ArrayList<String> healingFailureMessages = new ArrayList<>();
 
-    Object result =
-        heal(healParameters, healerCodeToImplClass.get(code.name()), healingFailureMessages);
+    Object result = executeHealer(itemId, version, healerClassName, healingFailureMessages);
 
     if (!healingFailureMessages.isEmpty()) {
       throw new RuntimeException(CommonMethods.listToSeparatedString(healingFailureMessages, '\n'));
@@ -59,46 +172,77 @@
     return result;
   }
 
-  @Override
-  public Optional<String> healAll(Map<String, Object> healParameters) {
-    ArrayList<String> healingFailureMessages = new ArrayList<>();
+  private Optional<String> executeHealers(String itemId, Version version,
+                                          Map<String, Map<String, String>> itemHealers) {
+    List<String> healers = itemHealers.values().stream()
+        .map(Map::values)
+        .flatMap(Collection::stream)
+        .collect(Collectors.toList());
 
-    for (String implClassName : healerCodeToImplClass.values()) {
-      heal(healParameters, implClassName, healingFailureMessages);
+    List<String> healingFailureMessages = new ArrayList<>();
+    for (String implClassName : healers) {
+      executeHealer(itemId, version, implClassName, healingFailureMessages);
     }
 
-    return healingFailureMessages.isEmpty() ? Optional.empty()
+    return healingFailureMessages.isEmpty()
+        ? Optional.empty()
         : Optional.of(CommonMethods.listToSeparatedString(healingFailureMessages, '\n'));
   }
 
-  private Object heal(Map<String, Object> healParameters, String healerImplClassName,
-                      ArrayList<String> healingFailureMessages) {
-    Healer healerImpl;
+
+  private Object executeHealer(String itemId, Version version, String healerClassName,
+                               List<String> healingFailureMessages) {
+    Healer healer;
     try {
-      healerImpl = getHealerImplInstance(healerImplClassName);
+      healer = getHealerImplInstance(healerClassName);
     } catch (Exception e) {
       MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
           LoggerTragetServiceName.SELF_HEALING, ErrorLevel.ERROR.name(), LoggerErrorCode
               .DATA_ERROR.getErrorCode(), LoggerErrorDescription.CANT_HEAL);
       healingFailureMessages
           .add(String.format(Messages.CANT_LOAD_HEALING_CLASS.getErrorMessage(),
-              healerImplClassName));
+              healerClassName));
       return null;
     }
 
     try {
-      return healerImpl.heal(healParameters);
+      return healer.heal(itemId, version);
     } catch (Exception e) {
       MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
           LoggerTragetServiceName.SELF_HEALING, ErrorLevel.ERROR.name(), LoggerErrorCode
               .DATA_ERROR.getErrorCode(), LoggerErrorDescription.CANT_HEAL);
-      healingFailureMessages.add(e.getMessage() + " ,healer name :" + healerImplClassName);
+      healingFailureMessages.add(e.getMessage() + " ,healer name :" + healerClassName);
     }
     return null;
   }
 
-  private static Map<String, String> initHealers() {
-    return FileUtils.readViaInputStream(HEALING_CONF_FILE, stream -> JsonUtil.json2Object(stream, Map.class));
+  private boolean isPrivateHealingNeededByFlag(String itemId, String version, String user) {
+    Optional<Boolean> userHealingFlag = getHealingFlag(itemId, version, user);
+    return userHealingFlag.isPresent()
+        ? userHealingFlag.get()
+        : isPublicHealingNeededByFlag(itemId, version);
+  }
+
+  private boolean isPublicHealingNeededByFlag(String itemId, String versionId) {
+    Optional<Boolean> publicHealingFlag = getHealingFlag(itemId, versionId, PUBLIC_USER);
+    return publicHealingFlag.isPresent() && publicHealingFlag.get();
+  }
+
+  private Optional<Boolean> getHealingFlag(String itemId, String version, String user) {
+    return healingDao.getItemHealingFlag(user, itemId, version);
+  }
+
+  private void markAsHealed(String itemId, String versionId, String user) {
+    healingDao.setItemHealingFlag(false, user, itemId, versionId);
+  }
+
+  private Map<String, Map<String, String>> getItemHealers(ItemType itemType) {
+    // TODO: 11/29/2017 create objects to hold this configuration +
+    // load once from the json file and use the relevant healers (by itemType, healerType) as needed.
+    Map healingConfig = FileUtils
+        .readViaInputStream(HEALERS_BY_ENTITY_TYPE_FILE,
+            stream -> JsonUtil.json2Object(stream, Map.class));
+    return (Map<String, Map<String, String>>) healingConfig.get(itemType.name());
   }
 
   private Healer getHealerImplInstance(String implClassName)
@@ -106,4 +250,9 @@
       NoSuchMethodException, ClassNotFoundException {
     return (Healer) Class.forName(implClassName).getConstructor().newInstance();
   }
+
+  private String getUser() {
+    return SessionContextProviderFactory.getInstance().createInterface().get().getUser()
+        .getUserId();
+  }
 }
diff --git a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-core/src/main/resources/entityHealingConfiguration.json b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-core/src/main/resources/entityHealingConfiguration.json
new file mode 100644
index 0000000..ab8a1df
--- /dev/null
+++ b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-core/src/main/resources/entityHealingConfiguration.json
@@ -0,0 +1,12 @@
+{
+  "vsp": {
+    "structure": {
+      "ownerHealer": "org.openecomp.sdc.healing.healers.OwnerHealer"
+    }
+  },
+  "vlm": {
+    "structure": {
+      "ownerHealer": "org.openecomp.sdc.healing.healers.OwnerHealer"
+    }
+  }
+}
\ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-core/src/main/resources/healingConfiguration.json b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-core/src/main/resources/healingConfiguration.json
index 4e1b0df..85eec77 100644
--- a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-core/src/main/resources/healingConfiguration.json
+++ b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-core/src/main/resources/healingConfiguration.json
@@ -1,13 +1,19 @@
 {
-  "FILE_DATA_STRUCTURE_HEALER" : "org.openecomp.sdc.healing.healers.FileDataStructureHealer",
-  "QUESTIONNAIRE_HEALER" : "org.openecomp.sdc.healing.healers.VspQuestionnaireHealer",
-  "COMPOSITION_DATA_HEALER" : "org.openecomp.sdc.healing.healers.CompositionDataHealer",
-  "SUB_ENTITIES_HEALER" : "org.openecomp.sdc.healing.healers.SubEntitiesQuestionnaireHealer",
-  "ONBOARDING_METHOD_HEALER" : "org.openecomp.sdc.healing.healers.VspOnboardingMethodHealer",
-  "NIC_DATA_HEALER" : "org.openecomp.sdc.healing.healers.NicDataHealer",
-  "COMPONENT_QUESTIONNAIRE_HEALER" : "org.openecomp.sdc.healing.healers.ComponentQuestionnaireHealer",
-  "HEAT_TOSCA_TRANSLATION_HEALER" : "org.openecomp.sdc.healing.healers.HeatToToscaTranslationHealer",
-  "VLM_VERSION_HEALER" : "org.openecomp.sdc.healing.healers.VlmVersionHealer",
-  "VALIDATION_STRUCTURE_HEALER" : "org.openecomp.sdc.healing.healers.ValidationStructureHealer",
-  "FORWARDER_CAPABILITY_HEALER" : "org.openecomp.sdc.healing.healers.ForwarderCapabilityHealer"
+    "VendorSoftwareProduct" : {
+      "VSP_OWNER_HEALER" : "org.openecomp.sdc.healing.healers.VspOwnerHealer",
+      "FILE_DATA_STRUCTURE_HEALER" : "org.openecomp.sdc.healing.healers.FileDataStructureHealer",
+      "QUESTIONNAIRE_HEALER" : "org.openecomp.sdc.healing.healers.VspQuestionnaireHealer",
+      "COMPOSITION_DATA_HEALER" : "org.openecomp.sdc.healing.healers.CompositionDataHealer",
+      "SUB_ENTITIES_HEALER" : "org.openecomp.sdc.healing.healers.SubEntitiesQuestionnaireHealer",
+      "ONBOARDING_METHOD_HEALER" : "org.openecomp.sdc.healing.healers.VspOnboardingMethodHealer",
+      "NIC_DATA_HEALER" : "org.openecomp.sdc.healing.healers.NicDataHealer",
+      "COMPONENT_QUESTIONNAIRE_HEALER" : "org.openecomp.sdc.healing.healers.ComponentQuestionnaireHealer",
+      "HEAT_TOSCA_TRANSLATION_HEALER" : "org.openecomp.sdc.healing.healers.HeatToToscaTranslationHealer",
+      "VLM_VERSION_HEALER" : "org.openecomp.sdc.healing.healers.VlmVersionHealer",
+      "VALIDATION_STRUCTURE_HEALER" : "org.openecomp.sdc.healing.healers.ValidationStructureHealer",
+      "FORWARDER_CAPABILITY_HEALER" : "org.openecomp.sdc.healing.healers.ForwarderCapabilityHealer"
+    },
+    "VendorLicenseModel" : {
+      "VLM_OWNER_HEALER" : "org.openecomp.sdc.healing.healers.VlmOwnerHealer"
+    }
 }
\ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/pom.xml b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/pom.xml
index c54f724..1359e69 100644
--- a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/pom.xml
+++ b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/pom.xml
@@ -39,6 +39,11 @@
             <artifactId>openecomp-sdc-vendor-license-api</artifactId>
             <version>${project.version}</version>
         </dependency>
+        <dependency>
+            <groupId>org.openecomp.sdc</groupId>
+            <artifactId>openecomp-item-permissions-impl</artifactId>
+            <version>${project.version}</version>
+        </dependency>
 
     </dependencies>
 
diff --git a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/ComponentQuestionnaireHealer.java b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/ComponentQuestionnaireHealer.java
index 50e7678..83395e0 100644
--- a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/ComponentQuestionnaireHealer.java
+++ b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/ComponentQuestionnaireHealer.java
@@ -4,7 +4,6 @@
 import com.google.gson.JsonObject;
 import com.google.gson.JsonParser;
 import org.apache.commons.lang3.StringUtils;
-import org.openecomp.sdc.common.utils.SdcCommon;
 import org.openecomp.sdc.healing.interfaces.Healer;
 import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDao;
@@ -19,7 +18,6 @@
 import org.openecomp.sdc.versioning.dao.types.Version;
 
 import java.util.Collection;
-import java.util.Map;
 import java.util.Objects;
 
 
@@ -57,11 +55,9 @@
   }
 
   @Override
-  public Object heal(Map<String, Object> healingParams) throws Exception {
-    mdcDataDebugMessage.debugEntryMessage("VSP ID",
-        (String) healingParams.get(SdcCommon.VSP_ID));
-    String vspId = (String) healingParams.get(SdcCommon.VSP_ID);
-    Version version = (Version) healingParams.get(SdcCommon.VERSION);
+  public Object heal(String vspId, Version version) throws Exception {
+    mdcDataDebugMessage.debugEntryMessage("VSP ID", vspId);
+
     Collection<ComponentEntity> componentEntities =
         componentDao.list(new ComponentEntity(vspId, version, null));
     componentEntities.forEach(componentEntity -> {
diff --git a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/CompositionDataHealer.java b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/CompositionDataHealer.java
index 6fc8cfe..e7a5e30 100644
--- a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/CompositionDataHealer.java
+++ b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/CompositionDataHealer.java
@@ -31,7 +31,6 @@
 import org.openecomp.core.utilities.json.JsonUtil;
 import org.openecomp.core.utilities.orchestration.OnboardingTypesEnum;
 import org.openecomp.sdc.common.utils.CommonUtil;
-import org.openecomp.sdc.common.utils.SdcCommon;
 import org.openecomp.sdc.healing.interfaces.Healer;
 import org.openecomp.sdc.logging.api.Logger;
 import org.openecomp.sdc.logging.api.LoggerFactory;
@@ -57,7 +56,7 @@
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ImageEntity;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.UploadDataEntity;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.OrchestrationTemplateEntity;
 import org.openecomp.sdc.vendorsoftwareproduct.factory.CompositionDataExtractorFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.factory.CompositionEntityDataManagerFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.services.composition.CompositionDataExtractor;
@@ -69,7 +68,6 @@
 
 import java.io.IOException;
 import java.util.Collection;
-import java.util.Map;
 import java.util.Objects;
 import java.util.Optional;
 
@@ -102,14 +100,10 @@
   }
 
   @Override
-  public Optional<CompositionData> heal(Map<String, Object> healingParams) throws IOException {
+  public Optional<CompositionData> heal(String vspId,
+                                        Version version) throws IOException {
     mdcDataDebugMessage.debugEntryMessage(null);
 
-    String vspId = (String) healingParams.get(SdcCommon.VSP_ID);
-    Version version = VERSION00.equals(healingParams.get(SdcCommon.VERSION))
-        ? VERSION01
-        : (Version) healingParams.get(SdcCommon.VERSION);
-
     Collection<ComponentEntity> componentEntities =
         componentDao.list(new ComponentEntity(vspId, version, null));
     Collection<NicEntity> nicEntities = nicDao.listByVsp(vspId, version);
@@ -131,7 +125,7 @@
           serviceModels.get()) : null;
     }
 
-    if(serviceModels.isPresent()) {
+    if (serviceModels.isPresent()) {
       compositionData =
           getCompositionDataForHealing(vspId, version, serviceModels.get());
       HealNfodData(vspId, version, compositionData);
@@ -150,16 +144,16 @@
     if (CollectionUtils.isEmpty(computeEntities) && CollectionUtils.isEmpty(imageEntities)) {
       for (Component component : compositionData.getComponents()) {
         String componentId = null;
-        for (ComponentEntity componentEntity:componentEntities) {
+        for (ComponentEntity componentEntity : componentEntities) {
           if (componentEntity.getComponentCompositionData().getName().equals(component.getData()
               .getName())) {
             componentId = componentEntity.getId();
             break;
           }
         }
-        compositionEntityDataManager.saveComputesFlavorByComponent(vspId,version,component,
+        compositionEntityDataManager.saveComputesFlavorByComponent(vspId, version, component,
             componentId);
-        compositionEntityDataManager.saveImagesByComponent(vspId,version,component,
+        compositionEntityDataManager.saveImagesByComponent(vspId, version, component,
             componentId);
       }
 
@@ -228,13 +222,15 @@
   }
 
   private Optional<Pair<ToscaServiceModel, ToscaServiceModel>> getServiceModelForHealing(String
-                                                                                             vspId, Version
+                                                                                             vspId,
+                                                                                         Version
                                                                                              version)
       throws IOException {
     mdcDataDebugMessage.debugEntryMessage("VSP id", vspId);
 
-    UploadDataEntity uploadData =
-        orchestrationTemplateDataDao.getOrchestrationTemplate(vspId, version);
+    /*OrchestrationTemplateEntity uploadData =
+        vendorSoftwareProductDao.getUploadData(new OrchestrationTemplateEntity(vspId, version));*/
+    OrchestrationTemplateEntity uploadData = orchestrationTemplateDataDao.get(vspId, version);
 
     if (Objects.isNull(uploadData) || Objects.isNull(uploadData.getContentData())) {
       return Optional.empty();
@@ -259,7 +255,7 @@
         .getNonUnifiedToscaServiceModel()));
   }
 
-  private TranslatorOutput getTranslatorOutputForHealing(UploadDataEntity uploadData) {
+  private TranslatorOutput getTranslatorOutputForHealing(OrchestrationTemplateEntity uploadData) {
 
     FileContentHandler fileContentHandler;
     try {
diff --git a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/FileDataStructureHealer.java b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/FileDataStructureHealer.java
index 4a0a5f9..6e49c9a 100644
--- a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/FileDataStructureHealer.java
+++ b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/FileDataStructureHealer.java
@@ -24,33 +24,23 @@
 import org.openecomp.core.utilities.json.JsonUtil;
 import org.openecomp.core.utilities.orchestration.OnboardingTypesEnum;
 import org.openecomp.sdc.common.utils.CommonUtil;
-import org.openecomp.sdc.common.utils.SdcCommon;
-import org.openecomp.sdc.datatypes.error.ErrorMessage;
 import org.openecomp.sdc.healing.interfaces.Healer;
 import org.openecomp.sdc.logging.api.Logger;
 import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.OrchestrationTemplateDao;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.OrchestrationTemplateDaoFactory;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.OrchestrationTemplateCandidateDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.OrchestrationTemplateCandidateDaoFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.OrchestrationTemplateCandidateData;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.UploadDataEntity;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
 import org.openecomp.sdc.vendorsoftwareproduct.factory.CandidateServiceFactory;
-import org.openecomp.sdc.vendorsoftwareproduct.services.filedatastructuremodule.CandidateService;
 import org.openecomp.sdc.vendorsoftwareproduct.services.utils.CandidateEntityBuilder;
 import org.openecomp.sdc.vendorsoftwareproduct.types.candidateheat.FilesDataStructure;
 import org.openecomp.sdc.versioning.dao.types.Version;
 
 import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
 import java.util.Optional;
 
 public class FileDataStructureHealer implements Healer {
-  private static final OrchestrationTemplateDao orchestrationTemplateDataDao =
-      OrchestrationTemplateDaoFactory.getInstance().createInterface();
-  private static CandidateService candidateService =
-      CandidateServiceFactory.getInstance().createInterface();
   private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage();
 
   private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName());
@@ -59,64 +49,55 @@
   }
 
   @Override
-  public Optional<FilesDataStructure> heal(Map<String, Object> healingParams) throws Exception {
-
-
+  public Optional<FilesDataStructure> heal(String vspId,
+                                           Version version) throws Exception {
     mdcDataDebugMessage.debugEntryMessage(null);
 
-    Optional<FilesDataStructure> healingResult = Optional.empty();
-    String vspId = (String) healingParams.get(SdcCommon.VSP_ID);
-    Version version = (Version) healingParams.get(SdcCommon.VERSION);
-    String user = (String) healingParams.get(SdcCommon.USER);
+    OrchestrationTemplateCandidateDao candidateDao =
+        OrchestrationTemplateCandidateDaoFactory.getInstance().createInterface();
 
-    UploadDataEntity uploadData =
-        orchestrationTemplateDataDao.getOrchestrationTemplate(vspId,version);
-    if (uploadData == null || uploadData.getContentData() == null) {
-      FilesDataStructure emptyFilesDataStructure = new FilesDataStructure();
-      return Optional.of(emptyFilesDataStructure);
+    OrchestrationTemplateCandidateData candidateData = candidateDao.get(vspId, version);
+
+    if (candidateData == null || candidateData.getContentData() == null ||
+        candidateData.getFilesDataStructure() != null) {
+      return Optional.of(new FilesDataStructure());
     }
 
-    Optional<FilesDataStructure> candidateFileDataStructure =
-        candidateService.getOrchestrationTemplateCandidateFileDataStructure(vspId, version);
+    Optional<FilesDataStructure> filesDataStructure =
+        healFilesDataStructure(vspId, version, candidateData);
 
-    if (!candidateFileDataStructure.isPresent()) {
-      healingResult = healFilesDataStructure(vspId, version, user, uploadData);
-    }
+    filesDataStructure
+        .ifPresent(structure -> candidateDao.updateStructure(vspId, version, structure));
 
     mdcDataDebugMessage.debugExitMessage(null);
-    return healingResult;
+    return filesDataStructure;
   }
 
-  private Optional<FilesDataStructure> healFilesDataStructure(String vspId, Version version,
-                                                              String user,
-                                                              UploadDataEntity uploadData)
+  private Optional<FilesDataStructure> healFilesDataStructure(
+      String vspId, Version version, OrchestrationTemplateCandidateData candidateData)
       throws Exception {
-
-
     mdcDataDebugMessage.debugEntryMessage(null);
 
     Optional<FilesDataStructure> healingResult;
-    byte[] byteContentData = uploadData.getContentData().array();
+    byte[] byteContentData = candidateData.getContentData().array();
     FileContentHandler fileContentHandler;
-    try{
-      fileContentHandler = CommonUtil.validateAndUploadFileContent(OnboardingTypesEnum.ZIP, byteContentData);
-      Map<String, List<ErrorMessage>> errors = new HashMap<>();
-      OrchestrationTemplateCandidateData candidateDataEntity =
-        new CandidateEntityBuilder(candidateService)
-            .buildCandidateEntityFromZip(new VspDetails(vspId, version), byteContentData,
-                fileContentHandler, errors, user);
+    try {
+      fileContentHandler =
+          CommonUtil.validateAndUploadFileContent(OnboardingTypesEnum.ZIP, byteContentData);
 
-      healingResult = getFileDataStructureFromJson(candidateDataEntity.getFilesDataStructure());
-    }catch (Exception e){
+      String filesDataStructure =
+          new CandidateEntityBuilder(CandidateServiceFactory.getInstance().createInterface())
+              .buildCandidateEntityFromZip(new VspDetails(vspId, version), byteContentData,
+                  fileContentHandler, new HashMap<>()).getFilesDataStructure();
+
+      healingResult =
+          Optional.of(JsonUtil.json2Object(filesDataStructure, FilesDataStructure.class));
+    } catch (Exception e) {
       log.debug("", e);
-      return Optional.empty();
+      healingResult = Optional.empty();
     }
 
     mdcDataDebugMessage.debugExitMessage(null);
     return healingResult;
   }
-
-  private Optional<FilesDataStructure> getFileDataStructureFromJson(String fileDataStructureJson) {
-    return Optional.of(JsonUtil.json2Object(fileDataStructureJson, FilesDataStructure.class));
-  }
 }
diff --git a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/ForwarderCapabilityHealer.java b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/ForwarderCapabilityHealer.java
index c2d7c2c..7991c59 100644
--- a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/ForwarderCapabilityHealer.java
+++ b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/ForwarderCapabilityHealer.java
@@ -5,7 +5,6 @@
 import org.openecomp.core.model.dao.ServiceModelDaoFactory;
 import org.openecomp.core.model.types.ServiceElement;
 import org.openecomp.sdc.common.togglz.ToggleableFeature;
-import org.openecomp.sdc.common.utils.SdcCommon;
 import org.openecomp.sdc.healing.interfaces.Healer;
 import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage;
 import org.openecomp.sdc.tosca.datatypes.ToscaNodeType;
@@ -46,10 +45,7 @@
   }
 
   @Override
-  public Object heal(Map<String, Object> healingParams) throws Exception {
-    String vspId = (String) healingParams.get(SdcCommon.VSP_ID);
-    Version version = (Version) healingParams.get(SdcCommon.VERSION);
-
+  public Object heal(String vspId, Version version) throws Exception {
     if(!ToggleableFeature.FORWARDER_CAPABILITY.isActive()) {
       return Optional.empty();
     }
diff --git a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/HeatToToscaTranslationHealer.java b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/HeatToToscaTranslationHealer.java
index 32cd8cb..ddae09f 100644
--- a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/HeatToToscaTranslationHealer.java
+++ b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/HeatToToscaTranslationHealer.java
@@ -3,14 +3,11 @@
 
 import org.openecomp.core.model.dao.ServiceModelDao;
 import org.openecomp.core.model.dao.ServiceModelDaoFactory;
-import org.openecomp.core.model.dao.ServiceTemplateDaoFactory;
-import org.openecomp.core.model.dao.ServiceTemplateDaoInter;
 import org.openecomp.core.model.types.ServiceElement;
 import org.openecomp.core.translator.datatypes.TranslatorOutput;
 import org.openecomp.core.utilities.file.FileContentHandler;
 import org.openecomp.core.utilities.orchestration.OnboardingTypesEnum;
 import org.openecomp.sdc.common.utils.CommonUtil;
-import org.openecomp.sdc.common.utils.SdcCommon;
 import org.openecomp.sdc.healing.interfaces.Healer;
 import org.openecomp.sdc.logging.api.Logger;
 import org.openecomp.sdc.logging.api.LoggerFactory;
@@ -19,37 +16,32 @@
 import org.openecomp.sdc.translator.services.heattotosca.HeatToToscaUtil;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.OrchestrationTemplateDao;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.OrchestrationTemplateDaoFactory;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.UploadDataEntity;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.OrchestrationTemplateEntity;
 import org.openecomp.sdc.versioning.dao.types.Version;
 
-import java.util.Map;
 import java.util.Objects;
 import java.util.Optional;
 
-public class HeatToToscaTranslationHealer implements Healer  {
+public class HeatToToscaTranslationHealer implements Healer {
 
   private static final OrchestrationTemplateDao orchestrationTemplateDao =
       OrchestrationTemplateDaoFactory.getInstance().createInterface();
   private static final ServiceModelDao<ToscaServiceModel, ServiceElement> serviceModelDao =
       ServiceModelDaoFactory.getInstance().createInterface();
-  public static final ServiceTemplateDaoInter
-      templateDao = ServiceTemplateDaoFactory.getInstance().createInterface();
   private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage();
 
   private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName());
 
-  public HeatToToscaTranslationHealer(){
+  public HeatToToscaTranslationHealer() {
 
   }
 
   @Override
-  public Object heal(Map<String, Object> healingParams) throws Exception {
-    mdcDataDebugMessage.debugEntryMessage(null, null);
-    String vspId = (String) healingParams.get(SdcCommon.VSP_ID);
-    Version version = (Version) healingParams.get(SdcCommon.VERSION);
-    String user = (String) healingParams.get(SdcCommon.USER);
-    UploadDataEntity uploadData =
-        orchestrationTemplateDao.getOrchestrationTemplate(vspId, version);
+  public Object heal(String vspId, Version version) throws Exception {
+    mdcDataDebugMessage.debugEntryMessage(null);;
+
+    OrchestrationTemplateEntity uploadData =
+        orchestrationTemplateDao.get(vspId, version);
 
     if (Objects.isNull(uploadData) || Objects.isNull(uploadData.getContentData())) {
       return Optional.empty();
@@ -58,8 +50,9 @@
     FileContentHandler fileContentHandler;
     TranslatorOutput translatorOutput;
     try {
-      fileContentHandler = CommonUtil.validateAndUploadFileContent(OnboardingTypesEnum.ZIP, uploadData
-          .getContentData().array());
+      fileContentHandler =
+          CommonUtil.validateAndUploadFileContent(OnboardingTypesEnum.ZIP, uploadData
+              .getContentData().array());
       translatorOutput =
           HeatToToscaUtil.loadAndTranslateTemplateData(fileContentHandler);
     } catch (Exception e) {
diff --git a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/NicDataHealer.java b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/NicDataHealer.java
index 123a943..b2ef965 100644
--- a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/NicDataHealer.java
+++ b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/NicDataHealer.java
@@ -1,20 +1,16 @@
 package org.openecomp.sdc.healing.healers;
 
 
-import org.openecomp.sdc.common.utils.SdcCommon;
 import org.openecomp.sdc.healing.interfaces.Healer;
 import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.NicDao;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.NicDaoFactory;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDaoFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity;
 import org.openecomp.sdc.vendorsoftwareproduct.types.composition.NetworkType;
 import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Nic;
 import org.openecomp.sdc.versioning.dao.types.Version;
 
 import java.util.Collection;
-import java.util.Map;
 
 public class NicDataHealer implements Healer {
   /*private static final VendorSoftwareProductDao vendorSoftwareProductDao =
@@ -28,11 +24,9 @@
 
   }
   @Override
-  public Object heal(Map<String, Object> healingParams) throws Exception {
+  public Object heal(String vspId, Version version) throws Exception {
     mdcDataDebugMessage.debugEntryMessage(null, null);
-    String vspId = (String) healingParams.get(SdcCommon.VSP_ID);
-    Version version = (Version) healingParams.get(SdcCommon.VERSION);
-    String user = (String) healingParams.get(SdcCommon.USER);
+
     Collection<NicEntity> nics = nicDao.listByVsp(vspId, version);
     for (NicEntity nicEntity : nics) {
       Nic nic = nicEntity.getNicCompositionData();
diff --git a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/OwnerHealer.java b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/OwnerHealer.java
new file mode 100644
index 0000000..acc20c9
--- /dev/null
+++ b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/OwnerHealer.java
@@ -0,0 +1,47 @@
+package org.openecomp.sdc.healing.healers;
+
+import org.openecomp.sdc.common.session.SessionContextProviderFactory;
+import org.openecomp.sdc.healing.interfaces.Healer;
+import org.openecomp.sdc.itempermissions.dao.ItemPermissionsDao;
+import org.openecomp.sdc.itempermissions.dao.ItemPermissionsDaoFactory;
+import org.openecomp.sdc.itempermissions.impl.types.PermissionTypes;
+import org.openecomp.sdc.itempermissions.type.ItemPermissionsEntity;
+import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+
+/**
+ * Created by ayalaben on 8/28/2017
+ */
+public class OwnerHealer implements Healer {
+  private static final String HEALING_USER_SUFFIX = "_healer";
+  private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage();
+
+  private static final ItemPermissionsDao permissionsDao =
+      ItemPermissionsDaoFactory.getInstance().createInterface();
+
+  public Object heal(String itemId, Version version) {
+    mdcDataDebugMessage.debugEntryMessage(null);
+
+    Collection<ItemPermissionsEntity> itemPermissions = permissionsDao.listItemPermissions(itemId);
+
+    if (itemPermissions.stream().noneMatch(this::isOwnerPermission)) {
+      String currentUserId =
+          SessionContextProviderFactory.getInstance().createInterface().get().getUser().getUserId()
+              .replace(HEALING_USER_SUFFIX, "");
+
+      permissionsDao.updateItemPermissions(itemId, PermissionTypes.Owner.name(),
+          Collections.singleton(currentUserId), new HashSet<>());
+
+      return currentUserId;
+    }
+    return itemPermissions.stream().filter(this::isOwnerPermission).findFirst().get().getUserId();
+  }
+
+  private boolean isOwnerPermission(ItemPermissionsEntity permissionsEntity) {
+    return permissionsEntity.getPermission().equals(PermissionTypes.Owner.name());
+  }
+}
diff --git a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/SubEntitiesQuestionnaireHealer.java b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/SubEntitiesQuestionnaireHealer.java
index 9355eb0..a1dd80c 100644
--- a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/SubEntitiesQuestionnaireHealer.java
+++ b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/SubEntitiesQuestionnaireHealer.java
@@ -21,7 +21,6 @@
 package org.openecomp.sdc.healing.healers;
 
 import org.openecomp.core.utilities.json.JsonSchemaDataGenerator;
-import org.openecomp.sdc.common.utils.SdcCommon;
 import org.openecomp.sdc.healing.interfaces.Healer;
 import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDao;
@@ -30,8 +29,6 @@
 import org.openecomp.sdc.vendorsoftwareproduct.dao.NetworkDaoFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.NicDao;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.NicDaoFactory;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDaoFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.CompositionEntity;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity;
@@ -42,15 +39,12 @@
 import org.openecomp.sdc.versioning.dao.types.Version;
 
 import java.util.Collection;
-import java.util.Map;
 import java.util.Objects;
 
 public class SubEntitiesQuestionnaireHealer implements Healer {
   private static Version version00 = new Version(0, 0);
   private MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage();
 
-  private static final VendorSoftwareProductDao vendorSoftwareProductDao =
-      VendorSoftwareProductDaoFactory.getInstance().createInterface();
   private static ComponentDao componentDao = ComponentDaoFactory.getInstance().createInterface();
   private static NicDao nicDao = NicDaoFactory.getInstance().createInterface();
   private static NetworkDao networkDao = NetworkDaoFactory.getInstance().createInterface();
@@ -59,22 +53,17 @@
   private static String emptyJson = "{}";
 
   @Override
-  public Object heal(Map<String, Object> healingParams) throws Exception {
+  public Object heal(String vspId, Version version) throws Exception {
 
 
     mdcDataDebugMessage.debugEntryMessage(null);
 
-    String vspId = (String) healingParams.get(SdcCommon.VSP_ID);
-    Version version = version00.equals(healingParams.get(SdcCommon.VERSION)) ? new Version
-        (0, 1)
-        : (Version) healingParams.get(SdcCommon.VERSION);
-
     Collection<ComponentEntity> componentEntities =
         componentDao.listCompositionAndQuestionnaire(vspId, version);
 
     networkDao.list(new NetworkEntity(vspId, version, null));
 
-    Collection<NicEntity> nicEntities = vendorSoftwareProductDao.listNicsByVsp(vspId, version);
+    Collection<NicEntity> nicEntities = nicDao.listByVsp(vspId, version);
 
     healCompositionEntityQuestionnaire(componentEntities, version, CompositionEntityType.component);
     healCompositionEntityQuestionnaire(nicEntities, version, CompositionEntityType.nic);
diff --git a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/ValidationStructureHealer.java b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/ValidationStructureHealer.java
index 4bf7e18..d172432 100644
--- a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/ValidationStructureHealer.java
+++ b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/ValidationStructureHealer.java
@@ -2,7 +2,6 @@
 
 import org.apache.commons.collections4.CollectionUtils;
 import org.openecomp.core.utilities.json.JsonUtil;
-import org.openecomp.sdc.common.utils.SdcCommon;
 import org.openecomp.sdc.datatypes.error.ErrorMessage;
 import org.openecomp.sdc.healing.interfaces.Healer;
 import org.openecomp.sdc.heat.datatypes.manifest.FileData;
@@ -13,16 +12,11 @@
 import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.OrchestrationTemplateDao;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.OrchestrationTemplateDaoFactory;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDao;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDaoFactory;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.UploadData;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.UploadDataEntity;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.OrchestrationTemplateEntity;
 import org.openecomp.sdc.versioning.dao.types.Version;
 
 import java.util.HashSet;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
 import java.util.Optional;
 import java.util.Set;
@@ -32,78 +26,55 @@
  */
 public class ValidationStructureHealer implements Healer {
 
-  private static final VendorSoftwareProductInfoDao vspInfoDao =
-      VendorSoftwareProductInfoDaoFactory.getInstance().createInterface();
+  private static final Logger logger = LoggerFactory.getLogger(JsonUtil.class);
   private static final OrchestrationTemplateDao orchestrationTemplateDao =
       OrchestrationTemplateDaoFactory.getInstance().createInterface();
-  private static final Logger logger = LoggerFactory.getLogger(JsonUtil.class);
 
   @Override
-  public Object heal(Map<String, Object> healingParams) throws Exception {
+  public Object heal(String vspId, Version version) throws Exception {
 
-    String vspId = (String) healingParams.get(SdcCommon.VSP_ID);
-    Version version = (Version) healingParams.get(SdcCommon.VERSION);
+    OrchestrationTemplateEntity orchestrationTemplate =
+        orchestrationTemplateDao.get(vspId, version);
 
-    VspDetails vspDetails = vspInfoDao.get(new VspDetails(vspId, version));
-    UploadDataEntity orchestrationTemplate =
-        orchestrationTemplateDao.getOrchestrationTemplate(vspId, version);
-
-    if(Objects.isNull(orchestrationTemplate.getValidationData())
-        || !JsonUtil.isValidJson(orchestrationTemplate.getValidationData())){
+    if (Objects.isNull(orchestrationTemplate.getValidationData())
+        || !JsonUtil.isValidJson(orchestrationTemplate.getValidationData())) {
       return Optional.empty();
     }
 
     OldValidationStructureTree oldValidationStructureTree;
-    try{
-      oldValidationStructureTree =
-          JsonUtil.json2Object(orchestrationTemplate.getValidationData(), OldValidationStructureTree
-              .class);
-    } catch (Exception e){
-      logger.debug("",e);
+    try {
+      oldValidationStructureTree = JsonUtil
+          .json2Object(orchestrationTemplate.getValidationData(), OldValidationStructureTree.class);
+    } catch (Exception e) {
+      logger.debug("", e);
       return Optional.empty();
     }
 
     Optional<HeatStructureTree> newHeatStructureTreeFromOldStructureTree =
-        createNewHeatStructureTreeFromOldStructureTree(oldValidationStructureTree.getImportStructure());
+        createNewHeatStructureTreeFromOldStructureTree(
+            oldValidationStructureTree.getImportStructure());
 
-    if(newHeatStructureTreeFromOldStructureTree.isPresent()){
-      ValidationStructureList validationData = new ValidationStructureList
-          (newHeatStructureTreeFromOldStructureTree.get());
-      vspDetails.setValidationDataStructure(validationData);
+    newHeatStructureTreeFromOldStructureTree.ifPresent(newStructure ->
+        updateValuesInDb(vspId, version, orchestrationTemplate,
+            new ValidationStructureList(newStructure)));
 
-      updateValuesInDb(vspId, vspDetails, orchestrationTemplate, validationData);
-    }
     return newHeatStructureTreeFromOldStructureTree;
 
   }
 
-  private void updateValuesInDb(String vspId, VspDetails vspDetails,
-                                UploadDataEntity orchestrationTemplate,
+  private void updateValuesInDb(String vspId, Version version,
+                                OrchestrationTemplateEntity orchestrationTemplate,
                                 ValidationStructureList validationData) {
-    vspInfoDao.update(vspDetails);
-    UploadData uploadData = getUpdatedUploadData(orchestrationTemplate, validationData);
-    orchestrationTemplateDao.updateOrchestrationTemplateData(vspId, uploadData);
+    orchestrationTemplate.setValidationDataStructure(validationData);
+    orchestrationTemplateDao.update(vspId, version, orchestrationTemplate);
   }
 
-  private UploadData getUpdatedUploadData(UploadDataEntity orchestrationTemplate,
-                                          ValidationStructureList validationData) {
-    UploadData uploadData = new UploadData();
-    uploadData.setValidationDataStructure(validationData);
-    uploadData.setValidationData(JsonUtil.object2Json(validationData));
-    uploadData.setContentData(orchestrationTemplate.getContentData());
-    uploadData.setId(orchestrationTemplate.getId());
-    uploadData.setPackageName(orchestrationTemplate.getPackageName());
-    uploadData.setPackageVersion(orchestrationTemplate.getPackageVersion());
-    return uploadData;
-  }
-
-
-  private Optional<HeatStructureTree> createNewHeatStructureTreeFromOldStructureTree(OldHeatStructureTree
-                                                               oldHeatStructureTree){
+  private Optional<HeatStructureTree> createNewHeatStructureTreeFromOldStructureTree(
+      OldHeatStructureTree oldHeatStructureTree) {
 
     HeatStructureTree heatStructureTree = new HeatStructureTree();
 
-    if(Objects.isNull(oldHeatStructureTree)){
+    if (Objects.isNull(oldHeatStructureTree)) {
       return Optional.empty();
     }
 
@@ -112,11 +83,14 @@
     Set<OldHeatStructureTree> heat =
         oldHeatStructureTree.getHeat() == null ? new HashSet<>() : oldHeatStructureTree.getHeat();
     Set<OldHeatStructureTree> volume =
-        oldHeatStructureTree.getVolume() == null ? new HashSet<>() : oldHeatStructureTree.getVolume();
+        oldHeatStructureTree.getVolume() == null ? new HashSet<>()
+            : oldHeatStructureTree.getVolume();
     Set<OldHeatStructureTree> nested =
-        oldHeatStructureTree.getNested() == null ? new HashSet<>() : oldHeatStructureTree.getNested();
+        oldHeatStructureTree.getNested() == null ? new HashSet<>()
+            : oldHeatStructureTree.getNested();
     Set<OldHeatStructureTree> network =
-        oldHeatStructureTree.getNetwork() == null ? new HashSet<>() : oldHeatStructureTree.getNetwork();
+        oldHeatStructureTree.getNetwork() == null ? new HashSet<>()
+            : oldHeatStructureTree.getNetwork();
 
 
     heatStructureTree.setHeat(createHeatStructureTreeSetFromOld(heat));
@@ -124,57 +98,47 @@
     heatStructureTree.setNested(createHeatStructureTreeSetFromOld(nested));
     heatStructureTree.setNetwork(createHeatStructureTreeSetFromOld(network));
 
-
     return Optional.of(heatStructureTree);
-
   }
 
-  private void mapOldHeatStructureTreeValues(
-      OldHeatStructureTree oldHeatStructureTree,
-      HeatStructureTree heatStructureTree) {
+  private void mapOldHeatStructureTreeValues(OldHeatStructureTree oldHeatStructureTree,
+                                             HeatStructureTree heatStructureTree) {
     heatStructureTree.setFileName(oldHeatStructureTree.getFileName());
     heatStructureTree.setBase(oldHeatStructureTree.getBase());
     heatStructureTree.setType(oldHeatStructureTree.getType());
     heatStructureTree.setArtifacts(oldHeatStructureTree.getArtifacts());
     heatStructureTree.setErrors(oldHeatStructureTree.getErrors());
 
-    if(Objects.nonNull(oldHeatStructureTree.getEnv())) {
+    if (Objects.nonNull(oldHeatStructureTree.getEnv())) {
       heatStructureTree.setEnv(new HeatStructureTree(oldHeatStructureTree.getEnv(), false));
     }
   }
 
   private Set<HeatStructureTree> createHeatStructureTreeSetFromOld(Set<OldHeatStructureTree>
-                                                                        oldHeatStructureTreeSet){
-    if(CollectionUtils.isEmpty(oldHeatStructureTreeSet)){
+                                                                       oldHeatStructureTreeSet) {
+    if (CollectionUtils.isEmpty(oldHeatStructureTreeSet)) {
       return null;
     }
     Set<HeatStructureTree> newHeatStructureSet = new HashSet<>();
 
-    for(OldHeatStructureTree old : oldHeatStructureTreeSet){
+    for (OldHeatStructureTree old : oldHeatStructureTreeSet) {
       Optional<HeatStructureTree> newHeatStructureTree =
           createNewHeatStructureTreeFromOldStructureTree(old);
-      if(newHeatStructureTree.isPresent()){
-        newHeatStructureSet.add(newHeatStructureTree.get());
-      }
+      newHeatStructureTree.ifPresent(newHeatStructureSet::add);
     }
 
     return newHeatStructureSet;
   }
 
-  private class OldValidationStructureTree{
+  private class OldValidationStructureTree {
     private OldHeatStructureTree importStructure;
 
-    public OldHeatStructureTree getImportStructure() {
+    OldHeatStructureTree getImportStructure() {
       return importStructure;
     }
-
-    public void setImportStructure(
-        OldHeatStructureTree importStructure) {
-      this.importStructure = importStructure;
-    }
   }
 
-  private class OldHeatStructureTree{
+  private class OldHeatStructureTree {
     private String fileName;
     private FileData.Type type;
     private Boolean isBase;
@@ -190,93 +154,93 @@
     public OldHeatStructureTree() {
     }
 
-  public String getFileName() {
-    return fileName;
-  }
+    public String getFileName() {
+      return fileName;
+    }
 
-  public void setFileName(String fileName) {
-    this.fileName = fileName;
-  }
+    public void setFileName(String fileName) {
+      this.fileName = fileName;
+    }
 
-  public FileData.Type getType() {
-    return type;
-  }
+    public FileData.Type getType() {
+      return type;
+    }
 
-  public void setType(FileData.Type type) {
-    this.type = type;
-  }
+    public void setType(FileData.Type type) {
+      this.type = type;
+    }
 
-  public Boolean getBase() {
-    return isBase;
-  }
+    public Boolean getBase() {
+      return isBase;
+    }
 
-  public void setBase(Boolean base) {
-    isBase = base;
-  }
+    public void setBase(Boolean base) {
+      isBase = base;
+    }
 
-  public String getEnv() {
-    return env;
-  }
+    public String getEnv() {
+      return env;
+    }
 
-  public void setEnv(String env) {
-    this.env = env;
-  }
+    public void setEnv(String env) {
+      this.env = env;
+    }
 
-  public List<ErrorMessage> getErrors() {
-    return errors;
-  }
+    public List<ErrorMessage> getErrors() {
+      return errors;
+    }
 
-  public void setErrors(List<ErrorMessage> errors) {
-    this.errors = errors;
-  }
+    public void setErrors(List<ErrorMessage> errors) {
+      this.errors = errors;
+    }
 
-  public Set<OldHeatStructureTree> getHeat() {
-    return heat;
-  }
+    public Set<OldHeatStructureTree> getHeat() {
+      return heat;
+    }
 
-  public void setHeat(Set<OldHeatStructureTree> heat) {
-    this.heat = heat;
-  }
+    public void setHeat(Set<OldHeatStructureTree> heat) {
+      this.heat = heat;
+    }
 
-  public Set<OldHeatStructureTree> getVolume() {
-    return volume;
-  }
+    public Set<OldHeatStructureTree> getVolume() {
+      return volume;
+    }
 
-  public void setVolume(Set<OldHeatStructureTree> volume) {
-    this.volume = volume;
-  }
+    public void setVolume(Set<OldHeatStructureTree> volume) {
+      this.volume = volume;
+    }
 
-  public Set<OldHeatStructureTree> getNetwork() {
-    return network;
-  }
+    public Set<OldHeatStructureTree> getNetwork() {
+      return network;
+    }
 
-  public void setNetwork(
-      Set<OldHeatStructureTree> network) {
-    this.network = network;
-  }
+    public void setNetwork(
+        Set<OldHeatStructureTree> network) {
+      this.network = network;
+    }
 
-  public Set<OldHeatStructureTree> getNested() {
-    return nested;
-  }
+    public Set<OldHeatStructureTree> getNested() {
+      return nested;
+    }
 
-  public void setNested(Set<OldHeatStructureTree> nested) {
-    this.nested = nested;
-  }
+    public void setNested(Set<OldHeatStructureTree> nested) {
+      this.nested = nested;
+    }
 
-  public Set<OldHeatStructureTree> getOther() {
-    return other;
-  }
+    public Set<OldHeatStructureTree> getOther() {
+      return other;
+    }
 
-  public void setOther(Set<OldHeatStructureTree> other) {
-    this.other = other;
-  }
+    public void setOther(Set<OldHeatStructureTree> other) {
+      this.other = other;
+    }
 
-  public Set<Artifact> getArtifacts() {
-    return artifacts;
-  }
+    public Set<Artifact> getArtifacts() {
+      return artifacts;
+    }
 
-  public void setArtifacts(Set<Artifact> artifacts) {
-    this.artifacts = artifacts;
+    public void setArtifacts(Set<Artifact> artifacts) {
+      this.artifacts = artifacts;
+    }
   }
 }
-}
diff --git a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/VlmVersionHealer.java b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/VlmVersionHealer.java
index 085923b..a57ac74 100644
--- a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/VlmVersionHealer.java
+++ b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/VlmVersionHealer.java
@@ -1,26 +1,21 @@
 package org.openecomp.sdc.healing.healers;
 
-import org.apache.commons.collections4.CollectionUtils;
-import org.openecomp.sdc.common.utils.SdcCommon;
 import org.openecomp.sdc.healing.interfaces.Healer;
 import org.openecomp.sdc.logging.api.Logger;
 import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.openecomp.sdc.vendorlicense.dao.LicenseAgreementDao;
 import org.openecomp.sdc.vendorlicense.dao.LicenseAgreementDaoFactory;
 import org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity;
-import org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity;
-import org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacade;
-import org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacadeFactory;
-import org.openecomp.sdc.vendorlicense.types.VersionedVendorLicenseModel;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDao;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDaoFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
+import org.openecomp.sdc.versioning.VersioningManager;
+import org.openecomp.sdc.versioning.VersioningManagerFactory;
 import org.openecomp.sdc.versioning.dao.types.Version;
-import org.openecomp.sdc.versioning.types.VersionInfo;
+import org.openecomp.sdc.versioning.dao.types.VersionStatus;
 
 import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
+import java.util.Collection;
 import java.util.Objects;
 import java.util.Optional;
 
@@ -28,8 +23,8 @@
  * Created by TALIO on 7/3/2017.
  */
 public class VlmVersionHealer implements Healer {
-  private static final VendorLicenseFacade vendorLicenseFacade =
-      VendorLicenseFacadeFactory.getInstance().createInterface();
+  private VersioningManager versioningManager =
+      VersioningManagerFactory.getInstance().createInterface();
   private static final VendorSoftwareProductInfoDao vspInfoDao =
       VendorSoftwareProductInfoDaoFactory.getInstance().createInterface();
   private static final LicenseAgreementDao licenseAgreementDao =
@@ -38,51 +33,35 @@
       LoggerFactory.getLogger(VlmVersionHealer.class);
 
   @Override
-  public Object heal(Map<String, Object> healingParams) throws Exception {
-    String vspId = (String) healingParams.get(SdcCommon.VSP_ID);
-    Version version = (Version) healingParams.get(SdcCommon.VERSION);
-    String user = (String) healingParams.get(SdcCommon.USER);
-
+  public Object heal(String vspId, Version version) throws Exception {
     VspDetails vspDetails = vspInfoDao.get(new VspDetails(vspId, version));
-    VersionedVendorLicenseModel vendorLicenseModel;
-    
-    if(!Objects.isNull(vspDetails.getVlmVersion())) {
+
+    if (!Objects.isNull(vspDetails.getVlmVersion())) {
       return Optional.empty();
     }
 
-
-    try{
-      vendorLicenseModel =
-          vendorLicenseFacade.getVendorLicenseModel(vspDetails.getVendorId(), null, user);
-    } catch (Exception e){
-      logger.debug("" + e);
+    // get the certified vlm version with the highest number in its name
+    Optional<Version> certifiedVlmVersion =
+        versioningManager.list(vspDetails.getVendorId()).stream()
+            .filter(ver -> VersionStatus.Certified == ver.getStatus())
+            .max((o1, o2) -> ((Double) Double.parseDouble(o1.getName()))
+                .compareTo(Double.parseDouble(o2.getName())));
+    if (!certifiedVlmVersion.isPresent()) {
       logger.debug("No Vlm was found for Vsp " + vspDetails.getName());
       return Optional.empty();
     }
+    vspDetails.setVlmVersion(certifiedVlmVersion.get());
 
-    VendorLicenseModelEntity vlm = vendorLicenseModel.getVendorLicenseModel();
-    String vlmId = vlm.getId();
-    Version vlmVersion = getLatestFinalVlmVersion(vendorLicenseModel.getVersionInfo());
-
-    List<LicenseAgreementEntity> laList =
-        new ArrayList<>(
-            licenseAgreementDao.list(new LicenseAgreementEntity(vlmId, vlmVersion, null)));
-
-
-    vspDetails.setVlmVersion(vlmVersion);
-
-    if(CollectionUtils.isNotEmpty(laList)) {
-      vspDetails.setLicenseAgreement(laList.get(0).getId());
-      vspDetails.setFeatureGroups(new ArrayList<>(laList.get(0).getFeatureGroupIds()));
+    Collection<LicenseAgreementEntity> licenseAgreements = licenseAgreementDao.list(
+        new LicenseAgreementEntity(vspDetails.getVendorId(), certifiedVlmVersion.get(), null));
+    if (!licenseAgreements.isEmpty()) {
+      LicenseAgreementEntity licenseAgreement = licenseAgreements.iterator().next();
+      vspDetails.setLicenseAgreement(licenseAgreement.getId());
+      vspDetails.setFeatureGroups(new ArrayList<>(licenseAgreement.getFeatureGroupIds()));
     }
 
     vspInfoDao.update(vspDetails);
+
     return vspDetails;
-
-  }
-
-  private Version getLatestFinalVlmVersion(VersionInfo versionInfo){
-    return versionInfo.getActiveVersion().isFinal() ? versionInfo.getActiveVersion()
-        : versionInfo.getLatestFinalVersion();
   }
 }
diff --git a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/VspOnboardingMethodHealer.java b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/VspOnboardingMethodHealer.java
index ddcd314..d5c082b 100644
--- a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/VspOnboardingMethodHealer.java
+++ b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/VspOnboardingMethodHealer.java
@@ -2,55 +2,91 @@
 
 
 import org.openecomp.core.utilities.orchestration.OnboardingTypesEnum;
-import org.openecomp.sdc.common.utils.SdcCommon;
 import org.openecomp.sdc.healing.interfaces.Healer;
 import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.OrchestrationTemplateCandidateDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.OrchestrationTemplateCandidateDaoFactory;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.OrchestrationTemplateDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.OrchestrationTemplateDaoFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDao;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDaoFactory;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.OnboardingMethod;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.OrchestrationTemplateCandidateData;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.OrchestrationTemplateEntity;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
 import org.openecomp.sdc.versioning.dao.types.Version;
 
-import java.util.Map;
 import java.util.Objects;
 
 public class VspOnboardingMethodHealer implements Healer {
-  private static VendorSoftwareProductInfoDao vendorSoftwareProductInfoDao;
+
+  private static final String DEFAULT_FILE_NAME = "Upload File";
   private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage();
+  private VendorSoftwareProductInfoDao vendorSoftwareProductInfoDao;
+  private OrchestrationTemplateDao orchestrationTemplateDao;
+  private OrchestrationTemplateCandidateDao candidateDao;
 
   public VspOnboardingMethodHealer(){
-    this(VendorSoftwareProductInfoDaoFactory.getInstance().createInterface());
+    this(VendorSoftwareProductInfoDaoFactory.getInstance().createInterface(),
+        OrchestrationTemplateDaoFactory.getInstance().createInterface(),
+        OrchestrationTemplateCandidateDaoFactory.getInstance().createInterface());
   }
 
-  public VspOnboardingMethodHealer( VendorSoftwareProductInfoDao inVendorSoftwareProductInfoDao){
-    vendorSoftwareProductInfoDao = inVendorSoftwareProductInfoDao;
+  public VspOnboardingMethodHealer(VendorSoftwareProductInfoDao vspInfoDao,
+                                   OrchestrationTemplateDao orchestrationTemplateDao,
+                                   OrchestrationTemplateCandidateDao candidateDao) {
+    this.vendorSoftwareProductInfoDao = vspInfoDao;
+    this.orchestrationTemplateDao = orchestrationTemplateDao;
+    this.candidateDao = candidateDao;
   }
 
-
   @Override
-  public Object heal(Map<String, Object> healingParams) throws Exception {
-    mdcDataDebugMessage.debugEntryMessage(null, null);
+  public Object heal(String vspId, Version version) throws Exception {
+    mdcDataDebugMessage.debugEntryMessage(null);
 
-    String onboardingMethod=null;
-    String vspId = (String) healingParams.get(SdcCommon.VSP_ID);
-    Version version = (Version) healingParams.get(SdcCommon.VERSION);
-    VspDetails vendorSoftwareProductInfo =
-        vendorSoftwareProductInfoDao.get(new VspDetails(vspId, version));
-    String onboardingValue = vendorSoftwareProductInfo.getOnboardingMethod();
+    VspDetails vsp = vendorSoftwareProductInfoDao.get(new VspDetails(vspId, version));
+    healOnboardingMethod(vsp);
 
-    if(Objects.isNull(onboardingValue)) {
-      onboardingMethod="NetworkPackage";
-
-      updateVSPInfo(OnboardingTypesEnum.ZIP.toString(), onboardingMethod, vendorSoftwareProductInfo);
-    } else if (onboardingValue.equals("HEAT")){
-      onboardingMethod="NetworkPackage";
-      updateVSPInfo(OnboardingTypesEnum.ZIP.toString(),onboardingMethod, vendorSoftwareProductInfo);
+    if (!OnboardingMethod.Manual.name().equals(vsp.getOnboardingMethod())) {
+      healOrchestrationTemplateFileName(vspId, version);
+      healOrchestrationTemplateCandidateFileName(vspId, version);
     }
-    return onboardingMethod;
+
+    mdcDataDebugMessage.debugExitMessage(null);
+    return null;
   }
 
-  private void updateVSPInfo(String onboardingOrigin,  String onboardingMethod, VspDetails vendorSoftwareProductInfo) {
-    vendorSoftwareProductInfo.setOnboardingMethod(onboardingMethod);
-    vendorSoftwareProductInfo.setOnboardingOrigin(onboardingOrigin);
-    vendorSoftwareProductInfoDao.update(vendorSoftwareProductInfo);
+  private void healOnboardingMethod(VspDetails vsp) {
+    if (Objects.isNull(vsp.getOnboardingMethod()) || "HEAT".equals(vsp.getOnboardingMethod())) {
+      vsp.setOnboardingMethod(OnboardingMethod.NetworkPackage.name());
+      vendorSoftwareProductInfoDao.update(vsp);
+    }
+  }
+
+  private void healOrchestrationTemplateFileName(String vspId, Version version) {
+    OrchestrationTemplateEntity orchestrationTemplate =
+        orchestrationTemplateDao.get(vspId, version);
+
+    if (orchestrationTemplate == null || orchestrationTemplate.getContentData() == null ||
+        orchestrationTemplate.getFileSuffix() != null) {
+      return;
+    }
+    orchestrationTemplate.setFileSuffix(OnboardingTypesEnum.ZIP.toString());
+    orchestrationTemplate.setFileName(DEFAULT_FILE_NAME);
+
+    orchestrationTemplateDao.update(vspId, version, orchestrationTemplate);
+  }
+
+  private void healOrchestrationTemplateCandidateFileName(String vspId, Version version) {
+    OrchestrationTemplateCandidateData candidate = candidateDao.get(vspId, version);
+
+    if (candidate == null || candidate.getContentData() == null ||
+        candidate.getFileSuffix() != null) {
+      return;
+    }
+    candidate.setFileSuffix(OnboardingTypesEnum.ZIP.toString());
+    candidate.setFileName(DEFAULT_FILE_NAME);
+
+    candidateDao.update(vspId, version, candidate);
   }
 }
diff --git a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/VspQuestionnaireHealer.java b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/VspQuestionnaireHealer.java
index 0952a4c..b45ce30 100644
--- a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/VspQuestionnaireHealer.java
+++ b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/VspQuestionnaireHealer.java
@@ -21,7 +21,6 @@
 package org.openecomp.sdc.healing.healers;
 
 import org.openecomp.core.utilities.json.JsonSchemaDataGenerator;
-import org.openecomp.sdc.common.utils.SdcCommon;
 import org.openecomp.sdc.healing.interfaces.Healer;
 import org.openecomp.sdc.logging.api.Logger;
 import org.openecomp.sdc.logging.api.LoggerFactory;
@@ -35,7 +34,6 @@
 import org.openecomp.sdc.versioning.dao.types.Version;
 
 import java.io.IOException;
-import java.util.Map;
 import java.util.Objects;
 import java.util.Optional;
 
@@ -50,15 +48,12 @@
   }
 
   @Override
-  public Object heal(Map<String, Object> healingParams) throws IOException {
+  public Object heal(String vspId, Version version) throws IOException {
 
 
     mdcDataDebugMessage.debugEntryMessage(null, null);
 
     Optional<String> questionnaireData = null;
-    String vspId = (String) healingParams.get(SdcCommon.VSP_ID);
-    Version version = (Version) healingParams.get(SdcCommon.VERSION);
-
     VspQuestionnaireEntity vspQuestionnaireEntity =
         vspInfoDao.getQuestionnaire(vspId, version);
 
diff --git a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/test/java/org/openecomp/sdc/healing/healers/ComponentQuestionnaireHealerTest.java b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/test/java/org/openecomp/sdc/healing/healers/ComponentQuestionnaireHealerTest.java
index 69f4287..688d1d4 100644
--- a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/test/java/org/openecomp/sdc/healing/healers/ComponentQuestionnaireHealerTest.java
+++ b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/test/java/org/openecomp/sdc/healing/healers/ComponentQuestionnaireHealerTest.java
@@ -8,7 +8,6 @@
 import org.mockito.InjectMocks;
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
-import org.openecomp.sdc.common.utils.SdcCommon;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDao;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.ComputeDao;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.ImageDao;
@@ -20,10 +19,7 @@
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
 
 import static org.mockito.Matchers.anyObject;
 import static org.mockito.Mockito.doNothing;
@@ -47,7 +43,6 @@
   private static final String DUMMY_COMPONENT_ID = "2495ef442f964cbfb00d82bd54292f89";
   private static final String DUMMY_COMPUTE_ID = "3495ef442f964cbfb00d82bd54292f89";
   private static final String DUMMY_IMAGE_ID = "4495ef442f964cbfb00d82bd54292f89";
-  private static Map<String, Object> healingParams = new HashMap<>();
   private static final String componentQuestionnaireData = "{\"compute\": {" +
       "\"guestOS\": {\"bitSize\": 64},\"vmSizing\": {\"IOOperationsPerSec\": \"0\"}," +
       "\"numOfVMs\": {\"CpuOverSubscriptionRatio\": \"1:1\",\"MemoryRAM\": \"2 GB\"}}," +
@@ -131,16 +126,13 @@
   @Before
   public void init() throws Exception {
     MockitoAnnotations.initMocks(ComponentQuestionnaireHealerTest.this);
-
-    healingParams.put(SdcCommon.VSP_ID, DUMMY_VSP_ID);
-    healingParams.put(SdcCommon.VERSION, VERSION);
   }
 
   @Test
   public void healQuestionnaireNullTest() throws Exception {
     prepareHealingData();
     componentEntity.setQuestionnaireData(null);
-    Object returnObject = componentQuestionnaireHealer.heal(healingParams);
+    Object returnObject = componentQuestionnaireHealer.heal(DUMMY_VSP_ID, VERSION);
     Assert.assertTrue(returnObject instanceof Collection);
     Collection<ComponentEntity> componentEntities = (Collection<ComponentEntity>) returnObject;
     componentEntities.forEach(componentEntity -> {
@@ -152,7 +144,7 @@
   public void healAllCasesTest() throws Exception {
     prepareHealingData();
 
-    Object returnObject = componentQuestionnaireHealer.heal(healingParams);
+    Object returnObject = componentQuestionnaireHealer.heal(DUMMY_VSP_ID, VERSION);
     Assert.assertTrue(returnObject instanceof Collection);
     Collection<ComponentEntity> componentEntities = (Collection<ComponentEntity>) returnObject;
     componentEntities.forEach(componentEntity -> {
@@ -177,7 +169,7 @@
   public void healDiskAttrMissingTest() throws Exception {
     prepareHealingData();
     componentEntity.setQuestionnaireData(componentQuestionnaireMissingDiskAttrData);
-    Object returnObject = componentQuestionnaireHealer.heal(healingParams);
+    Object returnObject = componentQuestionnaireHealer.heal(DUMMY_VSP_ID, VERSION);
     Assert.assertTrue(returnObject instanceof Collection);
     Collection<ComponentEntity> componentEntities = (Collection<ComponentEntity>) returnObject;
     componentEntities.forEach(componentEntity -> {
@@ -238,7 +230,7 @@
         .getDeclaredMethod(methodName, JsonObject.class, JsonObject.class);
     method.setAccessible(true);
 
-    method.invoke(componentQuestionnaireHealer,jsonObject.getAsJsonObject(COMPUTE), null);
+    method.invoke(componentQuestionnaireHealer, jsonObject.getAsJsonObject(COMPUTE), null);
   }
 
   private void prepareHealingData() {
diff --git a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/test/java/org/openecomp/sdc/healing/healers/ForwarderCapabilityHealerTest.java b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/test/java/org/openecomp/sdc/healing/healers/ForwarderCapabilityHealerTest.java
index 406d039..a07ace6 100644
--- a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/test/java/org/openecomp/sdc/healing/healers/ForwarderCapabilityHealerTest.java
+++ b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/test/java/org/openecomp/sdc/healing/healers/ForwarderCapabilityHealerTest.java
@@ -13,7 +13,6 @@
 import org.openecomp.core.model.dao.ServiceModelDao;
 import org.openecomp.core.model.types.ServiceElement;
 import org.openecomp.sdc.common.togglz.ToggleableFeature;
-import org.openecomp.sdc.common.utils.SdcCommon;
 import org.openecomp.sdc.healing.healers.util.TestUtil;
 import org.openecomp.sdc.tosca.datatypes.ToscaNodeType;
 import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel;
@@ -32,13 +31,14 @@
 import static org.mockito.Matchers.eq;
 
 public class ForwarderCapabilityHealerTest {
+  private static final String vspId = "1";
+  private static final Version version = new Version(1, 1);
   private static final String IN_SUFFIX = "/in";
   private static final String OUT_SUFFIX = "/out";
   private static final String BASE_DIRECTORY = "/mock/healers/forwarder";
   private static final String ENTRY_DEFINITION_SERVICE_TEMPLATE = "MainServiceTemplate.yaml";
   private static TestFeatureManager manager;
 
-  private Map<String,Object> params = new HashMap<>();
 
   @Mock
   private ServiceModelDao<ToscaServiceModel, ServiceElement> serviceModelDao;
@@ -65,8 +65,6 @@
   @Before
   public void setUp() throws Exception {
     MockitoAnnotations.initMocks(ForwarderCapabilityHealerTest.this);
-    params.put(SdcCommon.VSP_ID,"1");
-    params.put(SdcCommon.VERSION, new Version(1,1));
   }
 
 
@@ -127,7 +125,7 @@
 
   private void validateServiceModelAfterHealing(String testDirectory) throws Exception {
     Optional<ToscaServiceModel> serviceModelObject =
-        (Optional<ToscaServiceModel>) forwarderCapabilityHealer.heal(params);
+        (Optional<ToscaServiceModel>) forwarderCapabilityHealer.heal(vspId, version);
 
     Assert.assertTrue(serviceModelObject.isPresent());
     TestUtil
diff --git a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/test/java/org/openecomp/sdc/healing/healers/VspOnboardingMethodHealerTest.java b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/test/java/org/openecomp/sdc/healing/healers/VspOnboardingMethodHealerTest.java
index b732cb0..5584a5f 100644
--- a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/test/java/org/openecomp/sdc/healing/healers/VspOnboardingMethodHealerTest.java
+++ b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/test/java/org/openecomp/sdc/healing/healers/VspOnboardingMethodHealerTest.java
@@ -2,69 +2,77 @@
 
 import org.junit.Before;
 import org.junit.Test;
+import org.mockito.InjectMocks;
 import org.mockito.Mock;
 import org.mockito.Mockito;
 import org.mockito.MockitoAnnotations;
-import org.openecomp.sdc.common.utils.SdcCommon;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.OrchestrationTemplateCandidateDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.OrchestrationTemplateDao;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.OrchestrationTemplateCandidateData;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.OrchestrationTemplateEntity;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
 import org.openecomp.sdc.versioning.dao.types.Version;
 
-import java.util.HashMap;
-import java.util.Map;
-
 import static org.junit.Assert.assertEquals;
 import static org.mockito.Matchers.any;
 
-public class VspOnboardingMethodHealerTest{
+public class VspOnboardingMethodHealerTest {
+  private static final String vspId = "1";
+  private static final Version version = new Version(1, 1);
 
-    @Mock
-    private VendorSoftwareProductInfoDao vendorSoftwareProductInfoDao;
+  @Mock
+  private VendorSoftwareProductInfoDao vendorSoftwareProductInfoDao;
+  @Mock
+  private OrchestrationTemplateDao orchestrationTemplateDao;
+  @Mock
+  private OrchestrationTemplateCandidateDao candidateDao;
+  @InjectMocks
+  private VspOnboardingMethodHealer vspOnboardingMethodHealer;
 
-    @Before
-    public void setUp() throws Exception {
-        MockitoAnnotations.initMocks(VspOnboardingMethodHealerTest.this);
-    }
+  private OrchestrationTemplateEntity orchestrationTemplateEntity = new OrchestrationTemplateEntity();
+  private OrchestrationTemplateCandidateData candidateData = new OrchestrationTemplateCandidateData();
+  private static final String NETWORK_PACKAGE = "NetworkPackage";
+  private static final String HEAT = "HEAT";
+  private static final String MANUAL = "Manual";
 
-    @Test
-    public void checkHealingWithNullOnboarding() throws Exception{
-        VspOnboardingMethodHealer vspOnboardingMethodHealer = new VspOnboardingMethodHealer(vendorSoftwareProductInfoDao);
-        Map<String,Object> params = new HashMap<>();
-        params.put(SdcCommon.VSP_ID,"1");
-        params.put(SdcCommon.VERSION, new Version(1,1));
-        VspDetails vspDetails = new VspDetails();
-        vspDetails.setOnboardingMethod(null);
-        Mockito.when(vendorSoftwareProductInfoDao.get(any())).thenReturn(vspDetails);
-        vspOnboardingMethodHealer.heal(params);
-        assertEquals(vspDetails.getOnboardingMethod(),"NetworkPackage");
-        assertEquals(vspDetails.getOnboardingOrigin(),"zip");
-    }
+  @Before
+  public void setUp() throws Exception {
+    MockitoAnnotations.initMocks(VspOnboardingMethodHealerTest.this);
+  }
 
-    @Test
-    public void checkHealingWithHEATOnboarding() throws Exception{
-        VspOnboardingMethodHealer vspOnboardingMethodHealer = new VspOnboardingMethodHealer(vendorSoftwareProductInfoDao);
-        Map<String,Object> params = new HashMap<>();
-        params.put(SdcCommon.VSP_ID,"1");
-        params.put(SdcCommon.VERSION, new Version(1,1));
-        VspDetails vspDetails = new VspDetails();
-        vspDetails.setOnboardingMethod("HEAT");
-        Mockito.when(vendorSoftwareProductInfoDao.get(any())).thenReturn(vspDetails);
-        vspOnboardingMethodHealer.heal(params);
-        assertEquals(vspDetails.getOnboardingMethod(),"NetworkPackage");
-        assertEquals(vspDetails.getOnboardingOrigin(),"zip");
-    }
+  @Test
+  public void checkHealingWithNullOnboarding() throws Exception {
+    VspDetails vspDetails = initAndExecuteHealer(null);
+    assertEquals(vspDetails.getOnboardingMethod(), NETWORK_PACKAGE);
+  }
 
-    @Test
-    public void checkHealingWithManualOnboarding() throws Exception{
-        VspOnboardingMethodHealer vspOnboardingMethodHealer = new VspOnboardingMethodHealer(vendorSoftwareProductInfoDao);
-        Map<String,Object> params = new HashMap<>();
-        params.put(SdcCommon.VSP_ID,"1");
-        params.put(SdcCommon.VERSION, new Version(1,1));
-        VspDetails vspDetails = new VspDetails();
-        vspDetails.setOnboardingMethod("Manual");
-        Mockito.when(vendorSoftwareProductInfoDao.get(any())).thenReturn(vspDetails);
-        vspOnboardingMethodHealer.heal(params);
-        assertEquals(vspDetails.getOnboardingMethod(),"Manual");
-        assertEquals(vspDetails.getOnboardingOrigin(),null);
-    }
+  @Test
+  public void checkHealingWithHEATOnboarding() throws Exception {
+    VspDetails vspDetails = initAndExecuteHealer(HEAT);
+    assertEquals(vspDetails.getOnboardingMethod(), NETWORK_PACKAGE);
+  }
+
+  @Test
+  public void checkHealingWithManualOnboarding() throws Exception {
+    VspDetails vspDetails = initAndExecuteHealer(MANUAL);
+    assertEquals(vspDetails.getOnboardingMethod(), MANUAL);
+  }
+
+  private VspDetails initAndExecuteHealer(String onboardingMethod) throws Exception {
+    VspDetails vspDetails = new VspDetails();
+    vspDetails.setOnboardingMethod(onboardingMethod);
+
+    setMockActions(vspDetails);
+    vspOnboardingMethodHealer.heal(vspId, version);
+    return vspDetails;
+  }
+
+  private void setMockActions(VspDetails vspDetails) {
+    Mockito.doReturn(vspDetails).when(vendorSoftwareProductInfoDao).get(any());
+    Mockito.doReturn(orchestrationTemplateEntity).when(orchestrationTemplateDao).get(any(), any());
+    Mockito.doNothing().when(orchestrationTemplateDao).update(any(), any(), any());
+    Mockito.doReturn(candidateData).when(candidateDao).get(any(), any());
+    Mockito.doNothing().when(candidateDao).update(any(), any(), any());
+  }
 }
\ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/test/java/org/openecomp/sdc/healing/healers/testHealers/data/TestDescriptionHealer.java b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/test/java/org/openecomp/sdc/healing/healers/testHealers/data/TestDescriptionHealer.java
new file mode 100644
index 0000000..aac1a50
--- /dev/null
+++ b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/test/java/org/openecomp/sdc/healing/healers/testHealers/data/TestDescriptionHealer.java
@@ -0,0 +1,16 @@
+package org.openecomp.sdc.healing.healers.testHealers.data;
+
+import org.openecomp.sdc.healing.interfaces.Healer;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+public class TestDescriptionHealer implements Healer {
+
+  @Override
+  public Object heal(String vspId, Version version) throws Exception {
+    VspDetails vspDetails = new VspDetails(vspId, version);
+    vspDetails.setDescription("This is a data healer");
+
+    return vspDetails;
+  }
+}
diff --git a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/test/java/org/openecomp/sdc/healing/healers/testHealers/structure/TestNewEntityInVspHealer.java b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/test/java/org/openecomp/sdc/healing/healers/testHealers/structure/TestNewEntityInVspHealer.java
new file mode 100644
index 0000000..7d71c03
--- /dev/null
+++ b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/test/java/org/openecomp/sdc/healing/healers/testHealers/structure/TestNewEntityInVspHealer.java
@@ -0,0 +1,16 @@
+package org.openecomp.sdc.healing.healers.testHealers.structure;
+
+import org.openecomp.sdc.healing.interfaces.Healer;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+public class TestNewEntityInVspHealer implements Healer {
+
+  @Override
+  public Object heal(String vspId, Version version) throws Exception {
+    VspDetails vspDetails = new VspDetails(vspId, version);
+    vspDetails.setDescription("This is a structure healer");
+
+    return vspDetails;
+  }
+}
diff --git a/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-api/pom.xml b/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-api/pom.xml
new file mode 100644
index 0000000..f69f304
--- /dev/null
+++ b/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-api/pom.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+        <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0">
+    <modelVersion>4.0.0</modelVersion>
+
+
+    <parent>
+        <groupId>org.openecomp.sdc</groupId>
+        <artifactId>openecomp-item-permissions-lib</artifactId>
+        <version>1.2.0-SNAPSHOT</version>
+        <relativePath>..</relativePath>
+    </parent>
+
+    <artifactId>openecomp-item-permissions-api</artifactId>
+
+    <dependencies>
+
+    <dependency>
+        <groupId>org.openecomp.sdc.core</groupId>
+        <artifactId>openecomp-nosqldb-core</artifactId>
+        <version>${project.version}</version>
+    </dependency>
+
+        <dependency>
+            <groupId>org.openecomp.sdc.core</groupId>
+            <artifactId>openecomp-facade-api</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
+
+    </dependencies>
+
+</project>
\ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-api/src/main/java/org/openecomp/sdc/itempermissions/PermissionsRules.java b/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-api/src/main/java/org/openecomp/sdc/itempermissions/PermissionsRules.java
new file mode 100644
index 0000000..b5a119e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-api/src/main/java/org/openecomp/sdc/itempermissions/PermissionsRules.java
@@ -0,0 +1,17 @@
+package org.openecomp.sdc.itempermissions;
+
+import java.util.Set;
+
+/**
+ * Created by ayalaben on 6/22/2017.
+ */
+public interface PermissionsRules {
+
+  boolean isAllowed(String userId,String action);
+
+  void executeAction(String itemId, String userId, String action);
+
+  void updatePermission(String itemId,String currentUserId, String permission,Set<String>
+      addedUsersIds, Set<String> removedUsersIds);
+
+}
diff --git a/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-api/src/main/java/org/openecomp/sdc/itempermissions/PermissionsRulesFactory.java b/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-api/src/main/java/org/openecomp/sdc/itempermissions/PermissionsRulesFactory.java
new file mode 100644
index 0000000..c3e0672
--- /dev/null
+++ b/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-api/src/main/java/org/openecomp/sdc/itempermissions/PermissionsRulesFactory.java
@@ -0,0 +1,16 @@
+package org.openecomp.sdc.itempermissions;
+
+import org.openecomp.core.factory.api.AbstractComponentFactory;
+import org.openecomp.core.factory.api.AbstractFactory;
+
+/**
+ * Created by ayalaben on 6/26/2017
+ */
+public abstract class PermissionsRulesFactory extends
+    AbstractComponentFactory<PermissionsRules> {
+
+  public static PermissionsRulesFactory getInstance() {
+    return AbstractFactory.getInstance(PermissionsRulesFactory.class);
+  }
+
+}
diff --git a/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-api/src/main/java/org/openecomp/sdc/itempermissions/PermissionsServices.java b/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-api/src/main/java/org/openecomp/sdc/itempermissions/PermissionsServices.java
new file mode 100644
index 0000000..09c8102
--- /dev/null
+++ b/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-api/src/main/java/org/openecomp/sdc/itempermissions/PermissionsServices.java
@@ -0,0 +1,26 @@
+package org.openecomp.sdc.itempermissions;
+
+import org.openecomp.sdc.itempermissions.type.ItemPermissionsEntity;
+
+import java.util.Collection;
+import java.util.Set;
+
+/**
+ * Created by ayalaben on 6/22/2017
+ */
+public interface PermissionsServices {
+
+  Collection<ItemPermissionsEntity> listItemPermissions(String itemId);
+
+  void updateItemPermissions(String itemId, String permission, Set<String> addedUsersIds,
+                             Set<String> removedUsersIds);
+
+  boolean isAllowed(String itemId,String userId,String action);
+
+  void execute(String itemId,String userId,String action);
+
+  String getUserItemPermiission(String itemId, String userId);
+
+
+
+}
diff --git a/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-api/src/main/java/org/openecomp/sdc/itempermissions/PermissionsServicesFactory.java b/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-api/src/main/java/org/openecomp/sdc/itempermissions/PermissionsServicesFactory.java
new file mode 100644
index 0000000..97769bc
--- /dev/null
+++ b/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-api/src/main/java/org/openecomp/sdc/itempermissions/PermissionsServicesFactory.java
@@ -0,0 +1,16 @@
+package org.openecomp.sdc.itempermissions;
+
+import org.openecomp.core.factory.api.AbstractComponentFactory;
+import org.openecomp.core.factory.api.AbstractFactory;
+
+/**
+ * Created by ayalaben on 6/22/2017.
+ */
+public abstract class PermissionsServicesFactory extends
+    AbstractComponentFactory<PermissionsServices> {
+
+  public static PermissionsServicesFactory getInstance() {
+    return AbstractFactory.getInstance(PermissionsServicesFactory.class);
+  }
+
+}
diff --git a/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-api/src/main/java/org/openecomp/sdc/itempermissions/dao/ItemPermissionsDao.java b/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-api/src/main/java/org/openecomp/sdc/itempermissions/dao/ItemPermissionsDao.java
new file mode 100644
index 0000000..a0f51f9
--- /dev/null
+++ b/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-api/src/main/java/org/openecomp/sdc/itempermissions/dao/ItemPermissionsDao.java
@@ -0,0 +1,21 @@
+package org.openecomp.sdc.itempermissions.dao;
+
+import org.openecomp.sdc.itempermissions.type.ItemPermissionsEntity;
+
+import java.util.Collection;
+import java.util.Set;
+
+/**
+ * Created by ayalaben on 6/18/2017.
+ */
+public interface ItemPermissionsDao {
+
+  Collection<ItemPermissionsEntity> listItemPermissions(String itemId);
+
+  void updateItemPermissions(String itemId, String permission, Set<String> addedUsersIds,
+                             Set<String> removedUsersIds);
+
+  void addUserPermission(String itemId, String userId, String permission);
+
+  String getUserItemPermiission(String itemId, String userId);
+}
diff --git a/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-api/src/main/java/org/openecomp/sdc/itempermissions/dao/ItemPermissionsDaoFactory.java b/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-api/src/main/java/org/openecomp/sdc/itempermissions/dao/ItemPermissionsDaoFactory.java
new file mode 100644
index 0000000..95d541e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-api/src/main/java/org/openecomp/sdc/itempermissions/dao/ItemPermissionsDaoFactory.java
@@ -0,0 +1,15 @@
+package org.openecomp.sdc.itempermissions.dao;
+
+import org.openecomp.core.factory.api.AbstractComponentFactory;
+import org.openecomp.core.factory.api.AbstractFactory;
+
+/**
+ * Created by ayalaben on 6/18/2017.
+ */
+public abstract class ItemPermissionsDaoFactory extends AbstractComponentFactory<ItemPermissionsDao> {
+
+  public static ItemPermissionsDaoFactory getInstance() {
+    return AbstractFactory.getInstance(ItemPermissionsDaoFactory.class);
+  }
+
+}
diff --git a/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-api/src/main/java/org/openecomp/sdc/itempermissions/errors/PermissionsErrorMessages.java b/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-api/src/main/java/org/openecomp/sdc/itempermissions/errors/PermissionsErrorMessages.java
new file mode 100644
index 0000000..a3fb9a1
--- /dev/null
+++ b/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-api/src/main/java/org/openecomp/sdc/itempermissions/errors/PermissionsErrorMessages.java
@@ -0,0 +1,23 @@
+package org.openecomp.sdc.itempermissions.errors;
+
+/**
+ * Created by ayalaben on 6/28/2017
+ */
+public enum PermissionsErrorMessages {
+
+  NO_PERMISSION_FOR_USER("The user is not permitted to edit this item"),
+  USER_NOT_OWNER_SUBMIT("The user must be the owner to submit the item"),
+  INVALID_PERMISSION_TYPE("Invalid permission type"),
+  INVALID_ACTION_TYPE("Invalid action type");
+
+  private String errorMessage;
+
+  PermissionsErrorMessages(String errorMessage) {
+    this.errorMessage = errorMessage;
+  }
+
+  public String getErrorMessage() {
+    return errorMessage;
+  }
+
+}
diff --git a/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-api/src/main/java/org/openecomp/sdc/itempermissions/errors/PermissionsErrorMessagesBuilder.java b/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-api/src/main/java/org/openecomp/sdc/itempermissions/errors/PermissionsErrorMessagesBuilder.java
new file mode 100644
index 0000000..f0c13d9
--- /dev/null
+++ b/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-api/src/main/java/org/openecomp/sdc/itempermissions/errors/PermissionsErrorMessagesBuilder.java
@@ -0,0 +1,29 @@
+package org.openecomp.sdc.itempermissions.errors;
+
+import org.openecomp.sdc.common.errors.ErrorCategory;
+import org.openecomp.sdc.common.errors.ErrorCode;
+
+/**
+ * Created by ayalaben on 6/28/2017
+ */
+public class PermissionsErrorMessagesBuilder {
+  public static final String PERMISSIONS_ERROR= "PERMISSIONS_ERROR";
+  private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder();
+
+  /**
+   * Instantiates a new Submit uncompleted license model error builder.
+   *
+   * @param error
+   */
+  public PermissionsErrorMessagesBuilder(PermissionsErrorMessages error) {
+    builder.withId(PERMISSIONS_ERROR);
+    builder.withCategory(ErrorCategory.APPLICATION);
+    builder.withMessage(error.getErrorMessage());
+  }
+
+  public ErrorCode build() {
+    return builder.build();
+  }
+
+
+}
diff --git a/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-api/src/main/java/org/openecomp/sdc/itempermissions/notifications/NotificationConstants.java b/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-api/src/main/java/org/openecomp/sdc/itempermissions/notifications/NotificationConstants.java
new file mode 100644
index 0000000..d4235cd
--- /dev/null
+++ b/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-api/src/main/java/org/openecomp/sdc/itempermissions/notifications/NotificationConstants.java
@@ -0,0 +1,14 @@
+package org.openecomp.sdc.itempermissions.notifications;
+
+/**
+ * @author avrahamg
+ * @since July 10, 2017
+ */
+public class NotificationConstants {
+    public static final String PERMISSION_CHANGED= "PermissionChanged";
+    public static final String PERMISSION_ITEM = "permission";
+    public static final String ITEM_ID_PROP = "itemId";
+    public static final String ITEM_NAME_PROP = "itemName";
+    public static final String PERMISSION_GRANTED = "granted";
+    public static final String PERMISSION_USER = "userId";
+}
diff --git a/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-api/src/main/java/org/openecomp/sdc/itempermissions/type/ItemPermissionsEntity.java b/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-api/src/main/java/org/openecomp/sdc/itempermissions/type/ItemPermissionsEntity.java
new file mode 100644
index 0000000..22ff437
--- /dev/null
+++ b/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-api/src/main/java/org/openecomp/sdc/itempermissions/type/ItemPermissionsEntity.java
@@ -0,0 +1,50 @@
+package org.openecomp.sdc.itempermissions.type;
+
+import com.datastax.driver.mapping.annotations.ClusteringColumn;
+import com.datastax.driver.mapping.annotations.Column;
+import com.datastax.driver.mapping.annotations.PartitionKey;
+import com.datastax.driver.mapping.annotations.Table;
+
+/**
+ * Created by ayalaben on 6/18/2017.
+ */
+
+@Table(keyspace = "dox", name = "item_permissions")
+public class ItemPermissionsEntity {
+
+  @PartitionKey
+  @Column(name = "item_id")
+  private String itemId;
+
+  @ClusteringColumn
+  @Column(name = "user_id")
+  private String userId;
+
+  @Column(name = "permission")
+  private String permission;
+
+
+  public String getItemId() {
+    return itemId;
+  }
+
+  public void setItemId(String itemId) {
+    this.itemId = itemId;
+  }
+
+  public String getUserId() {
+    return userId;
+  }
+
+  public void setUserId(String userId) {
+    this.userId = userId;
+  }
+
+  public String getPermission() {
+    return permission;
+  }
+
+  public void setPermission(String permission) {
+    this.permission = permission;
+  }
+}
diff --git a/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-core/pom.xml b/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-core/pom.xml
new file mode 100644
index 0000000..a420b23
--- /dev/null
+++ b/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-core/pom.xml
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+
+    <parent>
+        <groupId>org.openecomp.sdc</groupId>
+        <artifactId>openecomp-item-permissions-lib</artifactId>
+        <version>1.2.0-SNAPSHOT</version>
+        <relativePath>..</relativePath>
+    </parent>
+
+    <artifactId>openecomp-item-permissions-core</artifactId>
+
+    <dependencies>
+
+        <dependency>
+            <groupId>org.openecomp.sdc.core</groupId>
+            <artifactId>openecomp-session-lib</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
+
+        <dependency>
+            <groupId>org.openecomp.sdc</groupId>
+            <artifactId>openecomp-item-permissions-api</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
+
+        <dependency>
+        <groupId>org.openecomp.sdc.core</groupId>
+        <artifactId>openecomp-facade-core</artifactId>
+            <version>${project.version}</version>
+    </dependency>
+
+
+    <dependency>
+        <groupId>org.openecomp.sdc.core</groupId>
+        <artifactId>openecomp-nosqldb-core</artifactId>
+        <version>${project.version}</version>
+    </dependency>
+        <dependency>
+            <groupId>org.openecomp.sdc</groupId>
+            <artifactId>openecomp-sdc-notification-api</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.mockito</groupId>
+            <artifactId>mockito-all</artifactId>
+            <version>RELEASE</version>
+        </dependency>
+        <dependency>
+            <groupId>org.testng</groupId>
+            <artifactId>testng</artifactId>
+            <version>RELEASE</version>
+        </dependency>
+
+    </dependencies>
+
+</project>
\ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-core/src/main/java/org/openecomp/sdc/itempermissions/dao/impl/ItemPermissionsDaoFactoryImpl.java b/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-core/src/main/java/org/openecomp/sdc/itempermissions/dao/impl/ItemPermissionsDaoFactoryImpl.java
new file mode 100644
index 0000000..87c0338
--- /dev/null
+++ b/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-core/src/main/java/org/openecomp/sdc/itempermissions/dao/impl/ItemPermissionsDaoFactoryImpl.java
@@ -0,0 +1,19 @@
+package org.openecomp.sdc.itempermissions.dao.impl;
+
+
+import org.openecomp.sdc.itempermissions.dao.ItemPermissionsDao;
+import org.openecomp.sdc.itempermissions.dao.ItemPermissionsDaoFactory;
+
+
+/**
+ * Created by ayalaben on 6/18/2017.
+ */
+public class ItemPermissionsDaoFactoryImpl extends ItemPermissionsDaoFactory {
+
+  private static ItemPermissionsDao INSTANCE =new ItemPermissionsDaoImpl();
+
+  @Override
+  public ItemPermissionsDao createInterface() {
+    return INSTANCE;
+  }
+}
diff --git a/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-core/src/main/java/org/openecomp/sdc/itempermissions/dao/impl/ItemPermissionsDaoImpl.java b/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-core/src/main/java/org/openecomp/sdc/itempermissions/dao/impl/ItemPermissionsDaoImpl.java
new file mode 100644
index 0000000..e1a9d1c
--- /dev/null
+++ b/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-core/src/main/java/org/openecomp/sdc/itempermissions/dao/impl/ItemPermissionsDaoImpl.java
@@ -0,0 +1,66 @@
+package org.openecomp.sdc.itempermissions.dao.impl;
+
+import com.datastax.driver.core.ResultSet;
+import com.datastax.driver.mapping.Result;
+import com.datastax.driver.mapping.annotations.Accessor;
+import com.datastax.driver.mapping.annotations.Query;
+import org.openecomp.core.nosqldb.api.NoSqlDb;
+import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
+import org.openecomp.sdc.itempermissions.dao.ItemPermissionsDao;
+import org.openecomp.sdc.itempermissions.type.ItemPermissionsEntity;
+
+import java.util.Collection;
+import java.util.Set;
+
+/**
+ * Created by ayalaben on 6/20/2017.
+ */
+public class ItemPermissionsDaoImpl implements ItemPermissionsDao {
+  private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface();
+  private static ItemPermissionsAccessor accessor =
+      noSqlDb.getMappingManager().createAccessor(ItemPermissionsAccessor.class);
+
+  @Override
+  public Collection<ItemPermissionsEntity> listItemPermissions(String itemId) {
+    return accessor.getItemPermissions(itemId).all();
+  }
+
+  @Override
+  public void updateItemPermissions(String itemId, String permission, Set<String> addedUsersIds,
+                                    Set<String> removedUsersIds) {
+    addedUsersIds.forEach(userId -> accessor.addPermission(itemId,userId,permission));
+    removedUsersIds.forEach(userId -> accessor.deletePermission(itemId,userId));
+  }
+
+  @Override
+  public void addUserPermission(String itemId, String userId, String permission){
+    accessor.addPermission(itemId,userId,permission);
+  }
+
+  @Override
+  public String getUserItemPermiission(String itemId, String userId) {
+
+    ResultSet result =  accessor.getUserItemPermission(itemId,userId);
+    if (result.getAvailableWithoutFetching() < 1) {
+      return null;
+    }
+    return result.one().getString(0);
+  }
+
+
+  @Accessor
+  interface ItemPermissionsAccessor {
+    @Query("select * from dox.item_permissions WHERE item_id = ?")
+    Result<ItemPermissionsEntity> getItemPermissions(String itemId);
+
+    @Query("select permission from dox.item_permissions WHERE item_id = ? AND user_id=?")
+    ResultSet getUserItemPermission(String itemId,String userId);
+
+    @Query("delete from dox.item_permissions where item_id = ? and user_id = ?")
+    void deletePermission(String itemId, String userId);
+
+    @Query("insert into dox.item_permissions (item_id,user_id,permission) values (?,?,?)")
+    void addPermission(String itemId,String userId, String permission);
+
+  }
+}
diff --git a/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-core/src/main/java/org/openecomp/sdc/itempermissions/dao/impl/PermissionsServicesImpl.java b/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-core/src/main/java/org/openecomp/sdc/itempermissions/dao/impl/PermissionsServicesImpl.java
new file mode 100644
index 0000000..ae40ea8
--- /dev/null
+++ b/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-core/src/main/java/org/openecomp/sdc/itempermissions/dao/impl/PermissionsServicesImpl.java
@@ -0,0 +1,70 @@
+package org.openecomp.sdc.itempermissions.dao.impl;
+
+import org.openecomp.sdc.common.session.SessionContextProviderFactory;
+import org.openecomp.sdc.itempermissions.PermissionsRules;
+import org.openecomp.sdc.itempermissions.PermissionsServices;
+import org.openecomp.sdc.itempermissions.dao.ItemPermissionsDao;
+import org.openecomp.sdc.itempermissions.type.ItemPermissionsEntity;
+
+import java.util.Collection;
+import java.util.Set;
+
+
+/**
+ * Created by ayalaben on 6/22/2017.
+ */
+public class PermissionsServicesImpl implements PermissionsServices {
+
+  private ItemPermissionsDao permissionsDao;
+
+  private PermissionsRules permissionsRules;
+
+  private static final String CHANGE_PERMISSIONS = "Change_Item_Permissions";
+
+  public PermissionsServicesImpl(PermissionsRules permissionsRules,
+                                 ItemPermissionsDao permissionsDao) {
+    this.permissionsDao = permissionsDao;
+    this.permissionsRules = permissionsRules;
+  }
+
+
+  @Override
+  public Collection<ItemPermissionsEntity> listItemPermissions(String itemId) {
+    return permissionsDao.listItemPermissions(itemId);
+  }
+
+  @Override
+  public void updateItemPermissions(String itemId, String permission, Set<String> addedUsersIds,
+                                    Set<String> removedUsersIds) {
+
+    String currentUserId = SessionContextProviderFactory.getInstance()
+          .createInterface().get().getUser().getUserId();
+
+    permissionsRules.executeAction(itemId,currentUserId,CHANGE_PERMISSIONS);
+
+    permissionsRules.updatePermission(itemId,currentUserId,permission,addedUsersIds,
+          removedUsersIds);
+
+    permissionsDao.updateItemPermissions(itemId, permission,
+          addedUsersIds, removedUsersIds);
+
+  }
+
+  @Override
+  public boolean isAllowed(String itemId,String userId,String action) {
+
+    String userPermission = permissionsDao.getUserItemPermiission(itemId,userId);
+    return permissionsRules.isAllowed(userPermission,action);
+  }
+
+  @Override
+  public void execute(String itemId,String userId,String action) {
+    permissionsRules.executeAction(itemId, userId, action);
+  }
+
+  @Override
+  public String getUserItemPermiission(String itemId, String userId) {
+    return permissionsDao.getUserItemPermiission(itemId,userId);
+  }
+
+}
diff --git a/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-core/src/main/java/org/openecomp/sdc/itempermissions/dao/impl/PrmissionsServicesFactoryImpl.java b/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-core/src/main/java/org/openecomp/sdc/itempermissions/dao/impl/PrmissionsServicesFactoryImpl.java
new file mode 100644
index 0000000..34532cb
--- /dev/null
+++ b/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-core/src/main/java/org/openecomp/sdc/itempermissions/dao/impl/PrmissionsServicesFactoryImpl.java
@@ -0,0 +1,21 @@
+package org.openecomp.sdc.itempermissions.dao.impl;
+
+import org.openecomp.sdc.itempermissions.PermissionsRulesFactory;
+import org.openecomp.sdc.itempermissions.PermissionsServices;
+import org.openecomp.sdc.itempermissions.PermissionsServicesFactory;
+import org.openecomp.sdc.itempermissions.dao.ItemPermissionsDaoFactory;
+
+/**
+ * Created by ayalaben on 6/22/2017
+ */
+public class PrmissionsServicesFactoryImpl  extends PermissionsServicesFactory {
+
+  private static final PermissionsServices INSTANCE =
+      new org.openecomp.sdc.itempermissions.dao.impl.PermissionsServicesImpl(PermissionsRulesFactory.getInstance().createInterface(),
+          ItemPermissionsDaoFactory.getInstance().createInterface());
+
+  @Override
+  public PermissionsServices createInterface() {
+    return INSTANCE;
+  }
+}
diff --git a/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-core/src/main/java/org/openecomp/sdc/itempermissions/servlet/PermissionsFilter.java b/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-core/src/main/java/org/openecomp/sdc/itempermissions/servlet/PermissionsFilter.java
new file mode 100644
index 0000000..21acc07
--- /dev/null
+++ b/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-core/src/main/java/org/openecomp/sdc/itempermissions/servlet/PermissionsFilter.java
@@ -0,0 +1,72 @@
+package org.openecomp.sdc.itempermissions.servlet;
+
+import org.openecomp.sdc.itempermissions.PermissionsServices;
+import org.openecomp.sdc.itempermissions.PermissionsServicesFactory;
+
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
+/**
+ * Created by ayalaben on 6/27/2017.
+ */
+public class PermissionsFilter implements Filter {
+
+  private final PermissionsServices permissionsServices;
+  public static final String IRRELEVANT_REQUEST = "Irrelevant_Request";
+  public static final String EDIT_ITEM = "Edit_Item";
+
+  public PermissionsFilter() {
+    this.permissionsServices = PermissionsServicesFactory.getInstance().createInterface();
+  }
+
+  @Override
+  public void init(FilterConfig filterConfig) throws ServletException {
+
+  }
+
+  @Override
+  public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse,
+                       FilterChain filterChain) throws IOException, ServletException {
+
+    if (servletRequest instanceof HttpServletRequest) {
+      if (((HttpServletRequest) servletRequest).getMethod().equals("POST")
+            ||  ((HttpServletRequest) servletRequest).getMethod().equals("PUT")) {
+
+        String userId = ((HttpServletRequest) servletRequest).getHeader("USER_ID");
+        String itemId = parseItemIdFromPath(((HttpServletRequest) servletRequest).getPathInfo());
+        if ( ! itemId.equals(IRRELEVANT_REQUEST)) {
+          if ( !  permissionsServices.isAllowed(itemId,userId,EDIT_ITEM)) {
+            ((HttpServletResponse) servletResponse).setStatus(HttpServletResponse.SC_FORBIDDEN);
+            servletResponse.getWriter().print("Permissions Error. The user does not have " +
+                "permission to perform" +
+                " this action.");
+           return;
+          }
+        }
+      }
+    }
+
+    filterChain.doFilter(servletRequest, servletResponse);
+  }
+
+  private String parseItemIdFromPath(String pathInfo) {
+    String[] tokens = pathInfo.split("/");
+    if (tokens.length < 4) {
+      return IRRELEVANT_REQUEST;
+    } else {
+      return tokens[3];
+    }
+  }
+
+  @Override
+  public void destroy() {
+
+  }
+}
diff --git a/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-core/src/main/resources/factoryConfiguration.json b/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-core/src/main/resources/factoryConfiguration.json
new file mode 100644
index 0000000..d239484
--- /dev/null
+++ b/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-core/src/main/resources/factoryConfiguration.json
@@ -0,0 +1,4 @@
+{
+  "org.openecomp.sdc.itempermissions.dao.ItemPermissionsDaoFactory": "org.openecomp.sdc.itempermissions.dao.impl.ItemPermissionsDaoFactoryImpl",
+"org.openecomp.sdc.itempermissions.PermissionsServicesFactory" : "org.openecomp.sdc.itempermissions.dao.impl.PrmissionsServicesFactoryImpl"
+}
\ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-core/src/main/test/java/org/openecomp/sdc/itempermissions/dao/impl/PermissionsServicesImplTest.java b/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-core/src/main/test/java/org/openecomp/sdc/itempermissions/dao/impl/PermissionsServicesImplTest.java
new file mode 100644
index 0000000..0a87c29
--- /dev/null
+++ b/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-core/src/main/test/java/org/openecomp/sdc/itempermissions/dao/impl/PermissionsServicesImplTest.java
@@ -0,0 +1,111 @@
+package org.openecomp.sdc.itempermissions.dao.impl;
+
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.mockito.Spy;
+import org.openecomp.sdc.common.session.SessionContextProviderFactory;
+import org.openecomp.sdc.itempermissions.PermissionsRules;
+import org.openecomp.sdc.itempermissions.dao.ItemPermissionsDao;
+import org.openecomp.sdc.itempermissions.type.ItemPermissionsEntity;
+import org.testng.Assert;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+
+import static org.mockito.Matchers.anyObject;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+/**
+ * Created by ayalaben on 7/9/2017
+ */
+public class PermissionsServicesImplTest {
+
+  private static final String ITEM1_ID = "1";
+  private static final String PERMISSION = "Owner";
+  private static final String USER2_ID = "testUser2";
+  private static final String USER1_ID = "testUser1";
+  private static final String ACTION_SUBMIT = "Submit_Item";
+  private static final String CHANGE_PERMISSIONS = "Change_Item_Permissions";
+
+  static {
+    SessionContextProviderFactory.getInstance().createInterface().create("testUser1");
+  }
+
+  @Mock
+  private ItemPermissionsDao permissionsDaoMock;
+  @Mock
+  private PermissionsRules permissionsRules;
+  @InjectMocks
+  @Spy
+  private PermissionsServicesImpl permissionsServices;
+
+
+  @BeforeMethod
+  public void setUp() throws Exception {
+    MockitoAnnotations.initMocks(this);
+  }
+
+  @Test
+  public void testListItemPermissionsWhenNone()  {
+    Collection<ItemPermissionsEntity> permissions =
+        permissionsServices.listItemPermissions(ITEM1_ID);
+    Assert.assertEquals(permissions.size(), 0);
+  }
+
+
+  @Test
+  public void testListItemPermissions(){
+    doReturn(Arrays.asList(
+        createPermissionEntity(ITEM1_ID, USER1_ID, PERMISSION),
+        createPermissionEntity(ITEM1_ID, USER2_ID, PERMISSION)))
+        .when(permissionsDaoMock).listItemPermissions(anyObject());
+
+    Collection<ItemPermissionsEntity> actual =
+        permissionsServices.listItemPermissions(ITEM1_ID);
+    Assert.assertEquals(actual.size(), 2);
+  }
+
+
+  @Test
+  public void testIsAllowed(){
+    when(permissionsDaoMock.getUserItemPermiission(ITEM1_ID,USER1_ID)).thenReturn(PERMISSION);
+    when(permissionsRules.isAllowed(PERMISSION,ACTION_SUBMIT)).thenReturn(true);
+
+    Boolean result = permissionsServices.isAllowed(ITEM1_ID,USER1_ID,ACTION_SUBMIT);
+
+    Assert.assertTrue(result);
+
+  }
+  @Test
+  public void testUpdatePermissions(){
+
+    Set<String> addedUsers = new HashSet<String>();
+    addedUsers.add(USER2_ID);
+
+    permissionsServices.updateItemPermissions(ITEM1_ID,PERMISSION,addedUsers,
+        new HashSet<String>());
+
+    verify(permissionsRules).executeAction(ITEM1_ID,USER1_ID,CHANGE_PERMISSIONS);
+    verify(permissionsRules).updatePermission(ITEM1_ID,USER1_ID,PERMISSION,addedUsers,new HashSet<String>());
+    verify(permissionsDaoMock).updateItemPermissions(ITEM1_ID,PERMISSION,addedUsers,new
+        HashSet<String>());
+  }
+
+
+  public static ItemPermissionsEntity createPermissionEntity(String itemId, String
+      userId, String permission) {
+    ItemPermissionsEntity permissionsEntity = new ItemPermissionsEntity();
+   permissionsEntity.setItemId(itemId);
+   permissionsEntity.setUserId(userId);
+   permissionsEntity.setPermission(permission);
+    return permissionsEntity;
+  }
+
+}
\ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-impl/pom.xml b/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-impl/pom.xml
new file mode 100644
index 0000000..0a3bf6e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-impl/pom.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.openecomp.sdc</groupId>
+        <artifactId>openecomp-item-permissions-lib</artifactId>
+        <version>1.2.0-SNAPSHOT</version>
+        <relativePath>..</relativePath>
+    </parent>
+    <artifactId>openecomp-item-permissions-impl</artifactId>
+    <dependencies>
+
+        <dependency>
+            <groupId>org.openecomp.sdc</groupId>
+            <artifactId>openecomp-item-permissions-api</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.openecomp.sdc</groupId>
+            <artifactId>openecomp-item-permissions-core</artifactId>
+            <version>${project.version}</version>
+            <scope>runtime</scope>
+        </dependency>
+    </dependencies>
+</project>
\ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-impl/src/main/java/org/openecomp/sdc/itempermissions/impl/PermissionsRulesFactoryImpl.java b/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-impl/src/main/java/org/openecomp/sdc/itempermissions/impl/PermissionsRulesFactoryImpl.java
new file mode 100644
index 0000000..c74907c
--- /dev/null
+++ b/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-impl/src/main/java/org/openecomp/sdc/itempermissions/impl/PermissionsRulesFactoryImpl.java
@@ -0,0 +1,16 @@
+package org.openecomp.sdc.itempermissions.impl;
+
+import org.openecomp.sdc.itempermissions.PermissionsRules;
+import org.openecomp.sdc.itempermissions.PermissionsRulesFactory;
+
+/**
+ * Created by ayalaben on 6/26/2017.
+ */
+public class PermissionsRulesFactoryImpl extends PermissionsRulesFactory {
+
+   @Override
+  public PermissionsRules createInterface() {
+    return new PermissionsRulesImpl();
+  }
+
+}
diff --git a/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-impl/src/main/java/org/openecomp/sdc/itempermissions/impl/PermissionsRulesImpl.java b/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-impl/src/main/java/org/openecomp/sdc/itempermissions/impl/PermissionsRulesImpl.java
new file mode 100644
index 0000000..22d81a7
--- /dev/null
+++ b/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-impl/src/main/java/org/openecomp/sdc/itempermissions/impl/PermissionsRulesImpl.java
@@ -0,0 +1,126 @@
+package org.openecomp.sdc.itempermissions.impl;
+
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.itempermissions.PermissionsRules;
+import org.openecomp.sdc.itempermissions.PermissionsServicesFactory;
+import org.openecomp.sdc.itempermissions.errors.PermissionsErrorMessagesBuilder;
+import org.openecomp.sdc.itempermissions.impl.types.PermissionActionTypes;
+import org.openecomp.sdc.itempermissions.impl.types.PermissionTypes;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import static org.openecomp.sdc.itempermissions.errors.PermissionsErrorMessages.INVALID_ACTION_TYPE;
+import static org.openecomp.sdc.itempermissions.errors.PermissionsErrorMessages.INVALID_PERMISSION_TYPE;
+
+/**
+ * Created by ayalaben on 6/26/2017.
+ */
+public class PermissionsRulesImpl implements PermissionsRules {
+
+
+  @Override
+  public boolean isAllowed(String permission, String action) {
+
+    if (permission == null) {
+      return false;
+    }
+    try {
+      PermissionTypes.valueOf(permission);
+    } catch (IllegalArgumentException ex) {
+      throw new CoreException(new PermissionsErrorMessagesBuilder(INVALID_PERMISSION_TYPE).build());
+    }
+
+    try {
+      switch (PermissionActionTypes.valueOf(action)) {
+        case Create_Item:
+          return true;
+
+        case Edit_Item:
+          if (permission.equals(PermissionTypes.Contributor.name()) || permission.equals
+              (PermissionTypes.Owner.name())) {
+            return true;
+          }
+          break;
+        case Commit_Item:
+          if (permission.equals(PermissionTypes.Contributor.name()) ||  permission.equals
+              (PermissionTypes.Owner.name())) {
+          return true;
+        }
+          break;
+
+        case Change_Item_Permissions:
+          if (permission.equals(PermissionTypes.Owner.name())) {
+            return true;
+          }
+          break;
+
+        case Submit_Item:
+          if (permission.equals(PermissionTypes.Owner.name())) {
+            return true;
+          }
+          break;
+
+        default:
+          return false;
+      }
+    } catch (IllegalArgumentException ex) {
+      throw new CoreException(new PermissionsErrorMessagesBuilder(INVALID_ACTION_TYPE).build());
+    }
+
+    return false;
+  }
+
+  @Override
+  public void executeAction(String itemId, String userId, String action) {
+    try {
+      switch (PermissionActionTypes.valueOf(action)) {
+        case Create_Item:
+          caseCreateItem(userId,itemId);
+          break;
+
+        case Change_Item_Permissions:
+          break;
+
+        case Edit_Item:
+          break;
+
+        case Submit_Item:
+          break;
+
+        default:
+      }
+    } catch (IllegalArgumentException ex) {
+      throw new CoreException(new PermissionsErrorMessagesBuilder(INVALID_ACTION_TYPE).build());
+    }
+  }
+
+  @Override
+  public void updatePermission(String itemId,String currentUserId, String permission, Set<String>
+      addedUsersIds,Set<String> removedUsersIds) {
+    try {
+      PermissionTypes.valueOf(permission);
+    } catch (IllegalArgumentException ex) {
+      throw new CoreException(new PermissionsErrorMessagesBuilder(INVALID_PERMISSION_TYPE).build());
+    }
+
+    if (permission.equals(PermissionTypes.Owner.name())) {
+
+      HashSet<String> currentOwner = new HashSet<String>();
+      currentOwner.add(currentUserId);
+
+      PermissionsServicesFactory.getInstance().createInterface()
+          .updateItemPermissions(itemId,PermissionTypes.Contributor.name(),
+          currentOwner,new HashSet<String>());
+    }
+  }
+
+  protected void caseCreateItem(String userId,String itemId) {
+    HashSet<String> ownerId = new HashSet<String>();
+    ownerId.add(userId);
+    PermissionsServicesFactory.getInstance().createInterface()
+        .updateItemPermissions(itemId, PermissionTypes.Owner.name(), ownerId,
+            new HashSet<String>());
+  }
+
+}
diff --git a/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-impl/src/main/java/org/openecomp/sdc/itempermissions/impl/types/PermissionActionTypes.java b/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-impl/src/main/java/org/openecomp/sdc/itempermissions/impl/types/PermissionActionTypes.java
new file mode 100644
index 0000000..3d1b8a8
--- /dev/null
+++ b/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-impl/src/main/java/org/openecomp/sdc/itempermissions/impl/types/PermissionActionTypes.java
@@ -0,0 +1,14 @@
+package org.openecomp.sdc.itempermissions.impl.types;
+
+/**
+ * Created by ayalaben on 6/26/2017
+ */
+public enum PermissionActionTypes {
+
+  Create_Item,
+  Change_Item_Permissions,
+  Edit_Item,
+  Commit_Item,
+  Submit_Item;
+
+}
diff --git a/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-impl/src/main/java/org/openecomp/sdc/itempermissions/impl/types/PermissionTypes.java b/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-impl/src/main/java/org/openecomp/sdc/itempermissions/impl/types/PermissionTypes.java
new file mode 100644
index 0000000..e3c93c5
--- /dev/null
+++ b/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-impl/src/main/java/org/openecomp/sdc/itempermissions/impl/types/PermissionTypes.java
@@ -0,0 +1,9 @@
+package org.openecomp.sdc.itempermissions.impl.types;
+
+/**
+ * Created by ayalaben on 6/26/2017.
+ */
+public enum PermissionTypes {
+  Owner,
+  Contributor
+}
diff --git a/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-impl/src/main/resources/factoryConfiguration.json b/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-impl/src/main/resources/factoryConfiguration.json
new file mode 100644
index 0000000..a3d3dae
--- /dev/null
+++ b/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-impl/src/main/resources/factoryConfiguration.json
@@ -0,0 +1,3 @@
+{
+   "org.openecomp.sdc.itempermissions.PermissionsRulesFactory": "org.openecomp.sdc.itempermissions.impl.PermissionsRulesFactoryImpl"
+}
\ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-impl/src/test/java/org/openecomp/sdc/itempermissions/impl/PermissionsRulesImplTest.java b/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-impl/src/test/java/org/openecomp/sdc/itempermissions/impl/PermissionsRulesImplTest.java
new file mode 100644
index 0000000..635a0b2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-impl/src/test/java/org/openecomp/sdc/itempermissions/impl/PermissionsRulesImplTest.java
@@ -0,0 +1,101 @@
+package org.openecomp.sdc.itempermissions.impl;
+
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.mockito.Spy;
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.itempermissions.dao.impl.PermissionsServicesImpl;
+import org.testng.Assert;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import java.util.HashSet;
+
+
+/**
+ * Created by ayalaben on 7/10/2017
+ */
+public class PermissionsRulesImplTest {
+
+  private static final String ITEM1_ID = "1";
+  private static final String USER1_ID = "testUser1";
+  private static final String PERMISSION_OWNER = "Owner";
+  private static final String PERMISSION_CONTRIBUTOR = "Contributor";
+  private static final String INVALID_PERMISSION = "Invalid_Permission";
+  private static final String SUBMIT_ACTION = "Submit_Item";
+  private static final String EDIT_ACTION = "Edit_Item";
+  private static final String CHANGE_PERMISSIONS_ACTION = "Change_Item_Permissions";
+  private static final String INVALID_ACTION = "Invalid_Action";
+
+  @Mock
+  private PermissionsServicesImpl permissionsServices;
+
+  @InjectMocks
+  @Spy
+  private PermissionsRulesImpl permissionsRules;
+
+
+  @BeforeMethod
+  public void setUp() throws Exception {
+
+    MockitoAnnotations.initMocks(this);
+  }
+
+  @Test(expectedExceptions = CoreException.class,expectedExceptionsMessageRegExp =
+      "Invalid permission type")
+  public void testIsAllowedWhenInvalidPermission() {
+      permissionsRules.isAllowed(INVALID_PERMISSION, EDIT_ACTION);
+    }
+
+  @Test(expectedExceptions = CoreException.class,expectedExceptionsMessageRegExp =
+      "Invalid action type")
+  public void testIsAllowedWhenInvalidAction() {
+    permissionsRules.isAllowed(PERMISSION_CONTRIBUTOR, INVALID_ACTION);
+  }
+
+  @Test
+  public void testIsAllowedCaseSubmitOwner(){
+    Assert.assertTrue(permissionsRules.isAllowed(PERMISSION_OWNER,SUBMIT_ACTION));
+  }
+
+  @Test
+  public void testIsAllowedCaseSubmitNotOwner(){
+    Assert.assertFalse(permissionsRules.isAllowed(PERMISSION_CONTRIBUTOR,SUBMIT_ACTION));
+  }
+
+  @Test
+  public void testIsAllowedCaseEditOwner(){
+    Assert.assertTrue(permissionsRules.isAllowed(PERMISSION_OWNER,EDIT_ACTION));
+  }
+
+  @Test
+  public void testIsAllowedCaseEditContributer(){
+    Assert.assertTrue(permissionsRules.isAllowed(PERMISSION_CONTRIBUTOR,EDIT_ACTION));
+  }
+
+  @Test
+  public void testIsAllowedCaseChangePermissionsContributer(){
+    Assert.assertFalse(permissionsRules.isAllowed(PERMISSION_CONTRIBUTOR,CHANGE_PERMISSIONS_ACTION));
+  }
+
+  @Test
+  public void testIsAllowedCaseChangePermissionsOwner(){
+    Assert.assertTrue(permissionsRules.isAllowed(PERMISSION_OWNER,CHANGE_PERMISSIONS_ACTION));
+  }
+
+  @Test(expectedExceptions = CoreException.class,expectedExceptionsMessageRegExp =
+      "Invalid permission type")
+  public void testUpdatePermissionWhenInvalidPermission()  {
+    permissionsRules.updatePermission(ITEM1_ID,USER1_ID,INVALID_PERMISSION,new HashSet<String>(),
+        new HashSet<String>());
+  }
+
+  @Test(expectedExceptions = CoreException.class,expectedExceptionsMessageRegExp =
+      "Invalid action type")
+  public void testExecuteActionInvalidAction(){
+    permissionsRules.executeAction(ITEM1_ID,USER1_ID,INVALID_ACTION);
+  }
+
+
+}
\ No newline at end of file
diff --git a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/resources/logback.xml b/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-impl/src/test/resources/logback.xml
similarity index 91%
copy from openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/resources/logback.xml
copy to openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-impl/src/test/resources/logback.xml
index 9c9c06c..c1932e3 100644
--- a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/resources/logback.xml
+++ b/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-impl/src/test/resources/logback.xml
@@ -9,7 +9,7 @@
     </appender>
 
     <root level="warn">
-        <appender-ref ref="STDOUT"/>
+        <appender-ref ref="STDOUT" />
     </root>
 
 </configuration>
\ No newline at end of file
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/activity-log-rest/pom.xml b/openecomp-be/lib/openecomp-item-permissions-lib/pom.xml
similarity index 60%
copy from openecomp-be/api/openecomp-sdc-rest-webapp/activity-log-rest/pom.xml
copy to openecomp-be/lib/openecomp-item-permissions-lib/pom.xml
index 0b3c83c..fbf8ca5 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/activity-log-rest/pom.xml
+++ b/openecomp-be/lib/openecomp-item-permissions-lib/pom.xml
@@ -4,19 +4,21 @@
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
-    <groupId>org.openecomp.sdc</groupId>
-    <artifactId>activity-log-rest</artifactId>
-    <packaging>pom</packaging>
-
     <parent>
+        <artifactId>openecomp-sdc-lib</artifactId>
         <groupId>org.openecomp.sdc</groupId>
-        <artifactId>openecomp-sdc-rest-webapp</artifactId>
         <version>1.2.0-SNAPSHOT</version>
+        <relativePath>..</relativePath>
     </parent>
 
+    <artifactId>openecomp-item-permissions-lib</artifactId>
+    <packaging>pom</packaging>
+
+
     <modules>
-        <module>activity-log-rest-services</module>
-        <module>activity-log-rest-types</module>
+        <module>openecomp-item-permissions-api</module>
+        <module>openecomp-item-permissions-impl</module>
+        <module>openecomp-item-permissions-core</module>
     </modules>
-    
-</project>
+
+</project>
\ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/errors/ActionExceptionMapper.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/errors/ActionExceptionMapper.java
index 98e1c69..9ca574a 100644
--- a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/errors/ActionExceptionMapper.java
+++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/errors/ActionExceptionMapper.java
@@ -20,6 +20,10 @@
 
 package org.openecomp.sdc.action.errors;
 
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.ext.ExceptionMapper;
+
 import static org.openecomp.sdc.action.ActionConstants.WWW_AUTHENTICATE_HEADER_PARAM;
 import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_ALREADY_EXISTS_CODE;
 import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_CHECKSUM_ERROR_CODE;
@@ -60,10 +64,6 @@
 import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_UPDATE_NOT_ALLOWED_FOR_NAME;
 import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_UPDATE_ON_UNLOCKED_ENTITY;
 
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.ext.ExceptionMapper;
-
 /**
  * Mapper class to map Action Library exceptions to corresponding HTTP Response objects.
  */
diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/util/ActionUtil.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/util/ActionUtil.java
index 0315a31..820fb86 100644
--- a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/util/ActionUtil.java
+++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/util/ActionUtil.java
@@ -20,6 +20,18 @@
 
 package org.openecomp.sdc.action.util;
 
+import org.openecomp.sdc.action.logging.CategoryLogLevel;
+import org.openecomp.sdc.action.logging.StatusCode;
+import org.openecomp.sdc.action.types.ActionLogResponseCode;
+import org.openecomp.sdc.action.types.ActionSubOperation;
+import org.slf4j.MDC;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.time.ZoneOffset;
+import java.util.Date;
+import java.util.TimeZone;
+
 import static org.openecomp.sdc.action.ActionConstants.BEGIN_TIMESTAMP;
 import static org.openecomp.sdc.action.ActionConstants.ELAPSED_TIME;
 import static org.openecomp.sdc.action.ActionConstants.END_TIMESTAMP;
@@ -104,18 +116,6 @@
 import static org.openecomp.sdc.action.types.ActionLogResponseCode.UPDATE_ON_LOCKED_ENTITY;
 import static org.openecomp.sdc.action.types.ActionLogResponseCode.UPDATE_ON_UNLOCKED_ENTITY;
 
-import org.openecomp.sdc.action.logging.CategoryLogLevel;
-import org.openecomp.sdc.action.logging.StatusCode;
-import org.openecomp.sdc.action.types.ActionLogResponseCode;
-import org.openecomp.sdc.action.types.ActionSubOperation;
-import org.slf4j.MDC;
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.time.ZoneOffset;
-import java.util.Date;
-import java.util.TimeZone;
-
 public class ActionUtil {
 
   private static final String UTC_DATE_FORMAT = "dd MMM yyyy kk:mm:ss z";
diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-core/src/main/java/org/openecomp/sdc/action/dao/impl/ActionArtifactDaoImpl.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-core/src/main/java/org/openecomp/sdc/action/dao/impl/ActionArtifactDaoImpl.java
index bfa5830..27f0438 100644
--- a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-core/src/main/java/org/openecomp/sdc/action/dao/impl/ActionArtifactDaoImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-core/src/main/java/org/openecomp/sdc/action/dao/impl/ActionArtifactDaoImpl.java
@@ -20,20 +20,12 @@
 
 package org.openecomp.sdc.action.dao.impl;
 
-import static org.openecomp.sdc.action.ActionConstants.TARGET_ENTITY_DB;
-import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ENTITY_INTERNAL_SERVER_ERROR_MSG;
-import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_INTERNAL_SERVER_ERR_CODE;
-import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_QUERY_FAILURE_CODE;
-import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_QUERY_FAILURE_MSG;
-
 import com.datastax.driver.core.exceptions.NoHostAvailableException;
 import com.datastax.driver.mapping.Mapper;
 import com.datastax.driver.mapping.Result;
 import com.datastax.driver.mapping.annotations.Accessor;
 import com.datastax.driver.mapping.annotations.Query;
 import org.openecomp.core.dao.impl.CassandraBaseDao;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.openecomp.core.nosqldb.api.NoSqlDb;
 import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
 import org.openecomp.sdc.action.dao.ActionArtifactDao;
@@ -44,10 +36,18 @@
 import org.openecomp.sdc.action.types.ActionArtifact;
 import org.openecomp.sdc.action.types.ActionSubOperation;
 import org.openecomp.sdc.action.util.ActionUtil;
+import org.openecomp.sdc.logging.api.Logger;
+import org.openecomp.sdc.logging.api.LoggerFactory;
 
 import java.util.Collection;
 import java.util.List;
 
+import static org.openecomp.sdc.action.ActionConstants.TARGET_ENTITY_DB;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ENTITY_INTERNAL_SERVER_ERROR_MSG;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_INTERNAL_SERVER_ERR_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_QUERY_FAILURE_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_QUERY_FAILURE_MSG;
+
 
 public class ActionArtifactDaoImpl extends CassandraBaseDao<ActionArtifactEntity>
     implements ActionArtifactDao {
diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-core/src/main/java/org/openecomp/sdc/action/dao/impl/ActionDaoImpl.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-core/src/main/java/org/openecomp/sdc/action/dao/impl/ActionDaoImpl.java
index b7f4b5c..a79687f 100644
--- a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-core/src/main/java/org/openecomp/sdc/action/dao/impl/ActionDaoImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-core/src/main/java/org/openecomp/sdc/action/dao/impl/ActionDaoImpl.java
@@ -20,30 +20,6 @@
 
 package org.openecomp.sdc.action.dao.impl;
 
-import static com.datastax.driver.core.querybuilder.QueryBuilder.eq;
-import static com.datastax.driver.core.querybuilder.QueryBuilder.in;
-import static com.datastax.driver.core.querybuilder.QueryBuilder.set;
-import static org.openecomp.core.nosqldb.impl.cassandra.CassandraSessionFactory.getSession;
-import static org.openecomp.sdc.action.ActionConstants.FILTER_TYPE_CATEGORY;
-import static org.openecomp.sdc.action.ActionConstants.FILTER_TYPE_OPEN_ECOMP_COMPONENT;
-import static org.openecomp.sdc.action.ActionConstants.FILTER_TYPE_MODEL;
-import static org.openecomp.sdc.action.ActionConstants.FILTER_TYPE_NAME;
-import static org.openecomp.sdc.action.ActionConstants.FILTER_TYPE_NONE;
-import static org.openecomp.sdc.action.ActionConstants.FILTER_TYPE_VENDOR;
-import static org.openecomp.sdc.action.ActionConstants.STATUS;
-import static org.openecomp.sdc.action.ActionConstants.TARGET_ENTITY;
-import static org.openecomp.sdc.action.ActionConstants.TARGET_ENTITY_DB;
-import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_DEL_LOCKED_OTHER_USER;
-import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_DEL_LOCKED_OTHER_USER_CODE;
-import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ENTITY_INTERNAL_SERVER_ERROR_MSG;
-import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ENTITY_NOT_EXIST;
-import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ENTITY_NOT_EXIST_CODE;
-import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_INTERNAL_SERVER_ERR_CODE;
-import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_NOT_LOCKED_CODE;
-import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_NOT_LOCKED_MSG;
-import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_QUERY_FAILURE_CODE;
-import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_QUERY_FAILURE_MSG;
-
 import com.datastax.driver.core.ResultSet;
 import com.datastax.driver.core.Row;
 import com.datastax.driver.core.Statement;
@@ -56,8 +32,6 @@
 import com.datastax.driver.mapping.annotations.Accessor;
 import com.datastax.driver.mapping.annotations.Query;
 import org.openecomp.core.dao.impl.CassandraBaseDao;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.openecomp.core.nosqldb.api.NoSqlDb;
 import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
 import org.openecomp.core.utilities.json.JsonUtil;
@@ -73,6 +47,8 @@
 import org.openecomp.sdc.action.types.ActionSubOperation;
 import org.openecomp.sdc.action.types.OpenEcompComponent;
 import org.openecomp.sdc.action.util.ActionUtil;
+import org.openecomp.sdc.logging.api.Logger;
+import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.openecomp.sdc.versioning.VersioningManagerFactory;
 import org.openecomp.sdc.versioning.dao.VersionInfoDao;
 import org.openecomp.sdc.versioning.dao.VersionInfoDaoFactory;
@@ -93,6 +69,30 @@
 import java.util.Set;
 import java.util.stream.Collectors;
 
+import static com.datastax.driver.core.querybuilder.QueryBuilder.eq;
+import static com.datastax.driver.core.querybuilder.QueryBuilder.in;
+import static com.datastax.driver.core.querybuilder.QueryBuilder.set;
+import static org.openecomp.core.nosqldb.impl.cassandra.CassandraSessionFactory.getSession;
+import static org.openecomp.sdc.action.ActionConstants.FILTER_TYPE_CATEGORY;
+import static org.openecomp.sdc.action.ActionConstants.FILTER_TYPE_MODEL;
+import static org.openecomp.sdc.action.ActionConstants.FILTER_TYPE_NAME;
+import static org.openecomp.sdc.action.ActionConstants.FILTER_TYPE_NONE;
+import static org.openecomp.sdc.action.ActionConstants.FILTER_TYPE_OPEN_ECOMP_COMPONENT;
+import static org.openecomp.sdc.action.ActionConstants.FILTER_TYPE_VENDOR;
+import static org.openecomp.sdc.action.ActionConstants.STATUS;
+import static org.openecomp.sdc.action.ActionConstants.TARGET_ENTITY;
+import static org.openecomp.sdc.action.ActionConstants.TARGET_ENTITY_DB;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_DEL_LOCKED_OTHER_USER;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_DEL_LOCKED_OTHER_USER_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ENTITY_INTERNAL_SERVER_ERROR_MSG;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ENTITY_NOT_EXIST;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ENTITY_NOT_EXIST_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_INTERNAL_SERVER_ERR_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_NOT_LOCKED_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_NOT_LOCKED_MSG;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_QUERY_FAILURE_CODE;
+import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_QUERY_FAILURE_MSG;
+
 
 public class ActionDaoImpl extends CassandraBaseDao<ActionEntity> implements ActionDao {
   private static NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface();
diff --git a/openecomp-be/lib/openecomp-sdc-activity-log-lib/openecomp-sdc-activity-log-api/src/main/java/org/openecomp/sdc/activitylog/dao/ActivityLogDao.java b/openecomp-be/lib/openecomp-sdc-activity-log-lib/openecomp-sdc-activity-log-api/src/main/java/org/openecomp/sdc/activitylog/dao/ActivityLogDao.java
index 9804bfc..6ca1010 100644
--- a/openecomp-be/lib/openecomp-sdc-activity-log-lib/openecomp-sdc-activity-log-api/src/main/java/org/openecomp/sdc/activitylog/dao/ActivityLogDao.java
+++ b/openecomp-be/lib/openecomp-sdc-activity-log-lib/openecomp-sdc-activity-log-api/src/main/java/org/openecomp/sdc/activitylog/dao/ActivityLogDao.java
@@ -18,10 +18,6 @@
 
 import org.openecomp.core.dao.BaseDao;
 import org.openecomp.sdc.activitylog.dao.type.ActivityLogEntity;
-import org.openecomp.sdc.versioning.dao.types.Version;
-
-import java.util.Collection;
 
 public interface ActivityLogDao extends BaseDao<ActivityLogEntity> {
-    Collection<ActivityLogEntity> getActivityLogListForItem(String itemId, String versionId);
 }
diff --git a/openecomp-be/lib/openecomp-sdc-activity-log-lib/openecomp-sdc-activity-log-api/src/main/java/org/openecomp/sdc/activitylog/dao/ActivityLogDaoFactory.java b/openecomp-be/lib/openecomp-sdc-activity-log-lib/openecomp-sdc-activity-log-api/src/main/java/org/openecomp/sdc/activitylog/dao/ActivityLogDaoFactory.java
index d3ac277..1fc7de7 100644
--- a/openecomp-be/lib/openecomp-sdc-activity-log-lib/openecomp-sdc-activity-log-api/src/main/java/org/openecomp/sdc/activitylog/dao/ActivityLogDaoFactory.java
+++ b/openecomp-be/lib/openecomp-sdc-activity-log-lib/openecomp-sdc-activity-log-api/src/main/java/org/openecomp/sdc/activitylog/dao/ActivityLogDaoFactory.java
@@ -15,8 +15,8 @@
  */
 package org.openecomp.sdc.activitylog.dao;
 
-import org.openecomp.core.factory.api.AbstractFactory;
 import org.openecomp.core.factory.api.AbstractComponentFactory;
+import org.openecomp.core.factory.api.AbstractFactory;
 
 
 public abstract class ActivityLogDaoFactory extends AbstractComponentFactory<ActivityLogDao> {
diff --git a/openecomp-be/lib/openecomp-sdc-activity-log-lib/openecomp-sdc-activity-log-api/src/main/java/org/openecomp/sdc/activitylog/dao/type/ActivityLogEntity.java b/openecomp-be/lib/openecomp-sdc-activity-log-lib/openecomp-sdc-activity-log-api/src/main/java/org/openecomp/sdc/activitylog/dao/type/ActivityLogEntity.java
index e84a2be..36a4bbc 100644
--- a/openecomp-be/lib/openecomp-sdc-activity-log-lib/openecomp-sdc-activity-log-api/src/main/java/org/openecomp/sdc/activitylog/dao/type/ActivityLogEntity.java
+++ b/openecomp-be/lib/openecomp-sdc-activity-log-lib/openecomp-sdc-activity-log-api/src/main/java/org/openecomp/sdc/activitylog/dao/type/ActivityLogEntity.java
@@ -16,107 +16,130 @@
 
 package org.openecomp.sdc.activitylog.dao.type;
 
-import com.datastax.driver.mapping.annotations.*;
+import com.datastax.driver.mapping.annotations.ClusteringColumn;
+import com.datastax.driver.mapping.annotations.Column;
+import com.datastax.driver.mapping.annotations.Enumerated;
+import com.datastax.driver.mapping.annotations.PartitionKey;
+import com.datastax.driver.mapping.annotations.Table;
 import org.openecomp.sdc.versioning.dao.types.Version;
 
-import java.util.Calendar;
 import java.util.Date;
 
 @Table(keyspace = "dox", name = "activity_log")
 public class ActivityLogEntity {
-    @PartitionKey
-    @Column(name = "item_id")
-    private String itemId;
-    @ClusteringColumn(value = 1)
-    @Column(name = "version_id")
-    private String versionId;
-    @ClusteringColumn
-    @Column(name = "activity_id")
-    private String id;
-    private String type;
-    private String user;
-    private Date timestamp;
-    private boolean success;
-    private String message;
-    private String comment;
+  @PartitionKey
+  @Column(name = "item_id")
+  private String itemId;
+  @ClusteringColumn(value = 1)
+  @Column(name = "version_id")
+  private String versionId;
+  @ClusteringColumn
+  @Column(name = "activity_id")
+  private String id;
+  @Enumerated
+  private ActivityType type;
+  private String user;
+  private Date timestamp;
+  private boolean success;
+  private String message;
+  private String comment;
 
-    public ActivityLogEntity() {}
+  public ActivityLogEntity() {
+  }
 
-    public ActivityLogEntity(String itemId, String versionId, String type, String user, boolean success, String message, String comment) {
-        this.itemId = itemId;
-        this.versionId = versionId;
-        this.type = type;
-        this.user = user;
-        this.success = success;
-        this.message = message;
-        this.comment = comment;
-        Calendar now = Calendar.getInstance();
-        this.timestamp = now.getTime();
-    }
+  public ActivityLogEntity(String itemId, Version version) {
+    this.itemId = itemId;
+    setVersion(version);
+  }
 
-    public String getItemId() { return itemId; }
+  public ActivityLogEntity(String itemId, Version version, ActivityType type, String user,
+                           boolean success, String message, String comment) {
+    this(itemId, version);
+    this.type = type;
+    this.user = user;
+    this.success = success;
+    this.message = message;
+    this.comment = comment;
+    this.timestamp = new Date();
+  }
 
-    public void setItemId(String itemId) {
-        this.itemId = itemId;
-    }
+  public String getItemId() {
+    return itemId;
+  }
 
-    public String getVersionId() {
-        return versionId;
-    }
+  public void setItemId(String itemId) {
+    this.itemId = itemId;
+  }
 
-    public void setVersionId(String versionId) {
-        this.versionId = versionId;
-    }
+  public Version getVersion() {
+    return versionId == null ? null : new Version(versionId);
+  }
 
-    public String getId() { return id; }
+  public void setVersion(Version version) {
+    this.versionId = version == null ? null : version.getId();
+  }
 
-    public void setId(String id) { this.id = id; }
+  public String getVersionId() {
+    return versionId;
+  }
 
-    public String getType() {
-        return type;
-    }
+  public void setVersionId(String versionId) {
+    this.versionId = versionId;
+  }
 
-    public void setType(String type) {
-        this.type = type;
-    }
+  public String getId() {
+    return id;
+  }
 
-    public String getUser() {
-        return user;
-    }
+  public void setId(String id) {
+    this.id = id;
+  }
 
-    public void setUser(String user) {
-        this.user = user;
-    }
+  public ActivityType getType() {
+    return type;
+  }
 
-    public Date getTimestamp() {
-        return timestamp;
-    }
+  public void setType(ActivityType type) {
+    this.type = type;
+  }
 
-    public void setTimestamp(Date timestamp) {
-        this.timestamp = timestamp;
-    }
+  public String getUser() {
+    return user;
+  }
 
-    public boolean isSuccess() {
-        return success;
-    }
+  public void setUser(String user) {
+    this.user = user;
+  }
 
-    public void setSuccess(boolean success) {
-        this.success = success;
-    }
+  public Date getTimestamp() {
+    return timestamp;
+  }
 
-    public String getMessage() {
-        return message;
-    }
+  public void setTimestamp(Date timestamp) {
+    this.timestamp = timestamp;
+  }
 
-    public void setMessage(String message) {
-        this.message = message;
-    }
+  public boolean isSuccess() {
+    return success;
+  }
 
-    public String getComment() {
-        return comment;
-    }
+  public void setSuccess(boolean success) {
+    this.success = success;
+  }
 
-    public void setComment(String comment) {
-        this.comment = comment;
-    }
+  public String getMessage() {
+    return message;
+  }
+
+  public void setMessage(String message) {
+    this.message = message;
+  }
+
+  public String getComment() {
+    return comment;
+  }
+
+  public void setComment(String comment) {
+    this.comment = comment;
+  }
 }
diff --git a/openecomp-be/lib/openecomp-sdc-activity-log-lib/openecomp-sdc-activity-log-api/src/main/java/org/openecomp/sdc/activitylog/dao/type/ActivityType.java b/openecomp-be/lib/openecomp-sdc-activity-log-lib/openecomp-sdc-activity-log-api/src/main/java/org/openecomp/sdc/activitylog/dao/type/ActivityType.java
new file mode 100644
index 0000000..620113e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-activity-log-lib/openecomp-sdc-activity-log-api/src/main/java/org/openecomp/sdc/activitylog/dao/type/ActivityType.java
@@ -0,0 +1,13 @@
+package org.openecomp.sdc.activitylog.dao.type;
+
+public enum ActivityType {
+  Create,
+  Create_Version,
+  Commit,
+  Submit,
+  Upload_Artifact,
+  Upload_Network_Package,
+  Revert,
+  Reset
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-activity-log-lib/openecomp-sdc-activity-log-core/src/main/java/org/openecomp/sdc/activitylog/dao/impl/ActivityLogDaoCassandraImpl.java b/openecomp-be/lib/openecomp-sdc-activity-log-lib/openecomp-sdc-activity-log-core/src/main/java/org/openecomp/sdc/activitylog/dao/impl/ActivityLogDaoCassandraImpl.java
index 5772cc1..85e0afa 100644
--- a/openecomp-be/lib/openecomp-sdc-activity-log-lib/openecomp-sdc-activity-log-core/src/main/java/org/openecomp/sdc/activitylog/dao/impl/ActivityLogDaoCassandraImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-activity-log-lib/openecomp-sdc-activity-log-core/src/main/java/org/openecomp/sdc/activitylog/dao/impl/ActivityLogDaoCassandraImpl.java
@@ -26,58 +26,34 @@
 import org.openecomp.sdc.activitylog.dao.type.ActivityLogEntity;
 
 import java.util.Collection;
-import java.util.Date;
 
-public class ActivityLogDaoCassandraImpl extends CassandraBaseDao<ActivityLogEntity> implements ActivityLogDao{
-    private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface();
-    private static final Mapper<ActivityLogEntity> mapper =
-            noSqlDb.getMappingManager().mapper(ActivityLogEntity.class);
-    private static final ActivityLogAccessor accessor =
-            noSqlDb.getMappingManager().createAccessor(ActivityLogAccessor.class);
+public class ActivityLogDaoCassandraImpl extends CassandraBaseDao<ActivityLogEntity>
+    implements ActivityLogDao {
+  private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface();
+  private static final Mapper<ActivityLogEntity> mapper =
+      noSqlDb.getMappingManager().mapper(ActivityLogEntity.class);
+  private static final ActivityLogAccessor accessor =
+      noSqlDb.getMappingManager().createAccessor(ActivityLogAccessor.class);
 
-    @Override
-    protected Mapper<ActivityLogEntity> getMapper() {
-        return mapper;
-    }
+  @Override
+  protected Mapper<ActivityLogEntity> getMapper() {
+    return mapper;
+  }
 
-    @Override
-    protected Object[] getKeys(ActivityLogEntity entity) {
-        return new Object[0];
-    }
+  @Override
+  protected Object[] getKeys(ActivityLogEntity entity) {
+    return new Object[]{entity.getItemId(), entity.getVersionId(), entity.getId()};
+  }
 
-    @Override
-    public Collection<ActivityLogEntity> list(ActivityLogEntity entity) {
-        return accessor.list().all();
-    }
+  @Override
+  public Collection<ActivityLogEntity> list(ActivityLogEntity entity) {
+    return accessor.listByItemVersion(entity.getItemId(), entity.getVersionId()).all();
+  }
 
-    @Override
-    public void create(ActivityLogEntity activityLogEntity) {
-        accessor.create(activityLogEntity.getItemId(), activityLogEntity.getVersionId(),activityLogEntity.getId(),
-                activityLogEntity.getType(),activityLogEntity.getUser(), activityLogEntity.getTimestamp(), activityLogEntity.isSuccess(),
-                activityLogEntity.getMessage(), activityLogEntity.getComment());
-    }
+  @Accessor
+  interface ActivityLogAccessor {
 
-    @Override
-    public Collection<ActivityLogEntity> getActivityLogListForItem(String itemId, String versionId) {
-        return accessor.getForItem(itemId, versionId).all();
-    }
-
-
-    @Accessor
-    interface ActivityLogAccessor {
-        @Query("select item_id, version_id, activity_id, type, user, timestamp, success, message, comment"
-                        + " from activity_log")
-        Result<ActivityLogEntity> list();
-
-        @Query("select item_id, version_id, activity_id, type, user, timestamp, success, message, comment"
-                        + " from activity_log where item_id=? and version_id=?")
-        Result<ActivityLogEntity> getForItem(String itemId, String versionId);
-
-        @Query("insert into activity_log " +
-                " (item_id, version_id, activity_id, type, user, timestamp, success, message, comment)" +
-                " values (?,?,?,?,?,?,?,?,?)")
-        Result<ActivityLogEntity> create(String itemId, String versionId, String id, String type,
-                                         String user, Date timestamp, boolean success,
-                                         String message, String comment);
-    }
+    @Query("select * from activity_log where item_id=? and version_id=?")
+    Result<ActivityLogEntity> listByItemVersion(String itemId, String versionId);
+  }
 }
diff --git a/openecomp-be/lib/openecomp-sdc-activity-log-lib/openecomp-sdc-activity-log-core/src/main/java/org/openecomp/sdc/activitylog/dao/impl/ActivityLogDaoFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-activity-log-lib/openecomp-sdc-activity-log-core/src/main/java/org/openecomp/sdc/activitylog/dao/impl/ActivityLogDaoFactoryImpl.java
index 98e4cc2..02c8a71 100644
--- a/openecomp-be/lib/openecomp-sdc-activity-log-lib/openecomp-sdc-activity-log-core/src/main/java/org/openecomp/sdc/activitylog/dao/impl/ActivityLogDaoFactoryImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-activity-log-lib/openecomp-sdc-activity-log-core/src/main/java/org/openecomp/sdc/activitylog/dao/impl/ActivityLogDaoFactoryImpl.java
@@ -19,10 +19,10 @@
 import org.openecomp.sdc.activitylog.dao.ActivityLogDaoFactory;
 
 public class ActivityLogDaoFactoryImpl extends ActivityLogDaoFactory {
-    private static final ActivityLogDao INSTANCE = new ActivityLogDaoCassandraImpl();
+  private static final ActivityLogDao INSTANCE = new ActivityLogDaoCassandraImpl();
 
-    @Override
-    public ActivityLogDao createInterface() {
-        return INSTANCE;
-    }
+  @Override
+  public ActivityLogDao createInterface() {
+    return INSTANCE;
+  }
 }
diff --git a/openecomp-be/lib/openecomp-sdc-datatypes-lib/src/main/java/org/openecomp/sdc/datatypes/model/ElementType.java b/openecomp-be/lib/openecomp-sdc-datatypes-lib/src/main/java/org/openecomp/sdc/datatypes/model/ElementType.java
new file mode 100644
index 0000000..19d5656
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-datatypes-lib/src/main/java/org/openecomp/sdc/datatypes/model/ElementType.java
@@ -0,0 +1,31 @@
+package org.openecomp.sdc.datatypes.model;
+
+public enum ElementType {
+  itemVersion,
+
+  VendorLicenseModel,
+  LicenseAgreements, LicenseAgreement,
+  FeatureGroups, FeatureGroup,
+  LicenseKeyGroups, LicenseKeyGroup,
+  EntitlementPools, EntitlementPool,
+  Limits, Limit,
+
+  VendorSoftwareProduct,
+  VSPQuestionnaire,
+
+  VspModel, NetworkPackage,
+  OrchestrationTemplateCandidate, OrchestrationTemplateCandidateContent,
+  // todo - remove OrchestrationTemplateContent
+  OrchestrationTemplate, OrchestrationTemplateValidationData, OrchestrationTemplateContent,
+  Networks, Network,
+  Components, Component, ComponentQuestionnaire, ComponentDependencies, ComponentDependency,
+  Nics, Nic, NicQuestionnaire,
+  Mibs, SNMP_POLL, SNMP_TRAP, VES_EVENTS,
+  Processes, Process,
+  DeploymentFlavors, DeploymentFlavor,
+  Computes, Compute, ComputeQuestionnaire,
+  Images, Image, ImageQuestionnaire,
+  ServiceModel, EnrichedServiceModel, ServiceTemplate, Templates, Artifact, Artifacts,
+
+  test
+}
diff --git a/openecomp-be/lib/openecomp-sdc-datatypes-lib/src/main/java/org/openecomp/sdc/datatypes/model/ItemType.java b/openecomp-be/lib/openecomp-sdc-datatypes-lib/src/main/java/org/openecomp/sdc/datatypes/model/ItemType.java
new file mode 100644
index 0000000..892351a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-datatypes-lib/src/main/java/org/openecomp/sdc/datatypes/model/ItemType.java
@@ -0,0 +1,6 @@
+package org.openecomp.sdc.datatypes.model;
+
+public enum ItemType {
+  vlm,
+  vsp
+}
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/main/java/org/openecomp/sdc/enrichment/impl/EnrichmentManagerImpl.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/main/java/org/openecomp/sdc/enrichment/impl/EnrichmentManagerImpl.java
index 06b157b..6610ec5 100644
--- a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/main/java/org/openecomp/sdc/enrichment/impl/EnrichmentManagerImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/main/java/org/openecomp/sdc/enrichment/impl/EnrichmentManagerImpl.java
@@ -22,12 +22,12 @@
 
 import org.openecomp.core.enrichment.api.EnrichmentManager;
 import org.openecomp.core.enrichment.types.EntityInfo;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.openecomp.sdc.datatypes.error.ErrorMessage;
 import org.openecomp.sdc.enrichment.EnrichmentInfo;
 import org.openecomp.sdc.enrichment.factory.EnricherHandlerFactory;
 import org.openecomp.sdc.enrichment.inter.Enricher;
+import org.openecomp.sdc.logging.api.Logger;
+import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel;
 import org.openecomp.sdc.versioning.dao.types.Version;
 
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/java/org/openecomp/sdc/enrichment/impl/EnrichmentManagerImplTest.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/java/org/openecomp/sdc/enrichment/impl/EnrichmentManagerImplTest.java
index 1b9e119..acd25dd 100644
--- a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/java/org/openecomp/sdc/enrichment/impl/EnrichmentManagerImplTest.java
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/java/org/openecomp/sdc/enrichment/impl/EnrichmentManagerImplTest.java
@@ -20,8 +20,6 @@
 
 package org.openecomp.sdc.enrichment.impl;
 
-import static org.junit.Assert.assertEquals;
-
 import org.openecomp.core.enrichment.factory.EnrichmentManagerFactory;
 import org.openecomp.core.utilities.file.FileUtils;
 import org.openecomp.sdc.logging.api.Logger;
@@ -50,6 +48,8 @@
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipInputStream;
 
+import static org.junit.Assert.assertEquals;
+
 
 public class EnrichmentManagerImplTest {
 
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/EnricherHandlerImpl.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/EnricherHandlerImpl.java
index a5eeece..c9d89ee 100644
--- a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/EnricherHandlerImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/EnricherHandlerImpl.java
@@ -20,12 +20,12 @@
 
 package org.openecomp.sdc.enrichment.impl;
 
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.openecomp.sdc.enrichment.impl.external.artifact.ExternalArtifactEnricher;
 import org.openecomp.sdc.enrichment.impl.tosca.ToscaEnricher;
 import org.openecomp.sdc.enrichment.inter.Enricher;
 import org.openecomp.sdc.enrichment.inter.EnricherHandler;
+import org.openecomp.sdc.logging.api.Logger;
+import org.openecomp.sdc.logging.api.LoggerFactory;
 
 import java.util.ArrayList;
 import java.util.List;
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/external/artifact/ProcessArtifactEnricher.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/external/artifact/ProcessArtifactEnricher.java
index a5f6529..828de72 100644
--- a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/external/artifact/ProcessArtifactEnricher.java
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/external/artifact/ProcessArtifactEnricher.java
@@ -10,10 +10,10 @@
 import org.openecomp.sdc.enrichment.EnrichmentInfo;
 import org.openecomp.sdc.enrichment.inter.ExternalArtifactEnricherInterface;
 import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDaoFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.ProcessDao;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.ProcessDaoFactory;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDaoFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessType;
@@ -28,7 +28,7 @@
 
 public class ProcessArtifactEnricher implements ExternalArtifactEnricherInterface {
 
-  private VendorSoftwareProductDao vendorSoftwareProductDao;
+  private ComponentDao componentDao;
   //private ProcessArtifactDao processArtifactDao;
   private ProcessDao processDao;
   private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage();
@@ -41,10 +41,9 @@
     Version version = enrichmentInfo.getVersion();
 
     Collection<ComponentEntity> components =
-        getVendorSoftwareProductDao().listComponents(vspId, version);
-    components.stream()
-        .forEach(componentEntry -> errors.putAll(enrichComponent(componentEntry,
-            vspId, version)));
+        getComponentDao().list(new ComponentEntity(vspId, version, null));
+    components.forEach(componentEntry -> errors.putAll(enrichComponent(componentEntry,
+        vspId, version)));
 
     return errors;
   }
@@ -79,10 +78,9 @@
           ProcessArtifactEntity artifactEntity = new ProcessArtifactEntity(vspId, version,
                   componentId, entity.getId());*/
 
-    processes.stream()
-        .forEach(entity -> {
-          ProcessEntity artifactEntity = new ProcessEntity(vspId, version,
-              componentId, entity.getId());
+    processes.forEach(entity -> {
+      ProcessEntity artifactEntity = new ProcessEntity(vspId, version,
+          componentId, entity.getId());
 
           ProcessEntity artifactProcessEntity = getProcessDao().get(artifactEntity);
           //ProcessArtifactEntity artifact = getProcessArtifactDao().get(artifactEntity);
@@ -105,7 +103,7 @@
           }
         });
 
-    mdcDataDebugMessage.debugExitMessage(null, null);
+    mdcDataDebugMessage.debugExitMessage(null);
   }
 
   void enrichServiceArtifact(ComponentProcessInfo componentProcessInfo,
@@ -113,19 +111,19 @@
                              Map<String, List<ErrorMessage>> errors) {
 
 
-    mdcDataDebugMessage.debugEntryMessage(null, null);
+    mdcDataDebugMessage.debugEntryMessage(null);
 
     processServiceArtifact.setName(componentProcessInfo.getName());
     processServiceArtifact.setContentData(FileUtils.toByteArray(componentProcessInfo.getContent()));
     getEnrichedServiceModelDao().storeExternalArtifact(processServiceArtifact);
-    mdcDataDebugMessage.debugExitMessage(null, null);
+    mdcDataDebugMessage.debugExitMessage(null);
   }
 
-  private VendorSoftwareProductDao getVendorSoftwareProductDao() {
-    if (vendorSoftwareProductDao == null) {
-      vendorSoftwareProductDao = VendorSoftwareProductDaoFactory.getInstance().createInterface();
+  private ComponentDao getComponentDao() {
+    if (componentDao == null) {
+      componentDao = ComponentDaoFactory.getInstance().createInterface();
     }
-    return vendorSoftwareProductDao;
+    return componentDao;
   }
 
   private ProcessDao getProcessDao() {
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/external/artifact/VspInformationArtifactEnricher.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/external/artifact/VspInformationArtifactEnricher.java
index b7da22b..9e46a5c 100644
--- a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/external/artifact/VspInformationArtifactEnricher.java
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/external/artifact/VspInformationArtifactEnricher.java
@@ -32,8 +32,6 @@
 import org.openecomp.sdc.enrichment.inter.ExternalArtifactEnricherInterface;
 import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage;
 import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.OrchestrationTemplateDao;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.OrchestrationTemplateDaoFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDao;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDaoFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
@@ -61,8 +59,6 @@
       EnrichedServiceModelDaoFactory.getInstance().createInterface();
   private VendorSoftwareProductInfoDao vspInfoDao = VendorSoftwareProductInfoDaoFactory
       .getInstance().createInterface();
-  private OrchestrationTemplateDao orchestrationTemplateDataDao =
-      OrchestrationTemplateDaoFactory.getInstance().createInterface();
 
   public VspInformationArtifactEnricher() {
   }
@@ -81,7 +77,7 @@
       throws IOException {
 
 
-    mdcDataDebugMessage.debugEntryMessage(null, null);
+    mdcDataDebugMessage.debugEntryMessage(null);
 
     Map<String, List<ErrorMessage>> errors = new HashMap<>();
     ByteBuffer infoArtifactByteBuffer = ByteBuffer.wrap(informationArtifactGenerator.generate(
@@ -94,13 +90,13 @@
           vspId, version.toString())));
       //TODO: add error to map (what is the key?)
 
-      mdcDataDebugMessage.debugExitMessage(null, null);
+      mdcDataDebugMessage.debugExitMessage(null);
       return errors;
     }
 
     enrichInformationArtifact(vspId, version, infoArtifactByteBuffer);
 
-    mdcDataDebugMessage.debugExitMessage(null, null);
+    mdcDataDebugMessage.debugExitMessage(null);
     return errors;
   }
 
@@ -108,10 +104,7 @@
                                          ByteBuffer infoArtifactByteBuffer) {
     ServiceArtifact infoArtifactServiceArtifact = new ServiceArtifact();
 
-    VspDetails vspDetails = getVspDetails(vspId, version);
-
-    String vspName = vspDetails.getName();
-
+    String vspName = vspInfoDao.get(new VspDetails(vspId, version)).getName();
 
     infoArtifactServiceArtifact.setVspId(vspId);
     infoArtifactServiceArtifact.setVersion(version);
@@ -126,9 +119,5 @@
     enrichedServiceModelDao.storeExternalArtifact(infoArtifactServiceArtifact);
 
   }
-  public VspDetails getVspDetails(String vspId,Version version){
-    VspDetails vspDetails = vspInfoDao.get(new VspDetails(vspId,version));
-    vspDetails.setValidationData(orchestrationTemplateDataDao.getValidationData(vspId,version));
-    return vspDetails;
-  }
+
 }
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/ComponentQuestionnaireData.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/ComponentQuestionnaireData.java
index f49c53d..9ebe9e5 100644
--- a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/ComponentQuestionnaireData.java
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/ComponentQuestionnaireData.java
@@ -26,36 +26,35 @@
 import static org.openecomp.sdc.enrichment.impl.util.EnrichmentConstants.VFC_NAMING_CODE;
 
 
-
 public class ComponentQuestionnaireData {
 
   ComponentDao componentDao = ComponentDaoFactory.getInstance().createInterface();
-  ComponentDependencyModelDao componentDependencyModelDao = ComponentDependencyModelDaoFactory.getInstance()
-      .createInterface();
+  ComponentDependencyModelDao componentDependencyModelDao =
+      ComponentDependencyModelDaoFactory.getInstance().createInterface();
 
-  private  Map<String,String> sourceToTargetComponent;
+  private Map<String, String> sourceToTargetComponent;
 
-  public Map<String,String> getSourceToTargetComponent() {
+  public Map<String, String> getSourceToTargetComponent() {
     return sourceToTargetComponent;
   }
 
-  public void setSourceToTargetComponent(Map<String,String> sourceToTargetComponent) {
+  public void setSourceToTargetComponent(Map<String, String> sourceToTargetComponent) {
     this.sourceToTargetComponent = sourceToTargetComponent;
   }
 
   public Map<String, Map<String, Object>> getPropertiesfromCompQuestionnaire(String key,
                                                                              Version version) {
-    Map<String, Map<String,Object>> componentProperties =
-        new HashMap<String, Map<String,Object>>();
+    Map<String, Map<String, Object>> componentProperties =
+        new HashMap<String, Map<String, Object>>();
 
     ComponentEntity entity = new ComponentEntity(key, version, null);
     final Collection<ComponentEntity> componentEntities =
         componentDao.listCompositionAndQuestionnaire(key, version);
 
-    Map<String,String> sourceToTarget = new HashMap<String, String>();
+    Map<String, String> sourceToTarget = new HashMap<>();
 
     for (ComponentEntity component : componentEntities) {
-      Map<String, Object> questionnaireParams = new HashMap<String, Object>();
+      Map<String, Object> questionnaireParams = new HashMap<>();
 
       final ComponentQuestionnaire componentQuestionnaire =
           JsonUtil.json2Object(component.getQuestionnaireData(), ComponentQuestionnaire.class);
@@ -77,7 +76,7 @@
       questionnaireParams.put(EnrichmentConstants.VFC_FUNCTION, vfcDescription);
 
 
-      if (componentQuestionnaire.getHighAvailabilityAndLoadBalancing() != null ) {
+      if (componentQuestionnaire.getHighAvailabilityAndLoadBalancing() != null) {
         String mandatory = componentQuestionnaire.getHighAvailabilityAndLoadBalancing()
             .getIsComponentMandatory();
         questionnaireParams.put(MANDATORY, mandatory);
@@ -91,19 +90,20 @@
       final Integer maxVms =
           componentQuestionnaire.getCompute() != null ? (componentQuestionnaire.getCompute()
               .getNumOfVMs() != null ? componentQuestionnaire.getCompute().getNumOfVMs()
-              .getMaximum(): null) : null;
+              .getMaximum() : null) : null;
 
       final Integer minVms =
           componentQuestionnaire.getCompute() != null ? (componentQuestionnaire.getCompute()
               .getNumOfVMs() != null ? componentQuestionnaire.getCompute().getNumOfVMs()
-              .getMinimum(): null) : null;
+              .getMinimum() : null) : null;
 
-      questionnaireParams.put(MIN_INSTANCES,minVms != null &&  minVms == 0 ? null : minVms);
-      questionnaireParams.put(MAX_INSTANCES,maxVms != null &&  maxVms == 0 ? null : maxVms);
+      questionnaireParams.put(MIN_INSTANCES, minVms != null && minVms == 0 ? null : minVms);
+      questionnaireParams.put(MAX_INSTANCES, maxVms != null && maxVms == 0 ? null : maxVms);
 
-      if (! questionnaireParams.isEmpty())
+      if (!questionnaireParams.isEmpty()) {
         componentProperties.put(JsonUtil.json2Object(component.getCompositionData(),
             ComponentData.class).getDisplayName(), questionnaireParams);
+      }
     }
 
     setSourceToTargetComponent(sourceToTarget);
@@ -111,12 +111,12 @@
     return componentProperties;
   }
 
-  public Map<String,List<String>> populateDependencies(String vspId, Version version, Map<String,
-                                                       String> componentNameData) {
+  public Map<String, List<String>> populateDependencies(String vspId, Version version, Map<String,
+      String> componentNameData) {
     Collection<ComponentDependencyModelEntity> componentDependencies =
         componentDependencyModelDao.list(new ComponentDependencyModelEntity(vspId, version, null));
 
-    Map<String,List<String>> sourceToTargetComponent = new HashMap<String, List<String>>();
+    Map<String, List<String>> sourceToTargetComponent = new HashMap<String, List<String>>();
     List<String> targetComponents = null;
     for (ComponentDependencyModelEntity dependency : componentDependencies) {
       String sourceComponentName = componentNameData.get(dependency.getSourceComponentId());
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/PortMirroringEnricher.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/PortMirroringEnricher.java
index 705773d..a855a74 100644
--- a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/PortMirroringEnricher.java
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/PortMirroringEnricher.java
@@ -1,9 +1,5 @@
 package org.openecomp.sdc.enrichment.impl.tosca;
 
-import static org.openecomp.sdc.tosca.services.DataModelUtil.getClonedObject;
-import static org.openecomp.sdc.tosca.services.ToscaConstants.PORT_MIRRORING_CAPABILITY_CP_PROPERTY_NAME;
-import static org.openecomp.sdc.tosca.services.ToscaConstants.PORT_MIRRORING_CAPABILITY_ID;
-
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.collections4.MapUtils;
 import org.openecomp.sdc.datatypes.error.ErrorMessage;
@@ -39,6 +35,10 @@
 import java.util.Set;
 import java.util.stream.Collectors;
 
+import static org.openecomp.sdc.tosca.services.DataModelUtil.getClonedObject;
+import static org.openecomp.sdc.tosca.services.ToscaConstants.PORT_MIRRORING_CAPABILITY_CP_PROPERTY_NAME;
+import static org.openecomp.sdc.tosca.services.ToscaConstants.PORT_MIRRORING_CAPABILITY_ID;
+
 public class PortMirroringEnricher {
   //Map of service template file name and map of all port node template ids, node template
   private Map<String, Map<String, NodeTemplate>> portNodeTemplates = new HashMap<>();
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/ToscaEnricher.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/ToscaEnricher.java
index 090c3ae..5ea1176 100644
--- a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/ToscaEnricher.java
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/ToscaEnricher.java
@@ -20,11 +20,13 @@
 
 package org.openecomp.sdc.enrichment.impl.tosca;
 
+import org.openecomp.sdc.datatypes.error.ErrorLevel;
 import org.openecomp.sdc.datatypes.error.ErrorMessage;
 import org.openecomp.sdc.enrichment.inter.Enricher;
 import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage;
 import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel;
 
+import java.util.Arrays;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -45,13 +47,19 @@
   private Map<String, List<ErrorMessage>> enrichAbstractSubstitute() {
     mdcDataDebugMessage.debugEntryMessage(null, null);
 
-    Map<String, List<ErrorMessage>> enrichErrors;
+    Map<String, List<ErrorMessage>> enrichErrors = new HashMap<>();
 
     ToscaServiceModel toscaModel = (ToscaServiceModel) model;
     AbstractSubstituteToscaEnricher abstractSubstituteToscaEnricher =
         new AbstractSubstituteToscaEnricher();
-    enrichErrors = abstractSubstituteToscaEnricher.enrich(toscaModel, data.getKey(),
-        data.getVersion());
+
+    try {
+      enrichErrors = abstractSubstituteToscaEnricher.enrich(toscaModel, data.getKey(),
+          data.getVersion());
+    }catch (Exception e){
+      enrichErrors.put("Tosca Enrich", Arrays.asList(new ErrorMessage(ErrorLevel.ERROR, e
+          .getMessage())));
+    }
 
     mdcDataDebugMessage.debugExitMessage(null, null);
     return enrichErrors;
@@ -59,10 +67,16 @@
 
   private Map<String, List<ErrorMessage>> enrichPortMirroring() {
     mdcDataDebugMessage.debugEntryMessage(null, null);
-    Map<String, List<ErrorMessage>> enrichErrors;
+    Map<String, List<ErrorMessage>> enrichErrors = new HashMap<>();
     ToscaServiceModel toscaModel = (ToscaServiceModel) model;
     PortMirroringEnricher portMirroringEnricher = new PortMirroringEnricher();
-    enrichErrors = portMirroringEnricher.enrich(toscaModel);
+
+    try {
+      enrichErrors = portMirroringEnricher.enrich(toscaModel);
+    }catch (Exception e){
+      enrichErrors.put("Tosca Enrich", Arrays.asList(new ErrorMessage(ErrorLevel.ERROR, e
+          .getMessage())));
+    }
     mdcDataDebugMessage.debugExitMessage(null, null);
     return enrichErrors;
   }
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/inter/ExternalArtifactEnricherInterface.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/inter/ExternalArtifactEnricherInterface.java
index 49b424e..bd250bb 100644
--- a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/inter/ExternalArtifactEnricherInterface.java
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/inter/ExternalArtifactEnricherInterface.java
@@ -32,5 +32,5 @@
  * Created by Talio on 11/24/2016.
  */
 public interface ExternalArtifactEnricherInterface {
-    public Map<String, List<ErrorMessage>> enrich(EnrichmentInfo enrichmentInfo) throws IOException;
+  Map<String, List<ErrorMessage>> enrich(EnrichmentInfo enrichmentInfo) throws IOException;
 }
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/test/java/org/openecomp/sdc/enrichment/impl/external/artifact/MonitoringMibEnricherTest.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/test/java/org/openecomp/sdc/enrichment/impl/external/artifact/MonitoringMibEnricherTest.java
index 3730a15..c01f986 100644
--- a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/test/java/org/openecomp/sdc/enrichment/impl/external/artifact/MonitoringMibEnricherTest.java
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/test/java/org/openecomp/sdc/enrichment/impl/external/artifact/MonitoringMibEnricherTest.java
@@ -35,7 +35,6 @@
 import org.openecomp.sdc.tosca.services.DataModelUtil;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentArtifactDao;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDao;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentMonitoringUploadEntity;
 import org.openecomp.sdc.versioning.dao.types.Version;
@@ -60,8 +59,6 @@
   @Mock
   private EnrichedServiceModelDao enrichedServiceModelDaoMock;
   @Mock
-  private VendorSoftwareProductDao vendorSoftwareProductDaoMock;
-  @Mock
   private ComponentDao componentDaoMock;
 
   @InjectMocks
@@ -157,7 +154,7 @@
 
   private ByteBuffer getMibByteBuffer(String fileName) {
     byte[] mibBytes = FileUtils.readViaInputStream(this.getClass().getResource(fileName),
-            stream -> FileUtils.toByteArray(stream));
+        stream -> FileUtils.toByteArray(stream));
     return ByteBuffer.wrap(mibBytes);
   }
 
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/test/java/org/openecomp/sdc/enrichment/impl/external/artifact/ProcessArtifactEnricherTest.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/test/java/org/openecomp/sdc/enrichment/impl/external/artifact/ProcessArtifactEnricherTest.java
index 0bd84a4..59931a1 100644
--- a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/test/java/org/openecomp/sdc/enrichment/impl/external/artifact/ProcessArtifactEnricherTest.java
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/test/java/org/openecomp/sdc/enrichment/impl/external/artifact/ProcessArtifactEnricherTest.java
@@ -1,46 +1,15 @@
 package org.openecomp.sdc.enrichment.impl.external.artifact;
 
-import org.mockito.ArgumentCaptor;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.core.enrichment.types.ArtifactCategory;
-import org.openecomp.core.model.dao.EnrichedServiceModelDao;
-import org.openecomp.core.model.types.ServiceArtifact;
-import org.openecomp.core.utilities.file.FileUtils;
-import org.openecomp.sdc.enrichment.EnrichmentInfo;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.ProcessDao;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessType;
-import org.openecomp.sdc.versioning.dao.types.Version;
-import org.testng.Assert;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-import java.io.File;
-import java.nio.ByteBuffer;
-import java.util.ArrayList;
-import java.util.Collection;
-
-import static org.mockito.Matchers.anyObject;
-import static org.mockito.Mockito.atLeastOnce;
-import static org.mockito.Mockito.when;
-
 public class ProcessArtifactEnricherTest {
   /*@Mock
   ProcessDao processDaoMock;
   @Mock
   EnrichedServiceModelDao enrichedServiceModelDaoMock;
   @Mock
-  VendorSoftwareProductDao vendorSoftwareProductDaoMock;
-
+  ComponentDao componentDaoMock;
   @InjectMocks
   ProcessArtifactEnricher processArtifactEnricher;
 
-
   @BeforeMethod(alwaysRun = true)
   public void injectDoubles() {
     MockitoAnnotations.initMocks(this);
@@ -65,11 +34,11 @@
     processEntity.setArtifactName("artifact_1kb.txt");
     processEntity.setArtifact(getMibByteBuffer("/mock/enrichProcess/artifact_1kb.txt"));
 
-    Collection<ComponentEntity> componentList = new ArrayList<ComponentEntity>();
+    Collection<ComponentEntity> componentList = new ArrayList<>();
     componentList.add(componentEntity);
-    when(vendorSoftwareProductDaoMock.listComponents(vspId, version)).thenReturn(componentList);
+    when(componentDaoMock.list(anyObject())).thenReturn(componentList);
 
-    Collection<ProcessEntity> list = new ArrayList<ProcessEntity>();
+    Collection<ProcessEntity> list = new ArrayList<>();
     list.add(processEntity);
     when(processDaoMock.list(entity)).thenReturn(list);
 
@@ -111,7 +80,7 @@
 
   private ByteBuffer getMibByteBuffer(String fileName) {
     byte[] mibBytes = FileUtils.readViaInputStream(this.getClass().getResource(fileName),
-            stream -> FileUtils.toByteArray(stream));
+        stream -> FileUtils.toByteArray(stream));
     return ByteBuffer.wrap(mibBytes);
   }*/
 }
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/test/java/org/openecomp/sdc/enrichment/impl/tosca/BaseToscaEnrichmentTest.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/test/java/org/openecomp/sdc/enrichment/impl/tosca/BaseToscaEnrichmentTest.java
index 0001cdf..363e171 100644
--- a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/test/java/org/openecomp/sdc/enrichment/impl/tosca/BaseToscaEnrichmentTest.java
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/test/java/org/openecomp/sdc/enrichment/impl/tosca/BaseToscaEnrichmentTest.java
@@ -25,12 +25,18 @@
 import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel;
 import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
+import org.openecomp.sdc.tosca.services.ToscaExtensionYamlUtil;
 import org.openecomp.sdc.tosca.services.ToscaFileOutputService;
 import org.openecomp.sdc.tosca.services.ToscaUtil;
 import org.openecomp.sdc.tosca.services.impl.ToscaFileOutputServiceCsarImpl;
-import org.openecomp.sdc.tosca.services.ToscaExtensionYamlUtil;
 
-import java.io.*;
+import java.io.BufferedInputStream;
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
 import java.net.URL;
 import java.nio.file.NotDirectoryException;
 import java.util.Collection;
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/test/java/org/openecomp/sdc/enrichment/impl/tosca/ComponentQuestionnaireDataTest.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/test/java/org/openecomp/sdc/enrichment/impl/tosca/ComponentQuestionnaireDataTest.java
index 7373257..d6810d9 100644
--- a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/test/java/org/openecomp/sdc/enrichment/impl/tosca/ComponentQuestionnaireDataTest.java
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/test/java/org/openecomp/sdc/enrichment/impl/tosca/ComponentQuestionnaireDataTest.java
@@ -1,31 +1,5 @@
 package org.openecomp.sdc.enrichment.impl.tosca;
 
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDao;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDependencyModelDao;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentDependencyModelEntity;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity;
-import org.openecomp.sdc.versioning.dao.types.Version;
-import org.testng.Assert;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import static org.mockito.Mockito.doReturn;
-import static org.openecomp.sdc.enrichment.impl.util.EnrichmentConstants.HIGH_AVAIL_MODE;
-import static org.openecomp.sdc.enrichment.impl.util.EnrichmentConstants.MANDATORY;
-import static org.openecomp.sdc.enrichment.impl.util.EnrichmentConstants.MAX_INSTANCES;
-import static org.openecomp.sdc.enrichment.impl.util.EnrichmentConstants.MIN_INSTANCES;
-import static org.openecomp.sdc.enrichment.impl.util.EnrichmentConstants.VFC_CODE;
-import static org.openecomp.sdc.enrichment.impl.util.EnrichmentConstants.VFC_FUNCTION;
-import static org.openecomp.sdc.enrichment.impl.util.EnrichmentConstants.VFC_NAMING_CODE;
-
 public class ComponentQuestionnaireDataTest {
   /*private static String VSP_ID = "vspId";
   public static final Version VERSION01 = new Version(0, 1);
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/test/java/org/openecomp/sdc/enrichment/impl/tosca/PortMirroringEnricherTest.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/test/java/org/openecomp/sdc/enrichment/impl/tosca/PortMirroringEnricherTest.java
index 0a8fe43..b48fd8d 100644
--- a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/test/java/org/openecomp/sdc/enrichment/impl/tosca/PortMirroringEnricherTest.java
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/test/java/org/openecomp/sdc/enrichment/impl/tosca/PortMirroringEnricherTest.java
@@ -2,8 +2,6 @@
 
 import org.openecomp.sdc.datatypes.error.ErrorMessage;
 import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel;
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.BeforeClass;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
diff --git a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/types/LoggerServiceName.java b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/types/LoggerServiceName.java
index 08c957a..1a9d327 100644
--- a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/types/LoggerServiceName.java
+++ b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/types/LoggerServiceName.java
@@ -161,8 +161,14 @@
 
   CREATE_COMPONENT_DEPENDENCY_MODEL,
   GET_COMPONENT_DEPENDENCY_MODEL,
+  GET_LIST_COMPONENT_DEPENDENCY,
+  CREATE_COMPONENT_DEPENDENCY,
+  UPDATE_COMPONENT_DEPENDENCY,
+  DELETE_COMPONENT_DEPENDENCY,
+  GET_COMPONENT_DEPENDENCY,
 
-  Health_check
+  Health_check,
+  notifications
   ;
 
   public static String getServiceName(LoggerServiceName serviceName) {
diff --git a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/types/LoggerTragetServiceName.java b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/types/LoggerTragetServiceName.java
index 33573a5..ab7292a 100644
--- a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/types/LoggerTragetServiceName.java
+++ b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/types/LoggerTragetServiceName.java
@@ -128,6 +128,8 @@
   public static final String CREATE_TRANSLATED_FILE = "Create Translated File";
   public static final String CREATE_PACKAGE = "Create Package";
 
+  public static final String CREATE_VERSION = "Create Version";
+
   public static final String SELF_HEALING = "Self Healing";
   public static final String WRITE_ARTIFACT_XML = "Write Artifact To XML File";
 
diff --git a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/test/java/org/openecomp/sdc/logging/api/LoggerFactoryTest.java b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/test/java/org/openecomp/sdc/logging/api/LoggerFactoryTest.java
index aa04c50..4b3a1ba 100644
--- a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/test/java/org/openecomp/sdc/logging/api/LoggerFactoryTest.java
+++ b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/test/java/org/openecomp/sdc/logging/api/LoggerFactoryTest.java
@@ -21,7 +21,9 @@
 import java.lang.reflect.Field;
 import java.util.ServiceLoader;
 
-import static org.testng.Assert.*;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertNotNull;
 
 /**
  * @author evitaliy
diff --git a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/test/java/org/openecomp/sdc/logging/api/context/TaskFactoryTest.java b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/test/java/org/openecomp/sdc/logging/api/context/TaskFactoryTest.java
index 61e1819..f5c2187 100644
--- a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/test/java/org/openecomp/sdc/logging/api/context/TaskFactoryTest.java
+++ b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/test/java/org/openecomp/sdc/logging/api/context/TaskFactoryTest.java
@@ -4,7 +4,9 @@
 
 import java.util.ServiceLoader;
 
-import static org.testng.Assert.*;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertNotNull;
+import static org.testng.Assert.assertTrue;
 
 /**
  * @author evitaliy
diff --git a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-core/src/main/java/org/openecomp/sdc/logging/servlet/LoggingFilter.java b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-core/src/main/java/org/openecomp/sdc/logging/servlet/LoggingFilter.java
index f34d09e..0ca550a 100644
--- a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-core/src/main/java/org/openecomp/sdc/logging/servlet/LoggingFilter.java
+++ b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-core/src/main/java/org/openecomp/sdc/logging/servlet/LoggingFilter.java
@@ -20,7 +20,12 @@
 import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.slf4j.MDC;
 
-import javax.servlet.*;
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
 import javax.servlet.http.HttpServletRequest;
 import java.io.IOException;
 import java.net.InetAddress;
@@ -58,7 +63,7 @@
     private static final HostAddressCache HOST_ADDRESS = new HostAddressCache();
     private static final String UNKNOWN = "UNKNOWN";
 
-    private final static Logger LOGGER = LoggerFactory.getLogger(LoggingFilter.class);
+    private static final Logger LOGGER = LoggerFactory.getLogger(LoggingFilter.class);
 
     public void destroy() {
     }
@@ -80,7 +85,8 @@
 
             InetAddress host = HOST_ADDRESS.get();
 
-            String ipAddress, hostName;
+            String ipAddress;
+            String hostName;
             if (host == null) {
                 ipAddress = UNKNOWN;
                 hostName = UNKNOWN;
diff --git a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-core/src/test/java/org/openecomp/sdc/logging/context/MDCPropagationFactoryTest.java b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-core/src/test/java/org/openecomp/sdc/logging/context/MDCPropagationFactoryTest.java
index 8502d95..1fda9e8 100644
--- a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-core/src/test/java/org/openecomp/sdc/logging/context/MDCPropagationFactoryTest.java
+++ b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-core/src/test/java/org/openecomp/sdc/logging/context/MDCPropagationFactoryTest.java
@@ -22,7 +22,9 @@
 import java.util.UUID;
 import java.util.concurrent.atomic.AtomicBoolean;
 
-import static org.testng.Assert.*;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertNull;
+import static org.testng.Assert.assertTrue;
 
 /**
  * @author evitaliy
diff --git a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-core/src/test/java/org/openecomp/sdc/logging/servlet/LoggingFilterTest.java b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-core/src/test/java/org/openecomp/sdc/logging/servlet/LoggingFilterTest.java
index 57911a3..95a5421 100644
--- a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-core/src/test/java/org/openecomp/sdc/logging/servlet/LoggingFilterTest.java
+++ b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-core/src/test/java/org/openecomp/sdc/logging/servlet/LoggingFilterTest.java
@@ -20,7 +20,13 @@
 import org.testng.Assert;
 import org.testng.annotations.Test;
 
-import javax.servlet.*;
+import javax.servlet.FilterChain;
+import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletException;
+import javax.servlet.ServletInputStream;
+import javax.servlet.ServletOutputStream;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
 import java.io.BufferedReader;
 import java.io.IOException;
 import java.io.PrintWriter;
diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/EnrichedServiceModelDao.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/EnrichedServiceModelDao.java
index aa8cbee..3e5975d 100644
--- a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/EnrichedServiceModelDao.java
+++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/EnrichedServiceModelDao.java
@@ -22,9 +22,6 @@
 
 import org.openecomp.core.model.types.ServiceArtifact;
 import org.openecomp.sdc.versioning.dao.VersionableDao;
-import org.openecomp.sdc.versioning.dao.types.Version;
-
-import java.util.List;
 
 public interface EnrichedServiceModelDao<M, E> extends VersionableDao,ServiceModelDao<M, E>{
 
diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/EnrichedServiceArtifactEntity.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/EnrichedServiceArtifactEntity.java
index d3d125b..8736f36 100644
--- a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/EnrichedServiceArtifactEntity.java
+++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/EnrichedServiceArtifactEntity.java
@@ -16,14 +16,12 @@
 
 package org.openecomp.core.model.types;
 
-import com.google.common.io.ByteStreams;
-
 import com.datastax.driver.mapping.annotations.ClusteringColumn;
 import com.datastax.driver.mapping.annotations.Column;
 import com.datastax.driver.mapping.annotations.Frozen;
 import com.datastax.driver.mapping.annotations.PartitionKey;
 import com.datastax.driver.mapping.annotations.Table;
-
+import com.google.common.io.ByteStreams;
 import org.openecomp.sdc.datatypes.error.ErrorLevel;
 import org.openecomp.sdc.logging.context.impl.MdcDataErrorMessage;
 import org.openecomp.sdc.logging.types.LoggerConstants;
diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/EnrichedServiceTemplateEntity.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/EnrichedServiceTemplateEntity.java
index c837a70..f60c892 100644
--- a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/EnrichedServiceTemplateEntity.java
+++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/EnrichedServiceTemplateEntity.java
@@ -16,14 +16,12 @@
 
 package org.openecomp.core.model.types;
 
-import com.google.common.io.ByteStreams;
-
 import com.datastax.driver.mapping.annotations.ClusteringColumn;
 import com.datastax.driver.mapping.annotations.Column;
 import com.datastax.driver.mapping.annotations.Frozen;
 import com.datastax.driver.mapping.annotations.PartitionKey;
 import com.datastax.driver.mapping.annotations.Table;
-
+import com.google.common.io.ByteStreams;
 import org.openecomp.sdc.datatypes.error.ErrorLevel;
 import org.openecomp.sdc.logging.context.impl.MdcDataErrorMessage;
 import org.openecomp.sdc.logging.types.LoggerConstants;
diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/ServiceArtifactEntity.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/ServiceArtifactEntity.java
index 8385a5d..ddff54b 100644
--- a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/ServiceArtifactEntity.java
+++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/ServiceArtifactEntity.java
@@ -16,13 +16,12 @@
 
 package org.openecomp.core.model.types;
 
-import com.google.common.io.ByteStreams;
-
 import com.datastax.driver.mapping.annotations.ClusteringColumn;
 import com.datastax.driver.mapping.annotations.Column;
 import com.datastax.driver.mapping.annotations.Frozen;
 import com.datastax.driver.mapping.annotations.PartitionKey;
 import com.datastax.driver.mapping.annotations.Table;
+import com.google.common.io.ByteStreams;
 import org.openecomp.sdc.datatypes.error.ErrorLevel;
 import org.openecomp.sdc.logging.context.impl.MdcDataErrorMessage;
 import org.openecomp.sdc.logging.types.LoggerConstants;
diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/ServiceTemplateEntity.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/ServiceTemplateEntity.java
index 4897c2f..8f886c2 100644
--- a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/ServiceTemplateEntity.java
+++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/ServiceTemplateEntity.java
@@ -20,14 +20,12 @@
 
 package org.openecomp.core.model.types;
 
-import com.google.common.io.ByteStreams;
-
 import com.datastax.driver.mapping.annotations.ClusteringColumn;
 import com.datastax.driver.mapping.annotations.Column;
 import com.datastax.driver.mapping.annotations.Frozen;
 import com.datastax.driver.mapping.annotations.PartitionKey;
 import com.datastax.driver.mapping.annotations.Table;
-
+import com.google.common.io.ByteStreams;
 import org.openecomp.sdc.datatypes.error.ErrorLevel;
 import org.openecomp.sdc.logging.context.impl.MdcDataErrorMessage;
 import org.openecomp.sdc.logging.types.LoggerConstants;
diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/EnrichedServiceModelDaoImpl.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/EnrichedServiceModelDaoImpl.java
index 14eda9e..348a8ad 100644
--- a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/EnrichedServiceModelDaoImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/EnrichedServiceModelDaoImpl.java
@@ -23,13 +23,10 @@
 import org.openecomp.core.model.dao.EnrichedServiceArtifactDaoFactory;
 import org.openecomp.core.model.dao.EnrichedServiceModelDao;
 import org.openecomp.core.model.dao.EnrichedServiceTemplateDaoFactory;
-import org.openecomp.core.model.types.ServiceArtifact;
 import org.openecomp.core.model.types.ServiceElement;
 import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel;
 import org.openecomp.sdc.versioning.dao.types.Version;
 
-import java.util.List;
-
 public class EnrichedServiceModelDaoImpl extends AbstractServiceModelDao
     implements EnrichedServiceModelDao<ToscaServiceModel, ServiceElement> {
   public EnrichedServiceModelDaoImpl() {
diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/zusammen/EnrichedServiceModelDaoZusammenImpl.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/zusammen/EnrichedServiceModelDaoZusammenImpl.java
index d018c9a..3bd2881 100644
--- a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/zusammen/EnrichedServiceModelDaoZusammenImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/zusammen/EnrichedServiceModelDaoZusammenImpl.java
@@ -1,7 +1,6 @@
 package org.openecomp.sdc.model.impl.zusammen;
 
 import com.amdocs.zusammen.adaptor.inbound.api.types.item.ZusammenElement;
-import com.amdocs.zusammen.datatypes.Id;
 import com.amdocs.zusammen.datatypes.SessionContext;
 import com.amdocs.zusammen.datatypes.item.Action;
 import com.amdocs.zusammen.datatypes.item.ElementContext;
@@ -11,10 +10,13 @@
 import org.openecomp.core.utilities.file.FileUtils;
 import org.openecomp.core.zusammen.api.ZusammenAdaptor;
 import org.openecomp.core.zusammen.api.ZusammenUtil;
+import org.openecomp.sdc.datatypes.model.ElementType;
 import org.openecomp.sdc.logging.api.Logger;
 import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel;
 
+import static org.openecomp.core.zusammen.api.ZusammenUtil.buildStructuralElement;
+
 public class EnrichedServiceModelDaoZusammenImpl extends ServiceModelDaoZusammenImpl implements
     EnrichedServiceModelDao<ToscaServiceModel, ServiceElement> {
 
@@ -23,28 +25,31 @@
 
   public EnrichedServiceModelDaoZusammenImpl(ZusammenAdaptor zusammenAdaptor) {
     super(zusammenAdaptor);
-    this.name = StructureElement.EnrichedServiceModel.name();
+    this.elementType = ElementType.EnrichedServiceModel;
   }
 
   @Override
   public void storeExternalArtifact(ServiceArtifact serviceArtifact) {
-    ZusammenElement artifactElement = buildArtifactElement(serviceArtifact.getName(),
+    ZusammenElement artifact = buildArtifactElement(serviceArtifact.getName(),
         FileUtils.toByteArray(serviceArtifact.getContent()), Action.CREATE);
 
-    ZusammenElement artifactsElement =
-        buildStructuralElement(StructureElement.Artifacts.name(), null);
-    artifactsElement.addSubElement(artifactElement);
+    ZusammenElement artifacts = buildStructuralElement(ElementType.Artifacts, Action.IGNORE);
+    artifacts.addSubElement(artifact);
 
-    ZusammenElement enrichedServiceModelElement = buildStructuralElement(name, null);
-    enrichedServiceModelElement.addSubElement(artifactsElement);
+    ZusammenElement enrichedServiceModel = buildStructuralElement(elementType, Action.IGNORE);
+    enrichedServiceModel.addSubElement(artifacts);
+
+    ZusammenElement vspModel = buildStructuralElement(ElementType.VspModel, Action.IGNORE);
+    vspModel.addSubElement(enrichedServiceModel);
 
     SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(serviceArtifact.getVspId());
-    ElementContext elementContext = new ElementContext(itemId, getFirstVersionId(context, itemId));
+    ElementContext elementContext =
+        new ElementContext(serviceArtifact.getVspId(), serviceArtifact.getVersion().getId());
     zusammenAdaptor
-        .saveElement(context, elementContext, enrichedServiceModelElement, "add service artifact.");
+        .saveElement(context, elementContext, vspModel, "add service external artifact.");
 
-    logger.info("Finished adding artifact to service model for vsp id -> " +
+    logger.info(
+        "Finished adding artifact to enriched service model for VendorSoftwareProduct id -> {}",
         elementContext.getItemId().getValue());
   }
 }
diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/zusammen/ServiceModelDaoZusammenImpl.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/zusammen/ServiceModelDaoZusammenImpl.java
index b5e3627..4ae9353 100644
--- a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/zusammen/ServiceModelDaoZusammenImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/zusammen/ServiceModelDaoZusammenImpl.java
@@ -8,7 +8,6 @@
 import com.amdocs.zusammen.datatypes.item.Action;
 import com.amdocs.zusammen.datatypes.item.ElementContext;
 import com.amdocs.zusammen.datatypes.item.Info;
-import com.amdocs.zusammen.datatypes.item.ItemVersion;
 import org.apache.commons.io.IOUtils;
 import org.openecomp.core.model.dao.ServiceModelDao;
 import org.openecomp.core.model.errors.RetrieveServiceTemplateFromDbErrorBuilder;
@@ -17,14 +16,14 @@
 import org.openecomp.core.zusammen.api.ZusammenAdaptor;
 import org.openecomp.core.zusammen.api.ZusammenUtil;
 import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.datatypes.model.ElementType;
 import org.openecomp.sdc.logging.api.Logger;
 import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel;
 import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
 import org.openecomp.sdc.tosca.services.ToscaExtensionYamlUtil;
 import org.openecomp.sdc.versioning.dao.types.Version;
-import org.openecomp.sdc.versioning.dao.types.VersionStatus;
-import org.openecomp.core.converter.datatypes.Constants;
+import org.openecomp.types.ElementPropertyName;
 
 import java.io.ByteArrayInputStream;
 import java.util.Collection;
@@ -33,16 +32,20 @@
 import java.util.Optional;
 import java.util.stream.Collectors;
 
+import static org.openecomp.core.zusammen.api.ZusammenUtil.buildElement;
+import static org.openecomp.core.zusammen.api.ZusammenUtil.buildStructuralElement;
+
 public class ServiceModelDaoZusammenImpl
     implements ServiceModelDao<ToscaServiceModel, ServiceElement> {
+  private static final String BASE_PROPERTY = "base";
   private static final Logger logger = LoggerFactory.getLogger(ServiceModelDaoZusammenImpl.class);
 
   protected ZusammenAdaptor zusammenAdaptor;
-  protected String name;
+  protected ElementType elementType;
 
   public ServiceModelDaoZusammenImpl(ZusammenAdaptor zusammenAdaptor) {
     this.zusammenAdaptor = zusammenAdaptor;
-    this.name = StructureElement.ServiceModel.name();
+    this.elementType = ElementType.ServiceModel;
   }
 
   @Override
@@ -53,37 +56,128 @@
   @Override
   public ToscaServiceModel getServiceModel(String vspId, Version version) {
     SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(vspId);
-    ElementContext elementContext = new ElementContext(itemId, getFirstVersionId(context, itemId),
-        version.getStatus() == VersionStatus.Locked ? null : version.toString());
+    ElementContext elementContext = new ElementContext(vspId, version.getId());
 
-    Optional<ElementInfo> serviceModelElement = zusammenAdaptor
-        .getElementInfoByName(context, elementContext, null, name);
-
-    if (serviceModelElement.isPresent()) {
-      String entryDefinitionServiceTemplate =
-          serviceModelElement.get().getInfo().getProperty("base");
-      Id serviceModelElementId = serviceModelElement.get().getId();
-      Map<String, ServiceTemplate> serviceTemplates =
-          getTemplates(context, elementContext, serviceModelElementId);
-      if (serviceTemplates == null) {
-        return null;
-      }
-      FileContentHandler artifacts = getArtifacts(context, elementContext, serviceModelElementId);
-
-
-      return new ToscaServiceModel(
-          artifacts, serviceTemplates, entryDefinitionServiceTemplate);
-    } else {
+    Optional<ElementInfo> serviceModel = getServiceModelElementInfo(context, elementContext);
+    if (!serviceModel.isPresent()) {
       return null;
     }
+
+    Id serviceModelElementId = serviceModel.get().getId();
+    Map<String, ServiceTemplate> serviceTemplates =
+        getTemplates(context, elementContext, serviceModelElementId);
+    if (serviceTemplates == null) {
+      return null;
+    }
+
+    FileContentHandler artifacts = getArtifacts(context, elementContext, serviceModelElementId);
+    String entryDefinitionServiceTemplate =
+        serviceModel.get().getInfo().getProperty(BASE_PROPERTY);
+
+    return new ToscaServiceModel(artifacts, serviceTemplates, entryDefinitionServiceTemplate);
   }
 
-  protected Map<String, ServiceTemplate> getTemplates(SessionContext context,
-                                                      ElementContext elementContext,
-                                                      Id serviceModelElementId) {
+  @Override
+  public void storeServiceModel(String vspId, Version version, ToscaServiceModel serviceModel) {
+    logger.info("Storing service model for VendorSoftwareProduct id -> {}", vspId);
+
+    ZusammenElement templatesElement = buildStructuralElement(ElementType.Templates, Action.UPDATE);
+    serviceModel.getServiceTemplates().entrySet().forEach(entry -> templatesElement.addSubElement(
+        buildServiceTemplateElement(entry.getKey(), entry.getValue(),
+            serviceModel.getEntryDefinitionServiceTemplate(), Action.CREATE)));
+
+    ZusammenElement artifactsElement = buildStructuralElement(ElementType.Artifacts, Action.UPDATE);
+    if (Objects.nonNull(serviceModel.getArtifactFiles())) {
+      serviceModel.getArtifactFiles().getFiles().entrySet()
+          .forEach(entry -> artifactsElement.addSubElement(
+              buildArtifactElement(entry.getKey(), entry.getValue(), Action.CREATE)));
+    }
+
+    ZusammenElement serviceModelElement = buildStructuralElement(elementType, Action.UPDATE);
+    serviceModelElement.getInfo()
+        .addProperty(BASE_PROPERTY, serviceModel.getEntryDefinitionServiceTemplate());
+
+    serviceModelElement.addSubElement(templatesElement);
+    serviceModelElement.addSubElement(artifactsElement);
+
+    ZusammenElement vspModel = buildStructuralElement(ElementType.VspModel, Action.IGNORE);
+    vspModel.addSubElement(serviceModelElement);
+
+    SessionContext context = ZusammenUtil.createSessionContext();
+    ElementContext elementContext = new ElementContext(vspId, version.getId());
+    zusammenAdaptor.saveElement(context, elementContext, vspModel, "Store service model");
+
+    logger
+        .info("Finished storing {} for VendorSoftwareProduct id -> {}", elementType.name(), vspId);
+  }
+
+  @Override
+  public ServiceElement getServiceModelInfo(String vspId, Version version, String name) {
+    return null;
+  }
+
+  @Override
+  public void deleteAll(String vspId, Version version) {
+    logger.info("Started deleting content of Templates and Artifacts of {} of vsp {} version {}",
+        elementType.name(), vspId, version.getId());
+
+    SessionContext context = ZusammenUtil.createSessionContext();
+    ElementContext elementContext = new ElementContext(vspId, version.getId());
+
+    Optional<ElementInfo> serviceModel = getServiceModelElementInfo(context, elementContext);
+    if (!serviceModel.isPresent()) {
+      logger.info("{} of vsp {} version {} does not exist - nothing to delete", elementType.name(),
+          vspId, version.getId());
+      return;
+    }
+
+    ZusammenElement serviceModelElement = buildElement(serviceModel.get().getId(), Action.IGNORE);
+    for (Id serviceModelSubElementId :
+        serviceModel.get().getSubElements().stream()
+            .map(ElementInfo::getId)
+            .collect(Collectors.toSet())) {
+      ElementInfo serviceModelSubElementInfo =
+          zusammenAdaptor.getElementInfo(context, elementContext, serviceModelSubElementId)
+              .orElseThrow(() -> new IllegalStateException(String.format(
+                  "Element %s declared as sub element of element %s (%s) does not exist",
+                  serviceModelSubElementId.getValue(),
+                  serviceModel.get().getId().getValue(),
+                  elementType.name())));
+
+      if (ElementType.Templates.name().equals(serviceModelSubElementInfo.getInfo().getName())
+          || ElementType.Artifacts.name().equals(serviceModelSubElementInfo.getInfo().getName())) {
+        ZusammenElement serviceModelSubElement =
+            buildElement(serviceModelSubElementId, Action.IGNORE);
+        serviceModelSubElement.setSubElements(serviceModelSubElementInfo.getSubElements().stream()
+            .map(elementInfo -> buildElement(elementInfo.getId(), Action.DELETE))
+            .collect(Collectors.toSet()));
+        serviceModelElement.addSubElement(serviceModelSubElement);
+      }
+    }
+
+    zusammenAdaptor.saveElement(context, elementContext, serviceModelElement,
+        String.format("Delete content of Templates and Artifacts of %s", elementType.name()));
+
+    logger.info("Finished deleting content of Templates and Artifacts of {} of vsp {} version {}",
+        elementType.name(), vspId, version.getId());
+  }
+
+  private Optional<ElementInfo> getServiceModelElementInfo(SessionContext context,
+                                                           ElementContext elementContext) {
+    Collection<ElementInfo> vspModelSubs = zusammenAdaptor
+        .listElementsByName(context, elementContext, null, ElementType.VspModel.name());
+
+    return vspModelSubs.stream()
+        .filter(elementInfo -> elementInfo.getInfo() != null
+            && elementType.name().equals(elementInfo.getInfo().getName()))
+        .findFirst();
+  }
+
+  private Map<String, ServiceTemplate> getTemplates(SessionContext context,
+                                                    ElementContext elementContext,
+                                                    Id serviceModelElementId) {
     Optional<ElementInfo> templatesElementInfo = zusammenAdaptor.getElementInfoByName(
-        context, elementContext, serviceModelElementId, StructureElement.Templates.name());
+        context, elementContext, serviceModelElementId, ElementType.Templates.name());
 
     if (templatesElementInfo.isPresent()) {
       Collection<Element> elements = zusammenAdaptor.listElementData(context, elementContext,
@@ -96,10 +190,10 @@
     return null;
   }
 
-  protected FileContentHandler getArtifacts(SessionContext context, ElementContext elementContext,
-                                            Id serviceModelElementId) {
+  private FileContentHandler getArtifacts(SessionContext context, ElementContext elementContext,
+                                          Id serviceModelElementId) {
     Optional<ElementInfo> artifactsElement = zusammenAdaptor.getElementInfoByName(
-        context, elementContext, serviceModelElementId, StructureElement.Artifacts.name());
+        context, elementContext, serviceModelElementId, ElementType.Artifacts.name());
 
     if (artifactsElement.isPresent()) {
 
@@ -114,70 +208,34 @@
     return null;
   }
 
-  @Override
-  public void storeServiceModel(String vspId, Version version, ToscaServiceModel serviceModel) {
-    logger.info("Storing service model for vsp id -> " + vspId);
-
-    ZusammenElement templatesElement =
-        buildStructuralElement(StructureElement.Templates.name(), null);
-    serviceModel.getServiceTemplates().entrySet().forEach(entry -> templatesElement.addSubElement(
-        buildServiceTemplateElement(entry.getKey(), entry.getValue(),
-            serviceModel.getEntryDefinitionServiceTemplate(), Action.CREATE)));
-
-    ZusammenElement artifactsElement =
-        buildStructuralElement(StructureElement.Artifacts.name(), Action.UPDATE);
-    if (Objects.nonNull(serviceModel.getArtifactFiles())) {
-      serviceModel.getArtifactFiles().getFiles().entrySet().forEach(entry -> artifactsElement
-          .addSubElement(buildArtifactElement(entry.getKey(), entry.getValue(), Action.CREATE)));
-    }
-
-    ZusammenElement serviceModelElement = buildStructuralElement(name, Action.UPDATE);
-    serviceModelElement.getInfo()
-        .addProperty("base", serviceModel.getEntryDefinitionServiceTemplate());
-
-    serviceModelElement.addSubElement(templatesElement);
-    serviceModelElement.addSubElement(artifactsElement);
-
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(vspId);
-    ElementContext elementContext = new ElementContext(itemId, getFirstVersionId(context, itemId));
-    zusammenAdaptor
-        .saveElement(context, elementContext, serviceModelElement, "Store service model");
-
-    logger.info("Finished storing service model for vsp id -> " + vspId);
-  }
-
-  @Override
-  public ServiceElement getServiceModelInfo(String vspId, Version version, String name) {
-    return null;
-  }
-
-  @Override
-  public void deleteAll(String vspId, Version version) {
-    logger.info("started deleting service model for vsp id -> " + vspId);
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(vspId);
-    ElementContext elementContext = new ElementContext(itemId, getFirstVersionId(context, itemId));
-
-    ZusammenElement zusammenElement = ZusammenUtil.buildStructuralElement(name, Action.DELETE);
-    zusammenAdaptor.saveElement(context, elementContext, zusammenElement, "delete:" + name + ".");
-    logger.info("Finished deleting service model for vsp id -> " + vspId);
+  private Element buildServiceTemplateElement(String name, ServiceTemplate serviceTemplate,
+                                              String entryDefinitionServiceTemplate,
+                                              Action action) {
+    ZusammenElement zusammenElement = buildElement(null, action);
+    Info info = new Info();
+    info.setName(name);
+    info.setDescription(serviceTemplate.getDescription());
+    info.addProperty(ElementPropertyName.elementType.name(), ElementType.ServiceTemplate.name());
+    info.addProperty(BASE_PROPERTY, entryDefinitionServiceTemplate);
+    String yaml = new ToscaExtensionYamlUtil().objectToYaml(serviceTemplate);
+    zusammenElement.setData(new ByteArrayInputStream(yaml.getBytes()));
+    zusammenElement.setInfo(info);
+    return zusammenElement;
   }
 
   protected ZusammenElement buildArtifactElement(String name, byte[] artifact, Action action) {
-    ZusammenElement artifactElement = new ZusammenElement();
-    artifactElement.setAction(action);
+    ZusammenElement artifactElement = buildElement(null, action);
     Info info = new Info();
     info.setName(name);
-    info.addProperty("type", ElementType.Artifact.name());
+    info.addProperty(ElementPropertyName.elementType.name(), ElementType.Artifact.name());
     artifactElement.setInfo(info);
     artifactElement.setData(new ByteArrayInputStream(artifact));
 
     return artifactElement;
   }
 
-  private ServiceTemplate elementToServiceTemplate(Element element){
 
+  private ServiceTemplate elementToServiceTemplate(Element element) {
     try {
       String yamlContent = IOUtils.toString(element.getData());
       return new ToscaExtensionYamlUtil().
@@ -188,31 +246,4 @@
               element.getInfo().getName(), e.getMessage()).build());
     }
   }
-
-  private Element buildServiceTemplateElement(String name, ServiceTemplate serviceTemplate,
-                                              String entryDefinitionServiceTemplate,
-                                              Action action) {
-    ZusammenElement zusammenElement = new ZusammenElement();
-    zusammenElement.setAction(action);
-    Info info = new Info();
-    info.setName(name);
-    info.setDescription(serviceTemplate.getDescription());
-    info.addProperty("type", ElementType.Servicetemplate.name());
-    info.addProperty("base", entryDefinitionServiceTemplate);
-    String yaml = new ToscaExtensionYamlUtil().objectToYaml(serviceTemplate);
-    zusammenElement.setData(new ByteArrayInputStream(yaml.getBytes()));
-    zusammenElement.setInfo(info);
-    return zusammenElement;
-  }
-
-  protected Id getFirstVersionId(SessionContext context, Id vspId) {
-    Optional<ItemVersion> itemVersionOptional = zusammenAdaptor.getFirstVersion(context, vspId);
-    ItemVersion itemVersion = itemVersionOptional.orElseThrow(() ->
-        new RuntimeException(String.format("Vsp %s does not contain any version.", vspId))); //todo
-    return itemVersion.getId();
-  }
-
-  protected ZusammenElement buildStructuralElement(String structureElement, Action action) {
-    return ZusammenUtil.buildStructuralElement(structureElement, action);
-  }
 }
diff --git a/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/pom.xml b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/pom.xml
new file mode 100644
index 0000000..8e1c293
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/pom.xml
@@ -0,0 +1,20 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <name>openecomp-sdc-notification-api</name>
+    <artifactId>openecomp-sdc-notification-api</artifactId>
+    <parent>
+        <groupId>org.openecomp.sdc</groupId>
+        <artifactId>openecomp-sdc-lib</artifactId>
+        <version>1.2.0-SNAPSHOT</version>
+        <relativePath>../..</relativePath>
+    </parent>
+    <dependencies>
+        <dependency>
+            <groupId>org.openecomp.sdc.core</groupId>
+            <artifactId>openecomp-nosqldb-core</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
+</project>
diff --git a/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/src/main/java/org/openecomp/sdc/destinationprovider/DestinationProvider.java b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/src/main/java/org/openecomp/sdc/destinationprovider/DestinationProvider.java
new file mode 100644
index 0000000..0c6dfc8
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/src/main/java/org/openecomp/sdc/destinationprovider/DestinationProvider.java
@@ -0,0 +1,11 @@
+package org.openecomp.sdc.destinationprovider;
+
+import java.util.List;
+
+/**
+ * @author avrahamg
+ * @since July 09, 2017
+ */
+public interface DestinationProvider {
+    List<String> getSubscribers();
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspCreationDto.java b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/src/main/java/org/openecomp/sdc/notification/dao/LastNotificationDao.java
similarity index 71%
copy from openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspCreationDto.java
copy to openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/src/main/java/org/openecomp/sdc/notification/dao/LastNotificationDao.java
index f77005f..f0bf7e8 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspCreationDto.java
+++ b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/src/main/java/org/openecomp/sdc/notification/dao/LastNotificationDao.java
@@ -7,9 +7,9 @@
  * 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.
@@ -18,19 +18,17 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.sdcrests.vendorsoftwareproducts.types;
+package org.openecomp.sdc.notification.dao;
 
-/**
- * Created by TALIO on 4/26/2016.
- */
-public class VspCreationDto {
-  private String vspId;
+import org.openecomp.core.dao.BaseDao;
+import org.openecomp.sdc.notification.dao.types.LastSeenNotificationEntity;
 
-  public String getVspId() {
-    return vspId;
-  }
+import java.util.UUID;
 
-  public void setVspId(String vspId) {
-    this.vspId = vspId;
-  }
+public interface LastNotificationDao extends BaseDao<LastSeenNotificationEntity> {
+
+  UUID getOwnerLastEventId(String ownerId);
+
+  void persistOwnerLastEventId(String ownerId, UUID eventId);
+
 }
diff --git a/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/src/main/java/org/openecomp/sdc/notification/dao/NotificationsDao.java b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/src/main/java/org/openecomp/sdc/notification/dao/NotificationsDao.java
new file mode 100644
index 0000000..6542d70
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/src/main/java/org/openecomp/sdc/notification/dao/NotificationsDao.java
@@ -0,0 +1,49 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * 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=========================================================
+ */
+
+package org.openecomp.sdc.notification.dao;
+
+import org.openecomp.core.dao.BaseDao;
+import org.openecomp.sdc.notification.dao.types.NotificationEntity;
+import org.openecomp.sdc.notification.dtos.NotificationsStatus;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.UUID;
+
+
+public interface NotificationsDao extends BaseDao<NotificationEntity> {
+
+    int DEFAULT_LIMIT_OF_RESULTS_FOR_OWNER_NOTIFICATIONS = 1000;
+
+    List<NotificationEntity> getNotificationsByOwnerId(String ownerId, int limit);
+
+    List<NotificationEntity> getNewNotificationsByOwnerId(String ownerId, UUID eventId);
+
+    List<NotificationEntity> getNewNotificationsByOwnerId(String ownerId, UUID eventId, int limit);
+
+    NotificationsStatus getNotificationsStatus(String ownerId, UUID lastSeenNotification, int numOfRecordsToReturn);
+
+    NotificationsStatus getNotificationsStatus(String ownerId, UUID lastSeenNotification, int numOfRecordsToReturn, UUID prevLastNotification);
+
+	void markNotificationAsRead(String ownerId, Collection<UUID> eventIds);
+
+    void createBatch(List<NotificationEntity> notificationEntities);
+}
diff --git a/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activityLog/ActivityLogManager.java b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/src/main/java/org/openecomp/sdc/notification/dao/SubscribersDao.java
similarity index 70%
copy from openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activityLog/ActivityLogManager.java
copy to openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/src/main/java/org/openecomp/sdc/notification/dao/SubscribersDao.java
index a40e101..3daf165 100644
--- a/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activityLog/ActivityLogManager.java
+++ b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/src/main/java/org/openecomp/sdc/notification/dao/SubscribersDao.java
@@ -18,14 +18,20 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.sdc.activityLog;
+package org.openecomp.sdc.notification.dao;
 
-import org.openecomp.sdc.activitylog.dao.type.ActivityLogEntity;
-import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.core.dao.BaseDao;
+import org.openecomp.sdc.notification.dao.types.SubscribersEntity;
 
-import java.util.Collection;
+import java.util.Set;
 
-public interface ActivityLogManager {
-    void addActionLog(ActivityLogEntity activityLogEntity, String user);
-    Collection<ActivityLogEntity> listActivityLogs(String itemId, Version versionId, String user);
+
+public interface SubscribersDao extends BaseDao<SubscribersEntity> {
+
+    void subscribe(String ownerId, String entityId);
+
+    void unsubscribe(String ownerId, String entityId);
+
+    Set<String> getSubscribers(String entityId);
+
 }
diff --git a/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/src/main/java/org/openecomp/sdc/notification/dao/types/LastSeenNotificationEntity.java b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/src/main/java/org/openecomp/sdc/notification/dao/types/LastSeenNotificationEntity.java
new file mode 100644
index 0000000..d6e717d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/src/main/java/org/openecomp/sdc/notification/dao/types/LastSeenNotificationEntity.java
@@ -0,0 +1,103 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * 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=========================================================
+ */
+
+package org.openecomp.sdc.notification.dao.types;
+
+import com.datastax.driver.mapping.annotations.Column;
+import com.datastax.driver.mapping.annotations.PartitionKey;
+import com.datastax.driver.mapping.annotations.Table;
+
+import java.util.Objects;
+import java.util.UUID;
+
+@Table(keyspace = "dox", name = "last_notification")
+public class LastSeenNotificationEntity {
+  public static final String ENTITY_TYPE = "Event Notification";
+
+  @PartitionKey
+  @Column(name = "owner_id")
+  private String ownerId;
+
+  @Column(name = "event_id")
+  private UUID lastEventId;
+
+  public LastSeenNotificationEntity() {
+  }
+
+  /**
+   * Instantiates a new Notification entity.
+   *
+   * @param ownerId      the owner id
+   * @param lastEventId  the last event id
+   */
+  public LastSeenNotificationEntity(String ownerId, UUID lastEventId) {
+    this.ownerId = ownerId;
+    this.lastEventId = lastEventId;
+  }
+
+  public String getOwnerId() {
+    return ownerId;
+  }
+
+  public void setOwnerId(String ownerId) {
+    this.ownerId = ownerId;
+  }
+
+  public UUID getLastEventId() {
+    return lastEventId;
+  }
+
+  public void setLastEventId(UUID lastEventId) {
+    this.lastEventId = lastEventId;
+  }
+
+  @Override
+  public boolean equals(Object other) {
+    if (Objects.equals(this, other)) {
+      return true;
+    }
+
+    if (Objects.equals(getClass(), other.getClass())) {
+      return false;
+    }
+
+    LastSeenNotificationEntity that = (LastSeenNotificationEntity) other;
+
+    if (Objects.equals(ownerId, that.ownerId)) {
+      return false;
+    }
+
+    return !Objects.equals(lastEventId, that.lastEventId);
+  }
+
+  @Override
+  public int hashCode() {
+    int result = ownerId != null ? ownerId.hashCode() : 0;
+    result = 31 * result + (lastEventId != null ? lastEventId.hashCode() : 0);
+    return result;
+  }
+
+  @Override
+  public String toString() {
+    return "LastSeenNotificationEntity {"
+        + "ownerId='" + ownerId + '\''
+       + '}';
+  }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/src/main/java/org/openecomp/sdc/notification/dao/types/NotificationEntity.java b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/src/main/java/org/openecomp/sdc/notification/dao/types/NotificationEntity.java
new file mode 100644
index 0000000..5237707
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/src/main/java/org/openecomp/sdc/notification/dao/types/NotificationEntity.java
@@ -0,0 +1,188 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * 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=========================================================
+ */
+
+package org.openecomp.sdc.notification.dao.types;
+
+import com.datastax.driver.mapping.annotations.ClusteringColumn;
+import com.datastax.driver.mapping.annotations.Column;
+import com.datastax.driver.mapping.annotations.PartitionKey;
+import com.datastax.driver.mapping.annotations.Table;
+
+import java.util.Objects;
+import java.util.UUID;
+
+@Table(keyspace = "dox", name = "notifications")
+public class NotificationEntity {
+
+  public static final String ENTITY_TYPE = "Event Notification";
+
+  @PartitionKey
+  @Column(name = "owner_id")
+  private String ownerId;
+
+  @Column(name = "read")
+  private boolean read;
+
+  @ClusteringColumn
+  @Column(name = "event_id")
+  private UUID eventId;
+
+  @Column(name = "event_type")
+  private String eventType;
+
+  @Column(name = "event_attributes")
+  private String eventAttributes;
+
+  @Column(name = "originator_id")
+  private String originatorId;
+
+  public NotificationEntity() {
+  }
+
+  public NotificationEntity(String ownerId) {
+    this.ownerId = ownerId;
+  }
+
+  /**
+   * Instantiates a new Notification entity.
+   *
+   * @param ownerId      the owner id
+   * @param eventId      the event id
+   * @param eventType    the event type
+   * @param originatorId the originator id
+   */
+  public NotificationEntity(String ownerId, UUID eventId, String eventType, String originatorId, boolean read, String eventAttributes) {
+    this.ownerId = ownerId;
+    this.read = read;
+    this.eventId = eventId;
+    this.eventType = eventType;
+    this.originatorId = originatorId;
+    this.eventAttributes = eventAttributes;
+  }
+
+  public NotificationEntity(String ownerId, UUID eventId, String eventType, String originatorId) {
+		this(ownerId, eventId, eventType, originatorId, false, null);
+  }
+
+  public NotificationEntity(String ownerId, UUID eventId) {
+		this(ownerId, eventId, null, null);
+  }
+
+  public String getOwnerId() {
+    return ownerId;
+  }
+
+  public void setOwnerId(String ownerId) {
+    this.ownerId = ownerId;
+  }
+
+  public boolean isRead() {
+    return read;
+  }
+
+  public void setRead(boolean read) {
+    this.read = read;
+  }
+
+  public UUID getEventId() {
+    return eventId;
+  }
+
+  public void setEventId(UUID eventId) {
+    this.eventId = eventId;
+  }
+
+  public String getEventType() {
+    return eventType;
+  }
+
+  public void setEventType(String eventType) {
+    this.eventType = eventType;
+  }
+
+  public String getEventAttributes() {
+    return eventAttributes;
+  }
+
+  public void setEventAttributes(String eventAttributes) {
+    this.eventAttributes = eventAttributes;
+  }
+
+  public String getOriginatorId() {
+    return originatorId;
+  }
+
+  public void setOriginatorId(String originatorId) {
+    this.originatorId = originatorId;
+  }
+
+  @Override
+  public boolean equals(Object other) {
+    if (Objects.equals(this, other)) {
+      return true;
+    }
+
+    if (Objects.equals(getClass(), other.getClass())) {
+      return false;
+    }
+
+    NotificationEntity that = (NotificationEntity) other;
+
+    if (Objects.equals(ownerId, that.ownerId)) {
+      return false;
+    }
+    if (read != that.read) {
+      return false;
+    }
+    if (Objects.equals(eventId, that.eventId)) {
+      return false;
+    }
+    if (Objects.equals(eventType, that.eventType)) {
+      return false;
+    }
+    if (Objects.equals(eventAttributes, that.eventAttributes)) {
+      return false;
+    }
+    if (Objects.equals(originatorId, that.originatorId)) {
+      return false;
+    }
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    int result = ownerId != null ? ownerId.hashCode() : 0;
+    result = 31 * result + (eventId != null ? eventId.hashCode() : 0);
+    return result;
+  }
+
+  @Override
+  public String toString() {
+    return "NotificationEntity {"
+        + "ownerId='" + ownerId + '\''
+        + ", state='" + (read ? "Read" : "Noread") + '\''
+        + ", originatorId='" + originatorId + '\''
+        + ", eventId='" + eventId + '\''
+        + ", eventType='" + eventType + '\''
+        + ", eventAttributes='" + eventAttributes + '\''
+        + '}';
+  }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/src/main/java/org/openecomp/sdc/notification/dao/types/SubscribersEntity.java b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/src/main/java/org/openecomp/sdc/notification/dao/types/SubscribersEntity.java
new file mode 100644
index 0000000..d858cbd
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/src/main/java/org/openecomp/sdc/notification/dao/types/SubscribersEntity.java
@@ -0,0 +1,68 @@
+package org.openecomp.sdc.notification.dao.types;
+
+import com.datastax.driver.mapping.annotations.Column;
+import com.datastax.driver.mapping.annotations.PartitionKey;
+import com.datastax.driver.mapping.annotations.Table;
+
+import java.util.Objects;
+import java.util.Set;
+
+import static java.util.Objects.hash;
+
+@Table(keyspace = "dox", name = "notification_subscribers")
+public class SubscribersEntity {
+
+    @PartitionKey
+    @Column(name = "entity_id")
+    private String entityId;
+
+    @Column(name = "subscribers")
+    private Set<String> subscribers;
+
+
+    public SubscribersEntity() {
+    }
+
+    public SubscribersEntity(String entityId, Set<String> subscribers) {
+        this.entityId = entityId;
+        this.subscribers = subscribers;
+    }
+
+    public String getEntityId() {
+        return entityId;
+    }
+
+    public void setEntityId(String entityId) {
+        this.entityId = entityId;
+    }
+
+    public Set<String> getSubscribers() {
+        return subscribers;
+    }
+
+    public void setSubscribers(Set<String> subscribers) {
+        this.subscribers = subscribers;
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+        SubscribersEntity that = (SubscribersEntity) o;
+        return Objects.equals(entityId, that.entityId) &&
+                Objects.equals(subscribers, that.subscribers);
+    }
+
+    @Override
+    public int hashCode() {
+        return hash(entityId, subscribers);
+    }
+
+    @Override
+    public String toString() {
+        return "SubscribersEntity{" +
+                "entityId='" + entityId + '\'' +
+                ", subscribers=" + subscribers +
+                '}';
+    }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/src/main/java/org/openecomp/sdc/notification/dtos/Event.java b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/src/main/java/org/openecomp/sdc/notification/dtos/Event.java
new file mode 100644
index 0000000..f7a181e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/src/main/java/org/openecomp/sdc/notification/dtos/Event.java
@@ -0,0 +1,14 @@
+package org.openecomp.sdc.notification.dtos;
+
+import java.util.Map;
+
+public interface Event {
+
+    String getEventType();
+
+    String getOriginatorId();
+
+    Map<String, Object> getAttributes();
+
+    String getEntityId();
+}
diff --git a/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/src/main/java/org/openecomp/sdc/notification/dtos/NotificationsStatus.java b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/src/main/java/org/openecomp/sdc/notification/dtos/NotificationsStatus.java
new file mode 100644
index 0000000..1620569
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/src/main/java/org/openecomp/sdc/notification/dtos/NotificationsStatus.java
@@ -0,0 +1,24 @@
+package org.openecomp.sdc.notification.dtos;
+
+import org.openecomp.sdc.notification.dao.types.NotificationEntity;
+
+import java.util.List;
+import java.util.UUID;
+
+/**
+ * @author Avrahamg
+ * @since June 26, 2017
+ */
+public interface NotificationsStatus {
+
+  List<NotificationEntity> getNotifications();
+
+  List<UUID> getNewEntries();
+
+  UUID getLastScanned();
+
+  UUID getEndOfPage();
+
+  long getNumOfNotSeenNotifications();
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/src/main/java/org/openecomp/sdc/notification/exceptons/NotificationNotExistException.java b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/src/main/java/org/openecomp/sdc/notification/exceptons/NotificationNotExistException.java
new file mode 100644
index 0000000..90e53ea
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/src/main/java/org/openecomp/sdc/notification/exceptons/NotificationNotExistException.java
@@ -0,0 +1,18 @@
+package org.openecomp.sdc.notification.exceptons;
+
+/**
+ * @author avrahamg
+ * @since July 02, 2017
+ */
+public class NotificationNotExistException extends Exception {
+    private String message;
+
+
+    public NotificationNotExistException(String Message){
+        this(Message, null);
+    }
+    public NotificationNotExistException(String message, Throwable cause) {
+        super(cause);
+        this.message = message;
+    }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VendorSoftwareProductDaoFactory.java b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/src/main/java/org/openecomp/sdc/notification/factories/LastNotificationDaoFactory.java
similarity index 75%
rename from openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VendorSoftwareProductDaoFactory.java
rename to openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/src/main/java/org/openecomp/sdc/notification/factories/LastNotificationDaoFactory.java
index 32070fe..6e6f9f0 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VendorSoftwareProductDaoFactory.java
+++ b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/src/main/java/org/openecomp/sdc/notification/factories/LastNotificationDaoFactory.java
@@ -7,9 +7,9 @@
  * 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.
@@ -18,18 +18,17 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.sdc.vendorsoftwareproduct.dao;
+package org.openecomp.sdc.notification.factories;
 
 import org.openecomp.core.factory.api.AbstractComponentFactory;
 import org.openecomp.core.factory.api.AbstractFactory;
+import org.openecomp.sdc.notification.dao.LastNotificationDao;
 
 
-public abstract class VendorSoftwareProductDaoFactory extends
-    AbstractComponentFactory<VendorSoftwareProductDao> {
+public abstract class LastNotificationDaoFactory extends AbstractComponentFactory<LastNotificationDao> {
 
-
-  public static VendorSoftwareProductDaoFactory getInstance() {
-    return AbstractFactory.getInstance(VendorSoftwareProductDaoFactory.class);
+  public static LastNotificationDaoFactory getInstance() {
+    return AbstractFactory.getInstance(LastNotificationDaoFactory.class);
   }
 
 }
diff --git a/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/src/main/java/org/openecomp/sdc/notification/factories/NotificationPropagationManagerFactory.java b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/src/main/java/org/openecomp/sdc/notification/factories/NotificationPropagationManagerFactory.java
new file mode 100644
index 0000000..356055e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/src/main/java/org/openecomp/sdc/notification/factories/NotificationPropagationManagerFactory.java
@@ -0,0 +1,15 @@
+package org.openecomp.sdc.notification.factories;
+
+import org.openecomp.core.factory.api.AbstractComponentFactory;
+import org.openecomp.core.factory.api.AbstractFactory;
+import org.openecomp.sdc.notification.services.NotificationPropagationManager;
+
+public abstract class NotificationPropagationManagerFactory extends AbstractComponentFactory<NotificationPropagationManager> {
+
+
+    public static NotificationPropagationManagerFactory getInstance() {
+        return AbstractFactory.getInstance(NotificationPropagationManagerFactory.class);
+    }
+
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/UploadDataDaoFactory.java b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/src/main/java/org/openecomp/sdc/notification/factories/NotificationsDaoFactory.java
similarity index 75%
copy from openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/UploadDataDaoFactory.java
copy to openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/src/main/java/org/openecomp/sdc/notification/factories/NotificationsDaoFactory.java
index 9654551..341af7e 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/UploadDataDaoFactory.java
+++ b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/src/main/java/org/openecomp/sdc/notification/factories/NotificationsDaoFactory.java
@@ -7,9 +7,9 @@
  * 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.
@@ -18,14 +18,17 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.sdc.vendorsoftwareproduct.dao;
+package org.openecomp.sdc.notification.factories;
 
 import org.openecomp.core.factory.api.AbstractComponentFactory;
 import org.openecomp.core.factory.api.AbstractFactory;
+import org.openecomp.sdc.notification.dao.NotificationsDao;
 
-public abstract class UploadDataDaoFactory extends AbstractComponentFactory<UploadDataDao> {
 
-  public static UploadDataDaoFactory getInstance() {
-    return AbstractFactory.getInstance(UploadDataDaoFactory.class);
+public abstract class NotificationsDaoFactory extends AbstractComponentFactory<NotificationsDao> {
+
+  public static NotificationsDaoFactory getInstance() {
+    return AbstractFactory.getInstance(NotificationsDaoFactory.class);
   }
+
 }
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/UploadDataDaoFactory.java b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/src/main/java/org/openecomp/sdc/notification/factories/NotificationsServiceFactory.java
similarity index 74%
copy from openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/UploadDataDaoFactory.java
copy to openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/src/main/java/org/openecomp/sdc/notification/factories/NotificationsServiceFactory.java
index 9654551..eab2618 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/UploadDataDaoFactory.java
+++ b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/src/main/java/org/openecomp/sdc/notification/factories/NotificationsServiceFactory.java
@@ -7,9 +7,9 @@
  * 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.
@@ -18,14 +18,17 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.sdc.vendorsoftwareproduct.dao;
+package org.openecomp.sdc.notification.factories;
 
 import org.openecomp.core.factory.api.AbstractComponentFactory;
 import org.openecomp.core.factory.api.AbstractFactory;
+import org.openecomp.sdc.notification.services.NotificationsService;
 
-public abstract class UploadDataDaoFactory extends AbstractComponentFactory<UploadDataDao> {
 
-  public static UploadDataDaoFactory getInstance() {
-    return AbstractFactory.getInstance(UploadDataDaoFactory.class);
+public abstract class NotificationsServiceFactory extends AbstractComponentFactory<NotificationsService> {
+
+  public static NotificationsServiceFactory getInstance() {
+    return AbstractFactory.getInstance(NotificationsServiceFactory.class);
   }
+
 }
diff --git a/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/src/main/java/org/openecomp/sdc/notification/factories/PropagationServiceFactory.java b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/src/main/java/org/openecomp/sdc/notification/factories/PropagationServiceFactory.java
new file mode 100644
index 0000000..e82783c
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/src/main/java/org/openecomp/sdc/notification/factories/PropagationServiceFactory.java
@@ -0,0 +1,15 @@
+package org.openecomp.sdc.notification.factories;
+
+import org.openecomp.core.factory.api.AbstractComponentFactory;
+import org.openecomp.core.factory.api.AbstractFactory;
+import org.openecomp.sdc.notification.services.PropagationService;
+
+public abstract class PropagationServiceFactory extends AbstractComponentFactory<PropagationService> {
+
+
+    public static PropagationServiceFactory getInstance() {
+        return AbstractFactory.getInstance(PropagationServiceFactory.class);
+    }
+
+
+}
diff --git a/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activityLog/ActivityLogManagerFactory.java b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/src/main/java/org/openecomp/sdc/notification/factories/SubscribersDaoFactory.java
similarity index 76%
copy from openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activityLog/ActivityLogManagerFactory.java
copy to openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/src/main/java/org/openecomp/sdc/notification/factories/SubscribersDaoFactory.java
index 9816b76..33b62e2 100644
--- a/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activityLog/ActivityLogManagerFactory.java
+++ b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/src/main/java/org/openecomp/sdc/notification/factories/SubscribersDaoFactory.java
@@ -17,15 +17,18 @@
  * limitations under the License.
  * ============LICENSE_END=========================================================
  */
-package org.openecomp.sdc.activityLog;
+
+package org.openecomp.sdc.notification.factories;
 
 import org.openecomp.core.factory.api.AbstractComponentFactory;
 import org.openecomp.core.factory.api.AbstractFactory;
-import org.openecomp.sdc.activityLog.ActivityLogManager;
+import org.openecomp.sdc.notification.dao.SubscribersDao;
 
 
-public abstract class ActivityLogManagerFactory extends AbstractComponentFactory<ActivityLogManager> {
-    public static ActivityLogManagerFactory getInstance() {
-        return AbstractFactory.getInstance(ActivityLogManagerFactory.class);
+public abstract class SubscribersDaoFactory extends AbstractComponentFactory<SubscribersDao> {
+
+    public static SubscribersDaoFactory getInstance() {
+        return AbstractFactory.getInstance(SubscribersDaoFactory.class);
     }
+
 }
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VendorSoftwareProductDaoFactory.java b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/src/main/java/org/openecomp/sdc/notification/factories/SubscriptionServiceFactory.java
similarity index 74%
copy from openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VendorSoftwareProductDaoFactory.java
copy to openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/src/main/java/org/openecomp/sdc/notification/factories/SubscriptionServiceFactory.java
index 32070fe..3e789c2 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VendorSoftwareProductDaoFactory.java
+++ b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/src/main/java/org/openecomp/sdc/notification/factories/SubscriptionServiceFactory.java
@@ -7,9 +7,9 @@
  * 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.
@@ -18,18 +18,17 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.sdc.vendorsoftwareproduct.dao;
+package org.openecomp.sdc.notification.factories;
 
 import org.openecomp.core.factory.api.AbstractComponentFactory;
 import org.openecomp.core.factory.api.AbstractFactory;
+import org.openecomp.sdc.notification.services.SubscriptionService;
 
 
-public abstract class VendorSoftwareProductDaoFactory extends
-    AbstractComponentFactory<VendorSoftwareProductDao> {
+public abstract class SubscriptionServiceFactory extends AbstractComponentFactory<SubscriptionService> {
 
-
-  public static VendorSoftwareProductDaoFactory getInstance() {
-    return AbstractFactory.getInstance(VendorSoftwareProductDaoFactory.class);
-  }
+    public static SubscriptionServiceFactory getInstance() {
+        return AbstractFactory.getInstance(SubscriptionServiceFactory.class);
+    }
 
 }
diff --git a/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/src/main/java/org/openecomp/sdc/notification/services/NotificationPropagationManager.java b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/src/main/java/org/openecomp/sdc/notification/services/NotificationPropagationManager.java
new file mode 100644
index 0000000..7a1596e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/src/main/java/org/openecomp/sdc/notification/services/NotificationPropagationManager.java
@@ -0,0 +1,12 @@
+package org.openecomp.sdc.notification.services;
+
+import org.openecomp.sdc.notification.dtos.Event;
+
+/**
+ * @author avrahamg
+ * @since July 09, 2017
+ */
+public interface NotificationPropagationManager {
+    void notifySubscribers(Event event, String ... excludedSubscribers);
+    void directNotification(Event event, String destinationId);
+}
diff --git a/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/src/main/java/org/openecomp/sdc/notification/services/NotificationsService.java b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/src/main/java/org/openecomp/sdc/notification/services/NotificationsService.java
new file mode 100644
index 0000000..17cfac1
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/src/main/java/org/openecomp/sdc/notification/services/NotificationsService.java
@@ -0,0 +1,31 @@
+package org.openecomp.sdc.notification.services;
+
+import org.openecomp.sdc.notification.dao.types.LastSeenNotificationEntity;
+import org.openecomp.sdc.notification.dao.types.NotificationEntity;
+import org.openecomp.sdc.notification.dtos.NotificationsStatus;
+import org.openecomp.sdc.notification.exceptons.NotificationNotExistException;
+
+import java.util.List;
+import java.util.UUID;
+
+/**
+ * @author Avrahamg
+ * @since June 22, 2017
+ */
+public interface NotificationsService {
+
+	LastSeenNotificationEntity getLastNotification(String ownerId);
+
+	NotificationsStatus getNotificationsStatus(String ownerId, UUID lastDelivered, int numOfRecordsToReturn, UUID endOfPage);
+
+	void updateLastSeenNotification(String ownerId, UUID eventId);
+
+	void markAsRead(String ownerId, String notificationId) throws NotificationNotExistException;
+
+    List<NotificationEntity> getNotificationsByOwnerId(String ownerId, int limit);
+
+    List<NotificationEntity> getNewNotificationsByOwnerId(String ownerId, UUID eventId);
+
+    List<NotificationEntity> getNewNotificationsByOwnerId(String ownerId, UUID eventId, int limit);
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/src/main/java/org/openecomp/sdc/notification/services/PropagationService.java b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/src/main/java/org/openecomp/sdc/notification/services/PropagationService.java
new file mode 100644
index 0000000..c084aa8
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/src/main/java/org/openecomp/sdc/notification/services/PropagationService.java
@@ -0,0 +1,9 @@
+package org.openecomp.sdc.notification.services;
+
+import org.openecomp.sdc.destinationprovider.DestinationProvider;
+import org.openecomp.sdc.notification.dtos.Event;
+
+public interface PropagationService {
+
+    void notify(Event event, DestinationProvider destinationProvider);
+}
diff --git a/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/src/main/java/org/openecomp/sdc/notification/services/SubscriptionService.java b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/src/main/java/org/openecomp/sdc/notification/services/SubscriptionService.java
new file mode 100644
index 0000000..98cd458
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-api/src/main/java/org/openecomp/sdc/notification/services/SubscriptionService.java
@@ -0,0 +1,15 @@
+package org.openecomp.sdc.notification.services;
+
+import java.util.Set;
+
+/**
+ * @author avrahamg
+ * @since July 09, 2017
+ */
+public interface SubscriptionService {
+    void subscribe(String ownerId, String entityId);
+
+    void unsubscribe(String ownerId, String entityId);
+
+    Set<String> getSubscribers(String entityId);
+}
diff --git a/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/pom.xml b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/pom.xml
new file mode 100644
index 0000000..4fe33ea
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/pom.xml
@@ -0,0 +1,42 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <name>openecomp-sdc-notification-core</name>
+    <artifactId>openecomp-sdc-notification-core</artifactId>
+
+
+    <parent>
+        <groupId>org.openecomp.sdc</groupId>
+        <artifactId>openecomp-sdc-lib</artifactId>
+        <version>1.2.0-SNAPSHOT</version>
+        <relativePath>../..</relativePath>
+    </parent>
+    <dependencies>
+        <dependency>
+            <groupId>org.openecomp.sdc</groupId>
+            <artifactId>openecomp-sdc-notification-api</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.mockito</groupId>
+            <artifactId>mockito-all</artifactId>
+            <scope>test</scope>
+            <version>1.10.19</version>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+            <version>${junit.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.powermock</groupId>
+            <artifactId>powermock-module-junit4</artifactId>
+            <version>1.6.5</version>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+
+</project>
diff --git a/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/main/java/org/openecomp/sdc/destinationprovider/impl/MulticastDestination.java b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/main/java/org/openecomp/sdc/destinationprovider/impl/MulticastDestination.java
new file mode 100644
index 0000000..431f9c1
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/main/java/org/openecomp/sdc/destinationprovider/impl/MulticastDestination.java
@@ -0,0 +1,44 @@
+package org.openecomp.sdc.destinationprovider.impl;
+
+import org.apache.commons.lang3.ArrayUtils;
+import org.openecomp.sdc.destinationprovider.DestinationProvider;
+import org.openecomp.sdc.notification.services.SubscriptionService;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @author avrahamg
+ * @since July 09, 2017
+ */
+public class MulticastDestination implements DestinationProvider {
+
+    private String entityId;
+    private SubscriptionService subscriptionService;
+    private String[] excludedSubscribers;
+
+    public MulticastDestination(String entityId, SubscriptionService subscriptionService,
+                                String... excludedSubscribers) {
+        this.entityId = entityId;
+        this.excludedSubscribers = excludedSubscribers;
+        this.subscriptionService = subscriptionService;
+    }
+
+    public List<String> getSubscribers() {
+        ArrayList<String> subscribers = new ArrayList<>(subscriptionService.getSubscribers(entityId));
+        if (ArrayUtils.isNotEmpty(excludedSubscribers)) {
+            subscribers.removeAll(Arrays.asList(excludedSubscribers));
+        }
+        return Collections.unmodifiableList(subscribers);
+    }
+
+    public String getEntityId() {
+        return entityId;
+    }
+
+    public void setEntityId(String entityId) {
+        this.entityId = entityId;
+    }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/main/java/org/openecomp/sdc/destinationprovider/impl/UnicastDestination.java b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/main/java/org/openecomp/sdc/destinationprovider/impl/UnicastDestination.java
new file mode 100644
index 0000000..693c816
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/main/java/org/openecomp/sdc/destinationprovider/impl/UnicastDestination.java
@@ -0,0 +1,23 @@
+package org.openecomp.sdc.destinationprovider.impl;
+
+import org.openecomp.sdc.destinationprovider.DestinationProvider;
+
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @author avrahamg
+ * @since July 09, 2017
+ */
+public class UnicastDestination implements DestinationProvider {
+
+    private String originatorId;
+
+    public UnicastDestination(String originatorId) {
+        this.originatorId = originatorId;
+    }
+
+    public List<String> getSubscribers() {
+        return Collections.unmodifiableList(Collections.singletonList(originatorId));
+    }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/main/java/org/openecomp/sdc/notification/dao/impl/LastNotificationDaoCassandraImpl.java b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/main/java/org/openecomp/sdc/notification/dao/impl/LastNotificationDaoCassandraImpl.java
new file mode 100644
index 0000000..0bfd6a3
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/main/java/org/openecomp/sdc/notification/dao/impl/LastNotificationDaoCassandraImpl.java
@@ -0,0 +1,87 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * 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=========================================================
+ */
+
+package org.openecomp.sdc.notification.dao.impl;
+
+import com.datastax.driver.core.ResultSet;
+import com.datastax.driver.core.Row;
+import com.datastax.driver.mapping.Mapper;
+import com.datastax.driver.mapping.Result;
+import com.datastax.driver.mapping.annotations.Accessor;
+import com.datastax.driver.mapping.annotations.Query;
+import org.openecomp.core.dao.impl.CassandraBaseDao;
+import org.openecomp.core.nosqldb.api.NoSqlDb;
+import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
+import org.openecomp.sdc.notification.dao.LastNotificationDao;
+import org.openecomp.sdc.notification.dao.types.LastSeenNotificationEntity;
+
+import java.util.Collection;
+import java.util.UUID;
+
+
+public class LastNotificationDaoCassandraImpl extends CassandraBaseDao<LastSeenNotificationEntity> implements LastNotificationDao {
+
+  private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface();
+  private static final Mapper<LastSeenNotificationEntity> mapper =
+      noSqlDb.getMappingManager().mapper(LastSeenNotificationEntity.class);
+  private static final LastNotificationAccessor accessor =
+      noSqlDb.getMappingManager().createAccessor(LastNotificationAccessor.class);
+
+  @Override
+  protected Mapper<LastSeenNotificationEntity> getMapper() {
+    return mapper;
+  }
+
+  @Override
+  protected Object[] getKeys(LastSeenNotificationEntity entity) {
+    return new Object[]{entity.getOwnerId()};
+  }
+
+  @Override
+  public Collection<LastSeenNotificationEntity> list(LastSeenNotificationEntity entity) {
+    return accessor.list(entity.getOwnerId()).all();
+  }
+
+  @Override
+  public UUID getOwnerLastEventId(String ownerId) {
+    ResultSet ownerLastEventId = accessor.getOwnerLastEventId(ownerId);
+    Row one = ownerLastEventId.one();
+    return one != null ? one.getUUID("event_id") : null;
+  }
+
+  @Override
+  public void persistOwnerLastEventId(String ownerId, UUID eventId) {
+	    accessor.updateOwnerLastEventId(eventId, ownerId);
+  }
+
+  @Accessor
+  interface LastNotificationAccessor {
+
+    @Query("select * from last_notification where owner_id=?")
+    Result<LastSeenNotificationEntity> list(String ownerId);
+
+    @Query("select event_id from last_notification where owner_id=?")
+    ResultSet getOwnerLastEventId(String ownerId);
+
+    @Query("update last_notification set event_id=? where owner_id=?")
+    ResultSet updateOwnerLastEventId(UUID eventId, String ownerId);
+  }
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/main/java/org/openecomp/sdc/notification/dao/impl/NotificationsDaoCassandraImpl.java b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/main/java/org/openecomp/sdc/notification/dao/impl/NotificationsDaoCassandraImpl.java
new file mode 100644
index 0000000..151c2c8
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/main/java/org/openecomp/sdc/notification/dao/impl/NotificationsDaoCassandraImpl.java
@@ -0,0 +1,287 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * 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=========================================================
+ */
+
+package org.openecomp.sdc.notification.dao.impl;
+
+import com.datastax.driver.core.BatchStatement;
+import com.datastax.driver.core.ResultSet;
+import com.datastax.driver.core.Statement;
+import com.datastax.driver.core.utils.UUIDs;
+import com.datastax.driver.mapping.Mapper;
+import com.datastax.driver.mapping.Result;
+import com.datastax.driver.mapping.annotations.Accessor;
+import com.datastax.driver.mapping.annotations.Query;
+import org.apache.commons.collections.CollectionUtils;
+import org.openecomp.core.dao.impl.CassandraBaseDao;
+import org.openecomp.core.nosqldb.api.NoSqlDb;
+import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
+import org.openecomp.sdc.notification.dao.NotificationsDao;
+import org.openecomp.sdc.notification.dao.types.NotificationEntity;
+import org.openecomp.sdc.notification.dtos.NotificationsStatus;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Objects;
+import java.util.UUID;
+import java.util.stream.Collectors;
+
+import static org.openecomp.core.nosqldb.impl.cassandra.CassandraSessionFactory.getSession;
+
+//import org.openecomp.sdc.notification.dao.types.LastSeenNotificationEntity;
+//import java.util.Optional;
+
+public class NotificationsDaoCassandraImpl extends CassandraBaseDao<NotificationEntity>
+    implements NotificationsDao {
+
+    private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface();
+    private static final Mapper<NotificationEntity> mapper =
+        noSqlDb.getMappingManager().mapper(NotificationEntity.class);
+    private static final NotificationsAccessor accessor =
+        noSqlDb.getMappingManager().createAccessor(NotificationsAccessor.class);
+
+    @Override
+    protected Mapper<NotificationEntity> getMapper() {
+        return mapper;
+    }
+
+    @Override
+    protected Object[] getKeys(NotificationEntity entity) {
+        return new Object[]{entity.getOwnerId(), entity.getEventId()};
+    }
+
+    @Override
+    public List<NotificationEntity> list(NotificationEntity entity) {
+        return accessor.list(entity.getOwnerId()).all();
+    }
+
+    @Override
+    public List<NotificationEntity> getNotificationsByOwnerId(String ownerId, int limit) {
+        return accessor.getNotifications(ownerId, limit).all();
+    }
+
+    @Override
+    public List<NotificationEntity> getNewNotificationsByOwnerId(String ownerId, UUID eventId) {
+        return getNewNotificationsByOwnerId(ownerId, eventId,
+            DEFAULT_LIMIT_OF_RESULTS_FOR_OWNER_NOTIFICATIONS);
+    }
+
+    @Override
+    public List<NotificationEntity> getNewNotificationsByOwnerId(String ownerId, UUID eventId, int limit) {
+        if (Objects.isNull(eventId)) {
+            return getNotificationsByOwnerId(ownerId, limit);
+        }
+        return accessor.getNewNotifications(ownerId, eventId, limit).all();
+    }
+
+    @Override
+    public void markNotificationAsRead(String ownerId, Collection<UUID> eventIds) {
+        eventIds.forEach(eventId -> accessor.markAsRead(ownerId, eventId));
+    }
+
+    @Override
+    public NotificationsStatus getNotificationsStatus(String ownerId, UUID lastScannedEventId, int numOfRecordsToReturn) {
+	NotificationsStatusImpl notificationsStatus = new NotificationsStatusImpl();
+	List<NotificationEntity> entities = accessor.getNotifications(ownerId, numOfRecordsToReturn).all();
+        if (CollectionUtils.isNotEmpty(entities)) {
+            long lastSeen = UUIDs.unixTimestamp(lastScannedEventId);
+            populateNewNotifications(notificationsStatus, entities, lastSeen);
+            UUID firstScannedEventId = entities.get(0).getEventId();
+		notificationsStatus.setLastScanned(firstScannedEventId);
+		notificationsStatus.setNumOfNotSeenNotifications(accessor.getNewNotificationsCount(ownerId, lastScannedEventId, firstScannedEventId).one().getLong(0));
+        }
+	return notificationsStatus;
+    }
+
+    private void populateNewNotifications(NotificationsStatusImpl notificationsStatus, List<NotificationEntity> entities, long lastSeen) {
+        for (NotificationEntity entity : entities) {
+            UUID eventId = entity.getEventId();
+            notificationsStatus.addNotification(entity);
+            if (UUIDs.unixTimestamp(eventId) > lastSeen) {
+                notificationsStatus.addNewNotificationUUID(eventId);
+            }
+        }
+    }
+
+    @Override
+    public NotificationsStatus getNotificationsStatus(String ownerId, UUID lastSeenNotification, int numOfRecordsToReturn, UUID prevLastScannedEventId) {
+	NotificationsStatusImpl notificationsStatus = new NotificationsStatusImpl();
+	List<NotificationEntity> entities = accessor.getPrevNotifications(ownerId, prevLastScannedEventId, numOfRecordsToReturn).all();
+        if (CollectionUtils.isNotEmpty(entities)) {
+		long lastSeen = UUIDs.unixTimestamp(lastSeenNotification);
+            populateNewNotifications(notificationsStatus, entities, lastSeen);
+        }
+	return notificationsStatus;
+    }
+
+/*
+    @Override
+    public NotificationsStatus getNotificationsStatus(String ownerId,
+                                                      LastSeenNotificationEntity lastSeenNotification,
+                                                      int numOfRecordsToReturn) {
+
+        List<NotificationEntity> notificationEntities =
+            fetchNewNotifications(lastSeenNotification, numOfRecordsToReturn);
+        NotificationsStatusImpl notificationsStatus = new NotificationsStatusImpl();
+        if (CollectionUtils.isEmpty(notificationEntities)) {
+            return notificationsStatus;
+        }
+
+        notificationEntities.forEach(notification -> {
+            if (isNewNotification(lastSeenNotification, notification)) {
+                notificationsStatus.addNewNotificationUUID(notification.getEventId());
+            }
+            notificationsStatus.addNotification(notification);
+        });
+
+        Optional<NotificationEntity> latestNotification = notificationEntities.stream().findFirst();
+        latestNotification.ifPresent(e -> notificationsStatus.setLastScanned(e.getEventId()));
+        return notificationsStatus;
+    }
+
+    private List<NotificationEntity> fetchNewNotifications(
+        LastSeenNotificationEntity lastSeenNotification, int numOfRecordsToReturn) {
+        String ownerId = lastSeenNotification.getOwnerId();
+        UUID lastEventId = lastSeenNotification.getLastEventId();
+        List<NotificationEntity> newNotificationsByOwnerId =
+            getNewNotificationsByOwnerId(ownerId, lastEventId);
+        newNotificationsByOwnerId = fetchMoreIfNeeded(ownerId, newNotificationsByOwnerId,
+            numOfRecordsToReturn, lastEventId);
+        return newNotificationsByOwnerId;
+    }
+
+    private boolean isNewNotification(LastSeenNotificationEntity lastSeenNotification,
+                                      NotificationEntity notification) {
+        return Objects.isNull(lastSeenNotification.getLastEventId()) ||
+            UUIDs.unixTimestamp(notification.getEventId()) >
+                UUIDs.unixTimestamp(lastSeenNotification.getLastEventId());
+    }
+*/
+
+    @Override
+    public void createBatch(List<NotificationEntity> notificationEntities) {
+        BatchStatement batch = new BatchStatement();
+        List<Statement> statements = notificationEntities.stream()
+            .map(mapper::saveQuery)
+            .collect(Collectors.toList());
+        batch.addAll(statements);
+        getSession().execute(batch);
+    }
+
+    @Accessor
+    interface NotificationsAccessor {
+
+        @Query("select * from notifications where owner_id=?")
+        Result<NotificationEntity> list(String ownerId);
+
+        @Query("select * from notifications where owner_id=? limit ?")
+        Result<NotificationEntity> getNotifications(String ownerId, int limit);
+
+        @Query("select * from notifications where owner_id=? and event_id > ? limit ?")
+        Result<NotificationEntity> getNewNotifications(String ownerId, UUID lastScannedEventId, int limit);
+
+        @Query("select * from notifications where owner_id=? and event_id < ? limit ?")
+        Result<NotificationEntity> getPrevNotifications(String ownerId, UUID prevLastScannedEventId, int limit);
+
+        @Query("select count(*) from notifications where owner_id=? and event_id > ? and event_id <= ?")
+        ResultSet getNewNotificationsCount(String ownerId, UUID lastScannedEventId, UUID firstScannedEventId);
+
+        @Query("update notifications set read=true where owner_id=? and event_id=?")
+        ResultSet markAsRead(String ownerId, UUID eventId);
+    }
+
+    private class NotificationsStatusImpl implements NotificationsStatus {
+
+        private List<NotificationEntity> notifications = new ArrayList<>();
+        private List<UUID> newEntries = new ArrayList<>();
+        private UUID lastScanned;
+        private UUID endOfPage;
+        private long numOfNotSeenNotifications = 0;
+
+        void addNotification(NotificationEntity notification) {
+            notifications.add(notification);
+            endOfPage = notification.getEventId();
+        }
+
+        void addNewNotificationUUID(UUID notificationUuid) {
+            newEntries.add(notificationUuid);
+        }
+
+        @Override
+        public List<NotificationEntity> getNotifications() {
+            return Collections.unmodifiableList(notifications);
+        }
+
+        @Override
+        public List<UUID> getNewEntries() {
+            return Collections.unmodifiableList(newEntries);
+        }
+
+        @Override
+        public UUID getLastScanned() {
+            return lastScanned;
+        }
+
+        void setLastScanned(UUID lastScanned) {
+            this.lastScanned = lastScanned;
+        }
+
+        @Override
+        public UUID getEndOfPage() {
+            return endOfPage;
+        }
+
+        @Override
+        public long getNumOfNotSeenNotifications() {
+            return numOfNotSeenNotifications;
+        }
+
+        void setNumOfNotSeenNotifications(long numOfNotSeenNotifications) {
+            this.numOfNotSeenNotifications = numOfNotSeenNotifications;
+        }
+    }
+
+/*
+    private List<NotificationEntity> fetchMoreIfNeeded(String ownerId,
+                                                       List<NotificationEntity> notificationEntities,
+                                                       int numOfRecordsToReturn, UUID lastEventId) {
+
+        if (numOfRecordsToReturn <= notificationEntities.size() || Objects.isNull(lastEventId)) {
+            return notificationEntities;
+        }
+
+        int multiplier = 2;
+        while (numOfRecordsToReturn > notificationEntities.size()) {
+
+            int bring = notificationEntities.size() +
+                (numOfRecordsToReturn - notificationEntities.size()) * multiplier;
+            notificationEntities = getNotificationsByOwnerId(ownerId, bring);
+
+            if (notificationEntities.size() < bring) {
+                return notificationEntities;
+            }
+            multiplier++;
+        }
+        return notificationEntities;
+    }
+*/
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/main/java/org/openecomp/sdc/notification/dao/impl/SubscribersDaoCassandraImpl.java b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/main/java/org/openecomp/sdc/notification/dao/impl/SubscribersDaoCassandraImpl.java
new file mode 100644
index 0000000..8e8cf9b
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/main/java/org/openecomp/sdc/notification/dao/impl/SubscribersDaoCassandraImpl.java
@@ -0,0 +1,104 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * 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=========================================================
+ */
+
+package org.openecomp.sdc.notification.dao.impl;
+
+import com.datastax.driver.mapping.Mapper;
+import com.datastax.driver.mapping.Result;
+import com.datastax.driver.mapping.annotations.Accessor;
+import com.datastax.driver.mapping.annotations.Query;
+import com.google.common.collect.Sets;
+import org.openecomp.core.dao.impl.CassandraBaseDao;
+import org.openecomp.core.nosqldb.api.NoSqlDb;
+import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
+import org.openecomp.sdc.notification.dao.SubscribersDao;
+import org.openecomp.sdc.notification.dao.types.SubscribersEntity;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Objects;
+import java.util.Set;
+
+import static java.util.Objects.isNull;
+
+public class SubscribersDaoCassandraImpl extends CassandraBaseDao<SubscribersEntity> implements
+        SubscribersDao {
+
+    private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface();
+    private static final Mapper<SubscribersEntity> mapper =
+            noSqlDb.getMappingManager().mapper(SubscribersEntity.class);
+    private static final SubscribersAccessor accessor =
+            noSqlDb.getMappingManager().createAccessor(SubscribersAccessor.class);
+
+
+    @Override
+    protected Object[] getKeys(SubscribersEntity entity) {
+        return new Object[]{entity.getEntityId()};
+    }
+
+    @Override
+    protected Mapper<SubscribersEntity> getMapper() {
+        return mapper;
+    }
+
+    @Override
+    public void subscribe(String ownerId, String entityId) {
+        Objects.requireNonNull(ownerId);
+        Objects.requireNonNull(entityId);
+        accessor.subscribe(Sets.newHashSet(ownerId), entityId);
+    }
+
+    @Override
+    @Deprecated
+    public Collection<SubscribersEntity> list(SubscribersEntity entity) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void unsubscribe(String ownerId, String entityId) {
+        Objects.requireNonNull(ownerId);
+        Objects.requireNonNull(entityId);
+        accessor.unsubscribe(Sets.newHashSet(ownerId), entityId);
+    }
+
+    @Override
+    public Set<String> getSubscribers(String entityId) {
+        Objects.requireNonNull(entityId);
+        SubscribersEntity subscribersEntity = accessor.getSubscribers(entityId).one();
+        if (isNull(subscribersEntity)) {
+            return Collections.emptySet();
+        }
+        return subscribersEntity.getSubscribers();
+    }
+
+    @Accessor
+    interface SubscribersAccessor {
+
+        @Query("select * from notification_subscribers where entity_id=?")
+        Result<SubscribersEntity> getSubscribers(String entityId);
+
+        @Query("update notification_subscribers set subscribers=subscribers+? WHERE entity_id=?")
+        void subscribe(Set<String> ownerId, String entityId);
+
+        @Query("update notification_subscribers set subscribers=subscribers-? WHERE entity_id=?")
+        void unsubscribe(Set<String> ownerId, String entityId);
+    }
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/main/java/org/openecomp/sdc/notification/factories/impl/LastNotificationDaoFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/main/java/org/openecomp/sdc/notification/factories/impl/LastNotificationDaoFactoryImpl.java
new file mode 100644
index 0000000..7ac9e00
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/main/java/org/openecomp/sdc/notification/factories/impl/LastNotificationDaoFactoryImpl.java
@@ -0,0 +1,19 @@
+package org.openecomp.sdc.notification.factories.impl;
+
+import org.openecomp.sdc.notification.dao.LastNotificationDao;
+import org.openecomp.sdc.notification.dao.impl.LastNotificationDaoCassandraImpl;
+import org.openecomp.sdc.notification.factories.LastNotificationDaoFactory;
+
+/**
+ * @author itzikpa
+ * @since June 23, 2017
+ */
+
+public class LastNotificationDaoFactoryImpl extends LastNotificationDaoFactory {
+  private static final LastNotificationDao INSTANCE = new LastNotificationDaoCassandraImpl();
+
+  @Override
+  public LastNotificationDao createInterface() {
+    return INSTANCE;
+  }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/main/java/org/openecomp/sdc/notification/factories/impl/NotificationPropagationManagerFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/main/java/org/openecomp/sdc/notification/factories/impl/NotificationPropagationManagerFactoryImpl.java
new file mode 100644
index 0000000..7b9e51e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/main/java/org/openecomp/sdc/notification/factories/impl/NotificationPropagationManagerFactoryImpl.java
@@ -0,0 +1,19 @@
+package org.openecomp.sdc.notification.factories.impl;
+
+import org.openecomp.sdc.notification.factories.NotificationPropagationManagerFactory;
+import org.openecomp.sdc.notification.factories.PropagationServiceFactory;
+import org.openecomp.sdc.notification.factories.SubscriptionServiceFactory;
+import org.openecomp.sdc.notification.services.NotificationPropagationManager;
+import org.openecomp.sdc.notification.services.impl.NotificationPropagationManagerImpl;
+
+public class NotificationPropagationManagerFactoryImpl extends
+    NotificationPropagationManagerFactory {
+    private static final NotificationPropagationManager INSTANCE = new NotificationPropagationManagerImpl(
+            PropagationServiceFactory.getInstance().createInterface(), SubscriptionServiceFactory
+        .getInstance().createInterface());
+
+    @Override
+    public NotificationPropagationManager createInterface() {
+        return INSTANCE;
+    }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/main/java/org/openecomp/sdc/notification/factories/impl/NotificationsDaoFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/main/java/org/openecomp/sdc/notification/factories/impl/NotificationsDaoFactoryImpl.java
new file mode 100644
index 0000000..edb0206
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/main/java/org/openecomp/sdc/notification/factories/impl/NotificationsDaoFactoryImpl.java
@@ -0,0 +1,18 @@
+package org.openecomp.sdc.notification.factories.impl;
+
+import org.openecomp.sdc.notification.dao.NotificationsDao;
+import org.openecomp.sdc.notification.dao.impl.NotificationsDaoCassandraImpl;
+import org.openecomp.sdc.notification.factories.NotificationsDaoFactory;
+
+/**
+ * @author Avrahamg
+ * @since June 20, 2017
+ */
+public class NotificationsDaoFactoryImpl extends NotificationsDaoFactory {
+  private static final NotificationsDao INSTANCE = new NotificationsDaoCassandraImpl();
+
+  @Override
+  public NotificationsDao createInterface() {
+    return INSTANCE;
+  }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/main/java/org/openecomp/sdc/notification/factories/impl/NotificationsServiceFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/main/java/org/openecomp/sdc/notification/factories/impl/NotificationsServiceFactoryImpl.java
new file mode 100644
index 0000000..ac265e3
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/main/java/org/openecomp/sdc/notification/factories/impl/NotificationsServiceFactoryImpl.java
@@ -0,0 +1,22 @@
+package org.openecomp.sdc.notification.factories.impl;
+
+import org.openecomp.sdc.notification.factories.LastNotificationDaoFactory;
+import org.openecomp.sdc.notification.factories.NotificationsDaoFactory;
+import org.openecomp.sdc.notification.factories.NotificationsServiceFactory;
+import org.openecomp.sdc.notification.services.NotificationsService;
+import org.openecomp.sdc.notification.services.impl.NotificationsServiceImpl;
+
+/**
+ * @author Avrahamg
+ * @since June 20, 2017
+ */
+public class NotificationsServiceFactoryImpl extends NotificationsServiceFactory {
+  private static final NotificationsService INSTANCE = new NotificationsServiceImpl(
+      LastNotificationDaoFactory.getInstance().createInterface(), NotificationsDaoFactory
+      .getInstance().createInterface());
+
+  @Override
+  public NotificationsService createInterface() {
+    return INSTANCE;
+  }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/main/java/org/openecomp/sdc/notification/factories/impl/PropagationServiceFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/main/java/org/openecomp/sdc/notification/factories/impl/PropagationServiceFactoryImpl.java
new file mode 100644
index 0000000..e5987fe
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/main/java/org/openecomp/sdc/notification/factories/impl/PropagationServiceFactoryImpl.java
@@ -0,0 +1,16 @@
+package org.openecomp.sdc.notification.factories.impl;
+
+import org.openecomp.sdc.notification.factories.NotificationsDaoFactory;
+import org.openecomp.sdc.notification.factories.PropagationServiceFactory;
+import org.openecomp.sdc.notification.services.PropagationService;
+import org.openecomp.sdc.notification.services.impl.PropagationServiceImpl;
+
+public class PropagationServiceFactoryImpl extends PropagationServiceFactory {
+    private static final PropagationService INSTANCE = new PropagationServiceImpl(
+            NotificationsDaoFactory.getInstance().createInterface());
+
+    @Override
+    public PropagationService createInterface() {
+        return INSTANCE;
+    }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/main/java/org/openecomp/sdc/notification/factories/impl/SubscribersDaoFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/main/java/org/openecomp/sdc/notification/factories/impl/SubscribersDaoFactoryImpl.java
new file mode 100644
index 0000000..fb87b94
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/main/java/org/openecomp/sdc/notification/factories/impl/SubscribersDaoFactoryImpl.java
@@ -0,0 +1,15 @@
+package org.openecomp.sdc.notification.factories.impl;
+
+import org.openecomp.sdc.notification.dao.SubscribersDao;
+import org.openecomp.sdc.notification.dao.impl.SubscribersDaoCassandraImpl;
+import org.openecomp.sdc.notification.factories.SubscribersDaoFactory;
+
+
+public class SubscribersDaoFactoryImpl extends SubscribersDaoFactory {
+    private static final SubscribersDao INSTANCE = new SubscribersDaoCassandraImpl();
+
+    @Override
+    public SubscribersDao createInterface() {
+        return INSTANCE;
+    }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/main/java/org/openecomp/sdc/notification/factories/impl/SubscriptionServiceFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/main/java/org/openecomp/sdc/notification/factories/impl/SubscriptionServiceFactoryImpl.java
new file mode 100644
index 0000000..604cff0
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/main/java/org/openecomp/sdc/notification/factories/impl/SubscriptionServiceFactoryImpl.java
@@ -0,0 +1,17 @@
+package org.openecomp.sdc.notification.factories.impl;
+
+import org.openecomp.sdc.notification.factories.SubscribersDaoFactory;
+import org.openecomp.sdc.notification.factories.SubscriptionServiceFactory;
+import org.openecomp.sdc.notification.services.SubscriptionService;
+import org.openecomp.sdc.notification.services.impl.SubscriptionServiceImpl;
+
+
+public class SubscriptionServiceFactoryImpl extends SubscriptionServiceFactory {
+    private static final SubscriptionService INSTANCE = new SubscriptionServiceImpl
+        (SubscribersDaoFactory.getInstance().createInterface());
+
+    @Override
+    public SubscriptionService createInterface() {
+        return INSTANCE;
+    }
+}
\ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/main/java/org/openecomp/sdc/notification/services/impl/NotificationPropagationManagerImpl.java b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/main/java/org/openecomp/sdc/notification/services/impl/NotificationPropagationManagerImpl.java
new file mode 100644
index 0000000..d381268
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/main/java/org/openecomp/sdc/notification/services/impl/NotificationPropagationManagerImpl.java
@@ -0,0 +1,35 @@
+package org.openecomp.sdc.notification.services.impl;
+
+import org.openecomp.sdc.destinationprovider.impl.MulticastDestination;
+import org.openecomp.sdc.destinationprovider.impl.UnicastDestination;
+import org.openecomp.sdc.notification.dtos.Event;
+import org.openecomp.sdc.notification.services.NotificationPropagationManager;
+import org.openecomp.sdc.notification.services.PropagationService;
+import org.openecomp.sdc.notification.services.SubscriptionService;
+
+/**
+ * @author avrahamg
+ * @since July 10, 2017
+ */
+public class NotificationPropagationManagerImpl implements NotificationPropagationManager {
+
+    private PropagationService propagationService;
+    private SubscriptionService subscriptionService;
+
+    public NotificationPropagationManagerImpl(PropagationService propagationService,
+                                              SubscriptionService subscriptionService) {
+        this.propagationService = propagationService;
+        this.subscriptionService = subscriptionService;
+    }
+
+    @Override
+    public void notifySubscribers(Event event, String ... excludedSubscribers) {
+        propagationService.notify(event, new MulticastDestination(event.getEntityId(),
+            subscriptionService, excludedSubscribers));
+    }
+
+    @Override
+    public void directNotification(Event event, String destinationId) {
+        propagationService.notify(event, new UnicastDestination(destinationId));
+    }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/main/java/org/openecomp/sdc/notification/services/impl/NotificationsServiceImpl.java b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/main/java/org/openecomp/sdc/notification/services/impl/NotificationsServiceImpl.java
new file mode 100644
index 0000000..8a7ab8b
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/main/java/org/openecomp/sdc/notification/services/impl/NotificationsServiceImpl.java
@@ -0,0 +1,92 @@
+package org.openecomp.sdc.notification.services.impl;
+
+import org.openecomp.sdc.notification.dao.LastNotificationDao;
+import org.openecomp.sdc.notification.dao.NotificationsDao;
+import org.openecomp.sdc.notification.dao.types.LastSeenNotificationEntity;
+import org.openecomp.sdc.notification.dao.types.NotificationEntity;
+import org.openecomp.sdc.notification.dtos.NotificationsStatus;
+import org.openecomp.sdc.notification.exceptons.NotificationNotExistException;
+import org.openecomp.sdc.notification.services.NotificationsService;
+
+import java.util.List;
+import java.util.Objects;
+import java.util.UUID;
+
+/**
+ * @author Avrahamg
+ * @since June 26, 2017
+ */
+public class NotificationsServiceImpl implements NotificationsService {
+
+    private LastNotificationDao lastNotificationDao;
+    private NotificationsDao notificationsDao;
+
+    public NotificationsServiceImpl(LastNotificationDao lastNotificationDao,
+                                    NotificationsDao notificationsDao) {
+        this.lastNotificationDao = lastNotificationDao;
+        this.notificationsDao = notificationsDao;
+    }
+
+    @Override
+    public LastSeenNotificationEntity getLastNotification(String ownerId) {
+        return new LastSeenNotificationEntity(ownerId,
+            lastNotificationDao.getOwnerLastEventId(ownerId));
+    }
+
+    @Override
+    public void updateLastSeenNotification(String ownerId, UUID eventId)
+    {
+        lastNotificationDao.persistOwnerLastEventId(ownerId, eventId);
+    }
+
+    @Override
+    public NotificationsStatus getNotificationsStatus(String ownerId, UUID lastDelivered, int numOfRecordsToReturn, UUID endOfPage) {
+	if (Objects.isNull(lastDelivered)) {
+		LastSeenNotificationEntity entity = getLastNotification(ownerId);
+		if (Objects.nonNull(entity)) {
+			lastDelivered = entity.getLastEventId();
+		}
+		if (Objects.isNull(lastDelivered)) {
+			lastDelivered = UUID.fromString("00000000-0000-1000-8080-808080808080"); // Lowest time UUID value
+		}
+	}
+	if (Objects.isNull(endOfPage)) {
+		// First page
+	        return notificationsDao.getNotificationsStatus(ownerId, lastDelivered, numOfRecordsToReturn);
+	}
+	else {
+		// Next page
+            return notificationsDao.getNotificationsStatus(ownerId, lastDelivered, numOfRecordsToReturn, endOfPage);
+	}
+    }
+
+    @Override
+    public void markAsRead(String ownerId, String notificationId) throws
+        NotificationNotExistException {
+        NotificationEntity notificationEntity =
+            notificationsDao.get(new NotificationEntity(ownerId, UUID.fromString(notificationId)));
+        if (Objects.isNull(notificationEntity)) {
+            throw new NotificationNotExistException(
+                "Notification '" + notificationId + "' is not related to ownerId" +
+                    " '" + ownerId + "'");
+        }
+        notificationEntity.setRead(true);
+        notificationsDao.update(notificationEntity);
+    }
+
+    @Override
+    public List<NotificationEntity> getNotificationsByOwnerId(String ownerId, int limit) {
+	return notificationsDao.getNotificationsByOwnerId(ownerId, limit);
+    }
+
+    @Override
+    public List<NotificationEntity> getNewNotificationsByOwnerId(String ownerId, UUID eventId) {
+	return notificationsDao.getNewNotificationsByOwnerId(ownerId, eventId);
+    }
+
+    @Override
+    public List<NotificationEntity> getNewNotificationsByOwnerId(String ownerId, UUID eventId, int limit) {
+	return notificationsDao.getNewNotificationsByOwnerId(ownerId, eventId, limit);
+    }
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/main/java/org/openecomp/sdc/notification/services/impl/PropagationServiceImpl.java b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/main/java/org/openecomp/sdc/notification/services/impl/PropagationServiceImpl.java
new file mode 100644
index 0000000..99d35b3
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/main/java/org/openecomp/sdc/notification/services/impl/PropagationServiceImpl.java
@@ -0,0 +1,78 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * 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=========================================================
+ */
+
+package org.openecomp.sdc.notification.services.impl;
+
+import com.datastax.driver.core.utils.UUIDs;
+import org.apache.commons.collections4.CollectionUtils;
+import org.openecomp.core.utilities.json.JsonUtil;
+import org.openecomp.sdc.destinationprovider.DestinationProvider;
+import org.openecomp.sdc.notification.dao.NotificationsDao;
+import org.openecomp.sdc.notification.dao.types.NotificationEntity;
+import org.openecomp.sdc.notification.dtos.Event;
+import org.openecomp.sdc.notification.services.PropagationService;
+
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import java.util.stream.Collectors;
+
+import static java.util.Objects.requireNonNull;
+
+public class PropagationServiceImpl implements PropagationService {
+
+    private NotificationsDao notificationsDao;
+
+    public PropagationServiceImpl(NotificationsDao notificationsDao) {
+        this.notificationsDao = notificationsDao;
+    }
+
+
+    @Override
+    public void notify(Event event, DestinationProvider destinationProvider) {
+        requireNonNull(event.getEventType());
+        requireNonNull(event.getOriginatorId());
+        List<String> subscribers = destinationProvider.getSubscribers();
+        if (CollectionUtils.isEmpty(subscribers)) {
+            return;
+        }
+        List<NotificationEntity> notificationEntities = subscribers.stream().map(
+            subscriber -> {
+                UUID eventId = UUIDs.timeBased();
+                return createNotificationEntity(event.getEventType(), subscriber,
+                    event.getOriginatorId(), event.getAttributes(), eventId);
+            }).collect(Collectors.toList());
+        if(CollectionUtils.isNotEmpty(notificationEntities)) {
+            notificationsDao.createBatch(notificationEntities);
+        }
+    }
+
+    private NotificationEntity createNotificationEntity(String eventType, String subscriber,
+                                                        String originatorId,
+                                                        Map<String, Object> attributes,
+                                                        UUID eventId) {
+        NotificationEntity notificationEntity =
+            new NotificationEntity(subscriber, eventId, eventType, originatorId);
+        if (attributes != null && !attributes.isEmpty()) {
+            notificationEntity.setEventAttributes(JsonUtil.object2Json(attributes));
+        }
+        return notificationEntity;
+    }
+}
\ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/main/java/org/openecomp/sdc/notification/services/impl/SubscriptionServiceImpl.java b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/main/java/org/openecomp/sdc/notification/services/impl/SubscriptionServiceImpl.java
new file mode 100644
index 0000000..2a12463
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/main/java/org/openecomp/sdc/notification/services/impl/SubscriptionServiceImpl.java
@@ -0,0 +1,50 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * 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=========================================================
+ */
+
+package org.openecomp.sdc.notification.services.impl;
+
+import org.openecomp.sdc.notification.dao.SubscribersDao;
+import org.openecomp.sdc.notification.services.SubscriptionService;
+
+import java.util.Set;
+
+public class SubscriptionServiceImpl implements SubscriptionService {
+
+    private SubscribersDao subscribersDao;
+
+    public SubscriptionServiceImpl(SubscribersDao subscribersDao) {
+        this.subscribersDao = subscribersDao;
+    }
+
+    @Override
+    public void subscribe(String ownerId, String entityId) {
+        subscribersDao.subscribe(ownerId, entityId);
+    }
+
+    @Override
+    public void unsubscribe(String ownerId, String entityId) {
+        subscribersDao.unsubscribe(ownerId, entityId);
+    }
+
+    @Override
+    public Set<String> getSubscribers(String entityId) {
+        return subscribersDao.getSubscribers(entityId);
+    }
+}
\ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/main/resources/factoryConfiguration.json b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/main/resources/factoryConfiguration.json
new file mode 100644
index 0000000..3f1bdf3
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/main/resources/factoryConfiguration.json
@@ -0,0 +1,9 @@
+{
+  "org.openecomp.sdc.notification.factories.LastNotificationDaoFactory": "org.openecomp.sdc.notification.factories.impl.LastNotificationDaoFactoryImpl",
+  "org.openecomp.sdc.notification.factories.NotificationsDaoFactory": "org.openecomp.sdc.notification.factories.impl.NotificationsDaoFactoryImpl",
+  "org.openecomp.sdc.notification.factories.NotificationsServiceFactory": "org.openecomp.sdc.notification.factories.impl.NotificationsServiceFactoryImpl",
+  "org.openecomp.sdc.notification.factories.SubscribersDaoFactory": "org.openecomp.sdc.notification.factories.impl.SubscribersDaoFactoryImpl",
+  "org.openecomp.sdc.notification.factories.PropagationServiceFactory": "org.openecomp.sdc.notification.factories.impl.PropagationServiceFactoryImpl",
+  "org.openecomp.sdc.notification.factories.SubscriptionServiceFactory": "org.openecomp.sdc.notification.factories.impl.SubscriptionServiceFactoryImpl",
+  "org.openecomp.sdc.notification.factories.NotificationPropagationManagerFactory": "org.openecomp.sdc.notification.factories.impl.NotificationPropagationManagerFactoryImpl"
+}
\ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/test/java/org/openecomp/sdc/destinationprovider/impl/MulticastDestinationTest.java b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/test/java/org/openecomp/sdc/destinationprovider/impl/MulticastDestinationTest.java
new file mode 100644
index 0000000..a0dd006
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/test/java/org/openecomp/sdc/destinationprovider/impl/MulticastDestinationTest.java
@@ -0,0 +1,67 @@
+package org.openecomp.sdc.destinationprovider.impl;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.openecomp.sdc.notification.services.SubscriptionService;
+
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.doReturn;
+
+/**
+ * @author avrahamg
+ * @since July 13, 2017
+ */
+public class MulticastDestinationTest {
+    @Mock
+    private SubscriptionService subscriptionServiceMock;
+
+    private final String excludedSubscriber = "excluded";
+    private Set<String> subscribers = new HashSet<>(Arrays.asList("a", "b", excludedSubscriber));
+    private MulticastDestination multicastDestination;
+
+    @Before
+    public void setUp() throws Exception {
+        MockitoAnnotations.initMocks(this);
+    }
+
+    @Test
+    public void shouldReturnAllSubscribersIfNoExcludedProvided() throws Exception {
+        doReturn(subscribers).when(subscriptionServiceMock).getSubscribers(any());
+        multicastDestination = new MulticastDestination("aa", subscriptionServiceMock);
+        assertEquals(subscribers.size(), multicastDestination.getSubscribers().size());
+        List<String> actualSubscribers = multicastDestination.getSubscribers();
+        assertTrue(actualSubscribers.containsAll(subscribers));
+    }
+
+    @Test
+    public void shouldReturnAllSubscribersExceptExcluded() throws Exception {
+        doReturn(subscribers).when(subscriptionServiceMock).getSubscribers(any());
+        multicastDestination =
+            new MulticastDestination("aa", subscriptionServiceMock, excludedSubscriber);
+        List<String> actualSubscribers = multicastDestination.getSubscribers();
+        assertNotEquals(this.subscribers.size(), actualSubscribers.size());
+        assertFalse(actualSubscribers.containsAll(subscribers));
+        assertFalse(actualSubscribers.contains(excludedSubscriber));
+    }
+
+    @Test(expected = UnsupportedOperationException.class)
+    public void shouldThrowUnsupportedOperationExceptionWhenTryingToChangeSubscribersList() throws
+        Exception {
+        doReturn(subscribers).when(subscriptionServiceMock).getSubscribers(any());
+        multicastDestination =
+            new MulticastDestination("aa", subscriptionServiceMock, excludedSubscriber);
+        List<String> actualSubscribers = multicastDestination.getSubscribers();
+        actualSubscribers.add("sss");
+    }
+}
\ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/test/java/org/openecomp/sdc/notification/services/impl/NotificationPropagationManagerImplTest.java b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/test/java/org/openecomp/sdc/notification/services/impl/NotificationPropagationManagerImplTest.java
new file mode 100644
index 0000000..0eb2b62
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/test/java/org/openecomp/sdc/notification/services/impl/NotificationPropagationManagerImplTest.java
@@ -0,0 +1,64 @@
+package org.openecomp.sdc.notification.services.impl;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.ArgumentCaptor;
+import org.mockito.Captor;
+import org.mockito.InjectMocks;
+import org.mockito.Matchers;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.mockito.Spy;
+import org.openecomp.sdc.destinationprovider.DestinationProvider;
+import org.openecomp.sdc.destinationprovider.impl.MulticastDestination;
+import org.openecomp.sdc.destinationprovider.impl.UnicastDestination;
+import org.openecomp.sdc.notification.dtos.Event;
+import org.openecomp.sdc.notification.services.PropagationService;
+import org.openecomp.sdc.notification.services.SubscriptionService;
+
+import static org.mockito.Mockito.verify;
+
+
+/**
+ * @author avrahamg
+ * @since July 13, 2017
+ */
+public class NotificationPropagationManagerImplTest {
+    @Mock
+    private PropagationService propagationServiceMock;
+    @Mock
+    private SubscriptionService subscriptionServiceMock;
+    @Mock
+    private Event eventMock;
+    @Captor
+    private ArgumentCaptor<DestinationProvider> destinationProviderCaptor;
+
+    @Spy
+    @InjectMocks
+    private NotificationPropagationManagerImpl notificationPropagationManager;
+
+    @Before
+    public void setUp() throws Exception {
+        MockitoAnnotations.initMocks(this);
+    }
+
+    @Test
+    public void shouldCallPropagationServiceNotifyWithMulticastDestinationWhenNotifySubscribers()
+        throws Exception {
+        notificationPropagationManager.notifySubscribers(eventMock);
+        verify(propagationServiceMock).notify(Matchers.eq(eventMock), destinationProviderCaptor
+            .capture());
+        Assert.assertTrue(destinationProviderCaptor.getValue() instanceof MulticastDestination);
+
+    }
+
+    @Test
+    public void shouldCallPropagationServiceNotifyWithUnicastDestinationWhenDirectNotification()
+        throws Exception {
+        notificationPropagationManager.directNotification(eventMock, "aaa");
+        verify(propagationServiceMock).notify(Matchers.eq(eventMock), destinationProviderCaptor
+            .capture());
+        Assert.assertTrue(destinationProviderCaptor.getValue() instanceof UnicastDestination);
+    }
+}
\ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/test/java/org/openecomp/sdc/notification/services/impl/NotificationsServiceImplTest.java b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/test/java/org/openecomp/sdc/notification/services/impl/NotificationsServiceImplTest.java
new file mode 100644
index 0000000..a20d0cc
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/test/java/org/openecomp/sdc/notification/services/impl/NotificationsServiceImplTest.java
@@ -0,0 +1,50 @@
+package org.openecomp.sdc.notification.services.impl;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.mockito.Spy;
+import org.openecomp.sdc.notification.dao.LastNotificationDao;
+import org.openecomp.sdc.notification.dao.NotificationsDao;
+import org.openecomp.sdc.notification.dao.types.NotificationEntity;
+import org.openecomp.sdc.notification.exceptons.NotificationNotExistException;
+
+import java.util.UUID;
+
+import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+
+/**
+ * @author avrahamg
+ * @since July 13, 2017
+ */
+public class NotificationsServiceImplTest {
+    @Mock
+    private LastNotificationDao lastNotificationDao;
+    @Mock
+    private NotificationsDao notificationsDao;
+    @Spy
+    @InjectMocks
+    private NotificationsServiceImpl notificationsService;
+
+    @Before
+    public void setUp() throws Exception {
+        MockitoAnnotations.initMocks(this);
+    }
+
+    public void shouldCallNotificationsDaoIfNotificationEntityExist() throws Exception {
+        doReturn(new NotificationEntity()).when(notificationsDao).get(any());
+        notificationsService.markAsRead("ownerId", UUID.randomUUID().toString());
+        verify(notificationsDao, times(1)).update(any());
+    }
+
+    @Test(expected = NotificationNotExistException.class)
+    public void shouldThrowExceptionIfOwnerIdAndNotificationIdDontRelate() throws Exception {
+        doReturn(null).when(notificationsDao).get(any());
+        notificationsService.markAsRead("ownerId", UUID.randomUUID().toString());
+    }
+}
\ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/test/java/org/openecomp/sdc/notification/services/impl/PropagationServiceImplTest.java b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/test/java/org/openecomp/sdc/notification/services/impl/PropagationServiceImplTest.java
new file mode 100644
index 0000000..866dec0
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/test/java/org/openecomp/sdc/notification/services/impl/PropagationServiceImplTest.java
@@ -0,0 +1,96 @@
+package org.openecomp.sdc.notification.services.impl;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+import org.mockito.ArgumentCaptor;
+import org.mockito.Captor;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.mockito.Spy;
+import org.openecomp.sdc.destinationprovider.DestinationProvider;
+import org.openecomp.sdc.notification.dao.NotificationsDao;
+import org.openecomp.sdc.notification.dtos.Event;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+
+import static org.mockito.Matchers.anyList;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.verify;
+
+/**
+ * @author avrahamg
+ * @since July 13, 2017
+ */
+public class PropagationServiceImplTest {
+    @Mock
+    private NotificationsDao notificationsDaoMock;
+    @Mock
+    private Event eventMock;
+    @Mock
+    private DestinationProvider destinationProviderMock;
+    @Captor
+    private ArgumentCaptor<List> createBatchCaptor;
+
+    @Rule
+    public ExpectedException thrown= ExpectedException.none();
+
+    @InjectMocks
+    @Spy
+    private PropagationServiceImpl propagationService;
+    private List<String> subscribersList = Arrays.asList("A1, A2, A3");;
+
+    @Before
+    public void setUp() throws Exception {
+        MockitoAnnotations.initMocks(this);
+        initEventMock();
+    }
+
+    @Test
+    public void shouldCallToNotificationsDaoWithCreateBatchWithNotificationEntitiesAsNumberOfSubscribers()
+        throws Exception {
+        doReturn(subscribersList).when(destinationProviderMock).getSubscribers();
+        propagationService.notify(eventMock, destinationProviderMock);
+        verify(notificationsDaoMock).createBatch(createBatchCaptor.capture());
+        Assert.assertEquals(createBatchCaptor.getValue().size(), subscribersList.size());
+    }
+
+    @Test
+    public void shouldNotCallNotificationDaoIfSubscriberIsNull() throws Exception {
+        doReturn(Collections.EMPTY_LIST).when(destinationProviderMock).getSubscribers();
+        verify(notificationsDaoMock,never()).createBatch(anyList());
+    }
+
+    @Test
+    public void shouldThrowExceptionIfEventTypeIsNull() throws Exception {
+        doReturn(null).when(eventMock).getEventType();
+        callToNotify();
+    }
+
+    @Test
+    public void shouldThrowExceptionIfOriginatorIdIsNull() throws Exception {
+        doReturn(null).when(eventMock).getOriginatorId();
+        callToNotify();
+    }
+
+    private void callToNotify() {
+        thrown.expect(NullPointerException.class);
+        propagationService.notify(eventMock, destinationProviderMock);
+    }
+
+    private void initEventMock() {
+        doReturn("eventType").when(eventMock).getEventType();
+        doReturn("originator").when(eventMock).getOriginatorId();
+        doReturn("entity").when(eventMock).getEntityId();
+        doReturn(new HashMap<>()).when(eventMock).getAttributes();
+    }
+
+
+}
\ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-websocket/pom.xml b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-websocket/pom.xml
new file mode 100644
index 0000000..abff87f
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-websocket/pom.xml
@@ -0,0 +1,34 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <name>openecomp-sdc-notification-websocket</name>
+    <artifactId>openecomp-sdc-notification-websocket</artifactId>
+
+    <parent>
+        <groupId>org.openecomp.sdc</groupId>
+        <artifactId>openecomp-sdc-lib</artifactId>
+        <version>1.2.0-SNAPSHOT</version>
+        <relativePath>../..</relativePath>
+    </parent>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.openecomp.sdc</groupId>
+            <artifactId>openecomp-sdc-notification-worker</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-websocket</artifactId>
+            <version>4.3.4.RELEASE</version>
+        </dependency>
+        <dependency>
+            <groupId>com.google.code.gson</groupId>
+            <artifactId>gson</artifactId>
+            <version>2.3.1</version>
+        </dependency>
+    </dependencies>
+
+</project>
diff --git a/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-websocket/src/main/java/org/openecomp/sdc/notification/websocket/NotificationWebsocketHandler.java b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-websocket/src/main/java/org/openecomp/sdc/notification/websocket/NotificationWebsocketHandler.java
new file mode 100644
index 0000000..1e42463
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-websocket/src/main/java/org/openecomp/sdc/notification/websocket/NotificationWebsocketHandler.java
@@ -0,0 +1,130 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * 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=========================================================
+ */
+
+package org.openecomp.sdc.notification.websocket;
+
+import com.google.gson.Gson;
+import org.openecomp.sdc.logging.api.Logger;
+import org.openecomp.sdc.logging.api.LoggerFactory;
+import org.openecomp.sdc.notification.types.NotificationsStatusDto;
+import org.openecomp.sdc.notification.workers.NotificationWorker;
+import org.springframework.http.HttpHeaders;
+import org.springframework.web.socket.CloseStatus;
+import org.springframework.web.socket.TextMessage;
+import org.springframework.web.socket.WebSocketSession;
+import org.springframework.web.socket.handler.TextWebSocketHandler;
+
+import java.io.IOException;
+import java.util.Objects;
+import java.util.Optional;
+import java.util.UUID;
+import java.util.function.Consumer;
+
+public class NotificationWebsocketHandler extends TextWebSocketHandler {
+
+	private static final String USER_ID_HEADER_PARAM = "USER_ID";
+	private static final String LAST_DELIVERED_QUERY_PARAM = "LAST_DELIVERED_EVENT_ID";
+	private static final String COOKIE = "Cookie";
+	private static Logger LOGGER = LoggerFactory.getLogger(NotificationWebsocketHandler.class);
+	private NotificationWorker worker;
+
+	public NotificationWebsocketHandler(NotificationWorker worker) {
+		super();
+		this.worker = Objects.requireNonNull(worker, "NotificationWorker object is not initialized.");
+	}
+
+	@Override
+    public void afterConnectionEstablished(WebSocketSession session) throws Exception {
+        super.afterConnectionEstablished(session);
+
+		String ownerId = getOwnerId(session);
+		if (ownerId == null) {
+			return;
+		}
+		UUID lastDelivered = getLastEventId(session);
+
+		Consumer<NotificationsStatusDto> notesProcessor = (notes) -> notifyReceiver(session, notes);
+
+		worker.register(ownerId, lastDelivered, notesProcessor);
+    }
+
+	@Override
+    public void afterConnectionClosed(WebSocketSession session, CloseStatus status) throws Exception {
+		String ownerId = getOwnerId(session);
+		if (ownerId != null) {
+			worker.unregister(ownerId);
+		}
+	    super.afterConnectionClosed(session, status);
+    }
+
+	private void notifyReceiver(WebSocketSession session, NotificationsStatusDto notificationsStatusDto) {
+
+		try {
+			session.sendMessage(new TextMessage(new Gson().toJson(notificationsStatusDto)));
+		} catch (IOException e) {
+			LOGGER.error("IO Exception during Receiver notification.", e);
+		}
+	}
+
+    private String getOwnerId(WebSocketSession session) {
+
+        HttpHeaders handshakeHeaders = session.getHandshakeHeaders();
+        if (handshakeHeaders.containsKey(COOKIE)) {
+			String[] cookies = handshakeHeaders.get(COOKIE).get(0).split("; ");
+			Optional<String> cookie = extractValue(cookies, USER_ID_HEADER_PARAM);
+			if (cookie.isPresent()) {
+				return cookie.get();
+			}
+		}
+
+		LOGGER.error("No " + USER_ID_HEADER_PARAM + " specified in the session cookies.");
+		return null;
+    }
+
+    private UUID getLastEventId(WebSocketSession session) {
+
+        String uriQuery = session.getUri().getQuery();
+        if (uriQuery != null) {
+
+            String[] queries = uriQuery.split("; ");
+            Optional<String> paramValue = extractValue(queries, LAST_DELIVERED_QUERY_PARAM);
+            if (paramValue.isPresent()) {
+                return UUID.fromString(paramValue.get());
+            }
+        }
+
+        LOGGER.warn("No " + LAST_DELIVERED_QUERY_PARAM + " specified in the request URI.");
+        return null;
+    }
+
+	private Optional<String> extractValue(String[] pairs, String name) {
+
+		for (String nameValuePair : pairs) {
+
+            String[] value = nameValuePair.split("=");
+            if (value[0].equals(name)) {
+                return Optional.of(value[1]);
+            }
+        }
+
+		return Optional.empty();
+	}
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-worker/pom.xml b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-worker/pom.xml
new file mode 100644
index 0000000..fb55d28
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-worker/pom.xml
@@ -0,0 +1,73 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <name>openecomp-sdc-notification-worker</name>
+    <artifactId>openecomp-sdc-notification-worker</artifactId>
+
+    <parent>
+        <groupId>org.openecomp.sdc</groupId>
+        <artifactId>openecomp-sdc-lib</artifactId>
+        <version>1.2.0-SNAPSHOT</version>
+        <relativePath>../..</relativePath>
+    </parent>
+
+    <dependencies>
+		<dependency>
+            <groupId>org.openecomp.sdc.core</groupId>
+            <artifactId>openecomp-utilities-lib</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.codehaus.jackson</groupId>
+            <artifactId>jackson-jaxrs</artifactId>
+            <version>${org.codehaus.jackson.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.codehaus.jackson</groupId>
+            <artifactId>jackson-core-asl</artifactId>
+            <version>${org.codehaus.jackson.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-websocket</artifactId>
+            <version>4.3.4.RELEASE</version>
+        </dependency>
+        <dependency>
+            <groupId>com.google.code.gson</groupId>
+            <artifactId>gson</artifactId>
+            <version>2.3.1</version>
+        </dependency>
+		<dependency>
+		    <groupId>com.googlecode.json-simple</groupId>
+		    <artifactId>json-simple</artifactId>
+		    <version>1.1</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.httpcomponents</groupId>
+			<artifactId>httpclient</artifactId>
+            <version>4.4.1</version>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.httpcomponents</groupId>
+			<artifactId>httpcore</artifactId>
+            <version>4.4.1</version>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+		<groupId>com.datastax.cassandra</groupId>
+		<artifactId>cassandra-driver-core</artifactId>
+		<version>2.0.1</version>
+		<scope>test</scope>
+		</dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+            <version>${junit.version}</version>
+        </dependency>
+    </dependencies>
+
+</project>
diff --git a/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-worker/src/main/java/org/openecomp/sdc/notification/config/ConfigurationManager.java b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-worker/src/main/java/org/openecomp/sdc/notification/config/ConfigurationManager.java
new file mode 100644
index 0000000..d960b8b
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-worker/src/main/java/org/openecomp/sdc/notification/config/ConfigurationManager.java
@@ -0,0 +1,113 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * 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=========================================================
+ */
+
+package org.openecomp.sdc.notification.config;
+
+import org.openecomp.sdc.logging.api.Logger;
+import org.openecomp.sdc.logging.api.LoggerFactory;
+import org.openecomp.sdc.tosca.services.YamlUtil;
+
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.function.BiConsumer;
+
+public class ConfigurationManager {
+
+    private static final String CONFIGURATION_YAML_FILE = "onboarding_configuration.yaml";
+    private static final String NOTIFICATIONS_CONFIG = "notifications";
+
+    private LinkedHashMap<String, Object> notificationsConfiguration;
+    private static final Logger LOGGER = LoggerFactory.getLogger(ConfigurationManager.class);
+    private static final ConfigurationManager SINGLETON = new ConfigurationManager();
+
+    public static ConfigurationManager getInstance() {
+        return SINGLETON;
+    }
+
+    private ConfigurationManager() {
+        initConfiguration();
+    }
+
+    private void initConfiguration() {
+
+        YamlUtil yamlUtil = new YamlUtil();
+        readConfigurationFromStream(yamlUtil, (filename, stream) -> {
+
+            if (stream == null) {
+                LOGGER.warn("Configuration not found: " + filename + ". Using defaults");
+                return;
+            }
+
+            Map<String, LinkedHashMap<String, Object>> configurationMap = yamlUtil.yamlToMap(stream);
+            if (configurationMap == null) {
+                LOGGER.warn("Configuration cannot be parsed: " + filename + ". Using defaults");
+                return;
+            }
+
+            notificationsConfiguration = configurationMap.get(NOTIFICATIONS_CONFIG);
+            if (notificationsConfiguration == null) {
+                LOGGER.error(NOTIFICATIONS_CONFIG +
+                        " is missing in configuration file '" + filename + "'. Using defaults");
+            }
+        });
+    }
+
+    private void readConfigurationFromStream(YamlUtil yamlUtil,
+                                             BiConsumer<String, InputStream> reader) {
+
+        String configurationYamlFile = System.getProperty(CONFIGURATION_YAML_FILE);
+
+        try {
+
+            if (configurationYamlFile == null) {
+
+                try (InputStream inputStream =
+                             yamlUtil.loadYamlFileIs("/" + CONFIGURATION_YAML_FILE)) {
+                    reader.accept(CONFIGURATION_YAML_FILE, inputStream);
+                }
+
+            } else {
+
+                try (InputStream inputStream = new FileInputStream(configurationYamlFile)) {
+                    reader.accept(configurationYamlFile, inputStream);
+                }
+            }
+
+        } catch (IOException e) {
+            LOGGER.error("Failed to read configuration", e);
+        }
+    }
+
+    public <T> T getConfigValue(String name, T defaultValue) {
+
+        Object value = notificationsConfiguration.get(name);
+
+        try {
+            return value == null ? defaultValue : (T) value;
+        } catch (ClassCastException e) {
+            LOGGER.warn(String.format("Failed to read configuration property '%s' as requested type. Using default '%s'",
+                    name, defaultValue), e);
+            return defaultValue;
+        }
+    }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-worker/src/main/java/org/openecomp/sdc/notification/types/NotificationEntityDto.java b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-worker/src/main/java/org/openecomp/sdc/notification/types/NotificationEntityDto.java
new file mode 100644
index 0000000..a415d9e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-worker/src/main/java/org/openecomp/sdc/notification/types/NotificationEntityDto.java
@@ -0,0 +1,103 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * 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=========================================================
+ */
+
+package org.openecomp.sdc.notification.types;
+
+import java.util.Map;
+import java.util.UUID;
+
+public class NotificationEntityDto {
+  private boolean read;
+  private UUID eventId;
+  private String dateTime;
+  private String eventType;
+  private Map<String, Object> eventAttributes;
+
+  public NotificationEntityDto() {
+  }
+  public NotificationEntityDto(boolean read, UUID eventId, String eventType,
+                               Map<String, Object> eventAttributes) {
+    this.read = read;
+    this.eventId = eventId;
+    this.eventType = eventType;
+    this.eventAttributes = eventAttributes;
+  }
+
+  public NotificationEntityDto(boolean read, UUID eventId,String eventType,
+                               Map<String, Object> eventAttributes, String dateTime) {
+    this.read = read;
+    this.eventId = eventId;
+    this.dateTime = dateTime;
+    this.eventType = eventType;
+    this.eventAttributes = eventAttributes;
+  }
+
+  public boolean isRead() {
+    return read;
+  }
+
+  public void setRead(boolean read) {
+    this.read = read;
+  }
+
+  public UUID getEventId() {
+    return eventId;
+  }
+
+  public void setEventId(UUID eventId) {
+    this.eventId = eventId;
+  }
+
+  public String getEventType() {
+    return eventType;
+  }
+
+  public void setEventType(String eventType) {
+    this.eventType = eventType;
+  }
+
+  public Map<String, Object> getEventAttributes() {
+    return eventAttributes;
+  }
+
+  public void setEventAttributes(Map<String, Object> eventAttributes) {
+    this.eventAttributes = eventAttributes;
+  }
+
+  public String getDateTime() {
+    return dateTime;
+  }
+
+  public void setDateTime(String dateTime) {
+    this.dateTime = dateTime;
+  }
+
+  @Override
+  public String toString() {
+    return "NotificationEntityDto {"
+        + ", state='" + (read ? "Read" : "Noread") + '\''
+        + ", dateTime='" + dateTime + '\''
+        + ", eventId='" + eventId + '\''
+        + ", eventType='" + eventType + '\''
+        + ", eventAttributes='" + eventAttributes + '\''
+        + '}';
+  }
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-worker/src/main/java/org/openecomp/sdc/notification/types/NotificationsStatusDto.java b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-worker/src/main/java/org/openecomp/sdc/notification/types/NotificationsStatusDto.java
new file mode 100644
index 0000000..fd8d320
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-worker/src/main/java/org/openecomp/sdc/notification/types/NotificationsStatusDto.java
@@ -0,0 +1,72 @@
+package org.openecomp.sdc.notification.types;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.UUID;
+
+/**
+ * @author avrahamg
+ * @since June 29, 2017
+ */
+public class NotificationsStatusDto {
+    private List<NotificationEntityDto> notifications;
+    private List<UUID> newEntries = new ArrayList<>();
+    private UUID lastScanned;
+    private UUID endOfPage;
+    private long numOfNotSeenNotifications;
+
+    public NotificationsStatusDto() {
+    }
+
+    public List<NotificationEntityDto> getNotifications() {
+        return notifications;
+    }
+
+    public void setNotifications(
+        List<NotificationEntityDto> notifications) {
+        this.notifications = notifications;
+    }
+
+    public List<UUID> getNewEntries() {
+        return newEntries;
+    }
+
+    public void setNewEntries(List<UUID> newEntries) {
+        this.newEntries = newEntries;
+    }
+
+    public UUID getLastScanned() {
+        return lastScanned;
+    }
+
+    public void setLastScanned(UUID lastScanned) {
+        this.lastScanned = lastScanned;
+    }
+
+    public UUID getEndOfPage() {
+        return endOfPage;
+    }
+
+    public void setEndOfPage(UUID endOfPage) {
+        this.endOfPage = endOfPage;
+    }
+
+    public long getNumOfNotSeenNotifications() {
+        return numOfNotSeenNotifications;
+    }
+
+    public void setNumOfNotSeenNotifications(long numOfNotSeenNotifications) {
+        this.numOfNotSeenNotifications = numOfNotSeenNotifications;
+    }
+
+    @Override
+    public String toString() {
+        return "NotificationsStatusDto{" +
+                "notifications=" + notifications +
+                ", newEntries=" + newEntries +
+                ", lastScanned=" + lastScanned +
+                ", endOfPage=" + endOfPage +
+                ", numOfNotSeenNotifications=" + numOfNotSeenNotifications +
+                '}';
+    }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspCreationDto.java b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-worker/src/main/java/org/openecomp/sdc/notification/workers/NewNotificationsReader.java
similarity index 76%
rename from openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspCreationDto.java
rename to openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-worker/src/main/java/org/openecomp/sdc/notification/workers/NewNotificationsReader.java
index f77005f..75b9f5c 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspCreationDto.java
+++ b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-worker/src/main/java/org/openecomp/sdc/notification/workers/NewNotificationsReader.java
@@ -7,9 +7,9 @@
  * 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.
@@ -18,19 +18,12 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.sdcrests.vendorsoftwareproducts.types;
+package org.openecomp.sdc.notification.workers;
 
-/**
- * Created by TALIO on 4/26/2016.
- */
-public class VspCreationDto {
-  private String vspId;
+import org.openecomp.sdc.notification.types.NotificationsStatusDto;
 
-  public String getVspId() {
-    return vspId;
-  }
+import java.util.UUID;
 
-  public void setVspId(String vspId) {
-    this.vspId = vspId;
-  }
+public interface NewNotificationsReader {
+	NotificationsStatusDto getNewNotifications(String ownerId, UUID eventId, int limit);
 }
diff --git a/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-worker/src/main/java/org/openecomp/sdc/notification/workers/NotificationReceiver.java b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-worker/src/main/java/org/openecomp/sdc/notification/workers/NotificationReceiver.java
new file mode 100644
index 0000000..ee80264
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-worker/src/main/java/org/openecomp/sdc/notification/workers/NotificationReceiver.java
@@ -0,0 +1,69 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * 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=========================================================
+ */
+
+package org.openecomp.sdc.notification.workers;
+
+import org.openecomp.sdc.notification.types.NotificationsStatusDto;
+
+import java.util.UUID;
+import java.util.function.Consumer;
+
+
+
+public class NotificationReceiver {
+
+	public String ownerId = null;
+	public Consumer<NotificationsStatusDto> notesProcessor = null;
+	public UUID lastEventId = null;
+
+	NotificationReceiver(String ownerId, UUID lastEventId, Consumer<NotificationsStatusDto> notesProcessor) {
+		this.ownerId = ownerId;
+		this.lastEventId = lastEventId;
+		this.notesProcessor = notesProcessor;
+	}
+
+	NotificationReceiver(String ownerId, Consumer<NotificationsStatusDto> notesProcessor) {
+		this(ownerId, null, notesProcessor);
+	}
+
+	public void setOwnerId(String ownerId) {
+		this.ownerId = ownerId;
+	}
+
+	public String getOwnerId() {
+		return this.ownerId;
+	}
+
+	public void setNotesProcessor(Consumer<NotificationsStatusDto> notesProcessor) {
+		this.notesProcessor = notesProcessor;
+	}
+
+	public Consumer<NotificationsStatusDto> getNotesProcessor() {
+		return this.notesProcessor;
+	}
+
+	public void setLastEventId(UUID lastEventId) {
+		this.lastEventId = lastEventId;
+	}
+
+	public UUID getlastEventId() {
+		return this.lastEventId;
+	}
+}
diff --git a/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-worker/src/main/java/org/openecomp/sdc/notification/workers/NotificationWorker.java b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-worker/src/main/java/org/openecomp/sdc/notification/workers/NotificationWorker.java
new file mode 100644
index 0000000..e8c2006
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-worker/src/main/java/org/openecomp/sdc/notification/workers/NotificationWorker.java
@@ -0,0 +1,117 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * 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=========================================================
+ */
+
+package org.openecomp.sdc.notification.workers;
+
+import org.apache.commons.collections4.CollectionUtils;
+import org.openecomp.sdc.logging.api.Logger;
+import org.openecomp.sdc.logging.api.LoggerFactory;
+import org.openecomp.sdc.notification.config.ConfigurationManager;
+import org.openecomp.sdc.notification.types.NotificationsStatusDto;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+import java.util.UUID;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.function.Consumer;
+
+public class NotificationWorker {
+
+	private static final int DEFAULT_POLLING_INTERVAL = 2000;
+	private static final String POLLING_INTERVAL = "pollingIntervalMsec";
+	private static final int DEFAULT_SELECTION_LIMIT = 10;
+	private static final String SELECTION_SIZE = "selectionSize";
+
+	private static boolean stopRunning = false;
+
+	private int selectionLimit = DEFAULT_SELECTION_LIMIT;
+	private int pollingSleepInterval = DEFAULT_POLLING_INTERVAL;
+
+	private static final Logger LOGGER = LoggerFactory.getLogger(NotificationWorker.class);
+
+	private static Map<String, NotificationReceiver> activeUsers = new ConcurrentHashMap<>();
+	private NewNotificationsReader news = null;
+
+	public NotificationWorker(NewNotificationsReader news) {
+		ConfigurationManager cm = ConfigurationManager.getInstance();
+		pollingSleepInterval = cm.getConfigValue(POLLING_INTERVAL, DEFAULT_POLLING_INTERVAL);
+		selectionLimit = cm.getConfigValue(SELECTION_SIZE, DEFAULT_SELECTION_LIMIT);
+
+		Objects.requireNonNull(news, "NotificationNews object is not initialized.");
+		this.news = news;
+
+		NotificationWorker.Poller p = new Poller();
+		Thread thread = new Thread(p);
+		thread.start();
+	}
+
+	public Map<String, NotificationReceiver> getActiveUsers() {
+		return activeUsers;
+	}
+
+	public class Poller extends Thread {
+		public void run() {
+			try {
+				while (!stopRunning) {
+					pollNotifications();
+					Thread.sleep(pollingSleepInterval);
+				}
+			}
+			catch (InterruptedException e) {
+				LOGGER.error("Interrupted Exception during Notification poller launch.", e);
+			}
+		}
+
+		private void pollNotifications() {
+
+			Map<String, NotificationReceiver> currUsers = new HashMap<>();
+			currUsers.putAll(getActiveUsers());
+
+			for (NotificationReceiver receiver : currUsers.values()) {
+				String ownerId = receiver.getOwnerId();
+				UUID eventId = receiver.getlastEventId();
+				NotificationsStatusDto status = news.getNewNotifications(ownerId, eventId, selectionLimit);
+				if(Objects.nonNull(status) && CollectionUtils.isNotEmpty(status.getNotifications())) {
+					receiver.setLastEventId(status.getLastScanned());
+					receiver.getNotesProcessor().accept(status);
+				}
+			}
+		}
+
+	}
+
+	public void register(String ownerId, UUID lastDelivered, Consumer<NotificationsStatusDto> notesProcessor) {
+		NotificationReceiver receiver = new NotificationReceiver(ownerId, lastDelivered, notesProcessor);
+		activeUsers.put(ownerId, receiver);
+		LOGGER.debug("User {} is registered with eventId: {}", ownerId, receiver.getlastEventId());
+	}
+
+	public void unregister(String ownerId) {
+		activeUsers.remove(ownerId);
+		LOGGER.debug("User {} is unregistered.", ownerId);
+	}
+
+	public void stopPolling() {
+		LOGGER.debug("Stop notification polling.");
+		stopRunning = true;
+	}
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-worker/src/main/java/org/openecomp/sdc/notification/workers/impl/NewNotificationsReaderRestImpl.java b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-worker/src/main/java/org/openecomp/sdc/notification/workers/impl/NewNotificationsReaderRestImpl.java
new file mode 100644
index 0000000..a332efa
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-worker/src/main/java/org/openecomp/sdc/notification/workers/impl/NewNotificationsReaderRestImpl.java
@@ -0,0 +1,84 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * 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=========================================================
+ */
+
+package org.openecomp.sdc.notification.workers.impl;
+
+import org.apache.http.HttpResponse;
+import org.apache.http.client.HttpClient;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.impl.client.HttpClientBuilder;
+import org.codehaus.jackson.map.ObjectMapper;
+import org.openecomp.sdc.logging.api.Logger;
+import org.openecomp.sdc.logging.api.LoggerFactory;
+import org.openecomp.sdc.notification.config.ConfigurationManager;
+import org.openecomp.sdc.notification.types.NotificationsStatusDto;
+import org.openecomp.sdc.notification.workers.NewNotificationsReader;
+
+import javax.ws.rs.core.HttpHeaders;
+import javax.ws.rs.core.MediaType;
+import java.io.InputStreamReader;
+import java.util.UUID;
+
+public class NewNotificationsReaderRestImpl implements NewNotificationsReader {
+
+    private static final String USER_ID_HEADER_PARAM = "USER_ID";
+    private static final String LAST_DELIVERED_QUERY_PARAM = "LAST_DELIVERED_EVENT_ID";
+    private static final String LIMIT_QUERY_PARAM = "NOTIFICATION_ROWS_LIMIT";
+    private static final String BE_HOST = "beHost";
+    private static final String BE_PORT = "beHttpPort";
+    private static final String DEFAULT_BE_HOST = "localhost";
+    private static final int DEFAULT_BE_PORT = 8080;
+    private static final String URL = "http://%s:%d/onboarding-api/v1.0/notifications/worker?";
+    private static final ObjectMapper mapper = new ObjectMapper();
+
+    private static String beHost;
+    private static int bePort;
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(NewNotificationsReaderRestImpl.class);
+
+    public NewNotificationsReaderRestImpl() {
+        ConfigurationManager cm = ConfigurationManager.getInstance();
+        bePort = cm.getConfigValue(BE_PORT, DEFAULT_BE_PORT);
+        beHost = cm.getConfigValue(BE_HOST, DEFAULT_BE_HOST);
+    }
+
+    public NotificationsStatusDto getNewNotifications(String ownerId, UUID eventId, int limit) {
+        HttpClient client = HttpClientBuilder.create().build();
+        String url = String.format(URL, beHost, bePort);
+
+        url = url + LIMIT_QUERY_PARAM + "=" + limit;
+        if (eventId != null) {
+            url = url + "&" + LAST_DELIVERED_QUERY_PARAM + "=" + eventId;
+        }
+
+        HttpGet request = new HttpGet(url);
+        request.addHeader(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON);
+        request.addHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON);
+        request.addHeader(USER_ID_HEADER_PARAM, ownerId);
+
+        try {
+            HttpResponse response = client.execute(request);
+            return mapper.readValue(new InputStreamReader(response.getEntity().getContent()), NotificationsStatusDto.class);
+        } catch (Exception e) {
+            LOGGER.error("Failed to execute the request {}", url, e);
+            return null;
+        }
+    }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-worker/src/main/resources/factoryConfiguration.json b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-worker/src/main/resources/factoryConfiguration.json
new file mode 100644
index 0000000..5f5693f
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-worker/src/main/resources/factoryConfiguration.json
@@ -0,0 +1,3 @@
+{
+  "org.openecomp.config.api.ConfigurationManager": "org.openecomp.config.impl.ConfigurationImpl"
+}
\ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-worker/src/main/resources/onboarding_configuration.yaml b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-worker/src/main/resources/onboarding_configuration.yaml
new file mode 100644
index 0000000..a1b7ba5
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-worker/src/main/resources/onboarding_configuration.yaml
@@ -0,0 +1,5 @@
+notifications:
+    pollingIntervalMsec: 2000
+    selectionSize: 10
+    beHost: localhost
+    beHttpPort: 8080
diff --git a/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-worker/src/test/java/org/openecomp/sdc/notification/workers/NotificationWorkerTest.java b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-worker/src/test/java/org/openecomp/sdc/notification/workers/NotificationWorkerTest.java
new file mode 100644
index 0000000..457ba07
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-worker/src/test/java/org/openecomp/sdc/notification/workers/NotificationWorkerTest.java
@@ -0,0 +1,134 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * 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=========================================================
+ */
+
+package org.openecomp.sdc.notification.workers;
+
+import com.datastax.driver.core.utils.UUIDs;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.openecomp.core.utilities.json.JsonUtil;
+import org.openecomp.sdc.notification.types.NotificationEntityDto;
+import org.openecomp.sdc.notification.types.NotificationsStatusDto;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.text.DateFormat;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.UUID;
+import java.util.function.Consumer;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+
+//import org.junit.Before;
+
+
+public class NotificationWorkerTest {
+
+    private static final String OWNER = "owner_1";
+
+    private String fileName = null;
+    private NewNotificationsReader news = this.new SimNewNotificationsReader();
+    private NotificationWorker worker = new NotificationWorker(news);
+
+    @BeforeClass
+    public static void beforeClass() throws Exception {
+    }
+
+    @Test
+    public void testBasicResourceCreation() throws IOException, InterruptedException {
+
+        Consumer<NotificationsStatusDto> notesProcessor = this::notifyReceiver;
+
+        fileName = "notification_1.csv";
+
+        worker.register(OWNER, null, notesProcessor);
+        worker.register("owner_2", null, notesProcessor);
+        worker.register("owner_3", null, notesProcessor);
+
+        int pollInterval = 2000;
+        Thread.sleep(pollInterval);
+
+        worker.unregister("owner_2");
+
+        fileName = "notification_2.csv";
+
+        Thread.sleep(pollInterval);
+
+        worker.stopPolling();
+
+    }
+
+    private void notifyReceiver(NotificationsStatusDto notes) {
+        if (Objects.nonNull(notes)) {
+            System.out.println("Received notes:");
+            System.out.println(notes);
+        }
+    }
+
+
+    private class SimNewNotificationsReader implements NewNotificationsReader {
+
+
+        private String resourcesDir = "src/test/resources/";
+
+        public NotificationsStatusDto getNewNotifications(String ownerId, UUID eventId, int limit) {
+            if (fileName == null) {
+                return null;
+            }
+            String fn = fileName;
+            fileName = null;
+
+            return getNotifications(fn);
+        }
+
+        private NotificationsStatusDto getNotifications(String fn) {
+            NotificationsStatusDto notificationsStatusDto = new NotificationsStatusDto();
+            List<NotificationEntityDto> inputList = new ArrayList<>();
+            try (BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(new File(resourcesDir + fn))))) {
+                int limit = 10;
+                inputList = br.lines().skip(1).limit(limit).map(mapToEntity).collect(Collectors.toCollection(ArrayList::new));
+            } catch (IOException e) {
+                System.err.println("getNotifications(): file " + resourcesDir + fn + " open exception: " + e.getMessage());
+            }
+            notificationsStatusDto.setNotifications(inputList);
+            notificationsStatusDto.setLastScanned(inputList.get(0).getEventId());
+            return notificationsStatusDto;
+        }
+
+        private Function<String, NotificationEntityDto> mapToEntity = (line) -> {
+            String[] p = line.split("\\|");
+            NotificationEntityDto entity = new NotificationEntityDto();
+            DateFormat formatter = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.SHORT);
+            entity.setRead(Boolean.parseBoolean(p[1]));
+            entity.setEventId(UUID.fromString(p[2]));
+            entity.setEventType(p[4]);
+            entity.setDateTime(formatter.format(UUIDs.unixTimestamp(entity.getEventId())));
+            entity.setEventAttributes(JsonUtil.json2Object(p[5], Map.class));
+            return entity;
+        };
+    }
+
+}
diff --git a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/resources/logback.xml b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-worker/src/test/resources/logback.xml
similarity index 91%
copy from openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/resources/logback.xml
copy to openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-worker/src/test/resources/logback.xml
index 9c9c06c..c1932e3 100644
--- a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/resources/logback.xml
+++ b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-worker/src/test/resources/logback.xml
@@ -9,7 +9,7 @@
     </appender>
 
     <root level="warn">
-        <appender-ref ref="STDOUT"/>
+        <appender-ref ref="STDOUT" />
     </root>
 
 </configuration>
\ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-worker/src/test/resources/notification_1.csv b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-worker/src/test/resources/notification_1.csv
new file mode 100644
index 0000000..8b7de38
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-worker/src/test/resources/notification_1.csv
@@ -0,0 +1,11 @@
+# Owner|Read|EventId|EventType|OriginatorId|EventAttributes
+owner_1|false|1dc38a90-5e85-11e7-907b-a6006ad3dba0|type_1|orig_1|{attr_1: val_1, attr_2: val_2}
+owner_1|false|1dc387d4-5e85-11e7-907b-a6006ad3dba0|type_1|orig_1|{attr_1: val_1, attr_2: val_2}
+owner_1|false|1dc38702-5e85-11e7-907b-a6006ad3dba0|type_1|orig_1|{attr_1: val_1, attr_2: val_2}
+owner_1|false|1dc385fe-5e85-11e7-907b-a6006ad3dba0|type_1|orig_1|{attr_1: val_1, attr_2: val_2}
+owner_1|false|1dc384a0-5e85-11e7-907b-a6006ad3dba0|type_1|orig_1|{attr_1: val_1, attr_2: val_2}
+owner_1|false|1dc383c4-5e85-11e7-907b-a6006ad3dba0|type_1|orig_1|{attr_1: val_1, attr_2: val_2}
+owner_1|false|1dc3818a-5e85-11e7-907b-a6006ad3dba0|type_1|orig_1|{attr_1: val_1, attr_2: val_2}
+owner_1|false|1dc380b8-5e85-11e7-907b-a6006ad3dba0|type_1|orig_1|{attr_1: val_1, attr_2: val_2}
+owner_1|false|1dc37fdc-5e85-11e7-907b-a6006ad3dba0|type_1|orig_1|{attr_1: val_1, attr_2: val_2}
+owner_1|false|1dc37ee2-5e85-11e7-907b-a6006ad3dba0|type_1|orig_1|{attr_1: val_1, attr_2: val_2}
diff --git a/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-worker/src/test/resources/notification_2.csv b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-worker/src/test/resources/notification_2.csv
new file mode 100644
index 0000000..565e80b
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-worker/src/test/resources/notification_2.csv
@@ -0,0 +1,11 @@
+# Owner|Read|EventId|EventType|OriginatorId|EventAttributes
+owner_1|false|1dc39346-5e85-11e7-907b-a6006ad3dba0|type_1|orig_1|{attr_1: val_1, attr_2: val_2}
+owner_1|false|1dc39288-5e85-11e7-907b-a6006ad3dba0|type_1|orig_1|{attr_1: val_1, attr_2: val_2}
+owner_1|false|1dc391c0-5e85-11e7-907b-a6006ad3dba0|type_1|orig_1|{attr_1: val_1, attr_2: val_2}
+owner_1|false|1dc38f2c-5e85-11e7-907b-a6006ad3dba0|type_1|orig_1|{attr_1: val_1, attr_2: val_2}
+owner_1|false|1dc38e64-5e85-11e7-907b-a6006ad3dba0|type_1|orig_1|{attr_1: val_1, attr_2: val_2}
+owner_1|false|1dc38da6-5e85-11e7-907b-a6006ad3dba0|type_1|orig_1|{attr_1: val_1, attr_2: val_2}
+owner_1|false|1dc38ce8-5e85-11e7-907b-a6006ad3dba0|type_1|orig_1|{attr_1: val_1, attr_2: val_2}
+owner_1|false|1dc38c2a-5e85-11e7-907b-a6006ad3dba0|type_1|orig_1|{attr_1: val_1, attr_2: val_2}
+owner_1|false|1dc38b62-5e85-11e7-907b-a6006ad3dba0|type_1|orig_1|{attr_1: val_1, attr_2: val_2}
+owner_1|false|1dc37c08-5e85-11e7-907b-a6006ad3dba0|type_1|orig_1|{attr_1: val_1, attr_2: val_2}
diff --git a/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-worker/src/test/resources/onboarding_configuration.yaml b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-worker/src/test/resources/onboarding_configuration.yaml
new file mode 100644
index 0000000..cc04531
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-worker/src/test/resources/onboarding_configuration.yaml
@@ -0,0 +1,5 @@
+notifications:
+    pollingIntervalMsec: 3000
+    selectionSize: 5
+    beHost: localhost
+    beHttpPort: 8080
diff --git a/openecomp-be/lib/openecomp-sdc-notification-lib/pom.xml b/openecomp-be/lib/openecomp-sdc-notification-lib/pom.xml
new file mode 100644
index 0000000..9dc0dcf
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-notification-lib/pom.xml
@@ -0,0 +1,23 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <name>openecomp-sdc-notification-lib</name>
+    <artifactId>openecomp-sdc-notification-lib</artifactId>
+
+    <packaging>pom</packaging>
+    <parent>
+        <artifactId>openecomp-sdc-lib</artifactId>
+        <groupId>org.openecomp.sdc</groupId>
+        <version>1.2.0-SNAPSHOT</version>
+        <relativePath>..</relativePath>
+    </parent>
+
+    <modules>
+        <module>openecomp-sdc-notification-api</module>
+        <module>openecomp-sdc-notification-core</module>
+        <module>openecomp-sdc-notification-worker</module>
+        <module>openecomp-sdc-notification-websocket</module>
+    </modules>
+
+</project>
diff --git a/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-core/src/main/java/org/openecomp/sdc/generator/core/services/ManualVspToscaGenerationService.java b/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-core/src/main/java/org/openecomp/sdc/generator/core/services/ManualVspToscaGenerationService.java
index 6ec7bfc..8234179 100644
--- a/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-core/src/main/java/org/openecomp/sdc/generator/core/services/ManualVspToscaGenerationService.java
+++ b/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-core/src/main/java/org/openecomp/sdc/generator/core/services/ManualVspToscaGenerationService.java
@@ -1,21 +1,5 @@
 package org.openecomp.sdc.generator.core.services;
 
-import static org.openecomp.sdc.generator.util.GeneratorConstants.ALLOWED_FLAVORS_PROPERTY;
-import static org.openecomp.sdc.generator.util.GeneratorConstants.DISK_SIZE;
-import static org.openecomp.sdc.generator.util.GeneratorConstants.DISK_SIZE_PROP_DESC_PREFIX;
-import static org.openecomp.sdc.generator.util.GeneratorConstants.IMAGES_PROPERTY;
-import static org.openecomp.sdc.generator.util.GeneratorConstants.MEM_SIZE;
-import static org.openecomp.sdc.generator.util.GeneratorConstants.MEM_SIZE_PROP_DESC_PREFIX;
-import static org.openecomp.sdc.generator.util.GeneratorConstants.NUM_CPUS;
-import static org.openecomp.sdc.generator.util.GeneratorConstants.NUM_CPUS_PROP_DESC_PREFIX;
-import static org.openecomp.sdc.generator.util.GeneratorConstants.PORT_NODE_TEMPLATE_ID_SUFFIX;
-import static org.openecomp.sdc.generator.util.GeneratorConstants.PORT_TYPE_EXTERNAL_NODE_TEMPLATE_SUFFIX;
-import static org.openecomp.sdc.generator.util.GeneratorConstants.PORT_TYPE_INTERNAL_NODE_TEMPLATE_SUFFIX;
-import static org.openecomp.sdc.generator.util.GeneratorConstants.RELEASE_VENDOR;
-import static org.openecomp.sdc.generator.util.GeneratorConstants.TOSCA_SERVICE_TEMPLATE_FILE_NAME_SUFFIX;
-import static org.openecomp.sdc.generator.util.GeneratorConstants.VNF_CONFIG_NODE_TEMPLATE_ID_SUFFIX;
-import static org.openecomp.sdc.generator.util.GeneratorConstants.VNF_NODE_TEMPLATE_ID_SUFFIX;
-
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.collections4.MapUtils;
 import org.openecomp.sdc.generator.core.utils.GeneratorUtils;
@@ -48,6 +32,22 @@
 import java.util.Objects;
 import java.util.Optional;
 
+import static org.openecomp.sdc.generator.util.GeneratorConstants.ALLOWED_FLAVORS_PROPERTY;
+import static org.openecomp.sdc.generator.util.GeneratorConstants.DISK_SIZE;
+import static org.openecomp.sdc.generator.util.GeneratorConstants.DISK_SIZE_PROP_DESC_PREFIX;
+import static org.openecomp.sdc.generator.util.GeneratorConstants.IMAGES_PROPERTY;
+import static org.openecomp.sdc.generator.util.GeneratorConstants.MEM_SIZE;
+import static org.openecomp.sdc.generator.util.GeneratorConstants.MEM_SIZE_PROP_DESC_PREFIX;
+import static org.openecomp.sdc.generator.util.GeneratorConstants.NUM_CPUS;
+import static org.openecomp.sdc.generator.util.GeneratorConstants.NUM_CPUS_PROP_DESC_PREFIX;
+import static org.openecomp.sdc.generator.util.GeneratorConstants.PORT_NODE_TEMPLATE_ID_SUFFIX;
+import static org.openecomp.sdc.generator.util.GeneratorConstants.PORT_TYPE_EXTERNAL_NODE_TEMPLATE_SUFFIX;
+import static org.openecomp.sdc.generator.util.GeneratorConstants.PORT_TYPE_INTERNAL_NODE_TEMPLATE_SUFFIX;
+import static org.openecomp.sdc.generator.util.GeneratorConstants.RELEASE_VENDOR;
+import static org.openecomp.sdc.generator.util.GeneratorConstants.TOSCA_SERVICE_TEMPLATE_FILE_NAME_SUFFIX;
+import static org.openecomp.sdc.generator.util.GeneratorConstants.VNF_CONFIG_NODE_TEMPLATE_ID_SUFFIX;
+import static org.openecomp.sdc.generator.util.GeneratorConstants.VNF_NODE_TEMPLATE_ID_SUFFIX;
+
 /**
  * The type Manual vsp tosca generator.
  */
@@ -329,7 +329,6 @@
                                          ToscaServiceModel toscaServiceModel,
                                          String substitutionNodeTypeId,
                                          String componentName) {
-    ToscaAnalyzerService toscaAnalyzerService = new ToscaAnalyzerServiceImpl();
     ServiceTemplate globalSubstitutionServiceTemplate = fetchGlobalSubstitutionServiceTemplate();
     NodeType substitutionNodeType =
         createGlobalSubstitutionNodeType(substitutionServiceTemplate, componentName);
diff --git a/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-core/src/main/java/org/openecomp/sdc/generator/core/utils/GeneratorUtils.java b/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-core/src/main/java/org/openecomp/sdc/generator/core/utils/GeneratorUtils.java
index 7e493f2..129929a 100644
--- a/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-core/src/main/java/org/openecomp/sdc/generator/core/utils/GeneratorUtils.java
+++ b/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-core/src/main/java/org/openecomp/sdc/generator/core/utils/GeneratorUtils.java
@@ -1,7 +1,5 @@
 package org.openecomp.sdc.generator.core.utils;
 
-import static org.openecomp.sdc.tosca.services.DataModelUtil.addSubstitutionNodeTypeRequirements;
-
 import org.openecomp.sdc.datatypes.error.ErrorLevel;
 import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage;
 import org.openecomp.sdc.logging.context.impl.MdcDataErrorMessage;
@@ -29,6 +27,8 @@
 import java.util.List;
 import java.util.Map;
 
+import static org.openecomp.sdc.tosca.services.DataModelUtil.addSubstitutionNodeTypeRequirements;
+
 /**
  * The type Generator utils.
  */
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/TranslationContext.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/TranslationContext.java
index 3686a51..87c578c 100644
--- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/TranslationContext.java
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/TranslationContext.java
@@ -20,7 +20,6 @@
 
 package org.openecomp.sdc.translator.datatypes.heattotosca;
 
-import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.collections.MapUtils;
 import org.openecomp.config.api.Configuration;
 import org.openecomp.config.api.ConfigurationManager;
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/ConsolidationService.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/ConsolidationService.java
index d3f2a72..628186e 100644
--- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/ConsolidationService.java
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/ConsolidationService.java
@@ -3,7 +3,6 @@
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.collections4.MapUtils;
 import org.openecomp.sdc.common.errors.CoreException;
-import org.openecomp.sdc.common.errors.ErrorCode;
 import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage;
 import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate;
 import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/HeatToToscaUtil.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/HeatToToscaUtil.java
index 895b3f9..9d875d2 100644
--- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/HeatToToscaUtil.java
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/HeatToToscaUtil.java
@@ -27,10 +27,9 @@
 import org.openecomp.core.translator.factory.HeatToToscaTranslatorFactory;
 import org.openecomp.core.utilities.file.FileContentHandler;
 import org.openecomp.core.utilities.file.FileUtils;
-import org.openecomp.sdc.common.togglz.ToggleableFeature;
-import org.openecomp.sdc.tosca.services.YamlUtil;
 import org.openecomp.core.validation.util.MessageContainerUtil;
 import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.common.togglz.ToggleableFeature;
 import org.openecomp.sdc.common.utils.SdcCommon;
 import org.openecomp.sdc.datatypes.error.ErrorLevel;
 import org.openecomp.sdc.datatypes.error.ErrorMessage;
@@ -73,9 +72,10 @@
 import org.openecomp.sdc.tosca.services.DataModelUtil;
 import org.openecomp.sdc.tosca.services.ToscaAnalyzerService;
 import org.openecomp.sdc.tosca.services.ToscaConstants;
-import org.openecomp.sdc.tosca.services.ToscaUtil;
-import org.openecomp.sdc.tosca.services.impl.ToscaAnalyzerServiceImpl;
 import org.openecomp.sdc.tosca.services.ToscaExtensionYamlUtil;
+import org.openecomp.sdc.tosca.services.ToscaUtil;
+import org.openecomp.sdc.tosca.services.YamlUtil;
+import org.openecomp.sdc.tosca.services.impl.ToscaAnalyzerServiceImpl;
 import org.openecomp.sdc.translator.datatypes.heattotosca.AttachedPropertyVal;
 import org.openecomp.sdc.translator.datatypes.heattotosca.AttachedResourceId;
 import org.openecomp.sdc.translator.datatypes.heattotosca.ReferenceType;
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/UnifiedCompositionService.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/UnifiedCompositionService.java
index 244434c..bd0fbcb 100644
--- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/UnifiedCompositionService.java
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/UnifiedCompositionService.java
@@ -20,12 +20,6 @@
 
 package org.openecomp.sdc.translator.services.heattotosca;
 
-import static org.openecomp.sdc.tosca.services.DataModelUtil.getClonedObject;
-import static org.openecomp.sdc.translator.services.heattotosca.Constants.ABSTRACT_NODE_TEMPLATE_ID_PREFIX;
-import static org.openecomp.sdc.translator.services.heattotosca.Constants.COMPUTE_IDENTICAL_VALUE_PROPERTY_PREFIX;
-import static org.openecomp.sdc.translator.services.heattotosca.Constants.COMPUTE_IDENTICAL_VALUE_PROPERTY_SUFFIX;
-import static org.openecomp.sdc.translator.services.heattotosca.Constants.PORT_IDENTICAL_VALUE_PROPERTY_PREFIX;
-
 import org.apache.commons.collections.map.HashedMap;
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.collections4.MapUtils;
@@ -94,6 +88,12 @@
 import java.util.Set;
 import java.util.regex.Pattern;
 
+import static org.openecomp.sdc.tosca.services.DataModelUtil.getClonedObject;
+import static org.openecomp.sdc.translator.services.heattotosca.Constants.ABSTRACT_NODE_TEMPLATE_ID_PREFIX;
+import static org.openecomp.sdc.translator.services.heattotosca.Constants.COMPUTE_IDENTICAL_VALUE_PROPERTY_PREFIX;
+import static org.openecomp.sdc.translator.services.heattotosca.Constants.COMPUTE_IDENTICAL_VALUE_PROPERTY_SUFFIX;
+import static org.openecomp.sdc.translator.services.heattotosca.Constants.PORT_IDENTICAL_VALUE_PROPERTY_PREFIX;
+
 public class UnifiedCompositionService {
 
   protected static Logger logger =
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/GlobalTypesServiceTemplates.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/GlobalTypesServiceTemplates.java
index 531de16..dff208f 100644
--- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/GlobalTypesServiceTemplates.java
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/GlobalTypesServiceTemplates.java
@@ -5,8 +5,8 @@
 import org.openecomp.sdc.common.errors.ErrorCode;
 import org.openecomp.sdc.logging.types.LoggerErrorDescription;
 import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
-import org.openecomp.sdc.tosca.services.ToscaUtil;
 import org.openecomp.sdc.tosca.services.ToscaExtensionYamlUtil;
+import org.openecomp.sdc.tosca.services.ToscaUtil;
 import org.openecomp.sdc.translator.utils.ResourceWalker;
 
 import java.util.HashMap;
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/helper/VolumeTranslationHelper.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/helper/VolumeTranslationHelper.java
index ef75f31..87bf36b 100644
--- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/helper/VolumeTranslationHelper.java
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/helper/VolumeTranslationHelper.java
@@ -20,8 +20,6 @@
 
 package org.openecomp.sdc.translator.services.heattotosca.helper;
 
-import static org.openecomp.sdc.heat.datatypes.model.HeatResourcesTypes.CINDER_VOLUME_RESOURCE_TYPE;
-
 import org.apache.commons.collections4.CollectionUtils;
 import org.openecomp.sdc.heat.datatypes.manifest.FileData;
 import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate;
@@ -45,6 +43,8 @@
 import java.util.function.Predicate;
 import java.util.stream.Collectors;
 
+import static org.openecomp.sdc.heat.datatypes.model.HeatResourcesTypes.CINDER_VOLUME_RESOURCE_TYPE;
+
 public class VolumeTranslationHelper {
   private final Logger logger;
   private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage();
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/functiontranslation/FunctionTranslationGetAttrImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/functiontranslation/FunctionTranslationGetAttrImpl.java
index 48d5642..1d35795 100644
--- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/functiontranslation/FunctionTranslationGetAttrImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/functiontranslation/FunctionTranslationGetAttrImpl.java
@@ -21,7 +21,6 @@
 package org.openecomp.sdc.translator.services.heattotosca.impl.functiontranslation;
 
 import org.apache.commons.lang3.StringUtils;
-import org.openecomp.sdc.tosca.services.YamlUtil;
 import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate;
 import org.openecomp.sdc.heat.datatypes.model.Resource;
 import org.openecomp.sdc.heat.services.HeatConstants;
@@ -29,6 +28,7 @@
 import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate;
 import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
 import org.openecomp.sdc.tosca.datatypes.model.Template;
+import org.openecomp.sdc.tosca.services.YamlUtil;
 import org.openecomp.sdc.translator.datatypes.heattotosca.TranslationContext;
 import org.openecomp.sdc.translator.datatypes.heattotosca.unifiedmodel.consolidation.EntityConsolidationData;
 import org.openecomp.sdc.translator.services.heattotosca.ConfigConstants;
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/functiontranslation/FunctionTranslationGetFileImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/functiontranslation/FunctionTranslationGetFileImpl.java
index bc0926c..374f8a9 100644
--- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/functiontranslation/FunctionTranslationGetFileImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/functiontranslation/FunctionTranslationGetFileImpl.java
@@ -30,8 +30,8 @@
 import org.openecomp.sdc.tosca.services.ToscaConstants;
 import org.openecomp.sdc.tosca.services.ToscaFileOutputService;
 import org.openecomp.sdc.tosca.services.impl.ToscaFileOutputServiceCsarImpl;
-import org.openecomp.sdc.translator.services.heattotosca.FunctionTranslation;
 import org.openecomp.sdc.translator.datatypes.heattotosca.TranslationContext;
+import org.openecomp.sdc.translator.services.heattotosca.FunctionTranslation;
 
 import java.util.ArrayList;
 import java.util.HashMap;
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/functiontranslation/FunctionTranslationGetParamImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/functiontranslation/FunctionTranslationGetParamImpl.java
index 877659e..184aa52 100644
--- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/functiontranslation/FunctionTranslationGetParamImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/functiontranslation/FunctionTranslationGetParamImpl.java
@@ -25,9 +25,9 @@
 import org.openecomp.sdc.tosca.datatypes.ToscaFunctions;
 import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
 import org.openecomp.sdc.tosca.datatypes.model.Template;
+import org.openecomp.sdc.translator.datatypes.heattotosca.TranslationContext;
 import org.openecomp.sdc.translator.services.heattotosca.FunctionTranslation;
 import org.openecomp.sdc.translator.services.heattotosca.FunctionTranslationFactory;
-import org.openecomp.sdc.translator.datatypes.heattotosca.TranslationContext;
 
 import java.util.ArrayList;
 import java.util.HashMap;
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/functiontranslation/FunctionTranslationGetResourceImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/functiontranslation/FunctionTranslationGetResourceImpl.java
index b2d11e3..ce160ce 100644
--- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/functiontranslation/FunctionTranslationGetResourceImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/functiontranslation/FunctionTranslationGetResourceImpl.java
@@ -23,8 +23,8 @@
 import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate;
 import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
 import org.openecomp.sdc.tosca.datatypes.model.Template;
-import org.openecomp.sdc.translator.services.heattotosca.FunctionTranslation;
 import org.openecomp.sdc.translator.datatypes.heattotosca.TranslationContext;
+import org.openecomp.sdc.translator.services.heattotosca.FunctionTranslation;
 import org.openecomp.sdc.translator.services.heattotosca.helper.FunctionTranslationHelper;
 import org.openecomp.sdc.translator.services.heattotosca.impl.resourcetranslation.ResourceTranslationBase;
 
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/BaseResourceConnection.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/BaseResourceConnection.java
index b0094b0..459c44e 100644
--- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/BaseResourceConnection.java
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/BaseResourceConnection.java
@@ -21,7 +21,6 @@
 package org.openecomp.sdc.translator.services.heattotosca.impl.resourcetranslation;
 
 import org.apache.commons.collections4.MapUtils;
-import org.openecomp.sdc.tosca.services.YamlUtil;
 import org.openecomp.sdc.common.errors.CoreException;
 import org.openecomp.sdc.common.errors.ErrorCategory;
 import org.openecomp.sdc.common.errors.ErrorCode;
@@ -44,6 +43,7 @@
 import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
 import org.openecomp.sdc.tosca.services.DataModelUtil;
 import org.openecomp.sdc.tosca.services.ToscaAnalyzerService;
+import org.openecomp.sdc.tosca.services.YamlUtil;
 import org.openecomp.sdc.tosca.services.impl.ToscaAnalyzerServiceImpl;
 import org.openecomp.sdc.translator.datatypes.heattotosca.AttachedResourceId;
 import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo;
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceConnectionUsingCapabilityHelper.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceConnectionUsingCapabilityHelper.java
index 231190a..3a3a7c7 100644
--- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceConnectionUsingCapabilityHelper.java
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceConnectionUsingCapabilityHelper.java
@@ -20,7 +20,6 @@
 
 package org.openecomp.sdc.translator.services.heattotosca.impl.resourcetranslation;
 
-import org.openecomp.sdc.common.utils.CommonUtil;
 import org.openecomp.sdc.heat.datatypes.manifest.FileData;
 import org.openecomp.sdc.heat.datatypes.model.Resource;
 import org.openecomp.sdc.tosca.datatypes.model.CapabilityDefinition;
@@ -32,7 +31,6 @@
 import org.openecomp.sdc.tosca.services.DataModelUtil;
 import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo;
 import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslatedHeatResource;
-import org.openecomp.sdc.translator.datatypes.heattotosca.unifiedmodel.consolidation.ConsolidationData;
 import org.openecomp.sdc.translator.services.heattotosca.ConsolidationDataUtil;
 import org.openecomp.sdc.translator.services.heattotosca.HeatToToscaUtil;
 import org.openecomp.sdc.translator.services.heattotosca.ResourceTranslationFactory;
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationBase.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationBase.java
index 72739d3..e439935 100644
--- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationBase.java
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationBase.java
@@ -22,7 +22,6 @@
 
 import org.apache.commons.collections4.CollectionUtils;
 import org.openecomp.sdc.common.errors.CoreException;
-import org.openecomp.sdc.common.errors.ErrorCode;
 import org.openecomp.sdc.datatypes.error.ErrorLevel;
 import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate;
 import org.openecomp.sdc.heat.datatypes.model.Resource;
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationCinderVolumeAttachmentImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationCinderVolumeAttachmentImpl.java
index 4cf817b..ea8f78a 100644
--- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationCinderVolumeAttachmentImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationCinderVolumeAttachmentImpl.java
@@ -20,8 +20,6 @@
 
 package org.openecomp.sdc.translator.services.heattotosca.impl.resourcetranslation;
 
-import static org.openecomp.sdc.translator.services.heattotosca.HeatToToscaUtil.getResource;
-
 import org.apache.commons.lang3.StringUtils;
 import org.openecomp.sdc.common.errors.CoreException;
 import org.openecomp.sdc.datatypes.error.ErrorLevel;
@@ -56,6 +54,8 @@
 import java.util.List;
 import java.util.Optional;
 
+import static org.openecomp.sdc.translator.services.heattotosca.HeatToToscaUtil.getResource;
+
 public class ResourceTranslationCinderVolumeAttachmentImpl extends ResourceTranslationBase {
   protected static Logger logger =
       (Logger) LoggerFactory.getLogger(ResourceTranslationCinderVolumeAttachmentImpl.class);
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationContrailAttachPolicyImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationContrailAttachPolicyImpl.java
index d729c04..90206cf 100644
--- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationContrailAttachPolicyImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationContrailAttachPolicyImpl.java
@@ -20,11 +20,11 @@
 
 package org.openecomp.sdc.translator.services.heattotosca.impl.resourcetranslation;
 
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.openecomp.sdc.common.errors.CoreException;
 import org.openecomp.sdc.datatypes.error.ErrorLevel;
 import org.openecomp.sdc.heat.datatypes.model.Resource;
+import org.openecomp.sdc.logging.api.Logger;
+import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.openecomp.sdc.logging.context.impl.MdcDataErrorMessage;
 import org.openecomp.sdc.logging.types.LoggerConstants;
 import org.openecomp.sdc.logging.types.LoggerErrorCode;
@@ -32,9 +32,9 @@
 import org.openecomp.sdc.logging.types.LoggerTragetServiceName;
 import org.openecomp.sdc.tosca.datatypes.ToscaCapabilityType;
 import org.openecomp.sdc.tosca.datatypes.ToscaRelationshipType;
+import org.openecomp.sdc.tosca.datatypes.ToscaTopologyTemplateElements;
 import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate;
 import org.openecomp.sdc.tosca.datatypes.model.RequirementAssignment;
-import org.openecomp.sdc.tosca.datatypes.ToscaTopologyTemplateElements;
 import org.openecomp.sdc.tosca.services.DataModelUtil;
 import org.openecomp.sdc.tosca.services.ToscaConstants;
 import org.openecomp.sdc.translator.datatypes.heattotosca.AttachedResourceId;
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationContrailV2NetworkPolicyImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationContrailV2NetworkPolicyImpl.java
index 71efc18..d12075d 100644
--- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationContrailV2NetworkPolicyImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationContrailV2NetworkPolicyImpl.java
@@ -20,7 +20,6 @@
 
 package org.openecomp.sdc.translator.services.heattotosca.impl.resourcetranslation;
 
-import org.openecomp.sdc.common.utils.CommonUtil;
 import org.openecomp.sdc.logging.api.Logger;
 import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.openecomp.sdc.tosca.datatypes.ToscaNodeType;
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationNovaServerGroupsImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationNovaServerGroupsImpl.java
index 875903f..9ed59e0 100644
--- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationNovaServerGroupsImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationNovaServerGroupsImpl.java
@@ -24,9 +24,9 @@
 import org.openecomp.sdc.heat.datatypes.model.Resource;
 import org.openecomp.sdc.tosca.datatypes.ToscaGroupType;
 import org.openecomp.sdc.tosca.datatypes.ToscaPolicyType;
+import org.openecomp.sdc.tosca.datatypes.ToscaTopologyTemplateElements;
 import org.openecomp.sdc.tosca.datatypes.model.GroupDefinition;
 import org.openecomp.sdc.tosca.datatypes.model.PolicyDefinition;
-import org.openecomp.sdc.tosca.datatypes.ToscaTopologyTemplateElements;
 import org.openecomp.sdc.tosca.services.DataModelUtil;
 import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo;
 import org.openecomp.sdc.translator.services.heattotosca.mapping.TranslatorHeatToToscaPropertyConverter;
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationNovaServerImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationNovaServerImpl.java
index 96c105c..2a2ecf9 100644
--- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationNovaServerImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationNovaServerImpl.java
@@ -44,14 +44,12 @@
 import org.openecomp.sdc.translator.datatypes.heattotosca.TranslationContext;
 import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo;
 import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslatedHeatResource;
-
 import org.openecomp.sdc.translator.datatypes.heattotosca.unifiedmodel.consolidation.ComputeTemplateConsolidationData;
 import org.openecomp.sdc.translator.services.heattotosca.ConsolidationDataUtil;
 import org.openecomp.sdc.translator.services.heattotosca.Constants;
 import org.openecomp.sdc.translator.services.heattotosca.HeatToToscaUtil;
 import org.openecomp.sdc.translator.services.heattotosca.NameExtractor;
 import org.openecomp.sdc.translator.services.heattotosca.ResourceTranslationFactory;
-
 import org.openecomp.sdc.translator.services.heattotosca.mapping.TranslatorHeatToToscaPropertyConverter;
 
 import java.util.ArrayList;
@@ -398,28 +396,23 @@
 
   private void manageNovaServerNetwork(TranslateTo translateTo,
                                        NodeTemplate novaNodeTemplate) {
+    mdcDataDebugMessage.debugEntryMessage(null, null);
 
-
-    String heatFileName = translateTo.getHeatFileName();
-    ServiceTemplate serviceTemplate = translateTo.getServiceTemplate();
-    HeatOrchestrationTemplate heatOrchestrationTemplate = translateTo
-        .getHeatOrchestrationTemplate();
     Resource resource = translateTo.getResource();
     String translatedId = translateTo.getTranslatedId();
-    TranslationContext context = translateTo.getContext();
-
-    mdcDataDebugMessage.debugEntryMessage(null, null);
 
     if (resource.getProperties() == null) {
       return;
     }
-    List<Map<String, Object>> heatNetworkList =
-        (List<Map<String, Object>>) resource.getProperties().get("networks");
-
-    if (CollectionUtils.isEmpty(heatNetworkList)) {
+    Object networks = resource.getProperties().get("networks");
+    if(Objects.isNull(networks)
+        || !(networks instanceof List)){
       return;
     }
 
+    List<Map<String, Object>> heatNetworkList =
+        (List<Map<String, Object>>) networks;
+
     for (Map<String, Object> heatNetwork : heatNetworkList) {
       getOrTranslatePortTemplate(translateTo, heatNetwork.get(
           Constants.PORT_PROPERTY_NAME), translatedId, novaNodeTemplate);
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/SecurityRulesToPortResourceConnection.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/SecurityRulesToPortResourceConnection.java
index 3d183b1..b32ea2d 100644
--- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/SecurityRulesToPortResourceConnection.java
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/SecurityRulesToPortResourceConnection.java
@@ -21,7 +21,6 @@
 package org.openecomp.sdc.translator.services.heattotosca.impl.resourcetranslation;
 
 import org.openecomp.sdc.heat.datatypes.manifest.FileData;
-
 import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate;
 import org.openecomp.sdc.heat.datatypes.model.HeatResourcesTypes;
 import org.openecomp.sdc.heat.datatypes.model.Resource;
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/TestUtils.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/TestUtils.java
index 27298ff..c7d3931 100644
--- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/TestUtils.java
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/TestUtils.java
@@ -36,7 +36,19 @@
 import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
 import org.openecomp.sdc.tosca.services.DataModelUtil;
 import org.openecomp.sdc.tosca.services.ToscaExtensionYamlUtil;
-import org.openecomp.sdc.translator.datatypes.heattotosca.unifiedmodel.consolidation.*;
+import org.openecomp.sdc.translator.datatypes.heattotosca.unifiedmodel.consolidation.ComputeConsolidationData;
+import org.openecomp.sdc.translator.datatypes.heattotosca.unifiedmodel.consolidation.ComputeTemplateConsolidationData;
+import org.openecomp.sdc.translator.datatypes.heattotosca.unifiedmodel.consolidation.ConsolidationData;
+import org.openecomp.sdc.translator.datatypes.heattotosca.unifiedmodel.consolidation.EntityConsolidationData;
+import org.openecomp.sdc.translator.datatypes.heattotosca.unifiedmodel.consolidation.FileComputeConsolidationData;
+import org.openecomp.sdc.translator.datatypes.heattotosca.unifiedmodel.consolidation.FileNestedConsolidationData;
+import org.openecomp.sdc.translator.datatypes.heattotosca.unifiedmodel.consolidation.FilePortConsolidationData;
+import org.openecomp.sdc.translator.datatypes.heattotosca.unifiedmodel.consolidation.GetAttrFuncData;
+import org.openecomp.sdc.translator.datatypes.heattotosca.unifiedmodel.consolidation.NestedConsolidationData;
+import org.openecomp.sdc.translator.datatypes.heattotosca.unifiedmodel.consolidation.NestedTemplateConsolidationData;
+import org.openecomp.sdc.translator.datatypes.heattotosca.unifiedmodel.consolidation.PortTemplateConsolidationData;
+import org.openecomp.sdc.translator.datatypes.heattotosca.unifiedmodel.consolidation.RequirementAssignmentData;
+import org.openecomp.sdc.translator.datatypes.heattotosca.unifiedmodel.consolidation.TypeComputeConsolidationData;
 
 import java.io.File;
 import java.io.FileInputStream;
@@ -45,7 +57,13 @@
 import java.io.InputStream;
 import java.net.URL;
 import java.nio.file.NotDirectoryException;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.ListIterator;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
 
 public class TestUtils {
   private static final String MANIFEST_NAME = SdcCommon.MANIFEST_NAME;
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/resources/OSNovaServerTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/resources/OSNovaServerTest.java
index ebb3450..9743483 100644
--- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/resources/OSNovaServerTest.java
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/resources/OSNovaServerTest.java
@@ -20,9 +20,6 @@
 
 package org.openecomp.sdc.translator.impl.heattotosca.resources;
 
-import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.TestConstants.TEST_PORT_POSITIVE;
-import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.TestConstants.TEST_VOLUME_POSITIVE;
-
 import org.junit.Before;
 import org.junit.Test;
 import org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.ConsolidationDataValidationType;
@@ -30,6 +27,9 @@
 
 import java.io.IOException;
 
+import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.TestConstants.TEST_PORT_POSITIVE;
+import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.TestConstants.TEST_VOLUME_POSITIVE;
+
 public class OSNovaServerTest extends BaseResourceTranslationTest {
 
   @Override
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/ConsolidationDataUtilTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/ConsolidationDataUtilTest.java
index 019d143..3f294eb 100644
--- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/ConsolidationDataUtilTest.java
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/ConsolidationDataUtilTest.java
@@ -1,6 +1,7 @@
 package org.openecomp.sdc.translator.services.heattotosca;
 
 import org.testng.annotations.Test;
+
 import static org.testng.Assert.assertEquals;
 
 public class ConsolidationDataUtilTest {
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/ConsolidationServiceTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/ConsolidationServiceTest.java
index 085c329..4af2415 100644
--- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/ConsolidationServiceTest.java
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/ConsolidationServiceTest.java
@@ -1,39 +1,5 @@
 package org.openecomp.sdc.translator.services.heattotosca;
 
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-
-import org.apache.commons.lang3.tuple.ImmutablePair;
-import org.apache.commons.lang3.tuple.Pair;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.ArgumentCaptor;
-import org.mockito.Captor;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.mockito.Spy;
-import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel;
-import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
-import org.openecomp.sdc.tosca.services.ToscaConstants;
-import org.openecomp.sdc.translator.TestUtils;
-import org.openecomp.sdc.translator.datatypes.heattotosca.TranslationContext;
-import org.openecomp.sdc.translator.datatypes.heattotosca.unifiedmodel.composition.UnifiedCompositionData;
-import org.openecomp.sdc.translator.datatypes.heattotosca.unifiedmodel.composition.UnifiedCompositionMode;
-import org.openecomp.sdc.translator.datatypes.heattotosca.unifiedmodel.consolidation.ConsolidationData;
-import org.openecomp.sdc.translator.datatypes.heattotosca.unifiedmodel.consolidation.GetAttrFuncData;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
 /**
  * Created by TALIO on 3/7/2017.
  */
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/UnifiedCompositionServiceTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/UnifiedCompositionServiceTest.java
index 69db1b2..7de9ae5 100644
--- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/UnifiedCompositionServiceTest.java
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/UnifiedCompositionServiceTest.java
@@ -1,9 +1,5 @@
 package org.openecomp.sdc.translator.services.heattotosca;
 
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Matchers.anyObject;
-import static org.mockito.Matchers.anyString;
-
 import org.apache.commons.lang3.tuple.ImmutablePair;
 import org.apache.commons.lang3.tuple.Pair;
 import org.junit.Before;
@@ -13,22 +9,40 @@
 import org.mockito.Mockito;
 import org.mockito.MockitoAnnotations;
 import org.mockito.Spy;
-import org.openecomp.sdc.tosca.services.YamlUtil;
 import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate;
 import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
 import org.openecomp.sdc.tosca.services.DataModelUtil;
 import org.openecomp.sdc.tosca.services.ToscaExtensionYamlUtil;
+import org.openecomp.sdc.tosca.services.YamlUtil;
 import org.openecomp.sdc.translator.TestUtils;
 import org.openecomp.sdc.translator.datatypes.heattotosca.TranslationContext;
 import org.openecomp.sdc.translator.datatypes.heattotosca.unifiedmodel.composition.UnifiedCompositionData;
 import org.openecomp.sdc.translator.datatypes.heattotosca.unifiedmodel.composition.UnifiedCompositionEntity;
 import org.openecomp.sdc.translator.datatypes.heattotosca.unifiedmodel.composition.UnifiedSubstitutionData;
-import org.openecomp.sdc.translator.datatypes.heattotosca.unifiedmodel.consolidation.*;
+import org.openecomp.sdc.translator.datatypes.heattotosca.unifiedmodel.consolidation.ComputeTemplateConsolidationData;
+import org.openecomp.sdc.translator.datatypes.heattotosca.unifiedmodel.consolidation.ConsolidationData;
+import org.openecomp.sdc.translator.datatypes.heattotosca.unifiedmodel.consolidation.EntityConsolidationData;
+import org.openecomp.sdc.translator.datatypes.heattotosca.unifiedmodel.consolidation.GetAttrFuncData;
+import org.openecomp.sdc.translator.datatypes.heattotosca.unifiedmodel.consolidation.NestedTemplateConsolidationData;
+import org.openecomp.sdc.translator.datatypes.heattotosca.unifiedmodel.consolidation.PortTemplateConsolidationData;
+import org.openecomp.sdc.translator.datatypes.heattotosca.unifiedmodel.consolidation.RequirementAssignmentData;
 import org.openecomp.sdc.translator.services.heattotosca.impl.unifiedcomposition.UnifiedCompositionSingleSubstitution;
 
 import java.io.IOException;
 import java.net.URL;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
+
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Matchers.anyObject;
+import static org.mockito.Matchers.anyString;
 
 public class UnifiedCompositionServiceTest {
   private static final String BASE_DIRECTORY = "/mock/services/heattotosca/unifiedComposition/";
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/buildconsolidationdata/ConsolidationDataTestUtil.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/buildconsolidationdata/ConsolidationDataTestUtil.java
index dd48e61..bb1f898 100644
--- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/buildconsolidationdata/ConsolidationDataTestUtil.java
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/buildconsolidationdata/ConsolidationDataTestUtil.java
@@ -1,19 +1,5 @@
 package org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata;
 
-import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.TestConstants.MAIN_SERVICE_TEMPLATE;
-import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.TestConstants.TEST_DEPENDS_ON_INVALID_DEPENDENCY_CANDIDATE;
-import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.TestConstants.TEST_DEPENDS_ON_MULTIPLE_COMPUTE;
-import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.TestConstants.TEST_DEPENDS_ON_NODES_CONNECTED_IN;
-import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.TestConstants.TEST_DEPENDS_ON_NODES_CONNECTED_IN_AND_OUT;
-import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.TestConstants.TEST_DEPENDS_ON_NODES_CONNECTED_OUT;
-import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.TestConstants.TEST_DEPENDS_ON_NO_DEPENDENCY;
-import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.TestConstants.TEST_MULTIPLE_MULTI_LEVEL_NESTED_RESOURCE;
-import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.TestConstants.TEST_MULTIPLE_NESTED_RESOURCE;
-import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.TestConstants.TEST_SECURITY_RULE_PORT_MULTI_LEVEL_NESTED_CONNECTION;
-import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.TestConstants.TEST_SECURITY_RULE_PORT_MULTI_LEVEL_NESTED_SHARED_PORT;
-import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.TestConstants.TEST_SECURITY_RULE_PORT_NESTED_CONNECTION;
-import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.TestConstants.TEST_SINGLE_NESTED_RESOURCE;
-
 import com.fasterxml.jackson.databind.ObjectMapper;
 import org.apache.commons.collections4.CollectionUtils;
 import org.junit.Assert;
@@ -51,6 +37,20 @@
 import java.util.Optional;
 import java.util.Set;
 
+import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.TestConstants.MAIN_SERVICE_TEMPLATE;
+import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.TestConstants.TEST_DEPENDS_ON_INVALID_DEPENDENCY_CANDIDATE;
+import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.TestConstants.TEST_DEPENDS_ON_MULTIPLE_COMPUTE;
+import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.TestConstants.TEST_DEPENDS_ON_NODES_CONNECTED_IN;
+import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.TestConstants.TEST_DEPENDS_ON_NODES_CONNECTED_IN_AND_OUT;
+import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.TestConstants.TEST_DEPENDS_ON_NODES_CONNECTED_OUT;
+import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.TestConstants.TEST_DEPENDS_ON_NO_DEPENDENCY;
+import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.TestConstants.TEST_MULTIPLE_MULTI_LEVEL_NESTED_RESOURCE;
+import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.TestConstants.TEST_MULTIPLE_NESTED_RESOURCE;
+import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.TestConstants.TEST_SECURITY_RULE_PORT_MULTI_LEVEL_NESTED_CONNECTION;
+import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.TestConstants.TEST_SECURITY_RULE_PORT_MULTI_LEVEL_NESTED_SHARED_PORT;
+import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.TestConstants.TEST_SECURITY_RULE_PORT_NESTED_CONNECTION;
+import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.TestConstants.TEST_SINGLE_NESTED_RESOURCE;
+
 public class ConsolidationDataTestUtil {
 
   public static void validateVolumeInConsolidationData(String computeNodeTemplateId,
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/helper/ContrailTranslationHelperTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/helper/ContrailTranslationHelperTest.java
index 9b4a59b..1a108ce 100644
--- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/helper/ContrailTranslationHelperTest.java
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/helper/ContrailTranslationHelperTest.java
@@ -31,7 +31,7 @@
 import java.util.Map;
 import java.util.Optional;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
 
 /**
  * @author SHIRIA
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/functiontranslation/FunctionTranslationGetFileImplTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/functiontranslation/FunctionTranslationGetFileImplTest.java
index b79671d..2a633da 100644
--- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/functiontranslation/FunctionTranslationGetFileImplTest.java
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/functiontranslation/FunctionTranslationGetFileImplTest.java
@@ -28,8 +28,8 @@
 import org.openecomp.sdc.tosca.services.ToscaConstants;
 import org.openecomp.sdc.tosca.services.ToscaFileOutputService;
 import org.openecomp.sdc.tosca.services.impl.ToscaFileOutputServiceCsarImpl;
-import org.openecomp.sdc.translator.services.heattotosca.FunctionTranslationFactory;
 import org.openecomp.sdc.translator.datatypes.heattotosca.TranslationContext;
+import org.openecomp.sdc.translator.services.heattotosca.FunctionTranslationFactory;
 
 import java.util.HashMap;
 import java.util.List;
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/functiontranslation/FunctionTranslationGetParamImplTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/functiontranslation/FunctionTranslationGetParamImplTest.java
index 981c061..860074b 100644
--- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/functiontranslation/FunctionTranslationGetParamImplTest.java
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/functiontranslation/FunctionTranslationGetParamImplTest.java
@@ -30,7 +30,8 @@
 import java.util.List;
 import java.util.Map;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
 
 public class FunctionTranslationGetParamImplTest extends BaseResourceTranslationTest {
 
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/nameextractor/NameExtractorContrailComputeImplTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/nameextractor/NameExtractorContrailComputeImplTest.java
index 9fdd2db..9a249d7 100644
--- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/nameextractor/NameExtractorContrailComputeImplTest.java
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/nameextractor/NameExtractorContrailComputeImplTest.java
@@ -23,7 +23,6 @@
 import org.junit.Assert;
 import org.junit.Test;
 import org.openecomp.sdc.heat.datatypes.model.Resource;
-import org.openecomp.sdc.translator.services.heattotosca.impl.nameextractor.NameExtractorContrailComputeImpl;
 
 import java.util.HashMap;
 import java.util.Map;
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/nameextractor/NameExtractorNovaServerImplTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/nameextractor/NameExtractorNovaServerImplTest.java
index 5823797..3095b52 100644
--- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/nameextractor/NameExtractorNovaServerImplTest.java
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/nameextractor/NameExtractorNovaServerImplTest.java
@@ -23,7 +23,6 @@
 import org.junit.Test;
 import org.openecomp.sdc.heat.datatypes.model.Resource;
 import org.openecomp.sdc.translator.services.heattotosca.Constants;
-import org.openecomp.sdc.translator.services.heattotosca.impl.nameextractor.NameExtractorNovaServerImpl;
 import org.openecomp.sdc.translator.services.heattotosca.impl.resourcetranslation.ResourceTranslationNovaServerImpl;
 
 import java.util.Arrays;
@@ -31,7 +30,7 @@
 import java.util.List;
 import java.util.Map;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertTrue;
 
 /**
  * @author SHIRIA
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/BaseResourceTranslationTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/BaseResourceTranslationTest.java
index 528db5e..dcfe127 100644
--- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/BaseResourceTranslationTest.java
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/BaseResourceTranslationTest.java
@@ -20,19 +20,6 @@
 
 package org.openecomp.sdc.translator.services.heattotosca.impl.resourcetranslation;
 
-import static org.junit.Assert.assertEquals;
-import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.ConsolidationDataTestUtil.validateComputeConnectivityIn;
-import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.ConsolidationDataTestUtil.validateComputeConnectivityOut;
-import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.ConsolidationDataTestUtil.validateDependsOnInConsolidationData;
-import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.ConsolidationDataTestUtil.validateGetAttr;
-import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.ConsolidationDataTestUtil.validateGroupsInConsolidationData;
-import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.ConsolidationDataTestUtil.validateNestedConsolidationData;
-import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.ConsolidationDataTestUtil.validatePortConnectivityIn;
-import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.ConsolidationDataTestUtil.validatePortConnectivityOut;
-import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.ConsolidationDataTestUtil.validatePortsInConsolidationData;
-import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.ConsolidationDataTestUtil.validateNestedConsolidationDataNodeTemplateIds;
-import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.ConsolidationDataTestUtil.validateVolumeInConsolidationData;
-
 import org.apache.commons.collections4.MapUtils;
 import org.junit.AfterClass;
 import org.junit.Assert;
@@ -86,6 +73,19 @@
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipInputStream;
 
+import static org.junit.Assert.assertEquals;
+import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.ConsolidationDataTestUtil.validateComputeConnectivityIn;
+import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.ConsolidationDataTestUtil.validateComputeConnectivityOut;
+import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.ConsolidationDataTestUtil.validateDependsOnInConsolidationData;
+import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.ConsolidationDataTestUtil.validateGetAttr;
+import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.ConsolidationDataTestUtil.validateGroupsInConsolidationData;
+import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.ConsolidationDataTestUtil.validateNestedConsolidationData;
+import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.ConsolidationDataTestUtil.validateNestedConsolidationDataNodeTemplateIds;
+import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.ConsolidationDataTestUtil.validatePortConnectivityIn;
+import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.ConsolidationDataTestUtil.validatePortConnectivityOut;
+import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.ConsolidationDataTestUtil.validatePortsInConsolidationData;
+import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.ConsolidationDataTestUtil.validateVolumeInConsolidationData;
+
 
 public class BaseResourceTranslationTest {
 
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/DependsOnResourceBaseTranslationlTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/DependsOnResourceBaseTranslationlTest.java
index 117dd0c..9c4c3a4 100644
--- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/DependsOnResourceBaseTranslationlTest.java
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/DependsOnResourceBaseTranslationlTest.java
@@ -20,6 +20,12 @@
 
 package org.openecomp.sdc.translator.services.heattotosca.impl.resourcetranslation;
 
+import org.junit.Before;
+import org.junit.Test;
+import org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.ConsolidationDataValidationType;
+
+import java.io.IOException;
+
 import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.TestConstants.TEST_DEPENDS_ON_INVALID_DEPENDENCY_CANDIDATE;
 import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.TestConstants.TEST_DEPENDS_ON_MULTIPLE_COMPUTE;
 import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.TestConstants.TEST_DEPENDS_ON_NODES_CONNECTED_IN;
@@ -28,12 +34,6 @@
 import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.TestConstants.TEST_DEPENDS_ON_NODE_TEMPLATE_TRANSLATION_ORDER_INVARIANCE;
 import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.TestConstants.TEST_DEPENDS_ON_NO_DEPENDENCY;
 
-import org.junit.Before;
-import org.junit.Test;
-import org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.ConsolidationDataValidationType;
-
-import java.io.IOException;
-
 
 public class DependsOnResourceBaseTranslationlTest extends BaseResourceTranslationTest {
   @Override
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationCinderVolumeAttachmentImplTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationCinderVolumeAttachmentImplTest.java
index 786b613..637b131 100644
--- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationCinderVolumeAttachmentImplTest.java
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationCinderVolumeAttachmentImplTest.java
@@ -20,15 +20,15 @@
 
 package org.openecomp.sdc.translator.services.heattotosca.impl.resourcetranslation;
 
-import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.TestConstants.TEST_VOLUME_NEGATIVE;
-import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.TestConstants.TEST_VOLUME_POSITIVE;
-
 import org.junit.Before;
 import org.junit.Test;
 import org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.ConsolidationDataValidationType;
 
 import java.io.IOException;
 
+import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.TestConstants.TEST_VOLUME_NEGATIVE;
+import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.TestConstants.TEST_VOLUME_POSITIVE;
+
 
 public class ResourceTranslationCinderVolumeAttachmentImplTest extends BaseResourceTranslationTest {
 
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationContrailV2VmInterfaceImplTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationContrailV2VmInterfaceImplTest.java
index 3e69ed1..74a6ce5 100644
--- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationContrailV2VmInterfaceImplTest.java
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationContrailV2VmInterfaceImplTest.java
@@ -20,14 +20,14 @@
 
 package org.openecomp.sdc.translator.services.heattotosca.impl.resourcetranslation;
 
-import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.TestConstants.TEST_CONNECTIVITY_POSITIVE;
-
 import org.junit.Before;
 import org.junit.Test;
 import org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.ConsolidationDataValidationType;
 
 import java.io.IOException;
 
+import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.TestConstants.TEST_CONNECTIVITY_POSITIVE;
+
 /**
  * @author Avrahamg
  * @since August 10, 2016
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationNeutronPortImplTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationNeutronPortImplTest.java
index 854a263..97a59c3 100644
--- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationNeutronPortImplTest.java
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationNeutronPortImplTest.java
@@ -20,14 +20,14 @@
 
 package org.openecomp.sdc.translator.services.heattotosca.impl.resourcetranslation;
 
-import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.TestConstants.TEST_CONNECTIVITY_POSITIVE;
-
 import org.junit.Before;
 import org.junit.Test;
 import org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.ConsolidationDataValidationType;
 
 import java.io.IOException;
 
+import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.TestConstants.TEST_CONNECTIVITY_POSITIVE;
+
 
 public class ResourceTranslationNeutronPortImplTest extends BaseResourceTranslationTest {
 
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationNovaServerGroupsImplTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationNovaServerGroupsImplTest.java
index 03b9402..6767db4 100644
--- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationNovaServerGroupsImplTest.java
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationNovaServerGroupsImplTest.java
@@ -20,14 +20,14 @@
 
 package org.openecomp.sdc.translator.services.heattotosca.impl.resourcetranslation;
 
-import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.TestConstants.TEST_GROUP_POSITIVE;
-
 import org.junit.Before;
 import org.junit.Test;
 import org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.ConsolidationDataValidationType;
 
 import java.io.IOException;
 
+import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.TestConstants.TEST_GROUP_POSITIVE;
+
 
 public class ResourceTranslationNovaServerGroupsImplTest extends BaseResourceTranslationTest {
 
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/SecurityRulesToPortResourceConnectionTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/SecurityRulesToPortResourceConnectionTest.java
index 724f624..15bf0f2 100644
--- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/SecurityRulesToPortResourceConnectionTest.java
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/SecurityRulesToPortResourceConnectionTest.java
@@ -20,14 +20,14 @@
 
 package org.openecomp.sdc.translator.services.heattotosca.impl.resourcetranslation;
 
-import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.ConsolidationDataTestUtil.validateNestedNodesConnectedInSecurityRuleToPort;
-
 import org.junit.Before;
 import org.junit.Test;
 import org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.TestConstants;
 
 import java.io.IOException;
 
+import static org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.ConsolidationDataTestUtil.validateNestedNodesConnectedInSecurityRuleToPort;
+
 
 public class SecurityRulesToPortResourceConnectionTest extends BaseResourceTranslationTest {
   @Override
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/types/GlobalValidationContext.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/types/GlobalValidationContext.java
index bc401d4..97da6ef 100644
--- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/types/GlobalValidationContext.java
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/types/GlobalValidationContext.java
@@ -22,9 +22,9 @@
 
 import org.apache.commons.collections4.CollectionUtils;
 import org.openecomp.core.validation.ErrorMessageCode;
+import org.openecomp.sdc.datatypes.error.ErrorLevel;
 import org.openecomp.sdc.logging.api.Logger;
 import org.openecomp.sdc.logging.api.LoggerFactory;
-import org.openecomp.sdc.datatypes.error.ErrorLevel;
 import org.openecomp.sdc.logging.context.MdcUtil;
 import org.openecomp.sdc.logging.types.LoggerConstants;
 import org.openecomp.sdc.logging.types.LoggerErrorCode;
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/main/java/org/openecomp/sdc/validation/impl/ValidationManagerImpl.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/main/java/org/openecomp/sdc/validation/impl/ValidationManagerImpl.java
index acb4eed..2f5a8ce 100644
--- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/main/java/org/openecomp/sdc/validation/impl/ValidationManagerImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/main/java/org/openecomp/sdc/validation/impl/ValidationManagerImpl.java
@@ -21,13 +21,13 @@
 package org.openecomp.sdc.validation.impl;
 
 import org.apache.commons.collections4.CollectionUtils;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.openecomp.core.validation.api.ValidationManager;
-import org.openecomp.sdc.validation.Validator;
 import org.openecomp.core.validation.types.GlobalValidationContext;
 import org.openecomp.core.validation.types.MessageContainer;
 import org.openecomp.sdc.datatypes.error.ErrorMessage;
+import org.openecomp.sdc.logging.api.Logger;
+import org.openecomp.sdc.logging.api.LoggerFactory;
+import org.openecomp.sdc.validation.Validator;
 import org.openecomp.sdc.validation.services.ValidationFactory;
 
 import java.util.HashMap;
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/java/org/openecomp/sdc/heat/services/tree/HeatTreeManagerTest.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/java/org/openecomp/sdc/heat/services/tree/HeatTreeManagerTest.java
index e3464db..e5d1a88 100644
--- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/java/org/openecomp/sdc/heat/services/tree/HeatTreeManagerTest.java
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/java/org/openecomp/sdc/heat/services/tree/HeatTreeManagerTest.java
@@ -20,7 +20,6 @@
 
 package org.openecomp.sdc.heat.services.tree;
 
-import org.openecomp.config.ConfigurationUtils;
 import org.openecomp.core.utilities.file.FileContentHandler;
 import org.openecomp.core.utilities.file.FileUtils;
 import org.openecomp.sdc.heat.datatypes.structure.HeatStructureTree;
@@ -33,9 +32,6 @@
 import java.io.FileInputStream;
 import java.io.IOException;
 import java.net.URL;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.stream.Collectors;
 
 
 public class HeatTreeManagerTest {
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/util/HeatValidationService.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/util/HeatValidationService.java
index 90750a4..e437892 100644
--- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/util/HeatValidationService.java
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/util/HeatValidationService.java
@@ -17,13 +17,15 @@
 package org.openecomp.sdc.validation.impl.util;
 
 import org.apache.commons.collections4.CollectionUtils;
-import org.openecomp.sdc.heat.datatypes.model.*;
-import org.openecomp.sdc.tosca.services.YamlUtil;
 import org.openecomp.core.validation.errors.ErrorMessagesFormatBuilder;
 import org.openecomp.core.validation.types.GlobalValidationContext;
 import org.openecomp.sdc.common.errors.Messages;
 import org.openecomp.sdc.datatypes.error.ErrorLevel;
 import org.openecomp.sdc.heat.datatypes.DefinedHeatParameterTypes;
+import org.openecomp.sdc.heat.datatypes.model.Environment;
+import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate;
+import org.openecomp.sdc.heat.datatypes.model.Parameter;
+import org.openecomp.sdc.heat.datatypes.model.Resource;
 import org.openecomp.sdc.logging.api.Logger;
 import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage;
@@ -32,10 +34,18 @@
 import org.openecomp.sdc.logging.types.LoggerErrorCode;
 import org.openecomp.sdc.logging.types.LoggerErrorDescription;
 import org.openecomp.sdc.logging.types.LoggerTragetServiceName;
+import org.openecomp.sdc.tosca.services.YamlUtil;
 import org.openecomp.sdc.validation.impl.validators.HeatValidator;
 
 import java.io.InputStream;
-import java.util.*;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
+import java.util.Set;
 
 
 public class HeatValidationService {
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/ContrailValidator.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/ContrailValidator.java
index 5045c80..eb23930 100644
--- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/ContrailValidator.java
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/ContrailValidator.java
@@ -22,9 +22,7 @@
 
 import org.apache.commons.collections4.MapUtils;
 import org.openecomp.core.validation.ErrorMessageCode;
-import org.openecomp.sdc.tosca.services.YamlUtil;
 import org.openecomp.core.validation.errors.ErrorMessagesFormatBuilder;
-import org.openecomp.sdc.validation.Validator;
 import org.openecomp.core.validation.types.GlobalValidationContext;
 import org.openecomp.sdc.common.errors.Messages;
 import org.openecomp.sdc.datatypes.error.ErrorLevel;
@@ -39,6 +37,8 @@
 import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage;
 import org.openecomp.sdc.logging.types.LoggerErrorDescription;
 import org.openecomp.sdc.logging.types.LoggerTragetServiceName;
+import org.openecomp.sdc.tosca.services.YamlUtil;
+import org.openecomp.sdc.validation.Validator;
 import org.openecomp.sdc.validation.tos.ContrailResourcesMappingTo;
 import org.openecomp.sdc.validation.util.ValidationUtil;
 
@@ -62,7 +62,7 @@
 
     ManifestContent manifestContent;
     try {
-      manifestContent = ValidationUtil.checkValidationPreCondition(globalContext);
+      manifestContent = ValidationUtil.validateManifest(globalContext);
     } catch (Exception exception) {
       logger.debug("",exception);
       return;
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/ForbiddenResourceGuideLineValidator.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/ForbiddenResourceGuideLineValidator.java
index 2dad766..2107825 100644
--- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/ForbiddenResourceGuideLineValidator.java
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/ForbiddenResourceGuideLineValidator.java
@@ -63,7 +63,7 @@
   public void validate(GlobalValidationContext globalContext) {
     ManifestContent manifestContent;
     try {
-      manifestContent = ValidationUtil.checkValidationPreCondition(globalContext);
+      manifestContent = ValidationUtil.validateManifest(globalContext);
     } catch (Exception exception) {
       log.debug("",exception);
       return;
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/HeatResourceValidator.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/HeatResourceValidator.java
index 10cfe35..89e96ef 100644
--- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/HeatResourceValidator.java
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/HeatResourceValidator.java
@@ -14,7 +14,6 @@
 import org.openecomp.sdc.heat.services.manifest.ManifestUtil;
 import org.openecomp.sdc.logging.api.Logger;
 import org.openecomp.sdc.logging.api.LoggerFactory;
-import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage;
 import org.openecomp.sdc.validation.ValidationContext;
 import org.openecomp.sdc.validation.base.ResourceBaseValidator;
 import org.openecomp.sdc.validation.type.ConfigConstants;
@@ -31,8 +30,7 @@
 import java.util.Set;
 
 public class HeatResourceValidator extends ResourceBaseValidator {
-  public static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage();
-  private static Logger logger = (Logger) LoggerFactory.getLogger(ResourceBaseValidator.class);
+  private static final Logger LOGGER = LoggerFactory.getLogger(ResourceBaseValidator.class);
   private static final ErrorMessageCode ERROR_CODE_HTR_1 = new ErrorMessageCode("HTR1");
 
   @Override
@@ -42,14 +40,14 @@
 
   @Override
   public ValidationContext createValidationContext(String fileName,
-                                                      String envFileName,
-                                                      HeatOrchestrationTemplate heatOrchestrationTemplate,
-                                                      GlobalValidationContext globalContext) {
+                                                   String envFileName,
+                                                   HeatOrchestrationTemplate heatOrchestrationTemplate,
+                                                   GlobalValidationContext globalContext) {
     ManifestContent manifestContent = new ManifestContent();
     try {
-      manifestContent = ValidationUtil.checkValidationPreCondition(globalContext);
+      manifestContent = ValidationUtil.validateManifest(globalContext);
     } catch (Exception exception) {
-      logger.debug("",exception);
+      LOGGER.debug("", exception);
     }
     Set<String> baseFiles = ManifestUtil.getBaseFiles(manifestContent);
     String baseFileName = CollectionUtils.isEmpty(baseFiles) ? null : baseFiles.iterator().next();
@@ -58,7 +56,7 @@
         ValidationUtil.checkHeatOrchestrationPreCondition(baseFileName, globalContext);
     Set<String> securityGroupsNamesFromBaseFileOutputs = baseFileName == null ? new HashSet<>()
         : checkForBaseFilePortsExistenceAndReturnSecurityGroupNamesFromOutputsIfNot
-            (baseFileName, baseHot, globalContext);
+            (baseHot);
 
     Map<String, Resource> resourcesMap =
         heatOrchestrationTemplate.getResources() == null ? new HashMap<>()
@@ -86,7 +84,7 @@
                                     GlobalValidationContext globalContext) {
 
     initTypeRelationsMapFromResourcesMap
-        (fileName, resourceMap, securityGroupsNamesFromBaseFileOutputs,
+        (fileName, resourceMap,
             typeToPointingResourcesMap, globalContext);
 
     initTypeRelationsMapFromOutputsMap
@@ -133,13 +131,13 @@
 
   private void initTypeRelationsMapFromResourcesMap(String fileName,
                                                     Map<String, Resource> resourceMap,
-                                                    Set<String> securityGroupsNamesFromBaseFileOutputs,
                                                     Map<String, Map<String, Map<String, List<String>>>> typeToPointingResourcesMap,
                                                     GlobalValidationContext globalContext) {
     for (Map.Entry<String, Resource> resourceEntry : resourceMap.entrySet()) {
       Resource pointingResource = resourceEntry.getValue();
       Map<String, Object> properties =
-          pointingResource.getProperties() == null ? new HashMap<>() : pointingResource.getProperties();
+          pointingResource.getProperties() == null ? new HashMap<>()
+              : pointingResource.getProperties();
 
       Set<String> referencedResourcesByGetResource =
           getResourcesIdsPointedByCurrentResource(fileName, ResourceReferenceFunctions.GET_RESOURCE,
@@ -231,9 +229,9 @@
         (pointingResourceType, new ArrayList<>());
   }
 
-  private Set<String> handleGetAttrBetweenResources(Map<String, Object> properties){
+  private Set<String> handleGetAttrBetweenResources(Map<String, Object> properties) {
     Set<String> referencedResourcesByGetAttr = new HashSet<>();
-    for(Map.Entry<String, Object> proprtyEntry : properties.entrySet()){
+    for (Map.Entry<String, Object> proprtyEntry : properties.entrySet()) {
       referencedResourcesByGetAttr.addAll(getGetAttrReferencesInCaseOfContrail(proprtyEntry
           .getValue()));
     }
@@ -242,7 +240,7 @@
   }
 
 
-  private Set<String> getGetAttrReferencesInCaseOfContrail(Object propertyValue){
+  private Set<String> getGetAttrReferencesInCaseOfContrail(Object propertyValue) {
     Object value;
     Set<String> getAttrReferences = new HashSet<>();
 
@@ -255,11 +253,11 @@
               getAttrReferences.add((String) ((List) value).get(0));
               return getAttrReferences;
             } else {
-              logger.warn("invalid format of 'get_attr' function - " + propertyValue.toString());
+              LOGGER.warn("invalid format of 'get_attr' function - " + propertyValue.toString());
             }
           }
         }
-      }else {
+      } else {
         Collection<Object> valCollection = ((Map) propertyValue).values();
         for (Object entryValue : valCollection) {
           getAttrReferences.addAll(getGetAttrReferencesInCaseOfContrail(entryValue));
@@ -294,8 +292,7 @@
   }
 
   private Set<String> checkForBaseFilePortsExistenceAndReturnSecurityGroupNamesFromOutputsIfNot(
-      String baseFileName, HeatOrchestrationTemplate heatOrchestrationTemplate,
-      GlobalValidationContext globalContext) {
+      HeatOrchestrationTemplate heatOrchestrationTemplate) {
     Set<String> securityGroupsNamesFromOutputsMap = new HashSet<>();
 
     if (heatOrchestrationTemplate != null) {
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/HeatValidator.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/HeatValidator.java
index da87a13..8064c6f 100644
--- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/HeatValidator.java
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/HeatValidator.java
@@ -23,11 +23,6 @@
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.collections4.MapUtils;
 import org.openecomp.core.validation.ErrorMessageCode;
-import org.openecomp.sdc.logging.context.impl.MdcDataErrorMessage;
-import org.openecomp.sdc.logging.types.LoggerConstants;
-import org.openecomp.sdc.logging.types.LoggerErrorCode;
-import org.openecomp.sdc.tosca.services.YamlUtil;
-import org.openecomp.sdc.validation.Validator;
 import org.openecomp.core.validation.errors.ErrorMessagesFormatBuilder;
 import org.openecomp.core.validation.types.GlobalValidationContext;
 import org.openecomp.sdc.common.errors.Messages;
@@ -48,13 +43,24 @@
 import org.openecomp.sdc.logging.api.Logger;
 import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage;
+import org.openecomp.sdc.logging.context.impl.MdcDataErrorMessage;
+import org.openecomp.sdc.logging.types.LoggerConstants;
+import org.openecomp.sdc.logging.types.LoggerErrorCode;
 import org.openecomp.sdc.logging.types.LoggerErrorDescription;
 import org.openecomp.sdc.logging.types.LoggerTragetServiceName;
+import org.openecomp.sdc.tosca.services.YamlUtil;
+import org.openecomp.sdc.validation.Validator;
 import org.openecomp.sdc.validation.impl.util.HeatValidationService;
 import org.openecomp.sdc.validation.util.ValidationUtil;
 
 import java.io.InputStream;
-import java.util.*;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
+import java.util.Set;
 
 public class HeatValidator implements Validator {
   public static final MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage();
@@ -126,91 +132,91 @@
         : heatOrchestrationTemplate.getResources().values();
     Collection<Output> outputsValues = heatOrchestrationTemplate.getOutputs() == null ? null
         : heatOrchestrationTemplate.getOutputs().values();
-        checkResourceExistenceFromResourcesMap(fileName, resourcesNames, resourcesValues,
-            globalContext);
-        checkResourceExistenceFromResourcesMap(fileName, resourcesNames, outputsValues,
-            globalContext);
+    checkResourceExistenceFromResourcesMap(fileName, resourcesNames, resourcesValues,
+        globalContext);
+    checkResourceExistenceFromResourcesMap(fileName, resourcesNames, outputsValues,
+        globalContext);
 
     mdcDataDebugMessage.debugExitMessage("file", fileName);
 
   }
 
-    private static void checkResourceExistenceFromResourcesMap(String fileName,
-                                                              Set<String> resourcesNames,
-                                                              Collection<?> valuesToSearchIn,
-                                                              GlobalValidationContext globalContext) {
+  private static void checkResourceExistenceFromResourcesMap(String fileName,
+                                                             Set<String> resourcesNames,
+                                                             Collection<?> valuesToSearchIn,
+                                                             GlobalValidationContext globalContext) {
 
-        mdcDataDebugMessage.debugEntryMessage("file", fileName);
+    mdcDataDebugMessage.debugEntryMessage("file", fileName);
 
-        if (CollectionUtils.isNotEmpty(valuesToSearchIn)) {
-            for (Object value : valuesToSearchIn) {
-                if (value instanceof Resource) {
-                  extractResourceProperty(fileName, resourcesNames, globalContext, (Resource) value);
-                } else if (value instanceof Output) {
-                    Output output = (Output) value;
-                    Object outputsValue = output.getValue();
-                    handleReferencedResources(fileName, outputsValue, resourcesNames,
-                        globalContext);
-                }
-            }
+    if (CollectionUtils.isNotEmpty(valuesToSearchIn)) {
+      for (Object value : valuesToSearchIn) {
+        if (value instanceof Resource) {
+          extractResourceProperty(fileName, resourcesNames, globalContext, (Resource) value);
+        } else if (value instanceof Output) {
+          Output output = (Output) value;
+          Object outputsValue = output.getValue();
+          handleReferencedResources(fileName, outputsValue, resourcesNames,
+              globalContext);
         }
+      }
     }
+  }
 
   private static void extractResourceProperty(String fileName, Set<String> resourcesNames,
                                               GlobalValidationContext globalContext,
                                               Resource value) {
     Resource resource = value;
     Collection<Object> resourcePropertiesValues =
-            resource.getProperties() == null ? null : resource.getProperties()
-                .values();
+        resource.getProperties() == null ? null : resource.getProperties()
+            .values();
     if (CollectionUtils.isNotEmpty(resourcePropertiesValues)) {
-        for (Object propertyValue : resourcePropertiesValues) {
-            handleReferencedResources(fileName, propertyValue, resourcesNames,
-                globalContext);
-        }
+      for (Object propertyValue : resourcePropertiesValues) {
+        handleReferencedResources(fileName, propertyValue, resourcesNames,
+            globalContext);
+      }
     }
   }
 
   private static void handleReferencedResources(String fileName, Object valueToSearchReferencesIn,
-                                                  Set<String> resourcesNames,
-                                                  GlobalValidationContext globalContext) {
+                                                Set<String> resourcesNames,
+                                                GlobalValidationContext globalContext) {
 
 
-        mdcDataDebugMessage.debugEntryMessage("file", fileName);
-        globalContext.setMessageCode(ERROR_CODE_HOT_13);
-        Set<String> referencedResourcesNames = HeatStructureUtil
-                .getReferencedValuesByFunctionName(fileName,
-                        ResourceReferenceFunctions.GET_RESOURCE.getFunction(),
-                    valueToSearchReferencesIn, globalContext);
-        if (CollectionUtils.isNotEmpty(referencedResourcesNames)) {
-            checkIfResourceReferenceExist(fileName, resourcesNames, referencedResourcesNames,
-                    globalContext);
-        }
-
-        mdcDataDebugMessage.debugExitMessage("file", fileName);
+    mdcDataDebugMessage.debugEntryMessage("file", fileName);
+    globalContext.setMessageCode(ERROR_CODE_HOT_13);
+    Set<String> referencedResourcesNames = HeatStructureUtil
+        .getReferencedValuesByFunctionName(fileName,
+            ResourceReferenceFunctions.GET_RESOURCE.getFunction(),
+            valueToSearchReferencesIn, globalContext);
+    if (CollectionUtils.isNotEmpty(referencedResourcesNames)) {
+      checkIfResourceReferenceExist(fileName, resourcesNames, referencedResourcesNames,
+          globalContext);
     }
 
-    private static void checkIfResourceReferenceExist(String fileName,
-                                                      Set<String> referencedResourcesNames,
-                                                      Set<String> referencedResources,
-                                                      GlobalValidationContext globalContext) {
+    mdcDataDebugMessage.debugExitMessage("file", fileName);
+  }
+
+  private static void checkIfResourceReferenceExist(String fileName,
+                                                    Set<String> referencedResourcesNames,
+                                                    Set<String> referencedResources,
+                                                    GlobalValidationContext globalContext) {
 
 
-        mdcDataDebugMessage.debugEntryMessage("file", fileName);
+    mdcDataDebugMessage.debugEntryMessage("file", fileName);
 
-        referencedResources.stream()
-                .filter(referencedResource -> !referencedResourcesNames.contains(referencedResource))
-                .forEach(referencedResource -> {
-                    globalContext.addMessage(fileName,
-                        ErrorLevel.ERROR, ErrorMessagesFormatBuilder
-                            .getErrorWithParameters(ERROR_CODE_HOT_16,Messages
-                            .REFERENCED_RESOURCE_NOT_FOUND.getErrorMessage(), referencedResource),
-                            LoggerTragetServiceName.VALIDATE_RESOURCE_REFERENCE_EXISTENCE,
-                            LoggerErrorDescription.RESOURCE_NOT_FOUND);
-                });
+    referencedResources.stream()
+        .filter(referencedResource -> !referencedResourcesNames.contains(referencedResource))
+        .forEach(referencedResource -> {
+          globalContext.addMessage(fileName,
+              ErrorLevel.ERROR, ErrorMessagesFormatBuilder
+                  .getErrorWithParameters(ERROR_CODE_HOT_16,Messages
+                      .REFERENCED_RESOURCE_NOT_FOUND.getErrorMessage(), referencedResource),
+              LoggerTragetServiceName.VALIDATE_RESOURCE_REFERENCE_EXISTENCE,
+              LoggerErrorDescription.RESOURCE_NOT_FOUND);
+        });
 
-        mdcDataDebugMessage.debugExitMessage("file", fileName);
-    }
+    mdcDataDebugMessage.debugExitMessage("file", fileName);
+  }
 
   /* validation 16 */
 
@@ -294,79 +300,79 @@
     mdcDataDebugMessage.debugExitMessage("file", fileName);
   }
 
-    private static void loopOverOutputMapAndValidateGetAttrFromNested(String fileName,
-                                                                     Map<String, Output> outputMap,
-                                                                     HeatOrchestrationTemplate
-                                                                             heatOrchestrationTemplate,
-                                                                     GlobalValidationContext
-                                                                             globalContext) {
-        for (Output output : outputMap.values()) {
-            Object outputValue = output.getValue();
-            if (outputValue != null && outputValue instanceof Map) {
-                Map<String, Object> outputValueMap = (Map<String, Object>) outputValue;
-                List<String> getAttrValue =
-                        (List<String>) outputValueMap.get(
-                            ResourceReferenceFunctions.GET_ATTR.getFunction());
-                if (!CollectionUtils.isEmpty(getAttrValue)) {
-                    String resourceName = getAttrValue.get(0);
-                    Object attNameObject = getAttrValue.get(1);
-                    if (!(attNameObject instanceof String)) {
-                        return;
-                    }
-                    String attName = getAttrValue.get(1);
-                    String resourceType =
-                            getResourceTypeFromResourcesMap(resourceName, heatOrchestrationTemplate);
-
-                    if (Objects.nonNull(resourceType)
-                            && HeatValidationService.isNestedResource(resourceType)) {
-                        handleGetAttrNestedResource(fileName, globalContext, resourceName, attName,
-                                resourceType);
-                    }
-                }
-            }
-        }
-    }
-
-    private static void handleGetAttrNestedResource(String fileName,
-                                                    GlobalValidationContext globalContext,
-                                                    String resourceName, String attName,
-                                                    String resourceType) {
-        Map<String, Output> nestedOutputMap;
-        HeatOrchestrationTemplate nestedHeatOrchestrationTemplate;
-        try {
-            Optional<InputStream> fileContent = globalContext.getFileContent(resourceType);
-            if (fileContent.isPresent()) {
-                nestedHeatOrchestrationTemplate =
-                        new YamlUtil().yamlToObject(fileContent.get(), HeatOrchestrationTemplate.class);
-            } else {
-                MdcDataErrorMessage
-                        .createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_API,
-                                LoggerTragetServiceName.VALIDATE_GET_ATTR_FROM_NESTED,
-                                ErrorLevel.ERROR.name(), LoggerErrorCode.DATA_ERROR.getErrorCode(),
-                                LoggerErrorDescription.EMPTY_FILE);
-                throw new Exception("The file '" + resourceType + "' has no content");
-            }
-        } catch (Exception exception) {
-            logger.debug("",exception);
+  private static void loopOverOutputMapAndValidateGetAttrFromNested(String fileName,
+                                                                    Map<String, Output> outputMap,
+                                                                    HeatOrchestrationTemplate
+                                                                        heatOrchestrationTemplate,
+                                                                    GlobalValidationContext
+                                                                        globalContext) {
+    for (Output output : outputMap.values()) {
+      Object outputValue = output.getValue();
+      if (outputValue != null && outputValue instanceof Map) {
+        Map<String, Object> outputValueMap = (Map<String, Object>) outputValue;
+        List<String> getAttrValue =
+            (List<String>) outputValueMap.get(
+                ResourceReferenceFunctions.GET_ATTR.getFunction());
+        if (!CollectionUtils.isEmpty(getAttrValue)) {
+          String resourceName = getAttrValue.get(0);
+          Object attNameObject = getAttrValue.get(1);
+          if (!(attNameObject instanceof String)) {
             return;
-        }
-        nestedOutputMap = nestedHeatOrchestrationTemplate.getOutputs();
+          }
+          String attName = getAttrValue.get(1);
+          String resourceType =
+              getResourceTypeFromResourcesMap(resourceName, heatOrchestrationTemplate);
 
-        if (MapUtils.isEmpty(nestedOutputMap) || !nestedOutputMap.containsKey(attName)) {
-            globalContext.addMessage(fileName, ErrorLevel.ERROR, ErrorMessagesFormatBuilder
-                            .getErrorWithParameters(ERROR_CODE_HOT_17,Messages.
-                                    GET_ATTR_NOT_FOUND.getErrorMessage(),
-                                    attName, resourceName),
-                    LoggerTragetServiceName.VALIDATE_GET_ATTR_FROM_NESTED,
-                    LoggerErrorDescription.GET_ATTR_NOT_FOUND);
+          if (Objects.nonNull(resourceType)
+              && HeatValidationService.isNestedResource(resourceType)) {
+            handleGetAttrNestedResource(fileName, globalContext, resourceName, attName,
+                resourceType);
+          }
         }
+      }
     }
+  }
 
-    private static String getResourceTypeFromResourcesMap(String resourceName,
-                                                          HeatOrchestrationTemplate
-                                                                  heatOrchestrationTemplate) {
-        return heatOrchestrationTemplate.getResources().get(resourceName).getType();
+  private static void handleGetAttrNestedResource(String fileName,
+                                                  GlobalValidationContext globalContext,
+                                                  String resourceName, String attName,
+                                                  String resourceType) {
+    Map<String, Output> nestedOutputMap;
+    HeatOrchestrationTemplate nestedHeatOrchestrationTemplate;
+    try {
+      Optional<InputStream> fileContent = globalContext.getFileContent(resourceType);
+      if (fileContent.isPresent()) {
+        nestedHeatOrchestrationTemplate =
+            new YamlUtil().yamlToObject(fileContent.get(), HeatOrchestrationTemplate.class);
+      } else {
+        MdcDataErrorMessage
+            .createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_API,
+                LoggerTragetServiceName.VALIDATE_GET_ATTR_FROM_NESTED,
+                ErrorLevel.ERROR.name(), LoggerErrorCode.DATA_ERROR.getErrorCode(),
+                LoggerErrorDescription.EMPTY_FILE);
+        throw new Exception("The file '" + resourceType + "' has no content");
+      }
+    } catch (Exception exception) {
+      logger.debug("",exception);
+      return;
     }
+    nestedOutputMap = nestedHeatOrchestrationTemplate.getOutputs();
+
+    if (MapUtils.isEmpty(nestedOutputMap) || !nestedOutputMap.containsKey(attName)) {
+      globalContext.addMessage(fileName, ErrorLevel.ERROR, ErrorMessagesFormatBuilder
+              .getErrorWithParameters(ERROR_CODE_HOT_17,Messages.
+                      GET_ATTR_NOT_FOUND.getErrorMessage(),
+                  attName, resourceName),
+          LoggerTragetServiceName.VALIDATE_GET_ATTR_FROM_NESTED,
+          LoggerErrorDescription.GET_ATTR_NOT_FOUND);
+    }
+  }
+
+  private static String getResourceTypeFromResourcesMap(String resourceName,
+                                                        HeatOrchestrationTemplate
+                                                            heatOrchestrationTemplate) {
+    return heatOrchestrationTemplate.getResources().get(resourceName).getType();
+  }
 
   /* validation 17 + */
   private static void validateEnvFile(String fileName, String envFileName,
@@ -416,7 +422,7 @@
           if (parametersNames != null && !parametersNames.contains(envParameter)) {
             globalContext.addMessage(envFile, ErrorLevel.ERROR, ErrorMessagesFormatBuilder
                     .getErrorWithParameters(
-                            ERROR_CODE_HOT_3,Messages.
+                        ERROR_CODE_HOT_3,Messages.
                             ENV_INCLUDES_PARAMETER_NOT_IN_HEAT.getErrorMessage(), envFile,
                         envParameter), LoggerTragetServiceName.VALIDATE_ENV_FILE,
                 LoggerErrorDescription.ENV_PARAMETER_NOT_IN_HEAT);
@@ -459,7 +465,7 @@
           if (!isValueMatchDefault) {
             globalContext.addMessage(fileName, ErrorLevel.ERROR, ErrorMessagesFormatBuilder
                     .getErrorWithParameters(
-                            ERROR_CODE_HOT_4,Messages.
+                        ERROR_CODE_HOT_4,Messages.
                             PARAMETER_DEFAULT_VALUE_NOT_ALIGN_WITH_TYPE.getErrorMessage(),
                         parameterEntry.getKey(), parameterType),
                 LoggerTragetServiceName.VALIDATE_PARAMTER_DEFAULT_MATCH_TYPE,
@@ -495,7 +501,7 @@
               .isValueIsFromGivenType(parameterEnvValue, parameterType)) {
             globalContext.addMessage(envFile, ErrorLevel.ERROR, ErrorMessagesFormatBuilder
                     .getErrorWithParameters(
-                            ERROR_CODE_HOT_5,Messages.
+                        ERROR_CODE_HOT_5,Messages.
                             PARAMETER_ENV_VALUE_NOT_ALIGN_WITH_TYPE.getErrorMessage(),
                         parameterName), LoggerTragetServiceName.VALIDATE_ENV_PARAMETER_MATCH_TYPE,
                 LoggerErrorDescription.PARAMETER_DEFAULT_VALUE_NOT_ALIGNED_WITH_TYPE);
@@ -513,7 +519,7 @@
     mdcDataDebugMessage.debugEntryMessage(null, null);
     ManifestContent manifestContent;
     try {
-      manifestContent = ValidationUtil.checkValidationPreCondition(globalContext);
+      manifestContent = ValidationUtil.validateManifest(globalContext);
     } catch (Exception exception) {
       logger.debug("",exception);
       return;
@@ -546,9 +552,9 @@
         .filter(fileName -> isManifestArtifact(manifestArtifacts, fileName) &&
             isNotArtifact(artifacts, fileName))
         .forEach(fileName -> globalContext.addMessage(fileName, ErrorLevel.WARNING,
-                ErrorMessagesFormatBuilder
-                        .getErrorWithParameters(ERROR_CODE_HOT_11,
-                                Messages.ARTIFACT_FILE_NOT_REFERENCED.getErrorMessage()),
+            ErrorMessagesFormatBuilder
+                .getErrorWithParameters(ERROR_CODE_HOT_11,
+                    Messages.ARTIFACT_FILE_NOT_REFERENCED.getErrorMessage()),
             LoggerTragetServiceName.CHECK_FOR_ORPHAN_ARTIFACTS,
             LoggerErrorDescription.ARTIFACT_NOT_REFERENCED));
 
@@ -567,10 +573,10 @@
   private void validate(String fileName, String envFileName, String baseFileName,
                         Set<String> artifacts, Set<String> securityGroupsNamesFromBaseFileOutputs,
                         GlobalValidationContext globalContext) {
-      globalContext.setMessageCode(ERROR_CODE_HOT_12);
+    globalContext.setMessageCode(ERROR_CODE_HOT_12);
     HeatOrchestrationTemplate
         heatOrchestrationTemplate = ValidationUtil.checkHeatOrchestrationPreCondition(
-            fileName, globalContext);
+        fileName, globalContext);
 
 
     if (heatOrchestrationTemplate != null) {
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/ManifestValidator.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/ManifestValidator.java
index 2ad2f9a..e3a35af 100644
--- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/ManifestValidator.java
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/ManifestValidator.java
@@ -22,7 +22,6 @@
 
 import org.openecomp.core.utilities.json.JsonUtil;
 import org.openecomp.core.validation.ErrorMessageCode;
-import org.openecomp.sdc.validation.Validator;
 import org.openecomp.core.validation.errors.ErrorMessagesFormatBuilder;
 import org.openecomp.core.validation.types.GlobalValidationContext;
 import org.openecomp.sdc.common.errors.Messages;
@@ -38,6 +37,7 @@
 import org.openecomp.sdc.logging.types.LoggerErrorCode;
 import org.openecomp.sdc.logging.types.LoggerErrorDescription;
 import org.openecomp.sdc.logging.types.LoggerTragetServiceName;
+import org.openecomp.sdc.validation.Validator;
 
 import java.io.InputStream;
 import java.util.ArrayList;
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/NamingConventionGuideLineValidator.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/NamingConventionGuideLineValidator.java
index 724b7e4..43e8e94 100644
--- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/NamingConventionGuideLineValidator.java
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/NamingConventionGuideLineValidator.java
@@ -1,8 +1,8 @@
 package org.openecomp.sdc.validation.impl.validators;
 
-import org.openecomp.sdc.validation.ValidationContext;
 import org.openecomp.core.validation.types.GlobalValidationContext;
 import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate;
+import org.openecomp.sdc.validation.ValidationContext;
 import org.openecomp.sdc.validation.base.ResourceBaseValidator;
 import org.openecomp.sdc.validation.type.ConfigConstants;
 import org.openecomp.sdc.validation.type.NamingConventionValidationContext;
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/SharedResourceGuideLineValidator.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/SharedResourceGuideLineValidator.java
index 424f8d3..fb7d6a2 100644
--- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/SharedResourceGuideLineValidator.java
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/SharedResourceGuideLineValidator.java
@@ -3,13 +3,10 @@
 import org.apache.commons.collections4.CollectionUtils;
 import org.openecomp.core.utilities.CommonMethods;
 import org.openecomp.core.validation.ErrorMessageCode;
-import org.openecomp.sdc.common.utils.SdcCommon;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
-import org.openecomp.sdc.validation.Validator;
 import org.openecomp.core.validation.errors.ErrorMessagesFormatBuilder;
 import org.openecomp.core.validation.types.GlobalValidationContext;
 import org.openecomp.sdc.common.errors.Messages;
+import org.openecomp.sdc.common.utils.SdcCommon;
 import org.openecomp.sdc.datatypes.error.ErrorLevel;
 import org.openecomp.sdc.heat.datatypes.manifest.FileData;
 import org.openecomp.sdc.heat.datatypes.manifest.ManifestContent;
@@ -18,9 +15,12 @@
 import org.openecomp.sdc.heat.datatypes.model.ResourceReferenceFunctions;
 import org.openecomp.sdc.heat.services.HeatStructureUtil;
 import org.openecomp.sdc.heat.services.manifest.ManifestUtil;
+import org.openecomp.sdc.logging.api.Logger;
+import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage;
 import org.openecomp.sdc.logging.types.LoggerErrorDescription;
 import org.openecomp.sdc.logging.types.LoggerTragetServiceName;
+import org.openecomp.sdc.validation.Validator;
 import org.openecomp.sdc.validation.util.ValidationUtil;
 
 import java.util.HashSet;
@@ -44,7 +44,7 @@
   public void validate(GlobalValidationContext globalContext) {
     ManifestContent manifestContent;
     try {
-      manifestContent = ValidationUtil.checkValidationPreCondition(globalContext);
+      manifestContent = ValidationUtil.validateManifest(globalContext);
     } catch (Exception exception) {
       log.debug("",exception);
       return;
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/YamlValidator.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/YamlValidator.java
index c0468f8..ab2e427 100644
--- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/YamlValidator.java
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/YamlValidator.java
@@ -21,8 +21,6 @@
 package org.openecomp.sdc.validation.impl.validators;
 
 import org.openecomp.core.validation.ErrorMessageCode;
-import org.openecomp.sdc.tosca.services.YamlUtil;
-import org.openecomp.sdc.validation.Validator;
 import org.openecomp.core.validation.errors.ErrorMessagesFormatBuilder;
 import org.openecomp.core.validation.types.GlobalValidationContext;
 import org.openecomp.sdc.common.errors.Messages;
@@ -32,6 +30,8 @@
 import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage;
 import org.openecomp.sdc.logging.types.LoggerErrorDescription;
 import org.openecomp.sdc.logging.types.LoggerTragetServiceName;
+import org.openecomp.sdc.tosca.services.YamlUtil;
+import org.openecomp.sdc.validation.Validator;
 import org.openecomp.sdc.validation.impl.util.YamlValidatorUtil;
 
 import java.io.InputStream;
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/heatresource/NovaServerResourceValidator.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/heatresource/NovaServerResourceValidator.java
index 9c9f4bc..33d20d5 100644
--- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/heatresource/NovaServerResourceValidator.java
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/heatresource/NovaServerResourceValidator.java
@@ -2,7 +2,6 @@
 
 import org.apache.commons.collections4.MapUtils;
 import org.openecomp.core.validation.ErrorMessageCode;
-import org.openecomp.sdc.validation.ResourceValidator;
 import org.openecomp.core.validation.errors.ErrorMessagesFormatBuilder;
 import org.openecomp.core.validation.types.GlobalValidationContext;
 import org.openecomp.sdc.common.errors.Messages;
@@ -15,6 +14,7 @@
 import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage;
 import org.openecomp.sdc.logging.types.LoggerErrorDescription;
 import org.openecomp.sdc.logging.types.LoggerTragetServiceName;
+import org.openecomp.sdc.validation.ResourceValidator;
 import org.openecomp.sdc.validation.ValidationContext;
 import org.openecomp.sdc.validation.type.HeatResourceValidationContext;
 
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/namingconvention/NovaServerNamingConventionGuideLineValidator.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/namingconvention/NovaServerNamingConventionGuideLineValidator.java
index b98b6d6..795bdf0 100644
--- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/namingconvention/NovaServerNamingConventionGuideLineValidator.java
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/namingconvention/NovaServerNamingConventionGuideLineValidator.java
@@ -1,7 +1,5 @@
 package org.openecomp.sdc.validation.impl.validators.namingconvention;
 
-import static java.util.Objects.nonNull;
-
 import org.apache.commons.collections4.MapUtils;
 import org.apache.commons.lang3.tuple.ImmutablePair;
 import org.apache.commons.lang3.tuple.Pair;
@@ -36,6 +34,8 @@
 import java.util.Objects;
 import java.util.TreeMap;
 
+import static java.util.Objects.nonNull;
+
 public class NovaServerNamingConventionGuideLineValidator implements ResourceValidator {
   private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage();
   private static final ErrorMessageCode ERROR_CODE_NNS1 = new ErrorMessageCode("NNS1");
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/ContrailValidatorTest.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/ContrailValidatorTest.java
index f921102..96db0fd 100644
--- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/ContrailValidatorTest.java
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/ContrailValidatorTest.java
@@ -20,9 +20,9 @@
 
 package org.openecomp.sdc.validation.impl.validators;
 
-import org.openecomp.sdc.validation.Validator;
 import org.openecomp.core.validation.types.MessageContainer;
 import org.openecomp.sdc.datatypes.error.ErrorMessage;
+import org.openecomp.sdc.validation.Validator;
 import org.openecomp.sdc.validation.util.ValidationTestUtil;
 import org.testng.Assert;
 import org.testng.annotations.Test;
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/ErrorMessagesTest.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/ErrorMessagesTest.java
index 64b3d2b..5c2c0c0 100644
--- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/ErrorMessagesTest.java
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/ErrorMessagesTest.java
@@ -21,10 +21,10 @@
 package org.openecomp.sdc.validation.impl.validators;
 
 import org.junit.Test;
+import org.openecomp.core.validation.ErrorMessageCode;
 import org.openecomp.core.validation.errors.ErrorMessagesFormatBuilder;
 import org.openecomp.sdc.common.errors.Messages;
 import org.testng.Assert;
-import org.openecomp.core.validation.ErrorMessageCode;
 
 
 public class ErrorMessagesTest {
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/HeatValidatorTest.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/HeatValidatorTest.java
index a523627..2ec119e 100644
--- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/HeatValidatorTest.java
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/HeatValidatorTest.java
@@ -21,8 +21,8 @@
 package org.openecomp.sdc.validation.impl.validators;
 
 
-import org.openecomp.sdc.validation.Validator;
 import org.openecomp.core.validation.types.MessageContainer;
+import org.openecomp.sdc.validation.Validator;
 import org.openecomp.sdc.validation.util.ValidationTestUtil;
 import org.testng.Assert;
 import org.testng.annotations.Test;
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/SharedResourceGuideLineValidatorTest.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/SharedResourceGuideLineValidatorTest.java
index e7c2d37..58400b9 100644
--- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/SharedResourceGuideLineValidatorTest.java
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/SharedResourceGuideLineValidatorTest.java
@@ -1,7 +1,7 @@
 package org.openecomp.sdc.validation.impl.validators;
 
-import org.openecomp.sdc.validation.Validator;
 import org.openecomp.core.validation.types.MessageContainer;
+import org.openecomp.sdc.validation.Validator;
 import org.openecomp.sdc.validation.util.ValidationTestUtil;
 import org.testng.Assert;
 import org.testng.annotations.Test;
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/namingconvention/ContrailServiceTemplateNamingConventionValidatorTest.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/namingconvention/ContrailServiceTemplateNamingConventionValidatorTest.java
index 681c54b..0db8c22 100644
--- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/namingconvention/ContrailServiceTemplateNamingConventionValidatorTest.java
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/namingconvention/ContrailServiceTemplateNamingConventionValidatorTest.java
@@ -1,9 +1,8 @@
 package org.openecomp.sdc.validation.impl.validators.namingconvention;
 
-import org.openecomp.sdc.validation.impl.validators.HeatResourceValidator;
-
 import org.openecomp.core.validation.types.MessageContainer;
 import org.openecomp.sdc.heat.datatypes.model.HeatResourcesTypes;
+import org.openecomp.sdc.validation.impl.validators.HeatResourceValidator;
 import org.openecomp.sdc.validation.util.ValidationTestUtil;
 import org.testng.Assert;
 import org.testng.annotations.Test;
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/namingconvention/NeutronPortNamingConventionValidatorTest.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/namingconvention/NeutronPortNamingConventionValidatorTest.java
index 1a7b608..3837f3b 100644
--- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/namingconvention/NeutronPortNamingConventionValidatorTest.java
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/namingconvention/NeutronPortNamingConventionValidatorTest.java
@@ -1,9 +1,8 @@
 package org.openecomp.sdc.validation.impl.validators.namingconvention;
 
-import org.openecomp.sdc.validation.impl.validators.NamingConventionGuideLineValidator;
-
 import org.openecomp.core.validation.types.MessageContainer;
 import org.openecomp.sdc.heat.datatypes.model.HeatResourcesTypes;
+import org.openecomp.sdc.validation.impl.validators.NamingConventionGuideLineValidator;
 import org.openecomp.sdc.validation.util.ValidationTestUtil;
 import org.testng.Assert;
 import org.testng.annotations.Test;
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-sdk/src/main/java/org/openecomp/sdc/validation/base/ResourceBaseValidator.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-sdk/src/main/java/org/openecomp/sdc/validation/base/ResourceBaseValidator.java
index c4d6f88..68c1b74 100644
--- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-sdk/src/main/java/org/openecomp/sdc/validation/base/ResourceBaseValidator.java
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-sdk/src/main/java/org/openecomp/sdc/validation/base/ResourceBaseValidator.java
@@ -4,7 +4,9 @@
 import org.openecomp.core.utilities.CommonMethods;
 import org.openecomp.core.validation.ErrorMessageCode;
 import org.openecomp.core.validation.errors.ErrorMessagesFormatBuilder;
+import org.openecomp.core.validation.types.GlobalValidationContext;
 import org.openecomp.sdc.common.errors.Messages;
+import org.openecomp.sdc.datatypes.configuration.ImplementationConfiguration;
 import org.openecomp.sdc.datatypes.error.ErrorLevel;
 import org.openecomp.sdc.heat.datatypes.manifest.FileData;
 import org.openecomp.sdc.heat.datatypes.manifest.ManifestContent;
@@ -12,15 +14,13 @@
 import org.openecomp.sdc.heat.datatypes.model.Resource;
 import org.openecomp.sdc.heat.services.HeatStructureUtil;
 import org.openecomp.sdc.heat.services.manifest.ManifestUtil;
+import org.openecomp.sdc.logging.api.Logger;
+import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.openecomp.sdc.logging.types.LoggerErrorDescription;
 import org.openecomp.sdc.logging.types.LoggerTragetServiceName;
 import org.openecomp.sdc.validation.ResourceValidator;
 import org.openecomp.sdc.validation.ValidationContext;
 import org.openecomp.sdc.validation.Validator;
-import org.openecomp.core.validation.types.GlobalValidationContext;
-import org.openecomp.sdc.datatypes.configuration.ImplementationConfiguration;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.openecomp.sdc.validation.type.ConfigConstants;
 import org.openecomp.sdc.validation.util.ValidationUtil;
 
@@ -54,7 +54,7 @@
   public void validate(GlobalValidationContext globalContext) {
     ManifestContent manifestContent;
     try {
-      manifestContent = ValidationUtil.checkValidationPreCondition(globalContext);
+      manifestContent = ValidationUtil.validateManifest(globalContext);
     } catch (Exception exception) {
       logger.debug("",exception);
       return;
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-sdk/src/main/java/org/openecomp/sdc/validation/util/ValidationTestUtil.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-sdk/src/main/java/org/openecomp/sdc/validation/util/ValidationTestUtil.java
index 2b58a30..08a3548 100644
--- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-sdk/src/main/java/org/openecomp/sdc/validation/util/ValidationTestUtil.java
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-sdk/src/main/java/org/openecomp/sdc/validation/util/ValidationTestUtil.java
@@ -25,7 +25,6 @@
 
 import java.io.File;
 import java.io.FileInputStream;
-import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.StringWriter;
 import java.net.URL;
@@ -97,7 +96,7 @@
                                                             String resourceTypeToValidate, String path) {
 
     GlobalValidationContext globalContext = createGlobalContextFromPath(path);
-    ManifestContent manifestContent = ValidationUtil.checkValidationPreCondition(globalContext);
+    ManifestContent manifestContent = ValidationUtil.validateManifest(globalContext);
     Map<String, FileData.Type> fileTypeMap = ManifestUtil.getFileTypeMap(manifestContent);
     Map<String, FileData> fileEnvMap = ManifestUtil.getFileAndItsEnv(manifestContent);
 
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-sdk/src/main/java/org/openecomp/sdc/validation/util/ValidationUtil.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-sdk/src/main/java/org/openecomp/sdc/validation/util/ValidationUtil.java
index d9e0351..76b4aff 100644
--- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-sdk/src/main/java/org/openecomp/sdc/validation/util/ValidationUtil.java
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-sdk/src/main/java/org/openecomp/sdc/validation/util/ValidationUtil.java
@@ -6,6 +6,7 @@
 import org.openecomp.core.validation.errors.ErrorMessagesFormatBuilder;
 import org.openecomp.core.validation.types.GlobalValidationContext;
 import org.openecomp.sdc.common.errors.Messages;
+import org.openecomp.sdc.common.errors.SdcRuntimeException;
 import org.openecomp.sdc.common.utils.SdcCommon;
 import org.openecomp.sdc.datatypes.error.ErrorLevel;
 import org.openecomp.sdc.heat.datatypes.manifest.ManifestContent;
@@ -176,7 +177,7 @@
     return false;
   }
 
-  public static ManifestContent checkValidationPreCondition(GlobalValidationContext globalContext) {
+  public static ManifestContent validateManifest(GlobalValidationContext globalContext) {
     Optional<InputStream> manifest = globalContext.getFileContent(SdcCommon.MANIFEST_NAME);
     if (!manifest.isPresent()) {
       MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_API,
@@ -192,7 +193,7 @@
       MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_API,
           LoggerTragetServiceName.VALIDATE_MANIFEST_CONTENT, ErrorLevel.ERROR.name(),
           LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.INVALID_MANIFEST);
-      throw new RuntimeException("Can't load manifest file for Heat Validator");
+      throw new SdcRuntimeException("Can't load manifest file for Heat Validator");
     }
 
     return manifestContent;
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/VendorLicenseUtil.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/VendorLicenseUtil.java
new file mode 100644
index 0000000..3ee326a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/VendorLicenseUtil.java
@@ -0,0 +1,28 @@
+package org.openecomp.sdc.vendorlicense;
+
+import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+
+public class VendorLicenseUtil {
+
+  private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage();
+
+  public static String getIsoFormatDate(String inputDate) {
+    mdcDataDebugMessage.debugEntryMessage("inputDate date", inputDate);
+    String isoFormatDate = null;
+    SimpleDateFormat isoDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
+    SimpleDateFormat inputDateFormat = new SimpleDateFormat("MM/dd/yyyy'T'HH:mm:ss'Z'");
+
+    try {
+      isoFormatDate = isoDateFormat.format(inputDateFormat.parse(inputDate));
+    } catch (ParseException e) {
+      mdcDataDebugMessage.debugExitMessage("parsing error", isoFormatDate);
+      isoFormatDate = null;
+    }
+
+    mdcDataDebugMessage.debugExitMessage("formatted date", isoFormatDate);
+    return isoFormatDate;
+  }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/EntitlementPoolEntity.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/EntitlementPoolEntity.java
index 2b7b3a6..6c4ba90 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/EntitlementPoolEntity.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/EntitlementPoolEntity.java
@@ -26,6 +26,9 @@
 import com.datastax.driver.mapping.annotations.Frozen;
 import com.datastax.driver.mapping.annotations.PartitionKey;
 import com.datastax.driver.mapping.annotations.Table;
+import org.apache.commons.lang3.StringUtils;
+import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage;
+import org.openecomp.sdc.vendorlicense.VendorLicenseUtil;
 import org.openecomp.sdc.vendorlicense.dao.types.xml.LimitForXml;
 import org.openecomp.sdc.vendorlicense.dao.types.xml.LimitXml;
 import org.openecomp.sdc.vendorlicense.dao.types.xml.OperationalScopeForXml;
@@ -40,6 +43,8 @@
 
 @Table(keyspace = "dox", name = "entitlement_pool")
 public class EntitlementPoolEntity implements VersionableEntity {
+
+  private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage();
   private static final String ENTITY_TYPE = "Entitlement Pool";
 
   @PartitionKey
@@ -201,7 +206,7 @@
   }
 
   public void setOperationalScope(MultiChoiceOrOther<OperationalScope> operationalScope) {
-    if(operationalScope != null) {
+    if (operationalScope != null) {
       operationalScope.resolveEnum(OperationalScope.class);
     }
     this.operationalScope = operationalScope;
@@ -220,7 +225,8 @@
   }
 
   /**
-   *  Gets version for artifact.
+   * Gets version for artifact.
+   *
    * @return version in format suitable for artifact
    */
   public String getVersionForArtifact() {
@@ -251,17 +257,18 @@
     this.limits = limits;
   }
 
-  public LimitForXml getSPLimits(){
-    if(limits != null){
+  public LimitForXml getSPLimits() {
+    if (limits != null) {
       Set<LimitXml> hs = new HashSet<>();
-      for(LimitEntity obj : limits){
-        if(obj.getType().equals(LimitType.ServiceProvider)){
+      for (LimitEntity obj : limits) {
+        if (obj.getType().equals(LimitType.ServiceProvider)) {
           LimitXml xmlObj = new LimitXml();
           xmlObj.setDescription(obj.getDescription());
           xmlObj.setMetric(obj.getMetric());
           xmlObj.setValues(obj.getValue());
           xmlObj.setUnit(obj.getUnit());
-          xmlObj.setAggregationFunction(obj.getAggregationFunction()!=null?obj.getAggregationFunction().name():null);
+          xmlObj.setAggregationFunction(
+              obj.getAggregationFunction() != null ? obj.getAggregationFunction().name() : null);
           xmlObj.setTime(obj.getTime());
           hs.add(xmlObj);
         }
@@ -274,17 +281,18 @@
     return null;
   }
 
-  public LimitForXml getVendorLimits(){
-    if(limits != null){
+  public LimitForXml getVendorLimits() {
+    if (limits != null) {
       Set<LimitXml> hs = new HashSet<>();
-      for(LimitEntity obj : limits){
-        if(obj.getType().equals(LimitType.Vendor)){
+      for (LimitEntity obj : limits) {
+        if (obj.getType().equals(LimitType.Vendor)) {
           LimitXml xmlObj = new LimitXml();
           xmlObj.setDescription(obj.getDescription());
           xmlObj.setMetric(obj.getMetric());
           xmlObj.setValues(obj.getValue());
           xmlObj.setUnit(obj.getUnit());
-          xmlObj.setAggregationFunction(obj.getAggregationFunction()!=null?obj.getAggregationFunction().name():null);
+          xmlObj.setAggregationFunction(
+              obj.getAggregationFunction() != null ? obj.getAggregationFunction().name() : null);
           xmlObj.setTime(obj.getTime());
           hs.add(xmlObj);
         }
@@ -324,7 +332,9 @@
         && Objects.equals(operationalScope, that.operationalScope)
         && Objects.equals(referencingFeatureGroups, that.referencingFeatureGroups)
         && Objects.equals(startDate, that.startDate)
-        && Objects.equals(expiryDate, that.expiryDate);
+        && Objects.equals(expiryDate, that.expiryDate)
+        && Objects.equals(manufacturerReferenceNumber, that.manufacturerReferenceNumber)
+        && Objects.equals(version, that.version);
   }
 
   @Override
@@ -354,7 +364,7 @@
   public OperationalScopeForXml getOperationalScopeForArtifact() {
     OperationalScopeForXml obj = new OperationalScopeForXml();
     if (operationalScope != null) {
-      if(operationalScope.getResults().size() > 0) {
+      if (operationalScope.getResults().size() > 0) {
         obj.setValue(operationalScope.getResults());
       }
     }
@@ -369,4 +379,27 @@
   public String getManufacturerReferenceNumber() {
     return manufacturerReferenceNumber;
   }
+
+  public String getIsoFormatStartDate() {
+    mdcDataDebugMessage.debugEntryMessage("start date", startDate);
+    String isoFormatStartDate = null;
+    if (!StringUtils.isEmpty(startDate)) {
+      isoFormatStartDate = VendorLicenseUtil.getIsoFormatDate(startDate);
+      mdcDataDebugMessage.debugExitMessage("start date", "iso format start date", startDate,
+          isoFormatStartDate);
+    }
+    return isoFormatStartDate;
+  }
+
+
+  public String getIsoFormatExpiryDate() {
+    mdcDataDebugMessage.debugEntryMessage("expiry date", expiryDate);
+    String isoFormatExpDate = null;
+    if (!StringUtils.isEmpty(expiryDate)) {
+      isoFormatExpDate = VendorLicenseUtil.getIsoFormatDate(expiryDate);
+      mdcDataDebugMessage.debugExitMessage("expiry date", "iso format expiry date", expiryDate,
+          isoFormatExpDate);
+    }
+    return isoFormatExpDate;
+  }
 }
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/LicenseKeyGroupEntity.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/LicenseKeyGroupEntity.java
index 364a240..7794aaf 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/LicenseKeyGroupEntity.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/LicenseKeyGroupEntity.java
@@ -26,9 +26,12 @@
 import com.datastax.driver.mapping.annotations.Frozen;
 import com.datastax.driver.mapping.annotations.PartitionKey;
 import com.datastax.driver.mapping.annotations.Table;
+import org.apache.commons.lang3.StringUtils;
+import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage;
+import org.openecomp.sdc.vendorlicense.VendorLicenseUtil;
 import org.openecomp.sdc.vendorlicense.dao.types.xml.LicenseKeyTypeForXml;
-import org.openecomp.sdc.vendorlicense.dao.types.xml.LimitXml;
 import org.openecomp.sdc.vendorlicense.dao.types.xml.LimitForXml;
+import org.openecomp.sdc.vendorlicense.dao.types.xml.LimitXml;
 import org.openecomp.sdc.vendorlicense.dao.types.xml.OperationalScopeForXml;
 import org.openecomp.sdc.vendorlicense.dao.types.xml.ThresholdForXml;
 import org.openecomp.sdc.versioning.dao.types.Version;
@@ -41,6 +44,8 @@
 
 @Table(keyspace = "dox", name = "license_key_group")
 public class LicenseKeyGroupEntity implements VersionableEntity {
+
+  private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage();
   private static final String ENTITY_TYPE = "License Key Group";
 
   @PartitionKey
@@ -164,7 +169,7 @@
   }
 
   public void setOperationalScope(MultiChoiceOrOther<OperationalScope> operationalScope) {
-    if(operationalScope != null)  {
+    if (operationalScope != null) {
       operationalScope.resolveEnum(OperationalScope.class);
     }
     this.operationalScope = operationalScope;
@@ -217,17 +222,18 @@
     this.limits = limits;
   }
 
-  public LimitForXml getSPLimits(){
-    if(limits != null){
+  public LimitForXml getSPLimits() {
+    if (limits != null) {
       Set<LimitXml> hs = new HashSet<>();
-      for(LimitEntity obj : limits){
-        if(obj.getType().equals(LimitType.ServiceProvider)){
+      for (LimitEntity obj : limits) {
+        if (obj.getType().equals(LimitType.ServiceProvider)) {
           LimitXml xmlObj = new LimitXml();
           xmlObj.setDescription(obj.getDescription());
           xmlObj.setMetric(obj.getMetric());
           xmlObj.setValues(obj.getValue());
           xmlObj.setUnit(obj.getUnit());
-          xmlObj.setAggregationFunction(obj.getAggregationFunction()!=null?obj.getAggregationFunction().name():null);
+          xmlObj.setAggregationFunction(
+              obj.getAggregationFunction() != null ? obj.getAggregationFunction().name() : null);
           xmlObj.setTime(obj.getTime());
           hs.add(xmlObj);
         }
@@ -240,17 +246,18 @@
     return null;
   }
 
-  public LimitForXml getVendorLimits(){
-    if(limits != null){
+  public LimitForXml getVendorLimits() {
+    if (limits != null) {
       Set<LimitXml> hs = new HashSet<>();
-      for(LimitEntity obj : limits){
-        if(obj.getType().equals(LimitType.Vendor)){
+      for (LimitEntity obj : limits) {
+        if (obj.getType().equals(LimitType.Vendor)) {
           LimitXml xmlObj = new LimitXml();
           xmlObj.setDescription(obj.getDescription());
           xmlObj.setMetric(obj.getMetric());
           xmlObj.setValues(obj.getValue());
           xmlObj.setUnit(obj.getUnit());
-          xmlObj.setAggregationFunction(obj.getAggregationFunction()!=null?obj.getAggregationFunction().name():null);
+          xmlObj.setAggregationFunction(
+              obj.getAggregationFunction() != null ? obj.getAggregationFunction().name() : null);
           xmlObj.setTime(obj.getTime());
           hs.add(xmlObj);
         }
@@ -297,6 +304,7 @@
     }
     LicenseKeyGroupEntity that = (LicenseKeyGroupEntity) obj;
     return Objects.equals(vendorLicenseModelId, that.vendorLicenseModelId)
+        && Objects.equals(version, that.version)
         && Objects.equals(id, that.id)
         && Objects.equals(name, that.name)
         && Objects.equals(description, that.description)
@@ -307,7 +315,8 @@
         && Objects.equals(expiryDate, that.expiryDate)
         && Objects.equals(thresholdValue, that.thresholdValue)
         && Objects.equals(thresholdUnits, that.thresholdUnits)
-        && Objects.equals(increments, that.increments);
+        && Objects.equals(increments, that.increments)
+        && Objects.equals(manufacturerReferenceNumber, that.manufacturerReferenceNumber);
   }
 
   @Override
@@ -337,7 +346,7 @@
   public OperationalScopeForXml getOperationalScopeForArtifact() {
     OperationalScopeForXml obj = new OperationalScopeForXml();
     if (operationalScope != null) {
-      if(operationalScope.getResults().size() > 0) {
+      if (operationalScope.getResults().size() > 0) {
         obj.setValue(operationalScope.getResults());
       }
     }
@@ -346,6 +355,7 @@
 
   /**
    * Gets version for artifact.
+   *
    * @return version in format suitable for artifact
    */
   public String getVersionForArtifact() {
@@ -375,4 +385,29 @@
   public void setManufacturerReferenceNumber(String manufacturerReferenceNumber) {
     this.manufacturerReferenceNumber = manufacturerReferenceNumber;
   }
+
+  public String getIsoFormatStartDate() {
+    mdcDataDebugMessage.debugEntryMessage("start date", startDate);
+    String isoFormatStartDate = null;
+    if (!StringUtils.isEmpty(startDate)) {
+      isoFormatStartDate = VendorLicenseUtil.getIsoFormatDate(startDate);
+      mdcDataDebugMessage.debugExitMessage("start date", "iso format start date", startDate,
+          isoFormatStartDate);
+    }
+    return isoFormatStartDate;
+  }
+
+
+  public String getIsoFormatExpiryDate() {
+    mdcDataDebugMessage.debugEntryMessage("expiry date", expiryDate);
+    String isoFormatExpDate = null;
+    if (!StringUtils.isEmpty(expiryDate)) {
+      isoFormatExpDate = VendorLicenseUtil.getIsoFormatDate(expiryDate);
+      mdcDataDebugMessage.debugExitMessage("expiry date", "iso format expiry date", expiryDate,
+          isoFormatExpDate);
+    }
+    return isoFormatExpDate;
+  }
+
+
 }
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/LimitEntity.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/LimitEntity.java
index 58ccd5e..0860c24 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/LimitEntity.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/LimitEntity.java
@@ -47,7 +47,7 @@
   }
 
   public void setAggregationFunction(
-          AggregationFunction aggregationFunction) {
+      AggregationFunction aggregationFunction) {
     this.aggregationFunction = aggregationFunction;
   }
 
@@ -159,7 +159,7 @@
   @Override
   public int hashCode() {
     return Objects.hash(vendorLicenseModelId, version, epLkgId, id, name, description, type,
-            metric, unit, time, aggregationFunction, value);
+        metric, unit, time, aggregationFunction, value);
   }
 
   @Override
@@ -172,35 +172,35 @@
     }
     LimitEntity that = (LimitEntity) obj;
     return Objects.equals(that.unit, unit)
-            && Objects.equals(that.value, value)
-            && Objects.equals(vendorLicenseModelId, that.vendorLicenseModelId)
-            && Objects.equals(epLkgId, that.epLkgId)
-            && Objects.equals(id, that.id)
-            && Objects.equals(name, that.name)
-            && Objects.equals(description, that.description)
-            && Objects.equals(type, that.type)
-            && Objects.equals(metric, that.metric)
-            && Objects.equals(aggregationFunction, that.aggregationFunction);
+        && Objects.equals(that.value, value)
+        && Objects.equals(vendorLicenseModelId, that.vendorLicenseModelId)
+        && Objects.equals(epLkgId, that.epLkgId)
+        && Objects.equals(id, that.id)
+        && Objects.equals(name, that.name)
+        && Objects.equals(description, that.description)
+        && Objects.equals(type, that.type)
+        && Objects.equals(metric, that.metric)
+        && Objects.equals(aggregationFunction, that.aggregationFunction);
 
   }
 
   @Override
   public String toString() {
     return "LimitEntity{"
-            + "vendorLicenseModelId='" + vendorLicenseModelId + '\''
-            + ", version=" + version
-            + ", epLkgId=" + epLkgId
-            + ", id='" + id + '\''
-            + ", name='" + name + '\''
-            + ", description='" + description + '\''
-            + ", type=" + type
-            + ", metric=" + metric
-            + ", value='" + value + '\''
-            + ", unit='" + unit + '\''
-            + ", aggregationFunction=" + aggregationFunction
-            + ", time=" + time
+        + "vendorLicenseModelId='" + vendorLicenseModelId + '\''
+        + ", version=" + version
+        + ", epLkgId=" + epLkgId
+        + ", id='" + id + '\''
+        + ", name='" + name + '\''
+        + ", description='" + description + '\''
+        + ", type=" + type
+        + ", metric=" + metric
+        + ", value='" + value + '\''
+        + ", unit='" + unit + '\''
+        + ", aggregationFunction=" + aggregationFunction
+        + ", time=" + time
 
-            + '}';
+        + '}';
   }
 
 }
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/VendorLicenseModelEntity.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/VendorLicenseModelEntity.java
index b57b850..05cc78f 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/VendorLicenseModelEntity.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/VendorLicenseModelEntity.java
@@ -45,6 +45,7 @@
   @Column(name = "vendor_name")
   private String vendorName;
   private String description;
+  private String oldVersion;
   @Column(name = "icon")
   private String iconRef;
 
@@ -111,6 +112,15 @@
     this.iconRef = iconRef;
   }
 
+  public void setOldVersion(String oldVersion) {
+    this.oldVersion = oldVersion;
+  }
+
+  public String getOldVersion() {
+    return oldVersion;
+  }
+
+
   @Override
   public int hashCode() {
     return Objects.hash(id, version, vendorName, description, iconRef);
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/facade/VendorLicenseFacade.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/facade/VendorLicenseFacade.java
index 3d27de3..dda42ee 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/facade/VendorLicenseFacade.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/facade/VendorLicenseFacade.java
@@ -29,72 +29,52 @@
 import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity;
 import org.openecomp.sdc.vendorlicense.dao.types.LimitEntity;
 import org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity;
-import org.openecomp.sdc.vendorlicense.types.VersionedVendorLicenseModel;
 import org.openecomp.sdc.versioning.dao.types.Version;
-import org.openecomp.sdc.versioning.types.VersionInfo;
-import org.openecomp.sdc.versioning.types.VersionableEntityAction;
 
 import java.util.Collection;
 
 public interface VendorLicenseFacade {
 
-  Version checkin(String vendorLicenseModelId, String user);
-
-  Version submit(String vendorLicenseModelId, String user);
-
-  FeatureGroupEntity getFeatureGroup(FeatureGroupEntity featureGroup, String user);
-
-  FeatureGroupModel getFeatureGroupModel(FeatureGroupEntity featureGroup, String user);
-
   LicenseAgreementEntity getLicenseAgreement(String vlmId, Version version,
-                                             String licenseAgreementId, String user);
+                                             String licenseAgreementId);
 
   LicenseAgreementModel getLicenseAgreementModel(String vlmId, Version version,
-                                                 String licenseAgreementId, String user);
+                                                 String licenseAgreementId);
 
-  EntitlementPoolEntity createEntitlementPool(EntitlementPoolEntity entitlementPool, String user);
+  LicenseAgreementEntity createLicenseAgreement(LicenseAgreementEntity licenseAgreement);
 
-  void updateEntitlementPool(EntitlementPoolEntity entitlementPool, String user);
+  Collection<FeatureGroupEntity> listFeatureGroups(String vlmId, Version version);
 
-  Collection<LicenseKeyGroupEntity> listLicenseKeyGroups(String vlmId, Version version,
-                                                         String user);
+  FeatureGroupEntity getFeatureGroup(FeatureGroupEntity featureGroup);
 
-  Collection<EntitlementPoolEntity> listEntitlementPools(String vlmId, Version version,
-                                                         String user);
+  FeatureGroupModel getFeatureGroupModel(FeatureGroupEntity featureGroup);
 
-  void updateLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup, String user);
+  FeatureGroupEntity createFeatureGroup(FeatureGroupEntity featureGroup);
 
-  LicenseKeyGroupEntity createLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup, String user);
+  Collection<EntitlementPoolEntity> listEntitlementPools(String vlmId, Version version);
 
+  EntitlementPoolEntity createEntitlementPool(EntitlementPoolEntity entitlementPool);
 
-  VersionedVendorLicenseModel getVendorLicenseModel(String vlmId, Version version, String user);
+  void updateEntitlementPool(EntitlementPoolEntity entitlementPool);
 
-  VendorLicenseModelEntity createVendorLicenseModel(
-      VendorLicenseModelEntity vendorLicenseModelEntity, String user);
+  Collection<LicenseKeyGroupEntity> listLicenseKeyGroups(String vlmId, Version version);
 
+  LicenseKeyGroupEntity createLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup);
 
-  LicenseAgreementEntity createLicenseAgreement(LicenseAgreementEntity licenseAgreement,
-                                                String user);
+  void updateLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup);
 
-  Collection<FeatureGroupEntity> listFeatureGroups(String vlmId, Version version,
-                                                         String user);
+  Collection<LimitEntity> listLimits(String vlmId, Version version, String epLkgId);
 
-  FeatureGroupEntity createFeatureGroup(FeatureGroupEntity featureGroup, String user);
+  LimitEntity createLimit(LimitEntity limit);
+
+  void updateLimit(LimitEntity limit);
+
+  VendorLicenseModelEntity getVendorLicenseModel(String vlmId, Version version);
 
 
   Collection<ErrorCode> validateLicensingData(String vlmId, Version vlmVersion,
                                               String licenseAgreementId,
                                               Collection<String> featureGroupIds);
 
-  VersionInfo getVersionInfo(String vendorLicenseModelId, VersionableEntityAction action,
-                             String user);
-
-  void updateVlmLastModificationTime(String vendorLicenseModelId, Version version);
-
-  LimitEntity createLimit(LimitEntity limit, String user);
-
-  Collection<LimitEntity> listLimits(String vlmId, Version version, String epLkgId
-                                               ,String user);
-
-  void updateLimit(LimitEntity limit, String user);
+  void validate(String vendorLicenseModelId, Version version);
 }
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/healing/HealingService.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/healing/HealingService.java
index 6ae2de1..a3a5b72 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/healing/HealingService.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/healing/HealingService.java
@@ -24,7 +24,7 @@
 
 public interface HealingService {
 
-  VersionableEntity heal(VersionableEntity toHeal, String user);
+  VersionableEntity heal(VersionableEntity toHeal);
 
   void persistNoHealing(VersionableEntity alreadyHealed);
 }
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/VendorLicenseArtifactsService.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/VendorLicenseArtifactsService.java
index c0610a9..66ac7ab 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/VendorLicenseArtifactsService.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/VendorLicenseArtifactsService.java
@@ -28,5 +28,5 @@
 public interface VendorLicenseArtifactsService {
 
   FileContentHandler createLicenseArtifacts(String vspId, String vlmId, Version vlmVersion,
-                                            List<String> featureGroups, String user);
+                                            List<String> featureGroups);
 }
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/FeatureGroupCassandraDaoImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/FeatureGroupCassandraDaoImpl.java
index 2568d71..dd22397 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/FeatureGroupCassandraDaoImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/FeatureGroupCassandraDaoImpl.java
@@ -20,8 +20,6 @@
 
 package org.openecomp.sdc.vendorlicense.dao.impl;
 
-import static org.openecomp.core.utilities.CommonMethods.toSingleElementSet;
-
 import com.datastax.driver.core.ResultSet;
 import com.datastax.driver.core.UDTValue;
 import com.datastax.driver.mapping.Mapper;
@@ -47,6 +45,8 @@
 import java.util.HashSet;
 import java.util.Set;
 
+import static org.openecomp.core.utilities.CommonMethods.toSingleElementSet;
+
 public class FeatureGroupCassandraDaoImpl extends CassandraBaseDao<FeatureGroupEntity>
     implements FeatureGroupDao {
 
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/EntitlementPoolZusammenDaoImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/EntitlementPoolZusammenDaoImpl.java
index b880c67..35182a3 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/EntitlementPoolZusammenDaoImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/EntitlementPoolZusammenDaoImpl.java
@@ -10,25 +10,20 @@
 import com.amdocs.zusammen.datatypes.item.Info;
 import org.openecomp.core.zusammen.api.ZusammenAdaptor;
 import org.openecomp.core.zusammen.api.ZusammenUtil;
+import org.openecomp.sdc.datatypes.model.ElementType;
 import org.openecomp.sdc.vendorlicense.dao.EntitlementPoolDao;
+import org.openecomp.sdc.vendorlicense.dao.impl.zusammen.convertor.ElementToEntitlementPoolConvertor;
 import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity;
-import org.openecomp.sdc.vendorlicense.dao.types.MultiChoiceOrOther;
-import org.openecomp.sdc.vendorlicense.dao.types.OperationalScope;
-import org.openecomp.sdc.vendorlicense.dao.types.ThresholdUnit;
-import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.types.ElementPropertyName;
 
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.HashSet;
-import java.util.List;
 import java.util.Map;
 import java.util.Optional;
-import java.util.Set;
 import java.util.stream.Collectors;
 
-/**
- * Created by ayalaben on 3/28/2017.
- */
+import static org.openecomp.core.zusammen.api.ZusammenUtil.buildElement;
+
 public class EntitlementPoolZusammenDaoImpl implements EntitlementPoolDao {
 
   private ZusammenAdaptor zusammenAdaptor;
@@ -48,18 +43,22 @@
         buildEntitlementPoolElement(entitlementPool, Action.CREATE);
 
     ZusammenElement entitlementPoolsElement =
-        VlmZusammenUtil.buildStructuralElement(StructureElement.EntitlementPools, null);
+        ZusammenUtil.buildStructuralElement(ElementType.EntitlementPools, Action.IGNORE);
 
+    ZusammenElement limitsElement =
+        ZusammenUtil.buildStructuralElement(ElementType.Limits, Action.CREATE);
+
+    entitlementPoolElement.addSubElement(limitsElement);
     entitlementPoolsElement.addSubElement(entitlementPoolElement);
 
     SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(entitlementPool.getVendorLicenseModelId());
-    Optional<Element> savedElement = zusammenAdaptor.saveElement(context, new ElementContext(itemId,
-            VlmZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor)),
+    Element epsSavedElement = zusammenAdaptor.saveElement(context,
+        new ElementContext(entitlementPool.getVendorLicenseModelId(),
+            entitlementPool.getVersion().getId()),
         entitlementPoolsElement, "Create entitlement pool");
 
-    savedElement.ifPresent(element -> entitlementPool
-        .setId(element.getSubElements().iterator().next().getElementId().getValue()));
+    entitlementPool
+        .setId(epsSavedElement.getSubElements().iterator().next().getElementId().getValue());
   }
 
   @Override
@@ -68,9 +67,8 @@
         buildEntitlementPoolElement(entitlementPool, Action.UPDATE);
 
     SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(entitlementPool.getVendorLicenseModelId());
-    ElementContext elementContext =  new ElementContext(itemId,
-        VlmZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor));
+    ElementContext elementContext = new ElementContext(entitlementPool.getVendorLicenseModelId(),
+        entitlementPool.getVersion().getId());
 
     Optional<ElementInfo> epFromDb = zusammenAdaptor.getElementInfo(context, elementContext,
         new Id(entitlementPool.getId()));
@@ -84,35 +82,33 @@
       }
     }
 
-    zusammenAdaptor.saveElement(context,elementContext, entitlmentpoolElement,
+    zusammenAdaptor.saveElement(context, elementContext, entitlmentpoolElement,
         String.format("Update entitlement pool with id %s", entitlementPool.getId()));
   }
 
   @Override
   public EntitlementPoolEntity get(EntitlementPoolEntity entitlementPool) {
     SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(entitlementPool.getVendorLicenseModelId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VlmZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor),
-        VlmZusammenUtil.getVersionTag(entitlementPool.getVersion()));
-
+    ElementContext elementContext = new ElementContext(entitlementPool.getVendorLicenseModelId(),
+        entitlementPool.getVersion().getId());
+    ElementToEntitlementPoolConvertor convertor = new ElementToEntitlementPoolConvertor();
     return zusammenAdaptor.getElementInfo(context, elementContext, new Id(entitlementPool.getId()))
-        .map(elementInfo -> mapElementInfoToEntitlementPool(
-            entitlementPool.getVendorLicenseModelId(), entitlementPool.getVersion(), elementInfo))
+        .map(elementInfo -> {
+          EntitlementPoolEntity entity = convertor.convert(elementInfo);
+          entity.setVendorLicenseModelId(entitlementPool.getVendorLicenseModelId());
+          entity.setVersion(entitlementPool.getVersion());
+          return entity;
+        })
         .orElse(null);
   }
 
   @Override
   public void delete(EntitlementPoolEntity entitlementPool) {
-    SessionContext context = ZusammenUtil.createSessionContext();
-    ZusammenElement zusammenElement = new ZusammenElement();
-    zusammenElement.setAction(Action.DELETE);
-    zusammenElement.setElementId(new Id(entitlementPool.getId()));
+    ZusammenElement zusammenElement = buildElement(new Id(entitlementPool.getId()), Action.DELETE);
 
-    Id itemId = new Id(entitlementPool.getVendorLicenseModelId());
-    ElementContext elementContext =
-        new ElementContext(itemId,
-            VlmZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor));
+    SessionContext context = ZusammenUtil.createSessionContext();
+    ElementContext elementContext = new ElementContext(entitlementPool.getVendorLicenseModelId(),
+        entitlementPool.getVersion().getId());
     zusammenAdaptor.saveElement(context, elementContext, zusammenElement,
         "delete entitlement pool. id:" + entitlementPool.getId() + ".");
   }
@@ -120,28 +116,27 @@
   @Override
   public Collection<EntitlementPoolEntity> list(EntitlementPoolEntity entitlementPool) {
     SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(entitlementPool.getVendorLicenseModelId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VlmZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor),
-        VlmZusammenUtil.getVersionTag(entitlementPool.getVersion()));
-
+    ElementContext elementContext = new ElementContext(entitlementPool.getVendorLicenseModelId(),
+        entitlementPool.getVersion().getId());
+    ElementToEntitlementPoolConvertor convertor = new ElementToEntitlementPoolConvertor();
     return zusammenAdaptor
-        .listElementsByName(context, elementContext, null, StructureElement.EntitlementPools.name())
-        .stream().map(elementInfo -> mapElementInfoToEntitlementPool(
-            entitlementPool.getVendorLicenseModelId(), entitlementPool.getVersion(), elementInfo))
-        .collect(Collectors.toList());
+        .listElementsByName(context, elementContext, null, ElementType.EntitlementPools.name())
+        .stream().map(elementInfo -> {
+          EntitlementPoolEntity entity = convertor.convert(elementInfo);
+          entity.setVendorLicenseModelId(entitlementPool.getVendorLicenseModelId());
+          entity.setVersion(entitlementPool.getVersion());
+          return entity;
+        }).collect(Collectors.toList());
   }
 
   @Override
   public long count(EntitlementPoolEntity entitlementPool) {
     SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(entitlementPool.getVendorLicenseModelId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VlmZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor),
-        VlmZusammenUtil.getVersionTag(entitlementPool.getVersion()));
+    ElementContext elementContext = new ElementContext(entitlementPool.getVendorLicenseModelId(),
+        entitlementPool.getVersion().getId());
 
     return zusammenAdaptor
-        .listElementsByName(context, elementContext, null, StructureElement.EntitlementPools.name())
+        .listElementsByName(context, elementContext, null, ElementType.EntitlementPools.name())
         .size();
   }
 
@@ -149,9 +144,8 @@
   public void removeReferencingFeatureGroup(EntitlementPoolEntity entitlementPool,
                                             String referencingFeatureGroupId) {
     SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(entitlementPool.getVendorLicenseModelId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VlmZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor));
+    ElementContext elementContext = new ElementContext(entitlementPool.getVendorLicenseModelId(),
+        entitlementPool.getVersion().getId());
 
     Optional<ElementInfo> elementInfo =
         zusammenAdaptor.getElementInfo(context, elementContext, new Id(entitlementPool.getId()));
@@ -173,9 +167,8 @@
   public void addReferencingFeatureGroup(EntitlementPoolEntity entitlementPool,
                                          String referencingFeatureGroupId) {
     SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(entitlementPool.getVendorLicenseModelId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VlmZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor));
+    ElementContext elementContext = new ElementContext(entitlementPool.getVendorLicenseModelId(),
+        entitlementPool.getVersion().getId());
 
     Optional<ElementInfo> elementInfo =
         zusammenAdaptor.getElementInfo(context, elementContext, new Id(entitlementPool.getId()));
@@ -199,17 +192,32 @@
     //not supported
   }
 
+  @Override
+  public String getManufacturerReferenceNumber(EntitlementPoolEntity entitlementPoolEntity) {
+    SessionContext context = ZusammenUtil.createSessionContext();
+    ElementContext elementContext =
+        new ElementContext(entitlementPoolEntity.getVendorLicenseModelId(),
+            entitlementPoolEntity.getVersion().getId());
+
+    Optional<ElementInfo> elementInfo1 = zusammenAdaptor
+        .getElementInfo(context, elementContext, new Id(entitlementPoolEntity.getId()));
+    Map<String, Object> properties = elementInfo1.get().getInfo().getProperties();
+    String manufacturerReferenceNumber = null;
+    if (properties != null && properties.containsKey("manufacturerReferenceNumber")) {
+      manufacturerReferenceNumber = (String) properties.get("manufacturerReferenceNumber");
+    }
+    return manufacturerReferenceNumber;
+  }
+
   private ZusammenElement buildEntitlementPoolElement(EntitlementPoolEntity entitlementPool,
                                                       Action action) {
-
-    ZusammenElement entitlementPoolElement = new ZusammenElement();
-    entitlementPoolElement.setAction(action);
-    if (entitlementPool.getId() != null) {
-      entitlementPoolElement.setElementId(new Id(entitlementPool.getId()));
-    }
+    ZusammenElement entitlementPoolElement =
+        buildElement(entitlementPool.getId() == null ? null : new Id(entitlementPool.getId()),
+            action);
     Info info = new Info();
     info.setName(entitlementPool.getName());
     info.setDescription(entitlementPool.getDescription());
+    info.addProperty(ElementPropertyName.elementType.name(), ElementType.EntitlementPool);
     info.addProperty("version_uuid", entitlementPool.getVersionUuId());
     info.addProperty("thresholdValue", entitlementPool.getThresholdValue());
     info.addProperty("threshold_unit", entitlementPool.getThresholdUnit());
@@ -219,8 +227,8 @@
     info.addProperty("expiryDate", entitlementPool.getExpiryDate());
     entitlementPoolElement.setInfo(info);
 
-   if (entitlementPool.getReferencingFeatureGroups() != null
-       && entitlementPool.getReferencingFeatureGroups().size() > 0) {
+    if (entitlementPool.getReferencingFeatureGroups() != null
+        && entitlementPool.getReferencingFeatureGroups().size() > 0) {
       entitlementPoolElement.setRelations(entitlementPool.getReferencingFeatureGroups().stream()
           .map(rel -> VlmZusammenUtil
               .createRelation(RelationType.EntitlmentPoolToReferencingFeatureGroup, rel))
@@ -229,62 +237,5 @@
     return entitlementPoolElement;
   }
 
-  private EntitlementPoolEntity mapElementInfoToEntitlementPool(String vlmId, Version version,
-                                                                ElementInfo elementInfo) {
-    EntitlementPoolEntity entitlmentPool =
-        new EntitlementPoolEntity(vlmId, version, elementInfo.getId().getValue());
-    entitlmentPool.setName(elementInfo.getInfo().getName());
-    entitlmentPool.setDescription(elementInfo.getInfo().getDescription());
-    entitlmentPool.setVersionUuId(elementInfo.getInfo().getProperty("version_uuid"));
-    entitlmentPool
-        .setThresholdValue(elementInfo.getInfo().getProperty("thresholdValue") != null
-                ? VlmZusammenUtil.toInteger(elementInfo.getInfo().getProperty("thresholdValue")) : null);
-
-    Object threshold_unit = elementInfo.getInfo().getProperty("threshold_unit");
-    entitlmentPool.setThresholdUnit( threshold_unit != null ?
-        ThresholdUnit.valueOf(elementInfo.getInfo().getProperty("threshold_unit")) : null);
-    entitlmentPool.setIncrements(elementInfo.getInfo().getProperty("increments"));
-    entitlmentPool.setOperationalScope(getOperationalScopeMultiChoiceOrOther(
-        elementInfo.getInfo().getProperty("operational_scope")));
-    entitlmentPool.setStartDate(elementInfo.getInfo().getProperty("startDate"));
-    entitlmentPool.setExpiryDate(elementInfo.getInfo().getProperty("expiryDate"));
-
-    if (elementInfo.getRelations() != null && elementInfo.getRelations().size() > 0) {
-      entitlmentPool
-          .setReferencingFeatureGroups(elementInfo.getRelations().stream().map(relation -> relation
-              .getEdge2().getElementId().getValue()).collect(Collectors.toSet()));
-    }
-    return entitlmentPool;
-  }
-
-  private MultiChoiceOrOther<OperationalScope> getOperationalScopeMultiChoiceOrOther
-      (Map<String, Object>
-           operationalScope) {
-    if(operationalScope != null && !operationalScope.isEmpty()) {
-      Set<OperationalScope> choices = new HashSet<>();
-      ((List<String>) operationalScope.get("choices")).
-          forEach(choice -> choices.add(OperationalScope.valueOf(choice)));
-
-      return new MultiChoiceOrOther<>(choices, operationalScope.get("other")==null?null:
-          (String) operationalScope.get("other"));
-    }
-    return null;
-  }
-
-  @Override
-  public String getManufacturerReferenceNumber(EntitlementPoolEntity entitlementPoolEntity){
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(entitlementPoolEntity.getVendorLicenseModelId());
-    ElementContext elementContext = new ElementContext(itemId,
-            VlmZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor),
-            VlmZusammenUtil.getVersionTag(entitlementPoolEntity.getVersion()));
-    Optional<ElementInfo> elementInfo1 = zusammenAdaptor.getElementInfo(context, elementContext, new Id(entitlementPoolEntity.getId()));
-    Map<String, Object> properties = elementInfo1.get().getInfo().getProperties();
-    String manufacturerReferenceNumber = null;
-    if(properties != null && properties.containsKey("manufacturerReferenceNumber") ) {
-      manufacturerReferenceNumber = (String)properties.get("manufacturerReferenceNumber");
-    }
-    return manufacturerReferenceNumber;
-  }
 
 }
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/FeatureGroupDaoZusammenImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/FeatureGroupDaoZusammenImpl.java
index aa9e6c7..8dcc964 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/FeatureGroupDaoZusammenImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/FeatureGroupDaoZusammenImpl.java
@@ -10,21 +10,22 @@
 import com.amdocs.zusammen.datatypes.item.Info;
 import com.amdocs.zusammen.datatypes.item.Relation;
 import org.openecomp.core.zusammen.api.ZusammenAdaptor;
-import org.openecomp.core.zusammen.api.ZusammenUtil;
+import org.openecomp.sdc.datatypes.model.ElementType;
 import org.openecomp.sdc.vendorlicense.dao.FeatureGroupDao;
+import org.openecomp.sdc.vendorlicense.dao.impl.zusammen.convertor.ElementToFeatureGroupConvertor;
 import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity;
-import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.types.ElementPropertyName;
 
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.HashSet;
 import java.util.Optional;
 import java.util.Set;
 import java.util.stream.Collectors;
 
-/**
- * Created by ayalaben on 3/27/2017.
- */
+import static org.openecomp.core.zusammen.api.ZusammenUtil.buildElement;
+import static org.openecomp.core.zusammen.api.ZusammenUtil.buildStructuralElement;
+import static org.openecomp.core.zusammen.api.ZusammenUtil.createSessionContext;
+
 public class FeatureGroupDaoZusammenImpl implements FeatureGroupDao {
 
   private ZusammenAdaptor zusammenAdaptor;
@@ -40,88 +41,86 @@
 
   @Override
   public void create(FeatureGroupEntity featureGroup) {
-    ZusammenElement featureGroupElement =
-        buildFeatureGroupElement(featureGroup, Action.CREATE);
+    ZusammenElement featureGroupElement = buildFeatureGroupElement(featureGroup, Action.CREATE);
 
     ZusammenElement featureGroupsElement =
-        VlmZusammenUtil.buildStructuralElement(StructureElement.FeatureGroups, null);
+        buildStructuralElement(ElementType.FeatureGroups, Action.IGNORE);
 
     featureGroupsElement.addSubElement(featureGroupElement);
 
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(featureGroup.getVendorLicenseModelId());
-    Optional<Element> savedElement = zusammenAdaptor.saveElement(context, new ElementContext(itemId,
-            VlmZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor)),
-        featureGroupsElement, "Create feature group");
+    SessionContext context = createSessionContext();
+    Element featureGroupsSavedElement = zusammenAdaptor.saveElement(context,
+        new ElementContext(featureGroup.getVendorLicenseModelId(),
+            featureGroup.getVersion().getId()), featureGroupsElement, "Create feature group");
 
-    savedElement.ifPresent(element -> featureGroup
-        .setId(element.getSubElements().iterator().next().getElementId().getValue()));
+    featureGroup.setId(
+        featureGroupsSavedElement.getSubElements().iterator().next().getElementId().getValue());
   }
 
   @Override
   public void update(FeatureGroupEntity featureGroup) {
     ZusammenElement featureGroupElement = buildFeatureGroupElement(featureGroup, Action.UPDATE);
 
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(featureGroup.getVendorLicenseModelId());
-    zusammenAdaptor.saveElement(context, new ElementContext(itemId,
-            VlmZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor)), featureGroupElement,
+    SessionContext context = createSessionContext();
+    zusammenAdaptor.saveElement(context, new ElementContext(featureGroup.getVendorLicenseModelId(),
+            featureGroup.getVersion().getId()), featureGroupElement,
         String.format("Update feature group with id %s", featureGroup.getId()));
   }
 
   @Override
   public FeatureGroupEntity get(FeatureGroupEntity featureGroup) {
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(featureGroup.getVendorLicenseModelId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VlmZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor),
-        VlmZusammenUtil.getVersionTag(featureGroup.getVersion()));
+    SessionContext context = createSessionContext();
+    ElementContext elementContext = new ElementContext(featureGroup.getVendorLicenseModelId(),
+        featureGroup.getVersion().getId());
 
     return zusammenAdaptor.getElementInfo(context, elementContext, new Id(featureGroup.getId()))
-        .map(elementInfo -> mapElementInfoToFeatureGroup(
-            featureGroup.getVendorLicenseModelId(), featureGroup.getVersion(), elementInfo))
+        .map(elementInfo -> {
+          FeatureGroupEntity entity = new ElementToFeatureGroupConvertor().convert(elementInfo);
+          entity.setVendorLicenseModelId(featureGroup.getVendorLicenseModelId());
+          entity.setVersion(featureGroup.getVersion());
+          return entity;
+        })
         .orElse(null);
   }
 
   @Override
   public void delete(FeatureGroupEntity featureGroup) {
-    SessionContext context = ZusammenUtil.createSessionContext();
-    ZusammenElement zusammenElement = new ZusammenElement();
-    zusammenElement.setAction(Action.DELETE);
-    zusammenElement.setElementId(new Id(featureGroup.getId()));
+    ZusammenElement zusammenElement = buildElement(new Id(featureGroup.getId()), Action.DELETE);
 
-    Id itemId = new Id(featureGroup.getVendorLicenseModelId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VlmZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor));
+    SessionContext context = createSessionContext();
+    ElementContext elementContext = new ElementContext(featureGroup.getVendorLicenseModelId(),
+        featureGroup.getVersion().getId());
     zusammenAdaptor.saveElement(context, elementContext, zusammenElement,
         "delete feature group. id:" + featureGroup.getId() + ".");
   }
 
   @Override
   public Collection<FeatureGroupEntity> list(FeatureGroupEntity featureGroup) {
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(featureGroup.getVendorLicenseModelId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VlmZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor),
-        VlmZusammenUtil.getVersionTag(featureGroup.getVersion()));
+    SessionContext context = createSessionContext();
+    ElementContext elementContext = new ElementContext(featureGroup.getVendorLicenseModelId(),
+        featureGroup.getVersion().getId());
 
+    ElementToFeatureGroupConvertor convertor = new ElementToFeatureGroupConvertor();
     return zusammenAdaptor
-        .listElementsByName(context, elementContext, null, StructureElement.FeatureGroups.name())
-        .stream().map(elementInfo -> mapElementInfoToFeatureGroup(
-            featureGroup.getVendorLicenseModelId(), featureGroup.getVersion(), elementInfo))
+        .listElementsByName(context, elementContext, null, ElementType.FeatureGroups.name())
+        .stream().map(elementInfo -> {
+          FeatureGroupEntity entity = convertor.convert(
+              elementInfo);
+          entity.setVendorLicenseModelId(featureGroup.getVendorLicenseModelId());
+          entity.setVersion(featureGroup.getVersion());
+          return entity;
+        })
         .collect(Collectors.toList());
   }
 
   @Override
   public long count(FeatureGroupEntity featureGroup) {
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(featureGroup.getVendorLicenseModelId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VlmZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor),
-        VlmZusammenUtil.getVersionTag(featureGroup.getVersion()));
+    SessionContext context = createSessionContext();
+    ElementContext elementContext = new ElementContext(featureGroup.getVendorLicenseModelId(),
+        featureGroup.getVersion().getId());
 
     return zusammenAdaptor
-        .listElementsByName(context, elementContext, null, StructureElement.FeatureGroups.name())
+        .listElementsByName(context, elementContext, null, ElementType.FeatureGroups.name())
         .size();
   }
 
@@ -138,10 +137,9 @@
   private void removeRelationToContainedEntity(FeatureGroupEntity featureGroup,
                                                String containedEntityId,
                                                String containedEntityType) {
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(featureGroup.getVendorLicenseModelId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VlmZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor));
+    SessionContext context = createSessionContext();
+    ElementContext elementContext = new ElementContext(featureGroup.getVendorLicenseModelId(),
+        featureGroup.getVersion().getId());
 
     Optional<ElementInfo> elementInfo = zusammenAdaptor.getElementInfo(context,
         elementContext, new Id(featureGroup.getId()));
@@ -158,25 +156,23 @@
   }
 
   @Override
-  public void updateFeatureGroup(FeatureGroupEntity
-                                     featureGroup, Set<String> addedEntitlementPools,
+  public void updateFeatureGroup(FeatureGroupEntity featureGroup,
+                                 Set<String> addedEntitlementPools,
                                  Set<String> removedEntitlementPools,
                                  Set<String> addedLicenseKeyGroups,
                                  Set<String> removedLicenseKeyGroups) {
     ZusammenElement featureGroupElement = buildFeatureGroupElement(featureGroup, Action.UPDATE);
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(featureGroup.getVendorLicenseModelId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VlmZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor));
-
+    SessionContext context = createSessionContext();
+    ElementContext elementContext = new ElementContext(featureGroup.getVendorLicenseModelId(),
+        featureGroup.getVersion().getId());
+    ElementToFeatureGroupConvertor convertor = new ElementToFeatureGroupConvertor();
     Optional<ElementInfo> elementInfo = zusammenAdaptor.getElementInfo(context,
         elementContext, new Id(featureGroup.getId()));
     if (elementInfo.isPresent()) {
-      FeatureGroupEntity currentFeatureGroup =
-          mapElementInfoToFeatureGroup(featureGroup.getId(), featureGroup.getVersion(),
-              elementInfo.get());
-
-      if (!(removedEntitlementPools == null )) {
+      FeatureGroupEntity currentFeatureGroup = convertor.convert(elementInfo.get());
+      currentFeatureGroup.setVendorLicenseModelId(featureGroup.getVendorLicenseModelId());
+      currentFeatureGroup.setVersion(featureGroup.getVersion());
+      if (!(removedEntitlementPools == null)) {
         currentFeatureGroup.getEntitlementPoolIds().removeAll(removedEntitlementPools);
       }
       if (!(addedEntitlementPools == null)) {
@@ -192,22 +188,24 @@
                   .createRelation(RelationType.FeatureGroupToEntitlmentPool, relation))
               .collect(Collectors.toList()));
 
-      if (! ( removedLicenseKeyGroups == null)) {
+      if (!(removedLicenseKeyGroups == null)) {
         currentFeatureGroup.getLicenseKeyGroupIds().removeAll(removedLicenseKeyGroups);
       }
-      if (! ( addedLicenseKeyGroups == null)) {
+      if (!(addedLicenseKeyGroups == null)) {
         currentFeatureGroup.getLicenseKeyGroupIds().addAll(addedLicenseKeyGroups);
       }
+
       featureGroupElement.getRelations()
           .addAll(currentFeatureGroup.getLicenseKeyGroupIds().stream()
               .map(relation -> VlmZusammenUtil
                   .createRelation(RelationType.FeatureGroupToLicenseKeyGroup, relation))
               .collect(Collectors.toList()));
 
-      Collection<Relation> LaRelations =  elementInfo.get().getRelations().stream().filter
-          (rel->rel.getType().equals(RelationType.FeatureGroupToReferencingLicenseAgreement.name()))
-          .map(rel ->VlmZusammenUtil.createRelation(RelationType
-          .FeatureGroupToReferencingLicenseAgreement,rel.getEdge2().getElementId().toString()))
+      Collection<Relation> LaRelations = elementInfo.get().getRelations().stream().filter
+          (rel -> rel.getType()
+              .equals(RelationType.FeatureGroupToReferencingLicenseAgreement.name()))
+          .map(rel -> VlmZusammenUtil.createRelation(RelationType
+              .FeatureGroupToReferencingLicenseAgreement, rel.getEdge2().getElementId().toString()))
           .collect(Collectors.toList());
 
       featureGroupElement.getRelations().addAll(LaRelations);
@@ -226,10 +224,9 @@
   @Override
   public void addReferencingLicenseAgreement(FeatureGroupEntity featureGroup,
                                              String licenseAgreementId) {
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(featureGroup.getVendorLicenseModelId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VlmZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor));
+    SessionContext context = createSessionContext();
+    ElementContext elementContext = new ElementContext(featureGroup.getVendorLicenseModelId(),
+        featureGroup.getVersion().getId());
 
     Optional<ElementInfo> elementInfo =
         zusammenAdaptor.getElementInfo(context, elementContext, new Id(featureGroup.getId()));
@@ -247,10 +244,9 @@
   @Override
   public void removeReferencingLicenseAgreement(FeatureGroupEntity featureGroup,
                                                 String licenseAgreementId) {
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(featureGroup.getVendorLicenseModelId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VlmZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor));
+    SessionContext context = createSessionContext();
+    ElementContext elementContext = new ElementContext(featureGroup.getVendorLicenseModelId(),
+        featureGroup.getVersion().getId());
 
     Optional<ElementInfo> elementInfo =
         zusammenAdaptor.getElementInfo(context, elementContext, new Id(featureGroup.getId()));
@@ -268,15 +264,12 @@
   }
 
   private ZusammenElement buildFeatureGroupElement(FeatureGroupEntity featureGroup, Action action) {
-
-    ZusammenElement featureGroupElement = new ZusammenElement();
-    featureGroupElement.setAction(action);
-    if (featureGroup.getId() != null) {
-      featureGroupElement.setElementId(new Id(featureGroup.getId()));
-    }
+    ZusammenElement featureGroupElement =
+        buildElement(featureGroup.getId() == null ? null : new Id(featureGroup.getId()), action);
     Info info = new Info();
     info.setName(featureGroup.getName());
     info.setDescription(featureGroup.getDescription());
+    info.addProperty(ElementPropertyName.elementType.name(), ElementType.FeatureGroup);
     info.addProperty("partNumber", featureGroup.getPartNumber());
     info.addProperty("manufacturerReferenceNumber", featureGroup.getManufacturerReferenceNumber());
     featureGroupElement.setInfo(info);
@@ -310,39 +303,5 @@
               .collect(Collectors.toList()));
     }
     return featureGroupElement;
-
-  }
-
-  private FeatureGroupEntity mapElementInfoToFeatureGroup(String vlmId, Version version,
-                                                          ElementInfo elementInfo) {
-    FeatureGroupEntity featureGroup =
-        new FeatureGroupEntity(vlmId, version, elementInfo.getId().getValue());
-    featureGroup.setName(elementInfo.getInfo().getName());
-    featureGroup.setDescription(elementInfo.getInfo().getDescription());
-    featureGroup.setPartNumber(elementInfo.getInfo().getProperty("partNumber"));
-    featureGroup.setManufacturerReferenceNumber(elementInfo.getInfo()
-        .getProperty("manufacturerReferenceNumber"));
-
-    Set<String> entitlementPoolIds = new HashSet<>();
-    Set<String> licenseAgreements = new HashSet<>();
-    Set<String> licenseKeyGroupIds = new HashSet<>();
-
-    if (elementInfo.getRelations() != null) {
-      for (Relation relation : elementInfo.getRelations()) {
-        if (RelationType.FeatureGroupToEntitlmentPool.name().equals(relation.getType())) {
-          entitlementPoolIds.add(relation.getEdge2().getElementId().getValue());
-        } else if (RelationType.FeatureGroupToLicenseKeyGroup.name().equals(relation.getType())) {
-          licenseKeyGroupIds.add(relation.getEdge2().getElementId().getValue());
-        } else if (RelationType.FeatureGroupToReferencingLicenseAgreement.name()
-            .equals(relation.getType())) {
-          licenseAgreements.add(relation.getEdge2().getElementId().getValue());
-        }
-      }
-    }
-    featureGroup.setEntitlementPoolIds(entitlementPoolIds);
-    featureGroup.setLicenseKeyGroupIds(licenseKeyGroupIds);
-    featureGroup.setReferencingLicenseAgreements(licenseAgreements);
-
-    return featureGroup;
   }
 }
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/LicenseAgreementDaoZusammenImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/LicenseAgreementDaoZusammenImpl.java
index 45c831f..0fbac66 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/LicenseAgreementDaoZusammenImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/LicenseAgreementDaoZusammenImpl.java
@@ -29,19 +29,21 @@
 import com.amdocs.zusammen.datatypes.item.ElementContext;
 import com.amdocs.zusammen.datatypes.item.Info;
 import org.openecomp.core.zusammen.api.ZusammenAdaptor;
-import org.openecomp.core.zusammen.api.ZusammenUtil;
+import org.openecomp.sdc.datatypes.model.ElementType;
 import org.openecomp.sdc.vendorlicense.dao.LicenseAgreementDao;
-import org.openecomp.sdc.vendorlicense.dao.types.ChoiceOrOther;
+import org.openecomp.sdc.vendorlicense.dao.impl.zusammen.convertor.ElementToLicenseAgreementConvertor;
 import org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity;
-import org.openecomp.sdc.vendorlicense.dao.types.LicenseTerm;
-import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.types.ElementPropertyName;
 
 import java.util.Collection;
-import java.util.Map;
 import java.util.Optional;
 import java.util.Set;
 import java.util.stream.Collectors;
 
+import static org.openecomp.core.zusammen.api.ZusammenUtil.buildElement;
+import static org.openecomp.core.zusammen.api.ZusammenUtil.buildStructuralElement;
+import static org.openecomp.core.zusammen.api.ZusammenUtil.createSessionContext;
+
 
 public class LicenseAgreementDaoZusammenImpl implements LicenseAgreementDao {
 
@@ -61,16 +63,17 @@
     ZusammenElement licenseAgreementElement =
         buildLicenseAgreementElement(licenseAgreement, Action.CREATE);
     ZusammenElement licenseAgreementsElement =
-        VlmZusammenUtil.buildStructuralElement(StructureElement.LicenseAgreements, null);
+        buildStructuralElement(ElementType.LicenseAgreements, Action.IGNORE);
     licenseAgreementsElement.addSubElement(licenseAgreementElement);
 
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(licenseAgreement.getVendorLicenseModelId());
-    Optional<Element> savedElement = zusammenAdaptor.saveElement(context, new ElementContext(itemId,
-            VlmZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor)),
-        licenseAgreementsElement, "Create license agreement");
-    savedElement.ifPresent(element -> licenseAgreement
-        .setId(element.getSubElements().iterator().next().getElementId().getValue()));
+    SessionContext context = createSessionContext();
+    Element licenseAgreementsSavedElement = zusammenAdaptor.saveElement(context,
+        new ElementContext(licenseAgreement.getVendorLicenseModelId(),
+            licenseAgreement.getVersion().getId()), licenseAgreementsElement,
+        "Create license agreement");
+    licenseAgreement
+        .setId(licenseAgreementsSavedElement.getSubElements().iterator().next().getElementId()
+            .getValue());
   }
 
   @Override
@@ -78,38 +81,36 @@
     ZusammenElement licenseAgreementElement =
         buildLicenseAgreementElement(licenseAgreement, Action.UPDATE);
 
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(licenseAgreement.getVendorLicenseModelId());
-    zusammenAdaptor.saveElement(context, new ElementContext(itemId,
-            VlmZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor)),
-        licenseAgreementElement,
+    SessionContext context = createSessionContext();
+    zusammenAdaptor.saveElement(context,
+        new ElementContext(licenseAgreement.getVendorLicenseModelId(),
+            licenseAgreement.getVersion().getId()), licenseAgreementElement,
         String.format("Update license agreement with id %s", licenseAgreement.getId()));
   }
 
   @Override
   public LicenseAgreementEntity get(LicenseAgreementEntity licenseAgreement) {
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(licenseAgreement.getVendorLicenseModelId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VlmZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor),
-        VlmZusammenUtil.getVersionTag(licenseAgreement.getVersion()));
-
+    SessionContext context = createSessionContext();
+    ElementContext elementContext = new ElementContext(licenseAgreement.getVendorLicenseModelId(),
+        licenseAgreement.getVersion().getId());
+    ElementToLicenseAgreementConvertor convertor = new ElementToLicenseAgreementConvertor();
     return zusammenAdaptor.getElementInfo(context, elementContext, new Id(licenseAgreement.getId()))
-        .map(elementInfo -> mapElementInfoToLicenseAgreement(
-            licenseAgreement.getVendorLicenseModelId(), licenseAgreement.getVersion(), elementInfo))
+        .map(elementInfo -> {
+          LicenseAgreementEntity entity = convertor.convert(elementInfo);
+          entity.setVendorLicenseModelId(licenseAgreement.getVendorLicenseModelId());
+          entity.setVersion(licenseAgreement.getVersion());
+          return entity;
+        })
         .orElse(null);
   }
 
   @Override
   public void delete(LicenseAgreementEntity licenseAgreement) {
-    SessionContext context = ZusammenUtil.createSessionContext();
-    ZusammenElement zusammenElement = new ZusammenElement();
-    zusammenElement.setAction(Action.DELETE);
-    zusammenElement.setElementId(new Id(licenseAgreement.getId()));
+    ZusammenElement zusammenElement = buildElement(new Id(licenseAgreement.getId()), Action.DELETE);
 
-    Id itemId = new Id(licenseAgreement.getVendorLicenseModelId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VlmZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor));
+    SessionContext context = createSessionContext();
+    ElementContext elementContext = new ElementContext(licenseAgreement.getVendorLicenseModelId(),
+        licenseAgreement.getVersion().getId());
     zusammenAdaptor.saveElement(context, elementContext, zusammenElement,
         "delete license agreement. id:" + licenseAgreement.getId() + ".");
   }
@@ -117,30 +118,30 @@
 
   @Override
   public Collection<LicenseAgreementEntity> list(LicenseAgreementEntity licenseAgreement) {
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(licenseAgreement.getVendorLicenseModelId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VlmZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor),
-        VlmZusammenUtil.getVersionTag(licenseAgreement.getVersion()));
-
+    SessionContext context = createSessionContext();
+    ElementContext elementContext = new ElementContext(licenseAgreement.getVendorLicenseModelId(),
+        licenseAgreement.getVersion().getId());
+    ElementToLicenseAgreementConvertor convertor = new ElementToLicenseAgreementConvertor();
     return zusammenAdaptor
         .listElementsByName(context, elementContext, null,
-            StructureElement.LicenseAgreements.name())
-        .stream().map(elementInfo -> mapElementInfoToLicenseAgreement(
-            licenseAgreement.getVendorLicenseModelId(), licenseAgreement.getVersion(), elementInfo))
+            ElementType.LicenseAgreements.name())
+        .stream().map(elementInfo -> {
+          LicenseAgreementEntity entity = convertor.convert(elementInfo);
+          entity.setVendorLicenseModelId(licenseAgreement.getVendorLicenseModelId());
+          entity.setVersion(licenseAgreement.getVersion());
+          return entity;
+        })
         .collect(Collectors.toList());
   }
 
   @Override
   public long count(LicenseAgreementEntity licenseAgreement) {
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(licenseAgreement.getVendorLicenseModelId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VlmZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor),
-        VlmZusammenUtil.getVersionTag(licenseAgreement.getVersion()));
+    SessionContext context = createSessionContext();
+    ElementContext elementContext = new ElementContext(licenseAgreement.getVendorLicenseModelId(),
+        licenseAgreement.getVersion().getId());
 
     return zusammenAdaptor.listElementsByName(context, elementContext, null,
-        StructureElement.LicenseAgreements.name())
+        ElementType.LicenseAgreements.name())
         .size();
   }
 
@@ -151,10 +152,9 @@
 
   @Override
   public void removeFeatureGroup(LicenseAgreementEntity licenseAgreement, String featureGroupId) {
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(licenseAgreement.getVendorLicenseModelId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VlmZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor));
+    SessionContext context = createSessionContext();
+    ElementContext elementContext = new ElementContext(licenseAgreement.getVendorLicenseModelId(),
+        licenseAgreement.getVersion().getId());
 
     Optional<ElementInfo> elementInfo = zusammenAdaptor.getElementInfo(context,
         elementContext, new Id(licenseAgreement.getId()));
@@ -175,23 +175,22 @@
     ZusammenElement licenseAgreementElement =
         buildLicenseAgreementElement(licenseAgreement, Action.UPDATE);
 
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(licenseAgreement.getVendorLicenseModelId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VlmZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor));
-
+    SessionContext context = createSessionContext();
+    ElementContext elementContext = new ElementContext(licenseAgreement.getVendorLicenseModelId(),
+        licenseAgreement.getVersion().getId());
+    ElementToLicenseAgreementConvertor convertor = new ElementToLicenseAgreementConvertor();
     Optional<ElementInfo> elementInfo =
         zusammenAdaptor.getElementInfo(context, elementContext, new Id(licenseAgreement.getId()));
     if (elementInfo.isPresent()) {
       LicenseAgreementEntity currentLicenseAgreement =
-          mapElementInfoToLicenseAgreement(licenseAgreement.getId(), licenseAgreement.getVersion(),
-              elementInfo.get());
-
-      if (! (removedFeatureGroupIds == null) ) {
+          convertor.convert(elementInfo.get());
+      currentLicenseAgreement.setVendorLicenseModelId(licenseAgreement.getVendorLicenseModelId());
+      currentLicenseAgreement.setVersion(licenseAgreement.getVersion());
+      if (!(removedFeatureGroupIds == null)) {
         currentLicenseAgreement.getFeatureGroupIds().removeAll(removedFeatureGroupIds);
       }
 
-      if (! (addedFeatureGroupIds == null)) {
+      if (!(addedFeatureGroupIds == null)) {
         currentLicenseAgreement.getFeatureGroupIds().addAll(addedFeatureGroupIds);
       }
       licenseAgreementElement.setRelations(currentLicenseAgreement.getFeatureGroupIds().stream()
@@ -203,41 +202,15 @@
     }
   }
 
-  private LicenseAgreementEntity mapElementInfoToLicenseAgreement(String vlmId, Version version,
-                                                                  ElementInfo elementInfo) {
-    LicenseAgreementEntity licenseAgreement =
-        new LicenseAgreementEntity(vlmId, version, elementInfo.getId().getValue());
-    licenseAgreement.setName(elementInfo.getInfo().getName());
-    licenseAgreement.setDescription(elementInfo.getInfo().getDescription());
-
-    licenseAgreement
-        .setLicenseTerm(getCoiceOrOther(elementInfo.getInfo().getProperty("licenseTerm")));
-    licenseAgreement.setRequirementsAndConstrains(
-        elementInfo.getInfo().getProperty("requirementsAndConstrains"));
-    if (elementInfo.getRelations() != null && elementInfo.getRelations().size() > 0) {
-      licenseAgreement.setFeatureGroupIds(elementInfo.getRelations().stream()
-          .map(relation -> relation.getEdge2().getElementId().getValue())
-          .collect(Collectors.toSet()));
-    }
-    return licenseAgreement;
-  }
-
-  private ChoiceOrOther<LicenseTerm> getCoiceOrOther(Map licenseTerm) {
-    return new ChoiceOrOther(LicenseTerm.valueOf((String) licenseTerm.get("choice")),
-        (String) licenseTerm.get("other"));
-  }
-
-
   private ZusammenElement buildLicenseAgreementElement(LicenseAgreementEntity licenseAgreement,
                                                        Action action) {
-    ZusammenElement licenseAgreementElement = new ZusammenElement();
-    licenseAgreementElement.setAction(action);
-    if (licenseAgreement.getId() != null) {
-      licenseAgreementElement.setElementId(new Id(licenseAgreement.getId()));
-    }
+    ZusammenElement licenseAgreementElement =
+        buildElement(licenseAgreement.getId() == null ? null : new Id(licenseAgreement.getId()),
+            action);
     Info info = new Info();
     info.setName(licenseAgreement.getName());
     info.setDescription(licenseAgreement.getDescription());
+    info.addProperty(ElementPropertyName.elementType.name(), ElementType.LicenseAgreement);
     info.addProperty("licenseTerm", licenseAgreement.getLicenseTerm());
     info.addProperty("requirementsAndConstrains", licenseAgreement.getRequirementsAndConstrains());
     licenseAgreementElement.setInfo(info);
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/LicenseKeyGroupZusammenDaoImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/LicenseKeyGroupZusammenDaoImpl.java
index 976db94..4e7aee3 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/LicenseKeyGroupZusammenDaoImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/LicenseKeyGroupZusammenDaoImpl.java
@@ -9,27 +9,22 @@
 import com.amdocs.zusammen.datatypes.item.ElementContext;
 import com.amdocs.zusammen.datatypes.item.Info;
 import org.openecomp.core.zusammen.api.ZusammenAdaptor;
-import org.openecomp.core.zusammen.api.ZusammenUtil;
+import org.openecomp.sdc.datatypes.model.ElementType;
 import org.openecomp.sdc.vendorlicense.dao.LicenseKeyGroupDao;
+import org.openecomp.sdc.vendorlicense.dao.impl.zusammen.convertor.ElementToLicenseKeyGroupConvertor;
 import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity;
-import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyType;
-import org.openecomp.sdc.vendorlicense.dao.types.MultiChoiceOrOther;
-import org.openecomp.sdc.vendorlicense.dao.types.OperationalScope;
-import org.openecomp.sdc.vendorlicense.dao.types.ThresholdUnit;
-import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.types.ElementPropertyName;
 
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
 import java.util.Optional;
-import java.util.Set;
 import java.util.stream.Collectors;
 
-/**
- * Created by ayalaben on 3/30/2017.
- */
+import static org.openecomp.core.zusammen.api.ZusammenUtil.buildElement;
+import static org.openecomp.core.zusammen.api.ZusammenUtil.buildStructuralElement;
+import static org.openecomp.core.zusammen.api.ZusammenUtil.createSessionContext;
+
+
 public class LicenseKeyGroupZusammenDaoImpl implements LicenseKeyGroupDao {
   private ZusammenAdaptor zusammenAdaptor;
 
@@ -47,18 +42,20 @@
     ZusammenElement licenseKeyGroupElement =
         buildLicenseKeyGroupElement(licenseKeyGroup, Action.CREATE);
 
+    ZusammenElement limitsElement = buildStructuralElement(ElementType.Limits, Action.CREATE);
+    licenseKeyGroupElement.addSubElement(limitsElement);
+
     ZusammenElement lkgsElement =
-        VlmZusammenUtil.buildStructuralElement(StructureElement.LicenseKeyGroups, null);
+        buildStructuralElement(ElementType.LicenseKeyGroups, Action.IGNORE);
     lkgsElement.addSubElement(licenseKeyGroupElement);
 
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(licenseKeyGroup.getVendorLicenseModelId());
-    Optional<Element> savedElement = zusammenAdaptor.saveElement(context, new ElementContext(itemId,
-            VlmZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor)),
-        lkgsElement, "Create license Key Group");
+    SessionContext context = createSessionContext();
+    Element lkgsSavedElement = zusammenAdaptor.saveElement(context,
+        new ElementContext(licenseKeyGroup.getVendorLicenseModelId(),
+            licenseKeyGroup.getVersion().getId()), lkgsElement, "Create license Key Group");
 
-    savedElement.ifPresent(element -> licenseKeyGroup
-        .setId(element.getSubElements().iterator().next().getElementId().getValue()));
+    licenseKeyGroup
+        .setId(lkgsSavedElement.getSubElements().iterator().next().getElementId().getValue());
   }
 
   @Override
@@ -66,55 +63,50 @@
     ZusammenElement licenseKeyGroupElement =
         buildLicenseKeyGroupElement(licenseKeyGroup, Action.UPDATE);
 
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(licenseKeyGroup.getVendorLicenseModelId());
-
-    ElementContext elementContext = new ElementContext(itemId,
-        VlmZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor));
+    SessionContext context = createSessionContext();
+    ElementContext elementContext = new ElementContext(licenseKeyGroup.getVendorLicenseModelId(),
+        licenseKeyGroup.getVersion().getId());
 
     Optional<ElementInfo> lkgFromDb = zusammenAdaptor.getElementInfo(context, elementContext,
         new Id(licenseKeyGroup.getId()));
 
-    if(lkgFromDb.isPresent()) {
+    if (lkgFromDb.isPresent()) {
 
-      if( licenseKeyGroupElement.getRelations() == null) {
-         licenseKeyGroupElement.setRelations(new ArrayList<>());
+      if (licenseKeyGroupElement.getRelations() == null) {
+        licenseKeyGroupElement.setRelations(new ArrayList<>());
       }
 
       if (lkgFromDb.get().getRelations() != null && lkgFromDb.get().getRelations().size() > 0) {
         licenseKeyGroupElement.getRelations().addAll(lkgFromDb.get().getRelations());
       }
     }
-
-    zusammenAdaptor.saveElement(context, elementContext,
-        licenseKeyGroupElement,
+    zusammenAdaptor.saveElement(context, elementContext, licenseKeyGroupElement,
         String.format("Update license key group with id %s", licenseKeyGroup.getId()));
   }
 
   @Override
   public LicenseKeyGroupEntity get(LicenseKeyGroupEntity licenseKeyGroup) {
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(licenseKeyGroup.getVendorLicenseModelId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VlmZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor),
-        VlmZusammenUtil.getVersionTag(licenseKeyGroup.getVersion()));
-
+    SessionContext context = createSessionContext();
+    ElementContext elementContext = new ElementContext(licenseKeyGroup.getVendorLicenseModelId(),
+        licenseKeyGroup.getVersion().getId());
+    ElementToLicenseKeyGroupConvertor convertor = new ElementToLicenseKeyGroupConvertor();
     return zusammenAdaptor.getElementInfo(context, elementContext, new Id(licenseKeyGroup.getId()))
-        .map(elementInfo -> mapElementInfoToLicenseKeyGroup(
-            licenseKeyGroup.getVendorLicenseModelId(), licenseKeyGroup.getVersion(), elementInfo))
+        .map(elementInfo -> {
+          LicenseKeyGroupEntity entity = convertor.convert(elementInfo);
+          entity.setVendorLicenseModelId(licenseKeyGroup.getVendorLicenseModelId());
+          entity.setVersion(licenseKeyGroup.getVersion());
+          return entity;
+        })
         .orElse(null);
   }
 
   @Override
   public void delete(LicenseKeyGroupEntity licenseKeyGroup) {
-    SessionContext context = ZusammenUtil.createSessionContext();
-    ZusammenElement zusammenElement = new ZusammenElement();
-    zusammenElement.setAction(Action.DELETE);
-    zusammenElement.setElementId(new Id(licenseKeyGroup.getId()));
+    ZusammenElement zusammenElement = buildElement(new Id(licenseKeyGroup.getId()), Action.DELETE);
 
-    Id itemId = new Id(licenseKeyGroup.getVendorLicenseModelId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VlmZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor));
+    SessionContext context = createSessionContext();
+    ElementContext elementContext = new ElementContext(licenseKeyGroup.getVendorLicenseModelId(),
+        licenseKeyGroup.getVersion().getId());
 
     zusammenAdaptor.saveElement(context, elementContext, zusammenElement,
         "delete license key group. id:" + licenseKeyGroup.getId() + ".");
@@ -122,29 +114,29 @@
 
   @Override
   public Collection<LicenseKeyGroupEntity> list(LicenseKeyGroupEntity licenseKeyGroup) {
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(licenseKeyGroup.getVendorLicenseModelId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VlmZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor),
-        VlmZusammenUtil.getVersionTag(licenseKeyGroup.getVersion()));
-
+    SessionContext context = createSessionContext();
+    ElementContext elementContext = new ElementContext(licenseKeyGroup.getVendorLicenseModelId(),
+        licenseKeyGroup.getVersion().getId());
+    ElementToLicenseKeyGroupConvertor convertor = new ElementToLicenseKeyGroupConvertor();
     return zusammenAdaptor
-        .listElementsByName(context, elementContext, null, StructureElement.LicenseKeyGroups.name())
-        .stream().map(elementInfo -> mapElementInfoToLicenseKeyGroup(
-            licenseKeyGroup.getVendorLicenseModelId(), licenseKeyGroup.getVersion(), elementInfo))
+        .listElementsByName(context, elementContext, null, ElementType.LicenseKeyGroups.name())
+        .stream().map(elementInfo -> {
+          LicenseKeyGroupEntity entity = convertor.convert(elementInfo);
+          entity.setVendorLicenseModelId(licenseKeyGroup.getVendorLicenseModelId());
+          entity.setVersion(licenseKeyGroup.getVersion());
+          return entity;
+        })
         .collect(Collectors.toList());
   }
 
   @Override
   public long count(LicenseKeyGroupEntity licenseKeyGroup) {
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(licenseKeyGroup.getVendorLicenseModelId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VlmZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor),
-        VlmZusammenUtil.getVersionTag(licenseKeyGroup.getVersion()));
+    SessionContext context = createSessionContext();
+    ElementContext elementContext = new ElementContext(licenseKeyGroup.getVendorLicenseModelId(),
+        licenseKeyGroup.getVersion().getId());
 
     return zusammenAdaptor
-        .listElementsByName(context, elementContext, null, StructureElement.LicenseKeyGroups.name())
+        .listElementsByName(context, elementContext, null, ElementType.LicenseKeyGroups.name())
         .size();
   }
 
@@ -156,10 +148,9 @@
   @Override
   public void removeReferencingFeatureGroup(LicenseKeyGroupEntity licenseKeyGroup,
                                             String featureGroupId) {
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(licenseKeyGroup.getVendorLicenseModelId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VlmZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor));
+    SessionContext context = createSessionContext();
+    ElementContext elementContext = new ElementContext(licenseKeyGroup.getVendorLicenseModelId(),
+        licenseKeyGroup.getVersion().getId());
 
     Optional<ElementInfo> elementInfo =
         zusammenAdaptor.getElementInfo(context, elementContext, new Id(licenseKeyGroup.getId()));
@@ -180,10 +171,9 @@
   @Override
   public void addReferencingFeatureGroup(LicenseKeyGroupEntity licenseKeyGroup,
                                          String featureGroupId) {
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(licenseKeyGroup.getVendorLicenseModelId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VlmZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor));
+    SessionContext context = createSessionContext();
+    ElementContext elementContext = new ElementContext(licenseKeyGroup.getVendorLicenseModelId(),
+        licenseKeyGroup.getVersion().getId());
 
     Optional<ElementInfo> elementInfo =
         zusammenAdaptor.getElementInfo(context, elementContext, new Id(licenseKeyGroup.getId()));
@@ -204,18 +194,15 @@
 
   private ZusammenElement buildLicenseKeyGroupElement(LicenseKeyGroupEntity licenseKeyGroup,
                                                       Action action) {
-
-    ZusammenElement lkgElement = new ZusammenElement();
-    lkgElement.setAction(action);
-    if (licenseKeyGroup.getId() != null) {
-      lkgElement.setElementId(new Id(licenseKeyGroup.getId()));
-    }
+    ZusammenElement lkgElement =
+        buildElement(licenseKeyGroup.getId() == null ? null : new Id(licenseKeyGroup.getId()),
+            action);
     Info info = new Info();
     info.setName(licenseKeyGroup.getName());
     info.setDescription(licenseKeyGroup.getDescription());
+    info.addProperty(ElementPropertyName.elementType.name(), ElementType.LicenseKeyGroup);
     info.addProperty("version_uuid", licenseKeyGroup.getVersionUuId());
     info.addProperty("LicenseKeyType", licenseKeyGroup.getType());
-    info.addProperty("version_uuid", licenseKeyGroup.getVersionUuId());
     info.addProperty("operational_scope", licenseKeyGroup.getOperationalScope());
     info.addProperty("startDate", licenseKeyGroup.getStartDate());
     info.addProperty("expiryDate", licenseKeyGroup.getExpiryDate());
@@ -224,70 +211,15 @@
     info.addProperty("increments", licenseKeyGroup.getIncrements());
     lkgElement.setInfo(info);
 
-   if (licenseKeyGroup.getReferencingFeatureGroups() != null
-       && licenseKeyGroup.getReferencingFeatureGroups().size() > 0) {
+    if (licenseKeyGroup.getReferencingFeatureGroups() != null
+        && licenseKeyGroup.getReferencingFeatureGroups().size() > 0) {
       lkgElement.setRelations(licenseKeyGroup.getReferencingFeatureGroups().stream()
           .map(rel -> VlmZusammenUtil
               .createRelation(RelationType.LicenseKeyGroupToReferencingFeatureGroup, rel))
           .collect(Collectors.toList()));
     }
-
     return lkgElement;
   }
 
-  private LicenseKeyGroupEntity mapElementInfoToLicenseKeyGroup(String vlmId, Version version,
-                                                                ElementInfo elementInfo) {
-    LicenseKeyGroupEntity licenseKeyGroup =
-        new LicenseKeyGroupEntity(vlmId, version, elementInfo.getId().getValue());
-    licenseKeyGroup.setName(elementInfo.getInfo().getName());
-    licenseKeyGroup.setDescription(elementInfo.getInfo().getDescription());
-    licenseKeyGroup.setVersionUuId(elementInfo.getInfo().getProperty("version_uuid"));
-    licenseKeyGroup
-        .setType(LicenseKeyType.valueOf(elementInfo.getInfo().getProperty("LicenseKeyType")));
-    licenseKeyGroup.setVersionUuId(elementInfo.getInfo().getProperty("version_uuid"));
-    licenseKeyGroup.setOperationalScope(getOperationalScopeMultiChoiceOrOther(
-        elementInfo.getInfo().getProperty("operational_scope")));
-    licenseKeyGroup.setStartDate(elementInfo.getInfo().getProperty("startDate"));
-    licenseKeyGroup.setExpiryDate(elementInfo.getInfo().getProperty("expiryDate"));
-    if (elementInfo.getInfo().getProperty("thresholdUnits") != null ){
-      licenseKeyGroup.setThresholdUnits(ThresholdUnit.valueOf(elementInfo
-          .getInfo().getProperty("thresholdUnits")));
-    }
-    if (elementInfo.getInfo().getProperty("thresholdValue") != null ){
-      licenseKeyGroup.setThresholdValue(toInteger(elementInfo.getInfo().getProperty
-          ("thresholdValue")));
-    }
-    licenseKeyGroup.setIncrements(elementInfo.getInfo().getProperty("increments"));
 
-    if (elementInfo.getRelations() != null && elementInfo.getRelations().size() > 0) {
-      licenseKeyGroup
-          .setReferencingFeatureGroups(elementInfo.getRelations().stream().map(relation -> relation
-              .getEdge2().getElementId().getValue()).collect(Collectors.toSet()));
-    }
-    return licenseKeyGroup;
-  }
-
-  private MultiChoiceOrOther<OperationalScope> getOperationalScopeMultiChoiceOrOther
-      (Map<String, Object>
-           operationalScope) {
-  if(operationalScope != null && !operationalScope.isEmpty()) {
-    Set<OperationalScope> choices = new HashSet<>();
-    ((List<String>) operationalScope.get("choices"))
-        .forEach(choice -> choices.add(OperationalScope.valueOf(choice)));
-
-    return new MultiChoiceOrOther<>(choices, operationalScope.get("other")==null?null:(String) operationalScope.get("other"));
-  }
-  return null;
-  }
-
-  private Integer toInteger(Object val) {
-    if (val instanceof Double) {
-      return ((Double) val).intValue();
-    } else if (val instanceof String) {
-      return new Integer((String) val);
-    } else if (val instanceof Integer) {
-      return (Integer) val;
-    }
-    throw new RuntimeException("invalid value for integer:" + val.getClass());
-  }
 }
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/LimitZusammenDaoImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/LimitZusammenDaoImpl.java
index 78c26c8..7b19236 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/LimitZusammenDaoImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/LimitZusammenDaoImpl.java
@@ -9,26 +9,30 @@
 import com.amdocs.zusammen.datatypes.item.ElementContext;
 import com.amdocs.zusammen.datatypes.item.Info;
 import org.openecomp.core.zusammen.api.ZusammenAdaptor;
-import org.openecomp.core.zusammen.api.ZusammenUtil;
+import org.openecomp.sdc.datatypes.model.ElementType;
 import org.openecomp.sdc.vendorlicense.dao.LimitDao;
 import org.openecomp.sdc.vendorlicense.dao.types.AggregationFunction;
 import org.openecomp.sdc.vendorlicense.dao.types.LimitEntity;
 import org.openecomp.sdc.vendorlicense.dao.types.LimitType;
 import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.types.ElementPropertyName;
 
 import java.util.Collection;
 import java.util.Collections;
-import java.util.Optional;
 import java.util.stream.Collectors;
 
+import static org.openecomp.core.zusammen.api.ZusammenUtil.buildElement;
+import static org.openecomp.core.zusammen.api.ZusammenUtil.buildStructuralElement;
+import static org.openecomp.core.zusammen.api.ZusammenUtil.createSessionContext;
+
 public class LimitZusammenDaoImpl implements LimitDao {
 
-  public static final String LIMT_TYPE = "type";
-  public static final String METRIC = "metric";
-  public static final String AGGREGATIONFUNCTION = "aggregationfunction";
-  public static final String TIME = "time";
-  public static final String UNIT = "unit";
-  public static final String VALUE = "value";
+  private static final String LIMT_TYPE = "type";
+  private static final String METRIC = "metric";
+  private static final String AGGREGATIONFUNCTION = "aggregationfunction";
+  private static final String TIME = "time";
+  private static final String UNIT = "unit";
+  private static final String VALUE = "value";
   private ZusammenAdaptor zusammenAdaptor;
 
   public LimitZusammenDaoImpl(ZusammenAdaptor zusammenAdaptor) {
@@ -39,36 +43,30 @@
   public void create(LimitEntity limitEntity) {
     ZusammenElement limitElement = limitToZusammen(limitEntity, Action.CREATE);
 
-    ZusammenElement limitsElement =
-        VlmZusammenUtil.buildStructuralElement(StructureElement.Limits, null);
+    ZusammenElement limitsElement = buildStructuralElement(ElementType.Limits, null);
     limitsElement.setSubElements(Collections.singletonList(limitElement));
 
-    ZusammenElement epLkgElement =
-        buildZusammenElement(new Id(limitEntity.getEpLkgId()), Action.IGNORE);
+    ZusammenElement epLkgElement = buildElement(new Id(limitEntity.getEpLkgId()), Action.IGNORE);
     epLkgElement.setSubElements(Collections.singletonList(limitsElement));
 
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(limitEntity.getVendorLicenseModelId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VlmZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor));
+    SessionContext context = createSessionContext();
+    ElementContext elementContext =
+        new ElementContext(limitEntity.getVendorLicenseModelId(), limitEntity.getVersion().getId());
 
-    Optional<Element> savedElement =
+    Element savedElement =
         zusammenAdaptor.saveElement(context, elementContext, epLkgElement, "Create limit");
-    savedElement.ifPresent(element ->
-        limitEntity.setId(element.getSubElements().iterator().next()
-            .getSubElements().iterator().next().getElementId().getValue()));
+    limitEntity.setId(savedElement.getSubElements().iterator().next()
+        .getSubElements().iterator().next().getElementId().getValue());
   }
 
   @Override
   public boolean isLimitPresent(LimitEntity limitEntity) {
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(limitEntity.getVendorLicenseModelId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VlmZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor),
-        VlmZusammenUtil.getVersionTag(limitEntity.getVersion()));
+    SessionContext context = createSessionContext();
+    ElementContext elementContext =
+        new ElementContext(limitEntity.getVendorLicenseModelId(), limitEntity.getVersion().getId());
 
     Collection<ElementInfo> elementInfos = zusammenAdaptor.listElementsByName(context,
-        elementContext, new Id(limitEntity.getEpLkgId()),StructureElement.Limits.name());
+        elementContext, new Id(limitEntity.getEpLkgId()), ElementType.Limits.name());
 
     for (ElementInfo elementInfo : elementInfos) {
       if (elementInfo.getId().getValue().equals(limitEntity.getId())) {
@@ -81,20 +79,18 @@
 
   @Override
   public Collection<LimitEntity> list(LimitEntity limitEntity) {
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(limitEntity.getVendorLicenseModelId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VlmZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor),
-        VlmZusammenUtil.getVersionTag(limitEntity.getVersion()));
+    SessionContext context = createSessionContext();
+    ElementContext elementContext =
+        new ElementContext(limitEntity.getVendorLicenseModelId(), limitEntity.getVersion().getId());
 
     return listLimits(context, elementContext, limitEntity);
   }
 
   private Collection<LimitEntity> listLimits(SessionContext context, ElementContext elementContext,
-                                           LimitEntity limitEntity) {
+                                             LimitEntity limitEntity) {
     return zusammenAdaptor
         .listElementsByName(context, elementContext, new Id(limitEntity.getEpLkgId()),
-            StructureElement.Limits.name())
+            ElementType.Limits.name())
         .stream().map(elementInfo -> mapElementInfoToLimit(
             limitEntity.getVendorLicenseModelId(), limitEntity.getVersion(),
             limitEntity.getEpLkgId(), elementInfo))
@@ -102,18 +98,18 @@
   }
 
   private LimitEntity mapElementInfoToLimit(String vlmId, Version version,
-                                        String epLkgId, ElementInfo elementInfo) {
+                                            String epLkgId, ElementInfo elementInfo) {
     LimitEntity limitEntity =
         new LimitEntity(vlmId, version, epLkgId, elementInfo.getId().getValue());
 
     limitEntity.setName(elementInfo.getInfo().getName());
     limitEntity.setDescription(elementInfo.getInfo().getDescription());
-    limitEntity.setType( elementInfo.getInfo().getProperties().get(LIMT_TYPE) != null ?
+    limitEntity.setType(elementInfo.getInfo().getProperties().get(LIMT_TYPE) != null ?
         LimitType.valueOf((String) elementInfo.getInfo().getProperties().get(LIMT_TYPE)) :
         null);
-    limitEntity.setTime((String) elementInfo.getInfo().getProperties().get(TIME) );
-    limitEntity.setMetric( (String) elementInfo.getInfo().getProperties().get(METRIC));
-    limitEntity.setAggregationFunction( elementInfo.getInfo().getProperties().get
+    limitEntity.setTime((String) elementInfo.getInfo().getProperties().get(TIME));
+    limitEntity.setMetric((String) elementInfo.getInfo().getProperties().get(METRIC));
+    limitEntity.setAggregationFunction(elementInfo.getInfo().getProperties().get
         (AGGREGATIONFUNCTION) != null ?
         AggregationFunction.valueOf((String) elementInfo.getInfo().getProperties()
             .get(AGGREGATIONFUNCTION)) : null);
@@ -126,25 +122,22 @@
   }
 
   @Override
-  public void update(LimitEntity entity) {
-    ZusammenElement limitElement = limitToZusammen(entity, Action.UPDATE);
+  public void update(LimitEntity limitEntity) {
+    ZusammenElement limitElement = limitToZusammen(limitEntity, Action.UPDATE);
 
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(entity.getVendorLicenseModelId());
-    ElementContext elementContext =  new ElementContext(itemId,
-        VlmZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor));
+    SessionContext context = createSessionContext();
+    ElementContext elementContext =
+        new ElementContext(limitEntity.getVendorLicenseModelId(), limitEntity.getVersion().getId());
 
-    zusammenAdaptor.saveElement(context,elementContext, limitElement,
-        String.format("Update limit with id %s", entity.getId()));
+    zusammenAdaptor.saveElement(context, elementContext, limitElement,
+        String.format("Update limit with id %s", limitEntity.getId()));
   }
 
   @Override
   public LimitEntity get(LimitEntity limitEntity) {
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(limitEntity.getVendorLicenseModelId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VlmZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor),
-        VlmZusammenUtil.getVersionTag(limitEntity.getVersion()));
+    SessionContext context = createSessionContext();
+    ElementContext elementContext =
+        new ElementContext(limitEntity.getVendorLicenseModelId(), limitEntity.getVersion().getId());
 
     return zusammenAdaptor.getElementInfo(context, elementContext, new Id(limitEntity.getId()))
         .map(elementInfo -> mapElementInfoToLimit(
@@ -154,18 +147,14 @@
   }
 
   @Override
-  public void delete(LimitEntity entity) {
-    SessionContext context = ZusammenUtil.createSessionContext();
-    ZusammenElement zusammenElement = new ZusammenElement();
-    zusammenElement.setAction(Action.DELETE);
-    zusammenElement.setElementId(new Id(entity.getId()));
+  public void delete(LimitEntity limitEntity) {
+    ZusammenElement zusammenElement = buildElement(new Id(limitEntity.getId()), Action.DELETE);
 
-    Id itemId = new Id(entity.getVendorLicenseModelId());
+    SessionContext context = createSessionContext();
     ElementContext elementContext =
-            new ElementContext(itemId,
-                    VlmZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor));
+        new ElementContext(limitEntity.getVendorLicenseModelId(), limitEntity.getVersion().getId());
     zusammenAdaptor.saveElement(context, elementContext, zusammenElement,
-            "delete limit Id:" + entity.getId() + ".");
+        "delete limit Id:" + limitEntity.getId() + ".");
   }
 
   @Override
@@ -173,23 +162,13 @@
 
   }
 
-  private ZusammenElement limitToZusammen(LimitEntity limit,
-                                                     Action action) {
-    ZusammenElement limitElement = buildLimitElement(limit, action);
-    return limitElement;
-  }
-
-  private ZusammenElement buildLimitElement(LimitEntity limit,
-                                                       Action action) {
-    ZusammenElement limitElement = new ZusammenElement();
-    limitElement.setAction(action);
-    if (limit.getId() != null) {
-      limitElement.setElementId(new Id(limit.getId()));
-    }
-
+  private ZusammenElement limitToZusammen(LimitEntity limit, Action action) {
+    ZusammenElement limitElement =
+        buildElement(limit.getId() == null ? null : new Id(limit.getId()), action);
     Info info = new Info();
     info.setName(limit.getName());
     info.setDescription(limit.getDescription());
+    info.addProperty(ElementPropertyName.elementType.name(), ElementType.Limit);
     info.addProperty(LIMT_TYPE, limit.getType());
     info.addProperty(METRIC, limit.getMetric());
     info.addProperty(AGGREGATIONFUNCTION, limit.getAggregationFunction());
@@ -199,11 +178,4 @@
     limitElement.setInfo(info);
     return limitElement;
   }
-
-  private ZusammenElement buildZusammenElement(Id elementId, Action action) {
-    ZusammenElement element = new ZusammenElement();
-    element.setElementId(elementId);
-    element.setAction(action);
-    return element;
-  }
 }
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/VendorLicenseModelDaoZusammenImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/VendorLicenseModelDaoZusammenImpl.java
index cd1ef0f..1306551 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/VendorLicenseModelDaoZusammenImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/VendorLicenseModelDaoZusammenImpl.java
@@ -1,23 +1,21 @@
 package org.openecomp.sdc.vendorlicense.dao.impl.zusammen;
 
 import com.amdocs.zusammen.adaptor.inbound.api.types.item.ZusammenElement;
-import com.amdocs.zusammen.datatypes.Id;
 import com.amdocs.zusammen.datatypes.SessionContext;
 import com.amdocs.zusammen.datatypes.item.Action;
 import com.amdocs.zusammen.datatypes.item.ElementContext;
 import com.amdocs.zusammen.datatypes.item.Info;
-import com.amdocs.zusammen.datatypes.item.ItemVersion;
 import org.openecomp.core.zusammen.api.ZusammenAdaptor;
 import org.openecomp.core.zusammen.api.ZusammenUtil;
+import org.openecomp.sdc.datatypes.model.ElementType;
 import org.openecomp.sdc.vendorlicense.dao.VendorLicenseModelDao;
+import org.openecomp.sdc.vendorlicense.dao.impl.zusammen.convertor.ElementToVLMGeneralConvertor;
 import org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity;
 import org.openecomp.sdc.versioning.VersioningManagerFactory;
-import org.openecomp.sdc.versioning.dao.types.Version;
 import org.openecomp.sdc.versioning.types.VersionableEntityMetadata;
 import org.openecomp.sdc.versioning.types.VersionableEntityStoreType;
 
 import java.util.Collection;
-import java.util.Date;
 import java.util.stream.Collectors;
 
 public class VendorLicenseModelDaoZusammenImpl implements VendorLicenseModelDao {
@@ -31,63 +29,91 @@
   @Override
   public void registerVersioning(String versionableEntityType) {
     VersionableEntityMetadata metadata =
-        new VersionableEntityMetadata(VersionableEntityStoreType.Zusammen, "vlm", null, null);
+        new VersionableEntityMetadata(VersionableEntityStoreType.Zusammen, "VendorLicenseModel",
+            null, null);
 
     VersioningManagerFactory.getInstance().createInterface()
         .register(versionableEntityType, metadata);
   }
 
   @Override
-  public Collection<VendorLicenseModelEntity> list(VendorLicenseModelEntity entity) {
+  public Collection<VendorLicenseModelEntity> list(
+      VendorLicenseModelEntity vendorLicenseModelEntity) {
+
+    ElementToVLMGeneralConvertor convertor = new ElementToVLMGeneralConvertor();
     return zusammenAdaptor.listItems(ZusammenUtil.createSessionContext()).stream()
-        .map(item -> mapInfoToVlm(
-            item.getId().getValue(), null, item.getInfo(),
-            item.getModificationTime(), item.getCreationTime()))
+        .filter(item -> "VendorLicenseModel".equals(item.getInfo().getProperty("item_type")))
+        .map(item -> {
+          VendorLicenseModelEntity entity = convertor.convert(item);
+          entity.setId(item.getId().getValue());
+          entity.setVersion(null);
+          return entity;
+        })
         .collect(Collectors.toList());
   }
 
   @Override
   public void create(VendorLicenseModelEntity vendorLicenseModel) {
+
     SessionContext context = ZusammenUtil.createSessionContext();
 
-    Id itemId = zusammenAdaptor.createItem(context, mapVlmToZusammenItemInfo(vendorLicenseModel));
-    Id versionId =
-        zusammenAdaptor.createVersion(context, itemId, null, ZusammenUtil.createFirstVersionData());
+    ElementContext elementContext = new ElementContext(vendorLicenseModel.getId(),
+        vendorLicenseModel.getVersion().getId());
 
     ZusammenElement generalElement = mapVlmToZusammenElement(vendorLicenseModel, Action.CREATE);
-    zusammenAdaptor.saveElement(context, new ElementContext(itemId, versionId),
-        generalElement, "Create VSP General Info Element");
 
-    vendorLicenseModel.setId(itemId.getValue());//set id for caller
+    zusammenAdaptor.saveElement(context, elementContext, generalElement,
+        "Create VLM General Info Element");
+
+    ZusammenElement licenseAgreementsElement =
+        ZusammenUtil.buildStructuralElement(ElementType.LicenseAgreements,  Action.CREATE);
+
+    zusammenAdaptor.saveElement(context, elementContext, licenseAgreementsElement,
+        "Create VLM licenseAgreementsElement");
+
+    ZusammenElement featureGroupsElement =
+        ZusammenUtil.buildStructuralElement(ElementType.FeatureGroups,  Action.CREATE);
+
+    zusammenAdaptor.saveElement(context, elementContext, featureGroupsElement,
+        "Create VLM featureGroupsElement");
+
+    ZusammenElement lkgsElement =
+        ZusammenUtil.buildStructuralElement(ElementType.LicenseKeyGroups,  Action.CREATE);
+
+    zusammenAdaptor.saveElement(context, elementContext, lkgsElement,
+        "Create VLM lkgsElement");
+
+    ZusammenElement entitlementPoolsElement =
+        ZusammenUtil.buildStructuralElement(ElementType.EntitlementPools,  Action.CREATE);
+
+    zusammenAdaptor.saveElement(context, elementContext, entitlementPoolsElement,
+        "Create VLM entitlementPoolsElement");
   }
 
   @Override
   public void update(VendorLicenseModelEntity vendorLicenseModel) {
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(vendorLicenseModel.getId());
-    Id versionId = VlmZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor);
-
-    zusammenAdaptor.updateItem(context, itemId, mapVlmToZusammenItemInfo(vendorLicenseModel));
-
     ZusammenElement generalElement = mapVlmToZusammenElement(vendorLicenseModel, Action.UPDATE);
-    zusammenAdaptor.saveElement(context, new ElementContext(itemId, versionId),
+
+    SessionContext context = ZusammenUtil.createSessionContext();
+    zusammenAdaptor.saveElement(context,
+        new ElementContext(vendorLicenseModel.getId(), vendorLicenseModel.getVersion().getId()),
         generalElement, "Update VSP General Info Element");
   }
 
   @Override
   public VendorLicenseModelEntity get(VendorLicenseModelEntity vendorLicenseModel) {
     SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(vendorLicenseModel.getId());
-    ItemVersion itemVersion = VlmZusammenUtil.getFirstVersion(context, itemId, zusammenAdaptor);
-    ElementContext elementContext = new ElementContext(itemId, itemVersion.getId(),
-        VlmZusammenUtil.getVersionTag(vendorLicenseModel.getVersion()));
-
+    ElementContext elementContext =
+        new ElementContext(vendorLicenseModel.getId(), vendorLicenseModel.getVersion().getId());
+    ElementToVLMGeneralConvertor convertor = new ElementToVLMGeneralConvertor();
     return zusammenAdaptor
-        .getElementInfoByName(context, elementContext, null, StructureElement.General.name())
-        .map(generalElementInfo -> mapInfoToVlm(
-            vendorLicenseModel.getId(), vendorLicenseModel.getVersion(),
-            generalElementInfo.getInfo(),
-            itemVersion.getModificationTime(), itemVersion.getCreationTime()))
+        .getElementInfoByName(context, elementContext, null, ElementType.VendorLicenseModel.name())
+        .map(generalElementInfo -> {
+          VendorLicenseModelEntity entity = convertor.convert(generalElementInfo);
+          entity.setId(vendorLicenseModel.getId());
+          entity.setVersion(vendorLicenseModel.getVersion());
+          return entity;
+        })
         .orElse(null);
   }
 
@@ -96,19 +122,19 @@
 
   }
 
-  private Info mapVlmToZusammenItemInfo(VendorLicenseModelEntity vendorLicenseModel) {
+ /* private Info mapVlmToZusammenItemInfo(VendorLicenseModelEntity vendorLicenseModel) {
     Info info = new Info();
     info.setName(vendorLicenseModel.getVendorName());
     info.setDescription(vendorLicenseModel.getDescription());
-    info.addProperty("type", "vlm");
+    info.addProperty("type", "VendorLicenseModel");
     addVlmToInfo(info, vendorLicenseModel);
     return info;
-  }
+  }*/
 
   private ZusammenElement mapVlmToZusammenElement(VendorLicenseModelEntity vendorLicenseModel,
                                                   Action action) {
     ZusammenElement generalElement =
-        VlmZusammenUtil.buildStructuralElement(StructureElement.General, action);
+        ZusammenUtil.buildStructuralElement(ElementType.VendorLicenseModel, action);
     addVlmToInfo(generalElement.getInfo(), vendorLicenseModel);
     return generalElement;
   }
@@ -117,22 +143,21 @@
     info.addProperty(InfoPropertyName.name.name(), vendorLicenseModel.getVendorName());
     info.addProperty(InfoPropertyName.description.name(), vendorLicenseModel.getDescription());
     info.addProperty(InfoPropertyName.iconRef.name(), vendorLicenseModel.getIconRef());
+    info.addProperty(InfoPropertyName.oldVersion.name(), vendorLicenseModel.getOldVersion());
   }
 
-  private VendorLicenseModelEntity mapInfoToVlm(String vlmId, Version version, Info info,
-                                                Date modificationTime, Date creationTime) {
+  /*private VendorLicenseModelEntity mapInfoToVlm(String vlmId, Version version, Info info) {
     VendorLicenseModelEntity vendorLicenseModel = new VendorLicenseModelEntity(vlmId, version);
     vendorLicenseModel.setVendorName(info.getProperty(InfoPropertyName.name.name()));
     vendorLicenseModel.setDescription(info.getProperty(InfoPropertyName.description.name()));
     vendorLicenseModel.setIconRef(info.getProperty(InfoPropertyName.iconRef.name()));
-    vendorLicenseModel.setWritetimeMicroSeconds(
-        modificationTime == null ? creationTime.getTime() : modificationTime.getTime());
     return vendorLicenseModel;
-  }
+  }*/
 
-  private enum InfoPropertyName {
+  public enum InfoPropertyName {
     name,
     description,
-    iconRef
+    iconRef,
+    oldVersion
   }
 }
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/VlmZusammenUtil.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/VlmZusammenUtil.java
index f16d0fa..07a4f87 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/VlmZusammenUtil.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/VlmZusammenUtil.java
@@ -3,49 +3,13 @@
 import com.amdocs.zusammen.adaptor.inbound.api.types.item.ElementInfo;
 import com.amdocs.zusammen.adaptor.inbound.api.types.item.ZusammenElement;
 import com.amdocs.zusammen.datatypes.Id;
-import com.amdocs.zusammen.datatypes.SessionContext;
-import com.amdocs.zusammen.datatypes.item.Action;
-import com.amdocs.zusammen.datatypes.item.ItemVersion;
 import com.amdocs.zusammen.datatypes.item.Relation;
 import com.amdocs.zusammen.datatypes.item.RelationEdge;
-import org.openecomp.core.zusammen.api.ZusammenAdaptor;
-import org.openecomp.core.zusammen.api.ZusammenUtil;
-import org.openecomp.sdc.common.errors.CoreException;
-import org.openecomp.sdc.vendorlicense.errors.VendorLicenseModelNotFoundErrorBuilder;
-import org.openecomp.sdc.versioning.dao.types.Version;
-import org.openecomp.sdc.versioning.dao.types.VersionStatus;
 
-import java.util.Optional;
 import java.util.stream.Collectors;
 
 public class VlmZusammenUtil {
 
-  static ItemVersion getFirstVersion(SessionContext context, Id itemId,
-                                     ZusammenAdaptor zusammenAdaptor) {
-    Optional<ItemVersion> itemVersion = zusammenAdaptor.getFirstVersion(context, itemId);
-
-    if (!itemVersion.isPresent()) {
-      throw new CoreException(
-          new VendorLicenseModelNotFoundErrorBuilder(itemId.getValue()).build());
-    }
-    return itemVersion.get();
-  }
-
-  static Id getFirstVersionId(SessionContext context, Id itemId, ZusammenAdaptor zusammenAdaptor) {
-    return getFirstVersion(context, itemId, zusammenAdaptor).getId();
-  }
-
-  // TODO: 4/25/2017 remove upon working with more than one single version
-  static String getVersionTag(Version version) {
-    return version.getStatus() == VersionStatus.Locked
-        ? null
-        : version.toString();
-  }
-
-  static ZusammenElement buildStructuralElement(StructureElement structureElement, Action action) {
-    return ZusammenUtil.buildStructuralElement(structureElement.name(), action);
-  }
-
   static ZusammenElement getZusammenElement(ElementInfo elementInfo) {
     ZusammenElement zusammenElement = new ZusammenElement();
     zusammenElement.setElementId(elementInfo.getId());
@@ -67,6 +31,9 @@
   }
 
   public static Integer toInteger(Object val) {
+    if (val == null) {
+      return null;
+    }
     if (val instanceof Double) {
       return ((Double) val).intValue();
     } else if (val instanceof String) {
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToEntitlementPoolConvertor.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToEntitlementPoolConvertor.java
new file mode 100644
index 0000000..75fc6f2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToEntitlementPoolConvertor.java
@@ -0,0 +1,95 @@
+package org.openecomp.sdc.vendorlicense.dao.impl.zusammen.convertor;
+
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.Element;
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.ElementInfo;
+import com.amdocs.zusammen.datatypes.item.Info;
+import com.amdocs.zusammen.datatypes.item.Relation;
+import org.openecomp.convertor.ElementConvertor;
+import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity;
+import org.openecomp.sdc.vendorlicense.dao.types.MultiChoiceOrOther;
+import org.openecomp.sdc.vendorlicense.dao.types.OperationalScope;
+import org.openecomp.sdc.vendorlicense.dao.types.ThresholdUnit;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+import static org.openecomp.sdc.vendorlicense.dao.impl.zusammen.VlmZusammenUtil.toInteger;
+
+
+public class ElementToEntitlementPoolConvertor extends ElementConvertor {
+  @Override
+  public EntitlementPoolEntity convert(Element element) {
+    if (element == null) {
+      return null;
+    }
+    return mapElementToEntitlementPoolEntity(element);
+  }
+
+  @Override
+  public EntitlementPoolEntity convert(ElementInfo elementInfo) {
+    if (elementInfo == null) {
+      return null;
+    }
+    return mapElementInfoToEntitlementPoolEntity(elementInfo);
+  }
+
+  private EntitlementPoolEntity mapElementToEntitlementPoolEntity(Element element) {
+    EntitlementPoolEntity entitlementPool =
+        new EntitlementPoolEntity();
+    entitlementPool.setId(element.getElementId().getValue());
+    mapInfoToEntitlementPoolEntity(entitlementPool, element.getInfo());
+    mapRelationsToEntitlementPoolEntity(entitlementPool, element.getRelations());
+    return entitlementPool;
+  }
+
+  private EntitlementPoolEntity mapElementInfoToEntitlementPoolEntity(ElementInfo elementInfo) {
+    EntitlementPoolEntity entitlementPool =
+        new EntitlementPoolEntity();
+    entitlementPool.setId(elementInfo.getId().getValue());
+    mapInfoToEntitlementPoolEntity(entitlementPool, elementInfo.getInfo());
+    mapRelationsToEntitlementPoolEntity(entitlementPool, elementInfo.getRelations());
+    return entitlementPool;
+  }
+
+  private void mapInfoToEntitlementPoolEntity(EntitlementPoolEntity entitlementPool, Info info) {
+    entitlementPool.setName(info.getName());
+    entitlementPool.setDescription(info.getDescription());
+    entitlementPool.setVersionUuId(info.getProperty("version_uuid"));
+    entitlementPool.setThresholdValue(toInteger(info.getProperty("thresholdValue")));
+    String thresholdUnit = info.getProperty("threshold_unit");
+    entitlementPool
+        .setThresholdUnit(thresholdUnit == null ? null : ThresholdUnit.valueOf(thresholdUnit));
+    entitlementPool.setIncrements(info.getProperty("increments"));
+    entitlementPool.setOperationalScope(
+        getOperationalScopeMultiChoiceOrOther(info.getProperty("operational_scope")));
+    entitlementPool.setStartDate(info.getProperty("startDate"));
+    entitlementPool.setExpiryDate(info.getProperty("expiryDate"));
+  }
+
+  private void mapRelationsToEntitlementPoolEntity(EntitlementPoolEntity entitlementPool,
+                                                   Collection<Relation> relations) {
+    if (relations != null && relations.size() > 0) {
+      entitlementPool
+          .setReferencingFeatureGroups(relations.stream().map(relation -> relation
+              .getEdge2().getElementId().getValue()).collect(Collectors.toSet()));
+    }
+  }
+
+  private MultiChoiceOrOther<OperationalScope> getOperationalScopeMultiChoiceOrOther(
+      Map<String, Object> operationalScope) {
+    if (operationalScope == null || operationalScope.isEmpty()) {
+      return null;
+    }
+
+    Set<OperationalScope> choices = new HashSet<>();
+    ((List<String>) operationalScope.get("choices")).
+        forEach(choice -> choices.add(OperationalScope.valueOf(choice)));
+
+    Object other = operationalScope.get("other");
+    return new MultiChoiceOrOther<>(choices, other == null ? null : (String) other);
+  }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToFeatureGroupConvertor.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToFeatureGroupConvertor.java
new file mode 100644
index 0000000..e39c22e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToFeatureGroupConvertor.java
@@ -0,0 +1,83 @@
+package org.openecomp.sdc.vendorlicense.dao.impl.zusammen.convertor;
+
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.Element;
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.ElementInfo;
+import com.amdocs.zusammen.datatypes.item.Info;
+import com.amdocs.zusammen.datatypes.item.Relation;
+import org.openecomp.convertor.ElementConvertor;
+import org.openecomp.sdc.vendorlicense.dao.impl.zusammen.RelationType;
+import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+
+
+public class ElementToFeatureGroupConvertor extends ElementConvertor {
+  @Override
+  public FeatureGroupEntity convert(Element element) {
+    if (element == null) {
+      return null;
+    }
+    return mapElementToFeatureGroupEntity(element);
+
+  }
+
+  @Override
+  public FeatureGroupEntity convert(ElementInfo elementInfo) {
+    if (elementInfo == null) {
+      return null;
+    }
+    return mapElementInfoToFeatureGroupEntity(elementInfo);
+
+  }
+
+
+  private FeatureGroupEntity mapElementToFeatureGroupEntity(Element element) {
+    FeatureGroupEntity featureGroup =
+        new FeatureGroupEntity();
+    featureGroup.setId(element.getElementId().getValue());
+    mapInfoToFeatureGroup(featureGroup, element.getInfo());
+    mapRelationsToFeatureGroup(featureGroup, element.getRelations());
+    return featureGroup;
+  }
+
+
+  private FeatureGroupEntity mapElementInfoToFeatureGroupEntity(ElementInfo elementInfo) {
+    FeatureGroupEntity featureGroup = new FeatureGroupEntity();
+    featureGroup.setId(elementInfo.getId().getValue());
+    mapInfoToFeatureGroup(featureGroup, elementInfo.getInfo());
+    mapRelationsToFeatureGroup(featureGroup, elementInfo.getRelations());
+    return featureGroup;
+  }
+
+  private void mapInfoToFeatureGroup(FeatureGroupEntity featureGroup, Info info) {
+    featureGroup.setName(info.getName());
+    featureGroup.setDescription(info.getDescription());
+    featureGroup.setPartNumber(info.getProperty("partNumber"));
+    featureGroup.setManufacturerReferenceNumber(info.getProperty("manufacturerReferenceNumber"));
+  }
+
+  private void mapRelationsToFeatureGroup(FeatureGroupEntity featureGroup,
+                                          Collection<Relation> relations) {
+    Set<String> entitlementPoolIds = new HashSet<>();
+    Set<String> licenseAgreements = new HashSet<>();
+    Set<String> licenseKeyGroupIds = new HashSet<>();
+
+    if (relations != null) {
+      for (Relation relation : relations) {
+        if (RelationType.FeatureGroupToEntitlmentPool.name().equals(relation.getType())) {
+          entitlementPoolIds.add(relation.getEdge2().getElementId().getValue());
+        } else if (RelationType.FeatureGroupToLicenseKeyGroup.name().equals(relation.getType())) {
+          licenseKeyGroupIds.add(relation.getEdge2().getElementId().getValue());
+        } else if (RelationType.FeatureGroupToReferencingLicenseAgreement.name()
+            .equals(relation.getType())) {
+          licenseAgreements.add(relation.getEdge2().getElementId().getValue());
+        }
+      }
+    }
+    featureGroup.setEntitlementPoolIds(entitlementPoolIds);
+    featureGroup.setLicenseKeyGroupIds(licenseKeyGroupIds);
+    featureGroup.setReferencingLicenseAgreements(licenseAgreements);
+  }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToLicenseAgreementConvertor.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToLicenseAgreementConvertor.java
new file mode 100644
index 0000000..a0caa0c
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToLicenseAgreementConvertor.java
@@ -0,0 +1,86 @@
+package org.openecomp.sdc.vendorlicense.dao.impl.zusammen.convertor;
+
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.Element;
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.ElementInfo;
+import com.amdocs.zusammen.datatypes.item.Info;
+import com.amdocs.zusammen.datatypes.item.Relation;
+import org.openecomp.convertor.ElementConvertor;
+import org.openecomp.sdc.vendorlicense.dao.types.ChoiceOrOther;
+import org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity;
+import org.openecomp.sdc.vendorlicense.dao.types.LicenseTerm;
+
+import java.util.Collection;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+
+public class ElementToLicenseAgreementConvertor extends ElementConvertor {
+  @Override
+  public LicenseAgreementEntity convert(Element element) {
+    if (element == null) {
+      return null;
+    }
+    return mapElementToLicenseAgreementEntity(element);
+
+  }
+
+
+  @Override
+  public LicenseAgreementEntity convert(ElementInfo elementInfo) {
+    if (elementInfo == null) {
+      return null;
+    }
+    return mapElementInfoToLicenseAgreementEntity(elementInfo);
+
+  }
+
+
+  private LicenseAgreementEntity mapElementToLicenseAgreementEntity(Element element) {
+    LicenseAgreementEntity licenseAgreement =
+        new LicenseAgreementEntity();
+    licenseAgreement.setId(element.getElementId().getValue());
+    mapInfoToLicenseAgreementEntity(licenseAgreement, element.getInfo());
+    mapRelationsToLicenseAgreementEntity(licenseAgreement, element.getRelations());
+    return licenseAgreement;
+  }
+
+
+  private LicenseAgreementEntity mapElementInfoToLicenseAgreementEntity(ElementInfo elementInfo) {
+    LicenseAgreementEntity licenseAgreement =
+        new LicenseAgreementEntity();
+    licenseAgreement.setId( elementInfo.getId().getValue());
+    mapInfoToLicenseAgreementEntity(licenseAgreement, elementInfo.getInfo());
+    mapRelationsToLicenseAgreementEntity(licenseAgreement, elementInfo.getRelations());
+    return licenseAgreement;
+  }
+
+  private void mapRelationsToLicenseAgreementEntity(LicenseAgreementEntity licenseAgreementEntity,
+                                                    Collection<Relation> relations) {
+    if (relations != null && relations.size() > 0) {
+      licenseAgreementEntity.setFeatureGroupIds(relations.stream()
+          .map(relation -> relation.getEdge2().getElementId().getValue())
+          .collect(Collectors.toSet()));
+    }
+
+  }
+
+  private void mapInfoToLicenseAgreementEntity(LicenseAgreementEntity licenseAgreement, Info info) {
+
+
+    licenseAgreement.setName(info.getName());
+    licenseAgreement.setDescription(info.getDescription());
+
+    licenseAgreement
+        .setLicenseTerm(getCoiceOrOther(info.getProperty("licenseTerm")));
+    licenseAgreement.setRequirementsAndConstrains(
+        info.getProperty("requirementsAndConstrains"));
+
+  }
+
+  private ChoiceOrOther<LicenseTerm> getCoiceOrOther(Map licenseTerm) {
+    return new ChoiceOrOther<>(LicenseTerm.valueOf((String) licenseTerm.get("choice")),
+        (String) licenseTerm.get("other"));
+  }
+
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToLicenseKeyGroupConvertor.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToLicenseKeyGroupConvertor.java
new file mode 100644
index 0000000..5956c3e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToLicenseKeyGroupConvertor.java
@@ -0,0 +1,104 @@
+package org.openecomp.sdc.vendorlicense.dao.impl.zusammen.convertor;
+
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.Element;
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.ElementInfo;
+import com.amdocs.zusammen.datatypes.item.Info;
+import com.amdocs.zusammen.datatypes.item.Relation;
+import org.openecomp.convertor.ElementConvertor;
+import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity;
+import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyType;
+import org.openecomp.sdc.vendorlicense.dao.types.MultiChoiceOrOther;
+import org.openecomp.sdc.vendorlicense.dao.types.OperationalScope;
+import org.openecomp.sdc.vendorlicense.dao.types.ThresholdUnit;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+import static org.openecomp.sdc.vendorlicense.dao.impl.zusammen.VlmZusammenUtil.toInteger;
+
+
+public class ElementToLicenseKeyGroupConvertor extends ElementConvertor {
+  @Override
+  public LicenseKeyGroupEntity convert(Element element) {
+    if (element == null) {
+      return null;
+    }
+    return mapElementToLicenseKeyGroupEntity(element);
+
+  }
+
+  @Override
+  public LicenseKeyGroupEntity convert(ElementInfo elementInfo) {
+    if (elementInfo == null) {
+      return null;
+    }
+    return mapElementInfoToLicenseKeyGroupEntity(elementInfo);
+
+  }
+
+  private LicenseKeyGroupEntity mapElementToLicenseKeyGroupEntity(
+      Element element) {
+    LicenseKeyGroupEntity licenseKeyGroup =
+        new LicenseKeyGroupEntity();
+    licenseKeyGroup.setId(element.getElementId().getValue());
+    mapInfoToLicenseKeyGroup(licenseKeyGroup, element.getInfo());
+    mapRelationsToLicenseKeyGroup(licenseKeyGroup, element.getRelations());
+    return licenseKeyGroup;
+  }
+
+
+  private LicenseKeyGroupEntity mapElementInfoToLicenseKeyGroupEntity(ElementInfo elementInfo) {
+    LicenseKeyGroupEntity licenseKeyGroup =
+        new LicenseKeyGroupEntity();
+    licenseKeyGroup.setId(elementInfo.getId().getValue());
+
+    mapInfoToLicenseKeyGroup(licenseKeyGroup, elementInfo.getInfo());
+    mapRelationsToLicenseKeyGroup(licenseKeyGroup, elementInfo.getRelations());
+    return licenseKeyGroup;
+  }
+
+  private void mapInfoToLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup, Info info) {
+    licenseKeyGroup.setName(info.getName());
+    licenseKeyGroup.setDescription(info.getDescription());
+    licenseKeyGroup.setVersionUuId(info.getProperty("version_uuid"));
+    licenseKeyGroup.setType(LicenseKeyType.valueOf(info.getProperty("LicenseKeyType")));
+    licenseKeyGroup.setOperationalScope(
+        getOperationalScopeMultiChoiceOrOther(info.getProperty("operational_scope")));
+    licenseKeyGroup.setStartDate(info.getProperty("startDate"));
+    licenseKeyGroup.setExpiryDate(info.getProperty("expiryDate"));
+
+    String thresholdUnit = info.getProperty("thresholdUnits");
+    licenseKeyGroup
+        .setThresholdUnits(thresholdUnit == null ? null : ThresholdUnit.valueOf(thresholdUnit));
+
+    licenseKeyGroup.setThresholdValue(toInteger(info.getProperty("thresholdValue")));
+    licenseKeyGroup.setIncrements(info.getProperty("increments"));
+  }
+
+  private void mapRelationsToLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup,
+                                             Collection<Relation> relations) {
+    if (relations != null && relations.size() > 0) {
+      licenseKeyGroup
+          .setReferencingFeatureGroups((relations.stream().map(relation -> relation
+              .getEdge2().getElementId().getValue()).collect(Collectors.toSet())));
+    }
+  }
+
+  private MultiChoiceOrOther<OperationalScope> getOperationalScopeMultiChoiceOrOther(
+      Map<String, Object> operationalScope) {
+    if (operationalScope == null || operationalScope.isEmpty()) {
+      return null;
+    }
+
+    Set<OperationalScope> choices = new HashSet<>();
+    ((List<String>) operationalScope.get("choices")).
+        forEach(choice -> choices.add(OperationalScope.valueOf(choice)));
+
+    Object other = operationalScope.get("other");
+    return new MultiChoiceOrOther<>(choices, other == null ? null : (String) other);
+  }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToLimitConvertor.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToLimitConvertor.java
new file mode 100644
index 0000000..4b2370a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToLimitConvertor.java
@@ -0,0 +1,44 @@
+package org.openecomp.sdc.vendorlicense.dao.impl.zusammen.convertor;
+
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.Element;
+import org.openecomp.convertor.ElementConvertor;
+import org.openecomp.sdc.vendorlicense.dao.types.LimitEntity;
+import org.openecomp.sdc.vendorlicense.dao.types.LimitType;
+
+/**
+ * Created by ayalaben on 9/26/2017
+ */
+public class ElementToLimitConvertor extends ElementConvertor {
+  @Override
+  public Object convert(Element element) {
+    if (element == null) {
+      return null;
+    }
+    return mapElementToLimitEntity(element);
+  }
+
+  private LimitEntity mapElementToLimitEntity(Element element) {
+    LimitEntity limit = new LimitEntity();
+    limit.setId(element.getElementId().getValue());
+    limit.setName(element.getInfo().getName());
+    limit.setDescription(element.getInfo().getDescription());
+    limit.setUnit(element.getInfo().getProperty("unit"));
+    limit.setMetric(element.getInfo().getProperty("metric"));
+    limit.setValue(element.getInfo().getProperty("value"));
+    limit.setTime(element.getInfo().getProperty("time"));
+    limit.setAggregationFunction(element.getInfo().getProperty("aggregationFunction"));
+    setLimitType(limit,element.getInfo().getProperty("type"));
+
+    return limit;
+  }
+
+  private void setLimitType(LimitEntity limit, String type) {
+    switch (LimitType.valueOf(type)) {
+      case ServiceProvider:
+        limit.setType(LimitType.ServiceProvider);
+        break;
+      case Vendor:
+        limit.setType(LimitType.Vendor);
+    }
+  }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToVLMGeneralConvertor.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToVLMGeneralConvertor.java
new file mode 100644
index 0000000..c2ef5a6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToVLMGeneralConvertor.java
@@ -0,0 +1,52 @@
+package org.openecomp.sdc.vendorlicense.dao.impl.zusammen.convertor;
+
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.Element;
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.ElementInfo;
+import com.amdocs.zusammen.datatypes.item.Info;
+import com.amdocs.zusammen.datatypes.item.Item;
+import org.openecomp.convertor.ElementConvertor;
+import org.openecomp.sdc.vendorlicense.dao.impl.zusammen.VendorLicenseModelDaoZusammenImpl;
+import org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity;
+
+
+public class ElementToVLMGeneralConvertor extends ElementConvertor {
+  @Override
+  public VendorLicenseModelEntity convert(Element element) {
+    if(element == null) return null;
+    return mapInfoToVendorLicenseModelEntity( element.getInfo());
+
+  }
+
+  @Override
+  public VendorLicenseModelEntity convert(Item item) {
+    if(item == null) return null;
+    return mapInfoToVendorLicenseModelEntity( item.getInfo());
+  }
+
+  @Override
+  public VendorLicenseModelEntity convert(ElementInfo elementInfo) {
+    if(elementInfo == null) return null;
+    return mapInfoToVendorLicenseModelEntity( elementInfo.getInfo());
+
+  }
+
+
+  private VendorLicenseModelEntity mapInfoToVendorLicenseModelEntity(Info info) {
+
+    VendorLicenseModelEntity vendorLicenseModelEntity = new VendorLicenseModelEntity();
+
+    vendorLicenseModelEntity.setVendorName(info.getProperty(
+        VendorLicenseModelDaoZusammenImpl.InfoPropertyName.name.name()));
+    vendorLicenseModelEntity.setDescription(info.getProperty(
+        VendorLicenseModelDaoZusammenImpl.InfoPropertyName.description.name()));
+    vendorLicenseModelEntity.setIconRef(info.getProperty(
+        VendorLicenseModelDaoZusammenImpl.InfoPropertyName.iconRef.name()));
+    vendorLicenseModelEntity.setOldVersion(info.getProperty(
+        VendorLicenseModelDaoZusammenImpl.InfoPropertyName.oldVersion.name()));
+
+
+    return vendorLicenseModelEntity;
+  }
+
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/facade/impl/VendorLicenseFacadeImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/facade/impl/VendorLicenseFacadeImpl.java
index b2f2d48..0898e48 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/facade/impl/VendorLicenseFacadeImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/facade/impl/VendorLicenseFacadeImpl.java
@@ -20,18 +20,12 @@
 
 package org.openecomp.sdc.vendorlicense.facade.impl;
 
-import static org.openecomp.sdc.vendorlicense.VendorLicenseConstants.VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE;
-import static org.openecomp.sdc.vendorlicense.errors.UncompletedVendorLicenseModelErrorType.SUBMIT_UNCOMPLETED_VLM_MSG_FG_MISSING_EP;
-import static org.openecomp.sdc.vendorlicense.errors.UncompletedVendorLicenseModelErrorType.SUBMIT_UNCOMPLETED_VLM_MSG_LA_MISSING_FG;
-
 import org.apache.commons.collections4.CollectionUtils;
 import org.openecomp.core.util.UniqueValueUtil;
 import org.openecomp.core.utilities.CommonMethods;
 import org.openecomp.sdc.common.errors.CoreException;
 import org.openecomp.sdc.common.errors.ErrorCode;
 import org.openecomp.sdc.datatypes.error.ErrorLevel;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage;
 import org.openecomp.sdc.logging.context.impl.MdcDataErrorMessage;
 import org.openecomp.sdc.logging.types.LoggerConstants;
@@ -62,23 +56,21 @@
 import org.openecomp.sdc.vendorlicense.errors.SubmitUncompletedLicenseModelErrorBuilder;
 import org.openecomp.sdc.vendorlicense.errors.VendorLicenseModelNotFoundErrorBuilder;
 import org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacade;
-import org.openecomp.sdc.vendorlicense.types.VersionedVendorLicenseModel;
-import org.openecomp.sdc.versioning.VersioningManager;
-import org.openecomp.sdc.versioning.VersioningManagerFactory;
 import org.openecomp.sdc.versioning.VersioningUtil;
 import org.openecomp.sdc.versioning.dao.types.Version;
-import org.openecomp.sdc.versioning.errors.RequestedVersionInvalidErrorBuilder;
 import org.openecomp.sdc.versioning.errors.VersionableSubEntityNotFoundErrorBuilder;
-import org.openecomp.sdc.versioning.types.VersionInfo;
-import org.openecomp.sdc.versioning.types.VersionableEntityAction;
 
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Objects;
+
+import static org.openecomp.sdc.vendorlicense.VendorLicenseConstants.VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE;
+import static org.openecomp.sdc.vendorlicense.errors.UncompletedVendorLicenseModelErrorType.SUBMIT_UNCOMPLETED_VLM_MSG_FG_MISSING_EP;
+import static org.openecomp.sdc.vendorlicense.errors.UncompletedVendorLicenseModelErrorType.SUBMIT_UNCOMPLETED_VLM_MSG_LA_MISSING_FG;
 
 public class VendorLicenseFacadeImpl implements VendorLicenseFacade {
-
-  private static final VersioningManager versioningManager =
-      VersioningManagerFactory.getInstance().createInterface();
-
   private static final VendorLicenseModelDao
       vendorLicenseModelDao = VendorLicenseModelDaoFactory.getInstance().createInterface();
   private static final LicenseAgreementDao
@@ -91,7 +83,6 @@
       licenseKeyGroupDao = LicenseKeyGroupDaoFactory.getInstance().createInterface();
   private static final LimitDao limitDao = LimitDaoFactory.getInstance().createInterface();
   private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage();
-  private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName());
 
   /**
    * Instantiates a new Vendor license facade.
@@ -106,32 +97,7 @@
   }
 
   @Override
-  public Version checkin(String vendorLicenseModelId, String user) {
-    Version newVersion = versioningManager
-        .checkin(VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE, vendorLicenseModelId, user, null);
-    updateVlmLastModificationTime(vendorLicenseModelId, newVersion);
-    return newVersion;
-  }
-
-  @Override
-  public Version submit(String vendorLicenseModelId, String user) {
-    validateCompletedVendorLicenseModel(vendorLicenseModelId, user);
-    Version newVersion = versioningManager
-        .submit(VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE, vendorLicenseModelId, user, null);
-    updateVlmLastModificationTime(vendorLicenseModelId, newVersion);
-    return newVersion;
-  }
-
-  @Override
-  public FeatureGroupEntity getFeatureGroup(FeatureGroupEntity featureGroup, String user) {
-    Version version = VersioningUtil.resolveVersion(featureGroup.getVersion(),
-        getVersionInfo(featureGroup.getVendorLicenseModelId(), VersionableEntityAction.Read,
-            user), user);
-    featureGroup.setVersion(version);
-    return getFeatureGroup(featureGroup);
-  }
-
-  private FeatureGroupEntity getFeatureGroup(FeatureGroupEntity featureGroup) {
+  public FeatureGroupEntity getFeatureGroup(FeatureGroupEntity featureGroup) {
     FeatureGroupEntity retrieved = featureGroupDao.get(featureGroup);
     VersioningUtil
         .validateEntityExistence(retrieved, featureGroup, VendorLicenseModelEntity.ENTITY_TYPE);
@@ -142,8 +108,8 @@
   }
 
   @Override
-  public FeatureGroupModel getFeatureGroupModel(FeatureGroupEntity featureGroup, String user) {
-    FeatureGroupEntity retrieved = getFeatureGroup(featureGroup, user);
+  public FeatureGroupModel getFeatureGroupModel(FeatureGroupEntity featureGroup) {
+    FeatureGroupEntity retrieved = getFeatureGroup(featureGroup);
 
     FeatureGroupModel featureGroupModel = new FeatureGroupModel();
     featureGroupModel.setFeatureGroup(retrieved);
@@ -164,9 +130,9 @@
 
   @Override
   public LicenseAgreementModel getLicenseAgreementModel(String vlmId, Version version,
-                                                        String licenseAgreementId, String user) {
+                                                        String licenseAgreementId) {
     LicenseAgreementEntity retrieved =
-        getLicenseAgreement(vlmId, version, licenseAgreementId, user);
+        getLicenseAgreement(vlmId, version, licenseAgreementId);
 
     LicenseAgreementModel licenseAgreementModel = new LicenseAgreementModel();
     licenseAgreementModel.setLicenseAgreement(retrieved);
@@ -180,103 +146,71 @@
   }
 
   @Override
-  public EntitlementPoolEntity createEntitlementPool(EntitlementPoolEntity entitlementPool,
-                                                     String user) {
-    entitlementPool.setVersion(VersioningUtil.resolveVersion(entitlementPool.getVersion(),
-        getVersionInfo(entitlementPool.getVendorLicenseModelId(), VersionableEntityAction.Write,
-            user), user));
-    //entitlementPool.setId(CommonMethods.nextUuId());
+  public EntitlementPoolEntity createEntitlementPool(EntitlementPoolEntity entitlementPool) {
     entitlementPool.setVersionUuId(CommonMethods.nextUuId());
     UniqueValueUtil.createUniqueValue(VendorLicenseConstants.UniqueValues.ENTITLEMENT_POOL_NAME,
-        entitlementPool.getVendorLicenseModelId(), entitlementPool.getVersion().toString(),
+        entitlementPool.getVendorLicenseModelId(), entitlementPool.getVersion().getId(),
         entitlementPool.getName());
     entitlementPoolDao.create(entitlementPool);
-    updateVlmLastModificationTime(entitlementPool.getVendorLicenseModelId(),
-        entitlementPool.getVersion());
     return entitlementPool;
   }
 
   @Override
-  public void updateEntitlementPool(EntitlementPoolEntity entitlementPool, String user) {
-    entitlementPool.setVersion(VersioningUtil.resolveVersion(entitlementPool.getVersion(),
-        getVersionInfo(entitlementPool.getVendorLicenseModelId(), VersionableEntityAction.Write,
-            user), user));
+  public void updateEntitlementPool(EntitlementPoolEntity entitlementPool) {
     EntitlementPoolEntity retrieved = entitlementPoolDao.get(entitlementPool);
     VersioningUtil
         .validateEntityExistence(retrieved, entitlementPool, VendorLicenseModelEntity.ENTITY_TYPE);
-
+    if (retrieved.equals(entitlementPool)) {
+      return;
+    }
     UniqueValueUtil.updateUniqueValue(VendorLicenseConstants.UniqueValues.ENTITLEMENT_POOL_NAME,
         retrieved.getName(), entitlementPool.getName(), entitlementPool.getVendorLicenseModelId(),
-        entitlementPool.getVersion().toString());
+        entitlementPool.getVersion().getId());
     entitlementPool.setVersionUuId(CommonMethods.nextUuId());
     entitlementPoolDao.update(entitlementPool);
-
-    updateVlmLastModificationTime(entitlementPool.getVendorLicenseModelId(),
-        entitlementPool.getVersion());
-
   }
 
   @Override
-  public Collection<LicenseKeyGroupEntity> listLicenseKeyGroups(String vlmId, Version version,
-                                                                String user) {
-    return licenseKeyGroupDao.list(new LicenseKeyGroupEntity(vlmId, VersioningUtil
-        .resolveVersion(version, getVersionInfo(vlmId, VersionableEntityAction.Read, user), user),
-        null));
+  public Collection<LicenseKeyGroupEntity> listLicenseKeyGroups(String vlmId, Version version) {
+    return licenseKeyGroupDao.list(new LicenseKeyGroupEntity(vlmId, version, null));
   }
 
   @Override
-  public Collection<EntitlementPoolEntity> listEntitlementPools(String vlmId, Version version,
-                                                                String user) {
-    return entitlementPoolDao.list(new EntitlementPoolEntity(vlmId, VersioningUtil
-        .resolveVersion(version, getVersionInfo(vlmId, VersionableEntityAction.Read, user), user),
-        null));
+  public Collection<EntitlementPoolEntity> listEntitlementPools(String vlmId, Version version) {
+    return entitlementPoolDao.list(new EntitlementPoolEntity(vlmId, version, null));
   }
 
   @Override
-  public void updateLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup, String user) {
-    licenseKeyGroup.setVersion(VersioningUtil.resolveVersion(licenseKeyGroup.getVersion(),
-        getVersionInfo(licenseKeyGroup.getVendorLicenseModelId(), VersionableEntityAction.Write,
-            user), user));
+  public void updateLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup) {
     LicenseKeyGroupEntity retrieved = licenseKeyGroupDao.get(licenseKeyGroup);
+    if (retrieved.equals(licenseKeyGroup)) {
+      return;
+    }
     licenseKeyGroup.setVersionUuId((CommonMethods.nextUuId()));
     VersioningUtil
         .validateEntityExistence(retrieved, licenseKeyGroup, VendorLicenseModelEntity.ENTITY_TYPE);
     UniqueValueUtil.updateUniqueValue(VendorLicenseConstants.UniqueValues.LICENSE_KEY_GROUP_NAME,
         retrieved.getName(), licenseKeyGroup.getName(), licenseKeyGroup.getVendorLicenseModelId(),
-        licenseKeyGroup.getVersion().toString());
+        licenseKeyGroup.getVersion().getId());
     licenseKeyGroupDao.update(licenseKeyGroup);
-
-    updateVlmLastModificationTime(licenseKeyGroup.getVendorLicenseModelId(),
-        licenseKeyGroup.getVersion());
   }
 
   @Override
-  public LicenseKeyGroupEntity createLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup,
-                                                     String user) {
-    licenseKeyGroup.setVersion(VersioningUtil.resolveVersion(licenseKeyGroup.getVersion(),
-        getVersionInfo(licenseKeyGroup.getVendorLicenseModelId(), VersionableEntityAction.Write,
-            user), user));
-    //licenseKeyGroup.setId(CommonMethods.nextUuId());
+  public LicenseKeyGroupEntity createLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup) {
     licenseKeyGroup.setVersionUuId(CommonMethods.nextUuId());
     UniqueValueUtil.createUniqueValue(VendorLicenseConstants.UniqueValues.LICENSE_KEY_GROUP_NAME,
-        licenseKeyGroup.getVendorLicenseModelId(), licenseKeyGroup.getVersion().toString(),
+        licenseKeyGroup.getVendorLicenseModelId(), licenseKeyGroup.getVersion().getId(),
         licenseKeyGroup.getName());
     licenseKeyGroupDao.create(licenseKeyGroup);
-    updateVlmLastModificationTime(licenseKeyGroup.getVendorLicenseModelId(),
-        licenseKeyGroup.getVersion());
     return licenseKeyGroup;
   }
 
   @Override
-  public VersionedVendorLicenseModel getVendorLicenseModel(String vlmId, Version version,
-                                                           String user) {
+  public VendorLicenseModelEntity getVendorLicenseModel(String vlmId, Version version) {
     mdcDataDebugMessage.debugEntryMessage("VLM id", vlmId);
 
-    VersionInfo versionInfo = getVersionInfo(vlmId, VersionableEntityAction.Read, user);
-
-    VendorLicenseModelEntity vendorLicenseModel = vendorLicenseModelDao.get(
-        new VendorLicenseModelEntity(vlmId,
-            VersioningUtil.resolveVersion(version, versionInfo, user)));
+    VendorLicenseModelEntity vendorLicenseModel =
+        vendorLicenseModelDao.get(new VendorLicenseModelEntity(vlmId, version));
     if (vendorLicenseModel == null) {
       MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
           LoggerTragetServiceName.GET_VLM, ErrorLevel.ERROR.name(),
@@ -285,90 +219,61 @@
     }
 
     mdcDataDebugMessage.debugExitMessage("VLM id", vlmId);
-    return new VersionedVendorLicenseModel(vendorLicenseModel, versionInfo);
+    return vendorLicenseModel;
   }
 
   @Override
-  public VendorLicenseModelEntity createVendorLicenseModel(
-      VendorLicenseModelEntity vendorLicenseModelEntity, String user) {
-
-    mdcDataDebugMessage.debugEntryMessage(null, null);
-
-    UniqueValueUtil.validateUniqueValue(VendorLicenseConstants.UniqueValues.VENDOR_NAME,
-        vendorLicenseModelEntity.getVendorName());
-    //vendorLicenseModelEntity.setId(CommonMethods.nextUuId());
-
-    vendorLicenseModelDao.create(vendorLicenseModelEntity);
-    UniqueValueUtil.createUniqueValue(VendorLicenseConstants.UniqueValues.VENDOR_NAME,
-        vendorLicenseModelEntity.getVendorName());
-
-    Version version = versioningManager
-        .create(VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE, vendorLicenseModelEntity.getId(), user);
-    vendorLicenseModelEntity.setVersion(version);
-
-    mdcDataDebugMessage.debugExitMessage(null, null);
-    return vendorLicenseModelEntity;
-  }
-
-  @Override
-  public LicenseAgreementEntity createLicenseAgreement(LicenseAgreementEntity licenseAgreement,
-                                                       String user) {
-    Version version = VersioningUtil.resolveVersion(licenseAgreement.getVersion(),
-        getVersionInfo(licenseAgreement.getVendorLicenseModelId(), VersionableEntityAction.Write,
-            user), user);
-    licenseAgreement.setVersion(version);
+  public LicenseAgreementEntity createLicenseAgreement(LicenseAgreementEntity licenseAgreement) {
     //licenseAgreement.setId(CommonMethods.nextUuId());
     VersioningUtil.validateEntitiesExistence(licenseAgreement.getFeatureGroupIds(),
-        new FeatureGroupEntity(licenseAgreement.getVendorLicenseModelId(), version, null),
+        new FeatureGroupEntity(licenseAgreement.getVendorLicenseModelId(),
+            licenseAgreement.getVersion(),
+            null),
         featureGroupDao, VendorLicenseModelEntity.ENTITY_TYPE);
 
     UniqueValueUtil.validateUniqueValue(VendorLicenseConstants.UniqueValues.LICENSE_AGREEMENT_NAME,
-        licenseAgreement.getVendorLicenseModelId(), licenseAgreement.getVersion().toString(),
+        licenseAgreement.getVendorLicenseModelId(), licenseAgreement.getVersion().getId(),
         licenseAgreement.getName());
 
     licenseAgreementDao.create(licenseAgreement);
     UniqueValueUtil.createUniqueValue(VendorLicenseConstants.UniqueValues.LICENSE_AGREEMENT_NAME,
-        licenseAgreement.getVendorLicenseModelId(), licenseAgreement.getVersion().toString(),
+        licenseAgreement.getVendorLicenseModelId(), licenseAgreement.getVersion().getId(),
         licenseAgreement.getName());
     if (licenseAgreement.getFeatureGroupIds() != null) {
       for (String addedFgId : licenseAgreement.getFeatureGroupIds()) {
         featureGroupDao.addReferencingLicenseAgreement(
-            new FeatureGroupEntity(licenseAgreement.getVendorLicenseModelId(), version,
+            new FeatureGroupEntity(licenseAgreement.getVendorLicenseModelId(),
+                licenseAgreement.getVersion(),
                 addedFgId), licenseAgreement.getId());
       }
     }
-    updateVlmLastModificationTime(licenseAgreement.getVendorLicenseModelId(),
-        licenseAgreement.getVersion());
-
     return licenseAgreement;
   }
 
   @Override
-  public FeatureGroupEntity createFeatureGroup(FeatureGroupEntity featureGroup, String user) {
-    Version version = VersioningUtil.resolveVersion(featureGroup.getVersion(),
-        getVersionInfo(featureGroup.getVendorLicenseModelId(), VersionableEntityAction.Write,
-            user), user);
-    //featureGroup.setId(CommonMethods.nextUuId());
-    featureGroup.setVersion(version);
+  public FeatureGroupEntity createFeatureGroup(FeatureGroupEntity featureGroup) {
     VersioningUtil.validateEntitiesExistence(featureGroup.getLicenseKeyGroupIds(),
-        new LicenseKeyGroupEntity(featureGroup.getVendorLicenseModelId(), version, null),
+        new LicenseKeyGroupEntity(featureGroup.getVendorLicenseModelId(), featureGroup.getVersion(),
+            null),
         licenseKeyGroupDao, VendorLicenseModelEntity.ENTITY_TYPE);
     VersioningUtil.validateEntitiesExistence(featureGroup.getEntitlementPoolIds(),
-        new EntitlementPoolEntity(featureGroup.getVendorLicenseModelId(), version, null),
+        new EntitlementPoolEntity(featureGroup.getVendorLicenseModelId(), featureGroup.getVersion(),
+            null),
         entitlementPoolDao, VendorLicenseModelEntity.ENTITY_TYPE);
     UniqueValueUtil.validateUniqueValue(VendorLicenseConstants.UniqueValues.FEATURE_GROUP_NAME,
-        featureGroup.getVendorLicenseModelId(), featureGroup.getVersion().toString(),
+        featureGroup.getVendorLicenseModelId(), featureGroup.getVersion().getId(),
         featureGroup.getName());
 
     featureGroupDao.create(featureGroup);
     UniqueValueUtil.createUniqueValue(VendorLicenseConstants.UniqueValues.FEATURE_GROUP_NAME,
-        featureGroup.getVendorLicenseModelId(), featureGroup.getVersion().toString(),
+        featureGroup.getVendorLicenseModelId(), featureGroup.getVersion().getId(),
         featureGroup.getName());
 
     if (featureGroup.getLicenseKeyGroupIds() != null) {
       for (String addedLkgId : featureGroup.getLicenseKeyGroupIds()) {
         licenseKeyGroupDao.addReferencingFeatureGroup(
-            new LicenseKeyGroupEntity(featureGroup.getVendorLicenseModelId(), version, addedLkgId),
+            new LicenseKeyGroupEntity(featureGroup.getVendorLicenseModelId(),
+                featureGroup.getVersion(), addedLkgId),
             featureGroup.getId());
       }
     }
@@ -376,27 +281,20 @@
     if (featureGroup.getEntitlementPoolIds() != null) {
       for (String addedEpId : featureGroup.getEntitlementPoolIds()) {
         entitlementPoolDao.addReferencingFeatureGroup(
-            new EntitlementPoolEntity(featureGroup.getVendorLicenseModelId(), version, addedEpId),
-            featureGroup.getId());
+            new EntitlementPoolEntity(featureGroup.getVendorLicenseModelId(),
+                featureGroup.getVersion(), addedEpId), featureGroup.getId());
       }
     }
-
-    updateVlmLastModificationTime(featureGroup.getVendorLicenseModelId(),
-        featureGroup.getVersion());
-
     return featureGroup;
   }
 
   @Override
-  public Collection<FeatureGroupEntity> listFeatureGroups(String vlmId, Version version,
-                                                                String user) {
+  public Collection<FeatureGroupEntity> listFeatureGroups(String vlmId, Version version) {
     Collection<FeatureGroupEntity> featureGroupEntities =
-        featureGroupDao.list(new FeatureGroupEntity(vlmId, VersioningUtil
-            .resolveVersion(version, getVersionInfo(vlmId, VersionableEntityAction.Read, user),
-                user), null));
+        featureGroupDao.list(new FeatureGroupEntity(vlmId, version, null));
     featureGroupEntities.stream()
         .filter(fgEntity -> Objects.isNull(fgEntity.getManufacturerReferenceNumber()))
-        .forEach(fgEntity -> updateManufacturerNumberInFeatureGroup(fgEntity));
+        .forEach(this::updateManufacturerNumberInFeatureGroup);
     return featureGroupEntities;
   }
 
@@ -405,23 +303,22 @@
   public Collection<ErrorCode> validateLicensingData(String vlmId, Version version,
                                                      String licenseAgreementId,
                                                      Collection<String> featureGroupIds) {
-    try {
+    // TODO: 5/21/2017 validate version exists and final
+/*    try {
       VersionInfo versionInfo = getVersionInfo(vlmId, VersionableEntityAction.Read, "");
       if (version == null || !version.isFinal()
           || !versionInfo.getViewableVersions().contains(version)) {
         return Collections.singletonList(new RequestedVersionInvalidErrorBuilder().build());
       }
     } catch (CoreException exception) {
-      log.debug("",exception);
       return Collections.singletonList(exception.code());
-    }
+    }*/
 
     List<ErrorCode> errorMessages = new ArrayList<>();
 
     try {
-      getLicenseAgreement(vlmId, licenseAgreementId, version);
+      getLicenseAgreement(vlmId, version, licenseAgreementId);
     } catch (CoreException exception) {
-      log.debug("",exception);
       errorMessages.add(exception.code());
     }
 
@@ -438,7 +335,6 @@
               version).build());
         }
       } catch (CoreException exception) {
-        log.debug("",exception);
         errorMessages.add(exception.code());
       }
     }
@@ -447,71 +343,34 @@
   }
 
   @Override
-  public VersionInfo getVersionInfo(String vendorLicenseModelId, VersionableEntityAction action,
-                                    String user) {
-    return versioningManager
-        .getEntityVersionInfo(VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE, vendorLicenseModelId, user,
-            action);
-  }
-
-  @Override
-  public void updateVlmLastModificationTime(String vendorLicenseModelId, Version version) {
-    VendorLicenseModelEntity retrieved =
-        vendorLicenseModelDao.get(new VendorLicenseModelEntity(vendorLicenseModelId, version));
-    vendorLicenseModelDao.update(retrieved);
-  }
-
-  @Override
   public LicenseAgreementEntity getLicenseAgreement(String vlmId, Version version,
-                                                    String licenseAgreementId, String user) {
-    return getLicenseAgreement(vlmId, licenseAgreementId, VersioningUtil
-        .resolveVersion(version, getVersionInfo(vlmId, VersionableEntityAction.Read, user), user));
-  }
-
-  @Override
-  public LimitEntity createLimit(LimitEntity limit, String user) {
-    limit.setVersion(VersioningUtil.resolveVersion(limit.getVersion(),
-        getVersionInfo(limit.getVendorLicenseModelId(), VersionableEntityAction.Write,
-            user), user));
-    //limit.setVersionUuId(CommonMethods.nextUuId());
-    limitDao.create(limit);
-    updateVlmLastModificationTime(limit.getVendorLicenseModelId(),
-        limit.getVersion());
-    return limit;
-  }
-
-  @Override
-  public Collection<LimitEntity> listLimits(String vlmId, Version version, String epLkgId,
-                                                      String user) {
-    return limitDao.list(new LimitEntity(vlmId, VersioningUtil
-        .resolveVersion(version, getVersionInfo(vlmId, VersionableEntityAction.Read, user), user),
-        epLkgId, null));
-
-  }
-
-  @Override
-  public void updateLimit(LimitEntity limit, String user) {
-    limit.setVersion(VersioningUtil.resolveVersion(limit.getVersion(),
-        getVersionInfo(limit.getVendorLicenseModelId(), VersionableEntityAction.Write,
-            user), user));
-    //limit.setVersionUuId(CommonMethods.nextUuId());
-    limitDao.update(limit);
-    updateVlmLastModificationTime(limit.getVendorLicenseModelId(),
-        limit.getVersion());
-  }
-
-  private LicenseAgreementEntity getLicenseAgreement(String vlmId, String licenseAgreementId,
-                                                     Version version) {
+                                                    String licenseAgreementId) {
     LicenseAgreementEntity input = new LicenseAgreementEntity(vlmId, version, licenseAgreementId);
     LicenseAgreementEntity retrieved = licenseAgreementDao.get(input);
     VersioningUtil.validateEntityExistence(retrieved, input, VendorLicenseModelEntity.ENTITY_TYPE);
     return retrieved;
   }
 
+  @Override
+  public Collection<LimitEntity> listLimits(String vlmId, Version version, String epLkgId) {
+    return limitDao.list(new LimitEntity(vlmId, version, epLkgId, null));
+  }
+
+  @Override
+  public LimitEntity createLimit(LimitEntity limit) {
+    limitDao.create(limit);
+    return limit;
+  }
+
+  @Override
+  public void updateLimit(LimitEntity limit) {
+    limitDao.update(limit);
+  }
+
   private void updateManufacturerNumberInFeatureGroup(FeatureGroupEntity featureGroupEntity) {
     if (CollectionUtils.isNotEmpty(featureGroupEntity.getEntitlementPoolIds())) {
       Object[] entitlementPoolIdsList = featureGroupEntity.getEntitlementPoolIds().toArray();
-      if (entitlementPoolIdsList != null && entitlementPoolIdsList.length > 0) {
+      if (entitlementPoolIdsList.length > 0) {
         String entitlementPoolId = entitlementPoolIdsList[0].toString();
         EntitlementPoolEntity entitlementPoolEntity =
             new EntitlementPoolEntity(featureGroupEntity.getVendorLicenseModelId(),
@@ -523,35 +382,40 @@
       }
     }
   }
-  private void validateCompletedVendorLicenseModel(String vendorLicenseModelId, String user) {
+
+  @Override
+  public void validate(String vendorLicenseModelId, Version version) {
     Collection<String> allFeatureGroupEntities = new HashSet<>();
-    Version version = VersioningUtil.resolveVersion(null,
-            getVersionInfo(vendorLicenseModelId, VersionableEntityAction.Read, user), user);
     Collection<LicenseAgreementEntity> licenseAgreements = licenseAgreementDao
-            .list(new LicenseAgreementEntity(vendorLicenseModelId, version, null));
+        .list(new LicenseAgreementEntity(vendorLicenseModelId, version, null));
 
     if (CollectionUtils.isNotEmpty(licenseAgreements)) {
       licenseAgreements.forEach(licenseAgreement -> {
         if (CollectionUtils.isEmpty(licenseAgreement.getFeatureGroupIds())) {
           MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
-                  LoggerTragetServiceName.SUBMIT_ENTITY, ErrorLevel.ERROR.name(),
-                  LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.SUBMIT_ENTITY);
+              LoggerTragetServiceName.SUBMIT_ENTITY, ErrorLevel.ERROR.name(),
+              LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.SUBMIT_ENTITY);
           throw new CoreException(
-                  new SubmitUncompletedLicenseModelErrorBuilder(SUBMIT_UNCOMPLETED_VLM_MSG_LA_MISSING_FG).build());
+              new SubmitUncompletedLicenseModelErrorBuilder(
+                  SUBMIT_UNCOMPLETED_VLM_MSG_LA_MISSING_FG).build());
         }
         allFeatureGroupEntities.addAll(licenseAgreement.getFeatureGroupIds());
       });
 
       allFeatureGroupEntities.forEach(fg -> {
-        FeatureGroupEntity featureGroupEntity = featureGroupDao.get(new FeatureGroupEntity(vendorLicenseModelId, version, fg));
-        if(CollectionUtils.isEmpty(featureGroupEntity.getEntitlementPoolIds())) {
+        FeatureGroupEntity featureGroupEntity =
+            featureGroupDao.get(new FeatureGroupEntity(vendorLicenseModelId, version, fg));
+        if (CollectionUtils.isEmpty(featureGroupEntity.getEntitlementPoolIds())) {
           MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
-                  LoggerTragetServiceName.SUBMIT_ENTITY, ErrorLevel.ERROR.name(),
-                  LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.SUBMIT_ENTITY);
+              LoggerTragetServiceName.SUBMIT_ENTITY, ErrorLevel.ERROR.name(),
+              LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.SUBMIT_ENTITY);
           throw new CoreException(
-                  new SubmitUncompletedLicenseModelErrorBuilder(SUBMIT_UNCOMPLETED_VLM_MSG_FG_MISSING_EP).build());
+              new SubmitUncompletedLicenseModelErrorBuilder(
+                  SUBMIT_UNCOMPLETED_VLM_MSG_FG_MISSING_EP).build());
         }
       });
     }
   }
+
+
 }
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/healing/impl/SimpleHealingServiceImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/healing/impl/SimpleHealingServiceImpl.java
index 7cb3e2e..c62061e 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/healing/impl/SimpleHealingServiceImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/healing/impl/SimpleHealingServiceImpl.java
@@ -40,14 +40,14 @@
 
 public class SimpleHealingServiceImpl implements HealingService {
   private static final EntitlementPoolDao entitlementPoolDao =
-          EntitlementPoolDaoFactory.getInstance().createInterface();
+      EntitlementPoolDaoFactory.getInstance().createInterface();
   private static final LicenseKeyGroupDao licenseKeyGroupDao =
-          LicenseKeyGroupDaoFactory.getInstance().createInterface();
+      LicenseKeyGroupDaoFactory.getInstance().createInterface();
   private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage();
 
   @Override
-  public VersionableEntity heal(VersionableEntity toHeal, String user) {
-    return handleMissingVersionId(toHeal, user);
+  public VersionableEntity heal(VersionableEntity toHeal) {
+    return handleMissingVersionId(toHeal);
   }
 
   @Override
@@ -59,10 +59,10 @@
     }
   }
 
-  private VersionableEntity handleMissingVersionId(VersionableEntity toHeal, String user) {
+  private VersionableEntity handleMissingVersionId(VersionableEntity toHeal) {
 
 
-    mdcDataDebugMessage.debugEntryMessage(null, null);
+    mdcDataDebugMessage.debugEntryMessage(null);
 
     if (toHeal != null && toHeal.getVersionUuId() != null) {
       return toHeal;
@@ -76,13 +76,13 @@
       licenseKeyGroupDao.update((LicenseKeyGroupEntity) toHeal);
     } else {
       MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
-              LoggerTragetServiceName.SELF_HEALING, ErrorLevel.ERROR.name(),
-              LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.UNSUPPORTED_OPERATION);
+          LoggerTragetServiceName.SELF_HEALING, ErrorLevel.ERROR.name(),
+          LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.UNSUPPORTED_OPERATION);
       throw new UnsupportedOperationException(
-              "Unsupported operation for 1610 release/1607->1610 migration.");
+          "Unsupported operation for 1610 release/1607->1610 migration.");
     }
 
-    mdcDataDebugMessage.debugExitMessage(null, null);
+    mdcDataDebugMessage.debugExitMessage(null);
     return toHeal;
   }
 }
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/VendorLicenseArtifactsServiceImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/VendorLicenseArtifactsServiceImpl.java
index 6dbed22..07f19b1 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/VendorLicenseArtifactsServiceImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/VendorLicenseArtifactsServiceImpl.java
@@ -20,9 +20,6 @@
 
 package org.openecomp.sdc.vendorlicense.licenseartifacts.impl;
 
-import static org.openecomp.sdc.vendorlicense.VendorLicenseConstants.VENDOR_LICENSE_MODEL_ARTIFACT_NAME_WITH_PATH;
-import static org.openecomp.sdc.vendorlicense.VendorLicenseConstants.VNF_ARTIFACT_NAME_WITH_PATH;
-
 import org.apache.commons.collections.CollectionUtils;
 import org.openecomp.core.utilities.file.FileContentHandler;
 import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage;
@@ -58,15 +55,14 @@
 public class VendorLicenseArtifactsServiceImpl implements VendorLicenseArtifactsService {
 
   public static final VendorLicenseFacade vendorLicenseFacade =
-          VendorLicenseFacadeFactory.getInstance().createInterface();
+      VendorLicenseFacadeFactory.getInstance().createInterface();
   public static final HealingService healingService =
-          HealingServiceFactory.getInstance().createInterface();
+      HealingServiceFactory.getInstance().createInterface();
   private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage();
 
 
-  private static byte[] createVnfArtifact(String vspId, String vlmId, Version vlmVersion,
-                                          String vendorName,
-                                          List<String> featureGroups, String user) {
+  private static byte[] createVnfArtifact(String vspId, String vlmId, Version vlmVersion, String vendorName,
+                                  List<String> featureGroups) {
 
 
     mdcDataDebugMessage.debugEntryMessage("VLM name", vendorName);
@@ -78,30 +74,31 @@
     if (featureGroups != null) {
       for (String featureGroupId : featureGroups) {
         FeatureGroupModel featureGroupModel = vendorLicenseFacade
-                .getFeatureGroupModel(new FeatureGroupEntity(vlmId, vlmVersion, featureGroupId), user);
+            .getFeatureGroupModel(new FeatureGroupEntity(vlmId, vlmVersion, featureGroupId));
         Set<EntitlementPoolEntity> entitlementPoolEntities =
-                featureGroupModel.getEntitlementPools();
+            featureGroupModel.getEntitlementPools();
         for (EntitlementPoolEntity entitlementPoolEntity : entitlementPoolEntities) {
           entitlementPoolEntity.setLimits(vendorLicenseFacade.listLimits(vlmId, vlmVersion,
-                  entitlementPoolEntity.getId(), user));
+              entitlementPoolEntity.getId()));
           entitlementPoolEntity.setManufacturerReferenceNumber(featureGroupModel.
-                  getEntityManufacturerReferenceNumber());
+              getEntityManufacturerReferenceNumber());
         }
+
         Set<LicenseKeyGroupEntity> licenseKeyGroupEntities =
-                featureGroupModel.getLicenseKeyGroups();
+            featureGroupModel.getLicenseKeyGroups();
         for (LicenseKeyGroupEntity licenseKeyGroupEntity : licenseKeyGroupEntities) {
           licenseKeyGroupEntity.setLimits(vendorLicenseFacade.listLimits(vlmId, vlmVersion,
-                  licenseKeyGroupEntity.getId(), user));
+              licenseKeyGroupEntity.getId()));
           licenseKeyGroupEntity.setManufacturerReferenceNumber(featureGroupModel.
-                  getEntityManufacturerReferenceNumber());
+              getEntityManufacturerReferenceNumber());
         }
 
         featureGroupModel.setEntitlementPools(entitlementPoolEntities.stream().map(
-                entitlementPoolEntity -> (EntitlementPoolEntity) healingService
-                        .heal(entitlementPoolEntity, user)).collect(Collectors.toSet()));
+            entitlementPoolEntity -> (EntitlementPoolEntity) healingService
+                .heal(entitlementPoolEntity)).collect(Collectors.toSet()));
         featureGroupModel.setLicenseKeyGroups(licenseKeyGroupEntities.stream().map(
-                licenseKeyGroupEntity -> (LicenseKeyGroupEntity) healingService
-                        .heal(licenseKeyGroupEntity, user)).collect(Collectors.toSet()));
+            licenseKeyGroupEntity -> (LicenseKeyGroupEntity) healingService
+                .heal(licenseKeyGroupEntity)).collect(Collectors.toSet()));
         artifact.getFeatureGroups().add(featureGroupModel);
       }
     }
@@ -110,7 +107,7 @@
     return artifact.toXml().getBytes();
   }
 
-  private static byte[] createVendorLicenseArtifact(String vlmId, String vendorName, String user) {
+  private static byte[] createVendorLicenseArtifact(String vlmId, String vendorName) {
 
 
     mdcDataDebugMessage.debugEntryMessage("VLM name", vendorName);
@@ -122,40 +119,37 @@
 
     List<Version> finalVersions = getFinalVersionsForVlm(vlmId);
     for (Version finalVersion : finalVersions) {
-      Collection<EntitlementPoolEntity> coll = vendorLicenseFacade.listEntitlementPools(vlmId,
-              finalVersion, user);
-      coll.stream().forEach(entitlementPoolEntity -> {
+      Collection<EntitlementPoolEntity> eps =
+          vendorLicenseFacade.listEntitlementPools(vlmId, finalVersion);
+      eps.forEach(entitlementPoolEntity -> {
         entitlementPoolEntity.setLimits(vendorLicenseFacade.listLimits(vlmId, finalVersion,
-                entitlementPoolEntity.getId(), user));
+            entitlementPoolEntity.getId()));
         Optional<String> manufacturerReferenceNumber = getFeatureGroupManufactureRefNumber
-                (entitlementPoolEntity.getReferencingFeatureGroups(), vlmId, finalVersion, user);
+            (entitlementPoolEntity.getReferencingFeatureGroups(), vlmId, finalVersion);
         manufacturerReferenceNumber
-                .ifPresent(entitlementPoolEntity::setManufacturerReferenceNumber);
+            .ifPresent(entitlementPoolEntity::setManufacturerReferenceNumber);
       });
+      entitlementPoolEntities.addAll(eps);
 
-      entitlementPoolEntities.addAll(coll);
+      Collection<LicenseKeyGroupEntity> lkgs =
+          vendorLicenseFacade.listLicenseKeyGroups(vlmId, finalVersion);
 
-      Collection<LicenseKeyGroupEntity> coll2 = vendorLicenseFacade.listLicenseKeyGroups(vlmId,
-              finalVersion, user);
-
-      coll2.stream().forEach(licenseKeyGroupEntity -> {
+      lkgs.forEach(licenseKeyGroupEntity -> {
         licenseKeyGroupEntity.setLimits(vendorLicenseFacade.listLimits(vlmId, finalVersion,
-                licenseKeyGroupEntity.getId(), user));
+            licenseKeyGroupEntity.getId()));
         Optional<String> manufacturerReferenceNumber = getFeatureGroupManufactureRefNumber
-                (licenseKeyGroupEntity.getReferencingFeatureGroups(), vlmId, finalVersion, user);
+            (licenseKeyGroupEntity.getReferencingFeatureGroups(), vlmId, finalVersion);
         manufacturerReferenceNumber
-                .ifPresent(licenseKeyGroupEntity::setManufacturerReferenceNumber);
+            .ifPresent(licenseKeyGroupEntity::setManufacturerReferenceNumber);
       });
-
-      licenseKeyGroupEntities.addAll(coll2);
+      licenseKeyGroupEntities.addAll(lkgs);
     }
 
+
     entitlementPoolEntities =
-            healEPs(user, filterChangedEntities(prepareForFiltering(entitlementPoolEntities, user,
-                    true)));
+        healEPs(filterChangedEntities(prepareForFiltering(entitlementPoolEntities, true)));
     licenseKeyGroupEntities =
-            healLkgs(user, filterChangedEntities(prepareForFiltering(licenseKeyGroupEntities, user,
-                    false)));
+        healLkgs(filterChangedEntities(prepareForFiltering(licenseKeyGroupEntities, false)));
     vendorLicenseArtifact.setEntitlementPoolEntities(entitlementPoolEntities);
     vendorLicenseArtifact.setLicenseKeyGroupEntities(licenseKeyGroupEntities);
 
@@ -165,21 +159,20 @@
 
   private static Optional<String> getFeatureGroupManufactureRefNumber(Set<String> featureGroupIds,
                                                                       String vlmId,
-                                                                      Version finalVersion,
-                                                                      String user) {
+                                                                      Version finalVersion) {
     String manufactureReferenceNumber = null;
     if (CollectionUtils.isNotEmpty(featureGroupIds)) {
       Object[] featureGroupIdsList = featureGroupIds.toArray();
       if (featureGroupIdsList.length > 0) {
         FeatureGroupEntity featureGroup =
-                vendorLicenseFacade.getFeatureGroup(new FeatureGroupEntity(vlmId, finalVersion,
-                        featureGroupIdsList[0].toString()), user);
+            vendorLicenseFacade.getFeatureGroup(new FeatureGroupEntity(vlmId, finalVersion,
+                featureGroupIdsList[0].toString()));
         manufactureReferenceNumber = featureGroup != null ? featureGroup
-                .getManufacturerReferenceNumber() : null;
+            .getManufacturerReferenceNumber() : null;
       }
     }
     return manufactureReferenceNumber != null ? Optional.of(manufactureReferenceNumber) :
-            Optional.empty();
+        Optional.empty();
   }
 
 
@@ -190,22 +183,21 @@
    * @param vlmId         vlmId
    * @param vlmVersion    vlmVersion
    * @param featureGroups featureGroups
-   * @param user          user
    * @return FileContentHandler
    */
   public FileContentHandler createLicenseArtifacts(String vspId, String vlmId, Version vlmVersion,
-                                                   List<String> featureGroups, String user) {
+                                                   List<String> featureGroups) {
 
 
     mdcDataDebugMessage.debugEntryMessage("VSP Id", vspId);
 
     FileContentHandler artifacts = new FileContentHandler();
-    String vendorName = getVendorName(vlmId, user);
+    String vendorName = getVendorName(vlmId);
 
     artifacts.addFile(VNF_ARTIFACT_NAME_WITH_PATH,
-            createVnfArtifact(vspId, vlmId, vlmVersion, vendorName, featureGroups, user));
+        createVnfArtifact(vspId, vlmId, vlmVersion, vendorName, featureGroups));
     artifacts.addFile(VENDOR_LICENSE_MODEL_ARTIFACT_NAME_WITH_PATH,
-            createVendorLicenseArtifact(vlmId, vendorName, user));
+        createVendorLicenseArtifact(vlmId, vendorName));
 
     mdcDataDebugMessage.debugExitMessage("VSP Id", vspId);
 
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/VnfLicenseArtifact.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/VnfLicenseArtifact.java
index b2cb710..91a73b6 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/VnfLicenseArtifact.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/VnfLicenseArtifact.java
@@ -38,11 +38,11 @@
 import org.openecomp.sdc.vendorlicense.licenseartifacts.impl.types.mixins.MixinLicenseKeyGroupEntityForVnfArtifact;
 import org.openecomp.sdc.vendorlicense.licenseartifacts.impl.types.mixins.MixinLimitArtifact;
 
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
 import java.io.Writer;
 import java.util.ArrayList;
 import java.util.List;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamWriter;
 
 @JacksonXmlRootElement(localName = "vf-license-model",
     namespace = "http://xmlns.openecomp.org/asdc/license-model/1.0")
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinEntitlementPoolEntityForVendorLicenseArtifact.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinEntitlementPoolEntityForVendorLicenseArtifact.java
index ac45528..70ef26f 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinEntitlementPoolEntityForVendorLicenseArtifact.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinEntitlementPoolEntityForVendorLicenseArtifact.java
@@ -62,12 +62,18 @@
   @JsonProperty(value = "version")
   abstract String getVersionForArtifact();
 
-  @JsonProperty(value = "start-date")
+  @JsonIgnore
   abstract String getStartDate();
 
-  @JsonProperty(value = "expiry-date")
+  @JsonIgnore
   abstract String getExpiryDate();
 
+  @JsonProperty(value = "start-date")
+  abstract String getIsoFormatStartDate();
+
+  @JsonProperty(value = "expiry-date")
+  abstract String getIsoFormatExpiryDate();
+
   @JsonIgnore
   abstract String getVendorLicenseModelId();
 
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinEntitlementPoolEntityForVnfArtifact.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinEntitlementPoolEntityForVnfArtifact.java
index ad1a9a6..7618b7a 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinEntitlementPoolEntityForVnfArtifact.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinEntitlementPoolEntityForVnfArtifact.java
@@ -42,7 +42,7 @@
   @JsonProperty(value = "threshold-value")
   abstract ThresholdForXml getThresholdForArtifact();
 
-  @JsonIgnore
+  @JsonProperty(value = "entitlement-pool-invariant-uuid")
   abstract String getId();
 
   @JsonProperty(value = "manufacturer-reference-number")
@@ -60,7 +60,7 @@
   @JsonIgnore
   abstract String getVersion();
 
-  @JsonIgnore
+  @JsonProperty(value = "version")
   abstract String getVersionForArtifact();
 
   @JsonIgnore
@@ -72,12 +72,18 @@
   @JsonIgnore
   abstract float getThresholdValue();
 
-  @JsonProperty(value = "start-date")
+  @JsonIgnore
   abstract String getStartDate();
 
-  @JsonProperty(value = "expiry-date")
+  @JsonIgnore
   abstract String getExpiryDate();
 
+  @JsonProperty(value = "start-date")
+  abstract String getIsoFormatStartDate();
+
+  @JsonProperty(value = "expiry-date")
+  abstract String getIsoFormatExpiryDate();
+
   @JsonIgnore
   abstract ChoiceOrOther<EntitlementMetric> getEntitlementMetric();
 
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinLicenseKeyGroupEntityForVendorLicenseArtifact.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinLicenseKeyGroupEntityForVendorLicenseArtifact.java
index 5a8e996..eeaa7c0 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinLicenseKeyGroupEntityForVendorLicenseArtifact.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinLicenseKeyGroupEntityForVendorLicenseArtifact.java
@@ -79,12 +79,18 @@
   @JsonIgnore
   abstract Collection<LimitEntity> getLimits();
 
-  @JsonProperty(value = "start-date")
+  @JsonIgnore
   abstract String getStartDate();
 
-  @JsonProperty(value = "expiry-date")
+  @JsonIgnore
   abstract String getExpiryDate();
 
+  @JsonProperty(value = "start-date")
+  abstract String getIsoFormatStartDate();
+
+  @JsonProperty(value = "expiry-date")
+  abstract String getIsoFormatExpiryDate();
+
   @JsonProperty(value = "threshold-value")
   abstract ThresholdForXml getThresholdForArtifact();
 
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinLicenseKeyGroupEntityForVnfArtifact.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinLicenseKeyGroupEntityForVnfArtifact.java
index 4af4b59..f560f36 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinLicenseKeyGroupEntityForVnfArtifact.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinLicenseKeyGroupEntityForVnfArtifact.java
@@ -34,7 +34,7 @@
 import java.util.Set;
 
 public abstract class MixinLicenseKeyGroupEntityForVnfArtifact {
-  @JsonIgnore
+  @JsonProperty(value = "license-key-group-invariant-uuid")
   abstract String getId();
 
   @JsonProperty(value = "manufacturer-reference-number")
@@ -46,7 +46,7 @@
   @JsonIgnore
   abstract String getVersion();
 
-  @JsonIgnore
+  @JsonProperty(value = "version")
   abstract String getVersionForArtifact();
 
   @JsonIgnore
@@ -87,12 +87,18 @@
   @JsonIgnore
   abstract Collection<LimitEntity> getLimits();
 
-  @JsonProperty(value = "start-date")
+  @JsonIgnore
   abstract String getStartDate();
 
-  @JsonProperty(value = "expiry-date")
+  @JsonIgnore
   abstract String getExpiryDate();
 
+  @JsonProperty(value = "start-date")
+  abstract String getIsoFormatStartDate();
+
+  @JsonProperty(value = "expiry-date")
+  abstract String getIsoFormatExpiryDate();
+
   @JsonIgnore
   abstract String getThresholdUnits();
 
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/util/VendorLicenseArtifactsServiceUtils.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/util/VendorLicenseArtifactsServiceUtils.java
index 502aa35..bd209f9 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/util/VendorLicenseArtifactsServiceUtils.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/util/VendorLicenseArtifactsServiceUtils.java
@@ -27,16 +27,19 @@
 import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity;
 import org.openecomp.sdc.vendorlicense.healing.HealingService;
 import org.openecomp.sdc.vendorlicense.licenseartifacts.impl.VendorLicenseArtifactsServiceImpl;
+import org.openecomp.sdc.versioning.ItemManagerFactory;
+import org.openecomp.sdc.versioning.VersioningManager;
+import org.openecomp.sdc.versioning.VersioningManagerFactory;
 import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.versioning.dao.types.VersionStatus;
 import org.openecomp.sdc.versioning.dao.types.VersionableEntity;
-import org.openecomp.sdc.versioning.types.VersionInfo;
-import org.openecomp.sdc.versioning.types.VersionableEntityAction;
 
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
+import java.util.stream.Collectors;
 
 /**
  * @author katyr
@@ -45,7 +48,7 @@
 
 public class VendorLicenseArtifactsServiceUtils {
   private static final HealingService healingService =
-          HealingServiceFactory.getInstance().createInterface();
+      HealingServiceFactory.getInstance().createInterface();
 
   /**
    * maps the entities by id
@@ -53,7 +56,7 @@
    * @return a Map of id -> list of versionable entities with that id
    */
   private static MultiValuedMap<String, VersionableEntity> mapById(
-          Collection<? extends VersionableEntity> versionableEntities) {
+      Collection<? extends VersionableEntity> versionableEntities) {
     MultiValuedMap<String, VersionableEntity> mappedById = new ArrayListValuedHashMap<>();
     for (VersionableEntity ve : versionableEntities) {
       mappedById.put(ve.getId(), ve);
@@ -62,17 +65,18 @@
   }
 
   /**
-   *  For all entities with same id, only entities that differ from one another will be returned.
-   *  If no change has occured, the entity with the earlier VLM version will be returned.
-   *  If only one version of said entities exists it will be returned
+   * For all entities with same id, only entities that differ from one another will be returned.
+   * If no change has occured, the entity with the earlier VLM version will be returned.
+   * If only one version of said entities exists it will be returned
+   *
    * @return a list of entities that has been changed
    */
   public static List<VersionableEntity> filterChangedEntities(
-          Collection<? extends VersionableEntity> versionableEntities) {
+      Collection<? extends VersionableEntity> versionableEntities) {
     MultiValuedMap<String, VersionableEntity> entitiesById = mapById(
-            versionableEntities);
+        versionableEntities);
     MultiValuedMap<String, VersionableEntity> entitiesByVersionUuId =
-            new ArrayListValuedHashMap<>();
+        new ArrayListValuedHashMap<>();
     List<VersionableEntity> changedOnly = new ArrayList<>();
 
     for (String epId : entitiesById.keySet()) {
@@ -85,7 +89,7 @@
     //for every list of eps which have the same uuid, get the one with the earliest vlm version.
     for (String versionUid : entitiesByVersionUuId.keySet()) {
       List<VersionableEntity> versionableEntitiesForUuid =
-              (List<VersionableEntity>) entitiesByVersionUuId.get(versionUid);
+          (List<VersionableEntity>) entitiesByVersionUuId.get(versionUid);
       versionableEntitiesForUuid.sort(new VersionableEntitySortByVlmMajorVersion());
       changedOnly.add(versionableEntitiesForUuid.get(0));
     }
@@ -93,40 +97,38 @@
     return changedOnly;
   }
 
-  public static Set<LicenseKeyGroupEntity> healLkgs(String user,
-                                                    Collection<? extends VersionableEntity> licenseKeyGroupEntities) {
+  public static Set<LicenseKeyGroupEntity> healLkgs(
+      Collection<? extends VersionableEntity> licenseKeyGroupEntities) {
     Set<LicenseKeyGroupEntity> healed = new HashSet<>();
     for (VersionableEntity licenseKeyGroupEntity : licenseKeyGroupEntities) {
       healed.add((LicenseKeyGroupEntity) VendorLicenseArtifactsServiceImpl.healingService
-              .heal(licenseKeyGroupEntity, user));
+          .heal(licenseKeyGroupEntity));
     }
 
     return healed;
   }
 
-  public static Set<EntitlementPoolEntity> healEPs(String user,
-                                                   Collection<? extends VersionableEntity> entitlementPoolEntities) {
+  public static Set<EntitlementPoolEntity> healEPs(
+      Collection<? extends VersionableEntity> entitlementPoolEntities) {
     Set<EntitlementPoolEntity> healed = new HashSet<>();
     for (VersionableEntity entitlementPoolEntity : entitlementPoolEntities) {
       healed.add((EntitlementPoolEntity) VendorLicenseArtifactsServiceImpl.healingService
-              .heal(entitlementPoolEntity, user));
+          .heal(entitlementPoolEntity));
     }
 
     return healed;
   }
 
   public static List<Version> getFinalVersionsForVlm(String vlmId) {
-    VersionInfo versionInfo =
-            VendorLicenseArtifactsServiceImpl.vendorLicenseFacade
-                    .getVersionInfo(vlmId, VersionableEntityAction.Read, "");
-    return versionInfo.getFinalVersions();
-
+    VersioningManager versioningManager = VersioningManagerFactory.getInstance().createInterface();
+    return versioningManager.list(vlmId).stream()
+        .filter(version -> VersionStatus.Certified == version.getStatus())
+        .map(certifiedVersion -> versioningManager.get(vlmId, certifiedVersion)) //sync to private
+        .collect(Collectors.toList());
   }
 
-  public static String getVendorName(String vendorLicenseModelId, String user) {
-    return VendorLicenseArtifactsServiceImpl.vendorLicenseFacade
-            .getVendorLicenseModel(vendorLicenseModelId, null, user)
-            .getVendorLicenseModel().getVendorName();
+  public static String getVendorName(String vendorLicenseModelId) {
+    return ItemManagerFactory.getInstance().createInterface().get(vendorLicenseModelId).getName();
   }
 
 
@@ -140,38 +142,36 @@
    * to healing as before. For VLMs created post-bugfix this code should not update any element
    */
   public static Collection<? extends VersionableEntity> prepareForFiltering(Collection<? extends
-          VersionableEntity> versionableEntities, String user, boolean isEP) {
+      VersionableEntity> versionableEntities, boolean isEP) {
     MultiValuedMap<String, VersionableEntity> entitiesById = mapById(
-            versionableEntities);
+        versionableEntities);
 
     for (String epId : entitiesById.keySet()) {
       List<VersionableEntity> versionableEntitiesForId = new ArrayList<>();
       versionableEntitiesForId.addAll(entitiesById.get(epId));
       versionableEntitiesForId.sort(new VersionableEntitySortByVlmMajorVersion());
-      healingService.heal(versionableEntitiesForId.get(0), user);
+      healingService.heal(versionableEntitiesForId.get(0));
       for (int i = 1; i < versionableEntitiesForId.size(); i++) {
         if (isEP) {
           EntitlementPoolEntity current = (EntitlementPoolEntity) versionableEntitiesForId.get(i);
           EntitlementPoolEntity previous = (EntitlementPoolEntity) versionableEntitiesForId
-                  .get(i - 1);
+              .get(i - 1);
           if (current.equals(previous) && current.getVersionUuId() == null) {
             current.setVersionUuId(previous.getVersionUuId());
             healingService.persistNoHealing(current);
           } else {
-            versionableEntitiesForId.set(i, healingService.heal(versionableEntitiesForId.get(i),
-                    user));
+            versionableEntitiesForId.set(i, healingService.heal(versionableEntitiesForId.get(i)));
           }
 
         } else {
           LicenseKeyGroupEntity current = (LicenseKeyGroupEntity) versionableEntitiesForId.get(i);
           LicenseKeyGroupEntity previous = (LicenseKeyGroupEntity) versionableEntitiesForId
-                  .get(i - 1);
+              .get(i - 1);
           if (current.equals(previous) && current.getVersionUuId() == null) {
             current.setVersionUuId(previous.getVersionUuId());
             healingService.persistNoHealing(current);
           } else {
-            versionableEntitiesForId.set(i, healingService.heal(versionableEntitiesForId.get(i),
-                    user));
+            versionableEntitiesForId.set(i, healingService.heal(versionableEntitiesForId.get(i)));
           }
 
 
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/VendorSoftwareProductConstants.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/VendorSoftwareProductConstants.java
index 8010c40..bf48bfb 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/VendorSoftwareProductConstants.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/VendorSoftwareProductConstants.java
@@ -22,14 +22,14 @@
 
 public final class VendorSoftwareProductConstants {
   public static final String VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE = "VendorSoftwareProduct";
-  public static final String GENERAL_COMPONENT_ID = "General";
   public static final String VSP_PACKAGE_ZIP = "VSPPackage.zip";
   public static final String CSAR = "CSAR";
   public static final String UPLOAD_RAW_DATA = "UPLOAD_RAW_DATA";
   public static final String INFORMATION_ARTIFACT_NAME = "VSP_%s_Information.txt";
-    public static final String UNSUPPORTED_OPERATION_ERROR =
-            "An error has occurred: Unsupported operation for 1707 release.";
+  public static final String UNSUPPORTED_OPERATION_ERROR =
+      "An error has occurred: Unsupported operation for 1707 release.";
   public static final String NAME_PATTERN = "^[a-zA-Z0-9_]*$";
+  public static final String VALIDATION_VSP_NAME = "validationOnlyVspName";
 
   public final class UniqueValues {
     public static final String VENDOR_SOFTWARE_PRODUCT_NAME = "Vendor Software Product name";
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ComponentDependencyModelDao.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ComponentDependencyModelDao.java
index a980918..cbbb97b 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ComponentDependencyModelDao.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ComponentDependencyModelDao.java
@@ -3,10 +3,7 @@
 import org.openecomp.core.dao.BaseDao;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentDependencyModelEntity;
 import org.openecomp.sdc.versioning.dao.VersionableDao;
-import org.openecomp.sdc.versioning.dao.types.Version;
 
 public interface ComponentDependencyModelDao extends VersionableDao,
     BaseDao<ComponentDependencyModelEntity> {
-
-  public void deleteAll(String vspId, Version version);
 }
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/OrchestrationTemplateCandidateDao.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/OrchestrationTemplateCandidateDao.java
index fceac0a..3d7c621 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/OrchestrationTemplateCandidateDao.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/OrchestrationTemplateCandidateDao.java
@@ -31,7 +31,9 @@
 
   OrchestrationTemplateCandidateData get(String vspId, Version version);
 
-  void update(String vspId, OrchestrationTemplateCandidateData candidateData);
+  OrchestrationTemplateCandidateData getInfo(String vspId, Version version);
+
+  void update(String vspId, Version version, OrchestrationTemplateCandidateData candidateData);
 
   void updateStructure(String vspId, Version version, FilesDataStructure fileDataStructure);
 
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/OrchestrationTemplateDao.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/OrchestrationTemplateDao.java
index a8c2eb8..4d82ed3 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/OrchestrationTemplateDao.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/OrchestrationTemplateDao.java
@@ -20,17 +20,16 @@
 
 package org.openecomp.sdc.vendorsoftwareproduct.dao;
 
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.UploadData;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.UploadDataEntity;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.OrchestrationTemplateEntity;
 import org.openecomp.sdc.versioning.dao.VersionableDao;
 import org.openecomp.sdc.versioning.dao.types.Version;
 
 public interface OrchestrationTemplateDao extends VersionableDao {
 
-  String getValidationData(String vspId, Version version);
+  OrchestrationTemplateEntity getInfo(String vspId, Version version);
 
-  UploadDataEntity getOrchestrationTemplate(String vspId, Version version);
+  OrchestrationTemplateEntity get(String vspId, Version version);
 
-  void updateOrchestrationTemplateData(String vspId, UploadData uploadData);
+  void update(String vspId, Version version, OrchestrationTemplateEntity uploadData);
 }
 
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/PackageInfoDao.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/PackageInfoDao.java
index d12069f..36fff1e 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/PackageInfoDao.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/PackageInfoDao.java
@@ -22,17 +22,9 @@
 
 import org.openecomp.core.dao.BaseDao;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.PackageInfo;
-import org.openecomp.sdc.versioning.dao.types.Version;
 
-import java.nio.ByteBuffer;
 import java.util.List;
 
 public interface PackageInfoDao extends BaseDao<PackageInfo> {
   List<PackageInfo> listByCategory(String category, String subCategory);
-
-  public void deleteRowTranslateContent(String vspId, Version version);
-
-  void updateTranslatedContent(String vspId, Version version, ByteBuffer translateContent);
-
-
 }
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ProcessDao.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ProcessDao.java
index c6622ef..aea93a3 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ProcessDao.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ProcessDao.java
@@ -12,6 +12,11 @@
 public interface ProcessDao extends VersionableDao, BaseDao<ProcessEntity> {
   void deleteAll(ProcessEntity entity);
 
-
   void deleteVspAll(String vspId, Version version);
+
+  ProcessEntity getArtifact(ProcessEntity entity);
+
+  void uploadArtifact(ProcessEntity entity);
+
+  void deleteArtifact(ProcessEntity entity);
 }
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/UploadDataDao.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/UploadDataDao.java
deleted file mode 100644
index cdc3a77..0000000
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/UploadDataDao.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * 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=========================================================
- */
-
-package org.openecomp.sdc.vendorsoftwareproduct.dao;
-
-import org.openecomp.core.dao.BaseDao;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.UploadDataEntity;
-import org.openecomp.sdc.versioning.dao.types.Version;
-
-import java.nio.ByteBuffer;
-
-public interface UploadDataDao extends BaseDao<UploadDataEntity> {
-
-  void deleteContentDataAndValidationData(String vspId, Version version);
-
-  ByteBuffer getContentData(String vspId, Version version);
-}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VendorSoftwareProductDao.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VendorSoftwareProductDao.java
deleted file mode 100644
index 48d1e16..0000000
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VendorSoftwareProductDao.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * 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=========================================================
- */
-
-package org.openecomp.sdc.vendorsoftwareproduct.dao;
-
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentDependencyModelEntity;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComputeEntity;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.DeploymentFlavorEntity;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ImageEntity;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
-import org.openecomp.sdc.versioning.dao.VersionableDao;
-import org.openecomp.sdc.versioning.dao.types.Version;
-
-import java.util.Collection;
-import java.util.List;
-
-
-public interface VendorSoftwareProductDao extends VersionableDao {
-
-  //VspDetails getVendorSoftwareProductInfo(VspDetails vspDetails);
-
-  Collection<ComponentEntity> listComponents(String vspId, Version version);
-
-  Collection<ComponentEntity> listComponentsQuestionnaire(String vspId, Version version);
-
-  Collection<ComponentEntity> listComponentsCompositionAndQuestionnaire(String vspId,
-                                                                        Version version);
-
-
-  Collection<ProcessEntity> listProcesses(String vspId, Version version, String componentId);
-
-  void deleteProcesses(String vspId, Version version, String componentId);
-
-  ProcessEntity getProcess(String vspId, Version version, String componentId, String processId);
-
-  void createProcess(ProcessEntity processEntity);
-
-  void updateProcess(ProcessEntity processEntity);
-
-  void deleteProcess(String vspId, Version version, String componentId, String processId);
-
-
-  void uploadProcessArtifact(String vspId, Version version, String componentId, String processId,
-                             byte[] artifact, String artifactFileName);
-
-  ProcessEntity getProcessArtifact(String vspId, Version version, String componentId,
-                                   String processId);
-
-  void deleteProcessArtifact(String vspId, Version version, String componentId, String processId);
-
-
-  Collection<NicEntity> listNicsByVsp(String vspId, Version version);
-
-
-  void deleteUploadData(String vspId, Version version);
-
-  //void updateVspLatestModificationTime(String vspId, Version version);
-  void createComponentDependencyModel(
-      List<ComponentDependencyModelEntity> componentDependencyModelEntity, String vspId,
-      Version version);
-
-  Collection<ComponentDependencyModelEntity> listComponentDependencies(String vspId,Version
-      version);
-
-  void createDeploymentFlavor(DeploymentFlavorEntity deploymentFlavor);
-
-  Collection<DeploymentFlavorEntity> listDeploymentFlavors(String vspId, Version version);
-
-  DeploymentFlavorEntity getDeploymentFlavor(String vspId, Version version, String
-      deploymentFlavorId);
-  void deleteDeploymentFlavor(String vspId, Version version, String deploymentFlavorId);
-
-
-  void createImage(ImageEntity imageEntity);
-
-  Collection<ImageEntity> listImages(String vspId, Version version, String componentId);
-
-  ImageEntity getImage(String vspId, Version version, String componentId, String imageId);
-
-  Collection<ImageEntity> listImagesByVsp(String vspId, Version version);
-
-  void createCompute(ComputeEntity computeEntity);
-
-  Collection<ComputeEntity> listComputes(String vspId, Version version, String componentId);
-
-  Collection<ComputeEntity> listComputesByVsp(String vspId, Version version);
-
-  ComputeEntity getCompute(String vspId, Version version, String componentId, String
-      computeFlavorId);
-
-  void deleteImage(String vspId, Version version, String componentId, String imageId);
-
-  void updateDeploymentFlavor(DeploymentFlavorEntity deploymentFlavorEntity);
-
-  void updateImage(ImageEntity imageEntity);
-
-  void updateImageQuestionnaire(String vspId, Version activeVersion, String componentId,
-                                String imageId, String questionnaireData);
-
-  void updateComputeQuestionnaire(String vspId, Version activeVersion, String componentId,
-                                  String computeId, String questionnaireData);
-
-  void updateCompute(ComputeEntity compute);
-
-  void deleteCompute(String vspId, Version version, String componentId, String computeFlavorId);
-
-}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VendorSoftwareProductInfoDao.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VendorSoftwareProductInfoDao.java
index 0481829..c44a9cd 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VendorSoftwareProductInfoDao.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VendorSoftwareProductInfoDao.java
@@ -28,15 +28,9 @@
 
 public interface VendorSoftwareProductInfoDao extends VersionableDao, BaseDao<VspDetails> {
 
-  void updateOldVersionIndication(VspDetails vspDetails);
-
   void updateQuestionnaireData(String vspId, Version version, String questionnaireData);
 
-  String getQuestionnaireData(String vspId, Version version);
-
   VspQuestionnaireEntity getQuestionnaire(String vspId, Version version);
 
-  void deleteAll(String vspId, Version version);
-
   boolean isManual(String vspId, Version version);
 }
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VspMergeDao.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VspMergeDao.java
new file mode 100644
index 0000000..c9525bf
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VspMergeDao.java
@@ -0,0 +1,16 @@
+package org.openecomp.sdc.vendorsoftwareproduct.dao;
+
+import com.amdocs.zusammen.datatypes.item.Resolution;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+public interface VspMergeDao {
+
+  boolean isVspModelConflicted(String vspId, Version version);
+
+  void updateVspModelId(String vspId, Version version);
+
+  // TODO: 11/7/2017 change to sdc Resolution
+  void updateVspModelConflictResolution(String vspId, Version version, Resolution resolution);
+
+  void applyVspModelConflictResolution(String vspId, Version version);
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VspMergeDaoFactory.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VspMergeDaoFactory.java
new file mode 100644
index 0000000..40ef50a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VspMergeDaoFactory.java
@@ -0,0 +1,11 @@
+package org.openecomp.sdc.vendorsoftwareproduct.dao;
+
+import org.openecomp.core.factory.api.AbstractComponentFactory;
+import org.openecomp.core.factory.api.AbstractFactory;
+
+public abstract class VspMergeDaoFactory extends AbstractComponentFactory<VspMergeDao> {
+
+  public static VspMergeDaoFactory getInstance() {
+    return AbstractFactory.getInstance(VspMergeDaoFactory.class);
+  }
+}
\ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/DeploymentFlavorEntity.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/DeploymentFlavorEntity.java
index b20e110..57161fb 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/DeploymentFlavorEntity.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/DeploymentFlavorEntity.java
@@ -1,6 +1,10 @@
 package org.openecomp.sdc.vendorsoftwareproduct.dao.type;
 
-import com.datastax.driver.mapping.annotations.*;
+import com.datastax.driver.mapping.annotations.ClusteringColumn;
+import com.datastax.driver.mapping.annotations.Column;
+import com.datastax.driver.mapping.annotations.Frozen;
+import com.datastax.driver.mapping.annotations.PartitionKey;
+import com.datastax.driver.mapping.annotations.Table;
 import org.openecomp.core.utilities.json.JsonUtil;
 import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityId;
 import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityType;
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/OnboardingMethod.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/OnboardingMethod.java
new file mode 100644
index 0000000..108fd22
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/OnboardingMethod.java
@@ -0,0 +1,6 @@
+package org.openecomp.sdc.vendorsoftwareproduct.dao.type;
+
+public enum OnboardingMethod {
+  NetworkPackage,
+  Manual;
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/OrchestrationTemplateCandidateData.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/OrchestrationTemplateCandidateData.java
index de70434..7b19e86 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/OrchestrationTemplateCandidateData.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/OrchestrationTemplateCandidateData.java
@@ -5,15 +5,18 @@
 public class OrchestrationTemplateCandidateData {
   private ByteBuffer contentData;
   private String filesDataStructure;
-
+  private String fileSuffix;
+  private String fileName;
 
   public OrchestrationTemplateCandidateData() {
   }
 
-  public OrchestrationTemplateCandidateData(ByteBuffer contentData,
-                                            String dataStructureJson) {
+  public OrchestrationTemplateCandidateData(ByteBuffer contentData, String dataStructureJson,
+                                            String fileSuffix, String fileName) {
     this.contentData = contentData;
     this.filesDataStructure = dataStructureJson;
+    this.fileSuffix = fileSuffix;
+    this.fileName = fileName;
   }
 
   public ByteBuffer getContentData() {
@@ -31,4 +34,20 @@
   public void setFilesDataStructure(String filesDataStructure) {
     this.filesDataStructure = filesDataStructure;
   }
+
+  public String getFileSuffix() {
+    return fileSuffix;
+  }
+
+  public void setFileSuffix(String fileSuffix) {
+    this.fileSuffix = fileSuffix;
+  }
+
+  public String getFileName() {
+    return fileName;
+  }
+
+  public void setFileName(String fileName) {
+    this.fileName = fileName;
+  }
 }
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/UploadDataEntity.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/OrchestrationTemplateEntity.java
similarity index 84%
rename from openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/UploadDataEntity.java
rename to openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/OrchestrationTemplateEntity.java
index 2ade95b..ef3a4b6 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/UploadDataEntity.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/OrchestrationTemplateEntity.java
@@ -7,9 +7,9 @@
  * 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.
@@ -27,25 +27,22 @@
 
 import java.nio.ByteBuffer;
 
-public class UploadDataEntity implements VersionableEntity {
-  private static final String ENTITY_TYPE = "Vendor Software Product Upload data";
+public class OrchestrationTemplateEntity implements VersionableEntity {
+  private static final String ENTITY_TYPE = "Vendor Software Product Orchestration Template";
 
   private String id;
-
   private Version version;
-
+  private String fileSuffix;
+  private String fileName;
   private String packageName;
-
   private String packageVersion;
-
   private String validationData;
-
   private ByteBuffer contentData;
 
-  public UploadDataEntity() {
+  public OrchestrationTemplateEntity() {
   }
 
-  public UploadDataEntity(String id, Version version) {
+  public OrchestrationTemplateEntity(String id, Version version) {
     this.id = id;
     this.version = version;
   }
@@ -78,6 +75,22 @@
     this.version = version;
   }
 
+  public String getFileSuffix() {
+    return fileSuffix;
+  }
+
+  public void setFileSuffix(String fileSuffix) {
+    this.fileSuffix = fileSuffix;
+  }
+
+  public String getFileName() {
+    return fileName;
+  }
+
+  public void setFileName(String fileName) {
+    this.fileName = fileName;
+  }
+
   public String getPackageName() {
     return packageName;
   }
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/PackageInfo.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/PackageInfo.java
index ad02883..3403f28 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/PackageInfo.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/PackageInfo.java
@@ -21,7 +21,6 @@
 package org.openecomp.sdc.vendorsoftwareproduct.dao.type;
 
 import com.datastax.driver.mapping.annotations.Column;
-import com.datastax.driver.mapping.annotations.Frozen;
 import com.datastax.driver.mapping.annotations.PartitionKey;
 import com.datastax.driver.mapping.annotations.Table;
 import org.openecomp.sdc.versioning.dao.types.Version;
@@ -38,8 +37,7 @@
   private String vspId;
 
   @PartitionKey(value = 1)
-  @Frozen
-  private Version version;
+  private String version;
 
   @Column(name = "display_name")
   private String displayName;
@@ -75,7 +73,7 @@
 
   public PackageInfo(String packageId, Version version) {
     this.vspId = packageId;
-    this.version = version;
+    this.version = version.getName();
   }
 
   public String getDisplayName() {
@@ -94,11 +92,11 @@
     this.vspDescription = vspDescription;
   }
 
-  public Version getVersion() {
+  public String getVersion() {
     return version;
   }
 
-  public void setVersion(Version version) {
+  public void setVersion(String version) {
     this.version = version;
   }
 
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/UploadData.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/UploadData.java
deleted file mode 100644
index 071af91..0000000
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/UploadData.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * 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=========================================================
- */
-
-package org.openecomp.sdc.vendorsoftwareproduct.dao.type;
-
-import org.openecomp.core.utilities.json.JsonUtil;
-import org.openecomp.sdc.heat.datatypes.structure.ValidationStructureList;
-
-import java.nio.ByteBuffer;
-
-
-public class UploadData {
-
-  private String id;
-
-  private String packageName;
-
-  private String packageVersion;
-
-  private String validationData;
-
-  private ByteBuffer contentData;
-
-  public String getId() {
-    return id;
-  }
-
-  public void setId(String id) {
-    this.id = id;
-  }
-
-  public String getPackageName() {
-    return packageName;
-  }
-
-  public void setPackageName(String packageName) {
-    this.packageName = packageName;
-  }
-
-  public String getPackageVersion() {
-    return packageVersion;
-  }
-
-  public void setPackageVersion(String packageVersion) {
-    this.packageVersion = packageVersion;
-  }
-
-  public String getValidationData() {
-    return validationData;
-  }
-
-  public void setValidationData(String validationData) {
-    this.validationData = validationData;
-  }
-
-  public ValidationStructureList getValidationDataStructure() {
-    return validationData == null ? null
-        : JsonUtil.json2Object(validationData, ValidationStructureList.class);
-  }
-
-  public void setValidationDataStructure(ValidationStructureList validationData) {
-    this.validationData = validationData == null ? null
-        : JsonUtil.object2Json(validationData);
-  }
-
-  public ByteBuffer getContentData() {
-    return contentData;
-  }
-
-  public void setContentData(ByteBuffer contentData) {
-    this.contentData = contentData;
-  }
-}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/VspDetails.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/VspDetails.java
index 3f9768b..3ba77ad 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/VspDetails.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/VspDetails.java
@@ -20,13 +20,10 @@
 
 package org.openecomp.sdc.vendorsoftwareproduct.dao.type;
 
-import org.openecomp.core.utilities.json.JsonUtil;
-import org.openecomp.sdc.heat.datatypes.structure.ValidationStructureList;
 import org.openecomp.sdc.versioning.dao.types.Version;
 import org.openecomp.sdc.versioning.dao.types.VersionableEntity;
 
 import java.util.List;
-import java.util.Objects;
 
 
 public class VspDetails implements VersionableEntity {
@@ -55,18 +52,10 @@
 
   private List<String> featureGroups;
 
-  private String validationData;
-
-  private String oldVersion;
-
   private Long writetimeMicroSeconds;
 
   private String onboardingMethod;
 
-  private String onboardingOrigin;
-
-  private String networkPackageName;
-
   public VspDetails() {
   }
 
@@ -183,24 +172,6 @@
     this.featureGroups = featureGroups;
   }
 
-  public String getValidationData() {
-    return validationData;
-  }
-
-  public void setValidationData(String validationData) {
-    this.validationData = validationData;
-  }
-
-  public ValidationStructureList getValidationDataStructure() {
-    return validationData == null ? null
-        : JsonUtil.json2Object(validationData, ValidationStructureList.class);
-  }
-
-  public void setValidationDataStructure(ValidationStructureList validationData) {
-    this.validationData = validationData == null ? null
-        : JsonUtil.object2Json(validationData);
-  }
-
   public Long getWritetimeMicroSeconds() {
     return this.writetimeMicroSeconds;
   }
@@ -213,36 +184,14 @@
     return this.oldVersion;
   }*/
 
-  public String getOldVersion(){
-    return this.oldVersion;
-  }
-
-  public void setOldVersion(String oldVersion) {
-    this.oldVersion = oldVersion;
-  }
-
-  public String getOnboardingOrigin() {
-    return onboardingOrigin;
-  }
-
-  public void setOnboardingOrigin(String onboardingOrigin) {
-    this.onboardingOrigin = onboardingOrigin;
-  }
-
   public String getOnboardingMethod() {
     return onboardingMethod;
   }
+
   public void setOnboardingMethod(String onboardingMethod) {
     this.onboardingMethod = onboardingMethod;
   }
 
-  public String getNetworkPackageName() {
-    return networkPackageName;
-  }
-
-  public void setNetworkPackageName(String networkPackageName) {
-    this.networkPackageName = networkPackageName;
-  }
 
   @Override
   public String toString() {
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/composition/CompositionEntityDataManager.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/composition/CompositionEntityDataManager.java
index b77012e..ff78fff 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/composition/CompositionEntityDataManager.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/composition/CompositionEntityDataManager.java
@@ -22,7 +22,6 @@
 
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.CompositionEntity;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComputeEntity;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.DeploymentFlavorEntity;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ImageEntity;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity;
@@ -64,12 +63,10 @@
   void saveComponents(String vspId, Version version, CompositionData compositionData,
                       Map<String, String> networkIdByName);
 
-  void saveNicsByComponent(String vspId, Version version,
-                           Map<String, String> networkIdByName, Component component,
-                           String componentId);
+  void saveNicsByComponent(String vspId, Version version, Map<String, String> networkIdByName,
+                           Component component, String componentId);
 
-  Map<String, String> saveNetworks(String vspId, Version version,
-                                   CompositionData compositionData);
+  Map<String, String> saveNetworks(String vspId, Version version, CompositionData compositionData);
 
   NetworkEntity createNetwork(NetworkEntity network);
 
@@ -77,15 +74,14 @@
 
   NicEntity createNic(NicEntity nic);
 
-  public ComputeEntity createCompute(ComputeEntity compute);
+  DeploymentFlavorEntity createDeploymentFlavor(DeploymentFlavorEntity deploymentFlavor);
 
-  public DeploymentFlavorEntity createDeploymentFlavor(DeploymentFlavorEntity deploymentFlavor);
+  ImageEntity createImage(ImageEntity image);
 
-  public ImageEntity createImage(ImageEntity image);
+  void saveComputesFlavorByComponent(String vspId, Version version, Component component,
+                                     String componentId);
 
-  public void saveComputesFlavorByComponent(String vspId, Version version, Component component, String
-      componentId);
-  public void saveImagesByComponent(String vspId, Version version, Component component, String
-      componentId);
+  void saveImagesByComponent(String vspId, Version version, Component component,
+                             String componentId);
 
 }
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/filedatastructuremodule/CandidateService.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/filedatastructuremodule/CandidateService.java
index 6cc639f..697dab2 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/filedatastructuremodule/CandidateService.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/filedatastructuremodule/CandidateService.java
@@ -45,19 +45,23 @@
   Optional<ErrorMessage> validateRawZipData(byte[] uploadedFileData);
 
   OrchestrationTemplateCandidateData createCandidateDataEntity(
-          CandidateDataEntityTo candidateDataEntityTo, InputStream zipFileManifest, AnalyzedZipHeatFiles analyzedZipHeatFiles) throws Exception;
+      CandidateDataEntityTo candidateDataEntityTo, InputStream zipFileManifest,
+      AnalyzedZipHeatFiles analyzedZipHeatFiles) throws Exception;
 
-  void updateCandidateUploadData(OrchestrationTemplateCandidateData uploadData, String
-      itemId);
+  void updateCandidateUploadData(String vspId, Version version,
+                                 OrchestrationTemplateCandidateData uploadData);
 
   Optional<FilesDataStructure> getOrchestrationTemplateCandidateFileDataStructure(String vspId,
-                               Version activeVersion);
+                                                                                  Version version);
 
-  void updateOrchestrationTemplateCandidateFileDataStructure(String vspId, Version activeVersion,
-        FilesDataStructure fileDataStructure);
+  void updateOrchestrationTemplateCandidateFileDataStructure(String vspId, Version version,
+                                                             FilesDataStructure fileDataStructure);
 
   OrchestrationTemplateCandidateData getOrchestrationTemplateCandidate(String vspId,
-                                                                       Version activeVersion);
+                                                                       Version version);
+
+  OrchestrationTemplateCandidateData getOrchestrationTemplateCandidateInfo(String vspId,
+                                                                       Version version);
 
   Optional<ByteArrayInputStream> fetchZipFileByteArrayInputStream(String vspId,
                                                                   OrchestrationTemplateCandidateData candidateDataEntity,
@@ -66,11 +70,11 @@
                                                                   Map<String, List<ErrorMessage>> uploadErrors);
 
   byte[] replaceManifestInZip(ByteBuffer contentData, String manifest, String vspId,
-                              OnboardingTypesEnum type)
-      throws IOException;
+                              OnboardingTypesEnum type) throws IOException;
 
   Optional<ManifestContent> createManifest(VspDetails vspDetails,
-                                           FileContentHandler fileContentHandler, AnalyzedZipHeatFiles analyzedZipHeatFiles);
+                                           FileContentHandler fileContentHandler,
+                                           AnalyzedZipHeatFiles analyzedZipHeatFiles);
 
   String createManifest(VspDetails vspDetails, FilesDataStructure structure);
 
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/HeatFileAnalyzerRowDataImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/HeatFileAnalyzerRowDataImpl.java
index dd303c7..8ed5160 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/HeatFileAnalyzerRowDataImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/HeatFileAnalyzerRowDataImpl.java
@@ -28,7 +28,11 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
-import java.util.*;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
 import java.util.regex.Pattern;
 
 public class HeatFileAnalyzerRowDataImpl implements HeatFileAnalyzer {
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/utils/CandidateEntityBuilder.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/utils/CandidateEntityBuilder.java
index 41510ec..c34e654 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/utils/CandidateEntityBuilder.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/utils/CandidateEntityBuilder.java
@@ -57,22 +57,22 @@
 
   public OrchestrationTemplateCandidateData buildCandidateEntityFromZip(
       VspDetails vspDetails, byte[] uploadedFileData, FileContentHandler contentMap,
-      Map<String, List<ErrorMessage>> uploadErrors, String user) throws Exception {
+      Map<String, List<ErrorMessage>> uploadErrors) throws Exception {
     //mdcDataDebugMessage.debugEntryMessage("VSP Id", vspDetails.getId());
 
     try (InputStream zipFileManifest = contentMap.getFileContent(SdcCommon.MANIFEST_NAME)) {
       HeatFileAnalyzer heatFileAnalyzer = new HeatFileAnalyzerRowDataImpl();
       AnalyzedZipHeatFiles analyzedZipHeatFiles =
-              heatFileAnalyzer.analyzeFilesNotEligibleForModulesFromFileAnalyzer(contentMap.getFiles());
+          heatFileAnalyzer.analyzeFilesNotEligibleForModulesFromFileAnalyzer(contentMap.getFiles());
       HeatStructureTree tree = getHeatStructureTree(vspDetails, contentMap, analyzedZipHeatFiles);
 
       CandidateDataEntityTo candidateDataEntityTo =
-              new CandidateDataEntityTo(vspDetails.getId(), user, uploadedFileData, tree, contentMap,
-                      vspDetails.getVersion());
+          new CandidateDataEntityTo(vspDetails.getId(), vspDetails.getVersion(), uploadedFileData,
+              tree, contentMap);
       candidateDataEntityTo.setErrors(uploadErrors);
       OrchestrationTemplateCandidateData candidateDataEntity =
-              candidateService.createCandidateDataEntity(candidateDataEntityTo, zipFileManifest,
-                      analyzedZipHeatFiles);
+          candidateService.createCandidateDataEntity(candidateDataEntityTo, zipFileManifest,
+              analyzedZipHeatFiles);
 
       MDC_DATA_DEBUG_MESSAGE.debugExitMessage("VSP Id", vspDetails.getId());
       return candidateDataEntity;
@@ -81,7 +81,8 @@
 
   private HeatStructureTree getHeatStructureTree(VspDetails vspDetails,
                                                  FileContentHandler contentMap,
-                                                 AnalyzedZipHeatFiles analyzedZipHeatFiles) throws IOException {
+                                                 AnalyzedZipHeatFiles analyzedZipHeatFiles)
+      throws IOException {
     addManifestToFileContentMapIfNotExist(vspDetails, contentMap, analyzedZipHeatFiles);
     HeatTreeManager heatTreeManager = HeatTreeManagerUtil.initHeatTreeManager(contentMap);
     heatTreeManager.createTree();
@@ -90,21 +91,22 @@
 
   private void addManifestToFileContentMapIfNotExist(VspDetails vspDetails,
                                                      FileContentHandler fileContentHandler,
-                                                     AnalyzedZipHeatFiles analyzedZipHeatFiles) throws IOException {
+                                                     AnalyzedZipHeatFiles analyzedZipHeatFiles)
+      throws IOException {
     MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("VSP Id", vspDetails.getId());
 
     try (InputStream manifest = fileContentHandler.getFileContent(SdcCommon.MANIFEST_NAME)) {
 
       if (Objects.isNull(manifest)) {
         Optional<ManifestContent> manifestContentOptional =
-                candidateService.createManifest(vspDetails, fileContentHandler, analyzedZipHeatFiles);
+            candidateService.createManifest(vspDetails, fileContentHandler, analyzedZipHeatFiles);
         if (!manifestContentOptional.isPresent()) {
           throw new RuntimeException(Messages.CREATE_MANIFEST_FROM_ZIP.getErrorMessage());
         }
         ManifestContent manifestContent = manifestContentOptional.get();
         fileContentHandler.addFile(
-                SdcCommon.MANIFEST_NAME,
-                String.valueOf(JsonUtil.sbObject2Json(manifestContent)).getBytes());
+            SdcCommon.MANIFEST_NAME,
+            String.valueOf(JsonUtil.sbObject2Json(manifestContent)).getBytes());
       }
     } finally {
       MDC_DATA_DEBUG_MESSAGE.debugExitMessage("VSP Id", vspDetails.getId());
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/CandidateDataEntityTo.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/CandidateDataEntityTo.java
index 4ea0a02..cf6e6f7 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/CandidateDataEntityTo.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/CandidateDataEntityTo.java
@@ -31,32 +31,26 @@
 
 public class CandidateDataEntityTo {
   private final String vspId;
-  private final String user;
-//  private final UploadFileResponse uploadFileResponse;
-  private Map<String, List<ErrorMessage>> errors = new HashMap<>();
+  private final Version version;
   private final byte[] uploadedFileData;
   private final HeatStructureTree tree;
-  private final Version activeVersion;
   private final FileContentHandler contentMap;
+  private Map<String, List<ErrorMessage>> errors = new HashMap<>();
 
   /**
    * Instantiates a new Candidate data entity to.
-   *  @param vspId              the vsp id
-   * @param user               the user
-   * @param uploadedFileData   the uploaded file data
-   * @param tree               the tree
-   * @param contentMap         the content map
-   * @param activeVersion      the active version
+   *
+   * @param vspId            the vsp id
+   * @param uploadedFileData the uploaded file data
+   * @param tree             the tree
+   * @param contentMap       the content map
    */
-  public CandidateDataEntityTo(String vspId, String user,
-                               byte[] uploadedFileData, HeatStructureTree tree,
-                               FileContentHandler contentMap, Version activeVersion) {
+  public CandidateDataEntityTo(String vspId, Version version, byte[] uploadedFileData,
+                               HeatStructureTree tree, FileContentHandler contentMap) {
     this.vspId = vspId;
-    this.user = user;
-    this.errors = errors;
+    this.version = version;
     this.uploadedFileData = uploadedFileData;
     this.tree = tree;
-    this.activeVersion = activeVersion;
     this.contentMap = contentMap;
   }
 
@@ -64,10 +58,6 @@
     return vspId;
   }
 
-  public String getUser() {
-    return user;
-  }
-
   public byte[] getUploadedFileData() {
     return uploadedFileData;
   }
@@ -76,15 +66,19 @@
     return tree;
   }
 
-  public Version getActiveVersion() {
-    return activeVersion;
+  public Version getVersion() {
+    return version;
   }
 
   public FileContentHandler getContentMap() {
     return contentMap;
   }
 
-  public Map<String, List<ErrorMessage>> getErrors() {return errors;}
+  public Map<String, List<ErrorMessage>> getErrors() {
+    return errors;
+  }
 
-  public void setErrors(Map<String, List<ErrorMessage>> errors) {this.errors = errors;}
+  public void setErrors(Map<String, List<ErrorMessage>> errors) {
+    this.errors = errors;
+  }
 }
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/questionnaire/component/compute/GuestOS.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/questionnaire/component/compute/GuestOS.java
index db22b3a..489557c 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/questionnaire/component/compute/GuestOS.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/questionnaire/component/compute/GuestOS.java
@@ -26,7 +26,7 @@
 public class GuestOS {
     private String name;
     private String tools;
-    private int bitSize;
+    private Number bitSize;
 
     public String getName() {
         return name;
@@ -44,11 +44,11 @@
         this.tools = tools;
     }
 
-    public int getBitSize() {
+    public Number getBitSize() {
         return bitSize;
     }
 
-    public void setBitSize(int bitSize) {
+    public void setBitSize(Number bitSize) {
         this.bitSize = bitSize;
     }
 }
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/questionnaire/component/compute/VmSizing.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/questionnaire/component/compute/VmSizing.java
index fb4aaa6..a6a8b40 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/questionnaire/component/compute/VmSizing.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/questionnaire/component/compute/VmSizing.java
@@ -23,8 +23,8 @@
 public class VmSizing {
     private int numOfCPUs;
     private String fileSystemSizeGB;
-    private int persistentStorageVolumeSize;
-    private int IOOperationsPerSec;
+    private Number persistentStorageVolumeSize;
+    private Number IOOperationsPerSec;
     private String cpuOverSubscriptionRatio;
     private String memoryRAM;
 
@@ -44,19 +44,19 @@
         this.fileSystemSizeGB = fileSystemSizeGB;
     }
 
-    public int getPersistentStorageVolumeSize() {
+    public Number getPersistentStorageVolumeSize() {
         return persistentStorageVolumeSize;
     }
 
-    public void setPersistentStorageVolumeSize(int persistentStorageVolumeSize) {
+    public void setPersistentStorageVolumeSize(Number persistentStorageVolumeSize) {
         this.persistentStorageVolumeSize = persistentStorageVolumeSize;
     }
 
-    public int getIOOperationsPerSec() {
+    public Number getIOOperationsPerSec() {
         return IOOperationsPerSec;
     }
 
-    public void setIOOperationsPerSec(int IOOperationsPerSec) {
+    public void setIOOperationsPerSec(Number IOOperationsPerSec) {
         this.IOOperationsPerSec = IOOperationsPerSec;
     }
 
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/questionnaire/component/general/Image.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/questionnaire/component/general/Image.java
index 09e83b8..e87c0fd 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/questionnaire/component/general/Image.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/questionnaire/component/general/Image.java
@@ -26,8 +26,8 @@
 public class Image {
     private String format;
     private String providedBy;
-    private int bootDiskSizePerVM;
-    private int ephemeralDiskSizePerVM;
+    private Number bootDiskSizePerVM;
+    private Number ephemeralDiskSizePerVM;
 
     public String getFormat() {
         return format;
@@ -45,19 +45,19 @@
         this.providedBy = providedBy;
     }
 
-    public int getBootDiskSizePerVM() {
+    public Number getBootDiskSizePerVM() {
         return bootDiskSizePerVM;
     }
 
-    public void setBootDiskSizePerVM(int bootDiskSizePerVM) {
+    public void setBootDiskSizePerVM(Number bootDiskSizePerVM) {
         this.bootDiskSizePerVM = bootDiskSizePerVM;
     }
 
-    public int getEphemeralDiskSizePerVM() {
+    public Number getEphemeralDiskSizePerVM() {
         return ephemeralDiskSizePerVM;
     }
 
-    public void setEphemeralDiskSizePerVM(int ephemeralDiskSizePerVM) {
+    public void setEphemeralDiskSizePerVM(Number ephemeralDiskSizePerVM) {
         this.ephemeralDiskSizePerVM = ephemeralDiskSizePerVM;
     }
 }
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/questionnaire/component/general/Recovery.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/questionnaire/component/general/Recovery.java
index 4a13829..f1f8017 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/questionnaire/component/general/Recovery.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/questionnaire/component/general/Recovery.java
@@ -24,23 +24,23 @@
  * Created by TALIO on 11/22/2016.
  */
 public class Recovery {
-    private int pointObjective;
-    private int timeObjective;
+    private Number pointObjective;
+    private Number timeObjective;
     private String vmProcessFailuresHandling;
 
-    public int getPointObjective() {
+    public Number getPointObjective() {
         return pointObjective;
     }
 
-    public void setPointObjective(int pointObjective) {
+    public void setPointObjective(Number pointObjective) {
         this.pointObjective = pointObjective;
     }
 
-    public int getTimeObjective() {
+    public Number getTimeObjective() {
         return timeObjective;
     }
 
-    public void setTimeObjective(int timeObjective) {
+    public void setTimeObjective(Number timeObjective) {
         this.timeObjective = timeObjective;
     }
 
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/questionnaire/component/storage/Backup.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/questionnaire/component/storage/Backup.java
index df5bcb0..2357ddf 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/questionnaire/component/storage/Backup.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/questionnaire/component/storage/Backup.java
@@ -27,7 +27,7 @@
     private String backupType;
     private String backupSolution;
     private String backupNIC;
-    private int backupStorageSize;
+    private Number backupStorageSize;
 
     public String getBackupType() {
         return backupType;
@@ -53,11 +53,11 @@
         this.backupNIC = backupNIC;
     }
 
-    public int getBackupStorageSize() {
+    public Number getBackupStorageSize() {
         return backupStorageSize;
     }
 
-    public void setBackupStorageSize(int backupStorageSize) {
+    public void setBackupStorageSize(Number backupStorageSize) {
         this.backupStorageSize = backupStorageSize;
     }
 }
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/questionnaire/component/storage/LogBackup.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/questionnaire/component/storage/LogBackup.java
index cbf1fbe..1b6453a 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/questionnaire/component/storage/LogBackup.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/questionnaire/component/storage/LogBackup.java
@@ -24,24 +24,24 @@
  * Created by TALIO on 11/22/2016.
  */
 public class LogBackup {
-    private int sizeOfLogFiles;
-    private int logBackupFrequency;
+    private Number sizeOfLogFiles;
+    private Number logBackupFrequency;
     private int logRetentionPeriod;
     private String logFileLocation;
 
-    public int getSizeOfLogFiles() {
+    public Number getSizeOfLogFiles() {
         return sizeOfLogFiles;
     }
 
-    public void setSizeOfLogFiles(int sizeOfLogFiles) {
+    public void setSizeOfLogFiles(Number sizeOfLogFiles) {
         this.sizeOfLogFiles = sizeOfLogFiles;
     }
 
-    public int getLogBackupFrequency() {
+    public Number getLogBackupFrequency() {
         return logBackupFrequency;
     }
 
-    public void setLogBackupFrequency(int logBackupFrequency) {
+    public void setLogBackupFrequency(Number logBackupFrequency) {
         this.logBackupFrequency = logBackupFrequency;
     }
 
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/questionnaire/nic/PeakAndAvg.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/questionnaire/nic/PeakAndAvg.java
index 3d80224..1e44327 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/questionnaire/nic/PeakAndAvg.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/questionnaire/nic/PeakAndAvg.java
@@ -25,7 +25,7 @@
  */
 public class PeakAndAvg {
     private int peak;
-    private int avg;
+    private Number avg;
 
     public int getPeak() {
         return peak;
@@ -35,11 +35,11 @@
         this.peak = peak;
     }
 
-    public int getAvg() {
+    public Number getAvg() {
         return avg;
     }
 
-    public void setAvg(int avg) {
+    public void setAvg(Number avg) {
         this.avg = avg;
     }
 }
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/questionnaire/nic/Sizing.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/questionnaire/nic/Sizing.java
index 32a9e5a..4160cba 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/questionnaire/nic/Sizing.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/questionnaire/nic/Sizing.java
@@ -25,7 +25,7 @@
  */
 public class Sizing {
     private String describeQualityOfService;
-    private int acceptablePacketLoss;
+    private Number acceptablePacketLoss;
     private PacketsAndBytes inflowTrafficPerSecond;
     private PacketsAndBytes outflowTrafficPerSecond;
     private PacketsAndBytes flowLength;
@@ -39,11 +39,11 @@
         this.describeQualityOfService = describeQualityOfService;
     }
 
-    public int getAcceptablePacketLoss() {
+    public Number getAcceptablePacketLoss() {
         return acceptablePacketLoss;
     }
 
-    public void setAcceptablePacketLoss(int acceptablePacketLoss) {
+    public void setAcceptablePacketLoss(Number acceptablePacketLoss) {
         this.acceptablePacketLoss = acceptablePacketLoss;
     }
 
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/questionnaire/vsp/general/StorageDataReplication.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/questionnaire/vsp/general/StorageDataReplication.java
index 7c073af..cf48703 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/questionnaire/vsp/general/StorageDataReplication.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/questionnaire/vsp/general/StorageDataReplication.java
@@ -25,8 +25,8 @@
  */
 public class StorageDataReplication {
     private boolean storageReplicationAcrossRegion;
-    private int storageReplicationSize;
-    private int storageReplicationFrequency;
+    private Number storageReplicationSize;
+    private Number storageReplicationFrequency;
     private String storageReplicationSource;
     private String storageReplicationDestination;
 
@@ -38,19 +38,19 @@
         this.storageReplicationDestination = storageReplicationDestination;
     }
 
-    public int getStorageReplicationSize() {
+    public Number getStorageReplicationSize() {
         return storageReplicationSize;
     }
 
-    public void setStorageReplicationSize(int storageReplicationSize) {
+    public void setStorageReplicationSize(Number storageReplicationSize) {
         this.storageReplicationSize = storageReplicationSize;
     }
 
-    public int getStorageReplicationFrequency() {
+    public Number getStorageReplicationFrequency() {
         return storageReplicationFrequency;
     }
 
-    public void setStorageReplicationFrequency(int storageReplicationFrequency) {
+    public void setStorageReplicationFrequency(Number storageReplicationFrequency) {
         this.storageReplicationFrequency = storageReplicationFrequency;
     }
 
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/resources/factoryConfiguration.json b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/resources/factoryConfiguration.json
index 52c6119..90160c4 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/resources/factoryConfiguration.json
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/resources/factoryConfiguration.json
@@ -1,8 +1,6 @@
 {
-  "org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDaoFactory": "org.openecomp.sdc.vendorsoftwareproduct.dao.impl.VendorSoftwareProductDaoFactoryImpl",
   "org.openecomp.sdc.vendorsoftwareproduct.dao.VspDaoFactory": "org.openecomp.sdc.vendorsoftwareproduct.dao.impl.VspDaoFactoryImpl",
   "org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDaoFactory": "org.openecomp.sdc.vendorsoftwareproduct.dao.impl.VendorSoftwareProductInfoDaoFactoryImpl",
-  "org.openecomp.sdc.vendorsoftwareproduct.dao.UploadDataDaoFactory": "org.openecomp.sdc.vendorsoftwareproduct.dao.impl.UploadDataDaoFactoryImpl",
   "org.openecomp.sdc.vendorsoftwareproduct.dao.OrchestrationTemplateCandidateDaoFactory": "org.openecomp.sdc.vendorsoftwareproduct.dao.impl.OrchestrationTemplateCandidateDaoFactoryImpl",
   "org.openecomp.sdc.vendorsoftwareproduct.dao.OrchestrationTemplateDaoFactory": "org.openecomp.sdc.vendorsoftwareproduct.dao.impl.OrchestrationTemplateDaoFactoryImpl",
   "org.openecomp.sdc.vendorsoftwareproduct.dao.PackageInfoDaoFactory": "org.openecomp.sdc.vendorsoftwareproduct.dao.impl.PackageInfoDaoFactoryImpl",
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ComponentDependencyModelDaoCassandraImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ComponentDependencyModelDaoCassandraImpl.java
index aa611c0..2fcbc1a 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ComponentDependencyModelDaoCassandraImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ComponentDependencyModelDaoCassandraImpl.java
@@ -52,12 +52,6 @@
   }
 
   @Override
-  public void deleteAll(String vspId, Version version) {
-    accessor.deleteAll(vspId, versionMapper.toUDT(version));
-  }
-
-
-  @Override
   public void registerVersioning(String versionableEntityType) {
     VersionableEntityMetadata metadata = new VersionableEntityMetadata(
         mapper.getTableMetadata().getName(),
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/PackageInfoDaoImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/PackageInfoDaoImpl.java
index 0b29fda..41ab1a3 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/PackageInfoDaoImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/PackageInfoDaoImpl.java
@@ -20,10 +20,8 @@
 
 package org.openecomp.sdc.vendorsoftwareproduct.dao.impl;
 
-import com.datastax.driver.core.UDTValue;
 import com.datastax.driver.mapping.Mapper;
 import com.datastax.driver.mapping.Result;
-import com.datastax.driver.mapping.UDTMapper;
 import com.datastax.driver.mapping.annotations.Accessor;
 import com.datastax.driver.mapping.annotations.Query;
 import org.openecomp.core.dao.impl.CassandraBaseDao;
@@ -32,9 +30,7 @@
 import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.PackageInfoDao;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.PackageInfo;
-import org.openecomp.sdc.versioning.dao.types.Version;
 
-import java.nio.ByteBuffer;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
@@ -46,8 +42,6 @@
       noSqlDb.getMappingManager().mapper(PackageInfo.class);
   private static final PackageInfoAccessor accessor =
       noSqlDb.getMappingManager().createAccessor(PackageInfoAccessor.class);
-  private static final UDTMapper<Version> versionMapper =
-      noSqlDb.getMappingManager().udtMapper(Version.class);
 
   private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage();
 
@@ -58,7 +52,7 @@
 
   @Override
   protected Object[] getKeys(PackageInfo entity) {
-    return new Object[]{entity.getVspId(), versionMapper.toUDT(entity.getVersion())};
+    return new Object[]{entity.getVspId(), entity.getVersion()};
   }
 
   @Override
@@ -68,8 +62,7 @@
 
   @Override
   public List<PackageInfo> listByCategory(String category, String subCategory) {
-
-    mdcDataDebugMessage.debugEntryMessage(null, null);
+    mdcDataDebugMessage.debugEntryMessage(null);
     Result<PackageInfo> packages = accessor.listInfo();
 
     List<PackageInfo> filteredPackages = new ArrayList<>();
@@ -86,20 +79,10 @@
         filteredPackages.add(packageInfo);
       }
     }
-    mdcDataDebugMessage.debugExitMessage(null, null);
+    mdcDataDebugMessage.debugExitMessage(null);
     return filteredPackages;
   }
 
-  @Override
-  public void deleteRowTranslateContent(String vspId, Version version) {
-    accessor.deleteRowTranslateContent(vspId, version);
-  }
-
-  @Override
-  public void updateTranslatedContent(String vspId, Version version, ByteBuffer translateContent){
-    accessor.updateTranslateContent(translateContent, vspId, versionMapper.toUDT(version));
-  }
-
   @Accessor
   interface PackageInfoAccessor {
 
@@ -107,13 +90,5 @@
         "SELECT vsp_id,version,display_name,vsp_name,vsp_description,vendor_name,category"
             + " ,sub_category, vendor_release,package_checksum,package_type FROM package_details")
     Result<PackageInfo> listInfo();
-
-    @Query("DELETE TRANSLATE_CONTENT FROM package_details WHERE vsp_id=? and version=?")
-    Result<PackageInfo> deleteRowTranslateContent(String vspId, Version version);
-
-    @Query("UPDATE package_details set translate_content = ? where vsp_id = ? and version = ?")
-    Result<PackageInfo> updateTranslateContent(ByteBuffer translateContent, String vspId,
-                                               UDTValue version);
-
   }
 }
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ProcessDaoFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ProcessDaoFactoryImpl.java
index ada76e7..0205446 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ProcessDaoFactoryImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ProcessDaoFactoryImpl.java
@@ -21,8 +21,8 @@
 package org.openecomp.sdc.vendorsoftwareproduct.dao.impl;
 
 import org.openecomp.core.zusammen.api.ZusammenAdaptorFactory;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.ProcessDaoFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.ProcessDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.ProcessDaoFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.ProcessDaoZusammenImpl;
 
 public class ProcessDaoFactoryImpl extends ProcessDaoFactory {
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VendorSoftwareProductDaoImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VendorSoftwareProductDaoImpl.java
deleted file mode 100644
index 832f36b..0000000
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VendorSoftwareProductDaoImpl.java
+++ /dev/null
@@ -1,323 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * 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=========================================================
- */
-
-package org.openecomp.sdc.vendorsoftwareproduct.dao.impl;
-
-import org.openecomp.core.model.dao.EnrichedServiceArtifactDao;
-import org.openecomp.core.model.dao.EnrichedServiceArtifactDaoFactory;
-import org.openecomp.core.model.dao.EnrichedServiceModelDao;
-import org.openecomp.core.model.dao.EnrichedServiceModelDaoFactory;
-import org.openecomp.core.model.dao.ServiceArtifactDaoFactory;
-import org.openecomp.core.model.dao.ServiceArtifactDaoInter;
-import org.openecomp.core.model.dao.ServiceModelDao;
-import org.openecomp.core.model.dao.ServiceModelDaoFactory;
-import org.openecomp.core.model.dao.ServiceTemplateDaoFactory;
-import org.openecomp.core.model.dao.ServiceTemplateDaoInter;
-import org.openecomp.core.utilities.CommonMethods;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDao;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDaoFactory;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDependencyModelDao;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDependencyModelDaoFactory;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.ComputeDao;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.ComputeDaoFactory;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.DeploymentFlavorDao;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.DeploymentFlavorDaoFactory;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.ImageDao;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.ImageDaoFactory;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.NetworkDao;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.NetworkDaoFactory;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.NicDao;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.NicDaoFactory;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.OrchestrationTemplateCandidateDao;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.OrchestrationTemplateCandidateDaoFactory;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.PackageInfoDao;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.PackageInfoDaoFactory;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.ProcessDao;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.ProcessDaoFactory;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDao;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDaoFactory;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentDependencyModelEntity;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComputeEntity;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.DeploymentFlavorEntity;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ImageEntity;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity;
-import org.openecomp.sdc.versioning.dao.types.Version;
-
-import java.nio.ByteBuffer;
-import java.util.Collection;
-import java.util.List;
-
-public class VendorSoftwareProductDaoImpl implements VendorSoftwareProductDao {
-
-  private static final VendorSoftwareProductInfoDao vspInfoDao = VendorSoftwareProductInfoDaoFactory
-      .getInstance().createInterface();
-  private static final PackageInfoDao packageInfoDao =
-      PackageInfoDaoFactory.getInstance().createInterface();
-  private static final OrchestrationTemplateCandidateDao orchestrationTemplateCandidateDataDao =
-      OrchestrationTemplateCandidateDaoFactory.getInstance().createInterface();
-  private static final NetworkDao networkDao = NetworkDaoFactory.getInstance().createInterface();
-  private static final ComponentDao componentDao =
-      ComponentDaoFactory.getInstance().createInterface();
-  private static final NicDao nicDao = NicDaoFactory.getInstance().createInterface();
-  private static final ProcessDao processDao = ProcessDaoFactory.getInstance().createInterface();
-  private static final ServiceArtifactDaoInter
-      artifactDao = ServiceArtifactDaoFactory.getInstance().createInterface();
-  public static final ServiceTemplateDaoInter
-      templateDao = ServiceTemplateDaoFactory.getInstance().createInterface();
-  private static final EnrichedServiceArtifactDao enrichArtifactDao =
-      EnrichedServiceArtifactDaoFactory.getInstance().createInterface();
-  private static final EnrichedServiceModelDao enrichedServiceModelDao =
-      EnrichedServiceModelDaoFactory.getInstance().createInterface();
-  private static final ServiceModelDao serviceModelDao =
-      ServiceModelDaoFactory.getInstance().createInterface();
-  private static final ComponentDependencyModelDao componentDependencyModelDao =
-      ComponentDependencyModelDaoFactory.getInstance().createInterface();
-  private static final DeploymentFlavorDao
-      deploymentFlavorDao = DeploymentFlavorDaoFactory.getInstance().createInterface();
-  private static final ImageDao imageDao = ImageDaoFactory.getInstance().createInterface();
-  private static final ComputeDao computeDao = ComputeDaoFactory.getInstance().createInterface();
-
-
-  @Override
-  public void registerVersioning(String versionableEntityType) {
-    vspInfoDao.registerVersioning(versionableEntityType);
-    networkDao.registerVersioning(versionableEntityType);
-    componentDao.registerVersioning(versionableEntityType);
-    nicDao.registerVersioning(versionableEntityType);
-    processDao.registerVersioning(versionableEntityType);
-    orchestrationTemplateCandidateDataDao.registerVersioning(versionableEntityType);
-    componentDependencyModelDao.registerVersioning(versionableEntityType);
-    computeDao.registerVersioning(versionableEntityType);
-    deploymentFlavorDao.registerVersioning(versionableEntityType);
-    imageDao.registerVersioning(versionableEntityType);
-  }
-
-  @Override
-  public Collection<ComponentEntity> listComponents(String vspId, Version version) {
-    return componentDao.list(new ComponentEntity(vspId, version, null));
-  }
-
-  @Override
-  public Collection<ComponentEntity> listComponentsQuestionnaire(String vspId, Version version) {
-    return componentDao.listQuestionnaires(vspId, version);
-  }
-
-  @Override
-  public Collection<ComponentEntity> listComponentsCompositionAndQuestionnaire(String vspId,
-                                                                               Version version) {
-    return componentDao.listCompositionAndQuestionnaire(vspId, version);
-  }
-
-  @Override
-  public Collection<ProcessEntity> listProcesses(String vspId, Version version,
-                                                 String componentId) {
-    return processDao.list(new ProcessEntity(vspId, version, componentId, null));
-  }
-
-  @Override
-  public void deleteProcesses(String vspId, Version version, String componentId) {
-    processDao.delete(new ProcessEntity(vspId, version, componentId, null));
-  }
-
-  @Override
-  public ProcessEntity getProcess(String vspId, Version version, String componentId,
-                                  String processId) {
-    return processDao.get(new ProcessEntity(vspId, version, componentId, processId));
-  }
-
-  @Override
-  public void createProcess(ProcessEntity processEntity) {
-    processDao.create(processEntity);
-  }
-
-  @Override
-  public void updateProcess(ProcessEntity processEntity) {
-    ProcessEntity process = processDao.get(new ProcessEntity(processEntity.getVspId(), processEntity.getVersion(),
-            processEntity.getComponentId(), processEntity.getId()));
-    processEntity.setArtifact(process.getArtifact());
-    processEntity.setArtifactName(process.getArtifactName());
-    processDao.update(processEntity);
-  }
-
-  @Override
-  public void deleteProcess(String vspId, Version version, String componentId, String processId) {
-    processDao.delete(new ProcessEntity(vspId, version, componentId, processId));
-  }
-
-  @Override
-  public void uploadProcessArtifact(String vspId, Version version, String componentId,
-                                    String processId, byte[] artifact, String artifactName) {
-    ProcessEntity
-        processArtifact = new ProcessEntity(vspId, version, componentId, processId);
-    processArtifact = processDao.get(processArtifact);
-    processArtifact.setArtifact(ByteBuffer.wrap(artifact));
-    processArtifact.setArtifactName(artifactName);
-    processDao.update(processArtifact);
-  }
-
-  @Override
-  public ProcessEntity getProcessArtifact(String vspId, Version version, String componentId,
-                                          String processId) {
-    return processDao
-        .get(new ProcessEntity(vspId, version, componentId, processId));
-  }
-
-  @Override
-  public void deleteProcessArtifact(String vspId, Version version, String componentId,
-                                    String processId) {
-    processDao.delete(new ProcessEntity(vspId, version, componentId, processId));
-  }
-
-  @Override
-  public Collection<NicEntity> listNicsByVsp(String vspId, Version version) {
-    return nicDao.listByVsp(vspId, version);
-  }
-
-  @Override
-  public void deleteUploadData(String vspId, Version version) {
-    networkDao.deleteAll(vspId, version);
-    enrichedServiceModelDao.deleteAll(vspId, version);
-    serviceModelDao.deleteAll(vspId, version);
-    componentDao.deleteAll(vspId, version);
-  }
-
-  @Override
-  public void createComponentDependencyModel(List<ComponentDependencyModelEntity>
-                                                 componentDependencyModel, String vspId,
-                                             Version version) {
-    componentDependencyModelDao.deleteAll(vspId, version);
-    for (ComponentDependencyModelEntity entity : componentDependencyModel) {
-      entity.setId(CommonMethods.nextUuId());
-      componentDependencyModelDao.create(entity);
-    }
-  }
-
-  @Override
-  public Collection<ComponentDependencyModelEntity> listComponentDependencies(String vspId,
-                                                                              Version version) {
-    return componentDependencyModelDao.list(new ComponentDependencyModelEntity(vspId, version,
-        null));
-  }
-
-  @Override
-  public void createDeploymentFlavor(DeploymentFlavorEntity deploymentFlavor) {
-    deploymentFlavorDao.create(deploymentFlavor);
-  }
-
-  @Override
-  public Collection<DeploymentFlavorEntity> listDeploymentFlavors(String vspId, Version version) {
-    return deploymentFlavorDao.list(new DeploymentFlavorEntity(vspId, version, null));
-  }
-
-  @Override
-  public DeploymentFlavorEntity getDeploymentFlavor(String vspId, Version version,
-                                                    String deploymentFlavorId) {
-    return deploymentFlavorDao.get(new DeploymentFlavorEntity(vspId, version, deploymentFlavorId));
-  }
-
-  @Override
-  public void deleteDeploymentFlavor(String vspId, Version version, String deploymentFlavorId) {
-    deploymentFlavorDao.delete(new DeploymentFlavorEntity(vspId,version,
-        deploymentFlavorId));
-  }
-
-  @Override
-  public void createImage(ImageEntity imageEntity) {
-    imageDao.create(imageEntity);
-  }
-
-  @Override
-  public Collection<ImageEntity> listImages(String vspId, Version version, String componentId) {
-    return imageDao.list(new ImageEntity(vspId, version, componentId, null));
-  }
-
-  @Override
-  public ImageEntity getImage(String vspId, Version version, String componentId, String imageId) {
-    return imageDao.get(new ImageEntity(vspId, version, componentId, imageId));
-  }
-
-  @Override
-  public Collection<ImageEntity> listImagesByVsp(String vspId, Version version) {
-    return imageDao.listByVsp(vspId, version);
-  }
-
-  @Override
-  public void createCompute(ComputeEntity computeEntity) {
-    computeDao.create(computeEntity);
-  }
-
-  @Override
-  public Collection<ComputeEntity> listComputes(String vspId, Version version, String componentId) {
-    return computeDao.list(new ComputeEntity(vspId, version, componentId, null));
-  }
-
-  @Override
-  public Collection<ComputeEntity> listComputesByVsp(String vspId, Version version) {
-    return computeDao.listByVsp(vspId, version);
-  }
-
-  @Override
-  public ComputeEntity getCompute(String vspId, Version version, String componentId,
-                                  String computeFlavorId) {
-    return computeDao.get(new ComputeEntity(vspId, version, componentId, computeFlavorId));
-  }
-
-  @Override
-  public void deleteImage(String vspId, Version version, String componentId, String imageId) {
-    ImageEntity imageEntity = new ImageEntity(vspId, version, componentId, imageId);
-    imageDao.delete(imageEntity);
-  }
-
-  @Override
-  public void updateDeploymentFlavor(DeploymentFlavorEntity deploymentFlavorEntity) {
-    deploymentFlavorDao.update(deploymentFlavorEntity);
-  }
-
-  @Override
-  public void updateImage(ImageEntity imageEntity) {
-    imageDao.update(imageEntity);
-  }
-
-  @Override
-  public void updateImageQuestionnaire(String vspId, Version version, String componentId,
-                                       String imageId, String questionnaireData) {
-    imageDao.updateQuestionnaireData(vspId, version, componentId, imageId, questionnaireData);
-  }
-
-  @Override
-  public void updateComputeQuestionnaire(String vspId, Version version, String componentId,
-                                         String computeId, String questionnaireData) {
-    computeDao.updateQuestionnaireData(vspId, version, componentId, computeId, questionnaireData);
-  }
-
-  @Override
-  public void updateCompute(ComputeEntity compute) {
-    computeDao.update(compute);
-  }
-
-  @Override
-  public void deleteCompute(String vspId, Version version, String componentId, String
-      computeFlavorId) {
-    computeDao.delete(new ComputeEntity(vspId, version, componentId, computeFlavorId));
-  }
-}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VendorSoftwareProductInfoDaoImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VendorSoftwareProductInfoDaoImpl.java
index d9b629c..fef49c8 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VendorSoftwareProductInfoDaoImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VendorSoftwareProductInfoDaoImpl.java
@@ -73,32 +73,17 @@
   }
 
   @Override
-  public void updateOldVersionIndication(VspDetails vspDetails) {
-
-  }
-
-  @Override
   public void updateQuestionnaireData(String vspId, Version version,
                                       String questionnaireData) {
 
   }
 
   @Override
-  public String getQuestionnaireData(String vspId, Version version) {
-    return null;
-  }
-
-  @Override
   public VspQuestionnaireEntity getQuestionnaire(String vspId, Version version) {
     return null;
   }
 
   @Override
-  public void deleteAll(String vspId, Version version) {
-
-  }
-
-  @Override
   public boolean isManual(String vspId, Version version) {
     return false;
   }
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VspMergeDaoFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VspMergeDaoFactoryImpl.java
new file mode 100644
index 0000000..478681f
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VspMergeDaoFactoryImpl.java
@@ -0,0 +1,17 @@
+package org.openecomp.sdc.vendorsoftwareproduct.dao.impl;
+
+
+import org.openecomp.core.zusammen.api.ZusammenAdaptorFactory;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.VspMergeDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.VspMergeDaoFactory;
+
+public class VspMergeDaoFactoryImpl extends VspMergeDaoFactory {
+
+  private static final VspMergeDao INSTANCE = new
+      VspMergeDaoImpl(ZusammenAdaptorFactory.getInstance().createInterface());
+
+  @Override
+  public VspMergeDao createInterface() {
+    return INSTANCE;
+  }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VspMergeDaoImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VspMergeDaoImpl.java
new file mode 100644
index 0000000..2ccc47a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VspMergeDaoImpl.java
@@ -0,0 +1,158 @@
+package org.openecomp.sdc.vendorsoftwareproduct.dao.impl;
+
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.ElementInfo;
+import com.amdocs.zusammen.datatypes.Id;
+import com.amdocs.zusammen.datatypes.SessionContext;
+import com.amdocs.zusammen.datatypes.item.Action;
+import com.amdocs.zusammen.datatypes.item.ElementContext;
+import com.amdocs.zusammen.datatypes.item.Resolution;
+import com.datastax.driver.core.ResultSet;
+import com.datastax.driver.core.Row;
+import com.datastax.driver.mapping.annotations.Accessor;
+import com.datastax.driver.mapping.annotations.Query;
+import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
+import org.openecomp.core.zusammen.api.ZusammenAdaptor;
+import org.openecomp.sdc.common.session.SessionContextProviderFactory;
+import org.openecomp.sdc.datatypes.model.ElementType;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.VspMergeDao;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+import static org.openecomp.core.zusammen.api.ZusammenUtil.buildElement;
+import static org.openecomp.core.zusammen.api.ZusammenUtil.createSessionContext;
+
+public class VspMergeDaoImpl implements VspMergeDao {
+  private static final String VSP_MODEL_NOT_EXIST =
+      "Vsp model does not exist for Vsp %s, version %s.";
+
+  private static VspMergeHintAccessor accessor =
+      NoSqlDbFactory.getInstance().createInterface()
+          .getMappingManager().createAccessor(VspMergeHintAccessor.class);
+
+  private ZusammenAdaptor zusammenAdaptor;
+
+  public VspMergeDaoImpl(ZusammenAdaptor zusammenAdaptor) {
+    this.zusammenAdaptor = zusammenAdaptor;
+  }
+
+  @Override
+  public boolean isVspModelConflicted(String vspId, Version version) {
+    SessionContext context = createSessionContext();
+    ElementContext elementContext = new ElementContext(new Id(vspId), new Id(version.getId()));
+
+    return listVspModels(context, elementContext).size() > 1;
+  }
+
+  @Override
+  public void updateVspModelId(String vspId, Version version) {
+    SessionContext context = createSessionContext();
+    ElementContext elementContext = new ElementContext(new Id(vspId), new Id(version.getId()));
+
+    String vspModelId = zusammenAdaptor
+        .getElementInfoByName(context, elementContext, null, ElementType.VspModel.name())
+        .orElseThrow(() -> new IllegalStateException(
+            String.format(VSP_MODEL_NOT_EXIST, vspId, version.getId())))
+        .getId().getValue();
+
+    updateVspModelId(vspId, version, vspModelId);
+  }
+
+  @Override
+  public void updateVspModelConflictResolution(String vspId, Version version,
+                                               Resolution resolution) {
+    accessor.updateModelResolution(resolution, getUser(), vspId, version.getId());
+  }
+
+  @Override
+  public void applyVspModelConflictResolution(String vspId, Version version) {
+    //called only when no conflicts
+
+    SessionContext context = createSessionContext();
+    ElementContext elementContext = new ElementContext(new Id(vspId), new Id(version.getId()));
+
+    List<ElementInfo> vspModels = listVspModels(context, elementContext);
+    if (vspModels.size() == 1) {
+      updateVspModelId(vspId, version, vspModels.iterator().next().getId().getValue());
+      return;
+    }
+
+    if (vspModels.size() != 2) {
+      return;
+    }
+
+    String user = getUser();
+    Row row = accessor.getModelMergeHint(user, vspId, version.getId()).one();
+    if (row == null) {
+      throw new IllegalStateException(
+          "Vsp model id must exists if its conflict is being resolved");
+    }
+    String resolutionValue = row.getString("model_resolution");
+    if (resolutionValue == null) {
+      return; // model conflict is not resolved yet
+    }
+
+    Resolution resolution = Resolution.valueOf(resolutionValue);
+    String localModelId = row.getString("model_id");
+
+    String chosenModelId =
+        keepOnlyChosenVspModel(context, elementContext, vspModels, resolution, localModelId);
+
+    accessor.updateModelMergeHint(chosenModelId, null, user, vspId, version.getId());
+  }
+
+  private String keepOnlyChosenVspModel(SessionContext context, ElementContext elementContext,
+                                        List<ElementInfo> vspModels, Resolution resolution,
+                                        String localModelId) {
+    String newLocalModelId = null;
+    for (ElementInfo vspModel : vspModels) {
+      if (isRedundantModel(vspModel.getId().getValue(), localModelId, resolution)) {
+        zusammenAdaptor
+            .saveElement(context, elementContext, buildElement(vspModel.getId(), Action.DELETE),
+                "Delete Redundant Vsp Model");
+      } else {
+        newLocalModelId = vspModel.getId().getValue();
+      }
+    }
+    return newLocalModelId;
+  }
+
+  private boolean isRedundantModel(String modelId, String localModelId, Resolution resolution) {
+    return resolution == Resolution.THEIRS && modelId.equals(localModelId) ||
+        resolution == Resolution.YOURS && !modelId.equals(localModelId);
+  }
+
+  private List<ElementInfo> listVspModels(SessionContext context, ElementContext elementContext) {
+    return zusammenAdaptor.listElements(context, elementContext, null).stream()
+        .filter(elementInfo -> ElementType.VspModel.name().equals(elementInfo.getInfo().getName()))
+        .collect(Collectors.toList());
+  }
+
+  private void updateVspModelId(String vspId, Version version, String vspModelId) {
+    accessor.updateModelMergeHint(vspModelId, null, getUser(), vspId, version.getId());
+  }
+
+  private String getUser() {
+    return SessionContextProviderFactory.getInstance().createInterface()
+        .get().getUser().getUserId();
+  }
+
+  @Accessor
+  interface VspMergeHintAccessor {
+
+    @Query("UPDATE vsp_merge_hint SET model_id=?, model_resolution=? " +
+        "WHERE space=? AND item_id=? AND version_id=?")
+    void updateModelMergeHint(String vspModelId, Resolution modelResolution, String space,
+                              String itemId, String versionId);
+
+    @Query(
+        "UPDATE vsp_merge_hint SET model_resolution=? WHERE space=? AND item_id=? AND version_id=?")
+    void updateModelResolution(Resolution modelResolution, String space, String itemId,
+                               String versionId);
+
+    @Query("SELECT model_id, model_resolution FROM vsp_merge_hint " +
+        "WHERE space=? AND item_id=? AND version_id=?")
+    ResultSet getModelMergeHint(String space, String itemId, String versionId);
+  }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/ComponentArtifactDaoZusammenImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/ComponentArtifactDaoZusammenImpl.java
index 517f2fd..01be738 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/ComponentArtifactDaoZusammenImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/ComponentArtifactDaoZusammenImpl.java
@@ -1,7 +1,6 @@
 package org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen;
 
 import com.amdocs.zusammen.adaptor.inbound.api.types.item.Element;
-import com.amdocs.zusammen.adaptor.inbound.api.types.item.ElementInfo;
 import com.amdocs.zusammen.adaptor.inbound.api.types.item.ZusammenElement;
 import com.amdocs.zusammen.datatypes.Id;
 import com.amdocs.zusammen.datatypes.SessionContext;
@@ -10,10 +9,10 @@
 import org.openecomp.core.enrichment.types.MonitoringUploadType;
 import org.openecomp.core.utilities.file.FileUtils;
 import org.openecomp.core.zusammen.api.ZusammenAdaptor;
-import org.openecomp.core.zusammen.api.ZusammenUtil;
+import org.openecomp.sdc.datatypes.model.ElementType;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentArtifactDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.convertor.ElementToComponentMonitoringUploadConvertor;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentMonitoringUploadEntity;
-import org.openecomp.sdc.versioning.dao.types.Version;
 
 import java.io.ByteArrayInputStream;
 import java.nio.ByteBuffer;
@@ -21,13 +20,17 @@
 import java.util.Optional;
 import java.util.stream.Collectors;
 
+import static org.openecomp.core.zusammen.api.ZusammenUtil.buildElement;
+import static org.openecomp.core.zusammen.api.ZusammenUtil.buildStructuralElement;
+import static org.openecomp.core.zusammen.api.ZusammenUtil.createSessionContext;
+
 /**
  * @author Avrahamg.
  * @since March 21, 2017
  */
 public class ComponentArtifactDaoZusammenImpl implements ComponentArtifactDao {
 
-  private static final String ARTIFACT_NAME = "name";
+  private static final String ARTIFACT_NAME = "artifactName";
 
   private ZusammenAdaptor zusammenAdaptor;
 
@@ -43,28 +46,25 @@
   @Override
   public Optional<ComponentMonitoringUploadEntity> getByType(
       ComponentMonitoringUploadEntity componentMonitoringUploadEntity) {
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(componentMonitoringUploadEntity.getVspId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor),
-        VspZusammenUtil.getVersionTag(componentMonitoringUploadEntity.getVersion()));
+    SessionContext context = createSessionContext();
+    ElementContext elementContext =
+        new ElementContext(componentMonitoringUploadEntity.getVspId(),
+            componentMonitoringUploadEntity.getVersion().getId());
+
     Optional<Element> mibsElement =
-        zusammenAdaptor.getElementByName(context, elementContext, new Id(
-            componentMonitoringUploadEntity
-            .getComponentId()), StructureElement.Mibs.toString());
+        zusammenAdaptor.getElementByName(context, elementContext,
+            new Id(componentMonitoringUploadEntity.getComponentId()), ElementType.Mibs.toString());
     if (mibsElement.isPresent()) {
       Optional<Element> monitoringElement = zusammenAdaptor
           .getElementByName(context, elementContext, mibsElement.get().getElementId(),
-              getMonitoringStructuralElement(componentMonitoringUploadEntity.getType())
-                  .toString());
+              getMonitoringStructuralElement(componentMonitoringUploadEntity.getType()).toString());
       if (monitoringElement.isPresent()) {
-        componentMonitoringUploadEntity.setId(monitoringElement.get().getElementId().getValue());
-        componentMonitoringUploadEntity
-            .setArtifactName(
-                (String) monitoringElement.get().getInfo().getProperties().get(ARTIFACT_NAME));
-        componentMonitoringUploadEntity
-            .setArtifact(ByteBuffer.wrap(FileUtils.toByteArray(monitoringElement.get().getData())));
-        return Optional.of(componentMonitoringUploadEntity);
+        ComponentMonitoringUploadEntity entity =
+            new ElementToComponentMonitoringUploadConvertor().convert(monitoringElement.get());
+        entity.setVspId(componentMonitoringUploadEntity.getVspId());
+        entity.setVersion(componentMonitoringUploadEntity.getVersion());
+        entity.setComponentId(componentMonitoringUploadEntity.getComponentId());
+        return Optional.of(entity);
       }
     }
 
@@ -75,93 +75,113 @@
   public void create(ComponentMonitoringUploadEntity entity) {
     ZusammenElement mibElement = buildMibElement(entity);
 
-    ZusammenElement mibsElement =
-        VspZusammenUtil.buildStructuralElement(StructureElement.Mibs, null);
+    ZusammenElement mibsElement = buildStructuralElement(ElementType.Mibs, null);
 
-    ZusammenElement componentElement = buildComponentElement(entity);
+    ZusammenElement componentElement = buildElement(new Id(entity.getComponentId()), Action.IGNORE);
 
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(entity.getVspId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor));
+    SessionContext context = createSessionContext();
+    ElementContext elementContext =
+        new ElementContext(entity.getVspId(), entity.getVersion().getId());
 
-    Optional<Element> savedElement = zusammenAdaptor.saveElement(context, elementContext,
+    Element savedElement = zusammenAdaptor.saveElement(context, elementContext,
         VspZusammenUtil.aggregateElements(componentElement, mibsElement, mibElement),
         "Create monitoring upload");
-    savedElement.ifPresent(element ->
-        entity.setId(element.getSubElements().iterator().next()
-            .getSubElements().iterator().next().getElementId().getValue()));
+    entity.setId(savedElement.getSubElements().iterator().next()
+        .getSubElements().iterator().next().getElementId().getValue());
   }
 
   @Override
   public void delete(ComponentMonitoringUploadEntity componentMonitoringUploadEntity) {
-    ZusammenElement mibElement = new ZusammenElement();
-    mibElement.setElementId(new Id(componentMonitoringUploadEntity.getId()));
-    mibElement.setAction(Action.DELETE);
 
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(componentMonitoringUploadEntity.getVspId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor));
+    ZusammenElement mibElement = buildMibElementStructure(componentMonitoringUploadEntity);
+    mibElement.setElementId(new Id(componentMonitoringUploadEntity.getId()));
+    SessionContext context = createSessionContext();
+    ElementContext elementContext =
+        new ElementContext(componentMonitoringUploadEntity.getVspId(),
+            componentMonitoringUploadEntity.getVersion().getId());
 
     zusammenAdaptor.saveElement(context, elementContext, mibElement,
         String.format("Delete mib with id %s", componentMonitoringUploadEntity.getId()));
   }
 
-  @Override
-  public Collection<ComponentMonitoringUploadEntity> list(ComponentMonitoringUploadEntity mib) {
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(mib.getVspId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor),
-        VspZusammenUtil.getVersionTag(mib.getVersion()));
 
-    return zusammenAdaptor.listElementsByName(context, elementContext, new Id(mib.getComponentId()),
-        StructureElement.Mibs.toString()).stream()
-        .map(elementInfo ->
-            mapElementInfoToMib(mib.getVspId(), mib.getVersion(), mib.getComponentId(),
-                elementInfo))
+
+  @Override
+  public Collection<ComponentMonitoringUploadEntity> list(
+      ComponentMonitoringUploadEntity mibEntity) {
+    SessionContext context = createSessionContext();
+    ElementContext elementContext =
+        new ElementContext(mibEntity.getVspId(), mibEntity.getVersion().getId());
+    ElementToComponentMonitoringUploadConvertor
+        convertor = new ElementToComponentMonitoringUploadConvertor();
+    return zusammenAdaptor
+        .listElementsByName(context, elementContext, new Id(mibEntity.getComponentId()),
+            ElementType.Mibs.toString()).stream()
+        .map(elementInfo -> convertor.convert(elementInfo))
+        .map(mib -> {
+          mib.setVspId(mibEntity.getVspId());
+          mib.setVersion(mibEntity.getVersion());
+          mib.setComponentId(mibEntity.getComponentId());
+          return mib;
+        })
         .collect(Collectors.toList());
   }
 
   @Override
   public void deleteAll(ComponentMonitoringUploadEntity componentMonitoringUploadEntity) {
-    ZusammenElement mibsElement =
-        VspZusammenUtil.buildStructuralElement(StructureElement.Mibs, Action.DELETE);
+    /*ZusammenElement mibsElement =
+        buildStructuralElement(ElementType.Mibs, Action.DELETE);
 
     ZusammenElement componentElement = buildComponentElement(componentMonitoringUploadEntity);
 
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(componentMonitoringUploadEntity.getVspId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor));
+    SessionContext context = createSessionContext();
+    ElementContext elementContext =
+        new ElementContext(componentMonitoringUploadEntity.getVspId(),
+            componentMonitoringUploadEntity.getVersion().getId());
 
     zusammenAdaptor.saveElement(context, elementContext,
-        VspZusammenUtil.aggregateElements(componentElement, mibsElement), "Delete mibs");
+        VspaggregateElements(componentElement, mibsElement), "Delete mibs");
+
+*/
+    SessionContext context = createSessionContext();
+    ElementContext elementContext =
+        new ElementContext(componentMonitoringUploadEntity.getVspId(),
+            componentMonitoringUploadEntity.getVersion().getId());
+
+    Optional<Element> optionalElement = zusammenAdaptor.getElementByName(context,
+        elementContext, new Id(componentMonitoringUploadEntity.getComponentId()), ElementType.Mibs
+            .name());
+
+    if (optionalElement.isPresent()) {
+      Element mibsElement = optionalElement.get();
+      Collection<Element> mibs = mibsElement.getSubElements();
+
+      mibs.forEach(mib -> {
+        ZusammenElement mibZusammenElement = buildElement(mib.getElementId(), Action.DELETE);
+        zusammenAdaptor.saveElement(context, elementContext, mibZusammenElement,
+            "Delete mib with id " + mib.getElementId());
+      });
+    }
   }
 
   @Override
   public Collection<ComponentMonitoringUploadEntity> listArtifacts(
       ComponentMonitoringUploadEntity monitoringUploadEntity) {
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(monitoringUploadEntity.getVspId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor),
-        VspZusammenUtil.getVersionTag(monitoringUploadEntity.getVersion()));
+    SessionContext context = createSessionContext();
+    ElementContext elementContext = new ElementContext(monitoringUploadEntity.getVspId(),
+        monitoringUploadEntity.getVersion().getId());
 
     final Optional<Element> elementByName =
         zusammenAdaptor.getElementByName(context, elementContext,
-            new Id(monitoringUploadEntity.getComponentId()
-        ), StructureElement.Mibs.name());
+            new Id(monitoringUploadEntity.getComponentId()), ElementType.Mibs.name());
 
-    if(!elementByName.isPresent())
+    if (!elementByName.isPresent()) {
       return null;
-    else {
+    } else {
       final Id elementId = elementByName.get().getElementId();
       return zusammenAdaptor.listElementData(context, elementContext, elementId).stream()
-          .map(element ->
-              buildMibEntity(element, monitoringUploadEntity)
-          ).collect(Collectors.toList());
+          .map(element -> buildMibEntity(element, monitoringUploadEntity))
+          .collect(Collectors.toList());
     }
   }
 
@@ -179,18 +199,10 @@
     return createdMib;
   }
 
-  private ZusammenElement buildComponentElement(
-      ComponentMonitoringUploadEntity componentMonitoringUploadEntity) {
-    ZusammenElement componentElement = new ZusammenElement();
-    componentElement.setElementId(new Id(componentMonitoringUploadEntity.getComponentId()));
-    componentElement.setAction(Action.IGNORE);
-    return componentElement;
-  }
+  private ZusammenElement buildMibElement(
+      ComponentMonitoringUploadEntity monitoringUploadEntity) {
 
-  private ZusammenElement buildMibElement(ComponentMonitoringUploadEntity monitoringUploadEntity) {
-    ZusammenElement monitoringElement = VspZusammenUtil
-        .buildStructuralElement(getMonitoringStructuralElement(monitoringUploadEntity.getType()),
-            Action.UPDATE);
+    ZusammenElement monitoringElement = buildMibElementStructure(monitoringUploadEntity);
     monitoringElement.getInfo().getProperties()
         .put(ARTIFACT_NAME, monitoringUploadEntity.getArtifactName());
     monitoringElement
@@ -198,27 +210,23 @@
     return monitoringElement;
   }
 
-  private ComponentMonitoringUploadEntity mapElementInfoToMib(String vspId, Version version,
-                                                              String componentId,
-                                                              ElementInfo elementInfo) {
-    ComponentMonitoringUploadEntity
-        monitoringUploadEntity = new ComponentMonitoringUploadEntity(vspId, version, componentId,
-        elementInfo.getId().getValue());
-    monitoringUploadEntity
-        .setArtifactName((String) elementInfo.getInfo().getProperties().get(ARTIFACT_NAME));
-    monitoringUploadEntity.setType(MonitoringUploadType.valueOf(elementInfo.getInfo().getName()));
-    return monitoringUploadEntity;
+  private ZusammenElement buildMibElementStructure(
+      ComponentMonitoringUploadEntity componentMonitoringUploadEntity) {
+    ZusammenElement monitoringElement =
+        buildStructuralElement(getMonitoringStructuralElement(componentMonitoringUploadEntity.getType()),
+            Action.UPDATE);
+    return monitoringElement;
   }
 
-  private StructureElement getMonitoringStructuralElement(MonitoringUploadType type)
+  private ElementType getMonitoringStructuralElement(MonitoringUploadType type)
       throws IllegalArgumentException {
     switch (type) {
       case SNMP_POLL:
-        return StructureElement.SNMP_POLL;
+        return ElementType.SNMP_POLL;
       case SNMP_TRAP:
-        return StructureElement.SNMP_TRAP;
+        return ElementType.SNMP_TRAP;
       case VES_EVENTS:
-        return StructureElement.VES_EVENTS;
+        return ElementType.VES_EVENTS;
       default:
         throw new IllegalArgumentException();
     }
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/ComponentDaoZusammenImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/ComponentDaoZusammenImpl.java
index ed6a13d..e658ea5 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/ComponentDaoZusammenImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/ComponentDaoZusammenImpl.java
@@ -8,20 +8,26 @@
 import com.amdocs.zusammen.datatypes.item.Action;
 import com.amdocs.zusammen.datatypes.item.ElementContext;
 import com.amdocs.zusammen.datatypes.item.Info;
-import org.openecomp.core.utilities.file.FileUtils;
 import org.openecomp.core.zusammen.api.ZusammenAdaptor;
-import org.openecomp.core.zusammen.api.ZusammenUtil;
+import org.openecomp.sdc.datatypes.model.ElementType;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.convertor.ElementToComponentConvertor;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.convertor.ElementToComponentQuestionnnaireConvertor;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity;
 import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.types.ElementPropertyName;
 
 import java.io.ByteArrayInputStream;
-import java.util.Arrays;
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Optional;
 import java.util.stream.Collectors;
 
+import static org.openecomp.core.zusammen.api.ZusammenUtil.buildElement;
+import static org.openecomp.core.zusammen.api.ZusammenUtil.buildStructuralElement;
+import static org.openecomp.core.zusammen.api.ZusammenUtil.createSessionContext;
+
 public class ComponentDaoZusammenImpl implements ComponentDao {
 
   private ZusammenAdaptor zusammenAdaptor;
@@ -36,105 +42,97 @@
 
   @Override
   public Collection<ComponentEntity> list(ComponentEntity component) {
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(component.getVspId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor),
-        VspZusammenUtil.getVersionTag(component.getVersion()));
+    SessionContext context = createSessionContext();
 
-    return listComponents(zusammenAdaptor, context, elementContext, component.getVspId(),
-        component.getVersion());
+    return listComponents(zusammenAdaptor, context, component.getVspId(), component.getVersion());
   }
 
   static Collection<ComponentEntity> listComponents(ZusammenAdaptor zusammenAdaptor,
                                                     SessionContext context,
-                                                    ElementContext elementContext,
                                                     String vspId, Version version) {
-    return zusammenAdaptor
-        .listElementsByName(context, elementContext, null, StructureElement.Components.name())
-        .stream().map(elementInfo -> mapElementInfoToComponent(vspId, version, elementInfo))
+    ElementContext elementContext = new ElementContext(vspId, version.getId());
+
+    Optional<ElementInfo> vspModel = zusammenAdaptor
+        .getElementInfoByName(context, elementContext, null, ElementType.VspModel.name());
+    if (!vspModel.isPresent()) {
+      return new ArrayList<>();
+    }
+
+    ElementToComponentConvertor convertor = new ElementToComponentConvertor();
+    return zusammenAdaptor.listElementsByName(context, elementContext, vspModel.get().getId(),
+        ElementType.Components.name()).stream()
+        .map(elementInfo -> {
+          ComponentEntity entity = convertor.convert(elementInfo);
+          entity.setVspId(vspId);
+          entity.setVersion(version);
+          return entity;
+        })
         .collect(Collectors.toList());
   }
 
-  private static ComponentEntity mapElementInfoToComponent(String vspId, Version version,
-                                                           ElementInfo elementInfo) {
-    ComponentEntity componentEntity =
-        new ComponentEntity(vspId, version, elementInfo.getId().getValue());
-    componentEntity.setCompositionData(
-        elementInfo.getInfo().getProperty(ElementPropertyName.compositionData.name()));
-    return componentEntity;
-  }
 
   @Override
   public void create(ComponentEntity component) {
     ZusammenElement componentElement = componentToZusammen(component, Action.CREATE);
+
     ZusammenElement componentsElement =
-        VspZusammenUtil.buildStructuralElement(StructureElement.Components, null);
+        buildStructuralElement(ElementType.Components, Action.IGNORE);
     componentsElement.getSubElements().add(componentElement);
 
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(component.getVspId());
-    Optional<Element> savedElement = zusammenAdaptor.saveElement(context,
-        new ElementContext(itemId,
-            VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor)),
-        componentsElement, "Create component");
-    savedElement.ifPresent(element ->
-        component.setId(element.getSubElements().iterator().next().getElementId().getValue()));
+    ZusammenElement vspModel = buildStructuralElement(ElementType.VspModel, Action.IGNORE);
+    vspModel.addSubElement(componentsElement);
+
+    SessionContext context = createSessionContext();
+    Element savedVspModel = zusammenAdaptor.saveElement(context,
+        new ElementContext(component.getVspId(), component.getVersion().getId()),
+        vspModel, "Create component");
+    component.setId(savedVspModel.getSubElements().iterator().next()
+        .getSubElements().iterator().next().getElementId().getValue());
   }
 
   @Override
   public void update(ComponentEntity component) {
     ZusammenElement componentElement = componentToZusammen(component, Action.UPDATE);
 
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(component.getVspId());
+    SessionContext context = createSessionContext();
     zusammenAdaptor.saveElement(context,
-        new ElementContext(itemId,
-            VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor)),
+        new ElementContext(component.getVspId(), component.getVersion().getId()),
         componentElement, String.format("Update component with id %s", component.getId()));
   }
 
   @Override
   public ComponentEntity get(ComponentEntity component) {
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(component.getVspId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor),
-        VspZusammenUtil.getVersionTag(component.getVersion()));
+    SessionContext context = createSessionContext();
 
     Optional<Element> element =
-        zusammenAdaptor.getElement(context, elementContext, component.getId());
+        zusammenAdaptor.getElement(context,
+            new ElementContext(component.getVspId(), component.getVersion().getId()),
+            component.getId());
 
     if (element.isPresent()) {
-      component.setCompositionData(new String(FileUtils.toByteArray(element.get().getData())));
-      return component;
+      ComponentEntity entity = new ElementToComponentConvertor().convert(element.get());
+      entity.setVspId(component.getVspId());
+      entity.setVersion(component.getVersion());
+      return entity;
     }
     return null;
   }
 
   @Override
   public void delete(ComponentEntity component) {
-    ZusammenElement componentElement = new ZusammenElement();
-    componentElement.setElementId(new Id(component.getId()));
-    componentElement.setAction(Action.DELETE);
+    ZusammenElement componentElement = buildElement(new Id(component.getId()), Action.DELETE);
 
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(component.getVspId());
+    SessionContext context = createSessionContext();
     zusammenAdaptor.saveElement(context,
-        new ElementContext(itemId,
-            VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor)),
+        new ElementContext(component.getVspId(), component.getVersion().getId()),
         componentElement, String.format("Delete component with id %s", component.getId()));
   }
 
   @Override
   public ComponentEntity getQuestionnaireData(String vspId, Version version, String componentId) {
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(vspId);
-    ElementContext elementContext = new ElementContext(itemId,
-        VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor),
-        VspZusammenUtil.getVersionTag(version));
+    SessionContext context = createSessionContext();
 
-    return getQuestionnaire(context, elementContext,
+    return getQuestionnaire(context, new ElementContext(vspId, version.getId()),
         new ComponentEntity(vspId, version, componentId));
   }
 
@@ -142,14 +140,12 @@
                                            ComponentEntity component) {
     Optional<Element> questionnaireElement = zusammenAdaptor
         .getElementByName(context, elementContext, new Id(component.getId()),
-            StructureElement.Questionnaire.name());
-    return questionnaireElement.map(
-        element -> element.getData() == null
-            ? null
-            : new String(FileUtils.toByteArray(element.getData())))
-        .map(questionnaireData -> {
-          component.setQuestionnaireData(questionnaireData);
-          return component;
+            ElementType.ComponentQuestionnaire.name());
+    return questionnaireElement.map(new ElementToComponentQuestionnnaireConvertor()::convert)
+        .map(entity -> {
+          entity.setVspId(component.getVspId());
+          entity.setVersion(component.getVersion());
+          return entity;
         })
         .orElse(null);
   }
@@ -160,16 +156,11 @@
     ZusammenElement questionnaireElement =
         componentQuestionnaireToZusammen(questionnaireData, Action.UPDATE);
 
-    ZusammenElement componentElement = new ZusammenElement();
-    componentElement.setAction(Action.IGNORE);
-    componentElement.setElementId(new Id(componentId));
+    ZusammenElement componentElement = buildElement(new Id(componentId), Action.IGNORE);
     componentElement.setSubElements(Collections.singletonList(questionnaireElement));
 
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(vspId);
-    zusammenAdaptor.saveElement(context,
-        new ElementContext(itemId,
-            VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor)),
+    SessionContext context = createSessionContext();
+    zusammenAdaptor.saveElement(context, new ElementContext(vspId, version.getId()),
         componentElement, "Update component questionnaire");
   }
 
@@ -181,45 +172,57 @@
   @Override
   public Collection<ComponentEntity> listCompositionAndQuestionnaire(String vspId,
                                                                      Version version) {
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(vspId);
-    ElementContext elementContext = new ElementContext(itemId,
-        VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor),
-        VspZusammenUtil.getVersionTag(version));
+    SessionContext context = createSessionContext();
 
     Collection<ComponentEntity> components =
-        listComponents(zusammenAdaptor, context, elementContext, vspId, version);
+        listComponents(zusammenAdaptor, context, vspId, version);
 
-    components.forEach(component -> getQuestionnaire(context, elementContext, component));
+    ElementContext elementContext = new ElementContext(vspId, version.getId());
+    components.forEach(component -> component.setQuestionnaireData(
+        getQuestionnaire(context, elementContext, component).getQuestionnaireData()));
     return components;
   }
 
   @Override
   public void deleteAll(String vspId, Version version) {
-    ZusammenElement componentsElement =
-        VspZusammenUtil.buildStructuralElement(StructureElement.Components, Action.DELETE);
+    SessionContext context = createSessionContext();
+    ElementContext elementContext = new ElementContext(vspId, version.getId());
 
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(vspId);
-    zusammenAdaptor.saveElement(context,
-        new ElementContext(itemId,
-            VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor)),
-        componentsElement, "Delete all components");
+    Collection<ElementInfo> vspModelSubs = zusammenAdaptor
+        .listElementsByName(context, elementContext, null, ElementType.VspModel.name());
+
+    Optional<ElementInfo> componentsElement = vspModelSubs.stream()
+        .filter(elementInfo -> elementInfo.getInfo() != null
+            && ElementType.Components.name().equals(elementInfo.getInfo().getName()))
+        .findFirst();
+    if (!componentsElement.isPresent()) {
+      return;
+    }
+
+    ZusammenElement components = buildElement(componentsElement.get().getId(), Action.IGNORE);
+    components.setSubElements(componentsElement.get().getSubElements().stream()
+        .map(component -> buildElement(component.getId(), Action.DELETE))
+        .collect(Collectors.toList()));
+
+    zusammenAdaptor.saveElement(context, elementContext, components, "Delete all components");
   }
 
   private ZusammenElement componentToZusammen(ComponentEntity component, Action action) {
     ZusammenElement componentElement = buildComponentElement(component, action);
+
     if (action == Action.CREATE) {
-      componentElement
-          .setSubElements(Arrays.asList(
-              componentQuestionnaireToZusammen(component.getQuestionnaireData(), Action.CREATE),
-              VspZusammenUtil.buildStructuralElement(StructureElement.Nics, Action.CREATE),
-              VspZusammenUtil.buildStructuralElement(StructureElement.Processes, Action.CREATE),
-              VspZusammenUtil.buildStructuralElement(StructureElement.Mibs, Action.CREATE),
-              VspZusammenUtil.buildStructuralElement(StructureElement.Computes, Action.CREATE),
-              VspZusammenUtil.buildStructuralElement(StructureElement.Images, Action.CREATE)));
+      ZusammenElement mibs = buildStructuralElement(ElementType.Mibs, Action.CREATE);
+      mibs.addSubElement(buildStructuralElement(ElementType.SNMP_TRAP, Action.CREATE));
+      mibs.addSubElement(buildStructuralElement(ElementType.VES_EVENTS, Action.CREATE));
+      mibs.addSubElement(buildStructuralElement(ElementType.SNMP_POLL, Action.CREATE));
 
-
+      componentElement.addSubElement(mibs);
+      componentElement.addSubElement(
+          componentQuestionnaireToZusammen(component.getQuestionnaireData(), Action.CREATE));
+      componentElement.addSubElement(buildStructuralElement(ElementType.Nics, Action.CREATE));
+      componentElement.addSubElement(buildStructuralElement(ElementType.Processes, Action.CREATE));
+      componentElement.addSubElement(buildStructuralElement(ElementType.Computes, Action.CREATE));
+      componentElement.addSubElement(buildStructuralElement(ElementType.Images, Action.CREATE));
     }
     return componentElement;
   }
@@ -227,22 +230,21 @@
   private ZusammenElement componentQuestionnaireToZusammen(String questionnaireData,
                                                            Action action) {
     ZusammenElement questionnaireElement =
-        VspZusammenUtil.buildStructuralElement(StructureElement.Questionnaire, action);
+        buildStructuralElement(ElementType.ComponentQuestionnaire, action);
     questionnaireElement.setData(new ByteArrayInputStream(questionnaireData.getBytes()));
     return questionnaireElement;
   }
 
   private ZusammenElement buildComponentElement(ComponentEntity component, Action action) {
-    ZusammenElement componentElement = new ZusammenElement();
-    componentElement.setAction(action);
-    if (component.getId() != null) {
-      componentElement.setElementId(new Id(component.getId()));
-    }
+    ZusammenElement componentElement =
+        buildElement(component.getId() == null ? null : new Id(component.getId()), action);
     Info info = new Info();
-    info.addProperty(ElementPropertyName.type.name(), ElementType.Component);
+    info.addProperty(ElementPropertyName.elementType.name(), ElementType.Component);
     info.addProperty(ElementPropertyName.compositionData.name(), component.getCompositionData());
     componentElement.setInfo(info);
     componentElement.setData(new ByteArrayInputStream(component.getCompositionData().getBytes()));
     return componentElement;
   }
+
+
 }
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/ComponentDependencyModelDaoZusammenImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/ComponentDependencyModelDaoZusammenImpl.java
index e36b6c7..6741d72 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/ComponentDependencyModelDaoZusammenImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/ComponentDependencyModelDaoZusammenImpl.java
@@ -9,17 +9,23 @@
 import com.amdocs.zusammen.datatypes.item.ElementContext;
 import com.amdocs.zusammen.datatypes.item.Info;
 import org.openecomp.core.zusammen.api.ZusammenAdaptor;
-import org.openecomp.core.zusammen.api.ZusammenUtil;
+import org.openecomp.sdc.datatypes.model.ElementType;
 import org.openecomp.sdc.logging.api.Logger;
 import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDependencyModelDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.convertor.ElementToComponentDependencyModelConvertor;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentDependencyModelEntity;
-import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.types.ElementPropertyName;
 
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Optional;
 import java.util.stream.Collectors;
 
+import static org.openecomp.core.zusammen.api.ZusammenUtil.buildElement;
+import static org.openecomp.core.zusammen.api.ZusammenUtil.buildStructuralElement;
+import static org.openecomp.core.zusammen.api.ZusammenUtil.createSessionContext;
+
 /**
  * Created by ayalaben on 5/16/2017.
  */
@@ -35,19 +41,22 @@
   }
 
   @Override
-  public ComponentDependencyModelEntity get(ComponentDependencyModelEntity entity) {
+  public ComponentDependencyModelEntity get(ComponentDependencyModelEntity dependency) {
 
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(entity.getVspId()); // entity.getId()?
-    ElementContext elementContext = new ElementContext(itemId,
-        VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor),
-        VspZusammenUtil.getVersionTag(entity.getVersion()));
+    SessionContext context = createSessionContext();
+    ElementContext elementContext =
+        new ElementContext(dependency.getVspId(), dependency.getVersion().getId());
 
     Optional<ElementInfo> componentDependencyElement =
-        zusammenAdaptor.getElementInfo(context, elementContext, new Id(entity.getId()));
+        zusammenAdaptor.getElementInfo(context, elementContext, new Id(dependency.getId()));
 
     if (componentDependencyElement.isPresent()) {
-      addComponentDependencyData(entity, componentDependencyElement.get());
+      ElementToComponentDependencyModelConvertor convertor = new
+          ElementToComponentDependencyModelConvertor();
+
+      ComponentDependencyModelEntity entity = convertor.convert(componentDependencyElement.get());
+      entity.setVspId(dependency.getVspId());
+      entity.setVersion(dependency.getVersion());
       return entity;
     }
 
@@ -55,70 +64,52 @@
   }
 
   @Override
-  public void create(ComponentDependencyModelEntity entity) {
+  public void create(ComponentDependencyModelEntity dependency) {
+    ZusammenElement componentDependency =
+        buildComponentDependencyElement(dependency, Action.CREATE);
 
     ZusammenElement componentDependencies =
-        VspZusammenUtil.buildStructuralElement(StructureElement.ComponentDependencies, null);
+        buildStructuralElement(ElementType.ComponentDependencies, Action.IGNORE);
+    componentDependencies.addSubElement(componentDependency);
 
-    ZusammenElement componentDependency = buildComponentDependencyElement(entity);
-    componentDependency.setAction(Action.CREATE);
+    ZusammenElement vspModel = buildStructuralElement(ElementType.VspModel, Action.IGNORE);
+    vspModel.addSubElement(componentDependencies);
 
-    Id itemId = new Id(entity.getVspId());
-    SessionContext context = ZusammenUtil.createSessionContext();
-    ElementContext elementContext = new ElementContext(itemId,
-        VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor));
+    SessionContext context = createSessionContext();
+    ElementContext elementContext =
+        new ElementContext(dependency.getVspId(), dependency.getVersion().getId());
 
-    Optional<Element> savedElement = zusammenAdaptor.saveElement(context, elementContext,
-        VspZusammenUtil.aggregateElements(componentDependencies, componentDependency),
-        "Create component dependency model");
+    Element compDepsSavedElement = zusammenAdaptor
+        .saveElement(context, elementContext, vspModel, "Create component dependency model");
 
-    savedElement.ifPresent(element ->
-        entity.setId(element.getSubElements().iterator().next().getElementId().getValue()));
+    dependency.setId(compDepsSavedElement.getSubElements().iterator().next()
+        .getSubElements().iterator().next().getElementId().getValue());
   }
 
   @Override
-  public void update(ComponentDependencyModelEntity entity) {
-    ZusammenElement componentDependencyElement = buildComponentDependencyElement(entity);
-    componentDependencyElement.setAction(Action.UPDATE);
+  public void update(ComponentDependencyModelEntity dependency) {
+    ZusammenElement componentDependencyElement =
+        buildComponentDependencyElement(dependency, Action.UPDATE);
 
-    Id itemId = new Id(entity.getVspId());
-    SessionContext context = ZusammenUtil.createSessionContext();
-    ElementContext elementContext = new ElementContext(itemId,
-        VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor));
+    SessionContext context = createSessionContext();
+    ElementContext elementContext =
+        new ElementContext(dependency.getVspId(), dependency.getVersion().getId());
 
-    zusammenAdaptor.saveElement(context, elementContext,
-        componentDependencyElement,
-        String.format("Update component dependency model with id %s", entity.getId()));
+    zusammenAdaptor.saveElement(context, elementContext, componentDependencyElement,
+        String.format("Update component dependency model with id %s", dependency.getId()));
   }
 
   @Override
-  public void delete(ComponentDependencyModelEntity entity) {
-    ZusammenElement componentDependencyElement = new ZusammenElement();
-    componentDependencyElement.setElementId(new Id(entity.getId()));
-    componentDependencyElement.setAction(Action.DELETE);
+  public void delete(ComponentDependencyModelEntity dependency) {
+    ZusammenElement componentDependencyElement =
+        buildElement(new Id(dependency.getId()), Action.DELETE);
 
-    Id itemId = new Id(entity.getVspId());
-    SessionContext context = ZusammenUtil.createSessionContext();
-    ElementContext elementContext = new ElementContext(itemId,
-        VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor));
+    SessionContext context = createSessionContext();
+    ElementContext elementContext =
+        new ElementContext(dependency.getVspId(), dependency.getVersion().getId());
 
-
-    zusammenAdaptor.saveElement(context, elementContext,
-        componentDependencyElement,
-        String.format("Delete component dependency model with id %s", entity.getId()));
-  }
-
-  @Override
-  public void deleteAll(String vspId, Version version) {
-    ZusammenElement componentDependenciesElement =
-        VspZusammenUtil
-            .buildStructuralElement(StructureElement.ComponentDependencies, Action.DELETE);
-
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(vspId);
-    zusammenAdaptor.saveElement(context, new ElementContext(itemId,
-            VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor)),
-        componentDependenciesElement, "Delete all component dependencies");
+    zusammenAdaptor.saveElement(context, elementContext, componentDependencyElement,
+        String.format("Delete component dependency model with id %s", dependency.getId()));
   }
 
   @Override
@@ -127,75 +118,55 @@
   }
 
   @Override
-  public Collection<ComponentDependencyModelEntity> list(ComponentDependencyModelEntity entity) {
+  public Collection<ComponentDependencyModelEntity> list(
+      ComponentDependencyModelEntity dependency) {
+    SessionContext context = createSessionContext();
+    ElementContext elementContext =
+        new ElementContext(dependency.getVspId(), dependency.getVersion().getId());
 
-    Id itemId = new Id(entity.getVspId());
-    SessionContext context = ZusammenUtil.createSessionContext();
-    ElementContext elementContext = new ElementContext(itemId,
-        VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor),
-        VspZusammenUtil.getVersionTag(entity.getVersion()));
+    Optional<ElementInfo> vspModel = zusammenAdaptor
+        .getElementInfoByName(context, elementContext, null, ElementType.VspModel.name());
+    if (!vspModel.isPresent()) {
+      return new ArrayList<>();
+    }
 
-    return zusammenAdaptor.listElementsByName(context, elementContext,
-        null, StructureElement.ComponentDependencies.name())
-        .stream().map(elementInfo -> mapElementInfoToComponentDependencyModel(entity.getVspId(),
-            entity.getVersion(), elementInfo))
+    ElementToComponentDependencyModelConvertor convertor =
+        new ElementToComponentDependencyModelConvertor();
+    return zusammenAdaptor.listElementsByName(context, elementContext, vspModel.get().getId(),
+        ElementType.ComponentDependencies.name()).stream()
+        .map(elementInfo -> {
+          ComponentDependencyModelEntity entity = convertor.convert(elementInfo);
+          entity.setVspId(dependency.getVspId());
+          entity.setVersion(dependency.getVersion());
+          entity.setId(elementInfo.getId().getValue());
+          return entity;
+        })
         .collect(Collectors.toList());
   }
 
-  private static ComponentDependencyModelEntity mapElementInfoToComponentDependencyModel(
-      String vspId, Version version,
-      ElementInfo elementInfo) {
-    ComponentDependencyModelEntity componentDependencyModelEntity =
-        new ComponentDependencyModelEntity(vspId, version, elementInfo.getId().getValue());
-    componentDependencyModelEntity.setSourceComponentId(elementInfo.getInfo()
-        .getProperty(ComponentDependencyModelPropertyName.sourcecomponent_id.name()));
-    componentDependencyModelEntity.setTargetComponentId(elementInfo.getInfo()
-        .getProperty(ComponentDependencyModelPropertyName.targetcomponent_id.name()));
-    componentDependencyModelEntity.setRelation(elementInfo.getInfo()
-        .getProperty(ComponentDependencyModelPropertyName.relation.name()));
-
-    return componentDependencyModelEntity;
-  }
-
-
-  private ZusammenElement buildComponentDependencyElement(ComponentDependencyModelEntity entity) {
-    ZusammenElement componentDependencyElement = new ZusammenElement();
-
-    if (entity.getId() != null) {
-      componentDependencyElement.setElementId(new Id(entity.getId()));
-    }
+  private ZusammenElement buildComponentDependencyElement(ComponentDependencyModelEntity compDep,
+                                                          Action action) {
+    ZusammenElement componentDependencyElement =
+        buildElement(compDep.getId() == null ? null : new Id(compDep.getId()), action);
 
     Info info = new Info();
-    info.addProperty(ComponentDependencyModelPropertyName.id.name(), entity.getId());
-    info.addProperty(ComponentDependencyModelPropertyName.relation.name(), entity.getRelation());
+    info.addProperty(ElementPropertyName.elementType.name(), ElementType.ComponentDependency);
+    //info.addProperty(ComponentDependencyModelPropertyName.id.name(), entity.getId());
+    info.addProperty(ComponentDependencyModelPropertyName.relation.name(), compDep.getRelation());
     info.addProperty(ComponentDependencyModelPropertyName.sourcecomponent_id.name(),
-        entity.getSourceComponentId());
+        compDep.getSourceComponentId());
     info.addProperty(ComponentDependencyModelPropertyName.targetcomponent_id.name(),
-        entity.getTargetComponentId());
+        compDep.getTargetComponentId());
 
     componentDependencyElement.setInfo(info);
 
     return componentDependencyElement;
   }
 
-  private void addComponentDependencyData(ComponentDependencyModelEntity componentDependency,
-                                          ElementInfo componentDependencyElement) {
-    componentDependency.setId(componentDependencyElement.getInfo()
-        .getProperty(ComponentDependencyModelPropertyName.id.name()));
-    componentDependency.setRelation(componentDependencyElement.getInfo()
-        .getProperty(ComponentDependencyModelPropertyName.id.name()));
-    componentDependency.setSourceComponentId(componentDependencyElement.getInfo()
-        .getProperty(ComponentDependencyModelPropertyName.sourcecomponent_id.name()));
-    componentDependency.setTargetComponentId(componentDependencyElement.getInfo()
-        .getProperty(ComponentDependencyModelPropertyName.targetcomponent_id.name()));
-  }
-
-
   private enum ComponentDependencyModelPropertyName {
     id,
     relation,
     sourcecomponent_id,
     targetcomponent_id,
   }
-
 }
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/ComputeDaoZusammenImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/ComputeDaoZusammenImpl.java
index aa4bab6..0f92c95 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/ComputeDaoZusammenImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/ComputeDaoZusammenImpl.java
@@ -2,7 +2,6 @@
 
 
 import com.amdocs.zusammen.adaptor.inbound.api.types.item.Element;
-import com.amdocs.zusammen.adaptor.inbound.api.types.item.ElementInfo;
 import com.amdocs.zusammen.adaptor.inbound.api.types.item.ZusammenElement;
 import com.amdocs.zusammen.datatypes.Id;
 import com.amdocs.zusammen.datatypes.SessionContext;
@@ -11,11 +10,13 @@
 import com.amdocs.zusammen.datatypes.item.Info;
 import org.openecomp.core.utilities.file.FileUtils;
 import org.openecomp.core.zusammen.api.ZusammenAdaptor;
-import org.openecomp.core.zusammen.api.ZusammenUtil;
+import org.openecomp.sdc.datatypes.model.ElementType;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.ComputeDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.convertor.ElementToComputeConvertor;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComputeEntity;
 import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.types.ElementPropertyName;
 
 import java.io.ByteArrayInputStream;
 import java.util.Collection;
@@ -23,6 +24,10 @@
 import java.util.Optional;
 import java.util.stream.Collectors;
 
+import static org.openecomp.core.zusammen.api.ZusammenUtil.buildElement;
+import static org.openecomp.core.zusammen.api.ZusammenUtil.buildStructuralElement;
+import static org.openecomp.core.zusammen.api.ZusammenUtil.createSessionContext;
+
 public class ComputeDaoZusammenImpl implements ComputeDao {
 
   private ZusammenAdaptor zusammenAdaptor;
@@ -37,83 +42,78 @@
 
   @Override
   public Collection<ComputeEntity> list(ComputeEntity compute) {
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(compute.getVspId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor),
-        VspZusammenUtil.getVersionTag(compute.getVersion()));
+    SessionContext context = createSessionContext();
+    ElementContext elementContext =
+        new ElementContext(compute.getVspId(), compute.getVersion().getId());
 
     return listComputes(context, elementContext, compute);
   }
 
   private Collection<ComputeEntity> listComputes(SessionContext context,
-                                            ElementContext elementContext, ComputeEntity compute) {
+                                                 ElementContext elementContext,
+                                                 ComputeEntity compute) {
+    ElementToComputeConvertor convertor = new ElementToComputeConvertor();
     return zusammenAdaptor
         .listElementsByName(context, elementContext, new Id(compute.getComponentId()),
-            StructureElement.Computes.name())
-        .stream().map(elementInfo -> mapElementInfoToCompute(
-            compute.getVspId(), compute.getVersion(), compute.getComponentId(), elementInfo))
+            ElementType.Computes.name())
+        .stream().map(elementInfo -> convertor.convert(elementInfo))
+        .map(computeEntity -> {
+          computeEntity.setComponentId(compute.getComponentId());
+          computeEntity.setVspId(compute.getVspId());
+          computeEntity.setVersion(compute.getVersion());
+          return computeEntity;
+        })
         .collect(Collectors.toList());
   }
 
-  private static ComputeEntity mapElementInfoToCompute(String vspId, Version version,
-                                                     String componentId, ElementInfo elementInfo) {
-    ComputeEntity componentEntity =
-        new ComputeEntity(vspId, version, componentId, elementInfo.getId().getValue());
-    componentEntity.setCompositionData(
-        elementInfo.getInfo().getProperty(ElementPropertyName.compositionData.name()));
-    return componentEntity;
-  }
-
   @Override
   public void create(ComputeEntity compute) {
     ZusammenElement computeElement = computeToZusammen(compute, Action.CREATE);
 
-    ZusammenElement computesElement =
-        VspZusammenUtil.buildStructuralElement(StructureElement.Computes, null);
+    ZusammenElement computesElement = buildStructuralElement(ElementType.Computes, Action.IGNORE);
     computesElement.setSubElements(Collections.singletonList(computeElement));
 
-    ZusammenElement componentElement = new ZusammenElement();
-    componentElement.setElementId(new Id(compute.getComponentId()));
-    componentElement.setAction(Action.IGNORE);
+    ZusammenElement componentElement =
+        buildElement(new Id(compute.getComponentId()), Action.IGNORE);
     componentElement.setSubElements(Collections.singletonList(computesElement));
 
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(compute.getVspId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor));
+    SessionContext context = createSessionContext();
+    ElementContext elementContext =
+        new ElementContext(compute.getVspId(), compute.getVersion().getId());
 
-    Optional<Element> savedElement =
+    Element savedElement =
         zusammenAdaptor.saveElement(context, elementContext, componentElement, "Create compute");
-    savedElement.ifPresent(element ->
-        compute.setId(element.getSubElements().iterator().next()
-            .getSubElements().iterator().next().getElementId().getValue()));
+    compute.setId(savedElement.getSubElements().iterator().next()
+        .getSubElements().iterator().next().getElementId().getValue());
   }
 
   @Override
   public void update(ComputeEntity compute) {
     ZusammenElement computeElement = computeToZusammen(compute, Action.UPDATE);
 
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(compute.getVspId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor));
+    SessionContext context = createSessionContext();
+    ElementContext elementContext =
+        new ElementContext(compute.getVspId(), compute.getVersion().getId());
     zusammenAdaptor.saveElement(context, elementContext, computeElement,
         String.format("Update compute with id %s", compute.getId()));
   }
 
   @Override
   public ComputeEntity get(ComputeEntity compute) {
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(compute.getVspId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor),
-        VspZusammenUtil.getVersionTag(compute.getVersion()));
-    Optional<Element> element = zusammenAdaptor.getElement(context, elementContext, compute.getId());
+    SessionContext context = createSessionContext();
+    ElementContext elementContext =
+        new ElementContext(compute.getVspId(), compute.getVersion().getId());
+    Optional<Element> element =
+        zusammenAdaptor.getElement(context, elementContext, compute.getId());
 
     if (element.isPresent()) {
-      compute.setCompositionData(new String(FileUtils.toByteArray(element.get().getData())));
-      return compute;
+
+      ElementToComputeConvertor convertor = new ElementToComputeConvertor();
+      ComputeEntity entity = convertor.convert(element.get());
+      entity.setVspId(compute.getVspId());
+      entity.setVersion(compute.getVersion());
+      entity.setComponentId(compute.getComponentId());
+      return entity;
     } else {
       return null;
     }
@@ -121,36 +121,30 @@
 
   @Override
   public void delete(ComputeEntity compute) {
-    ZusammenElement computeElement = new ZusammenElement();
-    computeElement.setElementId(new Id(compute.getId()));
-    computeElement.setAction(Action.DELETE);
+    ZusammenElement computeElement = buildElement(new Id(compute.getId()), Action.DELETE);
 
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(compute.getVspId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor));
+    SessionContext context = createSessionContext();
+    ElementContext elementContext =
+        new ElementContext(compute.getVspId(), compute.getVersion().getId());
     zusammenAdaptor.saveElement(context, elementContext, computeElement,
         String.format("Delete compute with id %s", compute.getId()));
   }
 
   @Override
   public ComputeEntity getQuestionnaireData(String vspId, Version version, String componentId,
-                                        String computeId) {
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(vspId);
-    ElementContext elementContext = new ElementContext(itemId,
-        VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor),
-        VspZusammenUtil.getVersionTag(version));
+                                            String computeId) {
+    SessionContext context = createSessionContext();
+    ElementContext elementContext = new ElementContext(vspId, version.getId());
 
     return getQuestionnaire(context, elementContext,
         new ComputeEntity(vspId, version, componentId, computeId));
   }
 
   private ComputeEntity getQuestionnaire(SessionContext context, ElementContext elementContext,
-                                     ComputeEntity compute) {
+                                         ComputeEntity compute) {
     Optional<Element> questionnaireElement = zusammenAdaptor
         .getElementByName(context, elementContext, new Id(compute.getId()),
-            StructureElement.Questionnaire.name());
+            ElementType.ComputeQuestionnaire.name());
     return questionnaireElement.map(
         element -> element.getData() == null
             ? null
@@ -168,29 +162,22 @@
     ZusammenElement questionnaireElement =
         computeQuestionnaireToZusammen(questionnaireData, Action.UPDATE);
 
-    ZusammenElement computeElement = new ZusammenElement();
-    computeElement.setAction(Action.IGNORE);
-    computeElement.setElementId(new Id(computeId));
+    ZusammenElement computeElement = buildElement(new Id(computeId), Action.IGNORE);
     computeElement.setSubElements(Collections.singletonList(questionnaireElement));
 
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(vspId);
-    ElementContext elementContext = new ElementContext(itemId,
-        VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor));
+    SessionContext context = createSessionContext();
+    ElementContext elementContext = new ElementContext(vspId, version.getId());
     zusammenAdaptor.saveElement(context, elementContext, computeElement, "Update compute "
         + "questionnaire");
   }
 
   @Override
   public Collection<ComputeEntity> listByVsp(String vspId, Version version) {
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(vspId);
-    ElementContext elementContext = new ElementContext(itemId,
-        VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor),
-        VspZusammenUtil.getVersionTag(version));
+    SessionContext context = createSessionContext();
+    ElementContext elementContext = new ElementContext(vspId, version.getId());
 
     Collection<ComponentEntity> components = ComponentDaoZusammenImpl
-        .listComponents(zusammenAdaptor, context, elementContext, vspId, version);
+        .listComponents(zusammenAdaptor, context, vspId, version);
 
     return components.stream()
         .map(component ->
@@ -204,15 +191,23 @@
 
   @Override
   public void deleteAll(String vspId, Version version) {
-    ZusammenElement computesElement =
-        VspZusammenUtil.buildStructuralElement(StructureElement.Computes, Action.DELETE);
 
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(vspId);
-    zusammenAdaptor.saveElement(context,
-        new ElementContext(itemId,
-            VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor)),
-        computesElement, "Delete all computes");
+    SessionContext context = createSessionContext();
+    ElementContext elementContext = new ElementContext(vspId, version.getId());
+
+    Optional<Element> optionalElement = zusammenAdaptor.getElementByName(context,
+        elementContext, null, ElementType.Computes.name());
+
+    if (optionalElement.isPresent()) {
+      Element computesElement = optionalElement.get();
+      Collection<Element> computes = computesElement.getSubElements();
+
+      computes.forEach(compute -> {
+        ZusammenElement computeElement = buildElement(compute.getElementId(), Action.DELETE);
+        zusammenAdaptor.saveElement(context, elementContext, computeElement,
+            "Delete compute with id " + compute.getElementId());
+      });
+    }
   }
 
   private ZusammenElement computeToZusammen(ComputeEntity compute, Action action) {
@@ -225,27 +220,21 @@
   }
 
   private ZusammenElement computeQuestionnaireToZusammen(String questionnaireData,
-                                                     Action action) {
+                                                         Action action) {
     ZusammenElement questionnaireElement =
-        VspZusammenUtil.buildStructuralElement(StructureElement.Questionnaire, action);
+        buildStructuralElement(ElementType.ComputeQuestionnaire, action);
     questionnaireElement.setData(new ByteArrayInputStream(questionnaireData.getBytes()));
     return questionnaireElement;
   }
 
   private ZusammenElement buildComputeElement(ComputeEntity compute, Action action) {
-    ZusammenElement computeElement = new ZusammenElement();
-    computeElement.setAction(action);
-    if (compute.getId() != null) {
-      computeElement.setElementId(new Id(compute.getId()));
-    }
+    ZusammenElement computeElement =
+        buildElement(compute.getId() == null ? null : new Id(compute.getId()), action);
     Info info = new Info();
-    info.addProperty(ElementPropertyName.type.name(), ElementType.Compute);
+    info.addProperty(ElementPropertyName.elementType.name(), ElementType.Compute);
     info.addProperty(ElementPropertyName.compositionData.name(), compute.getCompositionData());
     computeElement.setInfo(info);
     computeElement.setData(new ByteArrayInputStream(compute.getCompositionData().getBytes()));
     return computeElement;
   }
-
-
-
 }
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/DeploymentFlavorDaoZusammenImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/DeploymentFlavorDaoZusammenImpl.java
index 947bcc2..17580b2 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/DeploymentFlavorDaoZusammenImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/DeploymentFlavorDaoZusammenImpl.java
@@ -1,7 +1,6 @@
 package org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen;
 
 import com.amdocs.zusammen.adaptor.inbound.api.types.item.Element;
-import com.amdocs.zusammen.adaptor.inbound.api.types.item.ElementInfo;
 import com.amdocs.zusammen.adaptor.inbound.api.types.item.ZusammenElement;
 import com.amdocs.zusammen.datatypes.Id;
 import com.amdocs.zusammen.datatypes.SessionContext;
@@ -10,16 +9,22 @@
 import com.amdocs.zusammen.datatypes.item.Info;
 import org.openecomp.core.utilities.file.FileUtils;
 import org.openecomp.core.zusammen.api.ZusammenAdaptor;
-import org.openecomp.core.zusammen.api.ZusammenUtil;
+import org.openecomp.sdc.datatypes.model.ElementType;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.DeploymentFlavorDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.convertor.ElementToDeploymentFlavorConvertor;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.DeploymentFlavorEntity;
 import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.types.ElementPropertyName;
 
 import java.io.ByteArrayInputStream;
 import java.util.Collection;
 import java.util.Optional;
 import java.util.stream.Collectors;
 
+import static org.openecomp.core.zusammen.api.ZusammenUtil.buildElement;
+import static org.openecomp.core.zusammen.api.ZusammenUtil.buildStructuralElement;
+import static org.openecomp.core.zusammen.api.ZusammenUtil.createSessionContext;
+
 public class DeploymentFlavorDaoZusammenImpl implements DeploymentFlavorDao {
 
   private ZusammenAdaptor zusammenAdaptor;
@@ -34,52 +39,49 @@
 
   @Override
   public Collection<DeploymentFlavorEntity> list(DeploymentFlavorEntity deploymentFlavor) {
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(deploymentFlavor.getVspId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor),
-        VspZusammenUtil.getVersionTag(deploymentFlavor.getVersion()));
+    SessionContext context = createSessionContext();
+    ElementContext elementContext =
+        new ElementContext(deploymentFlavor.getVspId(), deploymentFlavor.getVersion().getId());
 
-    return listDeploymentFlavor(zusammenAdaptor, context, elementContext, deploymentFlavor.getVspId(),
+    return listDeploymentFlavor(zusammenAdaptor, context, elementContext,
+        deploymentFlavor.getVspId(),
         deploymentFlavor.getVersion());
   }
 
-  static Collection<DeploymentFlavorEntity> listDeploymentFlavor(ZusammenAdaptor zusammenAdaptor,
-                                                    SessionContext context,
-                                                    ElementContext elementContext,
-                                                    String vspId, Version version) {
+  private static Collection<DeploymentFlavorEntity> listDeploymentFlavor(
+      ZusammenAdaptor zusammenAdaptor,
+      SessionContext context,
+      ElementContext elementContext,
+      String vspId, Version version) {
+    ElementToDeploymentFlavorConvertor convertor = new ElementToDeploymentFlavorConvertor();
     return zusammenAdaptor
-        .listElementsByName(context, elementContext, null, StructureElement.DeploymentFlavors.name())
-        .stream().map(elementInfo -> mapElementInfoToComponent(vspId, version, elementInfo))
+        .listElementsByName(context, elementContext, null,
+            ElementType.DeploymentFlavors.name())
+        .stream().map(elementInfo -> {
+          DeploymentFlavorEntity entity = convertor.convert(
+              elementInfo);
+          entity.setVspId(vspId);
+          entity.setVersion(version);
+          return entity;
+        })
         .collect(Collectors.toList());
   }
 
-  private static DeploymentFlavorEntity mapElementInfoToComponent(String vspId, Version version,
-                                                           ElementInfo elementInfo) {
-    DeploymentFlavorEntity deploymentFlavorEntity =
-        new DeploymentFlavorEntity(vspId, version, elementInfo.getId().getValue());
-    deploymentFlavorEntity.setCompositionData(
-        elementInfo.getInfo().getProperty(ElementPropertyName.compositionData.name()));
-    return deploymentFlavorEntity;
-  }
 
   @Override
   public void create(DeploymentFlavorEntity deploymentFlavor) {
     ZusammenElement deploymentFlavorElement = deploymentFlavorToZusammen(deploymentFlavor,
         Action.CREATE);
     ZusammenElement deploymentFlavorElements =
-        VspZusammenUtil.buildStructuralElement(StructureElement.DeploymentFlavors, null);
+        buildStructuralElement(ElementType.DeploymentFlavors, Action.IGNORE);
     deploymentFlavorElements.getSubElements().add(deploymentFlavorElement);
 
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(deploymentFlavor.getVspId());
-    Optional<Element> savedElement = zusammenAdaptor.saveElement(context,
-        new ElementContext(itemId,
-            VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor)),
+    SessionContext context = createSessionContext();
+    Element savedElement = zusammenAdaptor.saveElement(context,
+        new ElementContext(deploymentFlavor.getVspId(), deploymentFlavor.getVersion().getId()),
         deploymentFlavorElements, "Create deloymentFlavor");
-    savedElement.ifPresent(element ->
-        deploymentFlavor.setId(element.getSubElements().iterator().next().getElementId()
-            .getValue()));
+    deploymentFlavor.setId(savedElement.getSubElements().iterator().next().getElementId()
+        .getValue());
   }
 
   @Override
@@ -87,87 +89,83 @@
     ZusammenElement deploymentFlavorElement = deploymentFlavorToZusammen(deploymentFlavor,
         Action.UPDATE);
 
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(deploymentFlavor.getVspId());
+    SessionContext context = createSessionContext();
     zusammenAdaptor.saveElement(context,
-        new ElementContext(itemId,
-            VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor)),
+        new ElementContext(deploymentFlavor.getVspId(), deploymentFlavor.getVersion().getId()),
         deploymentFlavorElement, String.format("Update deloymentFlavor with id %s",
             deploymentFlavor.getId()));
   }
 
   @Override
   public DeploymentFlavorEntity get(DeploymentFlavorEntity deploymentFlavor) {
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(deploymentFlavor.getVspId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor),
-        VspZusammenUtil.getVersionTag(deploymentFlavor.getVersion()));
+    SessionContext context = createSessionContext();
+    ElementContext elementContext =
+        new ElementContext(deploymentFlavor.getVspId(), deploymentFlavor.getVersion().getId());
 
     Optional<Element> element =
         zusammenAdaptor.getElement(context, elementContext, deploymentFlavor.getId());
 
     if (element.isPresent()) {
+      ElementToDeploymentFlavorConvertor convertor = new ElementToDeploymentFlavorConvertor();
+      DeploymentFlavorEntity entity = convertor.convert(element.get());
       deploymentFlavor.setCompositionData(new String(FileUtils.toByteArray(element.get()
           .getData())));
-      return deploymentFlavor;
+      entity.setVspId(deploymentFlavor.getVspId());
+      entity.setVersion(deploymentFlavor.getVersion());
+      return entity;
     }
     return null;
   }
 
   @Override
   public void delete(DeploymentFlavorEntity deploymentFlavor) {
-    ZusammenElement componentElement = new ZusammenElement();
-    componentElement.setElementId(new Id(deploymentFlavor.getId()));
-    componentElement.setAction(Action.DELETE);
+    ZusammenElement componentElement =
+        buildElement(new Id(deploymentFlavor.getId()), Action.DELETE);
 
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(deploymentFlavor.getVspId());
+    SessionContext context = createSessionContext();
     zusammenAdaptor.saveElement(context,
-        new ElementContext(itemId,
-            VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor)),
+        new ElementContext(deploymentFlavor.getVspId(), deploymentFlavor.getVersion().getId()),
         componentElement, String.format("Delete deloymentFlavor with id %s",
             deploymentFlavor.getId()));
   }
 
   @Override
   public void deleteAll(String vspId, Version version) {
-    ZusammenElement deploymentFlavorsElement =
-        VspZusammenUtil.buildStructuralElement(StructureElement.DeploymentFlavors, Action.DELETE);
+    SessionContext context = createSessionContext();
+    ElementContext elementContext = new ElementContext(vspId, version.getId());
 
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(vspId);
-    zusammenAdaptor.saveElement(context,
-        new ElementContext(itemId,
-            VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor)),
-        deploymentFlavorsElement, "Delete all deploymentFlavors");
-  }
+    Optional<Element> optionalElement = zusammenAdaptor.getElementByName(context,
+        elementContext, null, ElementType.DeploymentFlavors.name());
 
-  private ZusammenElement deploymentFlavorToZusammen(DeploymentFlavorEntity deploymentFlavor,
-                                                     Action action) {
-    ZusammenElement deploymentFlavorElement = buildDeploymentFlavorElement
-        (deploymentFlavor, action);
+    if (optionalElement.isPresent()) {
+      Element deploymentFlavorsElement = optionalElement.get();
+      Collection<Element> deploymentFlavors = deploymentFlavorsElement.getSubElements();
 
-    return deploymentFlavorElement;
+      deploymentFlavors.forEach(deplymentFlavor -> {
+        ZusammenElement deplymentFlavorZusammenElement =
+            buildElement(deplymentFlavor.getElementId(), Action.DELETE);
+        zusammenAdaptor.saveElement(context,
+            elementContext, deplymentFlavorZusammenElement, " Delete Deplyment Flavor with id "
+                + deplymentFlavor.getElementId());
+      });
+    }
   }
 
   /*private ZusammenElement deplymentFlavorQuestionnaireToZusammen(String questionnaireData,
                                                            Action action) {
     ZusammenElement questionnaireElement =
-        VspZusammenUtil.buildStructuralElement(StructureElement.Questionnaire, action);
+        VspbuildStructuralElement(ElementType.Questionnaire, action);
     questionnaireElement.setData(new ByteArrayInputStream(questionnaireData.getBytes()));
     return questionnaireElement;
   }*/
 
-  private ZusammenElement buildDeploymentFlavorElement(DeploymentFlavorEntity deploymentFlavor,
-                                                       Action action) {
-    ZusammenElement deploymentFlavorElement = new ZusammenElement();
-    deploymentFlavorElement.setAction(action);
-    if (deploymentFlavor.getId() != null) {
-      deploymentFlavorElement.setElementId(new Id(deploymentFlavor.getId()));
-    }
+  private ZusammenElement deploymentFlavorToZusammen(DeploymentFlavorEntity deploymentFlavor,
+                                                     Action action) {
+    ZusammenElement deploymentFlavorElement =
+        buildElement(deploymentFlavor.getId() == null ? null : new Id(deploymentFlavor.getId()),
+            action);
     Info info = new Info();
-    info.addProperty(ElementPropertyName.type.name(), ElementType.DeploymentFlavor);
+    info.addProperty(ElementPropertyName.elementType.name(), ElementType.DeploymentFlavor);
     info.addProperty(ElementPropertyName.compositionData.name(), deploymentFlavor
         .getCompositionData());
     deploymentFlavorElement.setInfo(info);
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/ElementPropertyName.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/ElementPropertyName.java
deleted file mode 100644
index 9ca0bf7..0000000
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/ElementPropertyName.java
+++ /dev/null
@@ -1,6 +0,0 @@
-package org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen;
-
-public enum ElementPropertyName {
-  type,
-  compositionData
-}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/ElementType.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/ElementType.java
deleted file mode 100644
index 9da0780..0000000
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/ElementType.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen;
-
-public enum ElementType {
-  Network,
-  Component,
-  Nic,
-  Process,
-  Mib,
-  LKG,
-  Compute,
-  DeploymentFlavor,
-  Image
-}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/ImageDaoZusammenImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/ImageDaoZusammenImpl.java
index d913b18..24ca072 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/ImageDaoZusammenImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/ImageDaoZusammenImpl.java
@@ -2,7 +2,6 @@
 
 
 import com.amdocs.zusammen.adaptor.inbound.api.types.item.Element;
-import com.amdocs.zusammen.adaptor.inbound.api.types.item.ElementInfo;
 import com.amdocs.zusammen.adaptor.inbound.api.types.item.ZusammenElement;
 import com.amdocs.zusammen.datatypes.Id;
 import com.amdocs.zusammen.datatypes.SessionContext;
@@ -11,11 +10,13 @@
 import com.amdocs.zusammen.datatypes.item.Info;
 import org.openecomp.core.utilities.file.FileUtils;
 import org.openecomp.core.zusammen.api.ZusammenAdaptor;
-import org.openecomp.core.zusammen.api.ZusammenUtil;
+import org.openecomp.sdc.datatypes.model.ElementType;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.ImageDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.convertor.ElementToImageConvertor;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ImageEntity;
 import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.types.ElementPropertyName;
 
 import java.io.ByteArrayInputStream;
 import java.util.Collection;
@@ -23,6 +24,10 @@
 import java.util.Optional;
 import java.util.stream.Collectors;
 
+import static org.openecomp.core.zusammen.api.ZusammenUtil.buildElement;
+import static org.openecomp.core.zusammen.api.ZusammenUtil.buildStructuralElement;
+import static org.openecomp.core.zusammen.api.ZusammenUtil.createSessionContext;
+
 public class ImageDaoZusammenImpl implements ImageDao {
 
   private ZusammenAdaptor zusammenAdaptor;
@@ -37,83 +42,76 @@
 
   @Override
   public Collection<ImageEntity> list(ImageEntity image) {
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(image.getVspId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor),
-        VspZusammenUtil.getVersionTag(image.getVersion()));
+    SessionContext context = createSessionContext();
+    ElementContext elementContext =
+        new ElementContext(image.getVspId(), image.getVersion().getId());
 
     return listImages(context, elementContext, image);
   }
 
   private Collection<ImageEntity> listImages(SessionContext context,
-                                                 ElementContext elementContext, ImageEntity image) {
+                                             ElementContext elementContext, ImageEntity image) {
+    ElementToImageConvertor convertor = new ElementToImageConvertor();
     return zusammenAdaptor
         .listElementsByName(context, elementContext, new Id(image.getComponentId()),
-            StructureElement.Images.name())
-        .stream().map(elementInfo -> mapElementInfoToImage(
-            image.getVspId(), image.getVersion(), image.getComponentId(), elementInfo))
+            ElementType.Images.name())
+        .stream().map(convertor::convert)
+        .map(imageEntity -> {
+          imageEntity.setComponentId(image.getComponentId());
+          imageEntity.setVspId(image.getVspId());
+          imageEntity.setVersion(image.getVersion());
+          return imageEntity;
+        })
         .collect(Collectors.toList());
   }
 
-  private static ImageEntity mapElementInfoToImage(String vspId, Version version,
-                                                       String componentId, ElementInfo elementInfo) {
-    ImageEntity imageEntity =
-        new ImageEntity(vspId, version, componentId, elementInfo.getId().getValue());
-    imageEntity.setCompositionData(
-        elementInfo.getInfo().getProperty(ElementPropertyName.compositionData.name()));
-    return imageEntity;
-  }
-
   @Override
   public void create(ImageEntity image) {
     ZusammenElement imageElement = imageToZusammen(image, Action.CREATE);
 
     ZusammenElement imagesElement =
-        VspZusammenUtil.buildStructuralElement(StructureElement.Images, null);
+        buildStructuralElement(ElementType.Images, Action.IGNORE);
     imagesElement.setSubElements(Collections.singletonList(imageElement));
 
-    ZusammenElement componentElement = new ZusammenElement();
-    componentElement.setElementId(new Id(image.getComponentId()));
-    componentElement.setAction(Action.IGNORE);
+    ZusammenElement componentElement = buildElement(new Id(image.getComponentId()), Action.IGNORE);
     componentElement.setSubElements(Collections.singletonList(imagesElement));
 
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(image.getVspId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor));
+    SessionContext context = createSessionContext();
+    ElementContext elementContext =
+        new ElementContext(image.getVspId(), image.getVersion().getId());
 
-    Optional<Element> savedElement =
+    Element savedElement =
         zusammenAdaptor.saveElement(context, elementContext, componentElement, "Create image");
-    savedElement.ifPresent(element ->
-        image.setId(element.getSubElements().iterator().next()
-            .getSubElements().iterator().next().getElementId().getValue()));
+    image.setId(savedElement.getSubElements().iterator().next()
+        .getSubElements().iterator().next().getElementId().getValue());
   }
 
   @Override
   public void update(ImageEntity image) {
     ZusammenElement imageElement = imageToZusammen(image, Action.UPDATE);
 
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(image.getVspId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor));
+    SessionContext context = createSessionContext();
+    ElementContext elementContext =
+        new ElementContext(image.getVspId(), image.getVersion().getId());
     zusammenAdaptor.saveElement(context, elementContext, imageElement,
         String.format("Update image with id %s", image.getId()));
   }
 
   @Override
   public ImageEntity get(ImageEntity image) {
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(image.getVspId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor),
-        VspZusammenUtil.getVersionTag(image.getVersion()));
+    SessionContext context = createSessionContext();
+
+    ElementContext elementContext =
+        new ElementContext(image.getVspId(), image.getVersion().getId());
     Optional<Element> element = zusammenAdaptor.getElement(context, elementContext, image.getId());
 
     if (element.isPresent()) {
-      image.setCompositionData(new String(FileUtils.toByteArray(element.get().getData())));
-      return image;
+      ElementToImageConvertor convertor = new ElementToImageConvertor();
+      ImageEntity entity = convertor.convert(element.get());
+      entity.setComponentId(image.getComponentId());
+      entity.setVspId(image.getVspId());
+      entity.setVersion(image.getVersion());
+      return entity;
     } else {
       return null;
     }
@@ -121,41 +119,41 @@
 
   @Override
   public void delete(ImageEntity image) {
-    ZusammenElement imageElement = new ZusammenElement();
-    imageElement.setElementId(new Id(image.getId()));
-    imageElement.setAction(Action.DELETE);
+    ZusammenElement imageElement = buildElement(new Id(image.getId()), Action.DELETE);
 
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(image.getVspId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor));
+    SessionContext context = createSessionContext();
+    ElementContext elementContext =
+        new ElementContext(image.getVspId(), image.getVersion().getId());
     zusammenAdaptor.saveElement(context, elementContext, imageElement,
         String.format("Delete image with id %s", image.getId()));
   }
 
   @Override
   public void deleteByVspId(String vspId, Version version) {
-    ZusammenElement imagesElement =
-        VspZusammenUtil.buildStructuralElement(StructureElement.Images, Action.DELETE);
+    SessionContext context = createSessionContext();
+    ElementContext elementContext = new ElementContext(vspId, version.getId());
 
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(vspId);
-    zusammenAdaptor.saveElement(context,
-        new ElementContext(itemId,
-            VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor)),
-        imagesElement, String.format("Delete all images with vsp id %s", vspId));
+    Optional<Element> elementOptional = zusammenAdaptor.getElementByName(context, elementContext,
+        null, ElementType.Images.name());
+
+    if (elementOptional.isPresent()) {
+      Element ImagesElement = elementOptional.get();
+      Collection<Element> Images = ImagesElement.getSubElements();
+      Images.forEach(image -> {
+        ZusammenElement imageZusammenElement = buildElement(image.getElementId(), Action.DELETE);
+        zusammenAdaptor.saveElement(context, elementContext, imageZusammenElement, "Delete image " +
+            "with id " + image.getElementId());
+      });
+    }
   }
 
   @Override
   public Collection<ImageEntity> listByVsp(String vspId, Version version) {
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(vspId);
-    ElementContext elementContext = new ElementContext(itemId,
-        VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor),
-        VspZusammenUtil.getVersionTag(version));
+    SessionContext context = createSessionContext();
+    ElementContext elementContext = new ElementContext(vspId, version.getId());
 
     Collection<ComponentEntity> components = ComponentDaoZusammenImpl
-        .listComponents(zusammenAdaptor, context, elementContext, vspId, version);
+        .listComponents(zusammenAdaptor, context, vspId, version);
 
     return components.stream()
         .map(component ->
@@ -169,12 +167,9 @@
 
   @Override
   public ImageEntity getQuestionnaireData(String vspId, Version version, String componentId,
-                                            String imageId) {
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(vspId);
-    ElementContext elementContext = new ElementContext(itemId,
-        VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor),
-        VspZusammenUtil.getVersionTag(version));
+                                          String imageId) {
+    SessionContext context = createSessionContext();
+    ElementContext elementContext = new ElementContext(vspId, version.getId());
 
     return getQuestionnaire(context, elementContext,
         new ImageEntity(vspId, version, componentId, imageId));
@@ -184,7 +179,7 @@
                                        ImageEntity image) {
     Optional<Element> questionnaireElement = zusammenAdaptor
         .getElementByName(context, elementContext, new Id(image.getId()),
-            StructureElement.Questionnaire.name());
+            ElementType.ImageQuestionnaire.name());
     return questionnaireElement.map(
         element -> element.getData() == null
             ? null
@@ -202,21 +197,16 @@
     ZusammenElement questionnaireElement =
         imageQuestionnaireToZusammen(questionnaireData, Action.UPDATE);
 
-    ZusammenElement imageElement = new ZusammenElement();
-    imageElement.setAction(Action.IGNORE);
-    imageElement.setElementId(new Id(imageId));
+    ZusammenElement imageElement = buildElement(new Id(imageId), Action.IGNORE);
     imageElement.setSubElements(Collections.singletonList(questionnaireElement));
 
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(vspId);
-    ElementContext elementContext = new ElementContext(itemId,
-        VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor));
+    SessionContext context = createSessionContext();
+    ElementContext elementContext = new ElementContext(vspId, version.getId());
     zusammenAdaptor.saveElement(context, elementContext, imageElement, "Update image "
         + "questionnaire");
   }
 
 
-
   private ZusammenElement imageToZusammen(ImageEntity image, Action action) {
     ZusammenElement imageElement = buildImageElement(image, action);
     if (action == Action.CREATE) {
@@ -227,21 +217,18 @@
   }
 
   private ZusammenElement imageQuestionnaireToZusammen(String questionnaireData,
-                                                         Action action) {
+                                                       Action action) {
     ZusammenElement questionnaireElement =
-        VspZusammenUtil.buildStructuralElement(StructureElement.Questionnaire, action);
+        buildStructuralElement(ElementType.ImageQuestionnaire, action);
     questionnaireElement.setData(new ByteArrayInputStream(questionnaireData.getBytes()));
     return questionnaireElement;
   }
 
   private ZusammenElement buildImageElement(ImageEntity image, Action action) {
-    ZusammenElement imageElement = new ZusammenElement();
-    imageElement.setAction(action);
-    if (image.getId() != null) {
-      imageElement.setElementId(new Id(image.getId()));
-    }
+    ZusammenElement imageElement =
+        buildElement(image.getId() == null ? null : new Id(image.getId()), action);
     Info info = new Info();
-    info.addProperty(ElementPropertyName.type.name(), ElementType.Image);
+    info.addProperty(ElementPropertyName.elementType.name(), ElementType.Image);
     info.addProperty(ElementPropertyName.compositionData.name(), image.getCompositionData());
     imageElement.setInfo(info);
     imageElement.setData(new ByteArrayInputStream(image.getCompositionData().getBytes()));
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/NetworkDaoZusammenImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/NetworkDaoZusammenImpl.java
index b22c9f3..bccea3a 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/NetworkDaoZusammenImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/NetworkDaoZusammenImpl.java
@@ -8,19 +8,25 @@
 import com.amdocs.zusammen.datatypes.item.Action;
 import com.amdocs.zusammen.datatypes.item.ElementContext;
 import com.amdocs.zusammen.datatypes.item.Info;
-import org.openecomp.core.utilities.file.FileUtils;
 import org.openecomp.core.zusammen.api.ZusammenAdaptor;
-import org.openecomp.core.zusammen.api.ZusammenUtil;
+import org.openecomp.sdc.datatypes.model.ElementType;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.NetworkDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.convertor.ElementToNetworkConvertor;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity;
 import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.types.ElementPropertyName;
 
 import java.io.ByteArrayInputStream;
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Optional;
 import java.util.stream.Collectors;
 
+import static org.openecomp.core.zusammen.api.ZusammenUtil.buildElement;
+import static org.openecomp.core.zusammen.api.ZusammenUtil.buildStructuralElement;
+import static org.openecomp.core.zusammen.api.ZusammenUtil.createSessionContext;
+
 public class NetworkDaoZusammenImpl implements NetworkDao {
 
   private ZusammenAdaptor zusammenAdaptor;
@@ -36,71 +42,70 @@
 
   @Override
   public Collection<NetworkEntity> list(NetworkEntity network) {
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(network.getVspId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor),
-        VspZusammenUtil.getVersionTag(network.getVersion()));
+    SessionContext context = createSessionContext();
+    ElementContext elementContext =
+        new ElementContext(network.getVspId(), network.getVersion().getId());
 
-    return zusammenAdaptor
-        .listElementsByName(context, elementContext, null, StructureElement.Networks.name())
-        .stream().map(elementInfo ->
-            mapElementInfoToNetwork(network.getVspId(), network.getVersion(), elementInfo))
+    Optional<ElementInfo> vspModel = zusammenAdaptor
+        .getElementInfoByName(context, elementContext, null, ElementType.VspModel.name());
+    if (!vspModel.isPresent()) {
+      return new ArrayList<>();
+    }
+
+    ElementToNetworkConvertor convertor = new ElementToNetworkConvertor();
+    return zusammenAdaptor.listElementsByName(context, elementContext, vspModel.get().getId(),
+        ElementType.Networks.name()).stream()
+        .map(convertor::convert)
+        .map(entity -> {
+          entity.setVspId(network.getVspId());
+          entity.setVersion(network.getVersion());
+          return entity;
+        })
         .collect(Collectors.toList());
   }
 
-  private NetworkEntity mapElementInfoToNetwork(String vspId, Version version,
-                                                ElementInfo elementInfo) {
-    NetworkEntity networkEntity =
-        new NetworkEntity(vspId, version, elementInfo.getId().getValue());
-    networkEntity.setCompositionData(
-        elementInfo.getInfo().getProperty(ElementPropertyName.compositionData.name()));
-    return networkEntity;
-  }
-
   @Override
   public void create(NetworkEntity network) {
     ZusammenElement networkElement = buildNetworkElement(network, Action.CREATE);
-    ZusammenElement networksElement =
-        VspZusammenUtil.buildStructuralElement(StructureElement.Networks, null);
+
+    ZusammenElement networksElement = buildStructuralElement(ElementType.Networks, Action.IGNORE);
     networksElement.setSubElements(Collections.singletonList(networkElement));
 
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(network.getVspId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor));
-    Optional<Element> savedElement =
-        zusammenAdaptor.saveElement(context, elementContext, networksElement, "Create network");
-    savedElement.ifPresent(element ->
-        network.setId(element.getSubElements().iterator().next().getElementId().getValue()));
+    ZusammenElement vspModel = buildStructuralElement(ElementType.VspModel, Action.IGNORE);
+    vspModel.addSubElement(networksElement);
+
+    SessionContext context = createSessionContext();
+    Element savedElement = zusammenAdaptor
+        .saveElement(context, new ElementContext(network.getVspId(), network.getVersion().getId()),
+            vspModel, "Create network");
+    network.setId(savedElement.getSubElements().iterator().next()
+        .getSubElements().iterator().next().getElementId().getValue());
   }
 
   @Override
   public void update(NetworkEntity network) {
     ZusammenElement networkElement = buildNetworkElement(network, Action.UPDATE);
 
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(network.getVspId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor));
-    zusammenAdaptor.saveElement(context, elementContext, networkElement,
-        String.format("Update network with id %s", network.getId()));
+    SessionContext context = createSessionContext();
+    zusammenAdaptor
+        .saveElement(context, new ElementContext(network.getVspId(), network.getVersion().getId()),
+            networkElement, String.format("Update network with id %s", network.getId()));
   }
 
   @Override
   public NetworkEntity get(NetworkEntity network) {
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(network.getVspId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor),
-        VspZusammenUtil.getVersionTag(network.getVersion()));
+    SessionContext context = createSessionContext();
 
     Optional<Element> element =
-        zusammenAdaptor.getElement(context, elementContext, network.getId());
+        zusammenAdaptor.getElement(context,
+            new ElementContext(network.getVspId(), network.getVersion().getId()), network.getId());
 
     if (element.isPresent()) {
-      network.setCompositionData(new String(FileUtils.toByteArray(element.get().getData())));
-      return network;
+      ElementToNetworkConvertor convertor = new ElementToNetworkConvertor();
+      NetworkEntity entity = convertor.convert(element.get());
+      entity.setVspId(network.getVspId());
+      entity.setVersion(network.getVersion());
+      return entity;
     } else {
       return null;
     }
@@ -108,39 +113,44 @@
 
   @Override
   public void delete(NetworkEntity network) {
-    ZusammenElement networkElement = new ZusammenElement();
-    networkElement.setElementId(new Id(network.getId()));
-    networkElement.setAction(Action.DELETE);
+    ZusammenElement networkElement = buildElement(new Id(network.getId()), Action.DELETE);
 
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(network.getVspId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor));
-    zusammenAdaptor.saveElement(context, elementContext,
-        networkElement, String.format("Delete network with id %s", network.getId()));
+    SessionContext context = createSessionContext();
+    zusammenAdaptor
+        .saveElement(context, new ElementContext(network.getVspId(), network.getVersion().getId()),
+            networkElement, String.format("Delete network with id %s", network.getId()));
   }
 
 
   @Override
   public void deleteAll(String vspId, Version version) {
-    ZusammenElement networksElement =
-        VspZusammenUtil.buildStructuralElement(StructureElement.Networks, Action.DELETE);
+    SessionContext context = createSessionContext();
+    ElementContext elementContext = new ElementContext(vspId, version.getId());
 
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(vspId);
-    ElementContext elementContext = new ElementContext(itemId,
-        VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor));
-    zusammenAdaptor.saveElement(context, elementContext, networksElement, "Delete all networks");
+    Collection<ElementInfo> vspModelSubs = zusammenAdaptor
+        .listElementsByName(context, elementContext, null, ElementType.VspModel.name());
+
+    Optional<ElementInfo> networksElement = vspModelSubs.stream()
+        .filter(elementInfo -> elementInfo.getInfo() != null
+            && ElementType.Networks.name().equals(elementInfo.getInfo().getName()))
+        .findFirst();
+    if (!networksElement.isPresent()) {
+      return;
+    }
+
+    ZusammenElement networks = buildElement(networksElement.get().getId(), Action.IGNORE);
+    networks.setSubElements(networksElement.get().getSubElements().stream()
+        .map(network -> buildElement(network.getId(), Action.DELETE))
+        .collect(Collectors.toList()));
+
+    zusammenAdaptor.saveElement(context, elementContext, networks, "Delete all networks");
   }
 
   private ZusammenElement buildNetworkElement(NetworkEntity network, Action action) {
-    ZusammenElement networkElement = new ZusammenElement();
-    networkElement.setAction(action);
-    if (network.getId() != null) {
-      networkElement.setElementId(new Id(network.getId()));
-    }
+    ZusammenElement networkElement =
+        buildElement(network.getId() == null ? null : new Id(network.getId()), action);
     Info info = new Info();
-    info.addProperty(ElementPropertyName.type.name(), ElementType.Network);
+    info.addProperty(ElementPropertyName.elementType.name(), ElementType.Network);
     info.addProperty(ElementPropertyName.compositionData.name(), network.getCompositionData());
     networkElement.setInfo(info);
     networkElement.setData(new ByteArrayInputStream(network.getCompositionData().getBytes()));
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/NicDaoZusammenImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/NicDaoZusammenImpl.java
index e597068..268e254 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/NicDaoZusammenImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/NicDaoZusammenImpl.java
@@ -1,20 +1,21 @@
 package org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen;
 
 import com.amdocs.zusammen.adaptor.inbound.api.types.item.Element;
-import com.amdocs.zusammen.adaptor.inbound.api.types.item.ElementInfo;
 import com.amdocs.zusammen.adaptor.inbound.api.types.item.ZusammenElement;
 import com.amdocs.zusammen.datatypes.Id;
 import com.amdocs.zusammen.datatypes.SessionContext;
 import com.amdocs.zusammen.datatypes.item.Action;
 import com.amdocs.zusammen.datatypes.item.ElementContext;
 import com.amdocs.zusammen.datatypes.item.Info;
-import org.openecomp.core.utilities.file.FileUtils;
 import org.openecomp.core.zusammen.api.ZusammenAdaptor;
-import org.openecomp.core.zusammen.api.ZusammenUtil;
+import org.openecomp.sdc.datatypes.model.ElementType;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.NicDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.convertor.ElementToNicConvertor;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.convertor.ElementToNicQuestionnaireConvertor;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity;
 import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.types.ElementPropertyName;
 
 import java.io.ByteArrayInputStream;
 import java.util.Collection;
@@ -22,6 +23,10 @@
 import java.util.Optional;
 import java.util.stream.Collectors;
 
+import static org.openecomp.core.zusammen.api.ZusammenUtil.buildElement;
+import static org.openecomp.core.zusammen.api.ZusammenUtil.buildStructuralElement;
+import static org.openecomp.core.zusammen.api.ZusammenUtil.createSessionContext;
+
 public class NicDaoZusammenImpl implements NicDao {
 
   private ZusammenAdaptor zusammenAdaptor;
@@ -37,82 +42,70 @@
 
   @Override
   public Collection<NicEntity> list(NicEntity nic) {
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(nic.getVspId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor),
-        VspZusammenUtil.getVersionTag(nic.getVersion()));
-
-    return listNics(context, elementContext, nic);
+    SessionContext context = createSessionContext();
+    return listNics(context, new ElementContext(nic.getVspId(), nic.getVersion().getId()), nic);
   }
 
   private Collection<NicEntity> listNics(SessionContext context, ElementContext elementContext,
                                          NicEntity nic) {
-    return zusammenAdaptor
-        .listElementsByName(context, elementContext, new Id(nic.getComponentId()),
-            StructureElement.Nics.name())
-        .stream().map(elementInfo -> mapElementInfoToNic(
-            nic.getVspId(), nic.getVersion(), nic.getComponentId(), elementInfo))
+    ElementToNicConvertor convertor = new ElementToNicConvertor();
+    return zusammenAdaptor.listElementsByName(context, elementContext, new Id(nic.getComponentId()),
+        ElementType.Nics.name())
+        .stream().map(convertor::convert)
+        .map(nicEntity -> {
+          nicEntity.setComponentId(nicEntity.getComponentId());
+          nicEntity.setVspId(nic.getVspId());
+          nicEntity.setVersion(nic.getVersion());
+          return nicEntity;
+        })
         .collect(Collectors.toList());
   }
 
-  private NicEntity mapElementInfoToNic(String vspId, Version version,
-                                        String componentId, ElementInfo elementInfo) {
-    NicEntity nicEntity =
-        new NicEntity(vspId, version, componentId, elementInfo.getId().getValue());
-    nicEntity.setCompositionData(
-        elementInfo.getInfo().getProperty(ElementPropertyName.compositionData.name()));
-    return nicEntity;
-  }
 
   @Override
   public void create(NicEntity nic) {
     ZusammenElement nicElement = nicToZusammen(nic, Action.CREATE);
 
-    ZusammenElement nicsElement =
-        VspZusammenUtil.buildStructuralElement(StructureElement.Nics, null);
+    ZusammenElement nicsElement = buildStructuralElement(ElementType.Nics, Action.IGNORE);
     nicsElement.setSubElements(Collections.singletonList(nicElement));
 
-    ZusammenElement componentElement =
-        buildZusammenElement(new Id(nic.getComponentId()), Action.IGNORE);
+    ZusammenElement componentElement = buildElement(new Id(nic.getComponentId()), Action.IGNORE);
     componentElement.setSubElements(Collections.singletonList(nicsElement));
 
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(nic.getVspId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor));
+    SessionContext context = createSessionContext();
+    ElementContext elementContext = new ElementContext(nic.getVspId(), nic.getVersion().getId());
 
-    Optional<Element> savedElement =
+    Element savedElement =
         zusammenAdaptor.saveElement(context, elementContext, componentElement, "Create nic");
-    savedElement.ifPresent(element ->
-        nic.setId(element.getSubElements().iterator().next()
-            .getSubElements().iterator().next().getElementId().getValue()));
+    nic.setId(savedElement.getSubElements().iterator().next()
+        .getSubElements().iterator().next().getElementId().getValue());
   }
 
   @Override
   public void update(NicEntity nic) {
     ZusammenElement nicElement = nicToZusammen(nic, Action.UPDATE);
 
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(nic.getVspId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor));
-    zusammenAdaptor.saveElement(context, elementContext, nicElement,
-        String.format("Update nic with id %s", nic.getId()));
+    SessionContext context = createSessionContext();
+    zusammenAdaptor
+        .saveElement(context, new ElementContext(nic.getVspId(), nic.getVersion().getId()),
+            nicElement, String.format("Update nic with id %s", nic.getId()));
   }
 
   @Override
   public NicEntity get(NicEntity nic) {
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(nic.getVspId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor),
-        VspZusammenUtil.getVersionTag(nic.getVersion()));
-    Optional<Element> element = zusammenAdaptor.getElement(context, elementContext, nic.getId());
+    SessionContext context = createSessionContext();
+    ElementToNicConvertor convertor = new ElementToNicConvertor();
+    Optional<Element> element = zusammenAdaptor
+        .getElement(context, new ElementContext(nic.getVspId(), nic.getVersion().getId()),
+            nic.getId());
 
     if (element.isPresent()) {
-      nic.setCompositionData(new String(FileUtils.toByteArray(element.get().getData())));
-      return nic;
+      NicEntity entity = convertor.convert(element.get());
+      entity.setVspId(nic.getVspId());
+      entity.setVersion(nic.getVersion());
+      entity.setComponentId(nic.getComponentId());
+
+      return entity;
     } else {
       return null;
     }
@@ -120,26 +113,20 @@
 
   @Override
   public void delete(NicEntity nic) {
-    ZusammenElement nicElement = buildZusammenElement(new Id(nic.getId()), Action.DELETE);
+    ZusammenElement nicElement = buildElement(new Id(nic.getId()), Action.DELETE);
 
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(nic.getVspId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor));
-    zusammenAdaptor.saveElement(context, elementContext, nicElement,
-        String.format("Delete nic with id %s", nic.getId()));
+    SessionContext context = createSessionContext();
+    zusammenAdaptor
+        .saveElement(context, new ElementContext(nic.getVspId(), nic.getVersion().getId()),
+            nicElement, String.format("Delete nic with id %s", nic.getId()));
   }
 
   @Override
   public NicEntity getQuestionnaireData(String vspId, Version version, String componentId,
                                         String nicId) {
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(vspId);
-    ElementContext elementContext = new ElementContext(itemId,
-        VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor),
-        VspZusammenUtil.getVersionTag(version));
+    SessionContext context = createSessionContext();
 
-    return getQuestionnaire(context, elementContext,
+    return getQuestionnaire(context, new ElementContext(vspId, version.getId()),
         new NicEntity(vspId, version, componentId, nicId));
   }
 
@@ -147,14 +134,13 @@
                                      NicEntity nic) {
     Optional<Element> questionnaireElement = zusammenAdaptor
         .getElementByName(context, elementContext, new Id(nic.getId()),
-            StructureElement.Questionnaire.name());
-    return questionnaireElement.map(
-        element -> element.getData() == null
-            ? null
-            : new String(FileUtils.toByteArray(element.getData())))
-        .map(questionnaireData -> {
-          nic.setQuestionnaireData(questionnaireData);
-          return nic;
+            ElementType.NicQuestionnaire.name());
+    return questionnaireElement.map(new ElementToNicQuestionnaireConvertor()::convert)
+        .map(entity -> {
+          entity.setVspId(nic.getVspId());
+          entity.setVersion(nic.getVersion());
+          entity.setComponentId(nic.getComponentId());
+          return entity;
         })
         .orElse(null);
   }
@@ -165,29 +151,22 @@
     ZusammenElement questionnaireElement =
         nicQuestionnaireToZusammen(questionnaireData, Action.UPDATE);
 
-    ZusammenElement nicElement = new ZusammenElement();
-    nicElement.setAction(Action.IGNORE);
-    nicElement.setElementId(new Id(nicId));
+    ZusammenElement nicElement = buildElement(new Id(nicId), Action.IGNORE);
     nicElement.setSubElements(Collections.singletonList(questionnaireElement));
 
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(vspId);
-    ElementContext elementContext = new ElementContext(itemId,
-        VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor));
-    zusammenAdaptor.saveElement(context, elementContext, nicElement, "Update nic questionnaire");
+    SessionContext context = createSessionContext();
+    zusammenAdaptor.saveElement(context, new ElementContext(vspId, version.getId()), nicElement,
+        "Update nic questionnaire");
   }
 
   @Override
   public Collection<NicEntity> listByVsp(String vspId, Version version) {
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(vspId);
-    ElementContext elementContext = new ElementContext(itemId,
-        VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor),
-        VspZusammenUtil.getVersionTag(version));
+    SessionContext context = createSessionContext();
 
     Collection<ComponentEntity> components = ComponentDaoZusammenImpl
-        .listComponents(zusammenAdaptor, context, elementContext, vspId, version);
+        .listComponents(zusammenAdaptor, context, vspId, version);
 
+    ElementContext elementContext = new ElementContext(vspId, version.getId());
     return components.stream()
         .map(component ->
             listNics(context, elementContext,
@@ -200,16 +179,22 @@
 
   @Override
   public void deleteByComponentId(String vspId, Version version, String componentId) {
-    ZusammenElement componentElement = buildZusammenElement(new Id(componentId), Action.IGNORE);
-    componentElement.setSubElements(Collections.singletonList(
-        VspZusammenUtil.buildStructuralElement(StructureElement.Nics, Action.DELETE)));
+    SessionContext context = createSessionContext();
+    ElementContext elementContext = new ElementContext(vspId, version.getId());
 
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(vspId);
-    ElementContext elementContext = new ElementContext(itemId,
-        VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor));
-    zusammenAdaptor.saveElement(context, elementContext, componentElement,
-        String.format("Delete all nics of component %s", componentId));
+    Optional<Element> optionalElement = zusammenAdaptor.getElementByName(context,
+        elementContext, new Id(componentId), ElementType.Nics.name());
+
+    if (optionalElement.isPresent()) {
+      Element nicsElement = optionalElement.get();
+      Collection<Element> nics = nicsElement.getSubElements();
+
+      nics.forEach(nic -> {
+        ZusammenElement nicZusammenElement = buildElement(nic.getElementId(), Action.DELETE);
+        zusammenAdaptor.saveElement(context, elementContext, nicZusammenElement,
+            "Delete nic with id " + nic.getElementId());
+      });
+    }
   }
 
   @Override
@@ -229,26 +214,16 @@
   private ZusammenElement nicQuestionnaireToZusammen(String questionnaireData,
                                                      Action action) {
     ZusammenElement questionnaireElement =
-        VspZusammenUtil.buildStructuralElement(StructureElement.Questionnaire, action);
+        buildStructuralElement(ElementType.NicQuestionnaire, action);
     questionnaireElement.setData(new ByteArrayInputStream(questionnaireData.getBytes()));
     return questionnaireElement;
   }
 
-  private ZusammenElement buildZusammenElement(Id elementId, Action action) {
-    ZusammenElement element = new ZusammenElement();
-    element.setElementId(elementId);
-    element.setAction(action);
-    return element;
-  }
-
   private ZusammenElement buildNicElement(NicEntity nic, Action action) {
-    ZusammenElement nicElement = new ZusammenElement();
-    nicElement.setAction(action);
-    if (nic.getId() != null) {
-      nicElement.setElementId(new Id(nic.getId()));
-    }
+    ZusammenElement nicElement =
+        buildElement(nic.getId() == null ? null : new Id(nic.getId()), action);
     Info info = new Info();
-    info.addProperty(ElementPropertyName.type.name(), ElementType.Nic);
+    info.addProperty(ElementPropertyName.elementType.name(), ElementType.Nic);
     info.addProperty(ElementPropertyName.compositionData.name(), nic.getCompositionData());
     nicElement.setInfo(info);
     nicElement.setData(new ByteArrayInputStream(nic.getCompositionData().getBytes()));
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/OrchestrationTemplateCandidateDaoZusammenImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/OrchestrationTemplateCandidateDaoZusammenImpl.java
index ea51b77..5d1ef12 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/OrchestrationTemplateCandidateDaoZusammenImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/OrchestrationTemplateCandidateDaoZusammenImpl.java
@@ -1,15 +1,16 @@
 package org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen;
 
 import com.amdocs.zusammen.adaptor.inbound.api.types.item.Element;
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.ElementInfo;
 import com.amdocs.zusammen.adaptor.inbound.api.types.item.ZusammenElement;
-import com.amdocs.zusammen.datatypes.Id;
 import com.amdocs.zusammen.datatypes.SessionContext;
 import com.amdocs.zusammen.datatypes.item.Action;
 import com.amdocs.zusammen.datatypes.item.ElementContext;
 import com.amdocs.zusammen.utils.fileutils.FileUtils;
+import org.apache.commons.io.IOUtils;
 import org.openecomp.core.utilities.json.JsonUtil;
 import org.openecomp.core.zusammen.api.ZusammenAdaptor;
-import org.openecomp.core.zusammen.api.ZusammenUtil;
+import org.openecomp.sdc.datatypes.model.ElementType;
 import org.openecomp.sdc.logging.api.Logger;
 import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.OrchestrationTemplateCandidateDao;
@@ -18,11 +19,18 @@
 import org.openecomp.sdc.versioning.dao.types.Version;
 
 import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
 import java.nio.ByteBuffer;
+import java.util.Arrays;
 import java.util.Optional;
 
+import static org.openecomp.core.zusammen.api.ZusammenUtil.buildStructuralElement;
+import static org.openecomp.core.zusammen.api.ZusammenUtil.createSessionContext;
+
 public class OrchestrationTemplateCandidateDaoZusammenImpl
     implements OrchestrationTemplateCandidateDao {
+
   private static final Logger logger =
       LoggerFactory.getLogger(OrchestrationTemplateCandidateDaoZusammenImpl.class);
 
@@ -39,95 +47,163 @@
 
   @Override
   public OrchestrationTemplateCandidateData get(String vspId, Version version) {
-    logger.info("Getting orchestration template for vsp id -> " + vspId);
+    logger.info("Getting orchestration template for VendorSoftwareProduct id -> " + vspId);
 
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(vspId);
-    Id versionId = VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor);
-    ElementContext elementContext = new ElementContext(itemId, versionId,
-        VspZusammenUtil.getVersionTag(version));
+    SessionContext context = createSessionContext();
+    ElementContext elementContext = new ElementContext(vspId, version.getId());
 
     Optional<Element> candidateElement =
         zusammenAdaptor.getElementByName(context, elementContext, null,
-            StructureElement.OrchestrationTemplateCandidate.name());
+            ElementType.OrchestrationTemplateCandidate.name());
     if (candidateElement.isPresent()) {
+      if (hasEmptyData(candidateElement.get().getData())) {
+        return null;
+      }
       OrchestrationTemplateCandidateData candidateData = new OrchestrationTemplateCandidateData();
       candidateData.setFilesDataStructure(
           new String(FileUtils.toByteArray(candidateElement.get().getData())));
 
-      zusammenAdaptor
+      Optional<Element> candidateContentElement = zusammenAdaptor
           .getElementByName(context, elementContext, candidateElement.get().getElementId(),
-              StructureElement.OrchestrationTemplateCandidateContent.name())
-          .ifPresent(candidateContentElement -> candidateData.setContentData(
-              ByteBuffer.wrap(FileUtils.toByteArray(candidateContentElement.getData()))));
-      logger.info("Finished getting orchestration template for vsp id -> " + vspId);
+              ElementType.OrchestrationTemplateCandidateContent.name());
+
+      if (candidateContentElement.isPresent()) {
+        candidateData.setContentData(
+            ByteBuffer.wrap(FileUtils.toByteArray(candidateContentElement.get().getData())));
+        candidateData.setFileSuffix(candidateContentElement.get().getInfo()
+            .getProperty(InfoPropertyName.fileSuffix.name()));
+        candidateData.setFileName(candidateContentElement.get().getInfo()
+            .getProperty(InfoPropertyName.fileName.name()));
+      }
+      logger
+          .info("Finished getting orchestration template for VendorSoftwareProduct id -> " + vspId);
       return candidateData;
     }
-    logger.info(String.format("Orchestration template for vsp id %s does not exist", vspId));
+    logger.info(String
+        .format("Orchestration template for VendorSoftwareProduct id %s does not exist", vspId));
     return null;
   }
 
   @Override
-  public void update(String vspId, OrchestrationTemplateCandidateData candidateData) {
-    logger.info("Uploading candidate data entity for vsp id -> " + vspId);
+  public OrchestrationTemplateCandidateData getInfo(String vspId, Version version) {
+    logger.info("Getting orchestration template info for VendorSoftwareProduct id -> " + vspId);
 
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(vspId);
-    Id versionId = VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor);
-    ElementContext elementContext = new ElementContext(itemId, versionId);
+    SessionContext context = createSessionContext();
+    ElementContext elementContext = new ElementContext(vspId, version.getId());
 
-    ZusammenElement candidateElement = VspZusammenUtil
-        .buildStructuralElement(StructureElement.OrchestrationTemplateCandidate, Action.UPDATE);
+    Optional<ElementInfo> candidateElement =
+        zusammenAdaptor.getElementInfoByName(context, elementContext, null,
+            ElementType.OrchestrationTemplateCandidate.name());
+    if (candidateElement.isPresent()) {
+      OrchestrationTemplateCandidateData candidateData = new OrchestrationTemplateCandidateData();
+
+      Optional<Element> candidateContentElement = zusammenAdaptor
+          .getElementByName(context, elementContext, candidateElement.get().getId(),
+              ElementType.OrchestrationTemplateCandidateContent.name());
+
+      if (candidateContentElement.isPresent()) {
+        candidateData.setFileSuffix(candidateContentElement.get().getInfo()
+            .getProperty(InfoPropertyName.fileSuffix.name()));
+        candidateData.setFileName(candidateContentElement.get().getInfo()
+            .getProperty(InfoPropertyName.fileName.name()));
+      }
+      logger.info(
+          "Finished getting orchestration template info for VendorSoftwareProduct id -> " + vspId);
+      return candidateData;
+    }
+    logger.info(String
+        .format("Orchestration template info for VendorSoftwareProduct id %s does not exist",
+            vspId));
+    return null;
+  }
+
+  @Override
+  public void update(String vspId, Version version,
+                     OrchestrationTemplateCandidateData candidateData) {
+    logger.info("Uploading candidate data entity for VendorSoftwareProduct id -> " + vspId);
+
+    ZusammenElement candidateElement =
+        buildStructuralElement(ElementType.OrchestrationTemplateCandidate, Action.UPDATE);
     candidateElement
         .setData(new ByteArrayInputStream(candidateData.getFilesDataStructure().getBytes()));
-    ZusammenElement candidateContentElement = VspZusammenUtil
-        .buildStructuralElement(StructureElement.OrchestrationTemplateCandidateContent, Action.UPDATE);
+
+    ZusammenElement candidateContentElement =
+        buildStructuralElement(ElementType.OrchestrationTemplateCandidateContent, Action.UPDATE);
     candidateContentElement
         .setData(new ByteArrayInputStream(candidateData.getContentData().array()));
+    candidateContentElement.getInfo()
+        .addProperty(InfoPropertyName.fileSuffix.name(), candidateData.getFileSuffix());
+    candidateContentElement.getInfo()
+        .addProperty(InfoPropertyName.fileName.name(), candidateData.getFileName());
     candidateElement.addSubElement(candidateContentElement);
 
+    SessionContext context = createSessionContext();
+    ElementContext elementContext = new ElementContext(vspId, version.getId());
     zusammenAdaptor.saveElement(context, elementContext, candidateElement,
         "Update Orchestration Template Candidate");
-    logger.info("Finished uploading candidate data entity for vsp id -> " + vspId);
+    logger
+        .info("Finished uploading candidate data entity for VendorSoftwareProduct id -> " + vspId);
   }
 
+
   @Override
   public void updateStructure(String vspId, Version version, FilesDataStructure fileDataStructure) {
     logger.info("Updating orchestration template for VSP id -> " + vspId);
 
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(vspId);
-    Id versionId = VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor);
-    ElementContext elementContext = new ElementContext(itemId, versionId);
-
-    ZusammenElement candidateElement = VspZusammenUtil
-        .buildStructuralElement(StructureElement.OrchestrationTemplateCandidate, Action.UPDATE);
+    ZusammenElement candidateElement =
+        buildStructuralElement(ElementType.OrchestrationTemplateCandidate, Action.UPDATE);
     candidateElement
         .setData(new ByteArrayInputStream(JsonUtil.object2Json(fileDataStructure).getBytes()));
+
+    SessionContext context = createSessionContext();
+    ElementContext elementContext = new ElementContext(vspId, version.getId());
     zusammenAdaptor.saveElement(context, elementContext, candidateElement,
         "Update Orchestration Template Candidate structure");
-    logger.info("Finished uploading candidate data entity for vsp id -> " + vspId);
+    logger
+        .info("Finished uploading candidate data entity for VendorSoftwareProduct id -> " + vspId);
   }
 
 
   @Override
   public Optional<String> getStructure(String vspId, Version version) {
-    logger.info("Getting orchestration template structure for vsp id -> " + vspId);
+    logger
+        .info("Getting orchestration template structure for VendorSoftwareProduct id -> " + vspId);
 
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(vspId);
-    Id versionId = VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor);
-    ElementContext elementContext = new ElementContext(itemId, versionId,
-        VspZusammenUtil.getVersionTag(version));
+    SessionContext context = createSessionContext();
+    ElementContext elementContext = new ElementContext(vspId, version.getId());
 
-    logger.info("Finished getting orchestration template structure for vsp id -> " + vspId);
+    logger.info(
+        "Finished getting orchestration template structure for VendorSoftwareProduct id -> " +
+            vspId);
     Optional<Element> element = zusammenAdaptor.getElementByName(context, elementContext, null,
-        StructureElement.OrchestrationTemplateCandidate.name());
+        ElementType.OrchestrationTemplateCandidate.name());
     if (element.isPresent()) {
+      if (hasEmptyData(element.get().getData())) {
+        return Optional.empty();
+      }
       return Optional.of(new String(FileUtils.toByteArray(element.get().getData())));
     } else {
       return Optional.empty();
     }
+  }
 
+  private boolean hasEmptyData(InputStream elementData) {
+    String emptyData = "{}";
+    byte[] byteElementData;
+    try {
+      byteElementData = IOUtils.toByteArray(elementData);
+    } catch (IOException ex) {
+      ex.printStackTrace();
+      return false;
+    }
+    if (Arrays.equals(emptyData.getBytes(), byteElementData)) {
+      return true;
+    }
+    return false;
+  }
+
+  public enum InfoPropertyName {
+    fileSuffix,
+    fileName
   }
 }
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/OrchestrationTemplateDaoZusammenImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/OrchestrationTemplateDaoZusammenImpl.java
index 2b6d52a..d02e854 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/OrchestrationTemplateDaoZusammenImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/OrchestrationTemplateDaoZusammenImpl.java
@@ -3,22 +3,27 @@
 import com.amdocs.zusammen.adaptor.inbound.api.types.item.Element;
 import com.amdocs.zusammen.adaptor.inbound.api.types.item.ElementInfo;
 import com.amdocs.zusammen.adaptor.inbound.api.types.item.ZusammenElement;
-import com.amdocs.zusammen.datatypes.Id;
 import com.amdocs.zusammen.datatypes.SessionContext;
 import com.amdocs.zusammen.datatypes.item.Action;
 import com.amdocs.zusammen.datatypes.item.ElementContext;
 import com.amdocs.zusammen.utils.fileutils.FileUtils;
+import org.apache.commons.io.IOUtils;
 import org.openecomp.core.zusammen.api.ZusammenAdaptor;
-import org.openecomp.core.zusammen.api.ZusammenUtil;
+import org.openecomp.sdc.datatypes.model.ElementType;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.OrchestrationTemplateDao;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.UploadData;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.UploadDataEntity;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.OrchestrationTemplateEntity;
 import org.openecomp.sdc.versioning.dao.types.Version;
 
 import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
 import java.nio.ByteBuffer;
+import java.util.Arrays;
 import java.util.Optional;
 
+import static org.openecomp.core.zusammen.api.ZusammenUtil.buildStructuralElement;
+import static org.openecomp.core.zusammen.api.ZusammenUtil.createSessionContext;
+
 public class OrchestrationTemplateDaoZusammenImpl implements OrchestrationTemplateDao {
 
   private ZusammenAdaptor zusammenAdaptor;
@@ -33,79 +38,128 @@
   }
 
   @Override
-  public String getValidationData(String vspId, Version version) {
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(vspId);
-    ElementContext elementContext = new ElementContext(itemId,
-        VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor),
-        VspZusammenUtil.getVersionTag(version));
+  public OrchestrationTemplateEntity getInfo(String vspId, Version version) {
+    SessionContext context = createSessionContext();
+    ElementContext elementContext = new ElementContext(vspId, version.getId());
+
+    Optional<ElementInfo> vspModel = zusammenAdaptor
+        .getElementInfoByName(context, elementContext, null, ElementType.VspModel.name());
+    if (!vspModel.isPresent()) {
+      return null;
+    }
 
     Optional<ElementInfo> elementInfo = zusammenAdaptor
-        .getElementInfoByName(context, elementContext, null,
-            StructureElement.OrchestrationTemplate.name());
-    if (elementInfo.isPresent()) {
-      Optional<Element> element =
-          zusammenAdaptor.getElementByName(context, elementContext, elementInfo.get().getId(),
-              StructureElement.OrchestrationTemplateValidationData.name());
-      if (element.isPresent()) {
-        return new String(FileUtils.toByteArray(element.get().getData()));
+        .getElementInfoByName(context, elementContext, vspModel.get().getId(),
+            ElementType.OrchestrationTemplate.name());
+    if (!elementInfo.isPresent()) {
+      return null;
+    }
+
+    Optional<Element> element =
+        zusammenAdaptor.getElementByName(context, elementContext, elementInfo.get().getId(),
+            ElementType.OrchestrationTemplateValidationData.name());
+
+    OrchestrationTemplateEntity orchestrationTemplate = new OrchestrationTemplateEntity();
+    if (!element.isPresent()) {
+      return orchestrationTemplate;
+    }
+    orchestrationTemplate
+        .setFileSuffix(element.get().getInfo().getProperty(InfoPropertyName.fileSuffix.name()));
+    orchestrationTemplate
+        .setFileName(element.get().getInfo().getProperty(InfoPropertyName.fileName.name()));
+    if (!hasEmptyData(element.get().getData())) {
+      orchestrationTemplate
+          .setValidationData(new String(FileUtils.toByteArray(element.get().getData())));
+    }
+    return orchestrationTemplate;
+  }
+
+  @Override
+  public OrchestrationTemplateEntity get(String vspId, Version version) {
+    SessionContext context = createSessionContext();
+    ElementContext elementContext = new ElementContext(vspId, version.getId());
+
+    OrchestrationTemplateEntity orchestrationTemplate = new OrchestrationTemplateEntity();
+
+    Optional<ElementInfo> vspModel = zusammenAdaptor
+        .getElementInfoByName(context, elementContext, null, ElementType.VspModel.name());
+    if (!vspModel.isPresent()) {
+      return orchestrationTemplate;
+    }
+
+    Optional<Element> orchestrationTemplateElement = zusammenAdaptor
+        .getElementByName(context, elementContext, vspModel.get().getId(),
+            ElementType.OrchestrationTemplate.name());
+    if (!orchestrationTemplateElement.isPresent()) {
+      return orchestrationTemplate;
+    }
+
+    if (!hasEmptyData(orchestrationTemplateElement.get().getData())) {
+      orchestrationTemplate.setContentData(
+          ByteBuffer.wrap(FileUtils.toByteArray(orchestrationTemplateElement.get().getData())));
+    }
+
+    Optional<Element> validationDataElement =
+        zusammenAdaptor.getElementByName(context, elementContext,
+            orchestrationTemplateElement.get().getElementId(),
+            ElementType.OrchestrationTemplateValidationData.name());
+    if (validationDataElement.isPresent()) {
+      orchestrationTemplate.setFileSuffix(validationDataElement.get().getInfo()
+          .getProperty(InfoPropertyName.fileSuffix.name()));
+      orchestrationTemplate.setFileName(validationDataElement.get().getInfo()
+          .getProperty(InfoPropertyName.fileName.name()));
+      if (!hasEmptyData(validationDataElement.get().getData())) {
+        orchestrationTemplate.setValidationData(
+            new String(FileUtils.toByteArray(validationDataElement.get().getData())));
       }
     }
-
-    return null;
+    return orchestrationTemplate;
   }
 
   @Override
-  public UploadDataEntity getOrchestrationTemplate(String vspId, Version version) {
+  public void update(String vspId, Version version,
+                     OrchestrationTemplateEntity orchestrationTemplate) {
+    SessionContext context = createSessionContext();
+    ElementContext elementContext = new ElementContext(vspId, version.getId());
 
-    UploadDataEntity uploadData = new UploadDataEntity();
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(vspId);
-    ElementContext elementContext = new ElementContext(itemId,
-        VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor),
-        VspZusammenUtil.getVersionTag(version));
+    ZusammenElement validationData =
+        buildStructuralElement(ElementType.OrchestrationTemplateValidationData, Action.UPDATE);
+    validationData
+        .setData(new ByteArrayInputStream(orchestrationTemplate.getValidationData().getBytes()));
+    validationData.getInfo()
+        .addProperty(InfoPropertyName.fileSuffix.name(), orchestrationTemplate.getFileSuffix());
+    validationData.getInfo()
+        .addProperty(InfoPropertyName.fileName.name(), orchestrationTemplate.getFileName());
 
-    Optional<ElementInfo> elementInfo = zusammenAdaptor
-        .getElementInfoByName(context, elementContext, null,
-            StructureElement.OrchestrationTemplate.name());
-    if (elementInfo.isPresent()) {
-      Optional<Element> element =
-          zusammenAdaptor.getElementByName(context, elementContext, elementInfo.get().getId(),
-              StructureElement.OrchestrationTemplateValidationData.name());
-      element.ifPresent(element1 -> uploadData
-          .setValidationData(new String(FileUtils.toByteArray(element1.getData()))));
-      element =
-          zusammenAdaptor.getElementByName(context, elementContext, elementInfo.get().getId(),
-              StructureElement.OrchestrationTemplateContent.name());
-      element.ifPresent(element1 -> uploadData
-          .setContentData(ByteBuffer.wrap(FileUtils.toByteArray(element1.getData()))));
-    }
-    return uploadData;
-  }
-
-  @Override
-  public void updateOrchestrationTemplateData(String vspId, UploadData uploadData) {
     ZusammenElement orchestrationTemplateElement =
-        VspZusammenUtil.buildStructuralElement(StructureElement.OrchestrationTemplate, null);
-    ZusammenElement orchestrationTemplateValidationDataElement =
-        VspZusammenUtil
-            .buildStructuralElement(StructureElement.OrchestrationTemplateValidationData, Action.UPDATE);
-    orchestrationTemplateValidationDataElement.setData(new ByteArrayInputStream(uploadData
-        .getValidationData().getBytes()));
-    ZusammenElement orchestrationTemplateContent =
-        VspZusammenUtil.buildStructuralElement(StructureElement.OrchestrationTemplateContent, Action.UPDATE);
-    orchestrationTemplateContent
-        .setData(new ByteArrayInputStream(uploadData.getContentData().array()));
-    orchestrationTemplateElement.addSubElement(orchestrationTemplateValidationDataElement);
-    orchestrationTemplateElement.addSubElement(orchestrationTemplateContent);
+        buildStructuralElement(ElementType.OrchestrationTemplate, Action.UPDATE);
+    orchestrationTemplateElement
+        .setData(new ByteArrayInputStream(orchestrationTemplate.getContentData().array()));
+    orchestrationTemplateElement.addSubElement(validationData);
 
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(vspId);
-    ElementContext elementContext = new ElementContext(itemId,
-        VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor));
+    ZusammenElement vspModel = buildStructuralElement(ElementType.VspModel, Action.IGNORE);
+    vspModel.addSubElement(orchestrationTemplateElement);
 
-    zusammenAdaptor.saveElement(context, elementContext, orchestrationTemplateElement, "Update " +
-        "Orchestration Template");
+    zusammenAdaptor.saveElement(context, elementContext, vspModel, "Update Orchestration Template");
   }
 
+  private boolean hasEmptyData(InputStream elementData) {
+    String emptyData = "{}";
+    byte[] byteElementData;
+    try {
+      byteElementData = IOUtils.toByteArray(elementData);
+    } catch (IOException ex) {
+      ex.printStackTrace();
+      return false;
+    }
+    if (Arrays.equals(emptyData.getBytes(), byteElementData)) {
+      return true;
+    }
+    return false;
+  }
+
+  private enum InfoPropertyName {
+    fileSuffix,
+    fileName
+  }
 }
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/ProcessDaoZusammenImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/ProcessDaoZusammenImpl.java
index b0cff43..d74900b 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/ProcessDaoZusammenImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/ProcessDaoZusammenImpl.java
@@ -8,34 +8,35 @@
 import com.amdocs.zusammen.datatypes.item.Action;
 import com.amdocs.zusammen.datatypes.item.ElementContext;
 import com.amdocs.zusammen.datatypes.item.Info;
-import org.openecomp.core.utilities.file.FileUtils;
 import org.openecomp.core.zusammen.api.ZusammenAdaptor;
-import org.openecomp.core.zusammen.api.ZusammenUtil;
+import org.openecomp.sdc.datatypes.model.ElementType;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.ProcessDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.convertor.ElementToProcessConvertor;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessType;
 import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.types.ElementPropertyName;
 
 import java.io.ByteArrayInputStream;
-import java.nio.ByteBuffer;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Objects;
 import java.util.Optional;
 import java.util.stream.Collectors;
 
+import static org.openecomp.core.zusammen.api.ZusammenUtil.buildElement;
+import static org.openecomp.core.zusammen.api.ZusammenUtil.buildStructuralElement;
+import static org.openecomp.core.zusammen.api.ZusammenUtil.createSessionContext;
+import static org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.convertor.ElementToProcessConvertor.ARTIFACT_NAME;
+import static org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.convertor.ElementToProcessConvertor.DESCRIPTION;
+import static org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.convertor.ElementToProcessConvertor.NAME;
+import static org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.convertor.ElementToProcessConvertor.PROCESS_TYPE;
+
 /**
  * @author Avrahamg.
  * @since March 23, 2017
  */
 public class ProcessDaoZusammenImpl implements ProcessDao {
 
-  private static final String NAME = "name";
-  private static final String ELEMENT_TYPE = "type";
-  private static final String ARTIFACT_NAME = "artifactName";
-  private static final String DESCRIPTION = "description";
-  private static final String PROCESS_TYPE = "processType";
-
   private ZusammenAdaptor zusammenAdaptor;
 
   public ProcessDaoZusammenImpl(ZusammenAdaptor zusammenAdaptor) {
@@ -52,85 +53,59 @@
     ZusammenElement processElement = buildProcessElement(processEntity, Action.CREATE);
 
     ZusammenElement processesElement =
-        VspZusammenUtil.buildStructuralElement(StructureElement.Processes, null);
+        buildStructuralElement(ElementType.Processes, Action.IGNORE);
     ZusammenElement aggregatedElement = VspZusammenUtil.aggregateElements(processesElement,
         processElement);
     ZusammenElement componentElement;
     if (processEntity.getComponentId() != null) {
-      componentElement = createParentElement(processEntity);
+      componentElement = buildElement(new Id(processEntity.getComponentId()), Action.IGNORE);
       aggregatedElement =
           VspZusammenUtil.aggregateElements(componentElement, aggregatedElement);
     }
 
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(processEntity.getVspId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor));
+    SessionContext context = createSessionContext();
+    ElementContext elementContext =
+        new ElementContext(processEntity.getVspId(), processEntity.getVersion().getId());
 
-    Optional<Element> savedElement =
+    Element savedElement =
         zusammenAdaptor.saveElement(context, elementContext, aggregatedElement, "Create process");
-    savedElement.ifPresent(element -> {
-      if (processEntity.getComponentId() == null) {
-        processEntity.setId(element.getSubElements().iterator().next()
-            .getElementId().getValue());
-      } else {
-        processEntity.setId(element.getSubElements().iterator().next()
-            .getSubElements().iterator().next().getElementId().getValue());
-      }
-    });
+    processEntity
+        .setId(processEntity.getComponentId() == null
+            ? savedElement.getSubElements().iterator().next().getElementId().getValue()
+            : savedElement.getSubElements().iterator().next().getSubElements()
+                .iterator().next().getElementId().getValue());
   }
 
   @Override
-  public ProcessEntity get(ProcessEntity process) {
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(process.getVspId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor),
-        VspZusammenUtil.getVersionTag(process.getVersion()));
+  public ProcessEntity get(ProcessEntity processEntity) {
+    SessionContext context = createSessionContext();
+    ElementContext elementContext =
+        new ElementContext(processEntity.getVspId(), processEntity.getVersion().getId());
 
-    Optional<Element> elementOptional =
-        zusammenAdaptor.getElement(context, elementContext, process.getId());
-
-    if (elementOptional.isPresent()) {
-      Element element = elementOptional.get();
-      process.setName(element.getInfo().getProperty(NAME));
-      process.setArtifactName(element.getInfo().getProperty(ARTIFACT_NAME));
-      process.setDescription(element.getInfo().getProperty(DESCRIPTION));
-      process.setType(element.getInfo().getProperty
-          (PROCESS_TYPE) != null ? ProcessType.valueOf(element.getInfo().getProperty
-          (PROCESS_TYPE)) : null);
-
-      process.setArtifact(ByteBuffer.wrap(FileUtils.toByteArray(element.getData())));
-      return process;
-    } else {
-      return null;
-    }
+    return zusammenAdaptor.getElementInfo(context, elementContext, new Id(processEntity.getId()))
+        .map(elementInfo -> convertToProcessEntity(elementInfo, new ElementToProcessConvertor(),
+            processEntity))
+        .orElse(null);
   }
 
   @Override
   public void update(ProcessEntity processEntity) {
-    ZusammenElement processElement = buildProcessElement(processEntity, Action.UPDATE);
+    ProcessEntity retrieved = getArtifact(processEntity);
+    if (retrieved != null && retrieved.getArtifact() != null) {
+      processEntity.setArtifactName(retrieved.getArtifactName());
+      processEntity.setArtifact(retrieved.getArtifact());
+    }
 
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(processEntity.getVspId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor));
-
-    Optional<Element> element =
-        zusammenAdaptor.saveElement(context, elementContext, processElement, "Create process");
-    System.out.println(element.get().getElementId());
+    update(processEntity, "Update process");
   }
 
   @Override
   public void delete(ProcessEntity processEntity) {
-    ZusammenElement processElement = new ZusammenElement();
-    processElement.setElementId(new Id(processEntity.getId()));
-    processElement.setAction(Action.DELETE);
+    ZusammenElement processElement = buildElement(new Id(processEntity.getId()), Action.DELETE);
 
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(processEntity.getVspId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor));
+    SessionContext context = createSessionContext();
+    ElementContext elementContext =
+        new ElementContext(processEntity.getVspId(), processEntity.getVersion().getId());
 
     zusammenAdaptor.saveElement(context, elementContext, processElement,
         String.format("Delete process with id %s", processEntity.getId()));
@@ -138,84 +113,158 @@
 
   @Override
   public void deleteAll(ProcessEntity processEntity) {
-    ZusammenElement aggregatedElement =
-        VspZusammenUtil.buildStructuralElement(StructureElement.Processes, Action.DELETE);
+    SessionContext context = createSessionContext();
+    ElementContext elementContext =
+        new ElementContext(processEntity.getVspId(), processEntity.getVersion().getId());
+
+    Optional<Element> optionalElement = zusammenAdaptor.getElementByName(context,
+        elementContext, new Id(processEntity.getComponentId()), ElementType.Processes.name());
+
+  /*  ZusammenElement aggregatedElement =
+        buildStructuralElement(ElementType.Processes, Action.DELETE);
 
     if (processEntity.getComponentId() != null) {
       ZusammenElement componentElement = createParentElement(processEntity);
-      aggregatedElement = VspZusammenUtil.aggregateElements(componentElement,
+      aggregatedElement = VspaggregateElements(componentElement,
           aggregatedElement);
     }
 
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(processEntity.getVspId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor));
-    zusammenAdaptor.saveElement(context, elementContext, aggregatedElement, "Delete All processes");
+    zusammenAdaptor.saveElement(context, elementContext, aggregatedElement, "Delete All
+    processes");*/
+
+    if (optionalElement.isPresent()) {
+      Element processesElement = optionalElement.get();
+      Collection<Element> processes = processesElement.getSubElements();
+
+      processes.forEach(process -> {
+        ZusammenElement processZusammenElement =
+            buildElement(process.getElementId(), Action.DELETE);
+        zusammenAdaptor.saveElement(context, elementContext, processZusammenElement,
+            "Delete Process with id " + process.getElementId());
+      });
+    }
   }
 
   @Override
   public void deleteVspAll(String vspId, Version version) {
-    ProcessEntity processEntity = new ProcessEntity();
+    /* ProcessEntity processEntity = new ProcessEntity();
     processEntity.setVersion(version);
     processEntity.setVspId(vspId);
-    deleteAll(processEntity);
+    deleteAll(processEntity); */
+
+    SessionContext context = createSessionContext();
+    ElementContext elementContext =
+        new ElementContext(vspId, version.getId());
+
+    Optional<Element> optionalElement = zusammenAdaptor.getElementByName(context,
+        elementContext, null, ElementType.Processes.name());
+
+    if (optionalElement.isPresent()) {
+      Element processesElement = optionalElement.get();
+      Collection<Element> processes = processesElement.getSubElements();
+
+      processes.forEach(process -> {
+        ZusammenElement processZusammenElement =
+            buildElement(process.getElementId(), Action.DELETE);
+        zusammenAdaptor.saveElement(context, elementContext, processZusammenElement,
+            "Delete Process with id " + process.getElementId());
+      });
+    }
   }
 
   @Override
-  public Collection<ProcessEntity> list(ProcessEntity process) {
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(process.getVspId());
-    ElementContext elementContext = new ElementContext(itemId,
-        VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor),
-        VspZusammenUtil.getVersionTag(process.getVersion()));
+  public ProcessEntity getArtifact(ProcessEntity processEntity) {
+    SessionContext context = createSessionContext();
+    ElementContext elementContext =
+        new ElementContext(processEntity.getVspId(), processEntity.getVersion().getId());
+
+    return zusammenAdaptor.getElement(context, elementContext, processEntity.getId())
+        .map(element -> {
+          ProcessEntity process = new ElementToProcessConvertor().convert(element);
+          process.setVspId(processEntity.getVspId());
+          process.setVersion(processEntity.getVersion());
+          process.setComponentId(processEntity.getComponentId());
+          return process;
+        })
+        .orElse(null);
+  }
+
+  @Override
+  public void uploadArtifact(ProcessEntity processEntity) {
+    ProcessEntity retrieved = get(processEntity);
+    if (retrieved != null) {
+      retrieved.setArtifactName(processEntity.getArtifactName());
+      retrieved.setArtifact(processEntity.getArtifact());
+
+      update(retrieved, "Upload process artifact");
+    }
+  }
+
+  @Override
+  public void deleteArtifact(ProcessEntity processEntity) {
+    ProcessEntity retrieved = get(processEntity);
+    if (retrieved != null) {
+      retrieved.setArtifactName(null);
+      retrieved.setArtifact(null);
+
+      update(retrieved, "Delete process artifact");
+    }
+  }
+
+  @Override
+  public Collection<ProcessEntity> list(ProcessEntity processEntity) {
+    SessionContext context = createSessionContext();
+    ElementContext elementContext =
+        new ElementContext(processEntity.getVspId(), processEntity.getVersion().getId());
 
     Optional<ElementInfo> processesOptional =
         zusammenAdaptor.getElementInfoByName(context, elementContext,
-            extractParentElementId(process), StructureElement.Processes.name());
+            extractParentElementId(processEntity), ElementType.Processes.name());
     if (!processesOptional.isPresent()) {
       return new ArrayList<>();
     }
+    ElementToProcessConvertor convertor = new ElementToProcessConvertor();
     return zusammenAdaptor.listElements(context, elementContext, processesOptional.get().getId())
         .stream()
-        .map(elementInfo -> mapElementInfoToProcess(
-            process.getVspId(), process.getVersion(), process.getComponentId(),
-            elementInfo))
+        .map(elementInfo -> convertToProcessEntity(elementInfo, convertor, processEntity))
         .collect(Collectors.toList());
   }
 
+  private ProcessEntity convertToProcessEntity(ElementInfo elementInfo,
+                                               ElementToProcessConvertor convertor,
+                                               ProcessEntity inputProcess) {
+    ProcessEntity process = convertor.convert(elementInfo);
+    process.setVspId(inputProcess.getVspId());
+    process.setVersion(inputProcess.getVersion());
+    process.setComponentId(inputProcess.getComponentId());
+    return process;
+  }
+
+  private void update(ProcessEntity processEntity, String message) {
+    ZusammenElement processElement = buildProcessElement(processEntity, Action.UPDATE);
+
+    SessionContext context = createSessionContext();
+    ElementContext elementContext =
+        new ElementContext(processEntity.getVspId(), processEntity.getVersion().getId());
+
+    zusammenAdaptor.saveElement(context, elementContext, processElement, message);
+  }
+
   private Id extractParentElementId(ProcessEntity processEntity) {
     return processEntity.getComponentId() == null ? null : new Id(processEntity.getComponentId());
   }
 
-  private ProcessEntity mapElementInfoToProcess(String vspId, Version version,
-                                                String componentId,
-                                                ElementInfo elementInfo) {
-    ProcessEntity processEntity = new ProcessEntity(vspId, version, componentId, elementInfo
-        .getId().getValue());
-    processEntity.setName((String) elementInfo.getInfo().getProperties().get(NAME));
-    processEntity
-        .setArtifactName((String) elementInfo.getInfo().getProperties().get(ARTIFACT_NAME));
-    processEntity.setDescription((String) elementInfo.getInfo().getProperties().get(DESCRIPTION));
-    processEntity.setType( elementInfo.getInfo().getProperties().get(PROCESS_TYPE) != null ?
-            ProcessType.valueOf((String) elementInfo.getInfo().getProperties().get(PROCESS_TYPE)) :
-            null);
-    return processEntity;
-  }
-
   private ZusammenElement buildProcessElement(ProcessEntity process, Action action) {
 
     Info info = new Info();
     info.setName(process.getName());
     info.addProperty(NAME, process.getName());
-    info.addProperty(ELEMENT_TYPE, ElementType.Process);
+    info.addProperty(ElementPropertyName.elementType.name(), ElementType.Process);
     info.addProperty(ARTIFACT_NAME, process.getArtifactName());
     info.addProperty(DESCRIPTION, process.getDescription());
     info.addProperty(PROCESS_TYPE, process.getType() != null ? process.getType().name() : null);
 
-    ZusammenElement processElement = new ZusammenElement();
-    processElement.setElementId(new Id(process.getId()));
-    processElement.setAction(action);
+    ZusammenElement processElement = buildElement(new Id(process.getId()), action);
     processElement.setInfo(info);
     if (Objects.nonNull(process.getArtifact())) {
       processElement.setData(new ByteArrayInputStream(process.getArtifact().array()));
@@ -223,10 +272,4 @@
     return processElement;
   }
 
-  private ZusammenElement createParentElement(ProcessEntity entity) {
-    ZusammenElement componentElement = new ZusammenElement();
-    componentElement.setElementId(new Id(entity.getComponentId()));
-    componentElement.setAction(Action.IGNORE);
-    return componentElement;
-  }
 }
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/StructureElement.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/StructureElement.java
deleted file mode 100644
index 6f15f5c..0000000
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/StructureElement.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen;
-
-public enum StructureElement {
-  General,
-  OrchestrationTemplateCandidate,
-  OrchestrationTemplate,
-  OrchestrationTemplateValidationData,
-  OrchestrationTemplateContent,
-  OrchestrationTemplateCandidateValidationData,
-  OrchestrationTemplateCandidateContent,
-  Networks,
-  Components,
-  Nics,
-  Processes,
-  Mibs,
-  SNMP_TRAP,
-  SNMP_POLL,
-  VES_EVENTS,
-  Questionnaire,
-  ComponentDependencies,
-  Computes,
-  Images,
-  DeploymentFlavors
-}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/VendorSoftwareProductInfoDaoZusammenImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/VendorSoftwareProductInfoDaoZusammenImpl.java
index 517a01e..aa192ed 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/VendorSoftwareProductInfoDaoZusammenImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/VendorSoftwareProductInfoDaoZusammenImpl.java
@@ -1,16 +1,15 @@
 package org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen;
 
 import com.amdocs.zusammen.adaptor.inbound.api.types.item.ZusammenElement;
-import com.amdocs.zusammen.datatypes.Id;
 import com.amdocs.zusammen.datatypes.SessionContext;
 import com.amdocs.zusammen.datatypes.item.Action;
 import com.amdocs.zusammen.datatypes.item.ElementContext;
 import com.amdocs.zusammen.datatypes.item.Info;
-import com.amdocs.zusammen.datatypes.item.ItemVersion;
-import com.amdocs.zusammen.utils.fileutils.FileUtils;
 import org.openecomp.core.zusammen.api.ZusammenAdaptor;
-import org.openecomp.core.zusammen.api.ZusammenUtil;
+import org.openecomp.sdc.datatypes.model.ElementType;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.convertor.ElementToVSPGeneralConvertor;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.convertor.ElementToVSPQuestionnaireConvertor;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspQuestionnaireEntity;
 import org.openecomp.sdc.versioning.VersioningManagerFactory;
@@ -20,10 +19,14 @@
 
 import java.io.ByteArrayInputStream;
 import java.util.Collection;
-import java.util.Date;
 import java.util.stream.Collectors;
 
+import static org.openecomp.core.zusammen.api.ZusammenUtil.buildStructuralElement;
+import static org.openecomp.core.zusammen.api.ZusammenUtil.createSessionContext;
+
 public class VendorSoftwareProductInfoDaoZusammenImpl implements VendorSoftwareProductInfoDao {
+  private static final String EMPTY_DATA = "{}";
+
   private ZusammenAdaptor zusammenAdaptor;
 
   public VendorSoftwareProductInfoDaoZusammenImpl(ZusammenAdaptor zusammenAdaptor) {
@@ -33,7 +36,8 @@
   @Override
   public void registerVersioning(String versionableEntityType) {
     VersionableEntityMetadata metadata =
-        new VersionableEntityMetadata(VersionableEntityStoreType.Zusammen, "vsp", null, null);
+        new VersionableEntityMetadata(VersionableEntityStoreType.Zusammen, "VendorSoftwareProduct",
+            null, null);
 
     VersioningManagerFactory.getInstance().createInterface()
         .register(versionableEntityType, metadata);
@@ -41,114 +45,174 @@
 
   @Override
   public Collection<VspDetails> list(VspDetails entity) {
-    return zusammenAdaptor.listItems(ZusammenUtil.createSessionContext()).stream().filter
-        (vspEntity-> "vsp".equals(vspEntity.getInfo().getProperty("type")))
-        .map(item -> mapInfoToVspDetails(
-            item.getId().getValue(), null, item.getInfo(),
-            item.getModificationTime(), item.getCreationTime()))
+    ElementToVSPGeneralConvertor convertor = new ElementToVSPGeneralConvertor();
+
+
+    return zusammenAdaptor.listItems(createSessionContext()).stream()
+        .filter(item -> "VendorSoftwareProduct".equals(item.getInfo().getProperty("item_type")))
+        .map(item -> convertor.convert(item))
         .collect(Collectors.toList());
   }
 
+
   @Override
   public void create(VspDetails vspDetails) {
-    SessionContext context = ZusammenUtil.createSessionContext();
-
-    Id itemId = zusammenAdaptor.createItem(context, mapVspDetailsToZusammenItemInfo(vspDetails));
-    Id versionId =
-        zusammenAdaptor.createVersion(context, itemId, null, ZusammenUtil.createFirstVersionData());
-
     ZusammenElement generalElement = mapVspDetailsToZusammenElement(vspDetails, Action.CREATE);
-    zusammenAdaptor.saveElement(context, new ElementContext(itemId, versionId),
-        generalElement, "Create VSP General Info Element");
 
-    vspDetails.setId(itemId.getValue());//set id for caller
+    SessionContext context = createSessionContext();
+    ElementContext elementContext =
+        new ElementContext(vspDetails.getId(), vspDetails.getVersion().getId());
+    zusammenAdaptor.saveElement(context, elementContext, generalElement,
+        "Create VSP General Info Element");
+
+    createVspStructure(context, elementContext);
+  }
+
+  private void createVspStructure(SessionContext context, ElementContext elementContext) {
+    createOrchestrationTemplateCandidateStructure(context, elementContext);
+    createVspModelStructure(context, elementContext);
+
+    zusammenAdaptor.saveElement(context, elementContext,
+        buildStructuralElement(ElementType.DeploymentFlavors, Action.CREATE),
+        "Create VSP Deployment Flavors Element");
+
+    zusammenAdaptor.saveElement(context, elementContext,
+        buildStructuralElement(ElementType.Processes, Action.CREATE),
+        "Create VSP Processes Element");
+  }
+
+  private void createOrchestrationTemplateCandidateStructure(SessionContext context,
+                                                             ElementContext elementContext) {
+    ByteArrayInputStream emptyData = new ByteArrayInputStream(EMPTY_DATA.getBytes());
+
+    ZusammenElement candidateContentElement =
+        buildStructuralElement(ElementType.OrchestrationTemplateCandidateContent, Action.CREATE);
+    candidateContentElement.setData(emptyData);
+
+    ZusammenElement candidateElement =
+        buildStructuralElement(ElementType.OrchestrationTemplateCandidate, Action.CREATE);
+    candidateElement.setData(emptyData);
+    candidateElement.addSubElement(candidateContentElement);
+
+    zusammenAdaptor.saveElement(context, elementContext, candidateElement,
+        "Create Orchestration Template Candidate Elements");
+  }
+
+  private void createVspModelStructure(SessionContext context, ElementContext elementContext) {
+    ZusammenElement vspModel = buildStructuralElement(ElementType.VspModel, Action.CREATE);
+    vspModel.addSubElement(buildOrchestrationTemplateStructure());
+    vspModel.addSubElement(buildStructuralElement(ElementType.Networks, Action.CREATE));
+    vspModel.addSubElement(buildStructuralElement(ElementType.Components, Action.CREATE));
+    vspModel
+        .addSubElement(buildStructuralElement(ElementType.ComponentDependencies, Action.CREATE));
+
+    ZusammenElement templates = buildStructuralElement(ElementType.Templates, Action.CREATE);
+    ZusammenElement artifacts = buildStructuralElement(ElementType.Artifacts, Action.CREATE);
+    vspModel.addSubElement(
+        buildServiceModelStructure(ElementType.ServiceModel, templates, artifacts));
+    vspModel.addSubElement(
+        buildServiceModelStructure(ElementType.EnrichedServiceModel, templates, artifacts));
+
+    zusammenAdaptor.saveElement(context, elementContext, vspModel, "Create VSP Model Elements");
+  }
+
+  private ZusammenElement buildOrchestrationTemplateStructure() {
+    ByteArrayInputStream emptyData = new ByteArrayInputStream(EMPTY_DATA.getBytes());
+
+    ZusammenElement validationData =
+        buildStructuralElement(ElementType.OrchestrationTemplateValidationData, Action.CREATE);
+    validationData.setData(emptyData);
+
+    ZusammenElement orchestrationTemplate =
+        buildStructuralElement(ElementType.OrchestrationTemplate, Action.CREATE);
+    orchestrationTemplate.setData(emptyData);
+    orchestrationTemplate.addSubElement(validationData);
+
+    return orchestrationTemplate;
+  }
+
+  private ZusammenElement buildServiceModelStructure(ElementType serviceModelElementType,
+                                                     ZusammenElement templates,
+                                                     ZusammenElement artifacts) {
+    ZusammenElement serviceModel = buildStructuralElement(serviceModelElementType, Action.CREATE);
+    serviceModel.addSubElement(templates);
+    serviceModel.addSubElement(artifacts);
+    return serviceModel;
   }
 
   @Override
   public void update(VspDetails vspDetails) {
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(vspDetails.getId());
-    Id versionId = VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor);
-
-    zusammenAdaptor.updateItem(context, itemId, mapVspDetailsToZusammenItemInfo(vspDetails));
-
     ZusammenElement generalElement = mapVspDetailsToZusammenElement(vspDetails, Action.UPDATE);
-    zusammenAdaptor.saveElement(context, new ElementContext(itemId, versionId),
-        generalElement, "Update VSP General Info Element");
+
+    SessionContext context = createSessionContext();
+    zusammenAdaptor.saveElement(context,
+        new ElementContext(vspDetails.getId(), vspDetails.getVersion().getId()), generalElement,
+        "Update VSP General Info Element");
   }
 
   @Override
   public VspDetails get(VspDetails vspDetails) {
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(vspDetails.getId());
-    ItemVersion itemVersion = VspZusammenUtil.getFirstVersion(context, itemId, zusammenAdaptor);
-    ElementContext elementContext = new ElementContext(itemId, itemVersion.getId(),
-        VspZusammenUtil.getVersionTag(vspDetails.getVersion()));
-
-    return zusammenAdaptor
-        .getElementInfoByName(context, elementContext, null, StructureElement.General.name())
-        .map(generalElementInfo -> mapInfoToVspDetails(
-            vspDetails.getId(), vspDetails.getVersion(), generalElementInfo.getInfo(),
-            itemVersion.getModificationTime(), itemVersion.getCreationTime()))
+    SessionContext context = createSessionContext();
+    ElementContext elementContext =
+        new ElementContext(vspDetails.getId(), vspDetails.getVersion().getId());
+    VspDetails vsp = zusammenAdaptor.getElementInfoByName(context, elementContext, null,
+        ElementType.VendorSoftwareProduct.name())
+        .map(new ElementToVSPGeneralConvertor()::convert)
         .orElse(null);
-  }
-
-
-  @Override
-  public void delete(VspDetails entity) {
-
+    vsp.setId(vspDetails.getId());
+    vsp.setVersion(vspDetails.getVersion());
+    return vsp;
   }
 
   @Override
-  public void updateOldVersionIndication(VspDetails vspDetails) {
-    VspDetails retrieved = get(vspDetails);
-    if (retrieved != null) {
-      retrieved.setOldVersion(vspDetails.getOldVersion());
-      update(retrieved);
-    }
+  public void delete(VspDetails vspDetails) {
+    SessionContext context = createSessionContext();
+    ElementContext elementContext =
+        new ElementContext(vspDetails.getId(), vspDetails.getVersion().getId());
+
+    zusammenAdaptor.saveElement(context, elementContext,
+        buildStructuralElement(ElementType.VspModel, Action.DELETE),
+        "Delete VSP Model Elements");
+
+    createVspModelStructure(context, elementContext);
   }
 
   @Override
   public void updateQuestionnaireData(String vspId, Version version, String questionnaireData) {
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(vspId);
-    Id versionId = VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor);
+    SessionContext context = createSessionContext();
 
     ZusammenElement questionnaireElement = mapQuestionnaireToZusammenElement(questionnaireData);
-    zusammenAdaptor.saveElement(context, new ElementContext(itemId, versionId),
+    zusammenAdaptor.saveElement(context, new ElementContext(vspId, version.getId()),
         questionnaireElement, "Update VSP Questionnaire");
   }
 
 
-  @Override
+ /* @Override
   public String getQuestionnaireData(String vspId, Version version) {
-    SessionContext context = ZusammenUtil.createSessionContext();
-    Id itemId = new Id(vspId);
-    Id versionId = VspZusammenUtil.getFirstVersionId(context, itemId, zusammenAdaptor);
+    SessionContext context = createSessionContext();
 
-    return zusammenAdaptor.getElementByName(context,
-        new ElementContext(itemId, versionId, VspZusammenUtil.getVersionTag(version)), null,
-        StructureElement.Questionnaire.name())
+    return zusammenAdaptor
+        .getElementByName(context, new ElementContext(vspId, version.getId()), null,
+            ElementType.Questionnaire.name())
         .map(questionnaireElement ->
             new String(FileUtils.toByteArray(questionnaireElement.getData())))
         .orElse(null);
-  }
+  }*/
 
   @Override
   public VspQuestionnaireEntity getQuestionnaire(String vspId, Version version) {
-    VspQuestionnaireEntity entity = new VspQuestionnaireEntity();
+
+    SessionContext context = createSessionContext();
+    ElementToVSPQuestionnaireConvertor convertor = new ElementToVSPQuestionnaireConvertor();
+    VspQuestionnaireEntity entity = convertor.convert(zusammenAdaptor
+        .getElementByName(context, new ElementContext(vspId, version.getId()), null,
+            ElementType.VSPQuestionnaire.name()).map(element -> element).orElse(null));
     entity.setId(vspId);
     entity.setVersion(version);
-    entity.setQuestionnaireData(getQuestionnaireData(vspId, version));
     return entity;
   }
 
   @Override
-  public void deleteAll(String vspId, Version version) {
-
-  }
-
-  @Override
   public boolean isManual(String vspId, Version version) {
     final VspDetails vspDetails = get(new VspDetails(vspId, version));
     if (vspDetails != null) {
@@ -159,29 +223,27 @@
     return false;
   }
 
-  private Info mapVspDetailsToZusammenItemInfo(VspDetails vspDetails) {
-    Info info = new Info();
-    info.setName(vspDetails.getName());
-    info.setDescription(vspDetails.getDescription());
-    info.addProperty("type", "vsp");
-    addVspDetailsToInfo(info, vspDetails);
-    return info;
-  }
-
   private ZusammenElement mapVspDetailsToZusammenElement(VspDetails vspDetails, Action action) {
     ZusammenElement generalElement =
-        VspZusammenUtil.buildStructuralElement(StructureElement.General, action);
+        buildStructuralElement(ElementType.VendorSoftwareProduct, action);
     addVspDetailsToInfo(generalElement.getInfo(), vspDetails);
     return generalElement;
   }
 
   private ZusammenElement mapQuestionnaireToZusammenElement(String questionnaireData) {
     ZusammenElement questionnaireElement =
-        VspZusammenUtil.buildStructuralElement(StructureElement.Questionnaire, Action.UPDATE);
+        buildStructuralElement(ElementType.VSPQuestionnaire, Action.UPDATE);
     questionnaireElement.setData(new ByteArrayInputStream(questionnaireData.getBytes()));
     return questionnaireElement;
   }
 
+  private ZusammenElement mapTestElementToZusammenElement(String elementData) {
+    ZusammenElement testElement =
+        buildStructuralElement(ElementType.test, Action.UPDATE);
+    testElement.setData(new ByteArrayInputStream(elementData.getBytes()));
+    return testElement;
+  }
+
   private void addVspDetailsToInfo(Info info, VspDetails vspDetails) {
     info.addProperty(InfoPropertyName.name.name(), vspDetails.getName());
     info.addProperty(InfoPropertyName.description.name(), vspDetails.getDescription());
@@ -191,45 +253,14 @@
     info.addProperty(InfoPropertyName.vendorId.name(), vspDetails.getVendorId());
     info.addProperty(InfoPropertyName.vendorName.name(), vspDetails.getVendorName());
     if (vspDetails.getVlmVersion() != null) {
-      info.addProperty(
-          InfoPropertyName.vendorVersion.name(), vspDetails.getVlmVersion().toString());
+      info.addProperty(InfoPropertyName.vendorVersion.name(), vspDetails.getVlmVersion().getId());
     }
     info.addProperty(InfoPropertyName.licenseAgreement.name(), vspDetails.getLicenseAgreement());
     info.addProperty(InfoPropertyName.featureGroups.name(), vspDetails.getFeatureGroups());
-    info.addProperty(InfoPropertyName.oldVersion.name(), vspDetails.getOldVersion());
     info.addProperty(InfoPropertyName.onboardingMethod.name(), vspDetails.getOnboardingMethod());
-    info.addProperty(InfoPropertyName.obBoardingOrigin.name(), vspDetails.getOnboardingOrigin());
-    info.addProperty(InfoPropertyName.networkPackageName.name(), vspDetails.getNetworkPackageName());
   }
 
-  private VspDetails mapInfoToVspDetails(String vspId, Version version, Info info,
-                                         Date modificationTime, Date creationTime) {
-    VspDetails vspDetails = new VspDetails(vspId, version);
-    vspDetails.setName(info.getProperty(InfoPropertyName.name.name()));
-    vspDetails.setDescription(info.getProperty(InfoPropertyName.description.name()));
-    vspDetails.setCategory(info.getProperty(InfoPropertyName.category.name()));
-    vspDetails.setSubCategory(info.getProperty(InfoPropertyName.subCategory.name()));
-    vspDetails.setVendorId(info.getProperty(InfoPropertyName.vendorId.name()));
-    vspDetails.setVendorName(info.getProperty(InfoPropertyName.vendorName.name()));
-    vspDetails.setVlmVersion(
-        Version.valueOf(info.getProperty(InfoPropertyName.vendorVersion.name())));
-    vspDetails.setLicenseAgreement(info.getProperty(InfoPropertyName.licenseAgreement.name()));
-    vspDetails.setFeatureGroups(info.getProperty(InfoPropertyName.featureGroups.name()));
-
-    vspDetails.setWritetimeMicroSeconds(
-        modificationTime == null ? creationTime.getTime() : modificationTime.getTime());
-    vspDetails.setVersion(version);
-    String oldVersion = info.getProperty(InfoPropertyName.oldVersion.name());
-
-    //Boolean oldVersion = ind == null || "true".equals( ind.toLowerCase());
-    vspDetails.setOldVersion(oldVersion);
-    vspDetails.setOnboardingMethod(info.getProperty(InfoPropertyName.onboardingMethod.name()));
-    vspDetails.setOnboardingOrigin(info.getProperty(InfoPropertyName.obBoardingOrigin.name()));
-    vspDetails.setNetworkPackageName(info.getProperty(InfoPropertyName.networkPackageName.name()));
-    return vspDetails;
-  }
-
-  private enum InfoPropertyName {
+  public enum InfoPropertyName {
     name,
     description,
     icon,
@@ -240,10 +271,7 @@
     vendorVersion,
     licenseAgreement,
     featureGroups,
-    oldVersion,
-    onboardingMethod,
-    obBoardingOrigin,
-    networkPackageName
+    onboardingMethod
   }
 
 }
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/VspZusammenUtil.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/VspZusammenUtil.java
index 5e80d4c..d4dc7e0 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/VspZusammenUtil.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/VspZusammenUtil.java
@@ -1,49 +1,11 @@
 package org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen;
 
 import com.amdocs.zusammen.adaptor.inbound.api.types.item.ZusammenElement;
-import com.amdocs.zusammen.datatypes.Id;
-import com.amdocs.zusammen.datatypes.SessionContext;
-import com.amdocs.zusammen.datatypes.item.Action;
-import com.amdocs.zusammen.datatypes.item.ItemVersion;
-import org.openecomp.core.zusammen.api.ZusammenAdaptor;
-import org.openecomp.core.zusammen.api.ZusammenUtil;
-import org.openecomp.sdc.common.errors.CoreException;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.errors.VendorSoftwareProductNotFoundErrorBuilder;
-import org.openecomp.sdc.versioning.dao.types.Version;
-import org.openecomp.sdc.versioning.dao.types.VersionStatus;
 
 import java.util.Objects;
-import java.util.Optional;
 
 class VspZusammenUtil {
 
-  static ItemVersion getFirstVersion(SessionContext context, Id itemId, ZusammenAdaptor
-      zusammenAdaptor) {
-
-    Optional<ItemVersion> itemVersion = zusammenAdaptor.getFirstVersion(context, itemId);
-
-    if (!itemVersion.isPresent()) {
-      throw new CoreException(
-          new VendorSoftwareProductNotFoundErrorBuilder(itemId.getValue()).build());
-    }
-    return itemVersion.get();
-  }
-
-  static Id getFirstVersionId(SessionContext context, Id itemId, ZusammenAdaptor zusammenAdaptor) {
-    return getFirstVersion(context, itemId, zusammenAdaptor).getId();
-  }
-
-  // TODO: 4/25/2017 remove upon working with more than one single version
-  static String getVersionTag(Version version) {
-    return version.getStatus() == VersionStatus.Locked
-        ? null
-        : version.toString();
-  }
-
-  static ZusammenElement buildStructuralElement(StructureElement structureElement, Action action) {
-    return ZusammenUtil.buildStructuralElement(structureElement.name(), action);
-  }
-
   static ZusammenElement aggregateElements(ZusammenElement... elements) {
     ZusammenElement head = null;
     ZusammenElement father = null;
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToComponentConvertor.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToComponentConvertor.java
new file mode 100644
index 0000000..ae88a7e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToComponentConvertor.java
@@ -0,0 +1,38 @@
+package org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.convertor;
+
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.Element;
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.ElementInfo;
+import com.amdocs.zusammen.datatypes.item.Info;
+import org.openecomp.convertor.ElementConvertor;
+import org.openecomp.core.utilities.file.FileUtils;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity;
+import org.openecomp.types.ElementPropertyName;
+
+public class ElementToComponentConvertor extends ElementConvertor<ComponentEntity> {
+
+  @Override
+  public ComponentEntity convert(Element element) {
+    ComponentEntity componentEntity = new ComponentEntity();
+    componentEntity.setId(element.getElementId().getValue());
+    componentEntity.setCompositionData(new String(FileUtils.toByteArray(element.getData())));
+    mapInfoToComponentEntity(componentEntity,element.getInfo());
+    return componentEntity;
+  }
+
+  @Override
+  public ComponentEntity convert( ElementInfo elementInfo) {
+    ComponentEntity componentEntity = new ComponentEntity();
+    componentEntity.setId(elementInfo.getId().getValue());
+    mapInfoToComponentEntity(componentEntity,elementInfo.getInfo());
+    return componentEntity;
+  }
+
+
+  public void mapInfoToComponentEntity(ComponentEntity componentEntity,Info info){
+
+
+    componentEntity.setCompositionData(
+        info.getProperty(ElementPropertyName.compositionData.name()));
+  }
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToComponentDependencyModelConvertor.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToComponentDependencyModelConvertor.java
new file mode 100644
index 0000000..0864ad3
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToComponentDependencyModelConvertor.java
@@ -0,0 +1,41 @@
+package org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.convertor;
+
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.Element;
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.ElementInfo;
+import com.amdocs.zusammen.datatypes.item.Info;
+import org.openecomp.convertor.ElementConvertor;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.ComponentDependencyModelPropertyName;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentDependencyModelEntity;
+
+public class ElementToComponentDependencyModelConvertor extends ElementConvertor <ComponentDependencyModelEntity>{
+
+  @Override
+  public ComponentDependencyModelEntity convert( Element element) {
+    ComponentDependencyModelEntity componentDependencyModelEntity = new ComponentDependencyModelEntity();
+    componentDependencyModelEntity.setId(element.getElementId().getValue());
+    mapInfoToComponentDependencyModelEntity(componentDependencyModelEntity,element.getInfo());
+    return componentDependencyModelEntity;
+  }
+
+  @Override
+  public ComponentDependencyModelEntity convert(ElementInfo elementInfo) {
+    ComponentDependencyModelEntity componentDependencyModelEntity = new ComponentDependencyModelEntity();
+
+    componentDependencyModelEntity.setId(elementInfo.getId().getValue());
+    mapInfoToComponentDependencyModelEntity(componentDependencyModelEntity,elementInfo.getInfo());
+    return componentDependencyModelEntity;
+  }
+
+
+  public void mapInfoToComponentDependencyModelEntity(ComponentDependencyModelEntity componentDependencyModelEntity,Info info){
+
+    componentDependencyModelEntity.setSourceComponentId(info
+        .getProperty(ComponentDependencyModelPropertyName.sourcecomponent_id.name()));
+    componentDependencyModelEntity.setTargetComponentId(info
+        .getProperty(ComponentDependencyModelPropertyName.targetcomponent_id.name()));
+    componentDependencyModelEntity.setRelation(info
+        .getProperty(ComponentDependencyModelPropertyName.relation.name()));
+
+  }
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToComponentMonitoringUploadConvertor.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToComponentMonitoringUploadConvertor.java
new file mode 100644
index 0000000..dd3d122
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToComponentMonitoringUploadConvertor.java
@@ -0,0 +1,45 @@
+package org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.convertor;
+
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.Element;
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.ElementInfo;
+import com.amdocs.zusammen.datatypes.item.Info;
+import org.openecomp.convertor.ElementConvertor;
+import org.openecomp.core.enrichment.types.MonitoringUploadType;
+import org.openecomp.core.utilities.file.FileUtils;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentMonitoringUploadEntity;
+
+import java.nio.ByteBuffer;
+
+import static org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.convertor.ElementToProcessConvertor.ARTIFACT_NAME;
+
+public class ElementToComponentMonitoringUploadConvertor extends ElementConvertor<ComponentMonitoringUploadEntity> {
+
+  @Override
+  public ComponentMonitoringUploadEntity convert(Element element) {
+    ComponentMonitoringUploadEntity mibEntity = new ComponentMonitoringUploadEntity();
+
+    mibEntity.setId(element.getElementId().getValue());
+    mibEntity.setArtifact(ByteBuffer.wrap(FileUtils.toByteArray(element.getData())));
+    mapInfoToComponentMonitoringUploadEntity(mibEntity, element.getInfo());
+    return mibEntity;
+  }
+
+  @Override
+  public ComponentMonitoringUploadEntity convert(ElementInfo elementInfo) {
+    ComponentMonitoringUploadEntity mibEntity = new ComponentMonitoringUploadEntity();
+
+    mibEntity.setId(elementInfo.getId().getValue());
+    mapInfoToComponentMonitoringUploadEntity(mibEntity, elementInfo.getInfo());
+    return mibEntity;
+  }
+
+
+  public void mapInfoToComponentMonitoringUploadEntity(ComponentMonitoringUploadEntity mibEntity,
+                                                       Info info) {
+
+    mibEntity.setArtifactName((String) info.getProperties().get(ARTIFACT_NAME));
+    mibEntity.setType(MonitoringUploadType.valueOf(info.getName()));
+  }
+
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToComponentQuestionnnaireConvertor.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToComponentQuestionnnaireConvertor.java
new file mode 100644
index 0000000..1554a1c
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToComponentQuestionnnaireConvertor.java
@@ -0,0 +1,21 @@
+package org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.convertor;
+
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.Element;
+import org.openecomp.convertor.ElementConvertor;
+import org.openecomp.core.utilities.file.FileUtils;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity;
+
+
+/**
+ * Created by ayalaben on 9/27/2017
+ */
+public class ElementToComponentQuestionnnaireConvertor extends ElementConvertor<ComponentEntity> {
+  @Override
+  public ComponentEntity convert( Element element) {
+    ComponentEntity componentEntity = new ComponentEntity();
+
+    componentEntity.setId(element.getElementId().getValue());
+    componentEntity.setQuestionnaireData(new String(FileUtils.toByteArray(element.getData())));
+    return componentEntity;
+  }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToCompositionEntityConvertor.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToCompositionEntityConvertor.java
new file mode 100644
index 0000000..f73da6a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToCompositionEntityConvertor.java
@@ -0,0 +1,45 @@
+package org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.convertor;
+
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.Element;
+import org.openecomp.convertor.ElementConvertor;
+import org.openecomp.core.utilities.file.FileUtils;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.CompositionEntity;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ImageEntity;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspQuestionnaireEntity;
+
+public class ElementToCompositionEntityConvertor extends ElementConvertor <CompositionEntity>{
+
+  @Override
+  public CompositionEntity convert(Element element) {
+
+    CompositionEntity compositionEntity = null;
+    switch (getElementType(element)) {
+      case ComponentQuestionnaire:
+        compositionEntity = new ComponentEntity();
+        break;
+      case VSPQuestionnaire:
+        compositionEntity = new VspQuestionnaireEntity();
+        break;
+      case ImageQuestionnaire:
+        compositionEntity = new ImageEntity();
+        break;
+      case ComputeQuestionnaire:
+        compositionEntity = new ComponentEntity();
+        break;
+      case NicQuestionnaire:
+        compositionEntity = new NicEntity();
+    }
+    if (compositionEntity != null) {
+      compositionEntity.setId(element.getElementId().getValue());
+      compositionEntity.setQuestionnaireData(element.getData() == null
+          ? null
+          : new String(FileUtils.toByteArray(element.getData())));
+      return compositionEntity;
+    } else  {
+      return null;
+    }
+  }
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToComputeConvertor.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToComputeConvertor.java
new file mode 100644
index 0000000..0412e03
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToComputeConvertor.java
@@ -0,0 +1,40 @@
+package org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.convertor;
+
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.Element;
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.ElementInfo;
+import com.amdocs.zusammen.datatypes.item.Info;
+import org.openecomp.convertor.ElementConvertor;
+import org.openecomp.core.utilities.file.FileUtils;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComputeEntity;
+import org.openecomp.types.ElementPropertyName;
+
+public class ElementToComputeConvertor extends ElementConvertor <ComputeEntity>{
+
+  @Override
+  public ComputeEntity convert( Element element) {
+    ComputeEntity computeEntity = new ComputeEntity();
+
+    computeEntity.setId(element.getElementId().getValue());
+    computeEntity.setCompositionData(new String(FileUtils.toByteArray(element.getData())));
+    mapInfoToComputeEntity(computeEntity,element.getInfo());
+    return computeEntity;
+  }
+
+  @Override
+  public ComputeEntity convert( ElementInfo elementInfo) {
+    ComputeEntity computeEntity = new ComputeEntity();
+
+    computeEntity.setId(elementInfo.getId().getValue());
+    mapInfoToComputeEntity(computeEntity,elementInfo.getInfo());
+    return computeEntity;
+  }
+
+
+  public void mapInfoToComputeEntity(ComputeEntity computeEntity,Info info){
+
+
+    computeEntity.setCompositionData(
+        info.getProperty(ElementPropertyName.compositionData.name()));
+  }
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToComputeQuestionnaireConvertor.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToComputeQuestionnaireConvertor.java
new file mode 100644
index 0000000..7ac2576
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToComputeQuestionnaireConvertor.java
@@ -0,0 +1,19 @@
+package org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.convertor;
+
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.Element;
+import org.openecomp.convertor.ElementConvertor;
+import org.openecomp.core.utilities.file.FileUtils;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComputeEntity;
+
+public class ElementToComputeQuestionnaireConvertor extends ElementConvertor <ComputeEntity>{
+
+  @Override
+  public ComputeEntity convert( Element element) {
+    ComputeEntity computeEntity = new ComputeEntity();
+
+    computeEntity.setId(element.getElementId().getValue());
+    computeEntity.setQuestionnaireData(new String(FileUtils.toByteArray(element.getData())));
+    return computeEntity;
+  }
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToDeploymentFlavorConvertor.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToDeploymentFlavorConvertor.java
new file mode 100644
index 0000000..48265bf
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToDeploymentFlavorConvertor.java
@@ -0,0 +1,40 @@
+package org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.convertor;
+
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.Element;
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.ElementInfo;
+import com.amdocs.zusammen.datatypes.item.Info;
+import org.openecomp.convertor.ElementConvertor;
+import org.openecomp.core.utilities.file.FileUtils;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.DeploymentFlavorEntity;
+import org.openecomp.types.ElementPropertyName;
+
+public class ElementToDeploymentFlavorConvertor extends ElementConvertor <DeploymentFlavorEntity>{
+
+  @Override
+  public DeploymentFlavorEntity convert( Element element) {
+    DeploymentFlavorEntity deploymentFlavorEntity = new DeploymentFlavorEntity();
+
+    deploymentFlavorEntity.setId(element.getElementId().getValue());
+    deploymentFlavorEntity.setCompositionData(new String(FileUtils.toByteArray(element.getData())));
+    mapInfoToDeploymentFlavorEntity(deploymentFlavorEntity,element.getInfo());
+    return deploymentFlavorEntity;
+  }
+
+  @Override
+  public DeploymentFlavorEntity convert( ElementInfo elementInfo) {
+    DeploymentFlavorEntity deploymentFlavorEntity = new DeploymentFlavorEntity();
+
+    deploymentFlavorEntity.setId(elementInfo.getId().getValue());
+    mapInfoToDeploymentFlavorEntity(deploymentFlavorEntity,elementInfo.getInfo());
+    return deploymentFlavorEntity;
+  }
+
+
+  public void mapInfoToDeploymentFlavorEntity(DeploymentFlavorEntity deploymentFlavorEntity,Info info){
+
+
+    deploymentFlavorEntity.setCompositionData(
+        info.getProperty(ElementPropertyName.compositionData.name()));
+  }
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToImageConvertor.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToImageConvertor.java
new file mode 100644
index 0000000..8aa59c5
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToImageConvertor.java
@@ -0,0 +1,40 @@
+package org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.convertor;
+
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.Element;
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.ElementInfo;
+import com.amdocs.zusammen.datatypes.item.Info;
+import org.openecomp.convertor.ElementConvertor;
+import org.openecomp.core.utilities.file.FileUtils;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ImageEntity;
+import org.openecomp.types.ElementPropertyName;
+
+public class ElementToImageConvertor extends ElementConvertor <ImageEntity>{
+
+  @Override
+  public ImageEntity convert( Element element) {
+    ImageEntity imageEntity = new ImageEntity();
+
+    imageEntity.setId(element.getElementId().getValue());
+    imageEntity.setCompositionData(new String(FileUtils.toByteArray(element.getData())));
+    mapInfoToImageEntity(imageEntity,element.getInfo());
+    return imageEntity;
+  }
+
+  @Override
+  public ImageEntity convert( ElementInfo elementInfo) {
+    ImageEntity imageEntity = new ImageEntity();
+
+    imageEntity.setId(elementInfo.getId().getValue());
+    mapInfoToImageEntity(imageEntity,elementInfo.getInfo());
+    return imageEntity;
+  }
+
+
+  public void mapInfoToImageEntity(ImageEntity imageEntity,Info info){
+
+
+    imageEntity.setCompositionData(
+        info.getProperty(ElementPropertyName.compositionData.name()));
+  }
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToImageQuestionnaireConvertor.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToImageQuestionnaireConvertor.java
new file mode 100644
index 0000000..2e9cfa0
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToImageQuestionnaireConvertor.java
@@ -0,0 +1,19 @@
+package org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.convertor;
+
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.Element;
+import org.openecomp.convertor.ElementConvertor;
+import org.openecomp.core.utilities.file.FileUtils;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ImageEntity;
+
+public class ElementToImageQuestionnaireConvertor extends ElementConvertor <ImageEntity>{
+
+  @Override
+  public ImageEntity convert( Element element) {
+    ImageEntity imageEntity = new ImageEntity();
+
+    imageEntity.setId(element.getElementId().getValue());
+    imageEntity.setQuestionnaireData(new String(FileUtils.toByteArray(element.getData())));
+    return imageEntity;
+  }
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToMonitoringUploadMapConvertor.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToMonitoringUploadMapConvertor.java
new file mode 100644
index 0000000..5da9dc4
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToMonitoringUploadMapConvertor.java
@@ -0,0 +1,23 @@
+package org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.convertor;
+
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.Element;
+import org.openecomp.convertor.ElementConvertor;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import static org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.convertor.ElementToProcessConvertor.ARTIFACT_NAME;
+
+/**
+ * Created by ayalaben on 9/5/2017.
+ */
+
+public class ElementToMonitoringUploadMapConvertor extends  ElementConvertor<Map<String ,String>> {
+
+  @Override
+  public Map<String ,String> convert(Element element) {
+    HashMap<String,String> map = new HashMap<>();
+    map.put("File Name",element.getInfo().getProperty(ARTIFACT_NAME));
+    return map;
+  }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToNetworkConvertor.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToNetworkConvertor.java
new file mode 100644
index 0000000..6ce2416
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToNetworkConvertor.java
@@ -0,0 +1,38 @@
+package org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.convertor;
+
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.Element;
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.ElementInfo;
+import com.amdocs.zusammen.datatypes.item.Info;
+import org.openecomp.convertor.ElementConvertor;
+import org.openecomp.core.utilities.file.FileUtils;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity;
+import org.openecomp.types.ElementPropertyName;
+
+public class ElementToNetworkConvertor extends ElementConvertor <NetworkEntity>{
+
+  @Override
+  public NetworkEntity convert( Element element) {
+    NetworkEntity networkEntity = new NetworkEntity();
+
+    networkEntity.setId(element.getElementId().getValue());
+    networkEntity.setCompositionData(new String(FileUtils.toByteArray(element.getData())));
+    mapInfoToNetworkEntity(networkEntity,element.getInfo());
+    return networkEntity;
+  }
+
+  @Override
+  public NetworkEntity convert( ElementInfo elementInfo) {
+    NetworkEntity networkEntity = new NetworkEntity();
+
+    networkEntity.setId(elementInfo.getId().getValue());
+    mapInfoToNetworkEntity(networkEntity,elementInfo.getInfo());
+    return networkEntity;
+  }
+
+
+  public void mapInfoToNetworkEntity(NetworkEntity networkEntity,Info info){
+    networkEntity.setCompositionData(
+        info.getProperty(ElementPropertyName.compositionData.name()));
+  }
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToNicConvertor.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToNicConvertor.java
new file mode 100644
index 0000000..33788af
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToNicConvertor.java
@@ -0,0 +1,39 @@
+package org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.convertor;
+
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.Element;
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.ElementInfo;
+import com.amdocs.zusammen.datatypes.item.Info;
+import org.openecomp.convertor.ElementConvertor;
+import org.openecomp.core.utilities.file.FileUtils;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity;
+import org.openecomp.types.ElementPropertyName;
+
+public class ElementToNicConvertor extends ElementConvertor <NicEntity>{
+
+  @Override
+  public NicEntity convert( Element element) {
+    NicEntity nicEntity = new NicEntity();
+
+    nicEntity.setId(element.getElementId().getValue());
+    nicEntity.setCompositionData(new String(FileUtils.toByteArray(element.getData())));
+    mapInfoToNicEntity(nicEntity,element.getInfo());
+    return nicEntity;
+  }
+
+  @Override
+  public NicEntity convert( ElementInfo elementInfo) {
+    NicEntity nicEntity = new NicEntity();
+
+    nicEntity.setId(elementInfo.getId().getValue());
+    mapInfoToNicEntity(nicEntity,elementInfo.getInfo());
+    return nicEntity;
+  }
+
+
+  public void mapInfoToNicEntity(NicEntity nicEntity,Info info){
+
+      nicEntity.setCompositionData(
+          info.getProperty(ElementPropertyName.compositionData.name()));
+  }
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToNicQuestionnaireConvertor.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToNicQuestionnaireConvertor.java
new file mode 100644
index 0000000..ff53153
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToNicQuestionnaireConvertor.java
@@ -0,0 +1,21 @@
+package org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.convertor;
+
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.Element;
+import org.openecomp.convertor.ElementConvertor;
+import org.openecomp.core.utilities.file.FileUtils;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity;
+
+public class ElementToNicQuestionnaireConvertor extends ElementConvertor <NicEntity>{
+
+  @Override
+  public NicEntity convert( Element element) {
+    NicEntity nicEntity = new NicEntity();
+
+    nicEntity.setId(element.getElementId().getValue());
+    nicEntity.setQuestionnaireData( element.getData() == null
+        ? null
+        : new String(FileUtils.toByteArray(element.getData())));
+    return nicEntity;
+  }
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToOrchestrationTemplateCandidateMapConvertor.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToOrchestrationTemplateCandidateMapConvertor.java
new file mode 100644
index 0000000..b07df95
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToOrchestrationTemplateCandidateMapConvertor.java
@@ -0,0 +1,20 @@
+package org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.convertor;
+
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.Element;
+import org.openecomp.convertor.ElementConvertor;
+import org.openecomp.core.utilities.file.FileUtils;
+import org.openecomp.core.utilities.json.JsonUtil;
+import org.openecomp.sdc.vendorsoftwareproduct.types.candidateheat.FilesDataStructure;
+
+/**
+ * Created by ayalaben on 9/6/2017
+ */
+public class ElementToOrchestrationTemplateCandidateMapConvertor
+    extends ElementConvertor<FilesDataStructure> {
+
+  @Override
+  public FilesDataStructure convert(Element element) {
+    return JsonUtil.json2Object(new String(FileUtils.toByteArray(element.getData())),
+        FilesDataStructure.class);
+  }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToProcessConvertor.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToProcessConvertor.java
new file mode 100644
index 0000000..5d3ebc3
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToProcessConvertor.java
@@ -0,0 +1,53 @@
+package org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.convertor;
+
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.Element;
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.ElementInfo;
+import com.amdocs.zusammen.datatypes.item.Info;
+import org.openecomp.convertor.ElementConvertor;
+import org.openecomp.core.utilities.file.FileUtils;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessType;
+
+import java.nio.ByteBuffer;
+
+public class ElementToProcessConvertor extends ElementConvertor<ProcessEntity> {
+
+  @Override
+  public ProcessEntity convert(Element element) {
+    if (element == null) {
+      return null;
+    }
+    ProcessEntity processEntity = new ProcessEntity();
+    processEntity.setId(element.getElementId().getValue());
+    processEntity.setArtifact(ByteBuffer.wrap(FileUtils.toByteArray(element.getData())));
+    mapInfoToProcessEntity(processEntity, element.getInfo());
+    return processEntity;
+  }
+
+  @Override
+  public ProcessEntity convert(ElementInfo elementInfo) {
+    if (elementInfo == null) {
+      return null;
+    }
+    ProcessEntity processEntity = new ProcessEntity();
+    processEntity.setId(elementInfo.getId().getValue());
+    mapInfoToProcessEntity(processEntity, elementInfo.getInfo());
+    return processEntity;
+  }
+
+
+  public void mapInfoToProcessEntity(ProcessEntity processEntity, Info info) {
+    processEntity.setName(info.getProperty(NAME));
+    processEntity.setArtifactName(info.getProperty(ARTIFACT_NAME));
+    processEntity.setDescription(info.getProperty(DESCRIPTION));
+    processEntity.setType(info.getProperty
+        (PROCESS_TYPE) != null ? ProcessType.valueOf(info.getProperty
+        (PROCESS_TYPE)) : null);
+  }
+
+
+  public static final String NAME = "name";
+  public static final String ARTIFACT_NAME = "artifactName";
+  public static final String DESCRIPTION = "description";
+  public static final String PROCESS_TYPE = "processType";
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToServiceModelMapConvertor.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToServiceModelMapConvertor.java
new file mode 100644
index 0000000..bb7e8bb
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToServiceModelMapConvertor.java
@@ -0,0 +1,20 @@
+package org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.convertor;
+
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.Element;
+import org.openecomp.convertor.ElementConvertor;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Created by ayalaben on 9/11/2017
+ */
+public class ElementToServiceModelMapConvertor extends ElementConvertor<Map<String ,String>> {
+  @Override
+  public Map<String ,String> convert(Element element) {
+    //TODO : after merge with 1802 change to heat fle name/TOSCA file name
+    HashMap<String,String> map = new HashMap<>();
+    map.put("Service Model Definition Entry", element.getInfo().getProperty("base"));
+    return map;
+  }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToVSPGeneralConvertor.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToVSPGeneralConvertor.java
new file mode 100644
index 0000000..c5c2f91
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToVSPGeneralConvertor.java
@@ -0,0 +1,78 @@
+package org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.convertor;
+
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.Element;
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.ElementInfo;
+import com.amdocs.zusammen.datatypes.item.Info;
+import com.amdocs.zusammen.datatypes.item.Item;
+import org.openecomp.convertor.ElementConvertor;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.VendorSoftwareProductInfoDaoZusammenImpl;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+
+public class ElementToVSPGeneralConvertor extends ElementConvertor {
+  @Override
+  public VspDetails convert(Element element) {
+    if (element == null) {
+      return null;
+    }
+    return mapInfoToVspDetails(element.getInfo());
+
+  }
+
+  @Override
+  public VspDetails convert(Item item) {
+    if (item == null) {
+      return null;
+    }
+    VspDetails vspDetails = mapInfoToVspDetails(item.getInfo());
+    vspDetails.setId(item.getId().getValue());
+    return vspDetails;
+  }
+
+  @Override
+  public VspDetails convert(ElementInfo elementInfo) {
+    if (elementInfo == null) {
+      return null;
+    }
+    return mapInfoToVspDetails(elementInfo.getInfo());
+
+  }
+
+
+  private VspDetails mapInfoToVspDetails(Info info) {
+
+    VspDetails vspDetails = new VspDetails();
+
+    vspDetails.setName(info.getProperty(VendorSoftwareProductInfoDaoZusammenImpl
+        .InfoPropertyName.name.name()));
+    vspDetails.setDescription(info.getProperty(
+        VendorSoftwareProductInfoDaoZusammenImpl.InfoPropertyName.description.name()));
+    vspDetails.setIcon(info.getProperty(
+        VendorSoftwareProductInfoDaoZusammenImpl.InfoPropertyName.icon.name()));
+    vspDetails.setCategory(info.getProperty(
+        VendorSoftwareProductInfoDaoZusammenImpl.InfoPropertyName.category.name()));
+    vspDetails.setSubCategory(info.getProperty(
+        VendorSoftwareProductInfoDaoZusammenImpl.InfoPropertyName.subCategory.name()));
+    vspDetails.setVendorId(info.getProperty(
+        VendorSoftwareProductInfoDaoZusammenImpl.InfoPropertyName.vendorId.name()));
+    vspDetails.setVendorName(info.getProperty(
+        VendorSoftwareProductInfoDaoZusammenImpl.InfoPropertyName.vendorName.name()));
+    if (info.getProperty(
+        VendorSoftwareProductInfoDaoZusammenImpl.InfoPropertyName.vendorVersion.name()) != null) {
+      vspDetails.setVlmVersion(new Version(info.getProperty(
+          VendorSoftwareProductInfoDaoZusammenImpl.InfoPropertyName.vendorVersion.name())));
+    }
+
+    vspDetails.setLicenseAgreement(info.getProperty(
+        VendorSoftwareProductInfoDaoZusammenImpl.InfoPropertyName.licenseAgreement.name()));
+    vspDetails.setFeatureGroups(info.getProperty(
+        VendorSoftwareProductInfoDaoZusammenImpl.InfoPropertyName.featureGroups.name()));
+    vspDetails.setOnboardingMethod(info.getProperty(
+        VendorSoftwareProductInfoDaoZusammenImpl.InfoPropertyName.onboardingMethod.name()));
+
+    return vspDetails;
+  }
+
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToVSPQuestionnaireConvertor.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToVSPQuestionnaireConvertor.java
new file mode 100644
index 0000000..d51b8b2
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/convertor/ElementToVSPQuestionnaireConvertor.java
@@ -0,0 +1,17 @@
+package org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.convertor;
+
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.Element;
+import com.amdocs.zusammen.utils.fileutils.FileUtils;
+import org.openecomp.convertor.ElementConvertor;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspQuestionnaireEntity;
+
+public class ElementToVSPQuestionnaireConvertor  extends ElementConvertor {
+  @Override
+  public VspQuestionnaireEntity convert( Element element) {
+    if(element == null) return null;
+    VspQuestionnaireEntity entity = new VspQuestionnaireEntity();
+    entity.setQuestionnaireData(new String(FileUtils.toByteArray(element.getData())));
+    return entity;
+  }
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/VendorSoftwareProductErrorCodes.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/VendorSoftwareProductErrorCodes.java
index d3c2a22..b4c0d29 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/VendorSoftwareProductErrorCodes.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/VendorSoftwareProductErrorCodes.java
@@ -60,9 +60,6 @@
 
   public static final String SAME_SOURCE_TARGET_COMPONENT = "SAME_SOURCE_TARGET_COMPONENT";
 
-  public static final String VSP_ONBOARD_METHOD_UPDATE_NOT_ALLOWED =
-      "VSP_ONBOARD_METHOD_UPDATE_NOT_ALLOWED";
-
   public static final String DUPLICATE_NIC_NAME_NOT_ALLOWED = "DUPLICATE_NIC_NAME_NOT_ALLOWED";
   public static final String NIC_NAME_FORMAT_NOT_ALLOWED = "NIC_NAME_FORMAT_NOT_ALLOWED";
 
@@ -129,4 +126,7 @@
 
   public static final String INVALID_EXTENSION = "INVALID_EXTENSION";
 
+  public static final String VSP_ONBOARD_METHOD_UPDATE_NOT_ALLOWED =
+      "VSP_ONBOARD_METHOD_UPDATE_NOT_ALLOWED";
+
 }
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/factory/impl/CompositionEntityDataManagerFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/factory/impl/CompositionEntityDataManagerFactoryImpl.java
index a7e55bd..08d911b 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/factory/impl/CompositionEntityDataManagerFactoryImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/factory/impl/CompositionEntityDataManagerFactoryImpl.java
@@ -26,7 +26,6 @@
 import org.openecomp.sdc.vendorsoftwareproduct.dao.ImageDaoFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.NetworkDaoFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.NicDaoFactory;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDaoFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDaoFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.factory.CompositionEntityDataManagerFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.services.composition.CompositionEntityDataManager;
@@ -42,9 +41,8 @@
         ComponentDaoFactory.getInstance().createInterface(),
         NicDaoFactory.getInstance().createInterface(),
         NetworkDaoFactory.getInstance().createInterface(),
-        ImageDaoFactory.getInstance().createInterface() ,
+        ImageDaoFactory.getInstance().createInterface(),
         ComputeDaoFactory.getInstance().createInterface(),
-        DeploymentFlavorDaoFactory.getInstance().createInterface(),
-        VendorSoftwareProductDaoFactory.getInstance().createInterface());
+        DeploymentFlavorDaoFactory.getInstance().createInterface());
   }
 }
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/quiestionnaire/QuestionnaireDataServiceImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/quiestionnaire/QuestionnaireDataServiceImpl.java
index de29d5b..78914aa 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/quiestionnaire/QuestionnaireDataServiceImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/quiestionnaire/QuestionnaireDataServiceImpl.java
@@ -23,8 +23,10 @@
 
 import org.openecomp.core.utilities.json.JsonUtil;
 import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDaoFactory;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDaoFactory;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.NicDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.NicDaoFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDao;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDaoFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity;
@@ -47,8 +49,9 @@
  * Created by TALIO on 11/22/2016
  */
 public class QuestionnaireDataServiceImpl implements QuestionnaireDataService {
-  private static final VendorSoftwareProductDao vendorSoftwareProductDao =
-      VendorSoftwareProductDaoFactory.getInstance().createInterface();
+  private static final ComponentDao componentDao =
+      ComponentDaoFactory.getInstance().createInterface();
+  private static final NicDao nicDao = NicDaoFactory.getInstance().createInterface();
   private static final VendorSoftwareProductInfoDao vspInfoDao =
       VendorSoftwareProductInfoDaoFactory.getInstance().createInterface();
   private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage();
@@ -56,15 +59,11 @@
 
   public InformationArtifactData generateQuestionnaireDataForInformationArtifact(String vspId,
                                                                                  Version version) {
-
-
     mdcDataDebugMessage.debugEntryMessage("VSP Id", vspId);
 
-    VspDetails vspDetails =
-        vspInfoDao.get(new VspDetails(vspId, version));
-    Collection<ComponentEntity> componentEntities =
-        vendorSoftwareProductDao.listComponentsQuestionnaire(vspId, version);
-    Collection<NicEntity> nicEntities = vendorSoftwareProductDao.listNicsByVsp(vspId, version);
+    VspDetails vspDetails = vspInfoDao.get(new VspDetails(vspId, version));
+    Collection<ComponentEntity> componentEntities = componentDao.listQuestionnaires(vspId, version);
+    Collection<NicEntity> nicEntities = nicDao.listByVsp(vspId, version);
 
     VspQuestionnaire vspQuestionnaire = getVspQuestionnaireFromJson(vspId, version);
     List<ComponentQuestionnaire> componentQuestionnaireList =
@@ -100,7 +99,6 @@
     return componentQuestionnaireList;
   }
 
-
   private List<NicQuestionnaire> getListOfNicQuestionnaireFromJson(Collection<NicEntity> entities) {
     List<NicQuestionnaire> nicQuestionnaireList = new ArrayList<>();
 
@@ -112,5 +110,4 @@
     return nicQuestionnaireList;
   }
 
-
 }
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/ManualVspDataCollectionService.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/ManualVspDataCollectionService.java
index 1004258..73b9491 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/ManualVspDataCollectionService.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/ManualVspDataCollectionService.java
@@ -23,12 +23,12 @@
 import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDaoFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.ComputeDao;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.ComputeDaoFactory;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.DeploymentFlavorDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.DeploymentFlavorDaoFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.ImageDao;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.ImageDaoFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.NicDao;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.NicDaoFactory;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDaoFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDao;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDaoFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity;
@@ -57,10 +57,10 @@
 
 public class ManualVspDataCollectionService {
 
-  private static final VendorSoftwareProductDao vendorSoftwareProductDao =
-      VendorSoftwareProductDaoFactory.getInstance().createInterface();
   private static final VendorSoftwareProductInfoDao vendorSoftwareProductInfoDao =
       VendorSoftwareProductInfoDaoFactory.getInstance().createInterface();
+  private static final DeploymentFlavorDao deploymentFlavorDao =
+      DeploymentFlavorDaoFactory.getInstance().createInterface();
   private static final ComputeDao computeDao =
       ComputeDaoFactory.getInstance().createInterface();
   private static final ImageDao imageDao =
@@ -75,16 +75,14 @@
 
   private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName());
 
-
   /**
    * Gets vendor name for the vsp.
    *
    * @param vspId   the vsp id
    * @param version the version
-   * @param user    the user
    * @return the release vendor name
    */
-  public Optional<String> getReleaseVendor(String vspId, Version version, String user) {
+  public Optional<String> getReleaseVendor(String vspId, Version version) {
     String vendorName = null;
     VspDetails vspDetails = vendorSoftwareProductInfoDao.get(new VspDetails(vspId, version));
     if (Objects.nonNull(vspDetails)) {
@@ -98,14 +96,12 @@
    *
    * @param vspId   the vsp id
    * @param version the version
-   * @param user    the user
    * @return the allowed flavors
    */
-  public Map<String, DeploymentFlavorModel> getAllowedFlavors(String vspId, Version version,
-                                                              String user) {
+  public Map<String, DeploymentFlavorModel> getAllowedFlavors(String vspId, Version version) {
     Map<String, DeploymentFlavorModel> allowedFlavors = new HashMap<>();
     Collection<DeploymentFlavorEntity> deploymentFlavorEntities =
-        vendorSoftwareProductDao.listDeploymentFlavors(vspId, version);
+        deploymentFlavorDao.list(new DeploymentFlavorEntity(vspId, version, null));
     if (CollectionUtils.isNotEmpty(deploymentFlavorEntities)) {
       for (DeploymentFlavorEntity deploymentFlavorEntity : deploymentFlavorEntities) {
         DeploymentFlavor deploymentFlavorCompositionData =
@@ -129,13 +125,12 @@
             LicenseFlavor licenseFlavor = getLicenseFlavor(featureGroupId);
             deploymentFlavorModel.setLicense_flavor(licenseFlavor);
             //Get sp_part_number
-            Optional<String> partNumber = getPartNumber(vspVlmId, vlmVersion, featureGroupId,
-                user);
+            Optional<String> partNumber = getPartNumber(vspVlmId, vlmVersion, featureGroupId);
             partNumber.ifPresent(deploymentFlavorModel::setSp_part_number);
             //Gather and set Vendor Info
             String vendorModel = deploymentFlavorCompositionData.getModel();
             Optional<VendorInfo> vendorInfo = getVendorInfo(vspVlmId, vendorModel, vlmVersion,
-                featureGroupId, user);
+                featureGroupId);
             vendorInfo.ifPresent(deploymentFlavorModel::setVendor_info);
             //Gather and set Compute info
             List<ComponentComputeAssociation> componentComputeAssociations =
@@ -146,7 +141,7 @@
                 String componentId = componentComputeAssociation.getComponentId();
                 String computeFlavorId = componentComputeAssociation.getComputeFlavorId();
                 Optional<ComputeFlavor> computeFlavor =
-                    getComputeFlavor(vspId, version, componentId, computeFlavorId, user);
+                    getComputeFlavor(vspId, version, componentId, computeFlavorId);
                 computeFlavor.ifPresent(deploymentFlavorModel::setCompute_flavor);
               }
             }
@@ -164,15 +159,13 @@
    *
    * @param vspId   the vsp id
    * @param version the version
-   * @param user    the user
    * @return the vsp component images
    */
   public Map<String, List<MultiFlavorVfcImage>> getVspComponentImages(String vspId,
-                                                                      Version version,
-                                                                      String user) {
+                                                                      Version version) {
     Map<String, List<MultiFlavorVfcImage>> vspComponentImages = new HashMap<>();
     Collection<DeploymentFlavorEntity> deploymentFlavorEntities =
-        vendorSoftwareProductDao.listDeploymentFlavors(vspId, version);
+        deploymentFlavorDao.list(new DeploymentFlavorEntity(vspId, version, null));
     for (DeploymentFlavorEntity deploymentFlavorEntity : deploymentFlavorEntities) {
       DeploymentFlavor deploymentFlavorCompositionData =
           deploymentFlavorEntity.getDeploymentFlavorCompositionData();
@@ -184,7 +177,7 @@
             componentComputeAssociations) {
           String componentId = componentComputeAssociation.getComponentId();
           List<MultiFlavorVfcImage> componentImages =
-              getComponentImages(vspId, version, componentId, user);
+              getComponentImages(vspId, version, componentId);
           if (CollectionUtils.isNotEmpty(componentImages)) {
             vspComponentImages.put(componentId, componentImages);
           }
@@ -199,13 +192,12 @@
    *
    * @param vspId   the vsp id
    * @param version the version
-   * @param user    the user
    * @return the vsp components
    */
-  public Map<String, String> getVspComponents(String vspId, Version version, String user) {
+  public Map<String, String> getVspComponents(String vspId, Version version) {
     Map<String, String> componentIdNameMap = new HashMap<>();
     Collection<DeploymentFlavorEntity> deploymentFlavorEntities =
-        vendorSoftwareProductDao.listDeploymentFlavors(vspId, version);
+        deploymentFlavorDao.list(new DeploymentFlavorEntity(vspId, version, null));
     for (DeploymentFlavorEntity deploymentFlavorEntity : deploymentFlavorEntities) {
       DeploymentFlavor deploymentFlavorCompositionData =
           deploymentFlavorEntity.getDeploymentFlavorCompositionData();
@@ -216,7 +208,7 @@
         for (ComponentComputeAssociation componentComputeAssociation :
             componentComputeAssociations) {
           String componentId = componentComputeAssociation.getComponentId();
-          Optional<String> componentName = getComponentName(vspId, version, componentId, user);
+          Optional<String> componentName = getComponentName(vspId, version, componentId);
           componentName.ifPresent(name -> componentIdNameMap.put(componentId, name));
         }
       }
@@ -229,13 +221,12 @@
    *
    * @param vspId   the vsp id
    * @param version the version
-   * @param user    the user
    * @return the vsp component nics
    */
-  public Map<String, List<Nic>> getVspComponentNics(String vspId, Version version, String user) {
+  public Map<String, List<Nic>> getVspComponentNics(String vspId, Version version) {
     Map<String, List<Nic>> vspComponentNics = new HashMap<>();
     Collection<DeploymentFlavorEntity> deploymentFlavorEntities =
-        vendorSoftwareProductDao.listDeploymentFlavors(vspId, version);
+        deploymentFlavorDao.list(new DeploymentFlavorEntity(vspId, version, null));
     if (CollectionUtils.isNotEmpty(deploymentFlavorEntities)) {
       for (DeploymentFlavorEntity deploymentFlavorEntity : deploymentFlavorEntities) {
         DeploymentFlavor deploymentFlavorCompositionData =
@@ -247,7 +238,7 @@
             for (ComponentComputeAssociation componentComputeAssociation :
                 componentComputeAssociations) {
               String componentId = componentComputeAssociation.getComponentId();
-              List<Nic> componentNics = getComponentNics(vspId, version, componentId, user);
+              List<Nic> componentNics = getComponentNics(vspId, version, componentId);
               if (CollectionUtils.isNotEmpty(componentNics)) {
                 vspComponentNics.put(componentId, componentNics);
               }
@@ -259,8 +250,7 @@
     return vspComponentNics;
   }
 
-  private List<Nic> getComponentNics(String vspId, Version version, String componentId,
-                                     String user) {
+  private List<Nic> getComponentNics(String vspId, Version version, String componentId) {
     List<Nic> componentNics = new ArrayList<>();
     Collection<NicEntity> nics = nicDao.list(new NicEntity(vspId, version, componentId, null));
     if (Objects.nonNull(nics)) {
@@ -283,8 +273,8 @@
   }
 
   private Optional<String> getPartNumber(String vlmId, Version version,
-                                         String featureGroupId, String user) {
-    FeatureGroupModel featureGroup = getFeatureGroup(vlmId, version, featureGroupId, user);
+                                         String featureGroupId) {
+    FeatureGroupModel featureGroup = getFeatureGroup(vlmId, version, featureGroupId);
     if (Objects.nonNull(featureGroup)) {
       return Optional.ofNullable(featureGroup.getFeatureGroup().getPartNumber());
     }
@@ -292,9 +282,9 @@
   }
 
   private Optional<VendorInfo> getVendorInfo(String vlmId, String vendorModel, Version version,
-                                             String featureGroupId, String user) {
+                                             String featureGroupId) {
     VendorInfo vendorInfo = null;
-    FeatureGroupModel featureGroup = getFeatureGroup(vlmId, version, featureGroupId, user);
+    FeatureGroupModel featureGroup = getFeatureGroup(vlmId, version, featureGroupId);
     if (Objects.nonNull(featureGroup)) {
       //Process Feature group to get Manufacturer ref no.
       String manufacturerReferenceNumber = featureGroup.getEntityManufacturerReferenceNumber();
@@ -308,29 +298,28 @@
   }
 
   private Optional<ComputeFlavor> getComputeFlavor(String vspId, Version version,
-                                                   String componentId, String computeFlavorId,
-                                                   String user) {
+                                                   String componentId, String computeFlavorId) {
     ComputeFlavor computeFlavor = null;
     ComputeEntity computeQuestionnaire = null;
     try {
       computeQuestionnaire = computeDao.getQuestionnaireData(vspId, version, componentId,
           computeFlavorId);
     } catch (Exception ex) {
-      log.debug("",ex);
+      log.debug("", ex);
       computeQuestionnaire = null;
       MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_API,
           LoggerTragetServiceName.COLLECT_MANUAL_VSP_TOSCA_DATA, ErrorLevel.INFO.name(),
           LoggerErrorCode.DATA_ERROR.getErrorCode(), "Failed to get compute questionnaire : "
               + ex.getMessage());
     }
-    if (computeQuestionnaire != null && Objects.nonNull(computeQuestionnaire)) {
+    if (Objects.nonNull(computeQuestionnaire)) {
       String computeQuestionnaireData = computeQuestionnaire.getQuestionnaireData();
       if (Objects.nonNull(computeQuestionnaireData)) {
         Compute compute;
         try {
           compute = JsonUtil.json2Object(computeQuestionnaireData, Compute.class);
         } catch (Exception ex) {
-          log.debug("",ex);
+          log.debug("", ex);
           compute = null;
           MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_API,
               LoggerTragetServiceName.COLLECT_MANUAL_VSP_TOSCA_DATA, ErrorLevel.INFO.name(),
@@ -354,17 +343,15 @@
     return Optional.ofNullable(computeFlavor);
   }
 
-  private FeatureGroupModel getFeatureGroup(String vlmId, Version version, String featureGroupId,
-                                            String user) {
+  private FeatureGroupModel getFeatureGroup(String vlmId, Version version, String featureGroupId) {
     FeatureGroupEntity fgInput = new FeatureGroupEntity();
     fgInput.setVendorLicenseModelId(vlmId);
     fgInput.setVersion(version);
     fgInput.setId(featureGroupId);
-    return vendorLicenseFacade.getFeatureGroupModel(fgInput, user);
+    return vendorLicenseFacade.getFeatureGroupModel(fgInput);
   }
 
-  private Optional<String> getComponentName(String vspId, Version version, String componentId,
-                                            String user) {
+  private Optional<String> getComponentName(String vspId, Version version, String componentId) {
 
     ComponentEntity componentEntity =
         componentDao.get(new ComponentEntity(vspId, version, componentId));
@@ -377,18 +364,16 @@
   }
 
   private List<MultiFlavorVfcImage> getComponentImages(String vspId, Version version,
-                                                       String componentId, String user) {
+                                                       String componentId) {
     List<MultiFlavorVfcImage> multiFlavorVfcImages = new ArrayList<>();
-    MultiFlavorVfcImage multiFlavorVfcImage = null;
+    MultiFlavorVfcImage multiFlavorVfcImage;
     Collection<ImageEntity> componentImages =
-        vendorSoftwareProductDao.listImages(vspId, version, componentId);
+        imageDao.list(new ImageEntity(vspId, version, componentId, null));
     if (Objects.nonNull(componentImages)) {
       for (ImageEntity componentImage : componentImages) {
-        String imageId = componentImage.getId();
-        ImageEntity imageEntity = vendorSoftwareProductDao.getImage(vspId, version, componentId,
-            imageId);
+        ImageEntity imageEntity = imageDao.get(componentImage);
         ImageEntity imageQuestionnaireDataEntity = imageDao.getQuestionnaireData(vspId, version,
-            componentId, imageId);
+            componentId, componentImage.getId());
         Image imageCompositionData = imageEntity.getImageCompositionData();
         if (Objects.nonNull(imageEntity)
             && Objects.nonNull(imageQuestionnaireDataEntity)
@@ -398,14 +383,14 @@
             imageDetails = JsonUtil.json2Object(imageQuestionnaireDataEntity
                 .getQuestionnaireData(), ImageDetails.class);
           } catch (Exception ex) {
-            log.debug("",ex);
+            log.debug("", ex);
             imageDetails = null;
             MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_API,
                 LoggerTragetServiceName.COLLECT_MANUAL_VSP_TOSCA_DATA, ErrorLevel.INFO.name(),
                 LoggerErrorCode.DATA_ERROR.getErrorCode(), "Unable to parse image questionnaire : "
                     + ex.getMessage());
           }
-          if (imageDetails != null && Objects.nonNull(imageDetails)
+          if (Objects.nonNull(imageDetails)
               && Objects.nonNull(imageDetails.getVersion())) {
             //Image version is used as a key for the image block
             //So excluding the population if questionnaire data is absent or invalid
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/composition/CompositionDataExtractorImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/composition/CompositionDataExtractorImpl.java
index 19e48ec..6b57649 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/composition/CompositionDataExtractorImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/composition/CompositionDataExtractorImpl.java
@@ -47,8 +47,8 @@
 import org.openecomp.sdc.tosca.errors.ToscaMissingSubstitutionMappingForReqCapErrorBuilder;
 import org.openecomp.sdc.tosca.services.ToscaAnalyzerService;
 import org.openecomp.sdc.tosca.services.ToscaConstants;
-import org.openecomp.sdc.tosca.services.impl.ToscaAnalyzerServiceImpl;
 import org.openecomp.sdc.tosca.services.ToscaExtensionYamlUtil;
+import org.openecomp.sdc.tosca.services.impl.ToscaAnalyzerServiceImpl;
 import org.openecomp.sdc.vendorsoftwareproduct.services.composition.CompositionDataExtractor;
 import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Component;
 import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentData;
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/composition/CompositionEntityDataManagerImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/composition/CompositionEntityDataManagerImpl.java
index 39534cf..ab5ee6c 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/composition/CompositionEntityDataManagerImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/composition/CompositionEntityDataManagerImpl.java
@@ -37,7 +37,6 @@
 import org.openecomp.sdc.vendorsoftwareproduct.dao.ImageDao;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.NetworkDao;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.NicDao;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDao;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity;
 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.CompositionEntity;
@@ -78,14 +77,14 @@
 public class CompositionEntityDataManagerImpl implements CompositionEntityDataManager {
 
   private static final String COMPOSITION_ENTITY_DATA_MANAGER_ERR =
-          "COMPOSITION_ENTITY_DATA_MANAGER_ERR";
+      "COMPOSITION_ENTITY_DATA_MANAGER_ERR";
   private static final String COMPOSITION_ENTITY_DATA_MANAGER_ERR_MSG =
-          "Invalid input: %s may not be null";
+      "Invalid input: %s may not be null";
   private static final String MISSING_OR_INVALID_QUESTIONNAIRE_MSG =
       "Data is missing/invalid for this %s. Please refill and resubmit.";
 
   private static final Logger logger =
-          LoggerFactory.getLogger(CompositionEntityDataManagerImpl.class);
+      LoggerFactory.getLogger(CompositionEntityDataManagerImpl.class);
   private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage();
 
   private Map<CompositionEntityId, CompositionEntityData> entities = new HashMap<>();
@@ -99,14 +98,12 @@
   private ImageDao imageDao;
   private ComputeDao computeDao;
   private DeploymentFlavorDao deploymentFlavorDao;
-  private VendorSoftwareProductDao vendorSoftwareProductDao;
 
   public CompositionEntityDataManagerImpl(VendorSoftwareProductInfoDao vspInfoDao,
                                           ComponentDao componentDao,
                                           NicDao nicDao, NetworkDao networkDao,
                                           ImageDao imageDao, ComputeDao computeDao,
-                                          DeploymentFlavorDao deploymentFlavorDao,
-                                          VendorSoftwareProductDao vendorSoftwareProductDao) {
+                                          DeploymentFlavorDao deploymentFlavorDao) {
     this.vspInfoDao = vspInfoDao;
     this.componentDao = componentDao;
     this.nicDao = nicDao;
@@ -114,7 +111,6 @@
     this.imageDao = imageDao;
     this.computeDao = computeDao;
     this.deploymentFlavorDao = deploymentFlavorDao;
-    this.vendorSoftwareProductDao = vendorSoftwareProductDao;
   }
 
   /**
@@ -133,27 +129,27 @@
 
     if (entity == null) {
       throw new CoreException(
-              new ErrorCode.ErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION)
-                      .withId(COMPOSITION_ENTITY_DATA_MANAGER_ERR).withMessage(
-                      String.format(COMPOSITION_ENTITY_DATA_MANAGER_ERR_MSG, "composition entity"))
-                      .build());
+          new ErrorCode.ErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION)
+              .withId(COMPOSITION_ENTITY_DATA_MANAGER_ERR).withMessage(
+              String.format(COMPOSITION_ENTITY_DATA_MANAGER_ERR_MSG, "composition entity"))
+              .build());
     }
     if (schemaTemplateContext == null) {
       throw new CoreException(
-              new ErrorCode.ErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION)
-                      .withId(COMPOSITION_ENTITY_DATA_MANAGER_ERR).withMessage(
-                      String.format(COMPOSITION_ENTITY_DATA_MANAGER_ERR_MSG, "schema template context"))
-                      .build());
+          new ErrorCode.ErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION)
+              .withId(COMPOSITION_ENTITY_DATA_MANAGER_ERR).withMessage(
+              String.format(COMPOSITION_ENTITY_DATA_MANAGER_ERR_MSG, "schema template context"))
+              .build());
     }
 
     CompositionEntityValidationData validationData =
-            new CompositionEntityValidationData(entity.getType(), entity.getId());
+        new CompositionEntityValidationData(entity.getType(), entity.getId());
     String json =
-            schemaTemplateContext == SchemaTemplateContext.composition ? entity.getCompositionData()
-                    : entity.getQuestionnaireData();
+        schemaTemplateContext == SchemaTemplateContext.composition ? entity.getCompositionData()
+            : entity.getQuestionnaireData();
     validationData.setErrors(JsonUtil.validate(
-            json == null ? JsonUtil.object2Json(new Object()) : json,
-            generateSchema(schemaTemplateContext, entity.getType(), schemaTemplateInput)));
+        json == null ? JsonUtil.object2Json(new Object()) : json,
+        generateSchema(schemaTemplateContext, entity.getType(), schemaTemplateInput)));
 
     mdcDataDebugMessage.debugExitMessage(null);
     return validationData;
@@ -169,13 +165,13 @@
   public void addEntity(CompositionEntity entity, SchemaTemplateInput schemaTemplateInput) {
     if (entity == null) {
       throw new CoreException(
-              new ErrorCode.ErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION)
-                      .withId(COMPOSITION_ENTITY_DATA_MANAGER_ERR).withMessage(
-                      String.format(COMPOSITION_ENTITY_DATA_MANAGER_ERR_MSG, "composition entity"))
-                      .build());
+          new ErrorCode.ErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION)
+              .withId(COMPOSITION_ENTITY_DATA_MANAGER_ERR).withMessage(
+              String.format(COMPOSITION_ENTITY_DATA_MANAGER_ERR_MSG, "composition entity"))
+              .build());
     }
     entities.put(entity.getCompositionEntityId(),
-            new CompositionEntityData(entity, schemaTemplateInput));
+        new CompositionEntityData(entity, schemaTemplateInput));
   }
 
   /**
@@ -205,10 +201,10 @@
   @Override
   public void buildTrees() {
     Map<CompositionEntityId, CompositionEntityValidationData> entitiesValidationData =
-            new HashMap<>();
+        new HashMap<>();
     entities.entrySet().forEach(
-            entry -> addValidationDataEntity(entitiesValidationData, entry.getKey(),
-                    entry.getValue().entity));
+        entry -> addValidationDataEntity(entitiesValidationData, entry.getKey(),
+            entry.getValue().entity));
   }
 
   public Collection<CompositionEntityValidationData> getTrees() {
@@ -259,14 +255,14 @@
     }
 
     Collection<CompositionEntityValidationData> subEntitiesValidationData =
-            entity.getSubEntitiesValidationData();
+        entity.getSubEntitiesValidationData();
     return !CollectionUtils.isEmpty(subEntitiesValidationData) &&
-            checkForErrorsInChildren(subEntitiesValidationData);
+        checkForErrorsInChildren(subEntitiesValidationData);
 
   }
 
   private boolean checkForErrorsInChildren(
-          Collection<CompositionEntityValidationData> subEntitiesValidationData) {
+      Collection<CompositionEntityValidationData> subEntitiesValidationData) {
     boolean result = false;
     for (CompositionEntityValidationData subEntity : subEntitiesValidationData) {
       if (CollectionUtils.isNotEmpty(subEntity.getErrors())) {
@@ -360,10 +356,10 @@
 
     //component.setId(CommonMethods.nextUuId()); will be set by the dao
     component.setQuestionnaireData(
-            new JsonSchemaDataGenerator(
-                    generateSchema(SchemaTemplateContext.questionnaire, CompositionEntityType.component,
-                            null))
-                    .generateData());
+        new JsonSchemaDataGenerator(
+            generateSchema(SchemaTemplateContext.questionnaire, CompositionEntityType.component,
+                null))
+            .generateData());
 
     componentDao.create(component);
 
@@ -377,9 +373,9 @@
 
     //nic.setId(CommonMethods.nextUuId()); will be set by the dao
     nic.setQuestionnaireData(
-            new JsonSchemaDataGenerator(
-                    generateSchema(SchemaTemplateContext.questionnaire, CompositionEntityType.nic, null))
-                    .generateData());
+        new JsonSchemaDataGenerator(
+            generateSchema(SchemaTemplateContext.questionnaire, CompositionEntityType.nic, null))
+            .generateData());
 
     nicDao.create(nic);
 
@@ -412,28 +408,26 @@
     return treeAsList;
   }
 
-  public void getEntityListWithErrors(CompositionEntityValidationData entity,
+  private void getEntityListWithErrors(CompositionEntityValidationData entity,
                                       Set<CompositionEntityValidationData> compositionSet) {
-    Collection<CompositionEntityValidationData> childNodes =
-            entity.getSubEntitiesValidationData();
+    if(CollectionUtils.isNotEmpty(entity.getErrors())){
+      addNodeWithErrors(entity, compositionSet);
+    }
 
-    if (CollectionUtils.isEmpty(childNodes)) {
+    if (CollectionUtils.isEmpty(entity.getSubEntitiesValidationData())) {
       return;
     }
 
-    for (CompositionEntityValidationData child : childNodes) {
-      if (CollectionUtils.isNotEmpty(child.getErrors())) {
-        addNodeWithErrors(child, compositionSet);
-      }
+    for (CompositionEntityValidationData child : entity.getSubEntitiesValidationData()) {
       getEntityListWithErrors(child, compositionSet);
     }
   }
 
 
-  public void addNodeWithErrors(CompositionEntityValidationData node,
+  private void addNodeWithErrors(CompositionEntityValidationData node,
                                 Set<CompositionEntityValidationData> entitiesWithErrors) {
     CompositionEntityValidationData compositionNodeToAdd = new CompositionEntityValidationData(node
-            .getEntityType(), node.getEntityId());
+        .getEntityType(), node.getEntityId());
     compositionNodeToAdd.setErrors(node.getErrors());
     compositionNodeToAdd.setSubEntitiesValidationData(null);
 
@@ -446,9 +440,9 @@
 
 
   private CompositionEntityData getCompositionEntityDataById(CompositionEntityValidationData
-                                                                     entity) {
+                                                                 entity) {
     for (Map.Entry<CompositionEntityId, CompositionEntityData> entityEntry : entities
-            .entrySet()) {
+        .entrySet()) {
       if (entityEntry.getKey().getId().equals(entity.getEntityId())) {
         return entityEntry.getValue();
       }
@@ -458,11 +452,11 @@
 
 
   private void updateValidationCompositionEntityName(Set<CompositionEntityValidationData>
-                                                             compositionSet) {
+                                                         compositionSet) {
     for (CompositionEntityValidationData entity : compositionSet) {
       String compositionData = getCompositionDataAsString(entity);
       if (entity.getEntityType().equals(CompositionEntityType.vsp) ||
-              Objects.nonNull(compositionData)) {
+          Objects.nonNull(compositionData)) {
         entity.setEntityName(getEntityNameByEntityType(compositionData, entity));
       }
     }
@@ -497,8 +491,8 @@
         CompositionEntityData vspEntity = getCompositionEntityDataById(entity);
         VspQuestionnaireEntity vspQuestionnaireEntity = (VspQuestionnaireEntity) vspEntity.entity;
         VspDetails vspDetails =
-                vspInfoDao.get(new VspDetails(vspQuestionnaireEntity.getId(),
-                        vspQuestionnaireEntity.getVersion()));
+            vspInfoDao.get(new VspDetails(vspQuestionnaireEntity.getId(),
+                vspQuestionnaireEntity.getVersion()));
         return vspDetails.getName();
     }
 
@@ -514,7 +508,7 @@
 
     if (hasChildren(node)) {
       Collection<CompositionEntityValidationData> subNodes =
-              new ArrayList<>(node.getSubEntitiesValidationData());
+          new ArrayList<>(node.getSubEntitiesValidationData());
       subNodes.forEach(subNode -> removeNodesWithoutErrors(subNode, node));
       node.setSubEntitiesValidationData(subNodes);
 
@@ -543,14 +537,14 @@
 
 
   private void addValidationDataEntity(
-          Map<CompositionEntityId, CompositionEntityValidationData> entitiesValidationData,
-          CompositionEntityId entityId, CompositionEntity entity) {
+      Map<CompositionEntityId, CompositionEntityValidationData> entitiesValidationData,
+      CompositionEntityId entityId, CompositionEntity entity) {
     if (entitiesValidationData.containsKey(entityId)) {
       return;
     }
 
     CompositionEntityValidationData validationData =
-            new CompositionEntityValidationData(entity.getType(), entity.getId());
+        new CompositionEntityValidationData(entity.getType(), entity.getId());
     entitiesValidationData.put(entityId, validationData);
 
     CompositionEntityId parentEntityId = entityId.getParentId();
@@ -578,16 +572,16 @@
 
     if (node.getSubEntitiesValidationData() != null) {
       node.getSubEntitiesValidationData()
-              .forEach(subNode -> addErrorsToTree(subNode, nodeId, errors));
+          .forEach(subNode -> addErrorsToTree(subNode, nodeId, errors));
     }
   }
 
   private Collection<String> validateQuestionnaire(CompositionEntityData compositionEntityData) {
     logger.debug(String.format("validateQuestionnaire start:  " +
-                    "[entity.type]=%s, [entity.id]=%s, [entity.questionnaireString]=%s",
-            compositionEntityData.entity.getType().name(),
-            compositionEntityData.entity.getCompositionEntityId().toString(),
-            compositionEntityData.entity.getQuestionnaireData()));
+            "[entity.type]=%s, [entity.id]=%s, [entity.questionnaireString]=%s",
+        compositionEntityData.entity.getType().name(),
+        compositionEntityData.entity.getCompositionEntityId().toString(),
+        compositionEntityData.entity.getQuestionnaireData()));
 
     if (Objects.isNull(compositionEntityData.entity.getQuestionnaireData()) ||
         !JsonUtil.isValidJson(compositionEntityData.entity.getQuestionnaireData())) {
@@ -596,20 +590,20 @@
     }
 
     return JsonUtil.validate(
-            compositionEntityData.entity.getQuestionnaireData() == null
-                    ? JsonUtil.object2Json(new Object())
-                    : compositionEntityData.entity.getQuestionnaireData(),
-            getSchema(compositionEntityData.entity.getType(), SchemaTemplateContext.questionnaire,
-                    compositionEntityData.schemaTemplateInput));
+        compositionEntityData.entity.getQuestionnaireData() == null
+            ? JsonUtil.object2Json(new Object())
+            : compositionEntityData.entity.getQuestionnaireData(),
+        getSchema(compositionEntityData.entity.getType(), SchemaTemplateContext.questionnaire,
+            compositionEntityData.schemaTemplateInput));
   }
 
   private String getSchema(CompositionEntityType compositionEntityType,
                            SchemaTemplateContext schemaTemplateContext,
                            SchemaTemplateInput schemaTemplateInput) {
     return schemaTemplateInput == null
-            ? nonDynamicSchemas.computeIfAbsent(compositionEntityType,
-            k -> generateSchema(schemaTemplateContext, compositionEntityType, null))
-            : generateSchema(schemaTemplateContext, compositionEntityType, schemaTemplateInput);
+        ? nonDynamicSchemas.computeIfAbsent(compositionEntityType,
+        k -> generateSchema(schemaTemplateContext, compositionEntityType, null))
+        : generateSchema(schemaTemplateContext, compositionEntityType, schemaTemplateInput);
   }
 
   private static class CompositionEntityData {
@@ -630,7 +624,7 @@
                                   CompositionEntityType compositionEntityType,
                                   SchemaTemplateInput schemaTemplateInput) {
     return SchemaGenerator
-            .generate(schemaTemplateContext, compositionEntityType, schemaTemplateInput);
+        .generate(schemaTemplateContext, compositionEntityType, schemaTemplateInput);
   }
 
   @Override
@@ -649,46 +643,33 @@
     image.setId(CommonMethods.nextUuId());
 
     image.setQuestionnaireData(
-            new JsonSchemaDataGenerator(SchemaGenerator
-                    .generate(SchemaTemplateContext.questionnaire, CompositionEntityType.image, null))
-                    .generateData());
+        new JsonSchemaDataGenerator(SchemaGenerator
+            .generate(SchemaTemplateContext.questionnaire, CompositionEntityType.image, null))
+            .generateData());
 
     imageDao.create(image);
     mdcDataDebugMessage.debugExitMessage(null, null);
     return image;
   }
 
-  @Override
-  public ComputeEntity createCompute(ComputeEntity compute) {
-    mdcDataDebugMessage.debugEntryMessage("VSP id, component id", compute.getVspId(),
-            compute.getComponentId());
-
-    compute.setId(CommonMethods.nextUuId());
-    compute.setQuestionnaireData(
-            new JsonSchemaDataGenerator(SchemaGenerator
-                    .generate(SchemaTemplateContext.questionnaire, CompositionEntityType.compute,
-                            null)).generateData());
-
-    computeDao.create(compute);
-
-    mdcDataDebugMessage.debugExitMessage("VSP id, component id", compute.getVspId(),
-            compute.getComponentId());
-    return compute;
-  }
-
   public void saveComputesFlavorByComponent(String vspId, Version version, Component component,
                                             String componentId) {
     if (CollectionUtils.isNotEmpty(component.getCompute())) {
       for (ComputeData flavor : component.getCompute()) {
         ComputeEntity computeEntity = new ComputeEntity(vspId, version, componentId, null);
         computeEntity.setComputeCompositionData(flavor);
-        createCompute(computeEntity);
+        computeEntity.setQuestionnaireData(
+            new JsonSchemaDataGenerator(SchemaGenerator
+                .generate(SchemaTemplateContext.questionnaire, CompositionEntityType.compute,
+                    null)).generateData());
+
+        computeDao.create(computeEntity);
       }
     }
   }
 
   public void saveImagesByComponent(String vspId, Version version, Component component, String
-          componentId) {
+      componentId) {
     if (CollectionUtils.isNotEmpty(component.getImages())) {
       for (Image img : component.getImages()) {
         ImageEntity imageEntity = new ImageEntity(vspId, version, componentId, null);
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/filedatastructuremodule/CandidateServiceImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/filedatastructuremodule/CandidateServiceImpl.java
index 640777e..45746ed 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/filedatastructuremodule/CandidateServiceImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/filedatastructuremodule/CandidateServiceImpl.java
@@ -72,577 +72,591 @@
 import java.util.zip.ZipOutputStream;
 
 public class CandidateServiceImpl implements CandidateService {
-    protected static final Logger logger = LoggerFactory.getLogger(CandidateServiceImpl.class);
-    private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage();
+  protected static final Logger logger = LoggerFactory.getLogger(CandidateServiceImpl.class);
+  private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage();
 
-    private CandidateServiceValidator candidateServiceValidator = new CandidateServiceValidator();
-    private ManifestCreator manifestCreator;
-    private OrchestrationTemplateCandidateDao orchestrationTemplateCandidateDataDao;
+  private CandidateServiceValidator candidateServiceValidator = new CandidateServiceValidator();
+  private ManifestCreator manifestCreator;
+  private OrchestrationTemplateCandidateDao orchestrationTemplateCandidateDao;
 
-    public CandidateServiceImpl(ManifestCreator manifestCreator,
-                                OrchestrationTemplateCandidateDao orchestrationTemplateCandidateDataDao) {
-        this.manifestCreator = manifestCreator;
-        this.orchestrationTemplateCandidateDataDao = orchestrationTemplateCandidateDataDao;
+  public CandidateServiceImpl(ManifestCreator manifestCreator,
+                              OrchestrationTemplateCandidateDao orchestrationTemplateCandidateDao) {
+    this.manifestCreator = manifestCreator;
+    this.orchestrationTemplateCandidateDao = orchestrationTemplateCandidateDao;
 
-    }
+  }
 
-    public CandidateServiceImpl() {
-    }
+  public CandidateServiceImpl() {
+  }
 
-    @Override
-    public Optional<ErrorMessage> validateNonEmptyFileToUpload(InputStream fileToUpload) {
+  @Override
+  public Optional<ErrorMessage> validateNonEmptyFileToUpload(InputStream fileToUpload) {
 
 
-        mdcDataDebugMessage.debugEntryMessage(null);
+    mdcDataDebugMessage.debugEntryMessage(null);
 
-        if (Objects.isNull(fileToUpload)) {
-            return Optional.of(new ErrorMessage(ErrorLevel.ERROR,
-                Messages.NO_ZIP_FILE_WAS_UPLOADED_OR_ZIP_NOT_EXIST.getErrorMessage()));
-        } else {
-            try {
-                int available = fileToUpload.available();
-                if (available == 0) {
-                    mdcDataDebugMessage.debugExitMessage(null);
-                    return Optional.of(new ErrorMessage(ErrorLevel.ERROR,
-                        Messages.NO_ZIP_FILE_WAS_UPLOADED_OR_ZIP_NOT_EXIST.getErrorMessage()));
-                }
-            } catch (IOException e) {
-                logger.debug(e.getMessage(), e);
-                mdcDataDebugMessage.debugExitMessage(null);
-                return Optional.of(new ErrorMessage(ErrorLevel.ERROR,
-                    Messages.NO_ZIP_FILE_WAS_UPLOADED_OR_ZIP_NOT_EXIST.getErrorMessage()));
-            }
+    if (Objects.isNull(fileToUpload)) {
+      return Optional.of(new ErrorMessage(ErrorLevel.ERROR,
+          Messages.NO_ZIP_FILE_WAS_UPLOADED_OR_ZIP_NOT_EXIST.getErrorMessage()));
+    } else {
+      try {
+        int available = fileToUpload.available();
+        if (available == 0) {
+          mdcDataDebugMessage.debugExitMessage(null);
+          return Optional.of(new ErrorMessage(ErrorLevel.ERROR,
+              Messages.NO_ZIP_FILE_WAS_UPLOADED_OR_ZIP_NOT_EXIST.getErrorMessage()));
         }
-
+      } catch (IOException e) {
+        logger.debug(e.getMessage(), e);
         mdcDataDebugMessage.debugExitMessage(null);
-        return Optional.empty();
+        return Optional.of(new ErrorMessage(ErrorLevel.ERROR,
+            Messages.NO_ZIP_FILE_WAS_UPLOADED_OR_ZIP_NOT_EXIST.getErrorMessage()));
+      }
     }
 
-    @Override
-    public Optional<ErrorMessage> validateRawZipData(byte[] uploadedFileData) {
-        if (Objects.isNull(uploadedFileData)) {
-            return Optional.of(new ErrorMessage(ErrorLevel.ERROR,
-                Messages.NO_ZIP_FILE_WAS_UPLOADED_OR_ZIP_NOT_EXIST.getErrorMessage()));
+    mdcDataDebugMessage.debugExitMessage(null);
+    return Optional.empty();
+  }
+
+  @Override
+  public Optional<ErrorMessage> validateRawZipData(byte[] uploadedFileData) {
+    if (Objects.isNull(uploadedFileData)) {
+      return Optional.of(new ErrorMessage(ErrorLevel.ERROR,
+          Messages.NO_ZIP_FILE_WAS_UPLOADED_OR_ZIP_NOT_EXIST.getErrorMessage()));
+    }
+    return Optional.empty();
+  }
+
+  private String heatStructureTreeToFileDataStructure(HeatStructureTree tree,
+                                                      FileContentHandler zipContentMap,
+                                                      Map<String, List<ErrorMessage>> uploadErrors,
+                                                      AnalyzedZipHeatFiles analyzedZipHeatFiles)
+      throws Exception {
+    FilesDataStructure structure = new FilesDataStructure();
+    Set<String> usedEnvFiles = new HashSet<>();
+    addHeatsToFileDataStructure(tree, usedEnvFiles, structure, uploadErrors,
+        analyzedZipHeatFiles);
+    handleOtherResources(tree, usedEnvFiles, structure);
+    FilesDataStructure fileDataStructureFromManifest =
+        createFileDataStructureFromManifest(zipContentMap.getFileContent
+            (SdcCommon.MANIFEST_NAME));
+    List<String> structureArtifacts = structure.getArtifacts();
+    structureArtifacts.addAll(fileDataStructureFromManifest.getArtifacts().stream().filter
+        (artifact -> isNotStrctureArtifact(structureArtifacts, artifact))
+        .collect((Collectors.toList())));
+    handleArtifactsFromTree(tree, structure);
+
+    return JsonUtil.object2Json(structure);
+  }
+
+  private boolean isNotStrctureArtifact(List<String> structureArtifacts, String artifact) {
+    return !structureArtifacts.contains(artifact);
+  }
+
+  @Override
+  public OrchestrationTemplateCandidateData createCandidateDataEntity(
+      CandidateDataEntityTo candidateDataEntityTo, InputStream zipFileManifest,
+      AnalyzedZipHeatFiles analyzedZipHeatFiles) throws Exception {
+
+
+    mdcDataDebugMessage.debugEntryMessage(null);
+
+    FileContentHandler zipContentMap = candidateDataEntityTo.getContentMap();
+    FilesDataStructure filesDataStructure;
+    String dataStructureJson;
+
+    if (zipFileManifest != null) {
+      // create data structure from manifest
+      filesDataStructure = createFileDataStructureFromManifest(zipFileManifest);
+      Set<String> zipFileList = zipContentMap.getFileList();
+      balanceManifestFilesWithZipFiles(filesDataStructure,
+          zipContentMap, analyzedZipHeatFiles);
+      Set<String> filesDataStructureFiles = getFlatFileNames(filesDataStructure);
+      filesDataStructure.getUnassigned().addAll(zipFileList.stream()
+          .filter(fileName -> (!filesDataStructureFiles.contains(fileName) &&
+              !filesDataStructure.getNested().contains(fileName) &&
+              !fileName.equals(SdcCommon.MANIFEST_NAME)))
+          .collect(Collectors.toList()));
+      dataStructureJson = JsonUtil.object2Json(filesDataStructure);
+    } else {
+      // create data structure from based on naming convention
+      dataStructureJson =
+          heatStructureTreeToFileDataStructure(candidateDataEntityTo.getTree(), zipContentMap,
+              candidateDataEntityTo.getErrors(), analyzedZipHeatFiles);
+    }
+
+    OrchestrationTemplateCandidateData candidateData = new OrchestrationTemplateCandidateData();
+    candidateData.setContentData(ByteBuffer.wrap(candidateDataEntityTo.getUploadedFileData()));
+    candidateData.setFilesDataStructure(dataStructureJson);
+
+    mdcDataDebugMessage.debugExitMessage(null);
+    return candidateData;
+  }
+
+  private void balanceManifestFilesWithZipFiles(
+      FilesDataStructure filesDataStructure,
+      FileContentHandler fileContentHandler, AnalyzedZipHeatFiles analyzedZipHeatFiles)
+      throws Exception {
+    Set<String> zipFileList = fileContentHandler.getFileList();
+    filesDataStructure.getNested().addAll(analyzedZipHeatFiles.getNestedFiles());
+    List<Module> modules = filesDataStructure.getModules();
+    if (CollectionUtils.isEmpty(modules)) {
+      return;
+    }
+
+    for (int i = 0; i < modules.size(); i++) {
+      Module module = modules.get(i);
+      if (!isFileExistInZipContains(zipFileList, module.getYaml())) {
+        addFileToUnassigned(filesDataStructure, zipFileList, module.getEnv());
+        addFileToUnassigned(filesDataStructure, zipFileList, module.getVol());
+        addFileToUnassigned(filesDataStructure, zipFileList, module.getVolEnv());
+        modules.remove(i--);
+      } else if (Objects.nonNull(module.getVol()) && !zipFileList.contains(module.getVol())) {
+        module.setVol(null);
+        CollectionUtils
+            .addIgnoreNull(filesDataStructure.getUnassigned(), module.getVolEnv());
+      } else {
+        if (filesDataStructure.getNested().contains(module.getYaml())) {
+          moveModuleFileToNested(filesDataStructure, i--, module);
         }
-        return Optional.empty();
+      }
+    }
+  }
+
+  private void addFileToUnassigned(FilesDataStructure filesDataStructure, Set<String> zipFileList,
+                                   String fileName) {
+    if (isFileExistInZipContains(zipFileList, fileName)) {
+      filesDataStructure.getUnassigned().add(fileName);
+    }
+  }
+
+  private boolean isFileExistInZipContains(Set<String> zipFileList, String fileName) {
+    return Objects.nonNull(fileName) && zipFileList.contains(fileName);
+  }
+
+  private void moveModuleFileToNested(FilesDataStructure filesDataStructure, int i,
+                                      Module module) {
+    if (!filesDataStructure.getNested().contains(module.getYaml())) {
+      filesDataStructure.getNested().add(module.getYaml());
+    }
+    if (Objects.nonNull(module.getEnv())) {
+      filesDataStructure.getNested().add(module.getEnv());
+    }
+    if (Objects.nonNull(module.getVol())) {
+      filesDataStructure.getNested().add(module.getVol());
+    }
+    if (Objects.nonNull(module.getVolEnv())) {
+      filesDataStructure.getNested().add(module.getVolEnv());
+    }
+    filesDataStructure.getModules().remove(i);
+  }
+
+  private Set<String> getFlatFileNames(FilesDataStructure filesDataStructure) {
+    Set<String> fileNames = new HashSet<>();
+    if (!CollectionUtils.isEmpty(filesDataStructure.getModules())) {
+      for (Module module : filesDataStructure.getModules()) {
+        CollectionUtils.addIgnoreNull(fileNames, module.getEnv());
+        CollectionUtils.addIgnoreNull(fileNames, module.getVol());
+        CollectionUtils.addIgnoreNull(fileNames, module.getVolEnv());
+        CollectionUtils.addIgnoreNull(fileNames, module.getYaml());
+      }
+    }
+    fileNames.addAll(filesDataStructure.getArtifacts().stream().collect(Collectors.toSet()));
+    fileNames.addAll(filesDataStructure.getNested().stream().collect(Collectors.toSet()));
+    fileNames.addAll(filesDataStructure.getUnassigned().stream().collect(Collectors.toSet()));
+
+    return fileNames;
+  }
+
+  private FilesDataStructure createFileDataStructureFromManifest(InputStream isManifestContent) {
+
+
+    mdcDataDebugMessage.debugEntryMessage(null);
+
+    ManifestContent manifestContent =
+        JsonUtil.json2Object(isManifestContent, ManifestContent.class);
+    FilesDataStructure structure = new FilesDataStructure();
+    for (FileData fileData : manifestContent.getData()) {
+      if (Objects.nonNull(fileData.getType()) &&
+          fileData.getType().equals(FileData.Type.HEAT)) {
+        Module module = new Module();
+        module.setYaml(fileData.getFile());
+        module.setIsBase(fileData.getBase());
+        addHeatDependenciesToModule(module, fileData.getData());
+        structure.getModules().add(module);
+      } else if (HeatFileAnalyzer.isYamlOrEnvFile(fileData.getFile()) &&
+          !FileData.Type.isArtifact(fileData.getType())) {
+        structure.getUnassigned().add(fileData.getFile());
+      } else {
+        structure.getArtifacts().add(fileData.getFile());
+      }
     }
 
-    private String heatStructureTreeToFileDataStructure(HeatStructureTree tree,
-                                                        FileContentHandler zipContentMap,
-                                                        Map<String, List<ErrorMessage>> uploadErrors,
-                                                        AnalyzedZipHeatFiles analyzedZipHeatFiles)
-        throws Exception {
-        FilesDataStructure structure = new FilesDataStructure();
-        Set<String> usedEnvFiles = new HashSet<>();
-        addHeatsToFileDataStructure(tree, usedEnvFiles, structure, uploadErrors,
-            analyzedZipHeatFiles);
-        handleOtherResources(tree, usedEnvFiles, structure);
-        FilesDataStructure fileDataStructureFromManifest =
-            createFileDataStructureFromManifest(zipContentMap.getFileContent
-                (SdcCommon.MANIFEST_NAME));
-        List<String> structureArtifacts = structure.getArtifacts();
-        structureArtifacts.addAll(fileDataStructureFromManifest.getArtifacts().stream().filter
-            (artifact -> isNotStrctureArtifact(structureArtifacts, artifact)).collect((Collectors.toList())));
-        handleArtifactsFromTree(tree, structure);
+    mdcDataDebugMessage.debugExitMessage(null);
+    return structure;
+  }
 
-        return JsonUtil.object2Json(structure);
+  private void addHeatDependenciesToModule(Module module, List<FileData> data) {
+    if (CollectionUtils.isEmpty(data)) {
+      return;
     }
 
-    private boolean isNotStrctureArtifact(List<String> structureArtifacts, String artifact) {
-        return !structureArtifacts.contains(artifact);
-    }
-
-    @Override
-    public OrchestrationTemplateCandidateData createCandidateDataEntity(
-        CandidateDataEntityTo candidateDataEntityTo, InputStream zipFileManifest,
-        AnalyzedZipHeatFiles analyzedZipHeatFiles) throws Exception {
-
-
-        mdcDataDebugMessage.debugEntryMessage(null);
-
-        FileContentHandler zipContentMap = candidateDataEntityTo.getContentMap();
-        FilesDataStructure filesDataStructure;
-        String dataStructureJson;
-
-        if (zipFileManifest != null) {
-            // create data structure from manifest
-            filesDataStructure = createFileDataStructureFromManifest(zipFileManifest);
-            Set<String> zipFileList = zipContentMap.getFileList();
-            balanceManifestFilesWithZipFiles(filesDataStructure,
-                zipContentMap, analyzedZipHeatFiles);
-            Set<String> filesDataStructureFiles = getFlatFileNames(filesDataStructure);
-            filesDataStructure.getUnassigned().addAll(zipFileList.stream()
-                .filter(fileName -> (!filesDataStructureFiles.contains(fileName) &&
-                    !filesDataStructure.getNested().contains(fileName) &&
-                    !fileName.equals(SdcCommon.MANIFEST_NAME)))
-                .collect(Collectors.toList()));
-            dataStructureJson = JsonUtil.object2Json(filesDataStructure);
-        } else {
-            // create data structure from based on naming convention
-            dataStructureJson =
-                heatStructureTreeToFileDataStructure(candidateDataEntityTo.getTree(), zipContentMap,
-                    candidateDataEntityTo.getErrors(), analyzedZipHeatFiles);
+    for (FileData fileData : data) {
+      if (fileData.getType().equals(FileData.Type.HEAT_ENV)) {
+        module.setEnv(fileData.getFile());
+      } else if (fileData.getType().equals(FileData.Type.HEAT_VOL))// must be volume
+      {
+        module.setVol(fileData.getFile());
+        if (!CollectionUtils.isEmpty(fileData.getData())) {
+          FileData volEnv = fileData.getData().get(0);
+          if (volEnv.getType().equals(FileData.Type.HEAT_ENV)) {
+            module.setVolEnv(volEnv.getFile());
+          } else {
+            throw new CoreException((new ErrorCode.ErrorCodeBuilder())
+                .withMessage(Messages.ILLEGAL_MANIFEST.getErrorMessage())
+                .withId(Messages.ILLEGAL_MANIFEST.getErrorMessage())
+                .withCategory(ErrorCategory.APPLICATION).build());
+          }
         }
-
-        mdcDataDebugMessage.debugExitMessage(null);
-        return new OrchestrationTemplateCandidateData(
-            ByteBuffer.wrap(candidateDataEntityTo.getUploadedFileData()), dataStructureJson);
+      } else {
+        throw new CoreException((new ErrorCode.ErrorCodeBuilder())
+            .withMessage(Messages.FILE_TYPE_NOT_LEGAL.getErrorMessage())
+            .withId(Messages.FILE_TYPE_NOT_LEGAL.getErrorMessage())
+            .withCategory(ErrorCategory.APPLICATION).build());
+      }
     }
+  }
 
-    private void balanceManifestFilesWithZipFiles(
-        FilesDataStructure filesDataStructure,
-        FileContentHandler fileContentHandler, AnalyzedZipHeatFiles analyzedZipHeatFiles)
-        throws Exception {
-        Set<String> zipFileList = fileContentHandler.getFileList();
-        filesDataStructure.getNested().addAll(analyzedZipHeatFiles.getNestedFiles());
-        List<Module> modules = filesDataStructure.getModules();
-        if (CollectionUtils.isEmpty(modules)) {
-            return;
-        }
+  @Override
+  public void updateCandidateUploadData(String vspId, Version version,
+                                        OrchestrationTemplateCandidateData uploadData) {
+    mdcDataDebugMessage.debugEntryMessage(null);
 
-        for (int i = 0; i < modules.size(); i++) {
-            Module module = modules.get(i);
-            if (!isFileExistInZipContains(zipFileList, module.getYaml())) {
-                addFileToUnassigned(filesDataStructure, zipFileList, module.getEnv());
-                addFileToUnassigned(filesDataStructure, zipFileList, module.getVol());
-                addFileToUnassigned(filesDataStructure, zipFileList, module.getVolEnv());
-                modules.remove(i--);
-            } else if (Objects.nonNull(module.getVol()) && !zipFileList.contains(module.getVol())) {
-                module.setVol(null);
-                CollectionUtils
-                    .addIgnoreNull(filesDataStructure.getUnassigned(), module.getVolEnv());
-            } else {
-                if (filesDataStructure.getNested().contains(module.getYaml())) {
-                    moveModuleFileToNested(filesDataStructure, i--, module);
-                }
-            }
-        }
+    orchestrationTemplateCandidateDao.update(vspId, version, uploadData);
+
+    mdcDataDebugMessage.debugExitMessage(null);
+  }
+
+  @Override
+  public Optional<FilesDataStructure> getOrchestrationTemplateCandidateFileDataStructure(
+      String vspId, Version version) {
+
+    mdcDataDebugMessage.debugEntryMessage("VSP Id", vspId);
+
+    Optional<String> jsonFileDataStructure =
+        orchestrationTemplateCandidateDao.getStructure(vspId, version);
+
+    if (jsonFileDataStructure.isPresent() && JsonUtil.isValidJson(jsonFileDataStructure.get())) {
+      mdcDataDebugMessage.debugExitMessage("VSP Id", vspId);
+      return Optional
+          .of(JsonUtil.json2Object(jsonFileDataStructure.get(), FilesDataStructure.class));
+    } else {
+      mdcDataDebugMessage.debugExitMessage("VSP Id", vspId);
+      return Optional.empty();
     }
+  }
 
-    private void addFileToUnassigned(FilesDataStructure filesDataStructure, Set<String> zipFileList,
-                                     String fileName) {
-        if (isFileExistInZipContains(zipFileList, fileName)) {
-            filesDataStructure.getUnassigned().add(fileName);
-        }
-    }
+  @Override
+  public void updateOrchestrationTemplateCandidateFileDataStructure(String vspId, Version version,
+                                                                    FilesDataStructure fileDataStructure) {
+    OrchestrationTemplateCandidateDaoFactory.getInstance().createInterface()
+        .updateStructure(vspId, version, fileDataStructure);
+  }
 
-    private boolean isFileExistInZipContains(Set<String> zipFileList, String fileName) {
-        return Objects.nonNull(fileName) && zipFileList.contains(fileName);
-    }
+  @Override
+  public OrchestrationTemplateCandidateData getOrchestrationTemplateCandidate(String vspId,
+                                                                              Version version) {
+    mdcDataDebugMessage.debugEntryMessage("VSP Id", vspId);
+    mdcDataDebugMessage.debugExitMessage("VSP Id", vspId);
 
-    private void moveModuleFileToNested(FilesDataStructure filesDataStructure, int i,
-                                        Module module) {
-        if (!filesDataStructure.getNested().contains(module.getYaml())) {
-            filesDataStructure.getNested().add(module.getYaml());
-        }
-        if (Objects.nonNull(module.getEnv())) {
-            filesDataStructure.getNested().add(module.getEnv());
-        }
-        if (Objects.nonNull(module.getVol())) {
-            filesDataStructure.getNested().add(module.getVol());
-        }
-        if (Objects.nonNull(module.getVolEnv())) {
-            filesDataStructure.getNested().add(module.getVolEnv());
-        }
-        filesDataStructure.getModules().remove(i);
-    }
+    return orchestrationTemplateCandidateDao.get(vspId, version);
+  }
 
-    private Set<String> getFlatFileNames(FilesDataStructure filesDataStructure) {
-        Set<String> fileNames = new HashSet<>();
-        if (!CollectionUtils.isEmpty(filesDataStructure.getModules())) {
-            for (Module module : filesDataStructure.getModules()) {
-                CollectionUtils.addIgnoreNull(fileNames, module.getEnv());
-                CollectionUtils.addIgnoreNull(fileNames, module.getVol());
-                CollectionUtils.addIgnoreNull(fileNames, module.getVolEnv());
-                CollectionUtils.addIgnoreNull(fileNames, module.getYaml());
-            }
-        }
-        fileNames.addAll(filesDataStructure.getArtifacts().stream().collect(Collectors.toSet()));
-        fileNames.addAll(filesDataStructure.getNested().stream().collect(Collectors.toSet()));
-        fileNames.addAll(filesDataStructure.getUnassigned().stream().collect(Collectors.toSet()));
+  @Override
+  public OrchestrationTemplateCandidateData getOrchestrationTemplateCandidateInfo(String vspId,
+                                                                                  Version version) {
+    mdcDataDebugMessage.debugEntryMessage("VSP Id", vspId);
+    mdcDataDebugMessage.debugExitMessage("VSP Id", vspId);
 
-        return fileNames;
-    }
-
-    private FilesDataStructure createFileDataStructureFromManifest(InputStream isManifestContent) {
-
-
-        mdcDataDebugMessage.debugEntryMessage(null);
-
-        ManifestContent manifestContent =
-            JsonUtil.json2Object(isManifestContent, ManifestContent.class);
-        FilesDataStructure structure = new FilesDataStructure();
-        for (FileData fileData : manifestContent.getData()) {
-            if (Objects.nonNull(fileData.getType()) &&
-                fileData.getType().equals(FileData.Type.HEAT)) {
-                Module module = new Module();
-                module.setYaml(fileData.getFile());
-                module.setIsBase(fileData.getBase());
-                addHeatDependenciesToModule(module, fileData.getData());
-                structure.getModules().add(module);
-            } else if (HeatFileAnalyzer.isYamlOrEnvFile(fileData.getFile()) &&
-                !FileData.Type.isArtifact(fileData.getType())) {
-                structure.getUnassigned().add(fileData.getFile());
-            } else {
-                structure.getArtifacts().add(fileData.getFile());
-            }
-        }
-
-        mdcDataDebugMessage.debugExitMessage(null);
-        return structure;
-    }
-
-    private void addHeatDependenciesToModule(Module module, List<FileData> data) {
-        if (CollectionUtils.isEmpty(data)) {
-            return;
-        }
-
-        for (FileData fileData : data) {
-            if (fileData.getType().equals(FileData.Type.HEAT_ENV)) {
-                module.setEnv(fileData.getFile());
-            } else if (fileData.getType().equals(FileData.Type.HEAT_VOL))// must be volume
-            {
-                module.setVol(fileData.getFile());
-                if (!CollectionUtils.isEmpty(fileData.getData())) {
-                    FileData volEnv = fileData.getData().get(0);
-                    if (volEnv.getType().equals(FileData.Type.HEAT_ENV)) {
-                        module.setVolEnv(volEnv.getFile());
-                    } else {
-                        throw new CoreException((new ErrorCode.ErrorCodeBuilder())
-                            .withMessage(Messages.ILLEGAL_MANIFEST.getErrorMessage())
-                            .withId(Messages.ILLEGAL_MANIFEST.getErrorMessage())
-                            .withCategory(ErrorCategory.APPLICATION).build());
-                    }
-                }
-            } else {
-                throw new CoreException((new ErrorCode.ErrorCodeBuilder())
-                    .withMessage(Messages.FILE_TYPE_NOT_LEGAL.getErrorMessage())
-                    .withId(Messages.FILE_TYPE_NOT_LEGAL.getErrorMessage())
-                    .withCategory(ErrorCategory.APPLICATION).build());
-            }
-        }
-    }
-
-    @Override
-    public void updateCandidateUploadData(OrchestrationTemplateCandidateData uploadData,
-                                          String itemId) {
-        mdcDataDebugMessage.debugEntryMessage(null);
-        orchestrationTemplateCandidateDataDao.update(itemId, uploadData);
-        mdcDataDebugMessage.debugExitMessage(null);
-    }
-
-    @Override
-    public Optional<FilesDataStructure> getOrchestrationTemplateCandidateFileDataStructure(
-        String vspId, Version version) {
-
-        mdcDataDebugMessage.debugEntryMessage("VSP Id", vspId);
-
-        Optional<String> jsonFileDataStructure =
-            orchestrationTemplateCandidateDataDao.getStructure(vspId, version);
-
-        if (jsonFileDataStructure.isPresent()
-            && JsonUtil.isValidJson(jsonFileDataStructure.get())) {
-            mdcDataDebugMessage.debugExitMessage("VSP Id", vspId);
-            return Optional
-                .of(JsonUtil.json2Object(jsonFileDataStructure.get(), FilesDataStructure.class));
-        } else {
-            mdcDataDebugMessage.debugExitMessage("VSP Id", vspId);
-            return Optional.empty();
-        }
-    }
-
-    @Override
-    public void updateOrchestrationTemplateCandidateFileDataStructure(String vspId, Version version,
-                                                                      FilesDataStructure fileDataStructure) {
-        OrchestrationTemplateCandidateDaoFactory.getInstance().createInterface()
-            .updateStructure(vspId, version, fileDataStructure);
-    }
-
-    @Override
-    public OrchestrationTemplateCandidateData getOrchestrationTemplateCandidate(String vspId,
-                                                                                Version version) {
-        mdcDataDebugMessage.debugEntryMessage("VSP Id", vspId);
-        mdcDataDebugMessage.debugExitMessage("VSP Id", vspId);
-
-        return orchestrationTemplateCandidateDataDao.get(vspId, version);
-    }
+    return orchestrationTemplateCandidateDao.getInfo(vspId, version);
+  }
 
   @Override
   public String createManifest(VspDetails vspDetails, FilesDataStructure structure) {
 
-        mdcDataDebugMessage.debugEntryMessage("VSP Id", vspDetails.getId());
+    mdcDataDebugMessage.debugEntryMessage("VSP Id", vspDetails.getId());
 
-        Optional<ManifestContent> manifest = manifestCreator.createManifest(vspDetails, structure);
-        if (!manifest.isPresent()) {
-            throw new RuntimeException(Messages.CREATE_MANIFEST_FROM_ZIP.getErrorMessage());
+    Optional<ManifestContent> manifest = manifestCreator.createManifest(vspDetails, structure);
+    if (!manifest.isPresent()) {
+      throw new RuntimeException(Messages.CREATE_MANIFEST_FROM_ZIP.getErrorMessage());
+    }
+
+    mdcDataDebugMessage.debugExitMessage("VSP Id", vspDetails.getId());
+    return JsonUtil.object2Json(manifest.get());
+  }
+
+  @Override
+  public Optional<ManifestContent> createManifest(VspDetails vspDetails,
+                                                  FileContentHandler fileContentHandler,
+                                                  AnalyzedZipHeatFiles analyzedZipHeatFiles) {
+
+
+    mdcDataDebugMessage.debugEntryMessage("VSP Id", vspDetails.getId());
+
+    mdcDataDebugMessage.debugExitMessage("VSP Id", vspDetails.getId());
+    return manifestCreator.createManifest(vspDetails, fileContentHandler, analyzedZipHeatFiles);
+  }
+
+  @Override
+  public Optional<ByteArrayInputStream> fetchZipFileByteArrayInputStream(String vspId,
+                                                                         OrchestrationTemplateCandidateData candidateDataEntity,
+                                                                         String manifest,
+                                                                         OnboardingTypesEnum type,
+                                                                         Map<String, List<ErrorMessage>> uploadErrors) {
+    byte[] file;
+    ByteArrayInputStream byteArrayInputStream = null;
+    try {
+      file = replaceManifestInZip(candidateDataEntity.getContentData(), manifest, vspId, type);
+      byteArrayInputStream = new ByteArrayInputStream(
+          Objects.isNull(file) ? candidateDataEntity.getContentData().array()
+              : file);
+    } catch (IOException e) {
+      ErrorMessage errorMessage =
+          new ErrorMessage(ErrorLevel.ERROR,
+              Messages.CANDIDATE_PROCESS_FAILED.getErrorMessage());
+      logger.error(errorMessage.getMessage(), e);
+      ErrorsUtil
+          .addStructureErrorToErrorMap(SdcCommon.UPLOAD_FILE, errorMessage, uploadErrors);
+    }
+    return Optional.ofNullable(byteArrayInputStream);
+  }
+
+  @Override
+  public byte[] replaceManifestInZip(ByteBuffer contentData, String manifest, String vspId,
+                                     OnboardingTypesEnum type)
+      throws IOException {
+    ByteArrayOutputStream baos = new ByteArrayOutputStream();
+
+    try (final ZipOutputStream zos = new ZipOutputStream(baos);
+         ZipInputStream zipStream = new ZipInputStream(
+             new ByteArrayInputStream(contentData.array()))) {
+      ZipEntry zipEntry;
+      boolean manifestWritten = false;
+      while ((zipEntry = zipStream.getNextEntry()) != null) {
+        if (!zipEntry.getName().equalsIgnoreCase(SdcCommon.MANIFEST_NAME)) {
+          ZipEntry loc_ze = new ZipEntry(zipEntry.getName());
+          zos.putNextEntry(loc_ze);
+          byte[] buf = new byte[1024];
+          int len;
+          while ((len = zipStream.read(buf)) > 0) {
+            zos.write(buf, 0, (len < buf.length) ? len : buf.length);
+          }
+        } else {
+          manifestWritten = true;
+          writeManifest(manifest, type, zos);
         }
+        zos.closeEntry();
+      }
+      if (!manifestWritten) {
+        writeManifest(manifest, type, zos);
+        zos.closeEntry();
+      }
+    }
+    return baos.toByteArray();
+  }
 
-        mdcDataDebugMessage.debugExitMessage("VSP Id", vspDetails.getId());
-        return JsonUtil.object2Json(manifest.get());
+  @Override
+  public Optional<List<ErrorMessage>> validateFileDataStructure(
+      FilesDataStructure filesDataStructure) {
+    return candidateServiceValidator.validateFileDataStructure(filesDataStructure);
+  }
+
+  private void writeManifest(String manifest,
+                             OnboardingTypesEnum type,
+                             ZipOutputStream zos) throws IOException {
+
+    if (isManifestNeedsToGetWritten(type)) {
+      return;
     }
 
-    @Override
-    public Optional<ManifestContent> createManifest(VspDetails vspDetails,
-                                                    FileContentHandler fileContentHandler,
-                                                    AnalyzedZipHeatFiles analyzedZipHeatFiles) {
+    zos.putNextEntry(new ZipEntry(SdcCommon.MANIFEST_NAME));
+    try (InputStream manifestStream = new ByteArrayInputStream(
+        manifest.getBytes(StandardCharsets.UTF_8))) {
+      byte[] buf = new byte[1024];
+      int len;
+      while ((len = (manifestStream.read(buf))) > 0) {
+        zos.write(buf, 0, (len < buf.length) ? len : buf.length);
+      }
+    }
+  }
 
+  private boolean isManifestNeedsToGetWritten(OnboardingTypesEnum type) {
+    return type.equals(OnboardingTypesEnum.CSAR);
+  }
 
-        mdcDataDebugMessage.debugEntryMessage("VSP Id", vspDetails.getId());
+  private void handleArtifactsFromTree(HeatStructureTree tree, FilesDataStructure structure) {
 
-        mdcDataDebugMessage.debugExitMessage("VSP Id", vspDetails.getId());
-        return manifestCreator.createManifest(vspDetails, fileContentHandler, analyzedZipHeatFiles);
+    if (Objects.isNull(tree) || Objects.isNull(tree.getArtifacts())) {
+      return;
     }
 
-    @Override
-    public Optional<ByteArrayInputStream> fetchZipFileByteArrayInputStream(String vspId,
-                                                                           OrchestrationTemplateCandidateData candidateDataEntity,
-                                                                           String manifest,
-                                                                           OnboardingTypesEnum type,
-                                                                           Map<String, List<ErrorMessage>> uploadErrors) {
-        byte[] file;
-        ByteArrayInputStream byteArrayInputStream = null;
-        try {
-            file = replaceManifestInZip(candidateDataEntity.getContentData(), manifest, vspId, type);
-            byteArrayInputStream = new ByteArrayInputStream(
-                Objects.isNull(file) ? candidateDataEntity.getContentData().array()
-                    : file);
-        } catch (IOException e) {
-            ErrorMessage errorMessage =
-                new ErrorMessage(ErrorLevel.ERROR,
-                    Messages.CANDIDATE_PROCESS_FAILED.getErrorMessage());
-            logger.error(errorMessage.getMessage(), e);
-            ErrorsUtil
-                .addStructureErrorToErrorMap(SdcCommon.UPLOAD_FILE, errorMessage, uploadErrors);
+    if (CollectionUtils.isNotEmpty(tree.getArtifacts())) {
+      structure.getArtifacts().addAll(
+          tree.getArtifacts()
+              .stream()
+              .map(Artifact::getFileName)
+              .filter(fileName -> !structure.getArtifacts().contains(fileName))
+              .collect(Collectors.toList()));
+    }
+  }
+
+  private void handleOtherResources(HeatStructureTree tree, Set<String> usedEnvFiles,
+                                    FilesDataStructure structure) {
+    Set<HeatStructureTree> others = tree.getOther();
+    if (Objects.isNull(others)) {
+      return;
+    }
+
+    List<String> artifacts = new ArrayList<>();
+    List<String> unassigned = new ArrayList<>();
+    for (HeatStructureTree other : others) {
+      if (HeatFileAnalyzer.isYamlOrEnvFile(other.getFileName())) {
+        if (isEnvFileUsedByHeatFile(usedEnvFiles, other)) {
+          continue;
         }
-        return Optional.ofNullable(byteArrayInputStream);
+        unassigned.add(other.getFileName());
+      } else {
+        artifacts.add(other.getFileName());
+      }
+      handleArtifactsFromTree(other, structure);
     }
+    structure.getArtifacts().addAll(artifacts);
+    structure.getUnassigned().addAll(unassigned);
+  }
 
-    @Override
-    public byte[] replaceManifestInZip(ByteBuffer contentData, String manifest, String vspId,
-                                       OnboardingTypesEnum type)
-        throws IOException {
-        ByteArrayOutputStream baos = new ByteArrayOutputStream();
-
-        try (final ZipOutputStream zos = new ZipOutputStream(baos);
-             ZipInputStream zipStream = new ZipInputStream(
-                 new ByteArrayInputStream(contentData.array()))) {
-            ZipEntry zipEntry;
-            boolean manifestWritten = false;
-            while ((zipEntry = zipStream.getNextEntry()) != null) {
-                if (!zipEntry.getName().equalsIgnoreCase(SdcCommon.MANIFEST_NAME)) {
-                    ZipEntry loc_ze = new ZipEntry(zipEntry.getName());
-                    zos.putNextEntry(loc_ze);
-                    byte[] buf = new byte[1024];
-                    int len;
-                    while ((len = zipStream.read(buf)) > 0) {
-                        zos.write(buf, 0, (len < buf.length) ? len : buf.length);
-                    }
-                } else {
-                    manifestWritten = true;
-                    writeManifest(manifest, type, zos);
-                }
-                zos.closeEntry();
-            }
-            if (!manifestWritten) {
-                writeManifest(manifest, type, zos);
-                zos.closeEntry();
-            }
-        }
-        return baos.toByteArray();
+  private boolean isEnvFileUsedByHeatFile(Set<String> usedEnvFiles, HeatStructureTree other) {
+    if (HeatFileAnalyzer.isEnvFile(other.getFileName())) {
+      if (usedEnvFiles.contains(other.getFileName())) {
+        return true;
+      }
     }
+    return false;
+  }
 
-    @Override
-    public Optional<List<ErrorMessage>> validateFileDataStructure(
-        FilesDataStructure filesDataStructure) {
-        return candidateServiceValidator.validateFileDataStructure(filesDataStructure);
+  private void addHeatsToFileDataStructure(HeatStructureTree tree, Set<String> usedEnvFiles,
+                                           FilesDataStructure structure,
+                                           Map<String, List<ErrorMessage>> uploadErrors,
+                                           AnalyzedZipHeatFiles analyzedZipHeatFiles)
+      throws Exception {
+    List<Module> modules = new ArrayList<>();
+    Set<HeatStructureTree> heatsSet = tree.getHeat();
+    if (Objects.isNull(heatsSet)) {
+      return;
     }
-
-    private void writeManifest(String manifest,
-                               OnboardingTypesEnum type,
-                               ZipOutputStream zos) throws IOException {
-
-        if(isManifestNeedsToGetWritten(type)){
-            return;
-        }
-
-        zos.putNextEntry(new ZipEntry(SdcCommon.MANIFEST_NAME));
-        try (InputStream manifestStream = new ByteArrayInputStream(
-            manifest.getBytes(StandardCharsets.UTF_8))) {
-            byte[] buf = new byte[1024];
-            int len;
-            while ((len = (manifestStream.read(buf))) > 0) {
-                zos.write(buf, 0, (len < buf.length) ? len : buf.length);
-            }
-        }
-    }
-
-    private boolean isManifestNeedsToGetWritten(OnboardingTypesEnum type) {
-        return type.equals(OnboardingTypesEnum.CSAR);
-    }
-
-    private void handleArtifactsFromTree(HeatStructureTree tree, FilesDataStructure structure) {
-
-        if (Objects.isNull(tree) || Objects.isNull(tree.getArtifacts())) {
-            return;
-        }
-
-        if (CollectionUtils.isNotEmpty(tree.getArtifacts())) {
-            structure.getArtifacts().addAll(
-                tree.getArtifacts()
-                    .stream()
-                    .map(Artifact::getFileName)
-                    .filter(fileName -> !structure.getArtifacts().contains(fileName))
-                    .collect(Collectors.toList()));
-        }
-    }
-
-    private void handleOtherResources(HeatStructureTree tree, Set<String> usedEnvFiles,
-                                      FilesDataStructure structure) {
-        Set<HeatStructureTree> others = tree.getOther();
-        if (Objects.isNull(others)) {
-            return;
-        }
-
-        List<String> artifacts = new ArrayList<>();
-        List<String> unassigned = new ArrayList<>();
-        for (HeatStructureTree other : others) {
-            if (HeatFileAnalyzer.isYamlOrEnvFile(other.getFileName())) {
-                if (isEnvFileUsedByHeatFile(usedEnvFiles, other)) {
-                    continue;
-                }
-                unassigned.add(other.getFileName());
-            } else {
-                artifacts.add(other.getFileName());
-            }
-            handleArtifactsFromTree(other, structure);
-        }
-        structure.getArtifacts().addAll(artifacts);
-        structure.getUnassigned().addAll(unassigned);
-    }
-
-    private boolean isEnvFileUsedByHeatFile(Set<String> usedEnvFiles, HeatStructureTree other) {
-        if (HeatFileAnalyzer.isEnvFile(other.getFileName())) {
-            if (usedEnvFiles.contains(other.getFileName())) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    private void addHeatsToFileDataStructure(HeatStructureTree tree, Set<String> usedEnvFiles,
-                                             FilesDataStructure structure,
-                                             Map<String, List<ErrorMessage>> uploadErrors,
-                                             AnalyzedZipHeatFiles analyzedZipHeatFiles)
-        throws Exception {
-        List<Module> modules = new ArrayList<>();
-        Set<HeatStructureTree> heatsSet = tree.getHeat();
-        if (Objects.isNull(heatsSet)) {
-            return;
-        }
-        for (HeatStructureTree heat : heatsSet) {
-            if (isFileBaseFile(heat.getFileName())) {
-                handleSingleHeat(structure, modules, heat, uploadErrors);
-            } else if (isFileModuleFile(heat.getFileName(),
-                analyzedZipHeatFiles.getModuleFiles())) {
-                handleSingleHeat(structure, modules, heat, uploadErrors);
-            } else {
-                structure.getUnassigned().add(heat.getFileName());
-                addNestedToFileDataStructure(heat, structure);
-            }
-            if (!Objects.isNull(heat.getEnv())) {
-                usedEnvFiles.add(heat.getEnv() == null ? null : heat.getEnv().getFileName());
-            }
-        }
-        structure.setModules(modules);
-
-    }
-
-    private boolean isFileModuleFile(String fileName, Set<String> modulesFileNames) {
-        return modulesFileNames.contains(fileName);
-    }
-
-    private boolean isFileBaseFile(String fileName) {
-        return manifestCreator.isFileBaseFile(fileName);
-    }
-
-    private void handleSingleHeat(FilesDataStructure structure, List<Module> modules,
-                                  HeatStructureTree heat,
-                                  Map<String, List<ErrorMessage>> uploadErrors) {
-
-
-        mdcDataDebugMessage.debugEntryMessage(null);
-
-        Module module = new Module();
-        module.setYaml(heat.getFileName());
-        module.setIsBase(heat.getBase());
+    for (HeatStructureTree heat : heatsSet) {
+      if (isFileBaseFile(heat.getFileName())) {
+        handleSingleHeat(structure, modules, heat, uploadErrors);
+      } else if (isFileModuleFile(heat.getFileName(),
+          analyzedZipHeatFiles.getModuleFiles())) {
+        handleSingleHeat(structure, modules, heat, uploadErrors);
+      } else {
+        structure.getUnassigned().add(heat.getFileName());
         addNestedToFileDataStructure(heat, structure);
-        Set<HeatStructureTree> volumeSet = heat.getVolume();
-        int inx = 0;
-        if (Objects.nonNull(volumeSet)) {
-            handleVolumes(module, volumeSet, structure, inx, uploadErrors);
-        }
-        handleEnv(module, heat, false, structure);
-        modules.add(module);
+      }
+      if (!Objects.isNull(heat.getEnv())) {
+        usedEnvFiles.add(heat.getEnv() == null ? null : heat.getEnv().getFileName());
+      }
+    }
+    structure.setModules(modules);
 
-        mdcDataDebugMessage.debugExitMessage(null);
+  }
+
+  private boolean isFileModuleFile(String fileName, Set<String> modulesFileNames) {
+    return modulesFileNames.contains(fileName);
+  }
+
+  private boolean isFileBaseFile(String fileName) {
+    return manifestCreator.isFileBaseFile(fileName);
+  }
+
+  private void handleSingleHeat(FilesDataStructure structure, List<Module> modules,
+                                HeatStructureTree heat,
+                                Map<String, List<ErrorMessage>> uploadErrors) {
+
+
+    mdcDataDebugMessage.debugEntryMessage(null);
+
+    Module module = new Module();
+    module.setYaml(heat.getFileName());
+    module.setIsBase(heat.getBase());
+    addNestedToFileDataStructure(heat, structure);
+    Set<HeatStructureTree> volumeSet = heat.getVolume();
+    int inx = 0;
+    if (Objects.nonNull(volumeSet)) {
+      handleVolumes(module, volumeSet, structure, inx, uploadErrors);
+    }
+    handleEnv(module, heat, false, structure);
+    modules.add(module);
+
+    mdcDataDebugMessage.debugExitMessage(null);
+  }
+
+  private void handleVolumes(Module module, Set<HeatStructureTree> volumeSet,
+                             FilesDataStructure structure, int inx,
+                             Map<String, List<ErrorMessage>> uploadErrors) {
+
+
+    mdcDataDebugMessage.debugEntryMessage(null);
+
+    for (HeatStructureTree volume : volumeSet) {
+      if (inx++ > 0) {
+        ErrorsUtil.addStructureErrorToErrorMap(SdcCommon.UPLOAD_FILE,
+            new ErrorMessage(ErrorLevel.WARNING,
+                Messages.MORE_THEN_ONE_VOL_FOR_HEAT.getErrorMessage()), uploadErrors);
+        break;
+      }
+      handleArtifactsFromTree(volume, structure);
+      module.setVol(volume.getFileName());
+      handleEnv(module, volume, true, structure);
+      addNestedToFileDataStructure(volume, structure);
     }
 
-    private void handleVolumes(Module module, Set<HeatStructureTree> volumeSet,
-                               FilesDataStructure structure, int inx,
-                               Map<String, List<ErrorMessage>> uploadErrors) {
+    mdcDataDebugMessage.debugExitMessage(null);
+  }
+
+  private void handleEnv(Module module, HeatStructureTree tree, boolean isVolEnv,
+                         FilesDataStructure structure) {
 
 
-        mdcDataDebugMessage.debugEntryMessage(null);
+    mdcDataDebugMessage.debugEntryMessage(null);
 
-        for (HeatStructureTree volume : volumeSet) {
-            if (inx++ > 0) {
-                ErrorsUtil.addStructureErrorToErrorMap(SdcCommon.UPLOAD_FILE,
-                    new ErrorMessage(ErrorLevel.WARNING,
-                        Messages.MORE_THEN_ONE_VOL_FOR_HEAT.getErrorMessage()), uploadErrors);
-                break;
-            }
-            handleArtifactsFromTree(volume, structure);
-            module.setVol(volume.getFileName());
-            handleEnv(module, volume, true, structure);
-            addNestedToFileDataStructure(volume, structure);
-        }
-
-        mdcDataDebugMessage.debugExitMessage(null);
+    if (Objects.nonNull(tree.getEnv())) {
+      if (isVolEnv) {
+        module.setVolEnv(tree.getEnv().getFileName());
+      } else {
+        module.setEnv(tree.getEnv().getFileName());
+      }
+      handleArtifactsFromTree(tree.getEnv(), structure);
     }
 
-    private void handleEnv(Module module, HeatStructureTree tree, boolean isVolEnv,
-                           FilesDataStructure structure) {
+    mdcDataDebugMessage.debugExitMessage(null);
+  }
 
-
-        mdcDataDebugMessage.debugEntryMessage(null);
-
-        if (Objects.nonNull(tree.getEnv())) {
-            if (isVolEnv) {
-                module.setVolEnv(tree.getEnv().getFileName());
-            } else {
-                module.setEnv(tree.getEnv().getFileName());
-            }
-            handleArtifactsFromTree(tree.getEnv(), structure);
-        }
-
-        mdcDataDebugMessage.debugExitMessage(null);
+  private void addNestedToFileDataStructure(HeatStructureTree heat,
+                                            FilesDataStructure structure) {
+    Set<HeatStructureTree> nestedSet = heat.getNested();
+    if (Objects.isNull(nestedSet)) {
+      return;
     }
-
-    private void addNestedToFileDataStructure(HeatStructureTree heat,
-                                              FilesDataStructure structure) {
-        Set<HeatStructureTree> nestedSet = heat.getNested();
-        if (Objects.isNull(nestedSet)) {
-            return;
-        }
-        for (HeatStructureTree nested : nestedSet) {
-            if (structure.getNested().contains(nested.getFileName())) {
-                continue;
-            }
-            structure.getNested().add(nested.getFileName());
-            if (CollectionUtils.isNotEmpty(nested.getArtifacts())) {
-                handleArtifactsFromTree(nested, structure);
-            }
-            addNestedToFileDataStructure(nested, structure);
-        }
+    for (HeatStructureTree nested : nestedSet) {
+      if (structure.getNested().contains(nested.getFileName())) {
+        continue;
+      }
+      structure.getNested().add(nested.getFileName());
+      if (CollectionUtils.isNotEmpty(nested.getArtifacts())) {
+        handleArtifactsFromTree(nested, structure);
+      }
+      addNestedToFileDataStructure(nested, structure);
     }
+  }
 }
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/filedatastructuremodule/ManifestCreatorNamingConventionImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/filedatastructuremodule/ManifestCreatorNamingConventionImpl.java
index eed575f..ce18097 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/filedatastructuremodule/ManifestCreatorNamingConventionImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/filedatastructuremodule/ManifestCreatorNamingConventionImpl.java
@@ -68,7 +68,7 @@
     addArtifactsToManifestFileDataList(filesDataStructure, fileDataList);
     ManifestContent manifestContent = createManifest(vspDetails, fileDataList);
 
-    mdcDataDebugMessage.debugExitMessage(null, null);
+    mdcDataDebugMessage.debugExitMessage(null);
     return Optional.of(manifestContent);
   }
 
@@ -76,7 +76,7 @@
       FilesDataStructure filesDataStructure, List<FileData> fileDataList) {
 
 
-    mdcDataDebugMessage.debugEntryMessage(null, null);
+    mdcDataDebugMessage.debugEntryMessage(null);
 
     if (CollectionUtils.isNotEmpty(filesDataStructure.getNested())) {
       for (String nested : filesDataStructure.getNested()) {
@@ -84,7 +84,7 @@
       }
     }
 
-    mdcDataDebugMessage.debugExitMessage(null, null);
+    mdcDataDebugMessage.debugExitMessage(null);
   }
 
   @Override
@@ -168,7 +168,7 @@
       FilesDataStructure filesDataStructure, List<FileData> fileDataList) {
 
 
-    mdcDataDebugMessage.debugEntryMessage(null, null);
+    mdcDataDebugMessage.debugEntryMessage(null);
 
     Collection<String> forArtifacts = CollectionUtils
         .union(filesDataStructure.getArtifacts(), filesDataStructure.getUnassigned());
@@ -178,14 +178,14 @@
       }
     }
 
-    mdcDataDebugMessage.debugExitMessage(null, null);
+    mdcDataDebugMessage.debugExitMessage(null);
   }
 
   private void addModulesToManifestFileDataList(
       FilesDataStructure filesDataStructure, List<FileData> fileDataList) {
 
 
-    mdcDataDebugMessage.debugEntryMessage(null, null);
+    mdcDataDebugMessage.debugEntryMessage(null);
 
     if (CollectionUtils.isNotEmpty(filesDataStructure.getModules())) {
       for (Module module : filesDataStructure.getModules()) {
@@ -197,7 +197,7 @@
       }
     }
 
-    mdcDataDebugMessage.debugExitMessage(null, null);
+    mdcDataDebugMessage.debugExitMessage(null);
   }
 
   private void addEnv(Module module, FileData fileData) {
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/resources/factoryConfiguration.json b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/resources/factoryConfiguration.json
new file mode 100644
index 0000000..982277d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/resources/factoryConfiguration.json
@@ -0,0 +1,3 @@
+{
+  "org.openecomp.sdc.vendorsoftwareproduct.dao.VspMergeDaoFactory": "org.openecomp.sdc.vendorsoftwareproduct.dao.impl.VspMergeDaoFactoryImpl"
+}
\ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ServiceModelDaoFactoryTest.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ServiceModelDaoFactoryTest.java
index 39c14e6..4690d75 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ServiceModelDaoFactoryTest.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ServiceModelDaoFactoryTest.java
@@ -21,7 +21,9 @@
 package org.openecomp.sdc.vendorsoftwareproduct.dao;
 
 import com.amdocs.zusammen.adaptor.inbound.api.types.item.Element;
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.ElementConflict;
 import com.amdocs.zusammen.adaptor.inbound.api.types.item.ElementInfo;
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.ItemVersionConflict;
 import com.amdocs.zusammen.adaptor.inbound.api.types.item.ZusammenElement;
 import com.amdocs.zusammen.commons.health.data.HealthInfo;
 import com.amdocs.zusammen.datatypes.Id;
@@ -32,15 +34,19 @@
 import com.amdocs.zusammen.datatypes.item.Item;
 import com.amdocs.zusammen.datatypes.item.ItemVersion;
 import com.amdocs.zusammen.datatypes.item.ItemVersionData;
+import com.amdocs.zusammen.datatypes.item.ItemVersionStatus;
+import com.amdocs.zusammen.datatypes.item.Resolution;
 import com.amdocs.zusammen.datatypes.itemversion.Tag;
 import org.openecomp.core.utilities.CommonMethods;
 import org.openecomp.core.utilities.file.FileContentHandler;
 import org.openecomp.core.zusammen.api.ZusammenAdaptor;
+import org.openecomp.sdc.common.session.SessionContextProviderFactory;
+import org.openecomp.sdc.datatypes.model.ElementType;
 import org.openecomp.sdc.model.impl.zusammen.ServiceModelDaoZusammenImpl;
-import org.openecomp.sdc.model.impl.zusammen.StructureElement;
 import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel;
 import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
 import org.openecomp.sdc.tosca.services.YamlUtil;
+import org.openecomp.sdc.versioning.dao.types.Revision;
 import org.openecomp.sdc.versioning.dao.types.Version;
 import org.testng.Assert;
 import org.testng.annotations.Test;
@@ -49,6 +55,7 @@
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 import java.util.Optional;
 
@@ -59,6 +66,10 @@
   private static final String baseServiceTemplateName = "baseYaml.yaml";
   private static String artifact001;
 
+  static {
+    SessionContextProviderFactory.getInstance().createInterface().create("test");
+  }
+
 
   @Test
   public void storeServiceModelTest() {
@@ -91,14 +102,19 @@
 
     ElementInfo elementInfo = new ElementInfo();
     Info info = new Info();
-    info.addProperty("base","baseElement");
+    info.addProperty("base", "baseElement");
     elementInfo.setInfo(info);
 
     ElementInfo artifactElementInfo = new ElementInfo();
-    artifactElementInfo.setInfo(info);
+    artifactElementInfo.setInfo(new Info());
+    artifactElementInfo.getInfo().setName(ElementType.Artifacts.name());
     ElementInfo templateElementInfo = new ElementInfo();
-    artifactElementInfo.setInfo(info);
+    templateElementInfo.setInfo(new Info());
+    templateElementInfo.getInfo().setName(ElementType.Templates.name());
 
+    ElementInfo serviceModelElementInfo = new ElementInfo();
+    serviceModelElementInfo.setInfo(new Info());
+    serviceModelElementInfo.getInfo().setName(ElementType.ServiceModel.name());
     ZusammenElement element = new ZusammenElement();
     ServiceTemplate serviceTemplate = new ServiceTemplate();
     YamlUtil yamlUtil = new YamlUtil();
@@ -111,9 +127,11 @@
         zusammenAdaptor);
 
     zusammenAdaptor.setItemVersion(itemVersionmock);
-    zusammenAdaptor.addElementInfo("null"+StructureElement.ServiceModel.name(),elementInfo);
-    zusammenAdaptor.addElementInfo("null"+StructureElement.Artifacts.name(),artifactElementInfo);
-    zusammenAdaptor.addElementInfo("null"+StructureElement.Templates.name(),templateElementInfo);
+    zusammenAdaptor.addElementInfo("null" + ElementType.ServiceModel.name(), elementInfo);
+    zusammenAdaptor.addElementInfo("null" + ElementType.Artifacts.name(), artifactElementInfo);
+    zusammenAdaptor.addElementInfo("null" + ElementType.Templates.name(), templateElementInfo);
+    zusammenAdaptor.addElementInfo("null" + ElementType.ServiceModel.name(),
+        serviceModelElementInfo);
     zusammenAdaptor.addElement(element);
 
     Object model =
@@ -126,11 +144,11 @@
     }
   }
 
-  private static void setArtifact(ToscaServiceModel model)
-  {
+  private static void setArtifact(ToscaServiceModel model) {
     artifact001 =
-            (String) (model).getArtifactFiles().getFileList().toArray()[0];
+        (String) (model).getArtifactFiles().getFileList().toArray()[0];
   }
+
   private ToscaServiceModel getToscaServiceModel() {
 
     Map<String, ServiceTemplate> serviceTemplates = getServiceTemplates(baseServiceTemplateName);
@@ -171,128 +189,225 @@
     return serviceTemplate;
   }
 
-  private class ZusammenAdaptorMock  implements ZusammenAdaptor
-    {
+  private class ZusammenAdaptorMock implements ZusammenAdaptor {
 
     private ItemVersion itemVersion;
-    private Map<String,ElementInfo> elementInfoMap = new HashMap();
-      private Collection<Element> elements = new ArrayList<>();
+    private Map<String, ElementInfo> elementInfoMap = new HashMap();
+    private Collection<Element> elements = new ArrayList<>();
 
-      public void setItemVersion(ItemVersion itemVersion){
+    public void setItemVersion(ItemVersion itemVersion) {
       this.itemVersion = itemVersion;
     }
 
-    public void addElementInfo(String key,ElementInfo elementInfo){
-      elementInfoMap.put(key,elementInfo);
+    public void addElementInfo(String key, ElementInfo elementInfo) {
+      elementInfoMap.put(key, elementInfo);
     }
-    public void addElement(Element element){
-     elements.add(element);
+
+    public void addElement(Element element) {
+      elements.add(element);
     }
+
     @Override
     public Optional<ItemVersion> getFirstVersion(SessionContext context, Id itemId) {
 
       return Optional.ofNullable(itemVersion);
     }
 
-      @Override
-      public Optional<Element> getElement(SessionContext context, ElementContext elementContext,
-                                          String elementId) {
-        return null;
-      }
-
-      @Override
-      public Optional<Element> getElementByName(SessionContext context,
-                                                ElementContext elementContext,
-                                                Id parentElementId, String elementName) {
-        return null;
-      }
-
-      @Override
-      public Collection<ElementInfo> listElements(SessionContext context,
-                                                  ElementContext elementContext,
-                                                  Id parentElementId) {
-        return null;
-      }
-
-      @Override
-      public Collection<Element> listElementData(SessionContext context,
-                                                 ElementContext elementContext,
-                                                 Id parentElementId) {
-        return elements;
-      }
-
-      @Override
-      public Collection<ElementInfo> listElementsByName(SessionContext context,
-                                                        ElementContext elementContext,
-                                                        Id parentElementId, String elementName) {
-        return null;
-      }
-
-      @Override
-      public Optional<ElementInfo> getElementInfoByName(SessionContext context,
-                                                        ElementContext elementContext,
-                                                        Id parentElementId, String elementName) {
-        return Optional.ofNullable(elementInfoMap.get(parentElementId+elementName));
-      }
-
-      @Override
-      public Optional<Element> saveElement(SessionContext context, ElementContext elementContext,
-                                           ZusammenElement element, String message) {
-        return null;
-      }
-
-      @Override
-      public Collection<HealthInfo> checkHealth(SessionContext context) {
-        return null;
-      }
-
-      @Override
-      public Id createItem(SessionContext context, Info info) {
-        return null;
-      }
-
-      @Override
-      public void updateItem(SessionContext context, Id itemId, Info info) {
-
-      }
-
-      @Override
-      public Id createVersion(SessionContext context, Id itemId, Id baseVersionId,
-                              ItemVersionData itemVersionData) {
-        return null;
-      }
-
-      @Override
-      public void updateVersion(SessionContext context, Id itemId, Id versionId,
-                                ItemVersionData itemVersionData) {
-
-      }
-
-      @Override
-      public void tagVersion(SessionContext context, Id itemId, Id versionId, Tag tag) {
-
-      }
-
-      @Override
-      public void resetVersionHistory(SessionContext context, Id itemId, Id versionId, String changeRef) {
-
-      }
-
-      @Override
-      public Optional<ElementInfo> getElementInfo(SessionContext context,
-                                                  ElementContext elementContext,
-                                                  Id elementId) {
-        return null;
-      }
-
-      @Override
-      public String getVersion(SessionContext sessionContext) {
-        return null;
-      }
-
-      @Override
-      public Collection<Item> listItems(SessionContext context) {
-        return null;
-      }
+    @Override
+    public Collection<ItemVersion> listPublicVersions(SessionContext context, Id itemId) {
+      return null;
     }
+
+    @Override
+    public ItemVersion getPublicVersion(SessionContext context, Id itemId, Id versionId) {
+      return null;
+    }
+
+    @Override
+    public Optional<Element> getElement(SessionContext context, ElementContext elementContext,
+                                        String elementId) {
+      return null;
+    }
+
+    @Override
+    public Optional<Element> getElementByName(SessionContext context,
+                                              ElementContext elementContext,
+                                              Id parentElementId, String elementName) {
+      return null;
+    }
+
+    @Override
+    public Collection<ElementInfo> listElements(SessionContext context,
+                                                ElementContext elementContext,
+                                                Id parentElementId) {
+      return null;
+    }
+
+    @Override
+    public Collection<Element> listElementData(SessionContext context,
+                                               ElementContext elementContext,
+                                               Id parentElementId) {
+      return elements;
+    }
+
+    @Override
+    public Collection<ElementInfo> listElementsByName(SessionContext context,
+                                                      ElementContext elementContext,
+                                                      Id parentElementId, String elementName) {
+
+      if(elementName.equals(ElementType.VspModel.name())){
+        return elementInfoMap.values();
+      }
+
+      return null;
+    }
+
+    @Override
+    public Optional<ElementInfo> getElementInfoByName(SessionContext context,
+                                                      ElementContext elementContext,
+                                                      Id parentElementId, String elementName) {
+
+     if(elementName.equals(ElementType.Templates.name())){
+       return Optional.ofNullable(elementInfoMap.get("null" + elementName));
+     }else if(elementName.equals(ElementType.Artifacts.name())) {
+       return Optional.ofNullable(elementInfoMap.get("null" + elementName));
+     }
+
+      return Optional.empty();
+    }
+
+    @Override
+    public Element saveElement(SessionContext context, ElementContext elementContext,
+                               ZusammenElement element, String message) {
+      return null;
+    }
+
+    @Override
+    public void resolveElementConflict(SessionContext context, ElementContext elementContext,
+                                       ZusammenElement element, Resolution resolution) {
+
+    }
+
+    @Override
+    public Collection<HealthInfo> checkHealth(SessionContext context) {
+      return null;
+    }
+
+    @Override
+    public Id createItem(SessionContext context, Info info) {
+      return null;
+    }
+
+    @Override
+    public void updateItem(SessionContext context, Id itemId, Info info) {
+
+    }
+
+    @Override
+    public Id createVersion(SessionContext context, Id itemId, Id baseVersionId,
+                            ItemVersionData itemVersionData) {
+      return null;
+    }
+
+    @Override
+    public void updateVersion(SessionContext context, Id itemId, Id versionId,
+                              ItemVersionData itemVersionData) {
+
+    }
+
+    @Override
+    public ItemVersion getVersion(SessionContext context, Id itemId, Id versionId) {
+      return null;
+    }
+
+    @Override
+    public ItemVersionStatus getVersionStatus(SessionContext context, Id itemId, Id versionId) {
+      return null;
+    }
+
+    @Override
+    public ItemVersionConflict getVersionConflict(SessionContext context, Id itemId, Id versionId) {
+      return null;
+    }
+
+    @Override
+    public void tagVersion(SessionContext context, Id itemId, Id versionId, Tag tag) {
+
+    }
+
+    @Override
+    public void resetVersionHistory(SessionContext context, Id itemId, Id versionId,
+                                    String changeRef) {
+
+
+    }
+
+    /*@Override
+    public void revertVersionToRevision(SessionContext context, Id itemId, Id versionId,
+                                        Id revisionId) {
+
+    }
+
+    @Override
+    public ItemVersionRevisions listVersionRevisions(SessionContext context, Id itemId,
+                                                     Id versionId) {
+      return null;
+    }*/
+
+    @Override
+    public void publishVersion(SessionContext context, Id itemId, Id versionId, String message) {
+
+    }
+
+    @Override
+    public void syncVersion(SessionContext sessionContext, Id itemId, Id versionId) {
+
+    }
+
+    @Override
+    public void forceSyncVersion(SessionContext context, Id itemId, Id versionId) {
+
+    }
+
+    @Override
+    public Optional<ElementInfo> getElementInfo(SessionContext context,
+                                                ElementContext elementContext,
+                                                Id elementId) {
+      return null;
+    }
+
+    @Override
+    public String getVersion(SessionContext sessionContext) {
+      return null;
+    }
+
+    @Override
+    public void revert(SessionContext sessionContext, String itemId, String versionId,
+                       String revisionId) {
+
+    }
+
+    @Override
+    public List<Revision> listRevisions(SessionContext sessionContext, String itemId,
+                                        String versionId) {
+      return null;
+    }
+
+    @Override
+    public Optional<ElementConflict> getElementConflict(SessionContext context,
+                                                        ElementContext elementContext,
+                                                        Id id) {
+      return null;
+    }
+
+    @Override
+    public Collection<Item> listItems(SessionContext context) {
+      return null;
+    }
+
+    @Override
+    public Item getItem(SessionContext context, Id itemId) {
+      return null;
+    }
+  }
 }
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/informationArtifact/impl/TxtInformationArtifactGeneratorImplTest.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/informationArtifact/impl/TxtInformationArtifactGeneratorImplTest.java
index 9f2f733..dde8d83 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/informationArtifact/impl/TxtInformationArtifactGeneratorImplTest.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/informationArtifact/impl/TxtInformationArtifactGeneratorImplTest.java
@@ -21,41 +21,9 @@
 package org.openecomp.sdc.vendorsoftwareproduct.informationArtifact.impl;
 
 
-import static org.mockito.Matchers.anyObject;
-import static org.mockito.Matchers.anyString;
-import static org.openecomp.sdc.vendorsoftwareproduct.informationArtifact.impl.TxtInformationArtifactConstants.HEADER;
-import static org.openecomp.sdc.vendorsoftwareproduct.informationArtifact.impl.TxtInformationArtifactConstants.VFC_COMPUTE_CPU_OVER_SUBSCRIPTION;
-
-import org.junit.Assert;
 import org.mockito.InjectMocks;
 import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
-import org.openecomp.sdc.vendorsoftwareproduct.informationArtifact.InformationArtifactData;
 import org.openecomp.sdc.vendorsoftwareproduct.questionnaire.QuestionnaireDataService;
-import org.openecomp.sdc.vendorsoftwareproduct.types.questionnaire.component.ComponentQuestionnaire;
-import org.openecomp.sdc.vendorsoftwareproduct.types.questionnaire.component.compute.Compute;
-import org.openecomp.sdc.vendorsoftwareproduct.types.questionnaire.component.compute.GuestOS;
-import org.openecomp.sdc.vendorsoftwareproduct.types.questionnaire.component.compute.NumOfVMs;
-import org.openecomp.sdc.vendorsoftwareproduct.types.questionnaire.component.general.Hypervisor;
-import org.openecomp.sdc.vendorsoftwareproduct.types.questionnaire.component.general.Recovery;
-import org.openecomp.sdc.vendorsoftwareproduct.types.questionnaire.component.network.NetworkCapacity;
-import org.openecomp.sdc.vendorsoftwareproduct.types.questionnaire.nic.IpConfiguration;
-import org.openecomp.sdc.vendorsoftwareproduct.types.questionnaire.nic.Network;
-import org.openecomp.sdc.vendorsoftwareproduct.types.questionnaire.nic.NicQuestionnaire;
-import org.openecomp.sdc.vendorsoftwareproduct.types.questionnaire.nic.Protocols;
-import org.openecomp.sdc.vendorsoftwareproduct.types.questionnaire.vsp.VspQuestionnaire;
-import org.openecomp.sdc.vendorsoftwareproduct.types.questionnaire.vsp.general.Availability;
-import org.openecomp.sdc.vendorsoftwareproduct.types.questionnaire.vsp.general.General;
-import org.openecomp.sdc.vendorsoftwareproduct.types.questionnaire.vsp.general.StorageDataReplication;
-import org.openecomp.sdc.versioning.dao.types.Version;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
 
 public class TxtInformationArtifactGeneratorImplTest {
 
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/pom.xml b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/pom.xml
index d11362c..dcf2c6a 100644
--- a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/pom.xml
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/pom.xml
@@ -15,6 +15,21 @@
     <dependencies>
         <dependency>
             <groupId>org.openecomp.sdc.core</groupId>
+            <artifactId>openecomp-session-lib</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.openecomp.sdc</groupId>
+            <artifactId>openecomp-item-permissions-core</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.openecomp.sdc</groupId>
+            <artifactId>openecomp-item-permissions-api</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.openecomp.sdc.core</groupId>
             <artifactId>openecomp-facade-core</artifactId>
             <version>${project.version}</version>
         </dependency>
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/ItemManager.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/ItemManager.java
new file mode 100644
index 0000000..ee58902
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/ItemManager.java
@@ -0,0 +1,20 @@
+package org.openecomp.sdc.versioning;
+
+import org.openecomp.sdc.versioning.dao.types.VersionStatus;
+import org.openecomp.sdc.versioning.types.Item;
+
+import java.util.Collection;
+import java.util.function.Predicate;
+
+public interface ItemManager {
+
+  Collection<Item> list(Predicate<Item> predicate);
+
+  Item get(String itemId);
+
+  Item create(Item item);
+
+  void updateVersionStatus(String itemId, VersionStatus addedVersionStatus,
+                           VersionStatus removedVersionStatus);
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/UploadDataDaoFactory.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/ItemManagerFactory.java
similarity index 79%
copy from openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/UploadDataDaoFactory.java
copy to openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/ItemManagerFactory.java
index 9654551..314ffce 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/UploadDataDaoFactory.java
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/ItemManagerFactory.java
@@ -7,9 +7,9 @@
  * 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.
@@ -18,14 +18,14 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.sdc.vendorsoftwareproduct.dao;
+package org.openecomp.sdc.versioning;
 
 import org.openecomp.core.factory.api.AbstractComponentFactory;
 import org.openecomp.core.factory.api.AbstractFactory;
 
-public abstract class UploadDataDaoFactory extends AbstractComponentFactory<UploadDataDao> {
+public abstract class ItemManagerFactory extends AbstractComponentFactory<ItemManager> {
 
-  public static UploadDataDaoFactory getInstance() {
-    return AbstractFactory.getInstance(UploadDataDaoFactory.class);
+  public static ItemManagerFactory getInstance() {
+    return AbstractFactory.getInstance(ItemManagerFactory.class);
   }
 }
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/VersioningManager.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/VersioningManager.java
index 7fab254..c037694 100644
--- a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/VersioningManager.java
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/VersioningManager.java
@@ -20,11 +20,14 @@
 
 package org.openecomp.sdc.versioning;
 
+import org.openecomp.sdc.versioning.dao.types.Revision;
 import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.versioning.types.VersionCreationMethod;
 import org.openecomp.sdc.versioning.types.VersionInfo;
 import org.openecomp.sdc.versioning.types.VersionableEntityAction;
 import org.openecomp.sdc.versioning.types.VersionableEntityMetadata;
 
+import java.util.List;
 import java.util.Map;
 
 public interface VersioningManager {
@@ -54,4 +57,24 @@
   Map<String, VersionInfo> listDeletedEntitiesVersionInfo(String entityType, String user,
                                                           VersionableEntityAction action);
 
+
+  List<Version> list(String itemId); // TODO: 5/24/2017 filter (by status for example)
+
+  Version get(String itemId, Version version);
+
+  Version create(String itemId, Version version,
+                 VersionCreationMethod creationMethod);
+
+  void submit(String itemId, Version version, String submitDescription);
+
+  void publish(String itemId, Version version, String message);
+
+  void sync(String itemId, Version version);
+
+  void forceSync(String itemId, Version version);
+
+  void revert(String itemId, Version version, String revisionId);
+
+  List<Revision> listRevisions(String itemId, Version version);
+
 }
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/VersioningNotificationConstansts.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/VersioningNotificationConstansts.java
new file mode 100644
index 0000000..42161df
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/VersioningNotificationConstansts.java
@@ -0,0 +1,13 @@
+package org.openecomp.sdc.versioning;
+
+/**
+ * @author avrahamg
+ * @since July 10, 2017
+ */
+public class VersioningNotificationConstansts {
+    public static final String ITEM_NAME = "itemName";
+    public static final String ITEM_ID = "itemId";
+    public static final String SUBMIT_DESCRIPTION = "description";
+    public static final String VERSION_NAME = "versionName";
+    public static final String VERSION_ID = "versionId";
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/ItemDao.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/ItemDao.java
new file mode 100644
index 0000000..f1edc1e
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/ItemDao.java
@@ -0,0 +1,15 @@
+package org.openecomp.sdc.versioning.dao;
+
+import org.openecomp.sdc.versioning.types.Item;
+
+import java.util.Collection;
+
+public interface ItemDao {
+  Collection<Item> list();
+
+  Item get(Item item);
+
+  Item create(Item item);
+
+  void update(Item item);
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/UploadDataDaoFactory.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/ItemDaoFactory.java
similarity index 79%
rename from openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/UploadDataDaoFactory.java
rename to openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/ItemDaoFactory.java
index 9654551..36edaa9 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/UploadDataDaoFactory.java
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/ItemDaoFactory.java
@@ -7,9 +7,9 @@
  * 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.
@@ -18,14 +18,13 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.sdc.vendorsoftwareproduct.dao;
+package org.openecomp.sdc.versioning.dao;
 
 import org.openecomp.core.factory.api.AbstractComponentFactory;
 import org.openecomp.core.factory.api.AbstractFactory;
 
-public abstract class UploadDataDaoFactory extends AbstractComponentFactory<UploadDataDao> {
-
-  public static UploadDataDaoFactory getInstance() {
-    return AbstractFactory.getInstance(UploadDataDaoFactory.class);
+public abstract class ItemDaoFactory extends AbstractComponentFactory<ItemDao> {
+  public static ItemDaoFactory getInstance() {
+    return AbstractFactory.getInstance(ItemDaoFactory.class);
   }
 }
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionDao.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionDao.java
new file mode 100644
index 0000000..f557e4d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionDao.java
@@ -0,0 +1,29 @@
+package org.openecomp.sdc.versioning.dao;
+
+import org.openecomp.sdc.versioning.dao.types.Revision;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+import java.util.List;
+import java.util.Optional;
+
+public interface VersionDao {
+  List<Version> list(String itemId);
+
+  void create(String itemId, Version version);
+
+  void update(String itemId, Version version);
+
+  Optional<Version> get(String itemId, Version version);
+
+  void delete(String itemId, Version version);
+
+  void publish(String itemId, Version version, String message);
+
+  void sync(String itemId, Version version);
+
+  void forceSync(String itemId, Version version);
+
+  void revert(String itemId, Version version, String revisionId);
+
+  List<Revision> listRevisions(String itemId, Version version);
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/UploadDataDaoFactory.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionDaoFactory.java
similarity index 79%
copy from openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/UploadDataDaoFactory.java
copy to openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionDaoFactory.java
index 9654551..845b248 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/UploadDataDaoFactory.java
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionDaoFactory.java
@@ -7,9 +7,9 @@
  * 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.
@@ -18,14 +18,13 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.sdc.vendorsoftwareproduct.dao;
+package org.openecomp.sdc.versioning.dao;
 
 import org.openecomp.core.factory.api.AbstractComponentFactory;
 import org.openecomp.core.factory.api.AbstractFactory;
 
-public abstract class UploadDataDaoFactory extends AbstractComponentFactory<UploadDataDao> {
-
-  public static UploadDataDaoFactory getInstance() {
-    return AbstractFactory.getInstance(UploadDataDaoFactory.class);
+public abstract class VersionDaoFactory extends AbstractComponentFactory<VersionDao> {
+  public static VersionDaoFactory getInstance() {
+    return AbstractFactory.getInstance(VersionDaoFactory.class);
   }
 }
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/Revision.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/Revision.java
new file mode 100644
index 0000000..492e75f
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/Revision.java
@@ -0,0 +1,42 @@
+package org.openecomp.sdc.versioning.dao.types;
+
+import java.util.Date;
+
+public class Revision {
+  private String id;
+  private String message;
+  private Date time;
+  private String user;
+
+  public String getId() {
+    return id;
+  }
+
+  public void setId(String id) {
+    this.id = id;
+  }
+
+  public void setMessage(String message) {
+    this.message = message;
+  }
+
+  public void setTime(Date time) {
+    this.time = time;
+  }
+
+  public String getMessage() {
+    return message;
+  }
+
+  public Date getTime() {
+    return time;
+  }
+
+  public String getUser() {
+    return user;
+  }
+
+  public void setUser(String user) {
+    this.user = user;
+  }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/SynchronizationState.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/SynchronizationState.java
new file mode 100644
index 0000000..f0142d3
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/SynchronizationState.java
@@ -0,0 +1,17 @@
+package org.openecomp.sdc.versioning.dao.types;
+
+public enum SynchronizationState {
+  UpToDate("Up to date"),
+  OutOfSync("Out of sync"),
+  Merging("Merging");
+
+  private String displayName;
+
+  SynchronizationState(String displayName) {
+    this.displayName = displayName;
+  }
+
+  public String toString() {
+    return this.displayName;
+  }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/Version.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/Version.java
index 82b79c6..b1f0b71 100644
--- a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/Version.java
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/Version.java
@@ -22,23 +22,44 @@
 
 import com.datastax.driver.mapping.annotations.Transient;
 import com.datastax.driver.mapping.annotations.UDT;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
+
+import java.util.Date;
+import java.util.Map;
 
 @UDT(name = "version", keyspace = "dox")
 public class Version {
-  private static final Logger logger = LoggerFactory.getLogger(Version.class);
   public static final String VERSION_STRING_VIOLATION_MSG =
       "Version string must be in the format of: {integer}.{integer}";
 
-  private int major;
-  private int minor;
   @Transient
-  private VersionStatus status = VersionStatus.Available;
+  private String id;
+  private int major; // TODO: 6/7/2017 remove!
+  private int minor; // TODO: 6/7/2017 remove!
+  @Transient
+  private String name;
+  @Transient
+  private String description;
+  @Transient
+  private String baseId;
+  @Transient
+  private Date creationTime;
+  @Transient
+  private Date modificationTime;
+  @Transient
+  private VersionStatus status = VersionStatus.Draft;
+  @Transient
+  private VersionState state;
+  @Transient
+  private Map<String, Object> additionalInfo;
 
   public Version() {
   }
 
+  public Version(String id) {
+    this.id = id;
+  }
+
+  @Deprecated
   public Version(int major, int minor) {
     this.major = major;
     this.minor = minor;
@@ -62,7 +83,6 @@
     try {
       version = new Version(Integer.parseInt(versionLevels[0]), Integer.parseInt(versionLevels[1]));
     } catch (Exception ex) {
-      logger.debug(ex.getMessage(), ex);
       throw new IllegalArgumentException(VERSION_STRING_VIOLATION_MSG);
     }
 
@@ -85,6 +105,54 @@
     this.minor = minor;
   }
 
+  public String getId() {
+    return id;
+  }
+
+  public void setId(String id) {
+    this.id = id;
+  }
+
+  public String getName() {
+    return name;
+  }
+
+  public void setName(String name) {
+    this.name = name;
+  }
+
+  public String getDescription() {
+    return description;
+  }
+
+  public void setDescription(String description) {
+    this.description = description;
+  }
+
+  public String getBaseId() {
+    return baseId;
+  }
+
+  public void setBaseId(String baseId) {
+    this.baseId = baseId;
+  }
+
+  public Date getCreationTime() {
+    return creationTime;
+  }
+
+  public void setCreationTime(Date creationTime) {
+    this.creationTime = creationTime;
+  }
+
+  public Date getModificationTime() {
+    return modificationTime;
+  }
+
+  public void setModificationTime(Date modificationTime) {
+    this.modificationTime = modificationTime;
+  }
+
   public VersionStatus getStatus() {
     return status;
   }
@@ -93,6 +161,14 @@
     this.status = status;
   }
 
+  public VersionState getState() {
+    return state;
+  }
+
+  public void setState(VersionState state) {
+    this.state = state;
+  }
+
   public Version calculateNextCandidate() {
     return new Version(major, minor + 1);
   }
@@ -105,6 +181,14 @@
     return major != 0 && minor == 0;
   }
 
+  public Map<String, Object> getAdditionalInfo() {
+    return additionalInfo;
+  }
+
+  public void setAdditionalInfo(Map<String, Object> additionalInfo) {
+    this.additionalInfo = additionalInfo;
+  }
+
   @Override
   public int hashCode() {
     int result = major;
@@ -138,6 +222,21 @@
 
   @Override
   public String toString() {
-    return major + "." + minor;
+    return name != null ? name : major + "." + minor;
   }
-}
+
+  @Override
+  public Version clone() {
+    Version version = new Version();
+    version.setStatus(this.getStatus());
+    version.setCreationTime(this.getCreationTime());
+    version.setName(this.getName());
+    version.setBaseId(this.getBaseId());
+    version.setMajor(this.major);
+    version.setMinor(this.minor);
+    version.setModificationTime(this.getModificationTime());
+    version.setDescription(this.description);
+    version.setId(this.getId());
+    return version;
+  }
+}
\ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/VersionState.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/VersionState.java
new file mode 100644
index 0000000..8d48980
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/VersionState.java
@@ -0,0 +1,23 @@
+package org.openecomp.sdc.versioning.dao.types;
+
+public class VersionState {
+  private SynchronizationState synchronizationState;
+  private boolean dirty;
+
+  public SynchronizationState getSynchronizationState() {
+    return synchronizationState;
+  }
+
+  public void setSynchronizationState(
+      SynchronizationState synchronizationState) {
+    this.synchronizationState = synchronizationState;
+  }
+
+  public boolean isDirty() {
+    return dirty;
+  }
+
+  public void setDirty(boolean dirty) {
+    this.dirty = dirty;
+  }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/VersionStatus.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/VersionStatus.java
index cf980d6..e330b95 100644
--- a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/VersionStatus.java
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/VersionStatus.java
@@ -21,7 +21,7 @@
 package org.openecomp.sdc.versioning.dao.types;
 
 public enum VersionStatus {
-  Available,
-  Locked,
-  Final
+  Draft,
+  Locked, /* todo remove!!*/
+  Certified
 }
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EditOnUnlockedEntityErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EditOnUnlockedEntityErrorBuilder.java
index 4de5618..367a93b 100644
--- a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EditOnUnlockedEntityErrorBuilder.java
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EditOnUnlockedEntityErrorBuilder.java
@@ -20,11 +20,11 @@
 
 package org.openecomp.sdc.versioning.errors;
 
-import static org.openecomp.sdc.versioning.errors.VersioningErrorCodes.EDIT_ON_UNLOCKED_ENTITY;
-
 import org.openecomp.sdc.common.errors.BaseErrorBuilder;
 import org.openecomp.sdc.common.errors.ErrorCategory;
 
+import static org.openecomp.sdc.versioning.errors.VersioningErrorCodes.EDIT_ON_UNLOCKED_ENTITY;
+
 /**
  * The type Edit on unlocked entity error builder.
  */
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/RevisionIdNotFoundErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/RevisionIdNotFoundErrorBuilder.java
new file mode 100644
index 0000000..0075403
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/RevisionIdNotFoundErrorBuilder.java
@@ -0,0 +1,44 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * 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=========================================================
+ */
+
+package org.openecomp.sdc.versioning.errors;
+
+import org.openecomp.sdc.common.errors.BaseErrorBuilder;
+import org.openecomp.sdc.common.errors.ErrorCategory;
+
+/**
+ * The mandatory field revision id not found error builder.
+ */
+public class RevisionIdNotFoundErrorBuilder extends BaseErrorBuilder {
+
+  private static final String REVISION_ID_NOT_FOUND_MSG =
+      "Mandatory field revision id missing";
+
+  /**
+   * Instantiates a new Versionable sub entity not found error builder.
+   */
+  public RevisionIdNotFoundErrorBuilder() {
+    getErrorCodeBuilder().withId(VersioningErrorCodes.MANDATORY_FIELD_REVISION_ID_MISSING);
+    getErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION);
+    getErrorCodeBuilder().withMessage(REVISION_ID_NOT_FOUND_MSG);
+  }
+
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/VersionableSubEntityNotFoundErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/VersionableSubEntityNotFoundErrorBuilder.java
index 77be83f..f717e5d 100644
--- a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/VersionableSubEntityNotFoundErrorBuilder.java
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/VersionableSubEntityNotFoundErrorBuilder.java
@@ -53,7 +53,7 @@
     getErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION);
     getErrorCodeBuilder().withMessage(String
         .format(SUB_ENTITY_NOT_FOUND_MSG, entityType, entityId, containingEntityType,
-            containingEntityId, version.toString()));
+            containingEntityId, version.getId()));
   }
 
   /**
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/VersioningErrorCodes.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/VersioningErrorCodes.java
index c1c6b96..3dd87d5 100644
--- a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/VersioningErrorCodes.java
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/VersioningErrorCodes.java
@@ -40,4 +40,10 @@
   public static final String UNDO_CHECKOUT_ON_ENTITY_LOCKED_BY_OTHER_USER =
       "UNDO_CHECKOUT_ON_ENTITY_LOCKED_BY_OTHER_USER";
   public static final String UNDO_CHECKOUT_ON_UNLOCKED_ENTITY = "UNDO_CHECKOUT_ON_UNLOCKED_ENTITY";
+  public static final String MANDATORY_FIELD_REVISION_ID_MISSING =
+      "MANDATORY_FIELD_REVISION_ID_MISSING";
+
+
+
+
 }
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/types/Item.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/types/Item.java
new file mode 100644
index 0000000..329ac52
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/types/Item.java
@@ -0,0 +1,103 @@
+package org.openecomp.sdc.versioning.types;
+
+import org.openecomp.sdc.versioning.dao.types.VersionStatus;
+
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+public class Item {
+  private String id;
+  private String type;
+  private String name;
+  private String description;
+  private Map<String, Object> properties = new HashMap<>();
+  private Map<VersionStatus, Integer> versionStatusCounters = new HashMap<>();
+  private Date creationTime;
+  private Date modificationTime;
+
+  public String getId() {
+    return id;
+  }
+
+  public void setId(String id) {
+    this.id = id;
+  }
+
+  public String getType() {
+    return type;
+  }
+
+  public void setType(String type) {
+    this.type = type;
+  }
+
+  public String getName() {
+    return name;
+  }
+
+  public void setName(String name) {
+    this.name = name;
+  }
+
+  public String getDescription() {
+    return description;
+  }
+
+  public void setDescription(String description) {
+    this.description = description;
+  }
+
+  public Map<String, Object> getProperties() {
+    return properties;
+  }
+
+  public void addProperty(String key, Object value) {
+    properties.put(key, value);
+  }
+
+  public void setProperties(Map<String, Object> properties) {
+    this.properties = properties;
+  }
+
+  public Map<VersionStatus, Integer> getVersionStatusCounters() {
+    return versionStatusCounters;
+  }
+
+  public void setVersionStatusCounters(Map<VersionStatus, Integer> versionStatusCounters) {
+    this.versionStatusCounters = versionStatusCounters;
+  }
+
+  public void addVersionStatus(VersionStatus versionStatus) {
+    Integer counter = versionStatusCounters.get(versionStatus);
+    versionStatusCounters
+        .put(versionStatus, counter == null ? 1 : counter + 1);
+  }
+
+  public void removeVersionStatus(VersionStatus versionStatus) {
+    Integer counter = versionStatusCounters.get(versionStatus);
+    if (counter != null) {
+      if (counter == 1) {
+        versionStatusCounters.remove(versionStatus);
+      } else {
+        versionStatusCounters.put(versionStatus, counter - 1);
+      }
+    }
+  }
+
+  public Date getCreationTime() {
+    return creationTime;
+  }
+
+  public void setCreationTime(Date creationTime) {
+    this.creationTime = creationTime;
+  }
+
+  public Date getModificationTime() {
+    return modificationTime;
+  }
+
+  public void setModificationTime(Date modificationTime) {
+    this.modificationTime = modificationTime;
+  }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/types/NotificationEventTypes.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/types/NotificationEventTypes.java
new file mode 100644
index 0000000..b62f7b5
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/types/NotificationEventTypes.java
@@ -0,0 +1,20 @@
+package org.openecomp.sdc.versioning.types;
+
+/**
+ * @author avrahamg
+ * @since July 10, 2017
+ */
+public enum NotificationEventTypes {
+    SUBMIT("submit"),
+    COMMIT("commit");
+
+    private String eventName;
+
+    NotificationEventTypes(String eventName) {
+        this.eventName = eventName;
+    }
+
+    public String getEventName() {
+        return eventName;
+    }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/types/VersionCreationMethod.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/types/VersionCreationMethod.java
new file mode 100644
index 0000000..6404b6b
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/types/VersionCreationMethod.java
@@ -0,0 +1,8 @@
+package org.openecomp.sdc.versioning.types;
+
+public enum VersionCreationMethod {
+  /*parent_level,
+  same_level,
+  sub_level*/
+  major,minor
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/resources/factoryConfiguration.json b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/resources/factoryConfiguration.json
index e38ad1a..90d11f1 100644
--- a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/resources/factoryConfiguration.json
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/resources/factoryConfiguration.json
@@ -1,6 +1,10 @@
 {
+  "org.openecomp.sdc.versioning.ItemManagerFactory": "org.openecomp.sdc.versioning.impl.ItemManagerFactoryImpl",
   "org.openecomp.sdc.versioning.VersioningManagerFactory": "org.openecomp.sdc.versioning.impl.VersioningManagerFactoryImpl",
   "org.openecomp.sdc.versioning.dao.VersionableEntityDaoFactory": "org.openecomp.sdc.versioning.dao.impl.VersionableEntityDaoFactoryImpl",
   "org.openecomp.sdc.versioning.dao.VersionInfoDaoFactory": "org.openecomp.sdc.versioning.dao.impl.VersionInfoDaoFactoryImpl",
-  "org.openecomp.sdc.versioning.dao.VersionInfoDeletedDaoFactory": "org.openecomp.sdc.versioning.dao.impl.VersionInfoDeletedDaoFactoryImpl"
+  "org.openecomp.sdc.versioning.dao.VersionInfoDeletedDaoFactory": "org.openecomp.sdc.versioning.dao.impl.VersionInfoDeletedDaoFactoryImpl",
+  "org.openecomp.sdc.versioning.dao.ItemDaoFactory": "org.openecomp.sdc.versioning.dao.impl.ItemDaoFactoryImpl",
+  "org.openecomp.sdc.versioning.dao.VersionDaoFactory": "org.openecomp.sdc.versioning.dao.impl.VersionDaoFactoryImpl",
+  "org.openecomp.sdc.versioning.dao.HealthCheckDaoFactory": "org.openecomp.sdc.model.impl.HealthCheckDaoFactoryImpl"
 }
\ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/VersionCalculator.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/VersionCalculator.java
new file mode 100644
index 0000000..dc9ac7b
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/VersionCalculator.java
@@ -0,0 +1,12 @@
+package org.openecomp.sdc.versioning;
+
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.versioning.types.VersionCreationMethod;
+
+import java.util.Set;
+
+public interface VersionCalculator {
+  String calculate(String baseVersion, VersionCreationMethod creationMethod);
+
+  void injectAdditionalInfo(Version version, Set<String> existingVersions);
+}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/UploadDataDaoFactory.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/VersionCalculatorFactory.java
similarity index 79%
copy from openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/UploadDataDaoFactory.java
copy to openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/VersionCalculatorFactory.java
index 9654551..85f02cd 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/UploadDataDaoFactory.java
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/VersionCalculatorFactory.java
@@ -7,9 +7,9 @@
  * 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.
@@ -18,14 +18,14 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.sdc.vendorsoftwareproduct.dao;
+package org.openecomp.sdc.versioning;
 
 import org.openecomp.core.factory.api.AbstractComponentFactory;
 import org.openecomp.core.factory.api.AbstractFactory;
 
-public abstract class UploadDataDaoFactory extends AbstractComponentFactory<UploadDataDao> {
+public abstract class VersionCalculatorFactory extends AbstractComponentFactory<VersionCalculator> {
 
-  public static UploadDataDaoFactory getInstance() {
-    return AbstractFactory.getInstance(UploadDataDaoFactory.class);
+  public static VersionCalculatorFactory getInstance() {
+    return AbstractFactory.getInstance(VersionCalculatorFactory.class);
   }
 }
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VendorSoftwareProductDaoFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/ItemDaoFactoryImpl.java
similarity index 66%
copy from openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VendorSoftwareProductDaoFactoryImpl.java
copy to openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/ItemDaoFactoryImpl.java
index 0a80b2a..0f9c906 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VendorSoftwareProductDaoFactoryImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/ItemDaoFactoryImpl.java
@@ -7,9 +7,9 @@
  * 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.
@@ -18,17 +18,19 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.sdc.vendorsoftwareproduct.dao.impl;
+package org.openecomp.sdc.versioning.dao.impl;
 
-import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDaoFactory;
+import org.openecomp.core.zusammen.api.ZusammenAdaptorFactory;
+import org.openecomp.sdc.versioning.dao.ItemDao;
+import org.openecomp.sdc.versioning.dao.ItemDaoFactory;
+import org.openecomp.sdc.versioning.dao.impl.zusammen.ItemZusammenDaoImpl;
 
-
-public class VendorSoftwareProductDaoFactoryImpl extends VendorSoftwareProductDaoFactory {
-  private static final VendorSoftwareProductDao INSTANCE = new VendorSoftwareProductDaoImpl();
+public class ItemDaoFactoryImpl extends ItemDaoFactory {
+  private static ItemDao INSTANCE =
+      new ItemZusammenDaoImpl(ZusammenAdaptorFactory.getInstance().createInterface());
 
   @Override
-  public VendorSoftwareProductDao createInterface() {
+  public ItemDao createInterface() {
     return INSTANCE;
   }
 }
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VendorSoftwareProductDaoFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionDaoFactoryImpl.java
similarity index 65%
copy from openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VendorSoftwareProductDaoFactoryImpl.java
copy to openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionDaoFactoryImpl.java
index 0a80b2a..f8b0d71 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VendorSoftwareProductDaoFactoryImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionDaoFactoryImpl.java
@@ -7,9 +7,9 @@
  * 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.
@@ -18,17 +18,19 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.sdc.vendorsoftwareproduct.dao.impl;
+package org.openecomp.sdc.versioning.dao.impl;
 
-import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDaoFactory;
+import org.openecomp.core.zusammen.api.ZusammenAdaptorFactory;
+import org.openecomp.sdc.versioning.dao.VersionDao;
+import org.openecomp.sdc.versioning.dao.VersionDaoFactory;
+import org.openecomp.sdc.versioning.dao.impl.zusammen.VersionZusammenDaoImpl;
 
-
-public class VendorSoftwareProductDaoFactoryImpl extends VendorSoftwareProductDaoFactory {
-  private static final VendorSoftwareProductDao INSTANCE = new VendorSoftwareProductDaoImpl();
+public class VersionDaoFactoryImpl extends VersionDaoFactory {
+  private static VersionDao INSTANCE =
+      new VersionZusammenDaoImpl(ZusammenAdaptorFactory.getInstance().createInterface());
 
   @Override
-  public VendorSoftwareProductDao createInterface() {
+  public VersionDao createInterface() {
     return INSTANCE;
   }
 }
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionableEntityDaoCassandraImpl.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionableEntityDaoCassandraImpl.java
index 5673da7..0845bea 100644
--- a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionableEntityDaoCassandraImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionableEntityDaoCassandraImpl.java
@@ -24,12 +24,12 @@
 import com.datastax.driver.core.ResultSet;
 import com.datastax.driver.core.Row;
 import com.datastax.driver.mapping.UDTMapper;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.openecomp.core.nosqldb.api.NoSqlDb;
 import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
 import org.openecomp.core.util.UniqueValueUtil;
 import org.openecomp.core.utilities.CommonMethods;
+import org.openecomp.sdc.logging.api.Logger;
+import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.openecomp.sdc.versioning.dao.VersionableEntityDao;
 import org.openecomp.sdc.versioning.dao.types.Version;
 import org.openecomp.sdc.versioning.types.UniqueValueMetadata;
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/zusammen/ItemZusammenDaoImpl.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/zusammen/ItemZusammenDaoImpl.java
new file mode 100644
index 0000000..8fdcf71
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/zusammen/ItemZusammenDaoImpl.java
@@ -0,0 +1,104 @@
+package org.openecomp.sdc.versioning.dao.impl.zusammen;
+
+import com.amdocs.zusammen.datatypes.Id;
+import com.amdocs.zusammen.datatypes.item.Info;
+import org.openecomp.core.zusammen.api.ZusammenAdaptor;
+import org.openecomp.core.zusammen.api.ZusammenUtil;
+import org.openecomp.sdc.versioning.dao.ItemDao;
+import org.openecomp.sdc.versioning.dao.types.VersionStatus;
+import org.openecomp.sdc.versioning.types.Item;
+
+import java.util.Collection;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+public class ItemZusammenDaoImpl implements ItemDao {
+
+  private ZusammenAdaptor zusammenAdaptor;
+
+  public ItemZusammenDaoImpl(ZusammenAdaptor zusammenAdaptor) {
+    this.zusammenAdaptor = zusammenAdaptor;
+  }
+
+  @Override
+  public Collection<Item> list() {
+    return zusammenAdaptor.listItems(ZusammenUtil.createSessionContext())
+        .stream().map(this::mapFromZusammenItem)
+        .collect(Collectors.toList());
+  }
+
+  @Override
+  public Item get(Item item) {
+    return mapFromZusammenItem(
+        zusammenAdaptor.getItem(ZusammenUtil.createSessionContext(), new Id(item.getId())));
+  }
+
+  @Override
+  public Item create(Item item) {
+    Id itemId = zusammenAdaptor
+        .createItem(ZusammenUtil.createSessionContext(), mapToZusammenItemInfo(item));
+    item.setId(itemId.getValue());
+    return item;
+  }
+
+  @Override
+  public void update(Item item) {
+    zusammenAdaptor
+        .updateItem(ZusammenUtil.createSessionContext(), new Id(item.getId()),
+            mapToZusammenItemInfo(item));
+  }
+
+  private Item mapFromZusammenItem(com.amdocs.zusammen.datatypes.item.Item zusammenItem) {
+    if (zusammenItem == null) {
+      return null;
+    }
+    Item item = new Item();
+    item.setId(zusammenItem.getId().getValue());
+    item.setName(zusammenItem.getInfo().getName());
+    item.setDescription(zusammenItem.getInfo().getDescription());
+
+    zusammenItem.getInfo().getProperties().entrySet()
+        .forEach(property -> addPropertyToItem(property.getKey(), property.getValue(), item));
+
+    item.setCreationTime(zusammenItem.getCreationTime());
+    item.setModificationTime(zusammenItem.getModificationTime());
+    return item;
+  }
+
+  private void addPropertyToItem(String propertyKey, Object propertyValue, Item item) {
+    switch (propertyKey) {
+      case InfoPropertyName.ITEM_TYPE:
+        item.setType((String) propertyValue);
+        break;
+      case InfoPropertyName.ITEM_VERSIONS_STATUSES:
+        for (Map.Entry<String, Number> statusCounter :
+            ((Map<String, Number>) propertyValue).entrySet()) {
+          item.getVersionStatusCounters().put(VersionStatus.valueOf(statusCounter.getKey()),
+              statusCounter.getValue().intValue());
+        }
+        break;
+      default:
+        item.addProperty(propertyKey, propertyValue);
+    }
+  }
+
+  private Info mapToZusammenItemInfo(Item item) {
+    Info info = new Info();
+    info.setName(item.getName());
+    info.setDescription(item.getDescription());
+    info.addProperty(InfoPropertyName.ITEM_TYPE, item.getType());
+    info.addProperty(InfoPropertyName.ITEM_VERSIONS_STATUSES, item.getVersionStatusCounters());
+    item.getProperties().entrySet()
+        .forEach(property -> info.addProperty(property.getKey(), property.getValue()));
+    return info;
+  }
+
+  private static final class InfoPropertyName {
+    private static final String ITEM_TYPE = "item_type";
+    private static final String ITEM_VERSIONS_STATUSES = "item_versions_statuses";
+
+    private InfoPropertyName() {
+      throw new IllegalStateException("Constants class");
+    }
+  }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/zusammen/VersionZusammenDaoImpl.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/zusammen/VersionZusammenDaoImpl.java
new file mode 100644
index 0000000..195973b
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/zusammen/VersionZusammenDaoImpl.java
@@ -0,0 +1,165 @@
+package org.openecomp.sdc.versioning.dao.impl.zusammen;
+
+import com.amdocs.zusammen.datatypes.Id;
+import com.amdocs.zusammen.datatypes.SessionContext;
+import com.amdocs.zusammen.datatypes.item.Info;
+import com.amdocs.zusammen.datatypes.item.ItemVersion;
+import com.amdocs.zusammen.datatypes.item.ItemVersionData;
+import com.amdocs.zusammen.datatypes.item.ItemVersionStatus;
+import com.amdocs.zusammen.datatypes.item.SynchronizationStatus;
+import org.openecomp.core.zusammen.api.ZusammenAdaptor;
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.common.errors.ErrorCategory;
+import org.openecomp.sdc.common.errors.ErrorCode;
+import org.openecomp.sdc.versioning.dao.VersionDao;
+import org.openecomp.sdc.versioning.dao.impl.zusammen.convertor.ItemVersionToVersionConvertor;
+import org.openecomp.sdc.versioning.dao.types.Revision;
+import org.openecomp.sdc.versioning.dao.types.SynchronizationState;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.versioning.dao.types.VersionState;
+
+import java.util.List;
+import java.util.Optional;
+import java.util.stream.Collectors;
+
+import static org.openecomp.core.zusammen.api.ZusammenUtil.createSessionContext;
+
+public class VersionZusammenDaoImpl implements VersionDao {
+
+  public static final class ZusammenProperty {
+    public static final String LABEL = "label";
+    public static final String STATUS = "status";
+
+    private ZusammenProperty() {
+      throw new IllegalStateException("Constants class");
+    }
+  }
+
+  private ZusammenAdaptor zusammenAdaptor;
+
+  public VersionZusammenDaoImpl(ZusammenAdaptor zusammenAdaptor) {
+    this.zusammenAdaptor = zusammenAdaptor;
+  }
+
+  @Override
+  public List<Version> list(String itemId) {
+    ItemVersionToVersionConvertor convertor = new ItemVersionToVersionConvertor();
+    return zusammenAdaptor.listPublicVersions(createSessionContext(), new Id(itemId)).stream()
+        .map(convertor::convert)
+        .collect(Collectors.toList());
+  }
+
+  @Override
+  public void create(String itemId, Version version) {
+    Id versionId =
+        zusammenAdaptor.createVersion(createSessionContext(), new Id(itemId),
+            version.getBaseId() == null ? null : new Id(version.getBaseId()),
+            mapToZusammenVersion(version));
+
+    version.setId(versionId.getValue());
+  }
+
+  @Override
+  public void update(String itemId, Version version) {
+    zusammenAdaptor.updateVersion(createSessionContext(), new Id(itemId), new Id(version.getId()),
+        mapToZusammenVersion(version));
+  }
+
+  @Override
+  public Optional<Version> get(String itemId, Version version) {
+    SessionContext context = createSessionContext();
+    Id itemIdObj = new Id(itemId);
+    Id versionId = new Id(version.getId());
+    ItemVersion itemVersion = zusammenAdaptor.getVersion(context, itemIdObj, versionId);
+
+    if (itemVersion == null) {
+      return Optional.empty();
+    }
+
+    VersionState versionState =
+        convertState(zusammenAdaptor.getVersionStatus(context, itemIdObj, versionId));
+    updateVersionStatus(context, itemIdObj, versionId, versionState, itemVersion);
+
+    Version result = new ItemVersionToVersionConvertor().convert(itemVersion);
+    result.setState(versionState);
+    return Optional.of(result);
+  }
+
+  @Override
+  public void delete(String itemId, Version version) {
+    throw new UnsupportedOperationException("Delete version operation is not yet supported.");
+  }
+
+  @Override
+  public void publish(String itemId, Version version, String message) {
+    zusammenAdaptor
+        .publishVersion(createSessionContext(), new Id(itemId), new Id(version.getId()), message);
+  }
+
+  @Override
+  public void sync(String itemId, Version version) {
+    zusammenAdaptor
+        .syncVersion(createSessionContext(), new Id(itemId), new Id(version.getId()));
+  }
+
+  @Override
+  public void forceSync(String itemId, Version version) {
+    zusammenAdaptor
+        .forceSyncVersion(createSessionContext(), new Id(itemId), new Id(version.getId()));
+  }
+
+  @Override
+  public void revert(String itemId, Version version, String revisionId) {
+    zusammenAdaptor.revert(createSessionContext(), itemId, version.getId(), revisionId);
+  }
+
+  @Override
+  public List<Revision> listRevisions(String itemId, Version version) {
+    return zusammenAdaptor.listRevisions(createSessionContext(), itemId, version.getId());
+  }
+
+  private void updateVersionStatus(SessionContext context, Id itemId, Id versionId,
+                                   VersionState versionState, ItemVersion itemVersion) {
+    if (versionState.getSynchronizationState() != SynchronizationState.UpToDate ||
+        versionState.isDirty()) {
+      String versionStatus = zusammenAdaptor.getPublicVersion(context, itemId, versionId)
+          .getData().getInfo().getProperty(ZusammenProperty.STATUS);
+      itemVersion.getData().getInfo().addProperty(ZusammenProperty.STATUS, versionStatus);
+    }
+  }
+
+  private ItemVersionData mapToZusammenVersion(Version version) {
+    Info info = new Info();
+    info.addProperty(ZusammenProperty.LABEL, version.toString());
+    info.addProperty(ZusammenProperty.STATUS, version.getStatus().name());
+    info.setName(version.getName());
+    info.setDescription(version.getDescription());
+
+    ItemVersionData itemVersionData = new ItemVersionData();
+    itemVersionData.setInfo(info);
+    return itemVersionData;
+  }
+
+  private VersionState convertState(ItemVersionStatus versionStatus) {
+    VersionState state = new VersionState();
+    state.setSynchronizationState(getSyncState(versionStatus.getSynchronizationStatus()));
+    state.setDirty(versionStatus.isDirty());
+    return state;
+  }
+
+  private SynchronizationState getSyncState(SynchronizationStatus synchronizationStatus) {
+    switch (synchronizationStatus) {
+      case UP_TO_DATE:
+        return SynchronizationState.UpToDate;
+      case OUT_OF_SYNC:
+        return SynchronizationState.OutOfSync;
+      case MERGING:
+        return SynchronizationState.Merging;
+      default:
+        throw new CoreException(new ErrorCode.ErrorCodeBuilder()
+            .withCategory(ErrorCategory.APPLICATION)
+            .withId("UNKNOWN_VERSION_STATE")
+            .withMessage("Version state is unknown").build());
+    }
+  }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/zusammen/convertor/ItemVersionToVersionConvertor.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/zusammen/convertor/ItemVersionToVersionConvertor.java
new file mode 100644
index 0000000..f47b5aa
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/zusammen/convertor/ItemVersionToVersionConvertor.java
@@ -0,0 +1,49 @@
+package org.openecomp.sdc.versioning.dao.impl.zusammen.convertor;
+
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.Element;
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.ElementInfo;
+import com.amdocs.zusammen.datatypes.item.Item;
+import com.amdocs.zusammen.datatypes.item.ItemVersion;
+import org.openecomp.convertor.ElementConvertor;
+import org.openecomp.sdc.versioning.dao.impl.zusammen.VersionZusammenDaoImpl;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.versioning.dao.types.VersionStatus;
+
+public class ItemVersionToVersionConvertor extends ElementConvertor {
+  @Override
+  public Object convert(Element element) {
+    return null;
+  }
+
+  @Override
+  public Object convert(Item item) {
+    return null;
+  }
+
+  @Override
+  public Object convert(ElementInfo elementInfo) {
+    return null;
+  }
+
+  @Override
+  public Version convert(ItemVersion itemVersion) {
+    if (itemVersion == null) {
+      return null;
+    }
+    Version version = Version.valueOf(
+        itemVersion.getData().getInfo().getProperty(VersionZusammenDaoImpl.ZusammenProperty.LABEL));
+    version.setStatus(VersionStatus.valueOf(itemVersion.getData().getInfo()
+        .getProperty(VersionZusammenDaoImpl.ZusammenProperty.STATUS)));
+    version.setName(itemVersion.getData().getInfo().getName());
+    version.setDescription(itemVersion.getData().getInfo().getDescription());
+
+    version.setId(itemVersion.getId().getValue());
+    if (itemVersion.getBaseId() != null) {
+      version.setBaseId(itemVersion.getBaseId().getValue());
+    }
+    version.setCreationTime(itemVersion.getCreationTime());
+    version.setModificationTime(itemVersion.getModificationTime());
+    return version;
+  }
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/impl/ItemManagerFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/impl/ItemManagerFactoryImpl.java
new file mode 100644
index 0000000..ba5bd07
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/impl/ItemManagerFactoryImpl.java
@@ -0,0 +1,39 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * 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=========================================================
+ */
+
+package org.openecomp.sdc.versioning.impl;
+
+import org.openecomp.sdc.itempermissions.PermissionsServicesFactory;
+import org.openecomp.sdc.notification.factories.SubscriptionServiceFactory;
+import org.openecomp.sdc.versioning.ItemManager;
+import org.openecomp.sdc.versioning.ItemManagerFactory;
+import org.openecomp.sdc.versioning.dao.ItemDaoFactory;
+
+public class ItemManagerFactoryImpl extends ItemManagerFactory {
+  private static final ItemManager INSTANCE =
+      new ItemManagerImpl(ItemDaoFactory.getInstance().createInterface(),
+          PermissionsServicesFactory.getInstance().createInterface(),
+          SubscriptionServiceFactory.getInstance().createInterface());
+
+  @Override
+  public ItemManager createInterface() {
+    return INSTANCE;
+  }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/impl/ItemManagerImpl.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/impl/ItemManagerImpl.java
new file mode 100644
index 0000000..7928454
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/impl/ItemManagerImpl.java
@@ -0,0 +1,68 @@
+package org.openecomp.sdc.versioning.impl;
+
+import org.openecomp.sdc.common.session.SessionContextProviderFactory;
+import org.openecomp.sdc.itempermissions.PermissionsServices;
+import org.openecomp.sdc.notification.services.SubscriptionService;
+import org.openecomp.sdc.versioning.ItemManager;
+import org.openecomp.sdc.versioning.dao.ItemDao;
+import org.openecomp.sdc.versioning.dao.types.VersionStatus;
+import org.openecomp.sdc.versioning.types.Item;
+
+import java.util.Collection;
+import java.util.function.Predicate;
+import java.util.stream.Collectors;
+
+public class ItemManagerImpl implements ItemManager {
+  public static final String CREATE_ITEM = "Create_Item";
+
+  private ItemDao itemDao;
+  private PermissionsServices permissionsServices;
+  private SubscriptionService subscriptionService;
+
+  public ItemManagerImpl(ItemDao itemDao, PermissionsServices permissionsServices,
+                         SubscriptionService subscriptionService) {
+    this.itemDao = itemDao;
+    this.permissionsServices = permissionsServices;
+    this.subscriptionService = subscriptionService;
+  }
+
+  @Override
+  public Collection<Item> list(Predicate<Item> predicate) {
+    return itemDao.list().stream().filter(predicate).collect(Collectors.toList());
+  }
+
+  @Override
+  public Item get(String itemId) {
+    Item item = new Item();
+    item.setId(itemId);
+    return itemDao.get(item);
+  }
+
+  @Override
+  public Item create(Item item) {
+    Item createdItem = itemDao.create(item);
+
+    String userId = SessionContextProviderFactory.getInstance()
+        .createInterface().get().getUser().getUserId();
+    String itemId = createdItem.getId();
+    permissionsServices.execute(itemId, userId, CREATE_ITEM);
+    subscriptionService.subscribe(userId, itemId);
+
+    return createdItem;
+  }
+
+  @Override
+  public void updateVersionStatus(String itemId, VersionStatus addedVersionStatus,
+                                  VersionStatus removedVersionStatus) {
+    Item item = get(itemId);
+    if (item == null) {
+      return;
+    }
+
+    item.addVersionStatus(addedVersionStatus);
+    if (removedVersionStatus != null) {
+      item.removeVersionStatus(removedVersionStatus);
+    }
+    itemDao.update(item);
+  }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/impl/MajorVersionCalculatorFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/impl/MajorVersionCalculatorFactoryImpl.java
new file mode 100644
index 0000000..2300f62
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/impl/MajorVersionCalculatorFactoryImpl.java
@@ -0,0 +1,14 @@
+package org.openecomp.sdc.versioning.impl;
+
+import org.openecomp.sdc.versioning.VersionCalculator;
+import org.openecomp.sdc.versioning.VersionCalculatorFactory;
+
+public class MajorVersionCalculatorFactoryImpl extends VersionCalculatorFactory {
+  private static final VersionCalculator INSTANCE =
+      new MajorVersionCalculatorImpl();
+
+  @Override
+  public VersionCalculator createInterface() {
+    return INSTANCE;
+  }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/impl/MajorVersionCalculatorImpl.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/impl/MajorVersionCalculatorImpl.java
new file mode 100644
index 0000000..91c59e0
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/impl/MajorVersionCalculatorImpl.java
@@ -0,0 +1,53 @@
+package org.openecomp.sdc.versioning.impl;
+
+import org.openecomp.core.utilities.CommonMethods;
+import org.openecomp.sdc.versioning.VersionCalculator;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.versioning.dao.types.VersionStatus;
+import org.openecomp.sdc.versioning.types.VersionCreationMethod;
+
+import java.util.HashSet;
+import java.util.Set;
+
+public class MajorVersionCalculatorImpl implements VersionCalculator {
+  private static final String INITIAL_VERSION = "1.0";
+  private static final String VERSION_STRING_VIOLATION_MSG =
+      "Version string must be in the format of: {integer}.{integer}";
+
+  @Override
+  public String calculate(String baseVersion, VersionCreationMethod creationMethod) {
+
+    if (baseVersion == null) {
+      return INITIAL_VERSION;
+    }
+
+    String[] versionLevels = baseVersion.split("\\.");
+    if (versionLevels.length != 2) {
+      throw new IllegalArgumentException(VERSION_STRING_VIOLATION_MSG);
+    }
+
+    int index = Integer.parseInt(versionLevels[0]);
+    index++;
+    versionLevels[0] = Integer.toString(index);
+    versionLevels[1] = "0";
+
+    return CommonMethods.arrayToSeparatedString(versionLevels, '.');
+  }
+
+  @Override
+  public void injectAdditionalInfo(Version version, Set<String> existingVersions) {
+    String optionalVersion;
+    Set<VersionCreationMethod> optionalCreationMethods = new HashSet<>();
+    if(version.getStatus().equals(VersionStatus.Certified)) {
+      try {
+        optionalVersion = calculate(version.getName(), VersionCreationMethod.major);
+        if (!existingVersions.contains(optionalVersion)) {
+          optionalCreationMethods.add(VersionCreationMethod.major);
+        }
+      } catch (IllegalArgumentException iae) {
+        //not a valid creation method.
+      }
+    }
+    version.getAdditionalInfo().put("OptionalCreationMethods", optionalCreationMethods);
+  }
+}
diff --git a/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activityLog/ActivityLogManager.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/impl/VersionCalculatorFactoryImpl.java
similarity index 70%
copy from openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activityLog/ActivityLogManager.java
copy to openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/impl/VersionCalculatorFactoryImpl.java
index a40e101..155aa9c 100644
--- a/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activityLog/ActivityLogManager.java
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/impl/VersionCalculatorFactoryImpl.java
@@ -18,14 +18,17 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.sdc.activityLog;
+package org.openecomp.sdc.versioning.impl;
 
-import org.openecomp.sdc.activitylog.dao.type.ActivityLogEntity;
-import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.versioning.VersionCalculator;
+import org.openecomp.sdc.versioning.VersionCalculatorFactory;
 
-import java.util.Collection;
+public class VersionCalculatorFactoryImpl extends VersionCalculatorFactory {
+  private static final VersionCalculator INSTANCE =
+      new VersionCalculatorImpl();
 
-public interface ActivityLogManager {
-    void addActionLog(ActivityLogEntity activityLogEntity, String user);
-    Collection<ActivityLogEntity> listActivityLogs(String itemId, Version versionId, String user);
+  @Override
+  public VersionCalculator createInterface() {
+    return INSTANCE;
+  }
 }
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/impl/VersionCalculatorImpl.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/impl/VersionCalculatorImpl.java
new file mode 100644
index 0000000..b7008de
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/impl/VersionCalculatorImpl.java
@@ -0,0 +1,155 @@
+package org.openecomp.sdc.versioning.impl;
+
+import org.openecomp.core.utilities.CommonMethods;
+import org.openecomp.sdc.versioning.VersionCalculator;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.versioning.dao.types.VersionStatus;
+import org.openecomp.sdc.versioning.types.VersionCreationMethod;
+
+import java.util.HashSet;
+import java.util.Set;
+
+public class VersionCalculatorImpl implements VersionCalculator {
+
+  private static final String INITIAL_VERSION = "1.0";
+  private static final String VERSION_STRING_VIOLATION_MSG =
+      "Version string must be in the format of: {integer}.{integer}";
+  private static final String PARENT_LEVEL_VERSION_CANNOT_BE_CREATED_FROM_TOP_LEVEL =
+      "Creation of parent level version on top level version is invalid.";
+  private static final String SUB_LEVEL_VERSION_CANNOT_BE_CREATED_FROM_LOWEST_LEVEL =
+      "Creation of parent level version on top level version is invalid.";
+
+  private static final String VERSION_CALCULATION_ERROR_MSG =
+      "Version calculation error.";
+
+  private static final String INVALID_CREATION_METHOD_MSG = "Invalid creation method-";
+
+
+  @Override
+  public String calculate(String baseVersion, VersionCreationMethod creationMethod) {
+
+    if (baseVersion == null) {
+      return INITIAL_VERSION;
+    }
+
+    String[] versionLevels = baseVersion.split("\\.");
+    if (versionLevels.length != 2) {
+      throw new IllegalArgumentException(VERSION_STRING_VIOLATION_MSG);
+    }
+
+    int index;
+    switch (creationMethod) {
+      case major:
+        index = Integer.parseInt(versionLevels[0]);
+        index++;
+        versionLevels[0] = Integer.toString(index);
+        versionLevels[1] = "0";
+        break;
+      case minor:
+        index = Integer.parseInt(versionLevels[1]);
+        index++;
+        versionLevels[1] = Integer.toString(index);
+        break;
+    }
+    return CommonMethods.arrayToSeparatedString(versionLevels, '.');
+  }
+
+
+  // version calculator when there are no version restrictions
+ /* @Override
+  public String calculate(String baseVersion, VersionCreationMethod creationMethod) {
+
+    return calculate(baseVersion,creationMethod,2);
+  }
+
+  private String calculate(String baseVersion, VersionCreationMethod creationMethod,int
+      maxVersionLevels) {
+    if (baseVersion == null) {
+      return INITIAL_VERSION;
+    }
+
+    String[] versionLevels = baseVersion.split("\\.");
+    if (versionLevels.length > maxVersionLevels) {
+      throw new IllegalArgumentException(VERSION_STRING_VIOLATION_MSG);
+    }
+
+    int index;
+    int versionLevel = calcVersionLevel(versionLevels);
+    if (versionLevel == -1) {
+      throw new IllegalArgumentException(
+          VERSION_STRING_VIOLATION_MSG + " given version:" + baseVersion);
+    }
+    int requiredVersionLevelIncrease;
+    switch (creationMethod) {
+      case parent_level:
+        if (versionLevel == 0) {
+          throw new IllegalArgumentException(
+              PARENT_LEVEL_VERSION_CANNOT_BE_CREATED_FROM_TOP_LEVEL + " version:" + baseVersion);
+
+        }
+        requiredVersionLevelIncrease = versionLevel - 1;
+        versionLevels[versionLevel] = "0";
+        index = Integer.getInteger(versionLevels[requiredVersionLevelIncrease]);
+        index++;
+        versionLevels[requiredVersionLevelIncrease] = Integer.toString(index);
+        break;
+      case same_level:
+        requiredVersionLevelIncrease = versionLevel;
+        index = Integer.valueOf(versionLevels[requiredVersionLevelIncrease]);
+        index++;
+        versionLevels[requiredVersionLevelIncrease] = Integer.toString(index);
+        break;
+      case sub_level:
+        if (versionLevel == versionLevels.length - 1) {
+          throw new IllegalArgumentException(
+              SUB_LEVEL_VERSION_CANNOT_BE_CREATED_FROM_LOWEST_LEVEL + " version:" + baseVersion);
+        }
+        requiredVersionLevelIncrease = versionLevel + 1;
+        if(requiredVersionLevelIncrease>maxVersionLevels){
+          throw new IllegalArgumentException(INVALID_CREATION_METHOD_MSG+" max " +
+              "levels:"+maxVersionLevels + "requested level:"+requiredVersionLevelIncrease);
+        }
+        String newVersion = baseVersion + ".1";
+        versionLevels = newVersion.split("\\.");
+
+        break;
+      default:
+        throw new IllegalArgumentException(VERSION_CALCULATION_ERROR_MSG + " base " +
+            "version:" + baseVersion + " creation method:" + creationMethod);
+
+    }
+
+    return CommonMethods.arrayToSeparatedString(versionLevels, '.');
+  }*/
+
+
+  @Override
+  public void injectAdditionalInfo(Version version, Set<String> existingVersions) {
+    String optionalVersion;
+    Set<VersionCreationMethod> optionalCreationMethods = new HashSet<>();
+    if(version.getStatus().equals(VersionStatus.Certified)) {
+      for (VersionCreationMethod versionCreationMethod : VersionCreationMethod.values()) {
+        try {
+          optionalVersion = calculate(version.getName(), versionCreationMethod);
+          if (!existingVersions.contains(optionalVersion)) {
+            optionalCreationMethods.add(versionCreationMethod);
+          }
+        } catch (IllegalArgumentException iae) {
+          //not a valid creation method.
+        }
+      }
+    }
+    version.getAdditionalInfo().put("OptionalCreationMethods", optionalCreationMethods);
+
+  }
+
+
+  private int calcVersionLevel(String[] versionLevels) {
+    for (int i = versionLevels.length - 1; i >= 0; i--) {
+      if (!versionLevels[i].equals("0")) {
+        return i;
+      }
+    }
+    return -1;
+  }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/impl/VersioningManagerFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/impl/VersioningManagerFactoryImpl.java
index 8ab5c60..b4dbcf3 100644
--- a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/impl/VersioningManagerFactoryImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/impl/VersioningManagerFactoryImpl.java
@@ -20,16 +20,21 @@
 
 package org.openecomp.sdc.versioning.impl;
 
+import org.openecomp.sdc.versioning.ItemManagerFactory;
+import org.openecomp.sdc.versioning.VersionCalculatorFactory;
 import org.openecomp.sdc.versioning.VersioningManager;
 import org.openecomp.sdc.versioning.VersioningManagerFactory;
+import org.openecomp.sdc.versioning.dao.VersionDaoFactory;
 import org.openecomp.sdc.versioning.dao.VersionInfoDaoFactory;
 import org.openecomp.sdc.versioning.dao.VersionInfoDeletedDaoFactory;
 
 public class VersioningManagerFactoryImpl extends VersioningManagerFactory {
   private static final VersioningManager INSTANCE = new VersioningManagerImpl(
       VersionInfoDaoFactory.getInstance().createInterface(),
-      VersionInfoDeletedDaoFactory.getInstance().createInterface()
-  );
+      VersionInfoDeletedDaoFactory.getInstance().createInterface(),
+      VersionDaoFactory.getInstance().createInterface(),
+      VersionCalculatorFactory.getInstance().createInterface(),
+      ItemManagerFactory.getInstance().createInterface());
 
   @Override
   public VersioningManager createInterface() {
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/impl/VersioningManagerImpl.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/impl/VersioningManagerImpl.java
index 4a49d53..7f98347 100644
--- a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/impl/VersioningManagerImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/impl/VersioningManagerImpl.java
@@ -21,25 +21,31 @@
 package org.openecomp.sdc.versioning.impl;
 
 import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.common.errors.ErrorCategory;
+import org.openecomp.sdc.common.errors.ErrorCode;
 import org.openecomp.sdc.datatypes.error.ErrorLevel;
+import org.openecomp.sdc.logging.api.Logger;
+import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage;
 import org.openecomp.sdc.logging.context.impl.MdcDataErrorMessage;
 import org.openecomp.sdc.logging.types.LoggerConstants;
 import org.openecomp.sdc.logging.types.LoggerErrorCode;
 import org.openecomp.sdc.logging.types.LoggerErrorDescription;
 import org.openecomp.sdc.logging.types.LoggerTragetServiceName;
+import org.openecomp.sdc.versioning.ItemManager;
+import org.openecomp.sdc.versioning.VersionCalculator;
 import org.openecomp.sdc.versioning.VersioningManager;
+import org.openecomp.sdc.versioning.dao.VersionDao;
 import org.openecomp.sdc.versioning.dao.VersionInfoDao;
 import org.openecomp.sdc.versioning.dao.VersionInfoDeletedDao;
 import org.openecomp.sdc.versioning.dao.VersionableEntityDaoFactory;
+import org.openecomp.sdc.versioning.dao.types.Revision;
+import org.openecomp.sdc.versioning.dao.types.SynchronizationState;
 import org.openecomp.sdc.versioning.dao.types.UserCandidateVersion;
 import org.openecomp.sdc.versioning.dao.types.Version;
-import org.openecomp.sdc.versioning.dao.types.VersionHistoryEntity;
 import org.openecomp.sdc.versioning.dao.types.VersionInfoDeletedEntity;
 import org.openecomp.sdc.versioning.dao.types.VersionInfoEntity;
 import org.openecomp.sdc.versioning.dao.types.VersionStatus;
-import org.openecomp.sdc.versioning.dao.types.VersionType;
-import org.openecomp.sdc.versioning.dao.types.VersionableEntityId;
 import org.openecomp.sdc.versioning.errors.CheckinOnEntityLockedByOtherErrorBuilder;
 import org.openecomp.sdc.versioning.errors.CheckinOnUnlockedEntityErrorBuilder;
 import org.openecomp.sdc.versioning.errors.CheckoutOnLockedEntityErrorBuilder;
@@ -52,6 +58,7 @@
 import org.openecomp.sdc.versioning.errors.SubmitLockedEntityNotAllowedErrorBuilder;
 import org.openecomp.sdc.versioning.errors.UndoCheckoutOnEntityLockedByOtherErrorBuilder;
 import org.openecomp.sdc.versioning.errors.UndoCheckoutOnUnlockedEntityErrorBuilder;
+import org.openecomp.sdc.versioning.types.VersionCreationMethod;
 import org.openecomp.sdc.versioning.types.VersionInfo;
 import org.openecomp.sdc.versioning.types.VersionableEntityAction;
 import org.openecomp.sdc.versioning.types.VersionableEntityMetadata;
@@ -66,18 +73,27 @@
 import java.util.stream.Collectors;
 
 public class VersioningManagerImpl implements VersioningManager {
-
+  private static final Logger LOGGER = LoggerFactory.getLogger(VersioningManagerImpl.class);
   private static final Version INITIAL_ACTIVE_VERSION = new Version(0, 0);
   private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage();
   private static Map<String, Set<VersionableEntityMetadata>> versionableEntities = new HashMap<>();
 
-  private VersionInfoDao versionInfoDao;
-  private VersionInfoDeletedDao versionInfoDeletedDao;
+  private final VersionInfoDao versionInfoDao;
+  private final VersionInfoDeletedDao versionInfoDeletedDao;
+  private VersionDao versionDao;
+  private VersionCalculator versionCalculator;
+  private ItemManager itemManager;
 
   public VersioningManagerImpl(VersionInfoDao versionInfoDao,
-                               VersionInfoDeletedDao versionInfoDeletedDao) {
+                               VersionInfoDeletedDao versionInfoDeletedDao,
+                               VersionDao versionDao,
+                               VersionCalculator versionCalculator,
+                               ItemManager itemManager) {
     this.versionInfoDao = versionInfoDao;
     this.versionInfoDeletedDao = versionInfoDeletedDao;
+    this.versionDao = versionDao;
+    this.versionCalculator = versionCalculator;
+    this.itemManager = itemManager;
   }
 
   private static VersionInfo getVersionInfo(VersionInfoEntity versionInfoEntity, String user,
@@ -146,8 +162,12 @@
     VersionInfo versionInfo = new VersionInfo();
     versionInfo.setStatus(status);
     activeVersion.setStatus(status);
-    if(latestFinalVersion!= null) latestFinalVersion.setStatus(status);
-    if(viewableVersions != null) viewableVersions.forEach(version->version.setStatus(status));
+    if (latestFinalVersion != null) {
+      latestFinalVersion.setStatus(status);
+    }
+    if (viewableVersions != null) {
+      viewableVersions.forEach(version -> version.setStatus(status));
+    }
     versionInfo.setActiveVersion(activeVersion);
     versionInfo.setLatestFinalVersion(latestFinalVersion);
     versionInfo.setViewableVersions(toSortedList(viewableVersions));
@@ -166,11 +186,9 @@
 
   private static List<Version> toSortedList(
       Set<Version> versions) { // changing the Set to List in DB will require migration...
-    return versions.stream().sorted((o1, o2) -> {
-      return o1.getMajor() > o2.getMajor() ? 1
-          : o1.getMajor() == o2.getMajor() ? (o1.getMinor() > o2.getMinor() ? 1
-              : o1.getMinor() == o2.getMinor() ? 0 : -1) : -1;
-    }).collect(Collectors.toList());
+    return versions.stream().sorted((o1, o2) -> o1.getMajor() > o2.getMajor() ? 1
+        : o1.getMajor() == o2.getMajor() ? (o1.getMinor() > o2.getMinor() ? 1
+            : o1.getMinor() == o2.getMinor() ? 0 : -1) : -1).collect(Collectors.toList());
   }
 
   private static List<Version> getFinalVersions(Set<Version> versions) {
@@ -263,8 +281,8 @@
             LoggerErrorCode.PERMISSION_ERROR.getErrorCode(), "Can't checkout versionable entity");
         throw new CoreException(new CheckoutOnLockedEntityErrorBuilder(entityType, entityId,
             versionInfoEntity.getCandidate().getUser()).build());
-      case Final:
-      case Available:
+      case Certified:
+      case Draft:
         checkoutVersion = doCheckout(versionInfoEntity, user);
         break;
       default:
@@ -300,8 +318,8 @@
         }
         activeVersion = undoCheckout(versionInfoEntity);
         break;
-      case Final:
-      case Available:
+      case Certified:
+      case Draft:
         MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
             LoggerTragetServiceName.UNDO_CHECKOUT_ENTITY, ErrorLevel.ERROR.name(),
             LoggerErrorCode.PERMISSION_ERROR.getErrorCode(),
@@ -320,8 +338,9 @@
     deleteVersionFromEntity(versionInfoEntity.getEntityType(), versionInfoEntity.getEntityId(),
         versionInfoEntity.getCandidate().getVersion(), versionInfoEntity.getActiveVersion());
 
-    versionInfoEntity.setStatus(versionInfoEntity.getActiveVersion().isFinal() ? VersionStatus.Final
-        : VersionStatus.Available);
+    versionInfoEntity
+        .setStatus(versionInfoEntity.getActiveVersion().isFinal() ? VersionStatus.Certified
+            : VersionStatus.Draft);
     versionInfoEntity.setCandidate(null);
     versionInfoDao.update(versionInfoEntity);
     return versionInfoEntity.getActiveVersion();
@@ -341,8 +360,8 @@
 
     Version checkedInVersion = null;
     switch (versionInfoEntity.getStatus()) {
-      case Available:
-      case Final:
+      case Draft:
+      case Certified:
         MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
             LoggerTragetServiceName.CHECKIN_ENTITY, ErrorLevel.ERROR.name(),
             LoggerErrorCode.PERMISSION_ERROR.getErrorCode(), "Can't checkin versionable entity");
@@ -379,7 +398,7 @@
 
     Version submitVersion = null;
     switch (versionInfoEntity.getStatus()) {
-      case Final:
+      case Certified:
         MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
             LoggerTragetServiceName.SUBMIT_ENTITY, ErrorLevel.ERROR.name(),
             LoggerErrorCode.DATA_ERROR.getErrorCode(), "Can't submit versionable entity");
@@ -391,7 +410,7 @@
             LoggerErrorCode.PERMISSION_ERROR.getErrorCode(), "Can't submit versionable entity");
         throw new CoreException(new SubmitLockedEntityNotAllowedErrorBuilder(entityType, entityId,
             versionInfoEntity.getCandidate().getUser()).build());
-      case Available:
+      case Draft:
         submitVersion = doSubmit(versionInfoEntity, user, submitDescription);
         break;
       default:
@@ -444,6 +463,143 @@
     return activeVersions;
   }
 
+  @Override
+  public List<Version> list(String itemId) {
+
+    List<Version> versions = versionDao.list(itemId);
+    Set<String> versionsNames = versions.stream().map(Version::getName).collect(Collectors.toSet());
+    versions.forEach(version -> {
+      version.setAdditionalInfo(new HashMap<>());
+      versionCalculator.injectAdditionalInfo(version, versionsNames);
+    });
+    return versions;
+  }
+
+  @Override
+  public Version get(String itemId, Version version) {
+    return versionDao.get(itemId, version)
+        .map(retrievedVersion -> getUpdateRetrievedVersion(itemId, retrievedVersion))
+        .orElseGet(() -> getSyncedVersion(itemId, version));
+  }
+
+  private Version getUpdateRetrievedVersion(String itemId, Version version) {
+    if (version.getStatus() == VersionStatus.Certified &&
+        (version.getState().getSynchronizationState() == SynchronizationState.OutOfSync ||
+            version.getState().isDirty())) {
+      forceSync(itemId, version);
+      LOGGER.info("Item Id {}, version Id {}: Force sync is done", itemId, version.getId());
+      version = versionDao.get(itemId, version)
+          .orElseThrow(() -> new IllegalStateException(
+              "Get version after a successful force sync must return the version"));
+    }
+    return version;
+  }
+
+  private Version getSyncedVersion(String itemId, Version version) {
+    sync(itemId, version);
+    LOGGER.info("Item Id {}, version Id {}: First time sync is done", itemId, version.getId());
+    return versionDao.get(itemId, version)
+        .orElseThrow(() -> new IllegalStateException(
+            "Get version after a successful sync must return the version"));
+  }
+
+  @Override
+  public Version create(String itemId, Version version, VersionCreationMethod creationMethod) {
+    String baseVersionName = null;
+    if (version.getBaseId() == null) {
+      version.setDescription("Initial version");
+    } else {
+      baseVersionName = get(itemId, new Version(version.getBaseId())).getName();
+    }
+    String versionName = versionCalculator.calculate(baseVersionName, creationMethod);
+    validateVersionName(itemId, versionName);
+    version.setName(versionName);
+
+    versionDao.create(itemId, version);
+    itemManager.updateVersionStatus(itemId, VersionStatus.Draft, null);
+
+    publish(itemId, version, String.format("Initial version: %s ", version.getName()));
+    return version;
+  }
+
+  private void validateVersionName(String itemId, String versionName) {
+    if (versionDao.list(itemId).stream()
+        .anyMatch(version -> versionName.equals(version.getName()))) {
+      String errorDescription = String
+          .format("Item %s: create version failed, a version with the name %s already exist",
+              itemId, versionName);
+
+      MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY,
+          LoggerTragetServiceName.CREATE_VERSION, ErrorLevel.ERROR.name(),
+          LoggerErrorCode.DATA_ERROR.getErrorCode(), errorDescription);
+
+      throw new CoreException(new ErrorCode.ErrorCodeBuilder()
+          .withCategory(ErrorCategory.APPLICATION)
+          .withId("VERSION_NAME_ALREADY_EXIST")
+          .withMessage(errorDescription)
+          .build());
+    }
+  }
+
+  @Override
+  public void submit(String itemId, Version version, String submitDescription) {
+    version = get(itemId, version);
+
+    validateSubmit(itemId, version);
+
+    version.setStatus(VersionStatus.Certified);
+    versionDao.update(itemId, version);
+
+    publish(itemId, version, submitDescription);
+
+    itemManager.updateVersionStatus(itemId, VersionStatus.Certified, VersionStatus.Draft);
+  }
+
+  private void validateSubmit(String itemId, Version version) {
+    if (version.getStatus() == VersionStatus.Certified) {
+      String errorDescription = String
+          .format("Item %s: submit version failed, version %s is already Certified", itemId,
+              version.getId());
+
+      MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
+          LoggerTragetServiceName.SUBMIT_ENTITY, ErrorLevel.ERROR.name(),
+          LoggerErrorCode.DATA_ERROR.getErrorCode(), errorDescription);
+
+      throw new CoreException(new ErrorCode.ErrorCodeBuilder()
+          .withCategory(ErrorCategory.APPLICATION)
+          .withId("VERSION_ALREADY_CERTIFIED")
+          .withMessage(errorDescription)
+          .build());
+    }
+  }
+
+  @Override
+  public void publish(String itemId, Version version, String message) {
+    versionDao.publish(itemId, version, message);
+  }
+
+
+  @Override
+  public void sync(String itemId, Version version) {
+    versionDao.sync(itemId, version);
+  }
+
+  @Override
+  public void forceSync(String itemId, Version version) {
+    versionDao.forceSync(itemId, version);
+  }
+
+  @Override
+  public void revert(String itemId, Version version, String revisionId) {
+    versionDao.revert(itemId, version, revisionId);
+  }
+
+  @Override
+  public List<Revision> listRevisions(String itemId, Version version) {
+    return versionDao.listRevisions(itemId, version);
+
+  }
+
   private void markAsCheckedOut(VersionInfoEntity versionInfoEntity, String checkingOutUser) {
     versionInfoEntity.setStatus(VersionStatus.Locked);
     versionInfoEntity.setCandidate(new UserCandidateVersion(checkingOutUser,
@@ -491,7 +647,7 @@
     versionInfoEntity.setCandidate(null);
     versionInfoEntity.setActiveVersion(userCandidateVersion.getVersion());
     versionInfoEntity.getViewableVersions().add(versionInfoEntity.getActiveVersion());
-    versionInfoEntity.setStatus(VersionStatus.Available);
+    versionInfoEntity.setStatus(VersionStatus.Draft);
 
     closeVersionOnEntity(versionInfoEntity.getEntityType(), versionInfoEntity.getEntityId(),
         versionInfoEntity.getActiveVersion());
@@ -519,22 +675,12 @@
     versionInfoEntity.setViewableVersions(viewableVersions);
     versionInfoEntity.setActiveVersion(finalVersion);
     versionInfoEntity.setLatestFinalVersion(finalVersion);
-    versionInfoEntity.setStatus(VersionStatus.Final);
+    versionInfoEntity.setStatus(VersionStatus.Certified);
     versionInfoDao.update(versionInfoEntity);
 
     return finalVersion;
   }
 
-  private void createVersionHistory(VersionableEntityId entityId, Version version, String user,
-                                    String description, VersionType type) {
-    VersionHistoryEntity versionHistory = new VersionHistoryEntity(entityId);
-    versionHistory.setVersion(version);
-    versionHistory.setUser(user);
-    versionHistory.setDescription(description);
-    versionHistory.setType(type);
-    //versionHistoryDao.create(versionHistory);
-  }
-
   private void initVersionOnEntity(String entityType, String entityId, Version baseVersion,
                                    Version newVersion) {
     Set<VersionableEntityMetadata> entityMetadatas = versionableEntities.get(entityType);
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/resources/factoryConfiguration.json b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/resources/factoryConfiguration.json
new file mode 100644
index 0000000..d2d16ef
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/resources/factoryConfiguration.json
@@ -0,0 +1,3 @@
+{
+  "org.openecomp.sdc.versioning.VersionCalculatorFactory": "org.openecomp.sdc.versioning.impl.MajorVersionCalculatorFactoryImpl"
+}
\ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/test/java/org/openecomp/sdc/versioning/dao/impl/zusammen/VersionZusammenDaoImplTest.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/test/java/org/openecomp/sdc/versioning/dao/impl/zusammen/VersionZusammenDaoImplTest.java
new file mode 100644
index 0000000..1f1efdf
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/test/java/org/openecomp/sdc/versioning/dao/impl/zusammen/VersionZusammenDaoImplTest.java
@@ -0,0 +1,265 @@
+package org.openecomp.sdc.versioning.dao.impl.zusammen;
+
+import com.amdocs.zusammen.datatypes.Id;
+import com.amdocs.zusammen.datatypes.SessionContext;
+import com.amdocs.zusammen.datatypes.UserInfo;
+import com.amdocs.zusammen.datatypes.item.Info;
+import com.amdocs.zusammen.datatypes.item.ItemVersion;
+import com.amdocs.zusammen.datatypes.item.ItemVersionData;
+import com.amdocs.zusammen.datatypes.item.ItemVersionStatus;
+import com.amdocs.zusammen.datatypes.item.SynchronizationStatus;
+import org.mockito.ArgumentCaptor;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.openecomp.core.zusammen.api.ZusammenAdaptor;
+import org.openecomp.sdc.common.session.SessionContextProviderFactory;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.versioning.dao.types.VersionStatus;
+import org.testng.Assert;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Optional;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.eq;
+import static org.mockito.Matchers.isNull;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.verify;
+
+public class VersionZusammenDaoImplTest {
+
+  private static final String USER = "user1";
+  @Mock
+  private ZusammenAdaptor zusammenAdaptorMock;
+  @InjectMocks
+  private VersionZusammenDaoImpl versionDao;
+
+  @BeforeMethod
+  public void setUp() throws Exception {
+    MockitoAnnotations.initMocks(this);
+    SessionContextProviderFactory.getInstance().createInterface().create(USER);
+  }
+
+  @Test
+  public void testList() throws Exception {
+    String itemId = "itemId";
+    Id versionId1 = new Id("v1_id");
+    Id versionId2 = new Id("v2_id");
+    Id versionId3 = new Id("v3_id");
+
+    List<ItemVersion> zusammenVersions = Stream.of(
+        createZusammenVersion(versionId1, null, "version desc", "1.0", VersionStatus.Certified),
+        createZusammenVersion(versionId2, versionId1, "version desc", "2.0", VersionStatus.Certified
+        ),
+        createZusammenVersion(versionId3, versionId2, "version desc", "3.0", VersionStatus.Draft))
+        .collect(Collectors.toList());
+    doReturn(zusammenVersions).when(zusammenAdaptorMock)
+        .listPublicVersions(eq(createZusammenContext()), eq(new Id(itemId)));
+
+    List<Version> versions = versionDao.list(itemId);
+    Assert.assertEquals(versions.size(), 3);
+
+    int zusammenVersionIndex;
+    for (Version version : versions) {
+      zusammenVersionIndex = versionId1.getValue().equals(version.getId())
+          ? 0
+          : versionId2.getValue().equals(version.getId())
+              ? 1
+              : 2;
+      assetVersionEquals(version, zusammenVersions.get(zusammenVersionIndex));
+    }
+  }
+
+  @Test
+  public void testCreate() throws Exception {
+    testCreate(null);
+  }
+
+  @Test
+  public void testCreateBasedOn() throws Exception {
+    testCreate("baseId");
+  }
+
+  private void testCreate(String baseId) {
+    String itemId = "itemId";
+    Version version = new Version(1, 0);
+    version.setBaseId(baseId);
+    version.setName("version name");
+    version.setDescription("version description");
+    version.setStatus(VersionStatus.Draft);
+
+    doReturn(new Id("versionId")).when(zusammenAdaptorMock)
+        .createVersion(eq(createZusammenContext()), eq(new Id(itemId)),
+            baseId == null ? isNull(Id.class) : eq(new Id(baseId)), any(ItemVersionData.class));
+
+    ArgumentCaptor<ItemVersionData> capturedZusammenVersion =
+        ArgumentCaptor.forClass(ItemVersionData.class);
+
+    versionDao.create(itemId, version);
+
+    verify(zusammenAdaptorMock)
+        .createVersion(eq(createZusammenContext()), eq(new Id(itemId)),
+            baseId == null ? isNull(Id.class) : eq(new Id(baseId)),
+            capturedZusammenVersion.capture());
+
+    Info capturedInfo = capturedZusammenVersion.getValue().getInfo();
+    Assert.assertEquals(capturedInfo.getName(), version.getName());
+    Assert.assertEquals(capturedInfo.getDescription(), version.getDescription());
+    Assert.assertEquals(VersionStatus
+            .valueOf(capturedInfo.getProperty(VersionZusammenDaoImpl.ZusammenProperty.STATUS)),
+        version.getStatus());
+    Assert.assertEquals(capturedInfo.getProperty(VersionZusammenDaoImpl.ZusammenProperty.LABEL),
+        version.toString());
+  }
+
+  @Test
+  public void testUpdate() throws Exception {
+    String itemId = "itemId";
+    Version version = new Version(1, 0);
+    version.setId("versionId");
+    version.setBaseId("baseId");
+    version.setName("version name");
+    version.setDescription("version description");
+    version.setStatus(VersionStatus.Certified);
+
+    ArgumentCaptor<ItemVersionData> capturedZusammenVersion =
+        ArgumentCaptor.forClass(ItemVersionData.class);
+
+    versionDao.update(itemId, version);
+
+    verify(zusammenAdaptorMock)
+        .updateVersion(eq(createZusammenContext()), eq(new Id(itemId)), eq(new Id(version.getId())),
+            capturedZusammenVersion.capture());
+
+    Info capturedInfo = capturedZusammenVersion.getValue().getInfo();
+    Assert.assertEquals(capturedInfo.getName(), version.getName());
+    Assert.assertEquals(capturedInfo.getDescription(), version.getDescription());
+    Assert.assertEquals(VersionStatus
+            .valueOf(capturedInfo.getProperty(VersionZusammenDaoImpl.ZusammenProperty.STATUS)),
+        version.getStatus());
+    Assert.assertEquals(capturedInfo.getProperty(VersionZusammenDaoImpl.ZusammenProperty.LABEL),
+        version.toString());
+  }
+
+  @Test
+  public void testGetNonExisting() throws Exception {
+    Optional<Version> version = versionDao.get("itemId", new Version("versionId"));
+
+    Assert.assertEquals(version, Optional.empty());
+  }
+
+  @Test
+  public void testGet() throws Exception {
+    String itemId = "itemId";
+    String versionId = "versionId";
+
+    SessionContext zusammenContext = createZusammenContext();
+    Id itemIdObj = new Id(itemId);
+    Id versionIdObj = new Id(versionId);
+
+    ItemVersion zusammenPrivateVersion =
+        createZusammenVersion(versionIdObj, new Id("baseId"), "version desc  updated", "2.0",
+            VersionStatus.Draft);
+    doReturn(zusammenPrivateVersion).when(zusammenAdaptorMock)
+        .getVersion(eq(zusammenContext), eq(itemIdObj), eq(versionIdObj));
+
+    doReturn(new ItemVersionStatus(SynchronizationStatus.UP_TO_DATE, true))
+        .when(zusammenAdaptorMock)
+        .getVersionStatus(eq(zusammenContext), eq(itemIdObj), eq(versionIdObj));
+
+    ItemVersion zusammenPublicVersion =
+        createZusammenVersion(versionIdObj, new Id("baseId"), "version desc", "2.0",
+            VersionStatus.Certified);
+    doReturn(zusammenPublicVersion).when(zusammenAdaptorMock)
+        .getPublicVersion(eq(zusammenContext), eq(itemIdObj), eq(versionIdObj));
+
+    Optional<Version> version = versionDao.get(itemId, new Version(versionId));
+
+    Assert.assertTrue(version.isPresent());
+    zusammenPrivateVersion.getData().getInfo()
+        .addProperty(VersionZusammenDaoImpl.ZusammenProperty.STATUS,
+            VersionStatus.Certified.name());
+    assetVersionEquals(version.get(), zusammenPrivateVersion);
+  }
+
+  // TODO: 12/20/2017 complete tests
+ /* @Test
+  public void testDelete() throws Exception {
+
+  }
+
+  @Test
+  public void testPublish() throws Exception {
+
+  }
+
+  @Test
+  public void testSync() throws Exception {
+
+  }
+
+  @Test
+  public void testForceSync() throws Exception {
+
+  }
+
+  @Test
+  public void testRevert() throws Exception {
+
+  }
+
+  @Test
+  public void testListRevisions() throws Exception {
+
+  }*/
+
+  private void assetVersionEquals(Version version, ItemVersion zusammenVersion) {
+    Assert.assertEquals(version.getId(), zusammenVersion.getId().getValue());
+    Assert.assertEquals(version.getBaseId(),
+        zusammenVersion.getBaseId() == null ? null : zusammenVersion.getBaseId().getValue());
+    Info info = zusammenVersion.getData().getInfo();
+    Assert.assertEquals(version.getName(), info.getName());
+    Assert.assertEquals(version.getDescription(), info.getDescription());
+    Assert.assertEquals(version.getStatus(),
+        VersionStatus.valueOf(info.getProperty(VersionZusammenDaoImpl.ZusammenProperty.STATUS)));
+    String label = info.getProperty(VersionZusammenDaoImpl.ZusammenProperty.LABEL).toString();
+    Assert
+        .assertEquals(version.getMajor(), Integer.parseInt(label.substring(0, label.indexOf('.'))));
+    Assert.assertEquals(version.getMinor(),
+        Integer.parseInt(label.substring(label.indexOf('.') + 1, label.length())));
+    Assert.assertEquals(version.getCreationTime(), zusammenVersion.getCreationTime());
+    Assert.assertEquals(version.getModificationTime(), zusammenVersion.getModificationTime());
+  }
+
+  private ItemVersion createZusammenVersion(Id id, Id baseId, String description, String label,
+                                            VersionStatus status) {
+    ItemVersion version = new ItemVersion();
+    version.setId(id);
+    version.setBaseId(baseId);
+    Info info = new Info();
+    info.setName(id + "_name");
+    info.setDescription(description);
+    info.addProperty(VersionZusammenDaoImpl.ZusammenProperty.LABEL, label);
+    info.addProperty(VersionZusammenDaoImpl.ZusammenProperty.STATUS, status.name());
+    ItemVersionData data = new ItemVersionData();
+    data.setInfo(info);
+    version.setData(data);
+    version.setCreationTime(new Date());
+    version.setModificationTime(new Date());
+    return version;
+  }
+
+  private SessionContext createZusammenContext() {
+    SessionContext sessionContext = new SessionContext();
+    sessionContext.setUser(new UserInfo(USER));
+    sessionContext.setTenant("dox");
+    return sessionContext;
+  }
+
+}
\ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/test/java/org/openecomp/sdc/versioning/impl/ItemManagerImplTest.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/test/java/org/openecomp/sdc/versioning/impl/ItemManagerImplTest.java
new file mode 100644
index 0000000..755bfb4
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/test/java/org/openecomp/sdc/versioning/impl/ItemManagerImplTest.java
@@ -0,0 +1,124 @@
+package org.openecomp.sdc.versioning.impl;
+
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.openecomp.sdc.common.session.SessionContextProviderFactory;
+import org.openecomp.sdc.itempermissions.PermissionsServices;
+import org.openecomp.sdc.notification.services.SubscriptionService;
+import org.openecomp.sdc.versioning.dao.ItemDao;
+import org.openecomp.sdc.versioning.dao.types.VersionStatus;
+import org.openecomp.sdc.versioning.types.Item;
+import org.testng.Assert;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import java.util.Collection;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.verify;
+
+public class ItemManagerImplTest {
+
+  @Mock
+  private ItemDao itemDao;
+  @Mock
+  private PermissionsServices permissionsServices;
+  @Mock
+  private SubscriptionService subscriptionService;
+  @InjectMocks
+  private ItemManagerImpl itemManager;
+
+  @BeforeMethod
+  public void setUp() throws Exception {
+    MockitoAnnotations.initMocks(this);
+  }
+
+  @Test
+  public void testList() throws Exception {
+    doReturn(Stream.of(
+        createItem("item1", "A"),
+        createItem("item2", "B"),
+        createItem("item3", "B"),
+        createItem("item4", "A"))
+        .collect(Collectors.toList())).when(itemDao).list();
+
+    Collection<Item> items = itemManager.list(item -> "B".equals(item.getType()));
+    Assert.assertEquals(items.size(), 2);
+    Assert.assertTrue(items.stream().anyMatch(item -> "item2".equals(item.getName())));
+    Assert.assertTrue(items.stream().anyMatch(item -> "item3".equals(item.getName())));
+  }
+
+  @Test
+  public void testGetNotExisting() throws Exception {
+    Item item = itemManager.get("item1");
+    Assert.assertNull(item);
+  }
+
+  @Test
+  public void testGet() throws Exception {
+    Item toBeReturned = new Item();
+    toBeReturned.setId("itemId");
+    doReturn(toBeReturned).when(itemDao).get(any(Item.class));
+
+    Item item = itemManager.get("itemId");
+    Assert.assertEquals(item.getId(), "itemId");
+  }
+
+  @Test
+  public void testCreate() throws Exception {
+    SessionContextProviderFactory.getInstance().createInterface().create("user1");
+
+    Item toBeReturned = new Item();
+    toBeReturned.setId("itemId");
+    doReturn(toBeReturned).when(itemDao).create(any(Item.class));
+
+    Item item = itemManager.create(createItem("item1", "A"));
+    Assert.assertEquals(item.getId(), "itemId");
+  }
+
+  @Test
+  public void testUpdateNotExistingVersionStatus() throws Exception {
+    itemManager.updateVersionStatus("itemId", VersionStatus.Certified, VersionStatus.Draft);
+    verify(itemDao, never()).update(any(Item.class));
+  }
+
+  @Test
+  public void testUpdateVersionStatusWhenNone() throws Exception {
+    Item item = new Item();
+    item.setId("itemId");
+    doReturn(item).when(itemDao).get(any(Item.class));
+
+    itemManager.updateVersionStatus("itemId", VersionStatus.Certified, VersionStatus.Draft);
+    verify(itemDao).update(item);
+    Assert.assertEquals(item.getVersionStatusCounters().get(VersionStatus.Certified).intValue(), 1);
+    Assert.assertNull(item.getVersionStatusCounters().get(VersionStatus.Draft));
+  }
+
+  @Test
+  public void testUpdateVersionStatus() throws Exception {
+    Item item = new Item();
+    item.setId("itemId");
+    item.getVersionStatusCounters().put(VersionStatus.Certified, 2);
+    item.getVersionStatusCounters().put(VersionStatus.Draft, 5);
+    doReturn(item).when(itemDao).get(any(Item.class));
+
+    itemManager.updateVersionStatus("itemId", VersionStatus.Certified, VersionStatus.Draft);
+    verify(itemDao).update(item);
+    Assert.assertEquals(item.getVersionStatusCounters().get(VersionStatus.Certified).intValue(), 3);
+    Assert.assertEquals(item.getVersionStatusCounters().get(VersionStatus.Draft).intValue(), 4);
+  }
+
+  private Item createItem(String name, String type) {
+    Item item = new Item();
+    item.setId(name);
+    item.setName(name);
+    item.setType(type);
+    return item;
+  }
+
+}
\ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/test/java/org/openecomp/sdc/versioning/impl/VersioningManagerImplTest.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/test/java/org/openecomp/sdc/versioning/impl/VersioningManagerImplTest.java
index d35de4f..2d1109a 100644
--- a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/test/java/org/openecomp/sdc/versioning/impl/VersioningManagerImplTest.java
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/test/java/org/openecomp/sdc/versioning/impl/VersioningManagerImplTest.java
@@ -21,39 +21,326 @@
 package org.openecomp.sdc.versioning.impl;
 
 
-import static org.mockito.Matchers.anyObject;
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.verify;
-
 import org.mockito.ArgumentCaptor;
-import org.mockito.Captor;
 import org.mockito.InjectMocks;
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
 import org.openecomp.sdc.common.errors.CoreException;
-import org.openecomp.sdc.versioning.dao.VersionInfoDao;
-import org.openecomp.sdc.versioning.dao.VersionInfoDeletedDao;
-import org.openecomp.sdc.versioning.dao.types.UserCandidateVersion;
+import org.openecomp.sdc.versioning.ItemManager;
+import org.openecomp.sdc.versioning.VersionCalculator;
+import org.openecomp.sdc.versioning.dao.VersionDao;
+import org.openecomp.sdc.versioning.dao.types.Revision;
+import org.openecomp.sdc.versioning.dao.types.SynchronizationState;
 import org.openecomp.sdc.versioning.dao.types.Version;
-import org.openecomp.sdc.versioning.dao.types.VersionInfoDeletedEntity;
-import org.openecomp.sdc.versioning.dao.types.VersionInfoEntity;
+import org.openecomp.sdc.versioning.dao.types.VersionState;
 import org.openecomp.sdc.versioning.dao.types.VersionStatus;
-import org.openecomp.sdc.versioning.types.VersionInfo;
-import org.openecomp.sdc.versioning.types.VersionableEntityAction;
+import org.openecomp.sdc.versioning.types.VersionCreationMethod;
 import org.testng.Assert;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Set;
+import java.util.List;
+import java.util.Optional;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.anyString;
+import static org.mockito.Matchers.eq;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.doThrow;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.openecomp.sdc.versioning.dao.types.SynchronizationState.OutOfSync;
+import static org.openecomp.sdc.versioning.dao.types.SynchronizationState.UpToDate;
+import static org.openecomp.sdc.versioning.dao.types.VersionStatus.Certified;
+import static org.openecomp.sdc.versioning.dao.types.VersionStatus.Draft;
 
 public class VersioningManagerImplTest {
+  @Mock
+  private VersionDao versionDaoMock;
+  @Mock
+  private VersionCalculator versionCalculatorMock;
+  @Mock
+  private ItemManager itemManagerMock;
+  @InjectMocks
+  private VersioningManagerImpl versioningManager;
+
+  @BeforeMethod
+  public void setUp() throws Exception {
+    MockitoAnnotations.initMocks(this);
+  }
+
+  @Test
+  public void testList() throws Exception {
+    String itemId = "itemId";
+
+    List<Version> returnedVersions = Stream.of(createVersion("1", null, null, false),
+        createVersion("2", null, null, false),
+        createVersion("3", null, null, false)).collect(Collectors.toList());
+    doReturn(returnedVersions).when(versionDaoMock).list(itemId);
+
+    List<Version> versions = versioningManager.list(itemId);
+    Assert.assertEquals(versions, returnedVersions);
+  }
+
+  @Test(expectedExceptions = Exception.class)
+  public void testGetNonExisting() throws Exception {
+    String itemId = "itemId";
+    String versionId = "versionId";
+    Version version = new Version(versionId);
+
+    doReturn(Optional.empty()).when(versionDaoMock).get(itemId, version);
+    doThrow(new Exception()).when(versionDaoMock).sync(itemId, version);
+
+    versioningManager.get(itemId, version);
+  }
+
+  @Test
+  public void testGetNonExistingForUser() throws Exception {
+    String itemId = "itemId";
+    String versionId = "versionId";
+    Version requestedVersion = new Version(versionId);
+
+    Version returnedVersion = createVersion(versionId, Draft, UpToDate, false);
+    doReturn(Optional.empty()).doReturn(Optional.of(returnedVersion))
+        .when(versionDaoMock).get(itemId, requestedVersion);
+
+    Version version = versioningManager.get(itemId, requestedVersion);
+    Assert.assertEquals(version, returnedVersion);
+
+    verify(versionDaoMock, times(2)).get(itemId, requestedVersion);
+    verify(versionDaoMock).sync(itemId, requestedVersion);
+  }
+
+  @Test
+  public void testGetOutOfSyncCertified() throws Exception {
+    String itemId = "itemId";
+    String versionId = "versionId";
+    Version requestedVersion = new Version(versionId);
+
+    Version returnedVersion = createVersion(versionId, Certified, UpToDate, false);
+    doReturn(Optional.of(createVersion(versionId, Certified, OutOfSync, false)))
+        .doReturn(Optional.of(returnedVersion))
+        .when(versionDaoMock).get(itemId, requestedVersion);
+
+    Version version = versioningManager.get(itemId, requestedVersion);
+    Assert.assertEquals(version, returnedVersion);
+
+    verify(versionDaoMock, times(2)).get(itemId, requestedVersion);
+    verify(versionDaoMock).forceSync(itemId, requestedVersion);
+  }
+
+  @Test
+  public void testGet() throws Exception {
+    String itemId = "itemId";
+    String versionId = "versionId";
+    Version requestedVersion = new Version(versionId);
+
+    Version returnedVersion = createVersion(versionId, Draft, OutOfSync, true);
+    doReturn(Optional.of(returnedVersion)).when(versionDaoMock).get(itemId, requestedVersion);
+
+    Version version = versioningManager.get(itemId, requestedVersion);
+    Assert.assertEquals(version, returnedVersion);
+
+    verify(versionDaoMock).get(itemId, requestedVersion);
+    verify(versionDaoMock, never()).sync(any(), any());
+    verify(versionDaoMock, never()).forceSync(any(), any());
+  }
+
+  @Test
+  public void testCreate() throws Exception {
+    String itemId = "itemId";
+    Version requestedVersion = new Version();
+
+    String versionName = "versionName";
+    doReturn(versionName).when(versionCalculatorMock).calculate(null, VersionCreationMethod.major);
+
+    doReturn(Stream.of(createVersion("1", null, null, false),
+        createVersion("2", null, null, false),
+        createVersion("3", null, null, false)).collect(Collectors.toList()))
+        .when(versionDaoMock).list(itemId);
+
+    Version version =
+        versioningManager.create(itemId, requestedVersion, VersionCreationMethod.major);
+    Assert.assertNotNull(version);
+    Assert.assertEquals(version.getName(), versionName);
+
+    verify(versionDaoMock).create(itemId, requestedVersion);
+    verify(itemManagerMock).updateVersionStatus(itemId, Draft, null);
+    verify(versionDaoMock).publish(eq(itemId), eq(requestedVersion), anyString());
+  }
+
+  @Test
+  public void testCreateBasedOn() throws Exception {
+    String itemId = "itemId";
+    Version requestedVersion = new Version();
+    requestedVersion.setBaseId("baseVersionId");
+
+    Version baseVersion = createVersion(requestedVersion.getBaseId(), Certified, UpToDate, false);
+    // TODO: 12/13/2017 fix to eq(new Version("baseVersionId")) when version.equals will be fixed
+    doReturn(Optional.of(baseVersion)).when(versionDaoMock).get(eq(itemId), any(Version.class));
+
+    String versionName = "4.0";
+    doReturn(versionName)
+        .when(versionCalculatorMock).calculate(baseVersion.getName(), VersionCreationMethod.major);
+
+    doReturn(Stream.of(createVersion("1", null, null, false),
+        createVersion("2", null, null, false),
+        createVersion("3", null, null, false)).collect(Collectors.toList()))
+        .when(versionDaoMock).list(itemId);
+
+    Version version =
+        versioningManager.create(itemId, requestedVersion, VersionCreationMethod.major);
+    Assert.assertNotNull(version);
+    Assert.assertEquals(version.getName(), versionName);
+
+    verify(versionDaoMock).create(itemId, requestedVersion);
+    verify(itemManagerMock).updateVersionStatus(itemId, Draft, null);
+    verify(versionDaoMock).publish(eq(itemId), eq(requestedVersion), anyString());
+  }
+
+  @Test(expectedExceptions = CoreException.class, expectedExceptionsMessageRegExp =
+      "Item itemId: create version failed, a version with the name 2.0 already exist")
+  public void testCreateWithExistingName() throws Exception {
+    String itemId = "itemId";
+    Version version = new Version();
+    version.setBaseId("baseVersionId");
+
+    Version baseVersion = createVersion(version.getBaseId(), Certified, UpToDate, false);
+    // TODO: 12/13/2017 fix to eq(new Version("baseVersionId")) when version.equals will be fixed
+    doReturn(Optional.of(baseVersion)).when(versionDaoMock).get(eq(itemId), any(Version.class));
+
+    String versionName = "2.0";
+    doReturn(versionName)
+        .when(versionCalculatorMock).calculate(baseVersion.getName(), VersionCreationMethod.major);
+
+    doReturn(Stream.of(createVersion("1", null, null, false),
+        createVersion("2", null, null, false),
+        createVersion("3", null, null, false)).collect(Collectors.toList()))
+        .when(versionDaoMock).list(itemId);
+
+    versioningManager.create(itemId, version, VersionCreationMethod.major);
+  }
+
+  @Test(expectedExceptions = CoreException.class, expectedExceptionsMessageRegExp =
+      "Item itemId: submit version failed, version versionId is already Certified")
+  public void testSubmitCertified() throws Exception {
+    String itemId = "itemId";
+    String versionId = "versionId";
+    Version version = new Version(versionId);
+
+    Version returnedVersion = createVersion(versionId, Certified, UpToDate, false);
+    doReturn(Optional.of(returnedVersion)).when(versionDaoMock).get(itemId, version);
+
+    versioningManager.submit(itemId, version, "Submit message");
+  }
+
+  @Test
+  public void testSubmit() throws Exception {
+    String itemId = "itemId";
+    String versionId = "versionId";
+    Version version = new Version(versionId);
+
+    ArgumentCaptor<Version> versionArgumentCaptor = ArgumentCaptor.forClass(Version.class);
+
+    Version returnedVersion = createVersion(versionId, Draft, UpToDate, false);
+    doReturn(Optional.of(returnedVersion)).when(versionDaoMock).get(itemId, version);
+
+    String submitDescription = "Submit message";
+    versioningManager.submit(itemId, version, submitDescription);
+
+    verify(versionDaoMock).update(eq(itemId), versionArgumentCaptor.capture());
+    Assert.assertEquals(Certified, versionArgumentCaptor.getValue().getStatus());
+    verify(versionDaoMock).publish(itemId, version, submitDescription);
+    verify(itemManagerMock).updateVersionStatus(itemId, Certified, Draft);
+  }
+
+  @Test
+  public void testPublish() throws Exception {
+    String itemId = "itemId";
+    String versionId = "versionId";
+    Version version = new Version(versionId);
+    String publishDescription = "Publish message";
+
+    versioningManager.publish(itemId, version, publishDescription);
+
+    verify(versionDaoMock).publish(itemId, version, publishDescription);
+  }
+
+  @Test
+  public void testSync() throws Exception {
+    String itemId = "itemId";
+    String versionId = "versionId";
+    Version version = new Version(versionId);
+
+    versioningManager.sync(itemId, version);
+
+    verify(versionDaoMock).sync(itemId, version);
+  }
+
+  @Test
+  public void testForceSync() throws Exception {
+    String itemId = "itemId";
+    String versionId = "versionId";
+    Version version = new Version(versionId);
+
+    versioningManager.forceSync(itemId, version);
+
+    verify(versionDaoMock).forceSync(itemId, version);
+  }
+
+  @Test
+  public void testRevert() throws Exception {
+    String itemId = "itemId";
+    String versionId = "versionId";
+    Version version = new Version(versionId);
+    String revisionId = "revisionId";
+
+    versioningManager.revert(itemId, version, revisionId);
+
+    verify(versionDaoMock).revert(itemId, version, revisionId);
+  }
+
+  @Test
+  public void testListRevisions() throws Exception {
+    String itemId = "itemId";
+    String versionId = "versionId";
+    Version version = new Version(versionId);
+
+    List<Revision> returnedRevisions =
+        Stream.of(new Revision(), new Revision()).collect(Collectors.toList());
+    doReturn(returnedRevisions)
+        .when(versionDaoMock).listRevisions(itemId, version);
+
+    List<Revision> revisions = versioningManager.listRevisions(itemId, version);
+    Assert.assertEquals(revisions, returnedRevisions);
+  }
+
+  private Version createVersion(String id, VersionStatus status,
+                                SynchronizationState syncState, boolean dirty) {
+    Version version = new Version(id);
+    version.setName(id + ".0");
+    version.setDescription(id + " desc");
+    version.setStatus(status);
+
+    VersionState state = new VersionState();
+    state.setSynchronizationState(syncState);
+    state.setDirty(dirty);
+    version.setState(state);
+    return version;
+  }
+
+/*
   private static final String USR1 = "usr1";
   private static final String USR2 = "usr2";
   private static final String TYPE1 = "Type1";
-/*  private static final String TYPE2 = "Type2";*/
+*/
+/*  private static final String TYPE2 = "Type2";*//*
+
   private static final String ID1 = "Id1";
+*/
 /*  private static final String ID2 = "Id2";
   private static final String ID3 = "Id3";
   private static final String TYPE1_TABLE_NAME = "vendor_license_model";
@@ -61,17 +348,20 @@
   private static final String TYPE1_VERSION_NAME = "version";
   private static final String TYPE2_TABLE_NAME = "feature_group";
   private static final String TYPE2_ID_NAME = "vlm_id";
-  private static final String TYPE2_VERSION_NAME = "version";*/
+  private static final String TYPE2_VERSION_NAME = "version";*//*
+
   private static final Version VERSION0 = new Version(0, 0);
   private static final Version VERSION01 = new Version(0, 1);
   private static final Version VERSION02 = new Version(0, 2);
   private static final Version VERSION10 = new Version(1, 0);
   private static final Version VERSION11 = new Version(1, 1);
 
-  /*  private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface();
+  */
+/*  private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface();
 
     private static UDTMapper<Version> versionMapper =
-        noSqlDb.getMappingManager().udtMapper(Version.class);*/
+        noSqlDb.getMappingManager().udtMapper(Version.class);*//*
+
   @Mock
   private VersionInfoDao versionInfoDaoMock;
   @Mock
@@ -87,7 +377,8 @@
     MockitoAnnotations.initMocks(this);
   }
 
-  /*  @BeforeClass
+  */
+/*  @BeforeClass
     private void init() {
       versionInfoDaoMock.delete(new VersionInfoEntity(TYPE1, ID1));
       versionInfoDaoMock.delete(new VersionInfoEntity(TYPE1, ID2));
@@ -103,8 +394,10 @@
           new VersionableEntityMetadata(TYPE1_TABLE_NAME, TYPE1_ID_NAME, TYPE1_VERSION_NAME));
       versioningManager.register(TYPE2,
           new VersionableEntityMetadata(TYPE2_TABLE_NAME, TYPE2_ID_NAME, TYPE2_VERSION_NAME));
-    }*/
+    }*//*
 
+
+*/
 /*  @Test
   public void testRegister() throws Exception {
     VersionableEntityMetadata entityMetadata =
@@ -116,7 +409,8 @@
     Set<VersionableEntityMetadata> type1Entities = versionableEntities.get(TYPE1);
     Assert.assertNotNull(type1Entities);
     Assert.assertTrue(type1Entities.contains(entityMetadata));
-  }*/
+  }*//*
+
 
   @Test(expectedExceptions = CoreException.class)
   public void testCreateAlreadyExisting() {
@@ -129,8 +423,10 @@
     Version version = versioningManager.create(TYPE1, ID1, USR1);
     Assert.assertEquals(version, VERSION01);
 
+*/
 /*    createVersionableEntityRecord(TYPE1_TABLE_NAME, TYPE1_ID_NAME, TYPE1_VERSION_NAME, ID1,
-        version);*/
+        version);*//*
+
     verify(versionInfoDaoMock).create(versionInfoEntityArg.capture());
     VersionInfoEntity versionInfoEntity = versionInfoEntityArg.getValue();
     assretVersionInfoEntity(versionInfoEntity, TYPE1, ID1, new Version(0, 0), VERSION01, USR1,
@@ -152,7 +448,7 @@
   @Test
   public void testDelete() {
     VersionInfoEntity versionInfoEntity = new VersionInfoEntity();
-    versionInfoEntity.setStatus(VersionStatus.Available);
+    versionInfoEntity.setStatus(VersionStatus.Draft);
     doReturn(versionInfoEntity).when(versionInfoDaoMock).get(anyObject());
 
     versioningManager.delete(TYPE1, ID1, USR1);
@@ -171,13 +467,14 @@
   @Test
   public void testUndoDelete() {
     VersionInfoDeletedEntity versionInfoDeletedEntity = new VersionInfoDeletedEntity();
-    versionInfoDeletedEntity.setStatus(VersionStatus.Available);
+    versionInfoDeletedEntity.setStatus(VersionStatus.Draft);
     doReturn(versionInfoDeletedEntity).when(versionInfoDeletedDaoMock).get(anyObject());
 
     versioningManager.undoDelete(TYPE1, ID1, USR1);
 
     verify(versionInfoDeletedDaoMock).delete(versionInfoDeletedEntity);
     verify(versionInfoDaoMock).create(versionInfoEntityArg.capture());
+*/
 /*
     VersionInfoDeletedEntity versionInfoDeletedEntity =
         versionInfoDeletedDaoMock.get(new VersionInfoDeletedEntity(TYPE1, ID1));
@@ -190,7 +487,8 @@
     Assert.assertNull(versionInfoEntity);
     versioningManager.undoDelete(TYPE1, ID1, USR1);
     versionInfoEntity = versionInfoDaoMock.get(new VersionInfoEntity(TYPE1, ID1));
-    Assert.assertNotNull(versionInfoEntity);*/
+    Assert.assertNotNull(versionInfoEntity);*//*
+
   }
 
   @Test(expectedExceptions = CoreException.class)
@@ -216,7 +514,7 @@
   public void testCheckoutOnFinalized() {
     Set<Version> viewableVersions = new HashSet<>();
     viewableVersions.add(VERSION10);
-    mockVersionInfoEntity(TYPE1, ID1, VersionStatus.Final, VERSION10, null, viewableVersions,
+    mockVersionInfoEntity(TYPE1, ID1, VersionStatus.Certified, VERSION10, null, viewableVersions,
         VERSION10);
 
     Version version = versioningManager.checkout(TYPE1, ID1, USR1);
@@ -225,18 +523,20 @@
     VersionInfoEntity versionInfoEntity = versionInfoDaoMock.get(new VersionInfoEntity(TYPE1, ID1));
     assretVersionInfoEntity(versionInfoEntity, TYPE1, ID1, VERSION10, VERSION11, USR1,
         VersionStatus.Locked, viewableVersions, VERSION10);
+*/
 /*
     ResultSet results =
         loadVersionableEntityRecord(TYPE1_TABLE_NAME, TYPE1_ID_NAME, TYPE1_VERSION_NAME, ID1,
             VERSION11);
-    Assert.assertTrue(results.iterator().hasNext());*/
+    Assert.assertTrue(results.iterator().hasNext());*//*
+
   }
 
   @Test
   public void testCheckout() {
     Set<Version> viewableVersions = new HashSet<>();
     viewableVersions.add(VERSION01);
-    mockVersionInfoEntity(TYPE1, ID1, VersionStatus.Available, VERSION01, null, viewableVersions,
+    mockVersionInfoEntity(TYPE1, ID1, VersionStatus.Draft, VERSION01, null, viewableVersions,
         null);
 
     Version version = versioningManager.checkout(TYPE1, ID1, USR1);
@@ -248,10 +548,12 @@
     assretVersionInfoEntity(versionInfoEntity, TYPE1, ID1, VERSION01, VERSION02, USR1,
         VersionStatus.Locked, viewableVersions, null);
 
+*/
 /*    ResultSet results =
         loadVersionableEntityRecord(TYPE1_TABLE_NAME, TYPE1_ID_NAME, TYPE1_VERSION_NAME, ID1,
             VERSION02);
-    Assert.assertTrue(results.iterator().hasNext());*/
+    Assert.assertTrue(results.iterator().hasNext());*//*
+
   }
 
   @Test(expectedExceptions = CoreException.class)
@@ -263,7 +565,7 @@
   public void testUndoCheckoutOnAvailable() {
     Set<Version> viewableVersions = new HashSet<>();
     viewableVersions.add(VERSION01);
-    mockVersionInfoEntity(TYPE1, ID1, VersionStatus.Available, VERSION01, null, viewableVersions,
+    mockVersionInfoEntity(TYPE1, ID1, VersionStatus.Draft, VERSION01, null, viewableVersions,
         null);
 
     versioningManager.undoCheckout(TYPE1, ID1, USR1);
@@ -273,7 +575,7 @@
   public void testUndoCheckouOnFinalized() {
     Set<Version> viewableVersions = new HashSet<>();
     viewableVersions.add(VERSION10);
-    mockVersionInfoEntity(TYPE1, ID1, VersionStatus.Final, VERSION10, null, viewableVersions,
+    mockVersionInfoEntity(TYPE1, ID1, VersionStatus.Certified, VERSION10, null, viewableVersions,
         VERSION10);
     versioningManager.undoCheckout(TYPE1, ID1, USR2);
   }
@@ -298,12 +600,14 @@
 
     VersionInfoEntity versionInfoEntity = versionInfoDaoMock.get(new VersionInfoEntity(TYPE1, ID1));
     assretVersionInfoEntity(versionInfoEntity, TYPE1, ID1, VERSION01, null, null,
-        VersionStatus.Available, viewableVersions, null);
+        VersionStatus.Draft, viewableVersions, null);
 
+*/
 /*    ResultSet results =
         loadVersionableEntityRecord(TYPE1_TABLE_NAME, TYPE1_ID_NAME, TYPE1_VERSION_NAME, ID1,
             VERSION02);
-    Assert.assertFalse(results.iterator().hasNext());*/
+    Assert.assertFalse(results.iterator().hasNext());*//*
+
   }
 
   @Test(expectedExceptions = CoreException.class)
@@ -315,7 +619,7 @@
   public void testCheckinOnAvailable() {
     Set<Version> viewableVersions = new HashSet<>();
     viewableVersions.add(VERSION01);
-    mockVersionInfoEntity(TYPE1, ID1, VersionStatus.Available, VERSION01, null, viewableVersions,
+    mockVersionInfoEntity(TYPE1, ID1, VersionStatus.Draft, VERSION01, null, viewableVersions,
         null);
 
     versioningManager.checkin(TYPE1, ID1, USR1, "fail checkin");
@@ -326,7 +630,7 @@
   public void testCheckinOnFinalized() {
     Set<Version> viewableVersions = new HashSet<>();
     viewableVersions.add(VERSION10);
-    mockVersionInfoEntity(TYPE1, ID1, VersionStatus.Final, VERSION10, null, viewableVersions,
+    mockVersionInfoEntity(TYPE1, ID1, VersionStatus.Certified, VERSION10, null, viewableVersions,
         VERSION10);
 
     versioningManager.checkin(TYPE1, ID1, USR1, "failed checkin");
@@ -354,7 +658,7 @@
 
     viewableVersions.add(VERSION01);
     assretVersionInfoEntity(versionInfoEntity, TYPE1, ID1, VERSION01, null, null,
-        VersionStatus.Available, viewableVersions, null);
+        VersionStatus.Draft, viewableVersions, null);
   }
 
   @Test(expectedExceptions = CoreException.class)
@@ -374,7 +678,7 @@
   public void testSubmitOnFinalized() {
     Set<Version> viewableVersions = new HashSet<>();
     viewableVersions.add(VERSION10);
-    mockVersionInfoEntity(TYPE1, ID1, VersionStatus.Final, VERSION10, null, viewableVersions,
+    mockVersionInfoEntity(TYPE1, ID1, VersionStatus.Certified, VERSION10, null, viewableVersions,
         VERSION10);
     versioningManager.submit(TYPE1, ID1, USR2, "failed submit");
   }
@@ -390,7 +694,7 @@
     viewableVersions.add(new Version(3, 0));
     viewableVersions.add(new Version(3, 1));
     viewableVersions.add(version32);
-    mockVersionInfoEntity(TYPE1, ID1, VersionStatus.Available, version32, null, viewableVersions,
+    mockVersionInfoEntity(TYPE1, ID1, VersionStatus.Draft, version32, null, viewableVersions,
         new Version(3, 0));
 
     Version version = versioningManager.submit(TYPE1, ID1, USR1, "submit msg");
@@ -403,12 +707,14 @@
     VersionInfoEntity versionInfoEntity = versionInfoEntityArg.getValue();
 
     assretVersionInfoEntity(versionInfoEntity, TYPE1, ID1, version40, null, null,
-        VersionStatus.Final, viewableVersions, version40);
+        VersionStatus.Certified, viewableVersions, version40);
 
+*/
 /*    ResultSet results =
         loadVersionableEntityRecord(TYPE1_TABLE_NAME, TYPE1_ID_NAME, TYPE1_VERSION_NAME, ID1,
             VERSION10);
-    Assert.assertTrue(results.iterator().hasNext());*/
+    Assert.assertTrue(results.iterator().hasNext());*//*
+
   }
 
   @Test(expectedExceptions = CoreException.class)
@@ -420,12 +726,12 @@
   public void testGetVersionInfoForReadOnAvailable() {
     Set<Version> viewableVersions = new HashSet<>();
     viewableVersions.add(VERSION01);
-    mockVersionInfoEntity(TYPE1, ID1, VersionStatus.Available, VERSION01, null, viewableVersions,
+    mockVersionInfoEntity(TYPE1, ID1, VersionStatus.Draft, VERSION01, null, viewableVersions,
         null);
 
     VersionInfo versionInfo =
         versioningManager.getEntityVersionInfo(TYPE1, ID1, USR1, VersionableEntityAction.Read);
-    assertVersionInfo(versionInfo, VERSION01, VersionStatus.Available, null,
+    assertVersionInfo(versionInfo, VERSION01, VersionStatus.Draft, null,
         viewableVersions, null);
   }
 
@@ -433,7 +739,7 @@
   public void testGetVersionInfoForWriteOnAvailable() {
     Set<Version> viewableVersions = new HashSet<>();
     viewableVersions.add(VERSION01);
-    mockVersionInfoEntity(TYPE1, ID1, VersionStatus.Available, VERSION01, null, viewableVersions,
+    mockVersionInfoEntity(TYPE1, ID1, VersionStatus.Draft, VERSION01, null, viewableVersions,
         null);
 
     versioningManager.getEntityVersionInfo(TYPE1, ID1, USR1, VersionableEntityAction.Write);
@@ -488,6 +794,7 @@
     assertVersionInfo(versionInfo, VERSION02, VersionStatus.Locked, USR1, viewableVersions, null);
   }
 
+*/
 /*  private void createVersionableEntityRecord(String tableName, String idName, String versionName,
                                              String id, Version version) {
     noSqlDb.execute(
@@ -500,7 +807,8 @@
     return noSqlDb.execute(
         String.format("select * from %s where %s=? and %s=?", tableName, idName, versionName), id,
         versionMapper.toUDT(version));
-  }*/
+  }*//*
+
 
 
   private static void assretVersionInfoEntity(VersionInfoEntity actual, String entityType,
@@ -553,4 +861,5 @@
     doReturn(mock).when(versionInfoDaoMock).get(anyObject());
     return mock;
   }
+*/
 }
diff --git a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/errors/CreateToscaObjectErrorBuilder.java b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/errors/CreateToscaObjectErrorBuilder.java
index f9a3da2..daeb570 100644
--- a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/errors/CreateToscaObjectErrorBuilder.java
+++ b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/errors/CreateToscaObjectErrorBuilder.java
@@ -5,15 +5,14 @@
 
 public class CreateToscaObjectErrorBuilder extends BaseErrorBuilder {
   private static final String CANT_CREATE_OBJECT_FROM_CLASS =
-      "Can't create %s from %s. Reason - %s";
+      "Can't create %s from %s.";
   private static final String IMPORT_TOSCA = "IMPORT_TOSCA";
 
   public CreateToscaObjectErrorBuilder(String className,
-                                       String objectId,
-                                       String reason) {
+                                       String objectId) {
     getErrorCodeBuilder()
         .withId(IMPORT_TOSCA)
         .withCategory(ErrorCategory.APPLICATION)
-        .withMessage(String.format(CANT_CREATE_OBJECT_FROM_CLASS, className, objectId, reason));
+        .withMessage(String.format(CANT_CREATE_OBJECT_FROM_CLASS, className, objectId));
   }
 }
diff --git a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/main/java/org/openecomp/core/impl/ToscaConverterImpl.java b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/main/java/org/openecomp/core/impl/ToscaConverterImpl.java
index e7ff3aa..39a53b4 100644
--- a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/main/java/org/openecomp/core/impl/ToscaConverterImpl.java
+++ b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/main/java/org/openecomp/core/impl/ToscaConverterImpl.java
@@ -12,7 +12,17 @@
 import org.openecomp.sdc.common.errors.ErrorCategory;
 import org.openecomp.sdc.common.errors.ErrorCode;
 import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel;
-import org.openecomp.sdc.tosca.datatypes.model.*;
+import org.openecomp.sdc.tosca.datatypes.model.ArtifactDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.CapabilityAssignment;
+import org.openecomp.sdc.tosca.datatypes.model.Import;
+import org.openecomp.sdc.tosca.datatypes.model.InterfaceDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.NodeFilter;
+import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate;
+import org.openecomp.sdc.tosca.datatypes.model.NodeType;
+import org.openecomp.sdc.tosca.datatypes.model.ParameterDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.RequirementAssignment;
+import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
+import org.openecomp.sdc.tosca.datatypes.model.SubstitutionMapping;
 import org.openecomp.sdc.tosca.services.DataModelUtil;
 import org.openecomp.sdc.tosca.services.ToscaUtil;
 import org.openecomp.sdc.translator.services.heattotosca.globaltypes.GlobalTypesGenerator;
@@ -21,11 +31,28 @@
 import java.io.ByteArrayInputStream;
 import java.io.File;
 import java.io.IOException;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
 import java.util.jar.Manifest;
 import java.util.regex.Pattern;
 
-import static org.openecomp.core.converter.datatypes.Constants.*;
+import static org.openecomp.core.converter.datatypes.Constants.capabilities;
+import static org.openecomp.core.converter.datatypes.Constants.definitionsDir;
+import static org.openecomp.core.converter.datatypes.Constants.globalStName;
+import static org.openecomp.core.converter.datatypes.Constants.globalSubstitution;
+import static org.openecomp.core.converter.datatypes.Constants.inputs;
+import static org.openecomp.core.converter.datatypes.Constants.mainStName;
+import static org.openecomp.core.converter.datatypes.Constants.manifestFileName;
+import static org.openecomp.core.converter.datatypes.Constants.metadataFile;
+import static org.openecomp.core.converter.datatypes.Constants.nodeType;
+import static org.openecomp.core.converter.datatypes.Constants.openecompHeatIndex;
+import static org.openecomp.core.converter.datatypes.Constants.outputs;
+import static org.openecomp.core.converter.datatypes.Constants.requirements;
 import static org.openecomp.core.impl.GlobalSubstitutionServiceTemplate.GLOBAL_SUBSTITUTION_SERVICE_FILE_NAME;
 
 public class ToscaConverterImpl implements ToscaConverter {
@@ -89,9 +116,8 @@
             }
         } catch (YAMLException ye) {
             throw new CoreException(new ErrorCode.ErrorCodeBuilder()
-                .withMessage("Invalid YAML content in file " + key + ". reason - "
-                    + ye.getMessage())
-                .withCategory(ErrorCategory.APPLICATION).build());
+                .withMessage("Invalid YAML content in file " + key)
+                .withCategory(ErrorCategory.APPLICATION).build(), ye);
         }
     }
 
@@ -181,9 +207,8 @@
 
         } catch (YAMLException ye) {
             throw new CoreException(new ErrorCode.ErrorCodeBuilder()
-                .withMessage("Invalid YAML content in file" + serviceTemplateName + ". reason - "
-                    + ye.getMessage())
-                .withCategory(ErrorCategory.APPLICATION).build());
+                .withMessage("Invalid YAML content in file" + serviceTemplateName)
+                .withCategory(ErrorCategory.APPLICATION).build(), ye);
         }
 
 
diff --git a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/main/java/org/openecomp/core/impl/ToscaConverterManagerImpl.java b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/main/java/org/openecomp/core/impl/ToscaConverterManagerImpl.java
index 520e418..4917533 100644
--- a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/main/java/org/openecomp/core/impl/ToscaConverterManagerImpl.java
+++ b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/main/java/org/openecomp/core/impl/ToscaConverterManagerImpl.java
@@ -5,6 +5,8 @@
 import org.openecomp.core.utilities.file.FileContentHandler;
 import org.openecomp.core.utilities.file.FileUtils;
 import org.openecomp.core.utilities.json.JsonUtil;
+import org.openecomp.sdc.logging.api.Logger;
+import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel;
 
 import java.lang.reflect.Constructor;
@@ -14,8 +16,10 @@
 
 public class ToscaConverterManagerImpl implements ToscaConverterManager {
 
+  private static final Logger LOGGER = LoggerFactory.getLogger(ToscaConverterManagerImpl.class.getName());
   private static List<ToscaConverter> toscaConverters;
   private static final String toscaConverterFileName = "ToscaConverters.json";
+  private static final String TOSCA_CONVERTER_IMPL_FORMAT_ERROR = "Failed to construct TOSCA converter for '%s' implementation.";
 
   static {
     toscaConverters = getConvertersList();
@@ -40,7 +44,8 @@
         Class<?> clazz = Class.forName(implClassName);
         Constructor<?> constructor = clazz.getConstructor();
         toscaConvertersList.add((ToscaConverter) constructor.newInstance());
-      }catch (Exception e){
+      }catch (Exception ex){
+        LOGGER.debug(String.format(TOSCA_CONVERTER_IMPL_FORMAT_ERROR, implClassName), ex);
         continue;
       }
     }
diff --git a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/main/java/org/openecomp/core/impl/ToscaConverterUtil.java b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/main/java/org/openecomp/core/impl/ToscaConverterUtil.java
index 20ac641..d34d467 100644
--- a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/main/java/org/openecomp/core/impl/ToscaConverterUtil.java
+++ b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/main/java/org/openecomp/core/impl/ToscaConverterUtil.java
@@ -4,6 +4,8 @@
 import org.apache.commons.lang.StringUtils;
 import org.openecomp.core.converter.errors.CreateToscaObjectErrorBuilder;
 import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.logging.api.Logger;
+import org.openecomp.sdc.logging.api.LoggerFactory;
 
 import java.lang.reflect.Field;
 import java.util.HashSet;
@@ -20,6 +22,8 @@
   private static final String DEFAULT_CAPITAL = "Default";
   private static Set<String> defaultValueKeys;
 
+  private static Logger LOGGER = LoggerFactory.getLogger(ToscaConverterUtil.class.getName());
+
   static {
     defaultValueKeys =
         Stream.of(DEFAULT, DEFAULT_CAPITAL).collect(Collectors.toSet());
@@ -30,10 +34,10 @@
                                                       Class<T> classToCreate) {
     try {
       return createObjectUsingSetters(objectCandidate, classToCreate);
-    } catch (Exception e) {
+    } catch (Exception ex) {
       throw new CoreException(
-          new CreateToscaObjectErrorBuilder(classToCreate.getSimpleName(), objectId, e.getMessage())
-              .build());
+          new CreateToscaObjectErrorBuilder(classToCreate.getSimpleName(), objectId)
+              .build(), ex);
     }
   }
 
@@ -68,6 +72,8 @@
       return Objects.nonNull(fieldValueToAssign)
           && Objects.nonNull(classToCreate.getMethod(methodName, field.getType()));
     } catch (NoSuchMethodException e) {
+      LOGGER.debug(String.format("Could not extract method '%s' from class '%s'. returning false " +
+              "with filedType '%s'.", methodName, classToCreate, field.getType()), e);
       return false;
     }
   }
diff --git a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/main/java/org/openecomp/core/impl/services/ServiceTemplateReaderServiceImpl.java b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/main/java/org/openecomp/core/impl/services/ServiceTemplateReaderServiceImpl.java
index 22780af..ee39af9 100644
--- a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/main/java/org/openecomp/core/impl/services/ServiceTemplateReaderServiceImpl.java
+++ b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/main/java/org/openecomp/core/impl/services/ServiceTemplateReaderServiceImpl.java
@@ -7,7 +7,14 @@
 import java.util.Map;
 import java.util.Objects;
 
-import static org.openecomp.core.converter.datatypes.Constants.*;
+import static org.openecomp.core.converter.datatypes.Constants.definitionVersion;
+import static org.openecomp.core.converter.datatypes.Constants.inputs;
+import static org.openecomp.core.converter.datatypes.Constants.metadata;
+import static org.openecomp.core.converter.datatypes.Constants.nodeTemplates;
+import static org.openecomp.core.converter.datatypes.Constants.nodeTypes;
+import static org.openecomp.core.converter.datatypes.Constants.outputs;
+import static org.openecomp.core.converter.datatypes.Constants.substitutionMappings;
+import static org.openecomp.core.converter.datatypes.Constants.topologyTemplate;
 
 public class ServiceTemplateReaderServiceImpl implements ServiceTemplateReaderService {
 
diff --git a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/test/java/org/openecomp/core/converter/impl/ToscaConverterImplTest.java b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/test/java/org/openecomp/core/converter/impl/ToscaConverterImplTest.java
index 5ee96ab..df34b89 100644
--- a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/test/java/org/openecomp/core/converter/impl/ToscaConverterImplTest.java
+++ b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/test/java/org/openecomp/core/converter/impl/ToscaConverterImplTest.java
@@ -2,7 +2,6 @@
 
 import org.apache.commons.collections.CollectionUtils;
 import org.junit.Assert;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.openecomp.core.converter.ToscaConverter;
 import org.openecomp.core.impl.ToscaConverterImpl;
diff --git a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/test/java/org/openecomp/core/converter/impl/ToscaConvertorDefinitionsTest.java b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/test/java/org/openecomp/core/converter/impl/ToscaConvertorDefinitionsTest.java
index 1ee8f6c..82a3695 100644
--- a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/test/java/org/openecomp/core/converter/impl/ToscaConvertorDefinitionsTest.java
+++ b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/test/java/org/openecomp/core/converter/impl/ToscaConvertorDefinitionsTest.java
@@ -13,9 +13,15 @@
 import java.util.Map;
 import java.util.Set;
 
-import static org.openecomp.sdc.common.utils.CommonUtil.*;
-import static org.junit.Assert.*;
-import static org.openecomp.core.impl.GlobalSubstitutionServiceTemplate.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.openecomp.core.impl.GlobalSubstitutionServiceTemplate.DEFININTION_VERSION;
+import static org.openecomp.core.impl.GlobalSubstitutionServiceTemplate.GLOBAL_SUBSTITUTION_SERVICE_FILE_NAME;
+import static org.openecomp.core.impl.GlobalSubstitutionServiceTemplate.HEAT_INDEX;
+import static org.openecomp.core.impl.GlobalSubstitutionServiceTemplate.TEMPLATE_NAME_PROPERTY;
+import static org.openecomp.sdc.common.utils.CommonUtil.validateAndUploadFileContent;
 public class ToscaConvertorDefinitionsTest {
 
 
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/impl/ToscaAnalyzerServiceImpl.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/impl/ToscaAnalyzerServiceImpl.java
index 45e6c3d..30e767b 100644
--- a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/impl/ToscaAnalyzerServiceImpl.java
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/impl/ToscaAnalyzerServiceImpl.java
@@ -53,8 +53,8 @@
 import org.openecomp.sdc.tosca.services.DataModelUtil;
 import org.openecomp.sdc.tosca.services.ToscaAnalyzerService;
 import org.openecomp.sdc.tosca.services.ToscaConstants;
-import org.openecomp.sdc.tosca.services.ToscaUtil;
 import org.openecomp.sdc.tosca.services.ToscaExtensionYamlUtil;
+import org.openecomp.sdc.tosca.services.ToscaUtil;
 
 import java.util.ArrayList;
 import java.util.Collection;
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/services/impl/ToscaAnalyzerServiceImplTest.java b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/services/impl/ToscaAnalyzerServiceImplTest.java
index aad2163..d082d2f 100644
--- a/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/services/impl/ToscaAnalyzerServiceImplTest.java
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/services/impl/ToscaAnalyzerServiceImplTest.java
@@ -20,12 +20,6 @@
 
 package org.openecomp.sdc.tosca.services.impl;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.when;
-
 import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Rule;
@@ -58,6 +52,12 @@
 import java.util.Map;
 import java.util.Optional;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.when;
+
 
 /**
  * @author Avrahamg
diff --git a/openecomp-be/lib/pom.xml b/openecomp-be/lib/pom.xml
index ea1faae..d031dd4 100644
--- a/openecomp-be/lib/pom.xml
+++ b/openecomp-be/lib/pom.xml
@@ -10,7 +10,7 @@
         <artifactId>openecomp-sdc</artifactId>
         <groupId>org.openecomp.sdc</groupId>
         <version>1.2.0-SNAPSHOT</version>
-	<relativePath>..</relativePath>
+        <relativePath>..</relativePath>
     </parent>
 
     <modules>
@@ -33,5 +33,8 @@
         <module>openecomp-sdc-activity-log-lib</module>
         <module>openecomp-tosca-converter-lib</module>
         <module>openecomp-sdc-orchestration-lib</module>
+        <module>openecomp-sdc-notification-lib</module>
+        <module>openecomp-item-permissions-lib</module>
+        <module>openecomp-conflict-lib</module>
     </modules>
 </project>
diff --git a/openecomp-be/pom.xml b/openecomp-be/pom.xml
index 02da3b9..dba8d0f 100644
--- a/openecomp-be/pom.xml
+++ b/openecomp-be/pom.xml
@@ -21,7 +21,7 @@
         <module>/lib</module>
         <module>/configuration</module>
         <module>/tools/swagger-ui</module>
-        <module>/tools/migration/1702_to_1707_zusammen</module>
+        <!--<module>/tools/migration/1702_to_1707_zusammen</module>-->
         <module>/tools/zusammen-tools</module>
         <module>/backend</module>
     </modules>
@@ -159,7 +159,7 @@
                 </executions>
             </plugin>
             <!-- Jacoco consolidation Report -->
-            <plugin>
+            <!--<plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-antrun-plugin</artifactId>
                 <version>${mvn.antrun.version}</version>
@@ -171,7 +171,7 @@
                         </goals>
                         <configuration>
                             <target>
-                                <!-- Execute an ant task within maven -->
+                                &lt;!&ndash; Execute an ant task within maven &ndash;&gt;
                                 <echo message="Generating JaCoCo Reports" />
                                 <taskdef name="report" classname="org.jacoco.ant.ReportTask">
                                     <classpath path="${basedir}/target/jacoco-jars/org.jacoco.ant.jar" />
@@ -212,7 +212,7 @@
                         <version>${jacoco.version}</version>
                     </dependency>
                 </dependencies>
-            </plugin>
+            </plugin>-->
 
         </plugins>
     </build>
@@ -262,7 +262,7 @@
                 <artifactId>classmate</artifactId>
                 <version>${classmate.version}</version>
             </dependency>
-	    <!--1702 -->
+            <!--1702 -->
             <!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-api -->
             <dependency>
                 <groupId>org.slf4j</groupId>
@@ -274,7 +274,7 @@
                 <artifactId>groovy-all</artifactId>
                 <version>${groovy.version}</version>
             </dependency>
-             <dependency>
+            <dependency>
                 <groupId>org.codehaus.janino</groupId>
                 <artifactId>janino</artifactId>
                 <version>${janino.version}</version>
diff --git a/openecomp-be/tools/build/scripts/cassandra-commands.json b/openecomp-be/tools/build/scripts/cassandra-commands.json
index 2935aca..34916fe 100644
--- a/openecomp-be/tools/build/scripts/cassandra-commands.json
+++ b/openecomp-be/tools/build/scripts/cassandra-commands.json
@@ -5,22 +5,7 @@
     "version_info": "CREATE TABLE IF NOT EXISTS version_info (entity_type text, entity_id text, active_version frozen<version>, status text, candidate frozen<user_candidate_version>, viewable_versions set<frozen<version>>, latest_final_version frozen<version>, PRIMARY KEY (entity_type, entity_id))",
     "version_info_deleted": "CREATE TABLE IF NOT EXISTS version_info_deleted (entity_type text, entity_id text, active_version frozen<version>, status text, candidate frozen<user_candidate_version>, viewable_versions set<frozen<version>>, latest_final_version frozen<version>, PRIMARY KEY (entity_type, entity_id))",
     "unique_value" : "CREATE TABLE IF NOT EXISTS unique_value (type text, value text, PRIMARY KEY ((type, value)))",
-    "choice_or_other": "CREATE TYPE IF NOT EXISTS choice_or_other (result text)",
-    "multi_choice_or_other": "CREATE TYPE IF NOT EXISTS multi_choice_or_other (results set<text>)",
-    "vendor_license_model": "CREATE TABLE IF NOT EXISTS vendor_license_model (vlm_id text, version frozen<version>, vendor_name text, description text, icon text, PRIMARY KEY ((vlm_id, version)))",
-    "license_agreement": "CREATE TABLE IF NOT EXISTS license_agreement (vlm_id text, version frozen<version>, la_id text, name text, description text, lic_term frozen<choice_or_other>, req_const text, fg_ids set<text>, PRIMARY KEY ((vlm_id, version), la_id))",
-    "feature_group": "CREATE TABLE IF NOT EXISTS feature_group (vlm_id text, version frozen<version>, fg_id text, name text, description text, part_num text, ep_ids set<text>, lkg_ids set<text>, ref_la_ids set<text>, PRIMARY KEY ((vlm_id, version), fg_id))",
-    "license_key_group": "CREATE TABLE IF NOT EXISTS license_key_group (vlm_id text, version frozen<version>, lkg_id text,name text,description text, type text, operational_scope frozen<multi_choice_or_other>, ref_fg_ids set<text>, version_uuid text, PRIMARY KEY ((vlm_id, version), lkg_id))",
-    "entitlement_pool": "CREATE TABLE IF NOT EXISTS entitlement_pool (vlm_id text, version frozen<version>, ep_id text,name text,description text,threshold float,threshold_unit text,entitlement_metric frozen<choice_or_other>,increments text,aggregation_func frozen<choice_or_other>, operational_scope frozen<multi_choice_or_other>, time frozen<choice_or_other>,manufacturer_ref_num text,ref_fg_ids set<text>, version_uuid text, PRIMARY KEY ((vlm_id, version), ep_id))",
-    "vsp_information": "CREATE TABLE IF NOT EXISTS vsp_information (VSP_ID text, version frozen<version>, NAME text,DESCRIPTION text,CATEGORY text,SUB_CATEGORY text,ICON text,PACKAGE_NAME text,PACKAGE_VERSION text,vendor_name text, vendor_id text,LICENSE_AGREEMENT text,FEATURE_GROUPS list<text>,VALIDATION_DATA text,CONTENT_DATA blob, questionnaire_data text, vlm_version frozen<version>, is_old_version text, onboarding_method text, PRIMARY KEY ((VSP_ID, version)))",
-    "package_details": "CREATE TABLE IF NOT EXISTS package_details (VSP_ID text, version frozen<version>,DISPLAY_NAME text,vsp_name text,vsp_description text,VENDOR_NAME text,CATEGORY text,SUB_CATEGORY text,VENDOR_RELEASE text,PACKAGE_CHECKSUM text,PACKAGE_TYPE text,TRANSLATE_CONTENT blob,PRIMARY KEY ((VSP_ID, version)))",
-    "vsp_network": "CREATE TABLE IF NOT EXISTS vsp_network (vsp_id text, version frozen<version>, network_id text, composition_data text, questionnaire_data text, PRIMARY KEY ((vsp_id, version), network_id))",
-    "vsp_component": "CREATE TABLE IF NOT EXISTS vsp_component (vsp_id text, version frozen<version>, component_id text, composition_data text, questionnaire_data text, PRIMARY KEY ((vsp_id, version), component_id))",
-    "vsp_component_nic": "CREATE TABLE IF NOT EXISTS vsp_component_nic (vsp_id text, version frozen<version>, component_id text, nic_id text, composition_data text, questionnaire_data text, PRIMARY KEY ((vsp_id, version), component_id, nic_id))",
-    "vsp_component_image": "CREATE TABLE IF NOT EXISTS vsp_component_image (vsp_id text, version frozen<version>, component_id text, image_id text, composition_data text, questionnaire_data text, PRIMARY KEY ((vsp_id, version), component_id, image_id))",
-    "vsp_process" : "CREATE TABLE IF NOT EXISTS vsp_process (vsp_id text, version frozen<version>, component_id text, process_id text, name text, description text, type text, artifact_name text, artifact blob, PRIMARY KEY ((vsp_id, version), component_id, process_id))",
-    "vsp_service_artifact" : "CREATE TABLE IF NOT EXISTS vsp_service_artifact (vsp_id text, version frozen<version>, name text, content_data blob, PRIMARY KEY ((vsp_id, version), name))",
-    "vsp_service_template" : "CREATE TABLE IF NOT EXISTS vsp_service_template (vsp_id text, version frozen<version>, base_name text static, name text, content_data blob, PRIMARY KEY ((vsp_id, version), name))",
+    "package_details": "CREATE TABLE IF NOT EXISTS package_details (VSP_ID text, version text,DISPLAY_NAME text,vsp_name text,vsp_description text,VENDOR_NAME text,CATEGORY text,SUB_CATEGORY text,VENDOR_RELEASE text,PACKAGE_CHECKSUM text,PACKAGE_TYPE text,TRANSLATE_CONTENT blob,PRIMARY KEY ((VSP_ID, version)))",
     "vsp_enriched_service_template" : "CREATE TABLE IF NOT EXISTS vsp_enriched_service_template (vsp_id text, version frozen<version>, base_name text static, name text, content_data blob, PRIMARY KEY ((vsp_id, version), name))",
     "vsp_enriched_service_artifact" : "CREATE TABLE IF NOT EXISTS vsp_enriched_service_artifact (vsp_id text, version frozen<version>, name text, content_data blob, PRIMARY KEY ((vsp_id, version), name))",
     "application_config" : "CREATE TABLE IF NOT EXISTS application_config (namespace text, key text, value text, PRIMARY KEY (namespace, key))",
@@ -31,37 +16,22 @@
     "vendor_list_index" : "CREATE INDEX IF NOT EXISTS action_vendor_list ON dox.Action (vendor_list)",
     "actionUUID_index" : "CREATE INDEX IF NOT EXISTS action_actionUUID ON dox.Action (actionUUID)",
     "ecomp_component": "CREATE TABLE IF NOT EXISTS dox.ecompcomponent(id text PRIMARY KEY, name text)",
-    "vsp_component_artifact": "CREATE TABLE IF NOT EXISTS vsp_component_artifact (vsp_id text, version frozen<version>, component_id text, artifact_type text, artifact_id text, name text, description text, artifact blob,  PRIMARY KEY ((vsp_id, version), component_id, artifact_type, artifact_id))",
     "name_index": "CREATE INDEX IF NOT EXISTS action_name ON dox.Action (name)",
     "action_artifact":"CREATE TABLE IF NOT EXISTS action_artifact(artifactuuid text, effective_version int, artifact blob, PRIMARY KEY(artifactuuid, effective_version)) WITH CLUSTERING ORDER BY (effective_version DESC)",
-    "vsp_orchestration_template_candidate" : "CREATE TABLE IF NOT EXISTS vsp_orchestration_template_candidate (vsp_id text, version frozen<version>, files_data_structure text, content_data blob, PRIMARY KEY ((vsp_id, version)))",
-    "vsp_deployment_flavor" : "CREATE TABLE IF NOT EXISTS vsp_deployment_flavor (vsp_id text, version frozen<version>, deployment_flavor_id text, composition_data text, questionnaire_data text, PRIMARY KEY ((vsp_id, version), deployment_flavor_id))",
-    "vsp_component_compute": "CREATE TABLE IF NOT EXISTS vsp_component_compute (vsp_id text, version frozen<version>, component_id text, compute_id text, composition_data text, questionnaire_data text, PRIMARY KEY ((vsp_id, version), component_id, compute_id))",
-    "vsp_component_dependency_model" : "CREATE TABLE IF NOT EXISTS vsp_component_dependency_model (vsp_id text, version frozen<version>, dependency_id text, sourcecomponent_id text, targetcomponent_id text, relation text, PRIMARY KEY ((vsp_id, version), dependency_id))",
     "activity_log" : "CREATE TABLE IF NOT EXISTS activity_log (item_id text, version_id text, activity_id text, type text, user text, timestamp timestamp, success boolean, message text, comment text, PRIMARY KEY (item_id, version_id, activity_id))",
-    "migration": "CREATE TABLE IF NOT EXISTS migration (id text, ismigrated boolean, primary key(id))"
+    "healing" : "CREATE TABLE IF NOT EXISTS healing (space text,item_id text,version_id text, healing_needed boolean,old_version text, PRIMARY KEY((space,item_id),version_id))",
+    "migration": "CREATE TABLE IF NOT EXISTS migration (id text, ismigrated boolean, primary key (id))",
+    "item_permissions" : "CREATE TABLE IF NOT EXISTS item_permissions (item_id text,user_id text, permission text, PRIMARY KEY(item_id,user_id)) WITH CLUSTERING ORDER BY (user_id DESC)",
+    "notification_subscribers": "CREATE TABLE IF NOT EXISTS NOTIFICATION_SUBSCRIBERS (entity_id text PRIMARY KEY, subscribers set<text>)",
+    "last_notification": "CREATE TABLE IF NOT EXISTS last_notification (owner_id text PRIMARY KEY, event_id timeuuid)",
+    "notifications": "CREATE TABLE IF NOT EXISTS notifications (owner_id text, event_id timeuuid, read boolean, originator_id text, event_type text, event_attributes text, PRIMARY KEY (owner_id, event_id)) WITH CLUSTERING ORDER BY (event_id DESC)",
+    "vsp_merge_hint": "CREATE TABLE IF NOT EXISTS vsp_merge_hint (space text, item_id text, version_id text, model_id text, model_resolution text, PRIMARY KEY ((space, item_id, version_id)))"
   },
   "drop": {
-    "version_info": "DROP TABLE IF EXISTS version_info",
     "version_info_deleted": "DROP TABLE IF EXISTS version_info_deleted",
     "unique_value": "DROP TABLE IF EXISTS unique_value",
-    "entitlement_pool": "DROP TABLE IF EXISTS entitlement_pool",
-    "vendor_license_model": "DROP TABLE IF EXISTS vendor_license_model",
-    "license_agreement": "DROP TABLE IF EXISTS license_agreement",
-    "feature_group": "DROP TABLE IF EXISTS feature_group",
-    "license_key_group": "DROP TABLE IF EXISTS license_key_group",
-    "vsp_information": "DROP   TABLE IF EXISTS vsp_information",
     "package_details": "DROP TABLE IF EXISTS package_details",
-    "vsp_network": "DROP TABLE IF EXISTS vsp_network",
-    "vsp_component_image": "DROP TABLE IF EXISTS vsp_component_image",
-    "vsp_component": "DROP TABLE IF EXISTS vsp_component",
-    "vsp_component_nic": "DROP TABLE IF EXISTS vsp_component_nic",
-    "vsp_process":"DROP TABLE IF EXISTS vsp_process",
-    "choice_or_other": "DROP TYPE IF EXISTS choice_or_other",
-    "multi_choice_or_other": "DROP TYPE IF EXISTS multi_choice_or_other",
     "application_config" : "DROP TABLE IF EXISTS application_config",
-    "vsp_service_artifact" :"DROP TABLE IF EXISTS vsp_service_artifact",
-    "vsp_service_template" :"DROP TABLE IF EXISTS vsp_service_template",
     "vsp_enriched_service_artifact" :"DROP TABLE IF EXISTS vsp_enriched_service_artifact",
     "vsp_enriched_service_template" :"DROP TABLE IF EXISTS vsp_enriched_service_template",
     "action" : "DROP TABLE IF EXISTS action",
@@ -72,22 +42,16 @@
     "actionUUID_index" : "DROP INDEX IF EXISTS dox.action_actionUUID",
     "name_index" : "DROP INDEX IF EXISTS dox.action_name",
     "ecomp_component": "DROP TABLE IF EXISTS dox.ecompcomponent",
-    "vsp_component_artifact": "DROP TABLE IF EXISTS dox.vsp_component_artifact",
     "action_artifact":"DROP TABLE IF EXISTS action_artifact",
-    "vsp_orchestration_template_candidate":"DROP TABLE IF EXISTS vsp_orchestration_template_candidate",
-    "vsp_deployment_flavor":"DROP TABLE IF EXISTS vsp_deployment_flavor",
-    "vsp_component_dependency_model":"DROP TABLE IF EXISTS vsp_component_dependency_model",
     "activity_log": "DROP TABLE IF EXISTS activity_log",
-    "migration": "DROP TABLE IF EXISTS migration"
+    "migration": "DROP TABLE IF EXISTS migration",
+    "item_permissions": "DROP TABLE IF EXISTS item_permissions",
+    "notification_subscribers": "DROP TABLE IF EXISTS notification_subscribers",
+    "last_notification": "DROP TABLE IF EXISTS last_notification",
+    "notifications": "DROP TABLE IF EXISTS notifications",
+    "vsp_merge_hint": "DROP TABLE IF EXISTS vsp_merge_hint"
   },
   "alter": {
-    "vsp_information": "ALTER TABLE vsp_information ADD questionnaire_data text",
-    "vsp_information_1": "ALTER TABLE vsp_information ADD vlm_version frozen<version>",
-    "vsp_information_2": "ALTER TABLE vsp_information ADD onboarding_method text",
-    "vsp_process": "ALTER TABLE vsp_process ADD type text",
-    "entitlement_pool": "alter table entitlement_pool ADD version_uuid text",
-    "license_key_group": "alter table license_key_group ADD version_uuid text",
-    "application_config": "delete from application_config where namespace='vsp.monitoring' and key = 'component.ceilometer'"
   },
   "actions": {
     "truncate_configuration": "truncate configuration"
diff --git a/openecomp-be/tools/build/scripts/zusammen-cassandra-commands.json b/openecomp-be/tools/build/scripts/zusammen-cassandra-commands.json
index 1395fec..5ddb1d7 100644
--- a/openecomp-be/tools/build/scripts/zusammen-cassandra-commands.json
+++ b/openecomp-be/tools/build/scripts/zusammen-cassandra-commands.json
@@ -1,19 +1,26 @@
 {
   "create": {
     "item": "CREATE TABLE IF NOT EXISTS item (item_id text primary key, item_info text, creation_time timestamp, modification_time timestamp)",
-    "version": "CREATE TABLE IF NOT EXISTS version (space text, item_id text, version_id text,base_version_id text,info text,relations text,creation_time timestamp,modification_time timestamp,PRIMARY KEY (( space, item_id ), version_id))",
-    "version_elements": "CREATE TABLE IF NOT EXISTS version_elements (space text,item_id text,version_id text,element_ids set<text>,PRIMARY KEY (( space, item_id, version_id )))",
-    "element_namespace": "CREATE TABLE IF NOT EXISTS element_namespace (space text, item_id text, element_id text, namespace text, PRIMARY KEY ((space, item_id, element_id)))",
-    "element": "CREATE TABLE IF NOT EXISTS element (space text,item_id text,version_id text,element_id text,parent_id text,namespace text,info text,relations text,data blob,searchable_data blob,visualization blob,sub_element_ids set<text>,PRIMARY KEY (( space, item_id, version_id, element_id )))"
+    "version": "CREATE TABLE IF NOT EXISTS version (space text, item_id text, version_id text,base_version_id text,info text,relations text,creation_time timestamp,modification_time timestamp ,PRIMARY KEY (( space, item_id ), version_id))",
+    "version_elements": "CREATE TABLE IF NOT EXISTS version_elements (space text,item_id text,version_id text,revision_id text,element_ids Map<text,text>, dirty_element_ids set<text>,stage_element_ids set<text>, conflict_element_ids set<text>, publish_time timestamp,user text,message text, PRIMARY KEY (( space, item_id, version_id ),revision_id))",
+    "element_namespace": "CREATE TABLE IF NOT EXISTS element_namespace (item_id text, element_id text, namespace text, PRIMARY KEY ((item_id, element_id)))",
+    "element": "CREATE TABLE IF NOT EXISTS element (space text,item_id text,version_id text,element_id text,revision_id text,parent_id text,namespace text,info text,relations text,data blob,searchable_data blob,visualization blob,sub_element_ids set<text> ,element_hash text,PRIMARY KEY (( space, item_id, version_id, element_id ),revision_id))",
+    "element_synchronization_state": "CREATE TABLE IF NOT EXISTS element_synchronization_state (space text, item_id text, version_id text, element_id text,revision_id text, publish_time timestamp, dirty boolean, PRIMARY KEY (( space, item_id, version_id ), element_id,revision_id))",
+    "element_stage": "CREATE TABLE IF NOT EXISTS element_stage (space text, item_id text,version_id text, element_id text, parent_id text, namespace text, info text, relations text,data blob, searchable_data blob, visualization blob, sub_element_ids set<text>,element_hash text, publish_time timestamp, action text, conflicted boolean,conflict_dependent_ids set<text>, PRIMARY KEY (( space, item_id, version_id, element_id )))",
+    "version_stage": "CREATE TABLE IF NOT EXISTS version_stage (space text, item_id text, version_id text, base_version_id text, creation_time timestamp,modification_time timestamp, publish_time timestamp, action text, PRIMARY KEY (( space, item_id ), version_id))"
   },
   "drop": {
     "item": "DROP TABLE IF EXISTS item",
     "version": "DROP TABLE IF EXISTS version",
     "version_elements": "DROP TABLE IF EXISTS version_elements",
     "element_namespace": "DROP TABLE IF EXISTS element_namespace",
-    "element": "DROP TABLE IF EXISTS element"
+    "element": "DROP TABLE IF EXISTS element",
+    "element_synchronization_state": "DROP TABLE IF EXISTS element_synchronization_state",
+    "element_stage": "DROP TABLE IF EXISTS element_stage",
+    "version_stage": "DROP TABLE IF EXISTS version_stage"
   },
   "alter": {
+
   },
   "actions": {
   }
diff --git a/openecomp-be/tools/install/database/schemaTemplates/questionnaire/vsp.ftl b/openecomp-be/tools/install/database/schemaTemplates/questionnaire/vsp.ftl
index 96f77b7..0f9be1c 100644
--- a/openecomp-be/tools/install/database/schemaTemplates/questionnaire/vsp.ftl
+++ b/openecomp-be/tools/install/database/schemaTemplates/questionnaire/vsp.ftl
@@ -63,6 +63,7 @@
             },
             "storageReplicationSize": {
               "type": "number",
+			  "minimum": 0,
               "maximum": 100,
               "exclusiveMaximum": true
             },
diff --git a/openecomp-be/tools/migration/1702_to_1707_zusammen/pom.xml b/openecomp-be/tools/migration/1702_to_1707_zusammen/pom.xml
deleted file mode 100644
index c2dbc94..0000000
--- a/openecomp-be/tools/migration/1702_to_1707_zusammen/pom.xml
+++ /dev/null
@@ -1,241 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-
-    <properties>
-
-        <groovy.version>2.4.7</groovy.version>
-        <janino.version>2.7.7</janino.version>
-
-    </properties>
-
-
-
-    <name>openecomp-zusammen-migration</name>
-    <dependencies>
-        <dependency>
-            <groupId>org.openecomp.sdc</groupId>
-            <artifactId>openecomp-sdc-vendor-software-product-api</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <artifactId>openecomp-zusammen-plugin</artifactId>
-            <groupId>org.openecomp.sdc.core</groupId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.openecomp.sdc</groupId>
-            <artifactId>openecomp-sdc-vendor-software-product-core</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.openecomp.sdc</groupId>
-            <artifactId>openecomp-sdc-vendor-license-api</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.openecomp.sdc</groupId>
-            <artifactId>openecomp-sdc-model-impl</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.openecomp.sdc.core</groupId>
-            <artifactId>openecomp-zusammen-core</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>com.amdocs.zusammen.plugin</groupId>
-            <artifactId>zusammen-state-store-cassandra-plugin</artifactId>
-              <version>${zusammen-state-store.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.hibernate</groupId>
-            <artifactId>hibernate-validator</artifactId>
-            <version>${hibernate.validator.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.openecomp.sdc</groupId>
-            <artifactId>openecomp-sdc-vendor-license-core</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-    </dependencies>
-    <artifactId>openecomp-zusammen-migration</artifactId>
-    <groupId>org.openecomp.sdc.core.migration</groupId>
-    <version>1.2.0-SNAPSHOT</version>
-    <parent>
-        <groupId>org.openecomp.sdc</groupId>
-        <artifactId>openecomp-sdc-lib</artifactId>
-        <relativePath>../../../lib</relativePath>
-        <version>1.2.0-SNAPSHOT</version>
-    </parent>
-    <build>
-        <plugins>
-
-            <!-- ================================================== -->
-            <!-- Set the JDK compiler version.                      -->
-            <!-- ================================================== -->
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-compiler-plugin</artifactId>
-                <version>2.5.1</version>
-                <inherited>true</inherited>
-                <configuration>
-                    <source>1.8</source>
-                    <target>1.8</target>
-                </configuration>
-            </plugin>
-
-            <plugin>
-                <groupId>org.codehaus.mojo</groupId>
-                <artifactId>license-maven-plugin</artifactId>
-                <version>1.10</version>
-                <configuration>
-                    <addJavaLicenseAfterPackage>false</addJavaLicenseAfterPackage>
-                    <processStartTag>
-                        ============LICENSE_START=======================================================
-                    </processStartTag>
-                    <processEndTag>
-                        ============LICENSE_END=========================================================
-                    </processEndTag>
-                    <sectionDelimiter>
-                        ================================================================================
-                    </sectionDelimiter>
-                    <licenseName>apache_v2</licenseName>
-                    <inceptionYear>2017</inceptionYear>
-                    <organizationName>AT&amp;T Intellectual Property. All rights reserved.
-                    </organizationName>
-                    <projectName>SDC</projectName>
-                    <canUpdateCopyright>true</canUpdateCopyright>
-                    <canUpdateDescription>true</canUpdateDescription>
-                    <canUpdateLicense>true</canUpdateLicense>
-                    <emptyLineAfterHeader>true</emptyLineAfterHeader>
-                    <verbose>false</verbose>
-                    <includes>
-                        <include>**/*.java</include>
-                        <include>**/*.js</include>
-                        <include>**/*.ts</include>
-                    </includes>
-                    <roots>
-                        <root>src</root>
-                        <root>app</root>
-                        <root>server-mock</root>
-                        <root>typings</root>
-                    </roots>
-                </configuration>
-                <executions>
-                    <execution>
-                        <id>first</id>
-                        <goals>
-                            <goal>update-file-header</goal>
-                        </goals>
-                        <!--phase>process-sources</phase-->
-                    </execution>
-                </executions>
-            </plugin>
-
-
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-dependency-plugin</artifactId>
-                <version>2.8</version>
-                <executions>
-                    <execution>
-                        <id>copy-dependencies</id>
-                        <phase>install</phase>
-                        <goals>
-                            <goal>copy-dependencies</goal>
-                        </goals>
-                        <configuration>
-                            <outputDirectory>${project.build.directory}/lib</outputDirectory>
-                            <overWriteReleases>false</overWriteReleases>
-                            <overWriteSnapshots>false</overWriteSnapshots>
-                            <overWriteIfNewer>true</overWriteIfNewer>
-                            <!--includeScope>runtime</includeScope-->
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-jar-plugin</artifactId>
-                <version>2.4</version>
-                <executions>
-                    <execution>
-                        <phase>package</phase>
-                    </execution>
-                </executions>
-                <configuration>
-                    <archive>
-                        <manifest>
-                            <addClasspath>true</addClasspath>
-                            <classpathLayoutType>custom</classpathLayoutType>
-                            <customClasspathLayout>
-                                lib/${artifact.artifactId}-${baseVersion}.${artifact.extension}
-                            </customClasspathLayout>
-                            <mainClass>org.openecomp.core.migration.MigrationMain
-                            </mainClass>
-                        </manifest>
-                        <manifestEntries>
-                            <Class-Path>lib/</Class-Path>
-                        </manifestEntries>
-                    </archive>
-                </configuration>
-            </plugin>
-
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-surefire-plugin</artifactId>
-                <version>2.19.1</version>
-                <configuration>
-                    <useSystemClassLoader>false</useSystemClassLoader>
-                    <redirectTestOutputToFile>true</redirectTestOutputToFile>
-                </configuration>
-            </plugin>
-
-
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-antrun-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <id>ant-test</id>
-                        <phase>package</phase>
-                        <configuration>
-                            <tasks>
-                                <fixcrlf srcdir="./" eol="unix"
-                                         includes="cassandra2zusammen.sh"/>
-                            </tasks>
-                        </configuration>
-                        <goals>
-                            <goal>run</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-            <plugin>
-                <artifactId>maven-assembly-plugin</artifactId>
-		<version>${mvn.assembly.version}</version>
-                <executions>
-                    <execution>
-                        <id>Generate assembly</id>
-                        <phase>install</phase>
-                        <goals>
-                            <goal>single</goal>
-                        </goals>
-                    </execution>
-                </executions>
-                <configuration>
-                    <descriptors>
-                        <descriptor>${basedir}/src/main/assembly/migration-lib-assembly.xml
-                        </descriptor>
-                    </descriptors>
-                    <finalName>openecomp-zusammen-migration-lib</finalName>
-                </configuration>
-            </plugin>
-
-        </plugins>
-    </build>
-
-</project>
diff --git a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/assembly/migration-lib-assembly.xml b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/assembly/migration-lib-assembly.xml
deleted file mode 100644
index 42296ba..0000000
--- a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/assembly/migration-lib-assembly.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
-		  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-		  xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
-
-	<formats>
-		<format>zip</format>
-	</formats>
-
-	<includeBaseDirectory>false</includeBaseDirectory>
-
-	<!--files>
-		<file>
-			<source>../cassandra2zusammen.sh</source>
-		</file>
-	</files-->
-
-	<fileSets>
-		<fileSet>
-			<directory>${basedir}/..</directory>
-			<includes>
-				<include>cassandra2zusammen.sh</include>
-			</includes>
-			<outputDirectory>/</outputDirectory>
-			<fileMode>0755</fileMode>
-		</fileSet>
-		<fileSet>
-			<directory>${basedir}/target</directory>
-			<includes>
-				<include>
-					openecomp-zusammen*.jar
-				</include>
-			</includes>
-			<outputDirectory>/</outputDirectory>
-		</fileSet>
-		<fileSet>
-			<directory>${basedir}/target/lib</directory>
-			<outputDirectory>/lib</outputDirectory>
-		</fileSet>
-	</fileSets>
-</assembly>
-
diff --git a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/MigrationMain.java b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/MigrationMain.java
deleted file mode 100644
index 1711e41..0000000
--- a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/MigrationMain.java
+++ /dev/null
@@ -1,469 +0,0 @@
-package org.openecomp.core.migration;
-
-import com.amdocs.zusammen.datatypes.SessionContext;
-import com.amdocs.zusammen.datatypes.UserInfo;
-import com.amdocs.zusammen.plugin.statestore.cassandra.dao.impl.ItemCassandraDao;
-import com.amdocs.zusammen.plugin.statestore.cassandra.dao.impl.VersionCassandraDao;
-import org.openecomp.core.migration.convertors.ComponentConvertor;
-import org.openecomp.core.migration.convertors.EntitlementPoolConvertor;
-import org.openecomp.core.migration.convertors.FeatureGroupConvertor;
-import org.openecomp.core.migration.convertors.LKGConvertor;
-import org.openecomp.core.migration.convertors.LicenseAgreementConvertor;
-import org.openecomp.core.migration.convertors.MibConvertor;
-import org.openecomp.core.migration.convertors.NetworkConvertor;
-import org.openecomp.core.migration.convertors.NicConvertor;
-import org.openecomp.core.migration.convertors.OrchestrationTemplateCandidateConvertor;
-import org.openecomp.core.migration.convertors.ProcessConvertor;
-import org.openecomp.core.migration.convertors.VlmConvertor;
-import org.openecomp.core.migration.convertors.VspInformationConvertor;
-import org.openecomp.core.migration.convertors.VspServiceArtifactConvertor;
-import org.openecomp.core.migration.convertors.VspServiceTemplateConvertor;
-import org.openecomp.core.migration.loaders.ComponentCassandraLoader;
-import org.openecomp.core.migration.loaders.EntitlementPoolCassandraLoader;
-import org.openecomp.core.migration.loaders.FeatureGroupCassandraLoader;
-import org.openecomp.core.migration.loaders.LKGCassandraLoader;
-import org.openecomp.core.migration.loaders.LicenseAgreementCassandraLoader;
-import org.openecomp.core.migration.loaders.MibCassandraLoader;
-import org.openecomp.core.migration.loaders.NetworkCassandraLoader;
-import org.openecomp.core.migration.loaders.NicCassandraLoader;
-import org.openecomp.core.migration.loaders.OrchestrationTemplateCandidateCassandraLoader;
-import org.openecomp.core.migration.loaders.ProcessCassandraLoader;
-import org.openecomp.core.migration.loaders.ServiceArtifactCassandraLoader;
-import org.openecomp.core.migration.loaders.ServiceTemplateCassandraLoader;
-import org.openecomp.core.migration.loaders.VendorLicenseModelCassandraLoader;
-import org.openecomp.core.migration.loaders.VendorSoftwareProductInfoLoader;
-import org.openecomp.core.migration.loaders.VersionInfoCassandraLoader;
-import org.openecomp.core.migration.loaders.VspInformation;
-import org.openecomp.core.migration.store.ElementHandler;
-import org.openecomp.core.migration.store.ItemHandler;
-import org.openecomp.core.migration.util.marker.MigrationMarker;
-import org.openecomp.core.model.types.ServiceArtifact;
-import org.openecomp.core.model.types.ServiceTemplate;
-import org.openecomp.core.zusammen.impl.CassandraConnectionInitializer;
-import org.openecomp.core.zusammen.plugin.dao.impl.CassandraElementRepository;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
-import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity;
-import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity;
-import org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity;
-import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity;
-import org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentMonitoringUploadEntity;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity;
-import org.openecomp.sdc.versioning.dao.types.Version;
-import org.openecomp.sdc.versioning.dao.types.VersionInfoEntity;
-
-import java.time.Duration;
-import java.time.Instant;
-import java.util.Collection;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-
-import static org.openecomp.core.migration.util.Utils.printMessage;
-
-public class MigrationMain {
-  private static final String GLOBAL_USER = "GLOBAL_USER";
-  private static Logger logger = LoggerFactory.getLogger(MigrationMain.class);
-  private static int status = 0;
-
-  private static Map<String, VersionInfoEntity> versionInfoMap = new HashMap<>();
-
-  public static void main(String[] args) {
-    CassandraElementRepository cassandraElementRepository = new CassandraElementRepository();
-    CassandraConnectionInitializer.setCassandraConnectionPropertiesToSystem();
-    printMessage(logger, "Checking whether a migration has already been run.");
-    if (MigrationMarker.isMigrated()) {
-      printMessage(logger, "The DB has already been migrated, this script will now exit.");
-      System.exit(status);
-    }
-    ItemCassandraDao itemCassandraDao = new ItemCassandraDao();
-    VersionCassandraDao versionCassandraDao = new VersionCassandraDao();
-    SessionContext context = new SessionContext();
-    context.setUser(new UserInfo(GLOBAL_USER));
-    context.setTenant("dox");
-    printMessage(logger, "Starting migration.\n");
-    Instant startTime = Instant.now();
-
-    migrateToZusammen(cassandraElementRepository, itemCassandraDao, versionCassandraDao, context);
-
-    Instant stopTime = Instant.now();
-    Duration duration = Duration.between(startTime, stopTime);
-    long minutesPart = duration.toMinutes();
-    long secondsPart = duration.minusMinutes(minutesPart).getSeconds();
-
-    if (status == 0) {
-      MigrationMarker.markMigrated();
-    }
-    printMessage(logger,
-        "Migration finished . Total run time was : " + minutesPart + ":" + secondsPart
-            + " minutes");
-    System.exit(status);
-  }
-
-
-  private static void migrateToZusammen(CassandraElementRepository cassandraElementRepository,
-                                        ItemCassandraDao itemCassandraDao,
-                                        VersionCassandraDao versionCassandraDao,
-                                        SessionContext context) {
-    loadVersionInfo();
-
-
-    try {
-      convertVsp(context, itemCassandraDao, versionCassandraDao, cassandraElementRepository);
-      printMessage(logger, "Converted VSPs\n");
-    } catch (Exception e) {
-      logger.debug(e.getMessage(), e);
-      status = -1;
-    }
-
-    try {
-      convertOrchestrationTemplateCandidate(context, cassandraElementRepository);
-      printMessage(logger, "Converted OrchestrationTemplateCandidates\n");
-    } catch (Exception e) {
-      logger.debug(e.getMessage(), e);
-      status = -1;
-    }
-
-
-    try {
-      convertComponent(context, cassandraElementRepository);
-      printMessage(logger, "Converted Components\n");
-    } catch (Exception e) {
-      logger.debug(e.getMessage(), e);
-      status = -1;
-    }
-    try {
-      convertNic(context, cassandraElementRepository);
-      printMessage(logger, "Converted Nics\n");
-    } catch (Exception e) {
-      logger.debug(e.getMessage(), e);
-      status = -1;
-    }
-    try {
-      convertNetwork(context, cassandraElementRepository);
-      printMessage(logger, "Converted Networks\n");
-    } catch (Exception e) {
-      logger.debug(e.getMessage(), e);
-      status = -1;
-    }
-    try {
-      convertMibs(context, cassandraElementRepository);
-      printMessage(logger, "Converted MIBs\n");
-    } catch (Exception e) {
-      logger.debug(e.getMessage(), e);
-      status = -1;
-    }
-    try {
-      convertServiceArtifact(context, cassandraElementRepository);
-      printMessage(logger, "Converted Service Artifacts\n");
-    } catch (Exception e) {
-      logger.debug(e.getMessage(), e);
-      status = -1;
-    }
-    try {
-      convertServiceTemplate(context, cassandraElementRepository);
-      printMessage(logger, "Converted Service Templates\n");
-    } catch (Exception e) {
-      logger.debug(e.getMessage(), e);
-      status = -1;
-    }
-    try {
-      convertProcesses(context, cassandraElementRepository);
-      printMessage(logger, "Converted Processes\n");
-    } catch (Exception e) {
-      logger.debug(e.getMessage(), e);
-      status = -1;
-    }
-
-
-    try {
-      convertVlm(context, itemCassandraDao, versionCassandraDao, cassandraElementRepository);
-      printMessage(logger, "Converted VLMs\n");
-    } catch (Exception e) {
-      logger.debug(e.getMessage(), e);
-      status = -1;
-    }
-    try {
-      convertLKG(context, cassandraElementRepository);
-      printMessage(logger, "Converted LKGs\n");
-    } catch (Exception e) {
-      logger.debug(e.getMessage(), e);
-      status = -1;
-    }
-    try {
-      convertFeatureGroup(context, cassandraElementRepository);
-      printMessage(logger, "Converted Feature Groups\n");
-    } catch (Exception e) {
-      logger.debug(e.getMessage(), e);
-      status = -1;
-    }
-    try {
-      convertEP(context, cassandraElementRepository);
-      printMessage(logger, "Converted EPs\n");
-    } catch (Exception e) {
-      logger.debug(e.getMessage(), e);
-      status = -1;
-    }
-    try {
-      convertLicenseAgreement(context, cassandraElementRepository);
-      printMessage(logger, "Converted License Agreements\n");
-    } catch (Exception e) {
-      logger.debug(e.getMessage(), e);
-      status = -1;
-    }
-  }
-
-  private static void convertOrchestrationTemplateCandidate(SessionContext context,
-                                                            CassandraElementRepository cassandraElementRepository) {
-    OrchestrationTemplateCandidateCassandraLoader orchestrationTemplateCandidateCassandraLoader =
-        new OrchestrationTemplateCandidateCassandraLoader();
-
-    orchestrationTemplateCandidateCassandraLoader.list().stream()
-        .filter(entity -> needMigration(entity.getId(), entity.getVersion()) &&
-            entity.getContentData()!=null && entity.getFilesDataStructure()!=null)
-        .forEach(entity -> ElementHandler
-            .save(context, cassandraElementRepository, entity.getId(), entity.getVersion(),
-                OrchestrationTemplateCandidateConvertor
-                    .convertOrchestrationTemplateCandidateToElement(entity)));
-  }
-
-  private static void loadVersionInfo() {
-
-    VersionInfoCassandraLoader versionInfoCassandraLoader = new VersionInfoCassandraLoader();
-    Collection<VersionInfoEntity> versions =
-        versionInfoCassandraLoader.list();
-
-    versions.forEach(versionInfoEntity -> versionInfoMap.put(versionInfoEntity.getEntityId
-        (), versionInfoEntity));
-
-
-  }
-
-  private static void convertMibs(SessionContext context,
-                                  CassandraElementRepository cassandraElementRepository) {
-    MibCassandraLoader cassandraLoader = new MibCassandraLoader();
-    Collection<ComponentMonitoringUploadEntity> mibs = cassandraLoader.list();
-    mibs.stream().filter(mibEntity -> needMigration(mibEntity.getVspId(), mibEntity.getVersion()))
-        .forEach
-            (mibEntity -> {
-              ElementHandler.save(context, cassandraElementRepository,
-                  mibEntity
-                      .getVspId(), mibEntity.getVersion(),
-                  MibConvertor.convertMibToElement
-                      (mibEntity));
-            });
-  }
-
-  private static void convertProcesses(SessionContext context,
-                                       CassandraElementRepository cassandraElementRepository) {
-    ProcessCassandraLoader cassandraLoader = new ProcessCassandraLoader();
-    Collection<ProcessEntity> processes = cassandraLoader.list();
-    processes.stream()
-        .filter(processEntity -> needMigration(processEntity.getVspId(), processEntity.getVersion
-            ())).forEach(processEntity -> {
-      ElementHandler.save(
-          context,
-          cassandraElementRepository,
-          processEntity
-              .getId(), processEntity.getVersion(),
-          ProcessConvertor.convertProcessToElement(processEntity));
-    });
-  }
-
-  private static void convertVsp(SessionContext context, ItemCassandraDao itemCassandraDao,
-                                 VersionCassandraDao versionCassandraDao,
-                                 CassandraElementRepository cassandraElementRepository) {
-    VendorSoftwareProductInfoLoader vendorSoftwareProductInfoLoader = new
-        VendorSoftwareProductInfoLoader();
-    Collection<VspInformation> vsps =
-        vendorSoftwareProductInfoLoader.list();
-    vsps.stream().filter(vspInformation -> needMigration(vspInformation.getId(),
-        vspInformation.getVersion())).forEach
-        (vspInformation
-            ->
-            ItemHandler.save(context,
-                itemCassandraDao,
-                versionCassandraDao,
-                vspInformation.getId(), vspInformation
-                    .getVersion(),
-                VspInformationConvertor
-                    .getVspInfo
-                        (vspInformation),
-                VspInformationConvertor.getItemVersionData(vspInformation),
-                vspInformation.getWritetimeMicroSeconds()));
-
-    vsps.stream().filter(vspInformation -> needMigration(vspInformation.getId(),
-        vspInformation.getVersion()))
-        .forEach(vspInformation -> ElementHandler.save(context, cassandraElementRepository,
-            vspInformation.getId(), vspInformation.getVersion(),
-            VspInformationConvertor.convertVspToElement
-                (vspInformation)));
-  }
-
-  private static void convertVlm(SessionContext context, ItemCassandraDao itemCassandraDao,
-                                 VersionCassandraDao versionCassandraDao,
-                                 CassandraElementRepository cassandraElementRepository) {
-    VendorLicenseModelCassandraLoader
-        vendorLicenseModelCassandraDao = new VendorLicenseModelCassandraLoader();
-    Collection<VendorLicenseModelEntity> vlms =
-        vendorLicenseModelCassandraDao.list();
-    vlms.stream().filter(vlm -> needMigration(vlm.getId(), vlm.getVersion())).forEach(vlmEntity ->
-        ItemHandler.save
-            (context, itemCassandraDao,
-                versionCassandraDao,
-                vlmEntity.getId(), vlmEntity.getVersion(),
-                VlmConvertor.getVlmInfo
-                    (vlmEntity),
-                VlmConvertor.getItemVersionData(vlmEntity), new Date().getTime()));
-    vlms.stream().filter(vlm -> needMigration(vlm.getId(), vlm.getVersion()))
-        .forEach(vlmEntity -> ElementHandler.save(context, cassandraElementRepository,
-            vlmEntity.getId(), vlmEntity.getVersion(),
-            VlmConvertor.convertVlmToElement
-                (vlmEntity)));
-
-  }
-
-  private static void convertNic(SessionContext context,
-                                 CassandraElementRepository cassandraElementRepository) {
-    NicCassandraLoader nicCassandraLoader = new NicCassandraLoader();
-    Collection<NicEntity> nics = nicCassandraLoader.list();
-    nics.stream().filter(entity -> needMigration(entity.getVspId(), entity.getVersion
-        ())).forEach(nicEntity -> ElementHandler.save(context, cassandraElementRepository,
-        nicEntity.getVspId(), nicEntity.getVersion(), NicConvertor.convertNicToElement
-            (nicEntity)));
-
-  }
-
-  private static void convertNetwork(SessionContext context,
-                                     CassandraElementRepository cassandraElementRepository) {
-    NetworkCassandraLoader networkCassandraLoader = new NetworkCassandraLoader();
-    Collection<NetworkEntity> networks = networkCassandraLoader.list();
-    networks.stream().filter(entity -> needMigration(entity.getVspId(), entity.getVersion
-        ())).forEach(networkEntity -> ElementHandler.save(context, cassandraElementRepository,
-        networkEntity.getVspId(), networkEntity.getVersion(), NetworkConvertor
-            .convertNetworkToElement(networkEntity)));
-
-  }
-
-  private static void convertComponent(SessionContext context,
-                                       CassandraElementRepository cassandraElementRepository) {
-    ComponentCassandraLoader componentCassandraLoader = new ComponentCassandraLoader();
-    Collection<ComponentEntity> components = componentCassandraLoader.list();
-    components.stream().filter(entity -> needMigration(entity.getVspId(), entity.getVersion
-        ())).forEach(componentEntity -> ElementHandler.save(context, cassandraElementRepository,
-        componentEntity
-            .getVspId(), componentEntity.getVersion(), ComponentConvertor
-            .convertComponentToElement(componentEntity)));
-
-  }
-
-  private static void convertServiceArtifact(SessionContext context,
-                                             CassandraElementRepository cassandraElementRepository) {
-    ServiceArtifactCassandraLoader serviceArtifactCassandraLoader =
-        new ServiceArtifactCassandraLoader();
-    Collection<ServiceArtifact> serviceArtifacts = serviceArtifactCassandraLoader.list();
-    serviceArtifacts.stream().filter(entity -> needMigration(entity.getVspId(), entity.getVersion
-        ())).forEach(serviceArtifact -> ElementHandler.save(context,
-        cassandraElementRepository,
-        serviceArtifact
-            .getVspId(), serviceArtifact.getVersion(),
-        VspServiceArtifactConvertor
-            .convertServiceArtifactToElement(serviceArtifact)));
-
-  }
-
-  private static void convertServiceTemplate(SessionContext context,
-                                             CassandraElementRepository cassandraElementRepository) {
-    ServiceTemplateCassandraLoader serviceTemplateCassandraLoader =
-        new ServiceTemplateCassandraLoader();
-    Collection<ServiceTemplate> serviceTemplates = serviceTemplateCassandraLoader.list();
-    serviceTemplates.stream().filter(entity -> needMigration(entity.getVspId(), entity.getVersion
-        ())).forEach(serviceTemplate -> ElementHandler.save(context,
-        cassandraElementRepository,
-        serviceTemplate
-            .getVspId(), serviceTemplate.getVersion(),
-        VspServiceTemplateConvertor
-            .convertServiceTemplateToElement(serviceTemplate)));
-
-  }
-
-  private static void convertLKG(SessionContext context,
-                                 CassandraElementRepository cassandraElementRepository) {
-    LKGCassandraLoader LKGCassandraLoader = new LKGCassandraLoader();
-    Collection<LicenseKeyGroupEntity> lkgs = LKGCassandraLoader.list();
-    lkgs.stream().filter(entity -> needMigration(entity.getVendorLicenseModelId(), entity.getVersion
-        ()))
-        .forEach(licenseKeyGroupEntity -> ElementHandler.save(context, cassandraElementRepository,
-            licenseKeyGroupEntity
-                .getVendorLicenseModelId(), licenseKeyGroupEntity.getVersion(),
-            LKGConvertor.convertLKGToElement
-                (licenseKeyGroupEntity)));
-  }
-
-  private static void convertEP(SessionContext context,
-                                CassandraElementRepository cassandraElementRepository) {
-    EntitlementPoolCassandraLoader entitlementPoolCassandraLoader =
-        new EntitlementPoolCassandraLoader();
-    Collection<EntitlementPoolEntity> entitlementPools = entitlementPoolCassandraLoader.list();
-    entitlementPools.stream()
-        .filter(entity -> needMigration(entity.getVendorLicenseModelId(), entity.getVersion
-            ()))
-        .forEach(entitlementPoolEntity -> ElementHandler.save(context, cassandraElementRepository,
-            entitlementPoolEntity
-                .getVendorLicenseModelId(), entitlementPoolEntity.getVersion(),
-            EntitlementPoolConvertor.convertEntitlementPoolToElement(entitlementPoolEntity)));
-  }
-
-  private static void convertFeatureGroup(SessionContext context,
-                                          CassandraElementRepository cassandraElementRepository) {
-    FeatureGroupCassandraLoader featureGroupCassandraLoader = new FeatureGroupCassandraLoader();
-    Collection<FeatureGroupEntity> featureGroupEntities = featureGroupCassandraLoader.list();
-    featureGroupEntities.stream()
-        .filter(entity -> needMigration(entity.getVendorLicenseModelId(), entity.getVersion
-            ()))
-        .forEach(featureGroupEntity -> ElementHandler.save(context, cassandraElementRepository,
-            featureGroupEntity
-                .getVendorLicenseModelId(), featureGroupEntity.getVersion(),
-            FeatureGroupConvertor.convertFeatureGroupToElement(featureGroupEntity)));
-  }
-
-  private static void convertLicenseAgreement(SessionContext context,
-                                              CassandraElementRepository cassandraElementRepository) {
-    LicenseAgreementCassandraLoader licenseAgreementCassandraLoader =
-        new LicenseAgreementCassandraLoader();
-    Collection<LicenseAgreementEntity> licenseAgreementEntities =
-        licenseAgreementCassandraLoader.list();
-    licenseAgreementEntities.stream()
-        .filter(entity -> needMigration(entity.getVendorLicenseModelId(), entity.getVersion
-            ()))
-        .forEach(licenseAgreementEntity -> ElementHandler.save(context, cassandraElementRepository,
-            licenseAgreementEntity
-                .getVendorLicenseModelId(), licenseAgreementEntity.getVersion(),
-            LicenseAgreementConvertor.convertLicenseAgreementToElement(licenseAgreementEntity)));
-  }
-
-
-  private static boolean needMigration(String itemId, Version versionId) {
-
-    VersionInfoEntity versionInfo =
-        MigrationMain.versionInfoMap.get(itemId);
-    if (versionInfo == null) {
-      printMessage(logger, "ItemId: " + itemId + " is not in version_info table.");
-      return false;
-    }
-    return (versionInfo.getCandidate() != null && versionId.equals(versionInfo.getCandidate()
-        .getVersion()))
-        || (versionInfo
-        .getViewableVersions() != null && versionInfo
-        .getViewableVersions().contains(versionId));
-  }
-
-  public static Map<String, VersionInfoEntity> getVersionInfoMap()
-  {
-    return versionInfoMap;
-  }
-}
diff --git a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/ComponentConvertor.java b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/ComponentConvertor.java
deleted file mode 100644
index fb597d5..0000000
--- a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/ComponentConvertor.java
+++ /dev/null
@@ -1,102 +0,0 @@
-package org.openecomp.core.migration.convertors;
-
-import com.amdocs.zusammen.datatypes.item.ElementContext;
-import com.amdocs.zusammen.datatypes.item.Info;
-import com.amdocs.zusammen.plugin.statestore.cassandra.dao.types.ElementEntityContext;
-import com.amdocs.zusammen.sdk.collaboration.types.CollaborationElement;
-import org.openecomp.core.migration.MigrationMain;
-import org.openecomp.core.migration.store.ElementHandler;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.ElementPropertyName;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.ElementType;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.StructureElement;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity;
-
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-/**
- * @author katyr
- * @since April 23, 2017
- */
-
-public class ComponentConvertor {
-
-  private static Set<String> componentsLoaded = new HashSet<>();
-  private static Logger logger = LoggerFactory.getLogger(MigrationMain.class);
-
-  public static CollaborationElement[] convertComponentToElement(ComponentEntity componentEntity) {
-
-    CollaborationElement[] componentElements;
-    List<String> componentNamespace = getComponentNamespace();
-
-    int index = 0;
-    String componentsEntityId = StructureElement.Components.name();
-    String uniqueId = componentEntity.getVspId()+"_"+componentEntity.getVersion().toString();
-    if (componentsLoaded.contains(uniqueId)) {
-//      printMessage(logger, "Components structural elements exist for component " +
-//          componentEntity.getId());
-      componentElements = new CollaborationElement[2];
-    } else {
-      componentsLoaded.add(uniqueId);
-//      printMessage(logger, "Creating Components structural elements for component " +
-//          componentEntity.getId());
-      componentElements = new CollaborationElement[3];
-      componentElements[index] = ElementHandler.getElementEntity(
-          componentEntity.getVspId(), componentEntity.getVersion().toString(), componentsEntityId,
-          componentNamespace,
-          ElementHandler.getStructuralElementInfo(StructureElement.Components.name()),
-          null,
-          null,
-          null);
-      index++;
-    }
-
-    componentNamespace.add(componentsEntityId);
-    componentElements[index] = ElementHandler.getElementEntity(
-        componentEntity.getVspId(), componentEntity.getVersion().toString(),
-        componentEntity.getId(),
-        componentNamespace,
-        getComponentInfo(componentEntity),
-        null,
-        null,
-        (componentEntity.getCompositionData() != null) ? componentEntity.getCompositionData().getBytes()
-            : null);
-    index++;
-
-    componentNamespace.add(componentEntity.getId());
-    componentElements[index] = ElementHandler.getElementEntity(
-        componentEntity.getVspId(), componentEntity.getVersion().toString(),StructureElement.Questionnaire.name() + "_" + componentEntity.getId(),
-        componentNamespace,
-        ElementHandler.getStructuralElementInfo(StructureElement.Questionnaire.name()),
-        null,
-        null,
-        (componentEntity.getQuestionnaireData() != null) ? componentEntity.getQuestionnaireData().getBytes()
-            : null);
-
-    return componentElements;
-  }
-
-  private static Info getComponentInfo(ComponentEntity componentEntity) {
-    Info info = new Info();
-    info.addProperty(ElementPropertyName.type.name(), ElementType.Component);
-    info.addProperty(ElementPropertyName.compositionData.name(),
-        componentEntity.getCompositionData());
-
-    return info;
-  }
-
-  private static List<String> getComponentNamespace() {
-    return ElementHandler.getElementPath();
-  }
-
-  public static ElementEntityContext convertComponentToElementContext(
-      ComponentEntity componentEntity) {
-
-    return new ElementEntityContext("GLOBAL_USER", new
-        ElementContext(componentEntity.getVspId(), componentEntity.getVersion().toString()));
-  }
-
-}
diff --git a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/EntitlementPoolConvertor.java b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/EntitlementPoolConvertor.java
deleted file mode 100644
index 86faf15..0000000
--- a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/EntitlementPoolConvertor.java
+++ /dev/null
@@ -1,92 +0,0 @@
-package org.openecomp.core.migration.convertors;
-
-import com.amdocs.zusammen.datatypes.item.ElementContext;
-import com.amdocs.zusammen.datatypes.item.Info;
-import com.amdocs.zusammen.plugin.statestore.cassandra.dao.types.ElementEntityContext;
-import com.amdocs.zusammen.sdk.collaboration.types.CollaborationElement;
-import org.openecomp.core.migration.store.ElementHandler;
-import org.openecomp.sdc.vendorlicense.dao.impl.zusammen.RelationType;
-import org.openecomp.sdc.vendorlicense.dao.impl.zusammen.StructureElement;
-import org.openecomp.sdc.vendorlicense.dao.impl.zusammen.VlmZusammenUtil;
-import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity;
-
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import java.util.stream.Collectors;
-
-/**
- * Created by ayalaben on 4/24/2017
- */
-public class EntitlementPoolConvertor {
-
-  private static Set<String> EntitlementPoolsLoaded = new HashSet<>();
-
-  public static ElementEntityContext convertEntitlementPoolToElementContext(
-      EntitlementPoolEntity entitlementPoolEntity) {
-
-    return new ElementEntityContext("GLOBAL_USER", new
-        ElementContext(entitlementPoolEntity.getVendorLicenseModelId(),
-        entitlementPoolEntity.getVersion().toString()));
-  }
-
-  public static CollaborationElement[] convertEntitlementPoolToElement(
-      EntitlementPoolEntity entitlementPoolEntity) {
-//    printMessage(logger, "source EntitlementPoolEntity -> " + entitlementPoolEntity.toString());
-    CollaborationElement[] elements;
-    List<String> entitlementPoolNamespace = getEntitlementPoolNamespace(entitlementPoolEntity);
-
-    int index = 0;
-    String entitlememtPoolsEntityId = StructureElement.EntitlementPools.name();
-    String uniqueId = entitlementPoolEntity.getVendorLicenseModelId() + "_" +
-        entitlementPoolEntity.getVersion().toString();
-
-    if (EntitlementPoolsLoaded.contains(uniqueId)) {
-      elements = new CollaborationElement[1];
-    } else {
-      EntitlementPoolsLoaded.add(uniqueId);
-      elements = new CollaborationElement[2];
-      elements[index] = ElementHandler.getElementEntity(
-          entitlementPoolEntity.getVendorLicenseModelId(),
-          entitlementPoolEntity.getVersion().toString(),
-          entitlememtPoolsEntityId, entitlementPoolNamespace,
-              ElementHandler.getStructuralElementInfo(StructureElement.EntitlementPools.name()),
-          null, null, null);
-      index++;
-    }
-
-    entitlementPoolNamespace.add(entitlememtPoolsEntityId);
-
-    elements[index] = ElementHandler.getElementEntity(
-        entitlementPoolEntity.getVendorLicenseModelId(),
-        entitlementPoolEntity.getVersion().toString(),
-        entitlementPoolEntity.getId(), entitlementPoolNamespace,
-        getEntitelementPoolInfo(entitlementPoolEntity),
-        entitlementPoolEntity.getReferencingFeatureGroups().stream().map(rel ->
-            VlmZusammenUtil
-                .createRelation( RelationType.EntitlmentPoolToReferencingFeatureGroup, rel))
-            .collect(Collectors.toList()), null, null);
-
-    return elements;
-  }
-
-  private static Info getEntitelementPoolInfo(EntitlementPoolEntity entitlementPool) {
-
-    Info info = new Info();
-    info.setName(entitlementPool.getName());
-    info.setDescription(entitlementPool.getDescription());
-    info.addProperty("thresholdValue", entitlementPool.getThresholdValue());
-    info.addProperty("threshold_unit", entitlementPool.getThresholdUnit());
-    //info.addProperty("entitlement_metric", entitlementPool.getEntitlementMetric());
-    info.addProperty("increments", entitlementPool.getIncrements());
-    info.addProperty("operational_scope", entitlementPool.getOperationalScope());
-
-    return info;
-  }
-
-  private static List<String> getEntitlementPoolNamespace(
-      EntitlementPoolEntity entitlementPoolEntity) {
-    return ElementHandler.getElementPath("");
-  }
-
-}
diff --git a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/FeatureGroupConvertor.java b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/FeatureGroupConvertor.java
deleted file mode 100644
index eac5ce6..0000000
--- a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/FeatureGroupConvertor.java
+++ /dev/null
@@ -1,102 +0,0 @@
-package org.openecomp.core.migration.convertors;
-
-import com.amdocs.zusammen.datatypes.item.ElementContext;
-import com.amdocs.zusammen.datatypes.item.Info;
-import com.amdocs.zusammen.datatypes.item.Relation;
-import com.amdocs.zusammen.plugin.statestore.cassandra.dao.types.ElementEntityContext;
-import com.amdocs.zusammen.sdk.collaboration.types.CollaborationElement;
-import org.openecomp.core.migration.store.ElementHandler;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
-import org.openecomp.sdc.vendorlicense.dao.impl.zusammen.RelationType;
-import org.openecomp.sdc.vendorlicense.dao.impl.zusammen.StructureElement;
-import org.openecomp.sdc.vendorlicense.dao.impl.zusammen.VlmZusammenUtil;
-import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import java.util.stream.Collectors;
-
-/**
- * Created by ayalaben on 4/25/2017
- */
-public class FeatureGroupConvertor {
-
-    private static Logger logger = LoggerFactory.getLogger(FeatureGroupConvertor.class);
-    private static Set<String> FeatureGroupsLoaded = new HashSet<>();
-
-    public static ElementEntityContext convertFeatureGroupToElementContext(FeatureGroupEntity featureGroupEntity) {
-
-        return new ElementEntityContext("GLOBAL_USER", new
-                ElementContext(featureGroupEntity.getVendorLicenseModelId(), featureGroupEntity.getVersion().toString()));
-    }
-
-    public static CollaborationElement[] convertFeatureGroupToElement(FeatureGroupEntity featureGroupEntity) {
-//        printMessage(logger, "source FeatureGroupEntity -> " + featureGroupEntity.toString());
-        CollaborationElement[] elements;
-        List<String> featureGroupNamespace = getFeatureGroupNamespace(featureGroupEntity);
-
-        int index = 0;
-        String featureGroupsEntityId = StructureElement.FeatureGroups.name();
-        String uniqueId = featureGroupEntity.getVendorLicenseModelId() + "_" + featureGroupEntity.getVersion().toString();
-
-        if (FeatureGroupsLoaded.contains(uniqueId)) {
-            elements = new CollaborationElement[1];
-        } else {
-            FeatureGroupsLoaded.add(uniqueId);
-            elements = new CollaborationElement[2];
-            elements[index] = ElementHandler.getElementEntity(
-                    featureGroupEntity.getVendorLicenseModelId(), featureGroupEntity.getVersion().toString(),
-                    featureGroupsEntityId, featureGroupNamespace,
-                    ElementHandler.getStructuralElementInfo(StructureElement.FeatureGroups.name()),
-                    null, null, null);
-            index++;
-        }
-
-        featureGroupNamespace.add(featureGroupsEntityId);
-
-        elements[index] = ElementHandler.getElementEntity(
-                featureGroupEntity.getVendorLicenseModelId(), featureGroupEntity.getVersion().toString(),
-                featureGroupEntity.getId(), featureGroupNamespace, getFeatureGroupInfo(featureGroupEntity),
-                getAllFeatureGroupRelations(featureGroupEntity), null, null);
-
-        return elements;
-    }
-
-    private static Collection<Relation> getAllFeatureGroupRelations(FeatureGroupEntity featureGroup) {
-        Collection<Relation> relations = new ArrayList<>();
-
-        relations.addAll(featureGroup.getEntitlementPoolIds().stream().map(rel ->
-                VlmZusammenUtil.createRelation( RelationType.FeatureGroupToEntitlmentPool, rel))
-                .collect(Collectors.toList()));
-
-        relations.addAll(featureGroup.getLicenseKeyGroupIds().stream().map(rel ->
-                VlmZusammenUtil.createRelation( RelationType.FeatureGroupToLicenseKeyGroup, rel))
-                .collect(Collectors.toList()));
-
-        relations.addAll(featureGroup.getReferencingLicenseAgreements().stream().map(rel ->
-                VlmZusammenUtil.createRelation( RelationType.FeatureGroupToReferencingLicenseAgreement,
-                        rel)).collect(Collectors.toList()));
-
-        return relations;
-    }
-
-    private static Info getFeatureGroupInfo(FeatureGroupEntity featureGroup) {
-
-        Info info = new Info();
-        info.setName(featureGroup.getName());
-        info.setDescription(featureGroup.getDescription());
-        info.addProperty("partNumber", featureGroup.getPartNumber());
-        info.addProperty("manufacturerReferenceNumber", featureGroup.getManufacturerReferenceNumber());
-
-        return info;
-    }
-
-
-    private static List<String> getFeatureGroupNamespace(FeatureGroupEntity featureGroupEntity) {
-        return ElementHandler.getElementPath("");
-    }
-}
diff --git a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/LKGConvertor.java b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/LKGConvertor.java
deleted file mode 100644
index 7fd640b..0000000
--- a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/LKGConvertor.java
+++ /dev/null
@@ -1,79 +0,0 @@
-package org.openecomp.core.migration.convertors;
-
-import com.amdocs.zusammen.datatypes.item.ElementContext;
-import com.amdocs.zusammen.datatypes.item.Info;
-import com.amdocs.zusammen.plugin.statestore.cassandra.dao.types.ElementEntityContext;
-import com.amdocs.zusammen.sdk.collaboration.types.CollaborationElement;
-import org.openecomp.core.migration.store.ElementHandler;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
-import org.openecomp.sdc.vendorlicense.dao.impl.zusammen.RelationType;
-import org.openecomp.sdc.vendorlicense.dao.impl.zusammen.StructureElement;
-import org.openecomp.sdc.vendorlicense.dao.impl.zusammen.VlmZusammenUtil;
-import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity;
-
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import java.util.stream.Collectors;
-
-/**
- * Created by ayalaben on 4/24/2017
- */
-public class LKGConvertor {
-
-    private static Logger logger = LoggerFactory.getLogger(LKGConvertor.class);
-    private static Set<String> compLKGLoaded = new HashSet<>();
-
-    public static CollaborationElement[] convertLKGToElement(LicenseKeyGroupEntity licenseKeyGroupEntity) {
-        CollaborationElement[] elements;
-        List<String> lkgNamespace = getLKGNamespace(licenseKeyGroupEntity);
-
-        int index = 0;
-        String lkgsEntityId = StructureElement.LicenseKeyGroups.name();
-        String uniqueId = licenseKeyGroupEntity.getVendorLicenseModelId() + "_" + licenseKeyGroupEntity.getVersion().toString();
-
-        if (compLKGLoaded.contains(uniqueId)) {
-            elements = new CollaborationElement[1];
-        } else {
-            compLKGLoaded.add(uniqueId);
-            elements = new CollaborationElement[2];
-            elements[index] = ElementHandler.getElementEntity(
-                    licenseKeyGroupEntity.getVendorLicenseModelId(), licenseKeyGroupEntity.getVersion().toString(), lkgsEntityId, lkgNamespace,
-                    ElementHandler.getStructuralElementInfo(StructureElement.LicenseKeyGroups.name()), null, null, null);
-            index++;
-        }
-
-        lkgNamespace.add(lkgsEntityId);
-
-        elements[index] = ElementHandler.getElementEntity(
-                licenseKeyGroupEntity.getVendorLicenseModelId(), licenseKeyGroupEntity.getVersion().toString(), licenseKeyGroupEntity.getId(), lkgNamespace,
-                getLKGInfo(licenseKeyGroupEntity), licenseKeyGroupEntity.getReferencingFeatureGroups().stream().map(rel ->
-                VlmZusammenUtil.createRelation( RelationType.LicenseKeyGroupToReferencingFeatureGroup, rel))
-                        .collect(Collectors.toList()), null, null);
-
-        return elements;
-    }
-
-    private static Info getLKGInfo(LicenseKeyGroupEntity licenseKeyGroupEntity) {
-
-        Info info = new Info();
-        info.setName(licenseKeyGroupEntity.getName());
-        info.setDescription(licenseKeyGroupEntity.getDescription());
-        info.addProperty("LicenseKeyType", licenseKeyGroupEntity.getType());
-        info.addProperty("operational_scope", licenseKeyGroupEntity.getOperationalScope());
-
-        return info;
-    }
-
-    private static List<String> getLKGNamespace(LicenseKeyGroupEntity LKGEntity) {
-        return ElementHandler.getElementPath("");
-    }
-
-    public static ElementEntityContext convertLKGToElementContext(LicenseKeyGroupEntity licenseKeyGroupEntity) {
-
-        return new ElementEntityContext("GLOBAL_USER", new
-                ElementContext(licenseKeyGroupEntity.getVendorLicenseModelId(), licenseKeyGroupEntity.getVersion().toString()));
-    }
-
-}
diff --git a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/LicenseAgreementConvertor.java b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/LicenseAgreementConvertor.java
deleted file mode 100644
index 25564c3..0000000
--- a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/LicenseAgreementConvertor.java
+++ /dev/null
@@ -1,84 +0,0 @@
-package org.openecomp.core.migration.convertors;
-
-import com.amdocs.zusammen.datatypes.item.ElementContext;
-import com.amdocs.zusammen.datatypes.item.Info;
-import com.amdocs.zusammen.plugin.statestore.cassandra.dao.types.ElementEntityContext;
-import com.amdocs.zusammen.sdk.collaboration.types.CollaborationElement;
-import org.openecomp.core.migration.store.ElementHandler;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
-import org.openecomp.sdc.vendorlicense.dao.impl.zusammen.RelationType;
-import org.openecomp.sdc.vendorlicense.dao.impl.zusammen.StructureElement;
-import org.openecomp.sdc.vendorlicense.dao.impl.zusammen.VlmZusammenUtil;
-import org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity;
-
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import java.util.stream.Collectors;
-
-/**
- * Created by ayalaben on 4/25/2017
- */
-public class LicenseAgreementConvertor {
-
-    private static Logger logger = LoggerFactory.getLogger(LicenseAgreementConvertor.class);
-    private static Set<String> LicenseAgreementsLoaded = new HashSet<>();
-
-    public static ElementEntityContext convertLicenseAgreementToElementContext(LicenseAgreementEntity licenseAgreementEntity) {
-
-        return new ElementEntityContext("GLOBAL_USER", new
-                ElementContext(licenseAgreementEntity.getVendorLicenseModelId(), licenseAgreementEntity.getVersion().toString()));
-    }
-
-
-    public static CollaborationElement[] convertLicenseAgreementToElement(LicenseAgreementEntity licenseAgreementEntity) {
-//        printMessage(logger, "source LicenseAgreementEntity -> " + licenseAgreementEntity.toString());
-        CollaborationElement[] elements;
-        List<String> featureGroupNamespace = getLicenseAgreementNamespace(licenseAgreementEntity);
-
-        int index = 0;
-        String featureGroupsEntityId = StructureElement.LicenseAgreements.name();
-        String uniqueId = licenseAgreementEntity.getVendorLicenseModelId() + "_" + licenseAgreementEntity.getVersion().toString();
-
-        if (LicenseAgreementsLoaded.contains(uniqueId)) {
-            elements = new CollaborationElement[1];
-        } else {
-            LicenseAgreementsLoaded.add(uniqueId);
-            elements = new CollaborationElement[2];
-            elements[index] = ElementHandler.getElementEntity(
-                    licenseAgreementEntity.getVendorLicenseModelId(), licenseAgreementEntity.getVersion().toString(),
-                    featureGroupsEntityId, featureGroupNamespace,
-                    ElementHandler.getStructuralElementInfo(StructureElement.LicenseAgreements.name()),
-                    null, null, null);
-            index++;
-        }
-
-        featureGroupNamespace.add(featureGroupsEntityId);
-
-        elements[index] = ElementHandler.getElementEntity(
-                licenseAgreementEntity.getVendorLicenseModelId(), licenseAgreementEntity.getVersion().toString(),
-                licenseAgreementEntity.getId(), featureGroupNamespace, getLicenseAgreementInfo(licenseAgreementEntity),
-                licenseAgreementEntity.getFeatureGroupIds().stream().map(rel ->
-                    VlmZusammenUtil.createRelation( RelationType.LicenseAgreementToFeatureGroup, rel))
-                        .collect(Collectors.toList()), null, null);
-
-        return elements;
-    }
-
-    private static Info getLicenseAgreementInfo(LicenseAgreementEntity licenseAgreement) {
-
-        Info info = new Info();
-        info.setName(licenseAgreement.getName());
-        info.setDescription(licenseAgreement.getDescription());
-        info.addProperty("licenseTerm", licenseAgreement.getLicenseTerm());
-        info.addProperty("requirementsAndConstrains", licenseAgreement.getRequirementsAndConstrains());
-
-        return info;
-    }
-
-    private static List<String> getLicenseAgreementNamespace(LicenseAgreementEntity licenseAgreement) {
-        return ElementHandler.getElementPath("");
-    }
-
-}
diff --git a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/MibConvertor.java b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/MibConvertor.java
deleted file mode 100644
index f145e51..0000000
--- a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/MibConvertor.java
+++ /dev/null
@@ -1,77 +0,0 @@
-package org.openecomp.core.migration.convertors;
-
-import com.amdocs.zusammen.datatypes.item.ElementContext;
-import com.amdocs.zusammen.datatypes.item.Info;
-import com.amdocs.zusammen.plugin.statestore.cassandra.dao.types.ElementEntityContext;
-import com.amdocs.zusammen.sdk.collaboration.types.CollaborationElement;
-import org.openecomp.core.migration.MigrationMain;
-import org.openecomp.core.migration.store.ElementHandler;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.StructureElement;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentMonitoringUploadEntity;
-
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-public class MibConvertor {
-  private static Logger logger = LoggerFactory.getLogger(MigrationMain.class);
-
-  private static Set<String> compMibLoaded = new HashSet<>();
-
-
-  public static CollaborationElement[] convertMibToElement(
-      ComponentMonitoringUploadEntity componentMonitoringUploadEntity) {
-    CollaborationElement[] elements;
-    List<String> mibNamespace = getMibNamespace(componentMonitoringUploadEntity);
-
-    int index = 0;
-    String mibsEntityId =
-        StructureElement.Mibs.name() + "_" + componentMonitoringUploadEntity.getComponentId();
-    if (compMibLoaded.contains(mibsEntityId)) {
-      elements = new CollaborationElement[1];
-    } else {
-      compMibLoaded.add(mibsEntityId);
-      elements = new CollaborationElement[2];
-      elements[index++] = ElementHandler.getElementEntity(
-          componentMonitoringUploadEntity.getVspId(),
-          componentMonitoringUploadEntity.getVersion().toString(), mibsEntityId, mibNamespace,
-          ElementHandler.getStructuralElementInfo(StructureElement.Mibs.name()), null, null, null);
-    }
-
-    mibNamespace.add(mibsEntityId);
-    elements[index] = ElementHandler.getElementEntity(
-        componentMonitoringUploadEntity.getVspId(),
-        componentMonitoringUploadEntity.getVersion().toString(), componentMonitoringUploadEntity
-            .getId(), mibNamespace,
-        getMibInfo(componentMonitoringUploadEntity), null, null, componentMonitoringUploadEntity
-            .getArtifact().array());
-
-    return elements;
-  }
-
-  private static Info getMibInfo(
-      ComponentMonitoringUploadEntity componentMonitoringUploadEntity) {
-    Info info = new Info();
-    info.setName(componentMonitoringUploadEntity.getType().toString());
-    info.getProperties().put("name", componentMonitoringUploadEntity.getArtifactName());
-    return info;
-  }
-
-  private static List<String> getMibNamespace(
-      ComponentMonitoringUploadEntity componentMonitoringUploadEntity) {
-    return ElementHandler
-        .getElementPath(StructureElement.Components.name(), componentMonitoringUploadEntity
-        .getComponentId());
-  }
-
-  public static ElementEntityContext convertMibToElementContext(
-      ComponentMonitoringUploadEntity componentMonitoringUploadEntity) {
-
-    return new ElementEntityContext("GLOBAL_USER", new
-        ElementContext(componentMonitoringUploadEntity.getVspId(),
-        componentMonitoringUploadEntity
-            .getVersion().toString()));
-  }
-}
diff --git a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/NetworkConvertor.java b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/NetworkConvertor.java
deleted file mode 100644
index 3d4f157..0000000
--- a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/NetworkConvertor.java
+++ /dev/null
@@ -1,91 +0,0 @@
-package org.openecomp.core.migration.convertors;
-
-import com.amdocs.zusammen.datatypes.item.ElementContext;
-import com.amdocs.zusammen.datatypes.item.Info;
-import com.amdocs.zusammen.plugin.statestore.cassandra.dao.types.ElementEntityContext;
-import com.amdocs.zusammen.sdk.collaboration.types.CollaborationElement;
-import org.openecomp.core.migration.MigrationMain;
-import org.openecomp.core.migration.store.ElementHandler;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.ElementPropertyName;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.ElementType;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.StructureElement;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity;
-
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-/**
- * @author katyr
- * @since April 23, 2017
- */
-
-public class NetworkConvertor {
-
-  private static Set<String> networksLoaded = new HashSet<>();
-  private static Logger logger = LoggerFactory.getLogger(MigrationMain.class);
-
-
-
-  public static CollaborationElement[] convertNetworkToElement(NetworkEntity networkEntity) {
-
-    CollaborationElement[] networkElements;
-    List<String> networkNamespace = getNetworkNamespace();
-
-    int index = 0;
-    String networksEntityId = StructureElement.Networks.name();
-    String uniqueId = networkEntity.getVspId()+"_"+networkEntity.getVersion().toString();
-    if (networksLoaded.contains(uniqueId)) {
-//      printMessage(logger, "Networks structural elements exist for network " +
-//          networkEntity.getId());
-      networkElements = new CollaborationElement[1];
-    } else {
-//      printMessage(logger, "Creating Networks structural element for network " +
-//          networkEntity.getId());
-      networksLoaded.add(uniqueId);
-      networkElements = new CollaborationElement[2];
-      networkElements[index] = ElementHandler.getElementEntity(
-          networkEntity.getVspId(), networkEntity.getVersion().toString(), networksEntityId,
-          networkNamespace,
-          ElementHandler.getStructuralElementInfo(StructureElement.Networks.name()),
-          null,
-          null,
-          null);
-      index++;
-    }
-
-    networkNamespace.add(networksEntityId);
-
-    networkElements[index] = ElementHandler.getElementEntity(
-        networkEntity.getVspId(), networkEntity.getVersion().toString(), networkEntity.getId(),
-        networkNamespace,
-        getNetworkInfo(networkEntity),
-        null,
-        null,
-        networkEntity.getCompositionData().getBytes());
-
-
-    return networkElements;
-  }
-
-  private static Info getNetworkInfo(NetworkEntity networkEntity) {
-    Info info = new Info();
-    info.addProperty(ElementPropertyName.type.name(), ElementType.Network);
-    info.addProperty(ElementPropertyName.compositionData.name(), networkEntity.getCompositionData());
-
-    return info;
-  }
-
-  private static List<String> getNetworkNamespace() {
-    return ElementHandler.getElementPath();
-  }
-
-  public static ElementEntityContext convertNetworkToElementContext(NetworkEntity networkEntity) {
-
-    return new ElementEntityContext("GLOBAL_USER", new
-        ElementContext(networkEntity.getVspId(), networkEntity.getVersion().toString()));
-  }
-
-}
diff --git a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/NicConvertor.java b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/NicConvertor.java
deleted file mode 100644
index b17e68c..0000000
--- a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/NicConvertor.java
+++ /dev/null
@@ -1,95 +0,0 @@
-package org.openecomp.core.migration.convertors;
-
-import com.amdocs.zusammen.datatypes.item.ElementContext;
-import com.amdocs.zusammen.datatypes.item.Info;
-import com.amdocs.zusammen.plugin.statestore.cassandra.dao.types.ElementEntityContext;
-import com.amdocs.zusammen.sdk.collaboration.types.CollaborationElement;
-import org.openecomp.core.migration.MigrationMain;
-import org.openecomp.core.migration.store.ElementHandler;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.ElementPropertyName;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.ElementType;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.StructureElement;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity;
-
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-public class NicConvertor {
-
-
-  private static Set<String> compNicLoaded = new HashSet<>();
-  private static Logger logger = LoggerFactory.getLogger(MigrationMain.class);
-
-
-
-  public static CollaborationElement[] convertNicToElement(NicEntity nicEntity) {
-
-    CollaborationElement[] nicElements;
-    List<String> nicNamespace = getNicNamespace(nicEntity);
-
-    int index = 0;
-    String nicsEntityId = StructureElement.Nics.name() + "_" + nicEntity.getComponentId();
-    if (compNicLoaded.contains(nicsEntityId)) {
-//      printMessage(logger, "Nics structural element exists for nic " +
-//          nicEntity.getId());
-      nicElements = new CollaborationElement[2];
-    } else {
-//      printMessage(logger, "Creating Nics structural element for nic " +
-//          nicEntity.getId());
-      compNicLoaded.add(nicsEntityId);
-      nicElements = new CollaborationElement[3];
-      nicElements[index] = ElementHandler.getElementEntity(
-          nicEntity.getVspId(), nicEntity.getVersion().toString(), nicsEntityId,
-          nicNamespace,
-          ElementHandler.getStructuralElementInfo(StructureElement.Nics.name()),
-          null,
-          null,
-          null);
-      index++;
-    }
-
-    nicNamespace.add(nicsEntityId);
-    nicElements[index] = ElementHandler.getElementEntity(
-        nicEntity.getVspId(), nicEntity.getVersion().toString(), nicEntity.getId(),
-        nicNamespace,
-        getNicInfo(nicEntity),
-        null,
-        null,
-        nicEntity.getCompositionData().getBytes());
-    index++;
-
-    nicNamespace.add(nicEntity.getId());
-    nicElements[index] = ElementHandler.getElementEntity(
-        nicEntity.getVspId(), nicEntity.getVersion().toString(),StructureElement.Questionnaire.name() + "_" + nicEntity.getId(),
-        nicNamespace,
-        ElementHandler.getStructuralElementInfo(StructureElement.Questionnaire.name()),
-        null,
-        null,
-        (nicEntity.getQuestionnaireData() != null) ? nicEntity.getQuestionnaireData().getBytes()
-            : null);
-    return nicElements;
-  }
-
-  private static Info getNicInfo(NicEntity nicEntity) {
-    Info info = new Info();
-    info.addProperty(ElementPropertyName.type.name(), ElementType.Nic);
-    info.addProperty(ElementPropertyName.compositionData.name(), nicEntity.getCompositionData());
-    return info;
-  }
-
-  private static List<String> getNicNamespace(NicEntity nicEntity) {
-    return ElementHandler.getElementPath(StructureElement.Components.name(), nicEntity
-        .getComponentId());
-  }
-
-  public static ElementEntityContext convertNicToElementContext(NicEntity nicEntity) {
-
-    return new ElementEntityContext("GLOBAL_USER", new
-        ElementContext(nicEntity.getVspId(), nicEntity.getVersion().toString()));
-  }
-
-
-}
diff --git a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/OrchestrationTemplateCandidateConvertor.java b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/OrchestrationTemplateCandidateConvertor.java
deleted file mode 100644
index e6ceb36..0000000
--- a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/OrchestrationTemplateCandidateConvertor.java
+++ /dev/null
@@ -1,70 +0,0 @@
-package org.openecomp.core.migration.convertors;
-
-import com.amdocs.zusammen.datatypes.item.ElementContext;
-import com.amdocs.zusammen.plugin.statestore.cassandra.dao.types.ElementEntityContext;
-import com.amdocs.zusammen.sdk.collaboration.types.CollaborationElement;
-import org.openecomp.core.migration.MigrationMain;
-import org.openecomp.core.migration.store.ElementHandler;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.StructureElement;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.OrchestrationTemplateCandidateDataEntity;
-
-import java.util.List;
-
-public class OrchestrationTemplateCandidateConvertor {
-
-
-
-
-  private static Logger logger = LoggerFactory.getLogger(MigrationMain.class);
-
-  public static CollaborationElement[] convertOrchestrationTemplateCandidateToElement(
-      OrchestrationTemplateCandidateDataEntity entity) {
-
-
-    CollaborationElement[] orchestrationTemplateCandidateElements = new CollaborationElement[2];
-    List<String> orchestrationTemplateCandidateNamespace =
-        getOrchestrationTemplateCandidateNamespace();
-
-
-
-    orchestrationTemplateCandidateElements[0] = ElementHandler.getElementEntity(
-        entity.getId(), entity.getVersion().toString(), StructureElement.OrchestrationTemplateCandidate.name(),
-        orchestrationTemplateCandidateNamespace,
-        ElementHandler.getStructuralElementInfo(StructureElement.OrchestrationTemplateCandidate.name()),
-        null,
-        null,
-        entity.getFilesDataStructure().getBytes());
-
-    orchestrationTemplateCandidateNamespace.add(StructureElement.OrchestrationTemplateCandidate.name());
-    orchestrationTemplateCandidateElements[1] = ElementHandler.getElementEntity(
-        entity.getId(), entity.getVersion().toString(), StructureElement.OrchestrationTemplateCandidateContent.name(),
-        orchestrationTemplateCandidateNamespace,
-        ElementHandler.getStructuralElementInfo(StructureElement.OrchestrationTemplateCandidateContent.name()),
-        null,
-        null,
-        entity.getContentData().array());
-
-
-
-    return orchestrationTemplateCandidateElements;
-  }
-
-
-  private static List<String> getOrchestrationTemplateCandidateNamespace() {
-    return ElementHandler.getElementPath();
-  }
-
-  public static ElementEntityContext convertComponentToElementContext(
-      ComponentEntity componentEntity) {
-
-    return new ElementEntityContext("GLOBAL_USER", new
-        ElementContext(componentEntity.getVspId(), componentEntity.getVersion().toString()));
-  }
-
-
-
-
-}
diff --git a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/ProcessConvertor.java b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/ProcessConvertor.java
deleted file mode 100644
index 0a145c4..0000000
--- a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/ProcessConvertor.java
+++ /dev/null
@@ -1,98 +0,0 @@
-package org.openecomp.core.migration.convertors;
-
-import com.amdocs.zusammen.datatypes.item.ElementContext;
-import com.amdocs.zusammen.datatypes.item.Info;
-import com.amdocs.zusammen.plugin.statestore.cassandra.dao.types.ElementEntityContext;
-import com.amdocs.zusammen.sdk.collaboration.types.CollaborationElement;
-import org.openecomp.core.migration.MigrationMain;
-import org.openecomp.core.migration.store.ElementHandler;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.ElementType;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.StructureElement;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity;
-
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-public class ProcessConvertor {
-  private static final String NAME = "name";
-  private static final String ELEMENT_TYPE = "type";
-  private static final String ARTIFACT_NAME = "artifactName";
-  private static final String DESCRIPTION = "description";
-  private static final String PROCESS_TYPE = "processType";
-  private static Set<String> compProcessesLoaded = new HashSet<>();
-
-  private static Logger logger = LoggerFactory.getLogger(MigrationMain.class);
-
-
-  public static CollaborationElement[] convertProcessToElement(ProcessEntity processEntity) {
-    CollaborationElement[] elements;
-    boolean isGeneralComponentId = isGeneralComponentId(processEntity);
-    List<String> processNamespace = getProcessNamespace(processEntity);
-    int index = 0;
-    String uniqueId = getUniqueId(processEntity, isGeneralComponentId);
-    String processesEntityId = isGeneralComponentId ? StructureElement.Processes.name() :
-        (StructureElement.Processes.name() + "_" +processEntity.getComponentId());
-    if (compProcessesLoaded.contains(uniqueId)) {
-      elements = new CollaborationElement[1];
-    } else {
-      compProcessesLoaded.add(uniqueId);
-      elements = new CollaborationElement[2];
-      elements[index++] = ElementHandler.getElementEntity(
-          processEntity.getVspId(), processEntity.getVersion().toString(), processesEntityId,
-          processNamespace,
-          ElementHandler.getStructuralElementInfo(StructureElement.Processes.name()), null, null, null);
-    }
-
-    processNamespace.add(processesEntityId);
-    elements[index] = ElementHandler.getElementEntity(
-        processEntity.getVspId(), processEntity.getVersion().toString(), processEntity.getId(),
-        processNamespace,
-        getProcessInfo(processEntity), null, null, processEntity.getArtifact() ==
-            null ? null : processEntity.getArtifact().array());
-
-    return elements;
-  }
-
-  private static String getUniqueId(ProcessEntity processEntity, boolean isGeneralComponentId) {
-    if (isGeneralComponentId) {
-      return processEntity.getVspId() + "_" + processEntity.getVersion().toString();
-    } else {
-      return StructureElement.Processes.name() + "_" + processEntity
-          .getComponentId();
-    }
-  }
-
-  private static Info getProcessInfo(ProcessEntity processEntity) {
-    Info info = new Info();
-    info.setName(processEntity.getName());
-    info.addProperty(NAME, processEntity.getName());
-    info.addProperty(ELEMENT_TYPE, ElementType.Process);
-    info.addProperty(ARTIFACT_NAME, processEntity.getArtifactName());
-    info.addProperty(DESCRIPTION, processEntity.getDescription());
-    info.addProperty(PROCESS_TYPE,
-        processEntity.getType() != null ? processEntity.getType().name() : null);
-    return info;
-  }
-
-  private static List<String> getProcessNamespace(ProcessEntity processEntity) {
-    if (isGeneralComponentId(processEntity)) {
-      return ElementHandler.getElementPath();
-    } else {
-      return ElementHandler
-          .getElementPath(StructureElement.Components.name(), processEntity.getComponentId());
-    }
-  }
-
-  private static boolean isGeneralComponentId(ProcessEntity processEntity) {
-    return processEntity.getComponentId().equals("General");
-  }
-
-  public static ElementEntityContext convertProcessToElementContext(ProcessEntity processEntity) {
-
-    return new ElementEntityContext("GLOBAL_USER", new
-        ElementContext(processEntity.getVspId(), processEntity.getVersion().toString()));
-  }
-}
diff --git a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/VlmConvertor.java b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/VlmConvertor.java
deleted file mode 100644
index 2e48374..0000000
--- a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/VlmConvertor.java
+++ /dev/null
@@ -1,92 +0,0 @@
-package org.openecomp.core.migration.convertors;
-
-import com.amdocs.zusammen.datatypes.item.ElementContext;
-import com.amdocs.zusammen.datatypes.item.Info;
-import com.amdocs.zusammen.datatypes.item.ItemVersionData;
-import com.amdocs.zusammen.plugin.statestore.cassandra.dao.types.ElementEntityContext;
-import com.amdocs.zusammen.sdk.collaboration.types.CollaborationElement;
-import org.openecomp.core.migration.store.ElementHandler;
-import org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.StructureElement;
-
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-public class VlmConvertor {
-
-  private static Set<String> compNicLoaded = new HashSet<>();
-
-  public static CollaborationElement[] convertVlmToElement(VendorLicenseModelEntity vendorLicenseModel) {
-
-    CollaborationElement[] vspElements = new CollaborationElement[1];
-    List<String> vspNamespace = getVlmNamespace(vendorLicenseModel);
-
-
-    String vspEntityId = StructureElement.General.name();
-
-    vspElements[0] = ElementHandler.getElementEntity(
-        vendorLicenseModel.getId(), vendorLicenseModel.getVersion().toString(),
-        vspEntityId,
-        vspNamespace,
-        getVlmGeneralInfo(vendorLicenseModel),
-        null,
-        null,
-        null);
-    return vspElements;
-  }
-
-
-  public static ItemVersionData getItemVersionData(
-      VendorLicenseModelEntity vendorLicenseModel) {
-    ItemVersionData itemVersionData = new ItemVersionData();
-    Info info = new Info();
-    info.setName("main version");
-    itemVersionData.setInfo(info);
-    return itemVersionData;
-  }
-
-  public static Info getVlmInfo(VendorLicenseModelEntity vendorLicenseModel) {
-
-    Info info = new Info();
-    info.setName(vendorLicenseModel.getVendorName());
-    info.setDescription(vendorLicenseModel.getDescription());
-    info.addProperty("type", "vlm");
-    info.addProperty("version", vendorLicenseModel.getVersion());
-    info.addProperty("iconRef", vendorLicenseModel.getIconRef());
-    return info;
-  }
-
-  private static List<String> getVlmNamespace(VendorLicenseModelEntity vlmEntity) {
-    return ElementHandler.getElementPath("");
-  }
-
-  private static Info getVlmGeneralInfo(VendorLicenseModelEntity vendorLicenseModel) {
-
-
-    Info info = new Info();
-    info.setName(StructureElement.General.name());
-    info.addProperty(InfoPropertyName.type.name(), InfoPropertyName.vlm.name());
-    info.addProperty(InfoPropertyName.iconRef.name(), vendorLicenseModel.getIconRef());
-    info.addProperty(InfoPropertyName.name.name(), vendorLicenseModel.getVendorName());
-    info.addProperty(InfoPropertyName.description.name(), vendorLicenseModel.getDescription());
-    return info;
-  }
-
-  public static ElementEntityContext convertVlmToElementContext(VendorLicenseModelEntity
-                                                                   vendorLicenseModel) {
-
-    return new ElementEntityContext("GLOBAL_USER", new
-        ElementContext(vendorLicenseModel.getId(), vendorLicenseModel.getVersion().toString()));
-  }
-
-
-  private enum InfoPropertyName {
-    name,
-    description,
-    iconRef,
-    type,
-    vlm
-  }
-
-}
diff --git a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/VspInformationConvertor.java b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/VspInformationConvertor.java
deleted file mode 100644
index 59fba5f..0000000
--- a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/VspInformationConvertor.java
+++ /dev/null
@@ -1,162 +0,0 @@
-package org.openecomp.core.migration.convertors;
-
-import com.amdocs.zusammen.datatypes.item.ElementContext;
-import com.amdocs.zusammen.datatypes.item.Info;
-import com.amdocs.zusammen.datatypes.item.ItemVersionData;
-import com.amdocs.zusammen.plugin.statestore.cassandra.dao.types.ElementEntityContext;
-import com.amdocs.zusammen.sdk.collaboration.types.CollaborationElement;
-import org.openecomp.core.migration.loaders.VspInformation;
-import org.openecomp.core.migration.store.ElementHandler;
-import org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.StructureElement;
-
-import java.util.List;
-
-public class VspInformationConvertor {
-
-  public static ItemVersionData getItemVersionData(
-      VspInformation vspInformation) {
-    Info info = new Info();
-    info.setName("main version");
-    ItemVersionData itemVersionData = new ItemVersionData();
-    itemVersionData.setInfo(info);
-    return itemVersionData;
-  }
-
-  public static Info getVspInfo(VspInformation vspInformation) {
-
-    Info info = new Info();
-    info.setName(vspInformation.getName());
-    info.setDescription(vspInformation.getDescription());
-    info.addProperty("type", "vsp");
-    addVspDetailsToInfo(info, vspInformation);
-    return info;
-  }
-
-  private static List<String> getVspNamespace(VendorLicenseModelEntity vlmEntity) {
-    return ElementHandler.getElementPath("");
-  }
-
-  private static void addVspDetailsToInfo(Info info, VspInformation vspInformation) {
-    info.addProperty("name", vspInformation.getName());
-    info.addProperty("description", vspInformation.getDescription());
-    info.addProperty("category", vspInformation.getCategory());
-    info.addProperty("subCategory", vspInformation.getSubCategory());
-    info.addProperty("vendorId", vspInformation.getVendorId());
-    info.addProperty("vendorName", vspInformation.getVendorName());
-    if (vspInformation.getVlmVersion() != null) {
-      info.addProperty("vendorVersion", vspInformation.getVlmVersion().toString());
-    }
-    info.addProperty("featureGroups", vspInformation.getFeatureGroups());
-    info.addProperty("licenseAgreement", vspInformation.getLicenseAgreement());
-    String oldVersion = vspInformation.getIsOldVersion() == null? "1702":"1610";
-    info.addProperty("oldVersion", oldVersion);
-  }
-
-  public static CollaborationElement[] convertVspToElement(VspInformation vspInformation) {
-
-    CollaborationElement[] vspElements;
-    if(vspInformation.getQuestionnaireData() == null){
-      vspElements = new CollaborationElement[4];
-    }else{
-      vspElements = new CollaborationElement[5];
-    }
-
-    int index=0;
-
-    List<String> vspNamespace = getVspNamespace(vspInformation);
-
-
-    String vspEntityId = StructureElement.General.name();
-
-    vspElements[index] = ElementHandler.getElementEntity(
-        vspInformation.getId(), vspInformation.getVersion().toString(),
-        vspEntityId,
-        vspNamespace,
-        getVspGeneralInfo(vspInformation),
-        null,
-        null,
-        null);
-
-    index++;
-    String vspOrchestrationTemplateEntityId = StructureElement.OrchestrationTemplate.name();
-    vspElements[index] = ElementHandler.getElementEntity(
-        vspInformation.getId(), vspInformation.getVersion().toString(),
-        vspOrchestrationTemplateEntityId,
-        vspNamespace,
-        ElementHandler.getStructuralElementInfo(vspOrchestrationTemplateEntityId),
-        null,
-        null,
-        null);
-
-    if(vspInformation.getQuestionnaireData()!= null) {
-      index++;
-      String vspQuestionnaireEntityId = StructureElement.Questionnaire.name();
-      vspElements[index] = ElementHandler.getElementEntity(
-          vspInformation.getId(), vspInformation.getVersion().toString(),
-          vspQuestionnaireEntityId,
-          vspNamespace,
-          ElementHandler.getStructuralElementInfo(vspQuestionnaireEntityId),
-          null,
-          null,
-          vspInformation.getQuestionnaireData().getBytes() != null ? vspInformation
-              .getQuestionnaireData().getBytes() : null);
-    }
-    vspNamespace.add(vspOrchestrationTemplateEntityId);
-    index++;
-    String vspOrchestrationTemplateValidationDataEntityId = StructureElement.OrchestrationTemplateValidationData.name();
-    vspElements[index] = ElementHandler.getElementEntity(
-        vspInformation.getId(), vspInformation.getVersion().toString(),
-        vspOrchestrationTemplateValidationDataEntityId,
-        vspNamespace,
-        ElementHandler.getStructuralElementInfo(vspOrchestrationTemplateValidationDataEntityId),
-        null,
-        null,
-        vspInformation.getValidationData()!= null?vspInformation.getValidationData().getBytes()
-            :null);
-    index++;
-    String vspOrchestrationTemplateContentEntityId = StructureElement.OrchestrationTemplateContent.name();
-    vspElements[index] = ElementHandler.getElementEntity(
-        vspInformation.getId(), vspInformation.getVersion().toString(),
-        vspOrchestrationTemplateContentEntityId,
-        vspNamespace,
-        ElementHandler.getStructuralElementInfo(vspOrchestrationTemplateContentEntityId),
-        null,
-        null,
-        vspInformation.getContentData()!= null?vspInformation.getContentData().array()
-            :null);
-
-    return vspElements;
-  }
-
-  private static Info getVspGeneralInfo(VspInformation vspInformation) {
-
-
-    Info info = new Info();
-    info.setName(StructureElement.General.name());
-    info.addProperty("name", vspInformation.getName());
-    info.addProperty("description", vspInformation.getDescription());
-    info.addProperty("category", vspInformation.getCategory());
-    info.addProperty("subCategory", vspInformation.getSubCategory());
-    info.addProperty("vendorId", vspInformation.getVendorId());
-    info.addProperty("vendorName", vspInformation.getVendorName());
-    if (vspInformation.getVlmVersion() != null) {
-      info.addProperty("vendorVersion", vspInformation.getVlmVersion().toString());
-    }
-    info.addProperty("featureGroups", vspInformation.getFeatureGroups());
-    info.addProperty("licenseAgreement", vspInformation.getLicenseAgreement());
-    String oldVersion = vspInformation.getIsOldVersion() == null? "1702":"1610";
-    info.addProperty("oldVersion", oldVersion);
-    return info;
-  }
-
-  private static List<String> getVspNamespace(VspInformation vspEntity) {
-    return ElementHandler.getElementPath("");
-  }
-
-  public static ElementEntityContext convertVspToElementContext(VspInformation vspEntity) {
-
-    return new ElementEntityContext("GLOBAL_USER", new
-        ElementContext(vspEntity.getId(), vspEntity.getVersion().toString()));
-  }
-}
diff --git a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/VspServiceArtifactConvertor.java b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/VspServiceArtifactConvertor.java
deleted file mode 100644
index 15b8ad7..0000000
--- a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/VspServiceArtifactConvertor.java
+++ /dev/null
@@ -1,83 +0,0 @@
-package org.openecomp.core.migration.convertors;
-
-import com.amdocs.zusammen.datatypes.item.ElementContext;
-import com.amdocs.zusammen.datatypes.item.Info;
-import com.amdocs.zusammen.plugin.statestore.cassandra.dao.types.ElementEntityContext;
-import com.amdocs.zusammen.sdk.collaboration.types.CollaborationElement;
-import org.openecomp.core.migration.store.ElementHandler;
-import org.openecomp.core.model.types.ServiceArtifact;
-import org.openecomp.core.utilities.file.FileUtils;
-import org.openecomp.sdc.model.impl.zusammen.StructureElement;
-
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-/**
- * @author katyr
- * @since April 23, 2017
- */
-
-public class VspServiceArtifactConvertor 
-{
-    private static Set<String> serviceArtifactsLoaded = new HashSet<>();
- 
-
-
-  public static CollaborationElement[] convertServiceArtifactToElement(ServiceArtifact serviceArtifact) {
-
-    CollaborationElement[] serviceArtifactElements;
-    List<String> serviceArtifactNamespace = getServiceArtifactNamespace();
-
-    int index = 0;
-    String serviceArtifactsEntityId = StructureElement.Artifacts.name();
-    String uniqueId = serviceArtifact.getVspId()+"_"+serviceArtifact.getVersion().toString();
-    if (serviceArtifactsLoaded.contains(uniqueId)) {
-      serviceArtifactElements = new CollaborationElement[1];
-    } else {
-      serviceArtifactsLoaded.add(uniqueId);
-      serviceArtifactElements = new CollaborationElement[2];
-      serviceArtifactElements[index] = ElementHandler.getElementEntity(
-          serviceArtifact.getVspId(), serviceArtifact.getVersion().toString(), serviceArtifactsEntityId,
-          serviceArtifactNamespace,
-          ElementHandler.getStructuralElementInfo(StructureElement.Artifacts.name()),
-          null,
-          null,
-          null);
-      index++;
-    }
-
-    serviceArtifactNamespace.add(serviceArtifactsEntityId);
-    String elementId = serviceArtifact.getVspId()+"_"+serviceArtifact.getVersion().toString()
-        +"_"+serviceArtifact.getName();
-    serviceArtifactElements[index] = ElementHandler.getElementEntity(
-        serviceArtifact.getVspId(), serviceArtifact.getVersion().toString(), elementId,
-        serviceArtifactNamespace,
-        getServiceArtifactInfo(serviceArtifact),
-        null,
-        null,
-        FileUtils.toByteArray(serviceArtifact.getContent()));
-
-    return serviceArtifactElements;
-  }
-
-  private static Info getServiceArtifactInfo(ServiceArtifact serviceArtifactEntity) {
-    Info info = new Info();
-    info.setName(serviceArtifactEntity.getName());
-    info.addProperty("type", org.openecomp.sdc.model.impl.zusammen.ElementType.Artifact.name());
-
-    return info;
-  }
-
-  private static List<String> getServiceArtifactNamespace() {
-    return ElementHandler.getElementPath(StructureElement.ServiceModel.name());
-  }
-
-  public static ElementEntityContext convertServiceArtifactToElementContext(ServiceArtifact
-                                                                                serviceArtifactEntity) {
-
-    return new ElementEntityContext("GLOBAL_USER", new
-        ElementContext(serviceArtifactEntity.getVspId(), serviceArtifactEntity.getVersion().toString()));
-  }
-
-}
diff --git a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/VspServiceTemplateConvertor.java b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/VspServiceTemplateConvertor.java
deleted file mode 100644
index a767246..0000000
--- a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/VspServiceTemplateConvertor.java
+++ /dev/null
@@ -1,100 +0,0 @@
-package org.openecomp.core.migration.convertors;
-
-import com.amdocs.zusammen.datatypes.item.ElementContext;
-import com.amdocs.zusammen.datatypes.item.Info;
-import com.amdocs.zusammen.plugin.statestore.cassandra.dao.types.ElementEntityContext;
-import com.amdocs.zusammen.sdk.collaboration.types.CollaborationElement;
-import org.openecomp.core.migration.store.ElementHandler;
-import org.openecomp.core.model.types.ServiceTemplate;
-import org.openecomp.core.utilities.file.FileUtils;
-import org.openecomp.sdc.model.impl.zusammen.ElementType;
-import org.openecomp.sdc.model.impl.zusammen.StructureElement;
-
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-/**
- * @author katyr
- * @since April 23, 2017
- */
-
-public class VspServiceTemplateConvertor 
-{
-    private static Set<String> serviceTemplatesLoaded = new HashSet<>();
- 
-
-
-  public static CollaborationElement[] convertServiceTemplateToElement(ServiceTemplate serviceTemplate) {
-
-    CollaborationElement[] serviceTemplateElements;
-    List<String> serviceTemplateNamespace = getServiceTemplateNamespace();
-
-    int index = 0;
-    String serviceTemplatesEntityId = StructureElement.Templates.name();
-    String uniqueId = serviceTemplate.getVspId()+"_"+serviceTemplate.getVersion().toString();
-    if (serviceTemplatesLoaded.contains(uniqueId)) {
-      serviceTemplateElements = new CollaborationElement[1];
-    } else {
-      serviceTemplatesLoaded.add(uniqueId);
-      String vspServiceModelEntityId = StructureElement.ServiceModel.name();
-
-      serviceTemplateElements = new CollaborationElement[3];
-      serviceTemplateElements[index] = ElementHandler.getElementEntity(
-          serviceTemplate.getVspId(),
-          serviceTemplate.getVersion().toString(),
-          vspServiceModelEntityId,
-          serviceTemplateNamespace,
-          ElementHandler.getServiceModelElementInfo(vspServiceModelEntityId,serviceTemplate),
-          null,
-          null,
-          null);
-     index++;
-      serviceTemplateNamespace.add(vspServiceModelEntityId);
-      serviceTemplateElements[index] = ElementHandler.getElementEntity(
-          serviceTemplate.getVspId(), serviceTemplate.getVersion().toString(), serviceTemplatesEntityId,
-          serviceTemplateNamespace,
-          ElementHandler.getStructuralElementInfo(StructureElement.Templates.name()),
-          null,
-          null,
-          null);
-      index++;
-    }
-
-    serviceTemplateNamespace.add(serviceTemplatesEntityId);
-    String elementId = serviceTemplate.getVspId()+"_"+serviceTemplate.getVersion().toString()
-        +"_"+serviceTemplate.getName();
-    serviceTemplateElements[index] = ElementHandler.getElementEntity(
-        serviceTemplate.getVspId(), serviceTemplate.getVersion().toString(), elementId,
-        serviceTemplateNamespace,
-        getServiceTemplateInfo(serviceTemplate),
-        null,
-        null,
-        FileUtils.toByteArray(serviceTemplate.getContent()));
-
-    return serviceTemplateElements;
-  }
-
-  private static Info getServiceTemplateInfo(ServiceTemplate serviceTemplateEntity) {
-    Info info = new Info();
-    info.setName(serviceTemplateEntity.getName());
-    info.addProperty("type", ElementType.Servicetemplate.name());
-    info.addProperty("base", serviceTemplateEntity.getBaseName());
-
-
-
-    return info;
-  }
-
-  private static List<String> getServiceTemplateNamespace() {
-    return ElementHandler.getElementPath();
-  }
-
-  public static ElementEntityContext convertServiceTemplateToElementContext(ServiceTemplate
-                                                                                serviceTemplateEntity) {
-
-    return new ElementEntityContext("GLOBAL_USER", new
-        ElementContext(serviceTemplateEntity.getVspId(), serviceTemplateEntity.getVersion().toString()));
-  }
-
-}
diff --git a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/ComponentCassandraLoader.java b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/ComponentCassandraLoader.java
deleted file mode 100644
index 3e00f9d..0000000
--- a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/ComponentCassandraLoader.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * 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=========================================================
- */
-
-package org.openecomp.core.migration.loaders;
-
-import com.datastax.driver.mapping.Result;
-import com.datastax.driver.mapping.annotations.Accessor;
-import com.datastax.driver.mapping.annotations.Query;
-import org.openecomp.core.nosqldb.api.NoSqlDb;
-import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity;
-
-import java.util.Collection;
-
-public class ComponentCassandraLoader  {
-
-  private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface();
-  private static final ComponentAccessor accessor =
-      noSqlDb.getMappingManager().createAccessor(ComponentAccessor.class);
-
-
-  public Collection<ComponentEntity> list() {
-    return accessor.list().all();
-  }
-
-  @Accessor
-  interface ComponentAccessor {
-
-    @Query(
-        "select * from vsp_component ")
-    Result<ComponentEntity> list();
-
-
-  }
-
-
-
-}
diff --git a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/EntitlementPoolCassandraLoader.java b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/EntitlementPoolCassandraLoader.java
deleted file mode 100644
index c307bfc..0000000
--- a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/EntitlementPoolCassandraLoader.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package org.openecomp.core.migration.loaders;
-
-import com.datastax.driver.mapping.Result;
-import com.datastax.driver.mapping.annotations.Accessor;
-import com.datastax.driver.mapping.annotations.Query;
-import org.openecomp.core.nosqldb.api.NoSqlDb;
-import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
-import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity;
-
-import java.util.Collection;
-
-/**
- * Created by ayalaben on 4/24/2017
- */
-public class EntitlementPoolCassandraLoader {
-
-    private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface();
-
-    private static final EntitlementPoolCassandraLoader.EntitlementPoolAccessor accessor =
-            noSqlDb.getMappingManager().createAccessor(EntitlementPoolCassandraLoader.EntitlementPoolAccessor.class);
-
-    public Collection<EntitlementPoolEntity> list() {
-        return accessor.list().all();
-    }
-
-    @Accessor
-    interface EntitlementPoolAccessor {
-        @Query("select * from entitlement_pool ")
-        Result<EntitlementPoolEntity> list();
-    }
-}
diff --git a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/FeatureGroupCassandraLoader.java b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/FeatureGroupCassandraLoader.java
deleted file mode 100644
index 0c7627f..0000000
--- a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/FeatureGroupCassandraLoader.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package org.openecomp.core.migration.loaders;
-
-import com.datastax.driver.mapping.Result;
-import com.datastax.driver.mapping.annotations.Accessor;
-import com.datastax.driver.mapping.annotations.Query;
-import org.openecomp.core.nosqldb.api.NoSqlDb;
-import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
-import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity;
-
-import java.util.Collection;
-
-/**
- * Created by ayalaben on 4/25/2017.
- */
-public class FeatureGroupCassandraLoader {
-
-    private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface();
-    private static final FeatureGroupCassandraLoader.FGAccessor accessor =
-            noSqlDb.getMappingManager().createAccessor(FeatureGroupCassandraLoader.FGAccessor.class);
-
-    public Collection<FeatureGroupEntity> list() {
-        return accessor.getAll().all();
-    }
-
-    @Accessor
-    interface FGAccessor {
-        @Query("SELECT * FROM feature_group")
-        Result<FeatureGroupEntity> getAll();
-    }
-}
diff --git a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/LKGCassandraLoader.java b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/LKGCassandraLoader.java
deleted file mode 100644
index 891a69e..0000000
--- a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/LKGCassandraLoader.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package org.openecomp.core.migration.loaders;
-
-import com.datastax.driver.mapping.Result;
-import com.datastax.driver.mapping.annotations.Accessor;
-import com.datastax.driver.mapping.annotations.Query;
-import org.openecomp.core.nosqldb.api.NoSqlDb;
-import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
-import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity;
-
-import java.util.Collection;
-
-/**
- * Created by ayalaben on 4/24/2017
- */
-public class LKGCassandraLoader {
-
-    private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface();
-    private static final LKGCassandraLoader.LKGAccessor accessor =
-            noSqlDb.getMappingManager().createAccessor(LKGCassandraLoader.LKGAccessor.class);
-
-    public Collection<LicenseKeyGroupEntity> list() {
-        return accessor.getAll().all();
-    }
-
-    @Accessor
-    interface LKGAccessor {
-        @Query("SELECT * FROM license_key_group")
-        Result<LicenseKeyGroupEntity> getAll();
-
-    }
-}
diff --git a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/LicenseAgreementCassandraLoader.java b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/LicenseAgreementCassandraLoader.java
deleted file mode 100644
index ca44209..0000000
--- a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/LicenseAgreementCassandraLoader.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package org.openecomp.core.migration.loaders;
-
-import com.datastax.driver.mapping.Result;
-import com.datastax.driver.mapping.annotations.Accessor;
-import com.datastax.driver.mapping.annotations.Query;
-import org.openecomp.core.nosqldb.api.NoSqlDb;
-import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
-import org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity;
-
-import java.util.Collection;
-
-/**
- * Created by ayalaben on 4/25/2017.
- */
-public class LicenseAgreementCassandraLoader {
-
-    private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface();
-    private static final LicenseAgreementCassandraLoader.LicenseAgreementAccessor accessor =
-            noSqlDb.getMappingManager().createAccessor(LicenseAgreementCassandraLoader.LicenseAgreementAccessor.class);
-
-    public Collection<LicenseAgreementEntity> list() {
-        return accessor.getAll().all();
-    }
-
-    @Accessor
-    interface LicenseAgreementAccessor {
-        @Query("SELECT * FROM license_agreement")
-        Result<LicenseAgreementEntity> getAll();
-
-    }
-}
diff --git a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/MibCassandraLoader.java b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/MibCassandraLoader.java
deleted file mode 100644
index b93033c..0000000
--- a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/MibCassandraLoader.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * 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=========================================================
- */
-
-package org.openecomp.core.migration.loaders;
-
-import com.datastax.driver.mapping.Result;
-import com.datastax.driver.mapping.annotations.Accessor;
-import com.datastax.driver.mapping.annotations.Query;
-import org.openecomp.core.nosqldb.api.NoSqlDb;
-import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentMonitoringUploadEntity;
-
-import java.util.Collection;
-
-public class MibCassandraLoader {
-
-  private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface();
-  private static final MibAccessor accessor =
-      noSqlDb.getMappingManager().createAccessor(MibAccessor.class);
-
-
-  public Collection<ComponentMonitoringUploadEntity> list() {
-    return accessor.list().all();
-  }
-
-  @Accessor
-  interface MibAccessor {
-
-    @Query(
-        "select * from vsp_component_artifact")
-    Result<ComponentMonitoringUploadEntity> list();
-
-
-  }
-
-
-
-}
diff --git a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/NetworkCassandraLoader.java b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/NetworkCassandraLoader.java
deleted file mode 100644
index 7ce93bc..0000000
--- a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/NetworkCassandraLoader.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package org.openecomp.core.migration.loaders;
-
-import com.datastax.driver.mapping.Result;
-import com.datastax.driver.mapping.annotations.Accessor;
-import com.datastax.driver.mapping.annotations.Query;
-import org.openecomp.core.nosqldb.api.NoSqlDb;
-import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity;
-
-import java.util.Collection;
-
-/**
- * @author katyr
- * @since April 23, 2017
- */
-
-public class NetworkCassandraLoader {
-
-  private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface();
-  private static final NetworkCassandraLoader.NetworkAccessor accessor =
-      noSqlDb.getMappingManager().createAccessor(NetworkCassandraLoader.NetworkAccessor.class);
-
-
-  public Collection<NetworkEntity> list() {
-    return accessor.list().all();
-  }
-
-  @Accessor
-  interface NetworkAccessor {
-
-    @Query(
-        "select * from vsp_network ")
-    Result<NetworkEntity> list();
-  }
-}
diff --git a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/NicCassandraLoader.java b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/NicCassandraLoader.java
deleted file mode 100644
index fea9c08..0000000
--- a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/NicCassandraLoader.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * 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=========================================================
- */
-
-package org.openecomp.core.migration.loaders;
-
-import com.datastax.driver.mapping.Mapper;
-import com.datastax.driver.mapping.Result;
-import com.datastax.driver.mapping.UDTMapper;
-import com.datastax.driver.mapping.annotations.Accessor;
-import com.datastax.driver.mapping.annotations.Query;
-import org.openecomp.core.nosqldb.api.NoSqlDb;
-import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity;
-import org.openecomp.sdc.versioning.dao.types.Version;
-
-import java.util.Collection;
-
-public class NicCassandraLoader {
-
-  private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface();
-  private static final Mapper<NicEntity> mapper =
-      noSqlDb.getMappingManager().mapper(NicEntity.class);
-  private static final NicAccessor accessor =
-      noSqlDb.getMappingManager().createAccessor(NicAccessor.class);
-  private static final UDTMapper<Version> versionMapper =
-      noSqlDb.getMappingManager().udtMapper(Version.class);
-
-
-  public Collection<NicEntity> list() {
-    return accessor.list().all();
-  }
-
-  @Accessor
-  interface NicAccessor {
-
-    @Query(
-        "select vsp_id, version, component_id, nic_id, composition_data,questionnaire_data "
-            + " from vsp_component_nic ")
-    Result<NicEntity> list();
-
-
-  }
-
-
-
-}
diff --git a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/OrchestrationTemplateCandidateCassandraLoader.java b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/OrchestrationTemplateCandidateCassandraLoader.java
deleted file mode 100644
index 09da455..0000000
--- a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/OrchestrationTemplateCandidateCassandraLoader.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * 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=========================================================
- */
-
-package org.openecomp.core.migration.loaders;
-
-import com.datastax.driver.mapping.Result;
-import com.datastax.driver.mapping.annotations.Accessor;
-import com.datastax.driver.mapping.annotations.Query;
-import org.openecomp.core.nosqldb.api.NoSqlDb;
-import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.OrchestrationTemplateCandidateDataEntity;
-
-import java.util.Collection;
-
-public class OrchestrationTemplateCandidateCassandraLoader {
-
-  private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface();
-  private static final OrchestrationTemplateCandidateAccessor accessor =
-      noSqlDb.getMappingManager().createAccessor(OrchestrationTemplateCandidateAccessor.class);
-
-
-  public Collection<OrchestrationTemplateCandidateDataEntity> list() {
-    return accessor.list().all();
-  }
-
-  @Accessor
-  interface OrchestrationTemplateCandidateAccessor {
-
-    @Query(
-        "select * from vsp_orchestration_template_candidate ")
-    Result<OrchestrationTemplateCandidateDataEntity> list();
-
-
-  }
-
-
-
-}
diff --git a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/ProcessCassandraLoader.java b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/ProcessCassandraLoader.java
deleted file mode 100644
index 6672af5..0000000
--- a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/ProcessCassandraLoader.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * 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=========================================================
- */
-
-package org.openecomp.core.migration.loaders;
-
-import com.datastax.driver.mapping.Result;
-import com.datastax.driver.mapping.annotations.Accessor;
-import com.datastax.driver.mapping.annotations.Query;
-import org.openecomp.core.nosqldb.api.NoSqlDb;
-import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity;
-
-import java.util.Collection;
-
-public class ProcessCassandraLoader {
-
-  private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface();
-  private static final ProcessAccessor accessor =
-      noSqlDb.getMappingManager().createAccessor(ProcessAccessor.class);
-
-
-  public Collection<ProcessEntity> list() {
-    return accessor.list().all();
-  }
-
-  @Accessor
-  interface ProcessAccessor {
-
-    @Query(
-        "select * from vsp_process")
-    Result<ProcessEntity> list();
-
-
-  }
-
-
-
-}
diff --git a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/ServiceArtifactCassandraLoader.java b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/ServiceArtifactCassandraLoader.java
deleted file mode 100644
index 5231662..0000000
--- a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/ServiceArtifactCassandraLoader.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * 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=========================================================
- */
-
-package org.openecomp.core.migration.loaders;
-
-import com.datastax.driver.mapping.Result;
-import com.datastax.driver.mapping.annotations.Accessor;
-import com.datastax.driver.mapping.annotations.Query;
-import org.openecomp.core.model.types.ServiceArtifact;
-import org.openecomp.core.model.types.ServiceArtifactEntity;
-import org.openecomp.core.nosqldb.api.NoSqlDb;
-import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
-
-import java.util.Collection;
-import java.util.List;
-import java.util.stream.Collectors;
-
-public class ServiceArtifactCassandraLoader {
-
-  private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface();
-  private static final VspServiceArtifactAccessor accessor =
-      noSqlDb.getMappingManager().createAccessor(
-          VspServiceArtifactAccessor.class);
-
-
-  public Collection<ServiceArtifact> list() {
-
-
-    List<ServiceArtifactEntity> entityList = accessor.listAll().all();
-
-    return entityList.stream().map(entity -> entity.getServiceArtifact())
-        .collect(Collectors.toList());
-  }
-
-  @Accessor
-  interface VspServiceArtifactAccessor {
-
-    @Query("SELECT * FROM vsp_service_artifact")
-    Result<ServiceArtifactEntity> listAll();
-
-
-  }
-
-}
diff --git a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/ServiceTemplateCassandraLoader.java b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/ServiceTemplateCassandraLoader.java
deleted file mode 100644
index f7e5853..0000000
--- a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/ServiceTemplateCassandraLoader.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * 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=========================================================
- */
-
-package org.openecomp.core.migration.loaders;
-
-import com.datastax.driver.mapping.Result;
-import com.datastax.driver.mapping.annotations.Accessor;
-import com.datastax.driver.mapping.annotations.Query;
-import org.openecomp.core.model.types.ServiceTemplate;
-import org.openecomp.core.model.types.ServiceTemplateEntity;
-import org.openecomp.core.nosqldb.api.NoSqlDb;
-import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
-
-import java.util.Collection;
-import java.util.List;
-import java.util.stream.Collectors;
-
-public class ServiceTemplateCassandraLoader {
-
-  private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface();
-  private static final VspServiceTemplateAccessor accessor =
-      noSqlDb.getMappingManager().createAccessor(
-          VspServiceTemplateAccessor.class);
-
-
-  public Collection<ServiceTemplate> list() {
-
-
-    List<ServiceTemplateEntity> entityList = accessor.listAll().all();
-
-    return entityList.stream().map(entity -> entity.getServiceTemplate())
-        .collect(Collectors.toList());
-  }
-
-  @Accessor
-  interface VspServiceTemplateAccessor {
-
-    @Query("SELECT * FROM vsp_service_template")
-    Result<ServiceTemplateEntity> listAll();
-
-
-  }
-
-}
diff --git a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/VendorLicenseModelCassandraLoader.java b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/VendorLicenseModelCassandraLoader.java
deleted file mode 100644
index c02cc1e..0000000
--- a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/VendorLicenseModelCassandraLoader.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * 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=========================================================
- */
-
-package org.openecomp.core.migration.loaders;
-
-import com.datastax.driver.mapping.Result;
-import com.datastax.driver.mapping.annotations.Accessor;
-import com.datastax.driver.mapping.annotations.Query;
-import org.openecomp.core.nosqldb.api.NoSqlDb;
-import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
-import org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity;
-
-import java.util.Collection;
-
-public class VendorLicenseModelCassandraLoader {
-
-  private static NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface();
-  private static VendorLicenseModelAccessor accessor =
-      noSqlDb.getMappingManager().createAccessor(VendorLicenseModelAccessor.class);
-
-
-  public Collection<VendorLicenseModelEntity> list() {
-    return accessor.getAll().all();
-  }
-
-  @Accessor
-  interface VendorLicenseModelAccessor {
-
-    @Query("SELECT * FROM vendor_license_model")
-    Result<VendorLicenseModelEntity> getAll();
-
-  }
-}
diff --git a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/VendorSoftwareProductInfoLoader.java b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/VendorSoftwareProductInfoLoader.java
deleted file mode 100644
index 26fc23c..0000000
--- a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/VendorSoftwareProductInfoLoader.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * 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=========================================================
- */
-
-package org.openecomp.core.migration.loaders;
-
-import com.datastax.driver.mapping.Mapper;
-import com.datastax.driver.mapping.Result;
-import com.datastax.driver.mapping.UDTMapper;
-import com.datastax.driver.mapping.annotations.Accessor;
-import com.datastax.driver.mapping.annotations.Query;
-import org.openecomp.core.nosqldb.api.NoSqlDb;
-import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
-import org.openecomp.sdc.versioning.dao.types.Version;
-
-import java.util.Collection;
-
-public class VendorSoftwareProductInfoLoader {
-
-  private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface();
-  private static final Mapper<VspInformation> mapper =
-      noSqlDb.getMappingManager().mapper(VspInformation.class);
-  private static final VendorSoftwareProductInfoAccessor accessor =
-      noSqlDb.getMappingManager().createAccessor(VendorSoftwareProductInfoAccessor.class);
-  private static final UDTMapper<Version> versionMapper =
-      noSqlDb.getMappingManager().udtMapper(Version.class);
-
-
-  public Collection<VspInformation> list() {
-    return accessor.listAll().all();
-  }
-
-
-  @Accessor
-  interface VendorSoftwareProductInfoAccessor {
-
-    @Query(
-        "SELECT * " +
-            "FROM " +
-            "vsp_information")
-    Result<VspInformation> listAll();
-
-
-  }
-}
diff --git a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/VersionInfoCassandraLoader.java b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/VersionInfoCassandraLoader.java
deleted file mode 100644
index 725298b..0000000
--- a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/VersionInfoCassandraLoader.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * 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=========================================================
- */
-
-package org.openecomp.core.migration.loaders;
-
-import com.datastax.driver.mapping.Mapper;
-import com.datastax.driver.mapping.Result;
-import com.datastax.driver.mapping.annotations.Accessor;
-import com.datastax.driver.mapping.annotations.Query;
-import org.openecomp.core.nosqldb.api.NoSqlDb;
-import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
-import org.openecomp.sdc.versioning.dao.types.VersionInfoEntity;
-
-import java.util.Collection;
-
-public class VersionInfoCassandraLoader  {
-
-  private static NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface();
-  private static Mapper<VersionInfoEntity> mapper =
-      noSqlDb.getMappingManager().mapper(VersionInfoEntity.class);
-  private static VersionInfoAccessor accessor =
-      noSqlDb.getMappingManager().createAccessor(VersionInfoAccessor.class);
-
-
-
-
-  public Collection<VersionInfoEntity> list() {
-    return accessor.getAll().all();
-  }
-
-  @Accessor
-  interface VersionInfoAccessor {
-    @Query("select * from version_info ")
-    Result<VersionInfoEntity> getAll();
-  }
-}
diff --git a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/VspInformation.java b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/VspInformation.java
deleted file mode 100644
index 2db1b09..0000000
--- a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/VspInformation.java
+++ /dev/null
@@ -1,276 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * 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=========================================================
- */
-
-package org.openecomp.core.migration.loaders;
-
-import com.datastax.driver.mapping.annotations.Column;
-import com.datastax.driver.mapping.annotations.Computed;
-import com.datastax.driver.mapping.annotations.Frozen;
-import com.datastax.driver.mapping.annotations.PartitionKey;
-import com.datastax.driver.mapping.annotations.Table;
-import org.openecomp.core.utilities.json.JsonUtil;
-import org.openecomp.sdc.heat.datatypes.structure.ValidationStructureList;
-import org.openecomp.sdc.versioning.dao.types.Version;
-
-import java.nio.ByteBuffer;
-import java.util.List;
-
-@Table(keyspace = "dox", name = "vsp_information")
-public class VspInformation {
-  public static final String ENTITY_TYPE = "Vendor Software Product";
-
-  @PartitionKey
-  @Column(name = "vsp_id")
-  private String id;
-
-  @PartitionKey(value = 1)
-  @Frozen
-  private Version version;
-
-  private String name;
-  private String description;
-
-  private String category;
-
-  @Column(name = "sub_category")
-  private String subCategory;
-
-  private String icon;
-
-  @Column(name = "vendor_name")
-  private String vendorName;
-
-  @Column(name = "vendor_id")
-  private String vendorId;
-
-  @Column(name = "vlm_version")
-  @Frozen
-  private Version vlmVersion;
-
-  @Column(name = "license_agreement")
-  private String licenseAgreement;
-
-  @Column(name = "feature_groups")
-  private List<String> featureGroups;
-
-  @Column(name = "package_name")
-  private String packageName;
-
-  @Column(name = "package_version")
-  private String packageVersion;
-
-  @Column(name = "validation_data")
-  private String validationData;
-
-  @Column(name = "is_old_version")
-  private String isOldVersion;
-
-  @Column(name = "questionnaire_data")
-  private String questionnaireData;
-
-  @Column(name = "content_data")
-  private ByteBuffer contentData;
-
-
-  @Computed("writetime(name)")
-  private Long writetimeMicroSeconds;
-
-
-  public VspInformation() {
-  }
-
-  public VspInformation(String id, Version version) {
-    this.id = id;
-    this.version = version;
-  }
-
-
-  public String getId() {
-    return id;
-  }
-
-  public void setId(String id) {
-    this.id = id;
-  }
-
-
-  public String getName() {
-    return name;
-  }
-
-  public void setName(String name) {
-    this.name = name;
-  }
-
-  public String getDescription() {
-    return description;
-  }
-
-  public void setDescription(String description) {
-    this.description = description;
-  }
-
-  public String getCategory() {
-    return category;
-  }
-
-  public void setCategory(String category) {
-    this.category = category;
-  }
-
-  public String getSubCategory() {
-    return subCategory;
-  }
-
-  public void setSubCategory(String subCategory) {
-    this.subCategory = subCategory;
-  }
-
-  public String getIcon() {
-    return icon;
-  }
-
-  public void setIcon(String icon) {
-    this.icon = icon;
-  }
-
-  public String getVendorName() {
-    return vendorName;
-  }
-
-  public void setVendorName(String vendorName) {
-    this.vendorName = vendorName;
-  }
-
-  public String getVendorId() {
-    return vendorId;
-  }
-
-  public void setVendorId(String vendorId) {
-    this.vendorId = vendorId;
-  }
-
-  public Version getVlmVersion() {
-    return vlmVersion;
-  }
-
-  public void setVlmVersion(Version vlmVersion) {
-    this.vlmVersion = vlmVersion;
-  }
-
-  public String getLicenseAgreement() {
-    return licenseAgreement;
-  }
-
-  public void setLicenseAgreement(String licenseAgreement) {
-    this.licenseAgreement = licenseAgreement;
-  }
-
-  public List<String> getFeatureGroups() {
-    return featureGroups;
-  }
-
-  public void setFeatureGroups(List<String> featureGroups) {
-    this.featureGroups = featureGroups;
-  }
-
-  public String getPackageName() {
-    return packageName;
-  }
-
-  public void setPackageName(String packageName) {
-    this.packageName = packageName;
-  }
-
-  public String getPackageVersion() {
-    return packageVersion;
-  }
-
-  public void setPackageVersion(String packageVersion) {
-    this.packageVersion = packageVersion;
-  }
-
-  public String getValidationData() {
-    return validationData;
-  }
-
-  public void setValidationData(String validationData) {
-    this.validationData = validationData;
-  }
-
-  public ValidationStructureList getValidationDataStructure() {
-    return validationData == null ? null
-        : JsonUtil.json2Object(validationData, ValidationStructureList.class);
-  }
-
-  public void setValidationDataStructure(ValidationStructureList validationData) {
-    this.validationData = validationData == null ? null
-        : JsonUtil.object2Json(validationData);
-  }
-
-  public Long getWritetimeMicroSeconds() {
-    return this.writetimeMicroSeconds;
-  }
-
-  public void setWritetimeMicroSeconds(Long writetimeMicroSeconds) {
-    this.writetimeMicroSeconds = writetimeMicroSeconds;
-  }
-
-  public String getIsOldVersion() {
-    return this.isOldVersion;
-  }
-
-  public void setIsOldVersion(String oldVersion) {
-    this.isOldVersion = oldVersion;
-  }
-
-  public void setVersion(Version version) {
-    this.version = version;
-  }
-
-  public Version getVersion() {
-    return version;
-  }
-
-  public String getQuestionnaireData() {
-    return questionnaireData;
-  }
-
-  public void setQuestionnaireData(String questionnaireData) {
-    this.questionnaireData = questionnaireData;
-  }
-
-  public ByteBuffer getContentData() {
-    return contentData;
-  }
-
-  public void setContentData(ByteBuffer contentData) {
-    this.contentData = contentData;
-  }
-
-  @Override
-  public String toString() {
-    StringBuilder sb = new StringBuilder();
-    sb.append("Vsp id = ").append(this.id);
-    sb.append("Version = ").append(this.version);
-
-    return sb.toString();
-  }
-}
diff --git a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/store/ElementHandler.java b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/store/ElementHandler.java
deleted file mode 100644
index 548a8d9..0000000
--- a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/store/ElementHandler.java
+++ /dev/null
@@ -1,136 +0,0 @@
-package org.openecomp.core.migration.store;
-
-import com.amdocs.zusammen.datatypes.Id;
-import com.amdocs.zusammen.datatypes.Namespace;
-import com.amdocs.zusammen.datatypes.SessionContext;
-import com.amdocs.zusammen.datatypes.item.Info;
-import com.amdocs.zusammen.datatypes.item.Relation;
-import com.amdocs.zusammen.plugin.statestore.cassandra.dao.types.ElementEntityContext;
-import com.amdocs.zusammen.sdk.collaboration.types.CollaborationElement;
-import org.openecomp.core.migration.MigrationMain;
-import org.openecomp.core.model.types.ServiceTemplate;
-import org.openecomp.core.zusammen.plugin.ZusammenPluginUtil;
-import org.openecomp.core.zusammen.plugin.dao.impl.CassandraElementRepository;
-import org.openecomp.core.zusammen.plugin.dao.types.ElementEntity;
-import org.openecomp.sdc.versioning.dao.types.Version;
-import org.openecomp.sdc.versioning.dao.types.VersionInfoEntity;
-
-import java.io.ByteArrayInputStream;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-public class ElementHandler {
-
-  private static final String GLOBAL_USER = "GLOBAL_USER";
-
-  public static void save(SessionContext context,
-                          CassandraElementRepository cassandraElementRepository,
-                          String itemId, Version versionId,
-                          CollaborationElement[] elements) {
-
-    ElementEntityContext elementContext;
-    for (CollaborationElement element : elements) {
-
-      elementContext = new ElementEntityContext(GLOBAL_USER, new Id(itemId), getVersionId(itemId,
-          versionId));
-      ElementEntity elementEntity = ZusammenPluginUtil.getElementEntity(element);
-
-      cassandraElementRepository.createNamespace(context, elementContext, elementEntity);
-
-      cassandraElementRepository.create(context, elementContext, elementEntity);
-
-      if (isActiveVersion(itemId, versionId)) {
-        elementContext =
-            new ElementEntityContext(GLOBAL_USER, new Id(itemId), new Id(versionId.toString()));
-        cassandraElementRepository.create(context, elementContext, elementEntity);
-
-      }
-    }
-  }
-
-  public static CollaborationElement getElementEntity(String itemId,
-                                                      String versionId,
-                                                      String elementId,
-                                                      List<String> elementPath,
-                                                      Info info,
-                                                      Collection<Relation> relations,
-                                                      List<String> subElements,
-                                                      byte[] data) {
-    Namespace namespace = new Namespace();
-    for (String pathElementId : elementPath) {
-      namespace = new Namespace(namespace, new Id(pathElementId));
-    }
-    if (namespace.getValue() == null || namespace.getValue().equals("")) {
-      namespace = Namespace.ROOT_NAMESPACE;
-    }
-    CollaborationElement elementEntity = new CollaborationElement(new Id(itemId), new Id(versionId),
-        namespace, new Id(elementId));
-
-    Id parentId = namespace.getParentElementId() != null ? namespace.getParentElementId() : Id.ZERO;
-    elementEntity.setParentId(parentId);
-    elementEntity.setInfo(info);
-    elementEntity.setRelations(relations);
-    if (subElements != null) {
-      Set<Id> subElementSet = new HashSet<>();
-
-      subElements.forEach(subElement -> subElementSet.add(new Id(subElement)));
-
-    }
-    if (data != null) {
-      elementEntity.setData(new ByteArrayInputStream(data));
-    }
-
-    return elementEntity;
-  }
-
-  public static List<String> getElementPath(String... paths) {
-    List<String> pathList = new ArrayList<>();
-    if (paths != null) {
-      Collections.addAll(pathList, paths);
-    }
-    return pathList;
-  }
-
-  public static Info getStructuralElementInfo(String elementName) {
-    Info info = new Info();
-    info.setName(elementName);
-    return info;
-  }
-
-
-  private static Id getVersionId(String itemId, Version versionId) {
-    VersionInfoEntity versionInfo =
-        MigrationMain.getVersionInfoMap().get(itemId);
-    if (versionInfo == null) {
-      return new Id(versionId.toString());
-    }
-    Version lastVersion = versionInfo.getCandidate() != null ? versionInfo.getCandidate()
-        .getVersion()
-        : versionInfo.getActiveVersion();
-
-    if (lastVersion.equals(versionId)) {
-      return new Id(itemId);
-    } else {
-      return new Id(versionId.toString());
-    }
-  }
-
-  private static boolean isActiveVersion(String itemId, Version versionId) {
-    VersionInfoEntity versionInfo =
-        MigrationMain.getVersionInfoMap().get(itemId);
-    return versionInfo != null && versionInfo.getActiveVersion().equals(versionId);
-  }
-
-
-  public static Info getServiceModelElementInfo(String vspServiceModelEntityId,
-                                                ServiceTemplate serviceTemplate) {
-    Info info = ElementHandler.getStructuralElementInfo(vspServiceModelEntityId);
-    info.addProperty("base", serviceTemplate.getBaseName());
-    return info;
-
-  }
-}
\ No newline at end of file
diff --git a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/store/ItemHandler.java b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/store/ItemHandler.java
deleted file mode 100644
index 801984a..0000000
--- a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/store/ItemHandler.java
+++ /dev/null
@@ -1,122 +0,0 @@
-package org.openecomp.core.migration.store;
-
-import com.amdocs.zusammen.datatypes.Id;
-import com.amdocs.zusammen.datatypes.Namespace;
-import com.amdocs.zusammen.datatypes.SessionContext;
-import com.amdocs.zusammen.datatypes.item.Info;
-import com.amdocs.zusammen.datatypes.item.ItemVersionData;
-import com.amdocs.zusammen.datatypes.item.Relation;
-import com.amdocs.zusammen.plugin.statestore.cassandra.dao.impl.ItemCassandraDao;
-import com.amdocs.zusammen.plugin.statestore.cassandra.dao.impl.VersionCassandraDao;
-import com.amdocs.zusammen.plugin.statestore.cassandra.dao.types.ElementEntity;
-
-import org.openecomp.core.migration.MigrationMain;
-import org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity;
-import org.openecomp.sdc.versioning.dao.types.Version;
-import org.openecomp.sdc.versioning.dao.types.VersionInfoEntity;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-public class ItemHandler {
-
-    public static ElementEntity getElementEntity(String id, List<String>
-      elementPath, Info info, Collection<Relation> relations, List<String> subElements,
-                                                byte[] data) {
-    ElementEntity elementEntity = new ElementEntity(new Id(id));
-
-    Namespace namespace = new Namespace();
-    for (String elementId : elementPath) {
-      namespace = new Namespace(namespace, new Id(elementId));
-    }
-    elementEntity.setNamespace(namespace);
-    elementEntity.setParentId(namespace.getParentElementId());
-    elementEntity.setInfo(info);
-    elementEntity.setRelations(relations);
-    if(subElements!=null) {
-      Set<Id> subElementSet = new HashSet<>();
-
-      subElements.forEach(subElement -> subElementSet.add(new Id(subElement)));
-
-      elementEntity.setSubElementIds(subElementSet);
-    }
-
-    //elementEntity.setData(new ByteArrayInputStream(data));
-    return elementEntity;
-  }
-
-  public static List<String> getElementPath(String... paths) {
-    List<String> pathList = new ArrayList<>();
-    for (String path : paths) {
-      pathList.add(path);
-    }
-    return pathList;
-  }
-
-  public static Info getStractualElementInfo(String elementName) {
-    Info info = new Info();
-    info.setName(elementName);
-    return info;
-  }
-
-  public static void save(SessionContext context, ItemCassandraDao itemCassandraDao,
-                          VersionCassandraDao versionCassandraDao,
-                          String itemId, Version versionId, Info info,
-                          ItemVersionData itemVersionData, Long writetimeMicroSeconds) {
-
-    Date date = writetimeMicroSeconds==null?new Date():new Date(writetimeMicroSeconds);
-    itemCassandraDao.create(context,new Id(itemId),info,date);
-
-    versionCassandraDao.create(context, context.getUser().getUserName(),new Id(itemId),
-        null,getVersionId(itemId,versionId),itemVersionData,date);
-
-    if(isActiveVersion(itemId,versionId)){
-      versionCassandraDao.create(context, context.getUser().getUserName(),new Id(itemId),
-          null,new Id(versionId.toString()),itemVersionData,date);
-    }
-  }
-
-
-
-  private static Info getInfo(VendorLicenseModelEntity vlmEntity) {
-    Info info = new Info();
-
-    info.setName(vlmEntity.getVendorName());
-    info.setDescription(vlmEntity.getDescription());
-    info.addProperty("iconRef",vlmEntity.getIconRef());
-    info.addProperty("type",vlmEntity.getIconRef());
-    return info;
-  }
-
-  private static Id getVersionId(String itemId, Version versionId) {
-    VersionInfoEntity versionInfo =
-        MigrationMain.getVersionInfoMap().get(itemId);
-    if (versionInfo == null) {
-      return new Id(versionId.toString());
-    }
-    Version lastVersion = versionInfo.getCandidate() != null ? versionInfo.getCandidate()
-        .getVersion()
-        : versionInfo.getActiveVersion();
-
-    if (lastVersion.equals(versionId)) {
-      return new Id(itemId);
-    } else {
-      return new Id(versionId.toString());
-    }
-  }
-  private static boolean isActiveVersion(String itemId, Version versionId) {
-    VersionInfoEntity versionInfo =
-        MigrationMain.getVersionInfoMap().get(itemId);
-    if (versionInfo == null) {
-      return false;
-    }
-
-    return versionInfo.getActiveVersion().equals(versionId);
-  }
-
-
-}
\ No newline at end of file
diff --git a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/util/Utils.java b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/util/Utils.java
deleted file mode 100644
index ea026e5..0000000
--- a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/util/Utils.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package org.openecomp.core.migration.util;
-
-import org.openecomp.sdc.logging.api.Logger;
-
-/**
- * @author Avrahamg
- * @since April 24, 2017
- */
-public class Utils {
-  public static void printMessage(Logger logger, String message) {
-    System.out.println(message);
-    logger.debug(message);
-  }
-}
-
diff --git a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/util/marker/MigrationMarker.java b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/util/marker/MigrationMarker.java
deleted file mode 100644
index 4481b43..0000000
--- a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/util/marker/MigrationMarker.java
+++ /dev/null
@@ -1,49 +0,0 @@
-package org.openecomp.core.migration.util.marker;
-
-import com.datastax.driver.mapping.annotations.Accessor;
-import com.datastax.driver.mapping.annotations.Query;
-import org.openecomp.core.migration.MigrationMain;
-import org.openecomp.core.nosqldb.api.NoSqlDb;
-import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
-
-/**
- * @author katyr
- * @since May 01, 2017
- */
-
-public class MigrationMarker {
-
-  private static Logger logger = LoggerFactory.getLogger(MigrationMain.class);
-
-  private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface();
-  private static final MigrationTableAccessor accessor =
-      noSqlDb.getMappingManager().createAccessor(MigrationMarker.MigrationTableAccessor.class);
-
-  public static Boolean isMigrated() {
-
-    MigrationMarkerEntity result = accessor.isMigrated();
-    if (result == null) {
-      return false;
-    } else {
-      return result.getMigrated();
-    }
-  }
-
-  public static void markMigrated() {
-    accessor.markMigrated();
-  }
-
-  @Accessor
-  interface MigrationTableAccessor {
-    @Query("SELECT * FROM migration where id='1'")
-    MigrationMarkerEntity isMigrated();
-
-
-    @Query("insert into migration (id,isMigrated) values('1',true)")
-    void markMigrated();
-
-  }
-
-}
diff --git a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/util/marker/MigrationMarkerEntity.java b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/util/marker/MigrationMarkerEntity.java
deleted file mode 100644
index 47bb91d..0000000
--- a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/util/marker/MigrationMarkerEntity.java
+++ /dev/null
@@ -1,45 +0,0 @@
-package org.openecomp.core.migration.util.marker;
-
-import com.datastax.driver.mapping.annotations.ClusteringColumn;
-import com.datastax.driver.mapping.annotations.Column;
-import com.datastax.driver.mapping.annotations.Table;
-
-/**
- * @author katyr
- * @since May 03, 2017
- */
-
-@Table(keyspace = "dox", name = "migration")
-public class MigrationMarkerEntity {
-
-  @ClusteringColumn
-  private String id;
-
-  @Column(name = "ismigrated")
-  private Boolean migrated;
-
-  public Boolean getMigrated() {
-    return migrated;
-  }
-
-  public void setMigrated(Boolean migrated) {
-    this.migrated = migrated;
-  }
-
-  public String getId() {
-    return id;
-  }
-
-  public void setId(String id) {
-    this.id = id;
-  }
-
-  @Override
-  public String toString() {
-    final StringBuilder sb = new StringBuilder("MigrationMarkerEntity{");
-    sb.append("id='").append(id).append('\'');
-    sb.append(", migrated=").append(migrated);
-    sb.append('}');
-    return sb.toString();
-  }
-}
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/ExportDataCommand.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/ExportDataCommand.java
deleted file mode 100644
index 487b413..0000000
--- a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/ExportDataCommand.java
+++ /dev/null
@@ -1,67 +0,0 @@
-package org.openecomp.core.tools.Commands;
-
-import static java.nio.file.Files.createDirectories;
-
-import com.amdocs.zusammen.datatypes.SessionContext;
-import org.apache.commons.io.FileUtils;
-import org.openecomp.core.tools.Commands.exportdata.ElementHandler;
-import org.openecomp.core.tools.Commands.exportdata.ImportProperties;
-import org.openecomp.core.tools.Commands.exportdata.ItemHandler;
-import org.openecomp.core.tools.Commands.exportdata.VersionHandler;
-import org.openecomp.core.tools.util.ZipUtils;
-import org.openecomp.core.zusammen.impl.CassandraConnectionInitializer;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
-
-import java.io.File;
-import java.io.IOException;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.time.LocalDateTime;
-import java.time.format.DateTimeFormatter;
-import java.util.HashSet;
-import java.util.Set;
-public class ExportDataCommand {
-    private static final Logger logger = LoggerFactory.getLogger(ExportDataCommand.class);
-
-    public static void exportData(SessionContext context, String filterItem) {
-        try {
-            Set<String> filteredItem = new HashSet<>();
-            filteredItem.add(filterItem);
-            ImportProperties.initParams();
-            CassandraConnectionInitializer.setCassandraConnectionPropertiesToSystem();
-            Path rootDir = Paths.get(ImportProperties.ROOT_DIRECTORY);
-            initDir(rootDir);
-            if (filterItem != null) {
-                filterItem = filterItem.replaceAll("\\r", "");
-            }
-            new ItemHandler().createItemsData(context, filteredItem);
-            new VersionHandler().loadVersions(filteredItem);
-            new ElementHandler().loadElements(filteredItem);
-            zipPath(rootDir,filteredItem);
-            FileUtils.forceDelete(rootDir.toFile());
-        } catch (Exception ex) {
-            logger.error(ex.getMessage(), ex);
-        }
-
-    }
-    private static void zipPath(Path rootDir,Set<String> filterItem ) throws Exception{
-        LocalDateTime date = LocalDateTime.now();
-        DateTimeFormatter formatter = DateTimeFormatter.ISO_LOCAL_DATE_TIME;
-        String dateStr = date.format(formatter);
-        String zipFile = System.getProperty("user.home")+ File.separatorChar+"onboarding_import"+ dateStr + ".zip";
-        ZipUtils.createZip(zipFile, rootDir,filterItem);
-        logger.info("Exported file :" + zipFile);
-        System.out.println("Exported file :" + zipFile);
-    }
-
-
-    public static void initDir(Path rootDir ) throws IOException{
-        if (Files.exists(rootDir)) {
-            FileUtils.forceDelete(rootDir.toFile());
-        }
-        createDirectories(rootDir);
-    }
-
-}
\ No newline at end of file
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/HealAll.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/HealAll.java
index 2bc48bd..40a56ed 100644
--- a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/HealAll.java
+++ b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/HealAll.java
@@ -3,6 +3,8 @@
 import org.apache.commons.collections.CollectionUtils;
 import org.openecomp.core.tools.concurrent.ItemHealingTask;
 import org.openecomp.core.tools.loaders.VersionInfoCassandraLoader;
+import org.openecomp.sdc.healing.api.HealingManager;
+import org.openecomp.sdc.healing.factory.HealingManagerFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants;
 import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductManager;
 import org.openecomp.sdc.vendorsoftwareproduct.VspManagerFactory;
@@ -31,18 +33,20 @@
 public class HealAll {
 
   private static final String HEALING_USER = "healing_user";
-  private static final int defaulThreadNumber =100;
+  private static final int defaulThreadNumber = 100;
   private static BufferedWriter log;
   private static List<ItemHealingTask> tasks = new ArrayList<>();
   private static VendorSoftwareProductManager vspManager = VspManagerFactory
       .getInstance().createInterface();
+  private static HealingManager healingManager = HealingManagerFactory.getInstance()
+      .createInterface();
   private static VersioningManager versioningManager = VersioningManagerFactory.getInstance()
       .createInterface();
 
   static {
     try {
       log =
-          new BufferedWriter(new FileWriter("healing.log",true));
+          new BufferedWriter(new FileWriter("healing.log", true));
     } catch (IOException e) {
       if (log != null) {
         try {
@@ -64,13 +68,13 @@
         defaulThreadNumber;
     ExecutorService executor = Executors.newFixedThreadPool(numberOfThreads);
 
-   filterByEntityType(VersionInfoCassandraLoader.list(),
+    filterByEntityType(VersionInfoCassandraLoader.list(),
         VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE).forEach
-       (HealAll::addTaskToTasks);
+        (HealAll::addTaskToTasks);
 
     executeAllTasks(executor);
 
-    writeToLog("----finished healing------" );
+    writeToLog("----finished healing------");
     Instant endTime = Instant.now();
     writeToLog("Total runtime was: " + Duration.between(startTime, endTime));
 
@@ -112,7 +116,7 @@
     if (Objects.nonNull(versionInfoEntity.getCandidate())) {
       return versionInfoEntity.getCandidate().getVersion();
     } else if (!CollectionUtils.isEmpty(versionInfoEntity.getViewableVersions())) {
-     return versionInfoEntity.getViewableVersions().stream().max(Version::compateTo).get();
+      return versionInfoEntity.getViewableVersions().stream().max(Version::compateTo).get();
     }
     return versionInfoEntity.getActiveVersion();
   }
@@ -126,17 +130,16 @@
     }
   }
 
-  private static Stream<VersionInfoEntity> filterByEntityType(Collection<VersionInfoEntity>
-                                                             versionInfoEntities,
-                                                     String entityType){
+  private static Stream<VersionInfoEntity> filterByEntityType(
+      Collection<VersionInfoEntity> versionInfoEntities, String entityType) {
     return versionInfoEntities.stream().filter(versionInfoEntity -> versionInfoEntity
         .getEntityType().equals(entityType));
   }
-  private static void addTaskToTasks(VersionInfoEntity versionInfoEntity){
+
+  private static void addTaskToTasks(VersionInfoEntity versionInfoEntity) {
     tasks.add(new ItemHealingTask(versionInfoEntity.getEntityId(), resolveVersion
-            (versionInfoEntity).toString(), versionInfoEntity.getCandidate() == null ?
-            HEALING_USER : versionInfoEntity.getCandidate().getUser(),
-            vspManager, versioningManager));
+        (versionInfoEntity).toString(),
+        vspManager, healingManager));
   }
 
 }
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/ImportCommand.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/ImportCommand.java
deleted file mode 100644
index cebff91..0000000
--- a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/ImportCommand.java
+++ /dev/null
@@ -1,45 +0,0 @@
-package org.openecomp.core.tools.Commands;
-
-import com.amdocs.zusammen.datatypes.SessionContext;
-import org.apache.commons.io.FileUtils;
-import org.openecomp.core.tools.Commands.importdata.TreeWalker;
-import org.openecomp.core.tools.Commands.exportdata.ImportProperties;
-import org.openecomp.core.tools.util.ZipUtils;
-import org.openecomp.core.zusammen.impl.CassandraConnectionInitializer;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
-
-import java.nio.file.Path;
-import java.nio.file.Paths;
-
-public class ImportCommand {
-
-    private static final Logger logger = LoggerFactory.getLogger(ImportCommand.class);
-
-
-    public static void importData(SessionContext context, String zippedFile, String filterItem) {
-        try {
-            ImportProperties.initParams();
-            CassandraConnectionInitializer.setCassandraConnectionPropertiesToSystem();
-            if (zippedFile == null){
-                logger.error("Import must have a valid file as an input.");
-            }
-            if (zippedFile != null) {
-                zippedFile = zippedFile.replaceAll("\\r", "");
-                if (filterItem != null) {
-                    filterItem = filterItem.replaceAll("\\r", "");
-                }
-                Path rootDir = Paths.get(ImportProperties.ROOT_DIRECTORY);
-                ExportDataCommand.initDir(rootDir);
-                ZipUtils.unzip(Paths.get(zippedFile), rootDir);
-                TreeWalker.walkFiles(context, rootDir, filterItem);
-                FileUtils.forceDelete(rootDir.toFile()); // clear all unzip data at the end.
-            }
-
-
-        } catch (Exception ex) {
-            logger.error(ex.getMessage(), ex);
-        }
-    }
-
-}
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/SetHealingFlag.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/SetHealingFlag.java
new file mode 100644
index 0000000..b885ac5
--- /dev/null
+++ b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/SetHealingFlag.java
@@ -0,0 +1,31 @@
+package org.openecomp.core.tools.Commands;
+
+import com.datastax.driver.core.ResultSet;
+import org.openecomp.core.tools.store.HealingHandler;
+import org.openecomp.core.tools.store.VersionCassandraLoader;
+import org.openecomp.core.tools.store.zusammen.datatypes.HealingEntity;
+
+import java.util.ArrayList;
+
+
+/**
+ * Created by ayalaben on 10/15/2017
+ */
+public class SetHealingFlag {
+
+
+  public static void populateHealingTable(String oldVersion) {
+
+    VersionCassandraLoader versionCassandraLoader = new VersionCassandraLoader();
+    ResultSet listItemVersion = versionCassandraLoader.listItemVersion();
+
+    ArrayList<HealingEntity> healingEntities = new ArrayList<HealingEntity>();
+
+    listItemVersion.iterator().forEachRemaining(entry -> healingEntities.add(new HealingEntity
+        (entry.getString(0),entry.getString(1),entry.getString(2),true,oldVersion)));
+
+    HealingHandler healingHandler = new HealingHandler();
+    healingHandler.populateHealingTable(healingEntities);
+
+  }
+}
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/exportdata/ElementHandler.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/exportdata/ElementHandler.java
deleted file mode 100644
index e03b7ff..0000000
--- a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/exportdata/ElementHandler.java
+++ /dev/null
@@ -1,108 +0,0 @@
-package org.openecomp.core.tools.Commands.exportdata;
-
-
-import org.openecomp.core.tools.store.ElementCassandraLoader;
-import org.openecomp.core.tools.store.zusammen.datatypes.ElementEntity;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
-
-import java.nio.ByteBuffer;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.util.Objects;
-import java.util.Set;
-
-import static java.io.File.separator;
-import static java.nio.file.Files.*;
-import static org.openecomp.core.tools.Commands.exportdata.ImportProperties.*;
-
-public class ElementHandler {
-
-    private static final Logger logger = LoggerFactory.getLogger(ElementHandler.class);
-
-    public ElementHandler() {
-    }
-
-    public void loadElements(Set<String> filteredItem) {
-        ElementCassandraLoader elementCassandraLoader = new ElementCassandraLoader();
-          elementCassandraLoader.list().forEach(elementEntity ->  handleElementEntity(elementEntity,filteredItem));
-    }
-
-    private void handleElementEntity(ElementEntity elementEntity, Set<String> filteredItem) {
-        try {
-            String itemId = elementEntity.getItemId();
-
-            if (!filteredItem.isEmpty() && !filteredItem.contains(itemId)){
-                return;
-            }
-            String versionId = elementEntity.getVersionId();
-            String space = elementEntity.getSpace();
-            String namespace = elementEntity.getNamespace();
-            String elementId = elementEntity.getElement_id();
-
-            String namespacePath = separator;
-            if (!isNull(namespace)){
-                namespacePath =  namespace.replace(ELEMENT_NAMESPACE_SPLITTER,separator)+separator;
-            }
-            Path elementDirectoryPath;
-            if (!isNull(namespace)){
-                elementDirectoryPath = Paths.get( ROOT_DIRECTORY + separator + itemId
-                        + separator + versionId + separator + space + separator + namespacePath+ separator + elementId);
-            } else {
-                elementDirectoryPath = Paths.get( ROOT_DIRECTORY + separator + itemId
-                        + separator + versionId + separator + space + separator + elementId);
-              }
-
-            if (notExists(elementDirectoryPath)) {
-                 Path created = createDirectories(elementDirectoryPath);
-             }
-
-            String info = elementEntity.getInfo();
-            if (!isNull(info)) {
-                Path infoFilePath = Paths.get(elementDirectoryPath.toString() + separator + ELEMENT_INFO_PREFIX
-                        + elementId + JSON_POSTFIX);
-                write(infoFilePath, info.getBytes());
-            }
-
-            String relations = elementEntity.getRelations();
-            if (!isNull(relations)) {
-                Path realtionsFilePath = Paths.get(elementDirectoryPath.toString() + separator
-                        + ELEMENT_RELATION_PREFIX + elementId + JSON_POSTFIX);
-                write(realtionsFilePath, relations.getBytes());
-            }
-
-            ByteBuffer data = elementEntity.getData();
-            if (!Objects.isNull(data)) {
-                Path dataFilePath = Paths.get(elementDirectoryPath.toString() + separator
-                        + ELEMENT_DATA_PREFIX + elementId + JSON_POSTFIX);
-                write(dataFilePath, data.array());
-            }
-
-            ByteBuffer visualization = elementEntity.getVisualization();
-            if (!Objects.isNull(visualization)) {
-                Path visualFilePath = Paths.get(elementDirectoryPath.toString() + separator
-                        + ELEMENT_VISUALIZATION_PREFIX + elementId );
-                write(visualFilePath, visualization.array());
-            }
-
-            ByteBuffer searchableData = elementEntity.getSearchableData();
-            if (!Objects.isNull(searchableData)) {
-                Path searchableFilePath = Paths.get(elementDirectoryPath.toString() + separator
-                        + ELEMENT_SEARCHABLE_PREFIX + elementId);
-                write(searchableFilePath, searchableData.array());
-            }
-
-        } catch (Exception ex) {
-            logger.error(ex.getMessage(), ex);
-        }
-
-    }
-
-    private boolean isNull(String inStr){
-        if (Objects.isNull(inStr)){
-            return true;
-        }
-        return inStr.trim().equalsIgnoreCase("null");
-    }
-
-}
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/exportdata/ImportProperties.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/exportdata/ImportProperties.java
deleted file mode 100644
index 3b7566f..0000000
--- a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/exportdata/ImportProperties.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package org.openecomp.core.tools.Commands.exportdata;
-
-import java.io.File;
-
-public class ImportProperties {
-    public static final String VERSION_FILE_PREFIX = "version_";
-    public static final String VERSION_INFO_FILE_PREFIX = "version_info_";
-    public static final String JSON_POSTFIX = ".json";
-
-    public static final String ELEMENT_INFO_PREFIX = "elem_info";
-    public static final String ELEMENT_RELATION_PREFIX = "elem_relations";
-    public static final String ELEMENT_DATA_PREFIX = "elem_data";
-    public static final String ELEMENT_VISUALIZATION_PREFIX = "elem_visualization";
-    public static final String ELEMENT_SEARCHABLE_PREFIX = "elem_searchableData";
-    public static final String ELEMENT_NAMESPACE_SPLITTER = "/";
-    public static String ROOT_DIRECTORY;
-    public static final void initParams(){
-         ROOT_DIRECTORY = System.getProperty("user.home")+File.separator+ "onboarding_import";
-    }
-}
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/exportdata/ItemHandler.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/exportdata/ItemHandler.java
deleted file mode 100644
index ebbfb56..0000000
--- a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/exportdata/ItemHandler.java
+++ /dev/null
@@ -1,87 +0,0 @@
-package org.openecomp.core.tools.Commands.exportdata;
-
-import com.amdocs.zusammen.datatypes.Id;
-import com.amdocs.zusammen.datatypes.SessionContext;
-import com.amdocs.zusammen.datatypes.item.Item;
-import com.amdocs.zusammen.plugin.statestore.cassandra.dao.ItemDao;
-import com.amdocs.zusammen.plugin.statestore.cassandra.dao.ItemDaoFactory;
-import com.google.common.base.Strings;
-import org.openecomp.core.tools.Commands.ExportDataCommand;
-import org.openecomp.core.utilities.json.JsonUtil;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
-
-import java.io.IOException;
-import java.net.URISyntaxException;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Optional;
-import java.util.Set;
-
-import static java.io.File.separator;
-import static java.nio.file.Files.*;
-import static org.openecomp.core.tools.Commands.exportdata.ImportProperties.JSON_POSTFIX;
-
-public class ItemHandler {
-    private static final Logger logger = LoggerFactory.getLogger(ExportDataCommand.class);
-
-
-    public ItemHandler() {
-        ImportProperties.initParams();
-    }
-
-    public void createItemsData(SessionContext context, Set<String> filteredItem) throws URISyntaxException, IOException {
-        final List<Item> items = new ArrayList<>();
-        if (filteredItem.isEmpty()) {
-            items.addAll(getItemDao(context).list(context));
-        } else {
-            Optional<Item> item = addItem(context, filteredItem.iterator().next(), items);
-            item.ifPresent(foundedItem -> {
-                Object vendorId =  foundedItem.getInfo().getProperty("vendorId");
-                if (vendorId != null) {
-                    String vendorIdStr = vendorId.toString();
-                    addItem(context, vendorIdStr, items);
-                    filteredItem.add(vendorIdStr);
-                }
-            });
-        }
-
-        items.parallelStream().forEach(item -> createItemDirectoryAndFiles(item, filteredItem));
-
-    }
-
-
-
-    private Optional<Item> addItem(SessionContext context, String filteredItem, List<Item> items) {
-        Optional<Item> item = getItemDao(context).get(context, new Id(filteredItem));
-        item.ifPresent(itemData -> items.add(itemData));
-        return item;
-    }
-
-    private final void createItemDirectoryAndFiles(Item item, Set<String> filteredItem) {
-        try {
-            String itemId = item.getId().getValue();
-            if (!filteredItem.isEmpty() && !filteredItem.contains(itemId)) {
-                return;
-            }
-            Path itemPath = Paths.get(ImportProperties.ROOT_DIRECTORY + separator + itemId);
-            Path itemFilePath = Paths.get(ImportProperties.ROOT_DIRECTORY + separator +
-                    itemId + separator + itemId + JSON_POSTFIX);
-            if (notExists(itemPath)) {
-                createDirectories(itemPath);
-            }
-            String itemJson = JsonUtil.object2Json(item);
-            write(itemFilePath, itemJson.getBytes());
-        } catch (Exception ex) {
-            logger.error(ex.getMessage(), ex);
-        }
-
-    }
-
-
-    private ItemDao getItemDao(SessionContext context) {
-        return ItemDaoFactory.getInstance().createInterface(context);
-    }
-}
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/exportdata/VersionHandler.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/exportdata/VersionHandler.java
deleted file mode 100644
index 4ff5624..0000000
--- a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/exportdata/VersionHandler.java
+++ /dev/null
@@ -1,73 +0,0 @@
-package org.openecomp.core.tools.Commands.exportdata;
-
-import org.openecomp.core.tools.Commands.ExportDataCommand;
-import org.openecomp.core.tools.store.VersionInfoCassandraLoader;
-import org.openecomp.core.tools.store.VersionCassandraLoader;
-
-import org.openecomp.core.tools.store.zusammen.datatypes.VersionEntity;
-import org.openecomp.core.utilities.json.JsonUtil;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
-import org.openecomp.sdc.versioning.dao.types.VersionInfoEntity;
-
-import static java.io.File.separator;
-import static java.nio.file.Files.*;
-import static org.openecomp.core.tools.Commands.exportdata.ImportProperties.*;
-import static org.openecomp.core.tools.Commands.exportdata.ImportProperties.ROOT_DIRECTORY;
-
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.util.Set;
-
-public class VersionHandler {
-    private static final Logger logger = LoggerFactory.getLogger(ExportDataCommand.class);
-
-    public VersionHandler() {
-    }
-
-    public void loadVersions(Set<String> filteredItem) {
-        VersionCassandraLoader versionCassandraLoader = new VersionCassandraLoader();
-        versionCassandraLoader.list().forEach(versionEntity -> handleVersionEntity(versionEntity,filteredItem));
-        VersionInfoCassandraLoader versionInfoCassandraLoader = new VersionInfoCassandraLoader();
-        versionInfoCassandraLoader.list().forEach(versionInfoEntity ->  handleVersionInfo(versionInfoEntity,filteredItem));
-    }
-
-    private void handleVersionEntity(VersionEntity versionEntity, Set<String> filteredItem) {
-        try {
-            String itemId = versionEntity.getItemId();
-            if (!filteredItem.isEmpty()  && !filteredItem.contains(itemId)){
-                return;
-            }
-            String versionId = versionEntity.getVersionId();
-            String space = versionEntity.getSpace();
-            Path versionDirectoryPath = Paths.get( ROOT_DIRECTORY + separator + itemId
-                    + separator + versionId + separator + space);
-            Path versionFilePath = Paths.get(versionDirectoryPath.toString() + separator + VERSION_FILE_PREFIX
-                    + versionId + JSON_POSTFIX);
-            if (notExists(versionDirectoryPath)) {
-                createDirectories(versionDirectoryPath);
-            }
-            String versionJson = JsonUtil.object2Json(versionEntity);
-            write(versionFilePath, versionJson.getBytes());
-        } catch (Exception ex) {
-            logger.error(ex.getMessage(), ex);
-        }
-
-    }
-
-    private void handleVersionInfo(VersionInfoEntity versionInfoEntity, Set<String> filteredItem) {
-        try {
-            String itemId = versionInfoEntity.getEntityId();
-            Path itemDirectory = Paths.get( ROOT_DIRECTORY + separator + itemId);
-            Path versionInfoFilePath = Paths.get(itemDirectory.toString() + separator + VERSION_INFO_FILE_PREFIX
-                    + itemId + JSON_POSTFIX);
-            if (exists(itemDirectory)) {
-                String versionJson = JsonUtil.object2Json(versionInfoEntity);
-                write(versionInfoFilePath, versionJson.getBytes());
-            }
-        } catch (Exception ex) {
-            logger.error(ex.getMessage(), ex);
-        }
-
-    }
-}
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/importdata/ElementImport.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/importdata/ElementImport.java
deleted file mode 100644
index d439468..0000000
--- a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/importdata/ElementImport.java
+++ /dev/null
@@ -1,135 +0,0 @@
-package org.openecomp.core.tools.Commands.importdata;
-
-import com.amdocs.zusammen.datatypes.Id;
-import com.amdocs.zusammen.datatypes.SessionContext;
-import org.openecomp.core.tools.store.ElementCassandraLoader;
-import org.openecomp.core.tools.store.ElementNamespaceHandler;
-import org.openecomp.core.tools.store.VersionCassandraLoader;
-import org.openecomp.core.tools.store.zusammen.datatypes.ElementEntity;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
-
-import java.io.File;
-import java.io.IOException;
-import java.nio.ByteBuffer;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Set;
-
-import static java.io.File.separator;
-import static org.openecomp.core.tools.Commands.exportdata.ImportProperties.*;
-
-public class ElementImport {
-    private static final Logger logger = LoggerFactory.getLogger(ElementImport.class);
-    public static final String ROOT_ITEM = Id.ZERO.getValue();
-
-    private ElementCassandraLoader elementCassandraLoader = new ElementCassandraLoader();
-    private ElementNamespaceHandler cassandraElementRepository = new ElementNamespaceHandler();
-    private VersionCassandraLoader versionCassandraLoader = new VersionCassandraLoader();
-
-    public void loadPath(SessionContext sessionContext, Path elementDir, String elementId, String[]
-            pathObjects) {
-        try {
-            if (!Files.isDirectory(elementDir)){
-                return;
-            }
-            // load info file
-            ElementEntity elementEntity = new ElementEntity();
-            Path infoFilePath = Paths.get(elementDir.toString() + separator + ELEMENT_INFO_PREFIX
-                    + elementId + JSON_POSTFIX);
-            if (Files.exists(infoFilePath)) {
-                String info = new String(Files.readAllBytes(infoFilePath));
-                elementEntity.setInfo(info);
-            }
-            // load relation file
-            Path realtionsFilePath = Paths.get(elementDir.toString() + separator
-                    + ELEMENT_RELATION_PREFIX + elementId + JSON_POSTFIX);
-            if (Files.exists(realtionsFilePath)) {
-                String relations = new String(Files.readAllBytes(realtionsFilePath));
-                elementEntity.setRelations(relations);
-            }
-
-            //load entity data
-            Path dataFilePath = Paths.get(elementDir.toString() + separator
-                    + ELEMENT_DATA_PREFIX + elementId + JSON_POSTFIX);
-            if (Files.exists(dataFilePath)) {
-                byte[] bytes = Files.readAllBytes(dataFilePath);
-                ByteBuffer data = ByteBuffer.wrap(bytes);
-                elementEntity.setData(data);
-            }
-
-            //load visualization
-            Path visualFilePath = Paths.get(elementDir.toString() + separator
-                    + ELEMENT_VISUALIZATION_PREFIX + elementId);
-            if (Files.exists(visualFilePath)) {
-                byte[] bytes = Files.readAllBytes(visualFilePath);
-                ByteBuffer visualization = ByteBuffer.wrap(bytes);
-                elementEntity.setVisualization(visualization);
-            }
-
-            //load searchable
-            Path searchableFilePath = Paths.get(elementDir.toString() + separator
-                    + ELEMENT_SEARCHABLE_PREFIX + elementId);
-            if (Files.exists(searchableFilePath)) {
-                byte[] bytes = Files.readAllBytes(searchableFilePath);
-                ByteBuffer searchable = ByteBuffer.wrap(bytes);
-                elementEntity.setSearchableData(searchable);
-            }
-            String element_Id = pathObjects[pathObjects.length - 1];
-            elementEntity.setSpace(pathObjects[2]);
-            elementEntity.setItemId(pathObjects[0]);
-            elementEntity.setVersionId(pathObjects[1]);
-            elementEntity.setElement_id(element_Id);
-            elementEntity.setNamespace(getNameSpace(pathObjects));
-            elementEntity.setParentId(getParentId(pathObjects));
-            elementEntity.setSubElementIds(getAllSubElementsIds(elementDir, element_Id));
-            elementCassandraLoader.createEntity(elementEntity);
-            cassandraElementRepository.createElementNamespace(elementEntity);
-            versionCassandraLoader.insertElementToVersion(elementEntity);
-        } catch (Exception ex) {
-            logger.error(ex.getMessage(), ex);
-        }
-    }
-
-    private String getParentId(String[] pathObjects) {
-
-        if (pathObjects[pathObjects.length - 1].equals(ROOT_ITEM)) {
-            return null;
-        }
-        if (pathObjects.length == 4) {
-            return ROOT_ITEM;
-        }
-        return pathObjects[pathObjects.length - 2];
-    }
-
-    private Set<String> getAllSubElementsIds(Path root, String elementId) throws IOException {
-        if (elementId.equals(ROOT_ITEM)) {
-            root = root.getParent();
-        }
-        File file = root.toFile();
-        Set<String> retVal = new HashSet<>();
-        File[] files = file.listFiles();
-        for (File f : files){
-            if (f.isDirectory()){
-                retVal.add(f.getName());
-            }
-        }
-        retVal.remove(ROOT_ITEM);
-        return retVal;
-
-    }
-
-    private String getNameSpace(String[] pathObjects) {
-        if (pathObjects.length <= 4) {
-            return "";
-        }
-        if (pathObjects.length == 5) {
-            return pathObjects[3];
-        }
-        return Arrays.stream(pathObjects, 3, pathObjects.length - 1)
-                .reduce("", (s1, s2) -> s1 + File.separator + s2);
-    }
-}
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/importdata/ItemImport.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/importdata/ItemImport.java
deleted file mode 100644
index 4dd4a1f..0000000
--- a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/importdata/ItemImport.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package org.openecomp.core.tools.Commands.importdata;
-
-import com.amdocs.zusammen.datatypes.SessionContext;
-import com.amdocs.zusammen.datatypes.item.Item;
-import com.amdocs.zusammen.plugin.statestore.cassandra.dao.ItemDao;
-import com.amdocs.zusammen.plugin.statestore.cassandra.dao.ItemDaoFactory;
-import org.openecomp.core.utilities.json.JsonUtil;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
-
-import java.io.File;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-
-import static org.openecomp.core.tools.Commands.exportdata.ImportProperties.JSON_POSTFIX;
-
-public class ItemImport {
-    private static final Logger logger = LoggerFactory.getLogger(ItemImport.class);
-
-    public void loadPath(SessionContext sessionContext, Path itemDir, String itemName) {
-        try {
-            Path itemPath = Paths.get(itemDir.toString() + File.separator + itemName + JSON_POSTFIX);
-            if (!Files.exists(itemPath)) {
-                return;
-            }
-            String itemJson = new String(Files.readAllBytes(itemPath));
-            if (itemJson.trim().isEmpty()) {
-                return;
-            }
-            Item item = JsonUtil.json2Object(itemJson, Item.class);
-            ItemDao itemDao = getItemDao(sessionContext);
-            itemDao.create(sessionContext, item.getId(), item.getInfo(), item.getCreationTime());
-            logger.info("Item Created :"+item.getInfo().getName()+" , "+item.getId());
-            System.out.println("Item Created :"+item.getInfo().getName()+" , "+item.getId());
-        } catch (Exception ex) {
-            logger.error(ex.getMessage(), ex);
-        }
-    }
-
-    private ItemDao getItemDao(SessionContext context) {
-        return ItemDaoFactory.getInstance().createInterface(context);
-    }
-}
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/importdata/TreeWalker.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/importdata/TreeWalker.java
deleted file mode 100644
index 30c4152..0000000
--- a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/importdata/TreeWalker.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package org.openecomp.core.tools.Commands.importdata;
-
-import com.amdocs.zusammen.datatypes.SessionContext;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
-
-import java.io.File;
-import java.io.IOException;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.util.stream.Stream;
-
-public class TreeWalker {
-    private static final Logger logger = LoggerFactory.getLogger(TreeWalker.class);
-
-    public static final void walkFiles(SessionContext sessionContext,Path rootDir, String filterItem) throws IOException {
-        try (Stream<Path> walk = Files.walk(rootDir)) {
-            walk.parallel().filter(path -> Files.isDirectory(path)).
-                    forEach(path -> handlePath(sessionContext,path, rootDir, filterItem));
-        }
-    }
-
-    private static final void handlePath(SessionContext sessionContext, Path path, Path root,String filterItem) {
-        String logicalPath = path.toString().replace(root.toString(), "");
-        if (logicalPath.startsWith(File.separator)){
-            logicalPath = logicalPath.substring(1);
-        }
-        String[] splitted = logicalPath.split(File.separator);
-        if(filterItem != null && splitted.length > 0 && !splitted[0].contains(filterItem)){
-            return;
-        }
-        switch (splitted.length) {
-            case 0:
-                //root - ignore
-                break;
-            case 1:     // handle Item
-                new ItemImport().loadPath(sessionContext,path,splitted[splitted.length -1]);
-                new VersionInfoImport().loadPath(sessionContext,path,splitted[splitted.length -1]);
-                break;
-            case 2:
-                //ignore this level
-                break;
-            case 3: // handle version
-                new VersionImport().loadPath(sessionContext,path,splitted[splitted.length -2]);
-                break;
-            default:
-                //handle elements
-                 new ElementImport().loadPath(sessionContext,path,splitted[splitted.length -1],splitted);
-                break;
-        }
-
-    }
-
-}
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/importdata/VersionImport.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/importdata/VersionImport.java
deleted file mode 100644
index 48433d8..0000000
--- a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/importdata/VersionImport.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package org.openecomp.core.tools.Commands.importdata;
-
-import com.amdocs.zusammen.datatypes.SessionContext;
-import org.openecomp.core.tools.store.VersionCassandraLoader;
-import org.openecomp.core.tools.store.zusammen.datatypes.VersionEntity;
-import org.openecomp.core.utilities.json.JsonUtil;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
-
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-
-import static java.io.File.separator;
-import static org.openecomp.core.tools.Commands.exportdata.ImportProperties.JSON_POSTFIX;
-import static org.openecomp.core.tools.Commands.exportdata.ImportProperties.VERSION_FILE_PREFIX;
-
-public class VersionImport {
-    private static final Logger logger = LoggerFactory.getLogger(VersionImport.class);
-
-    public void loadPath(SessionContext sessionContext, Path versionDir , String versionId){
-        try {
-            Path versionPath = Paths.get(versionDir.toString() + separator + VERSION_FILE_PREFIX
-                    + versionId + JSON_POSTFIX);
-            if (!Files.exists(versionPath)) {
-                return;
-            }
-            String versionJson = new String(Files.readAllBytes(versionPath));
-            if (versionJson.trim().isEmpty()) {
-                return;
-            }
-            VersionEntity versionEntity = JsonUtil.json2Object(versionJson, VersionEntity.class);
-            VersionCassandraLoader versionCassandraLoader = new VersionCassandraLoader();
-            versionCassandraLoader.insertVersion(versionEntity);
-        } catch (Exception ex) {
-            logger.error(ex.getMessage(), ex);
-        }
-    }
-
-
-}
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/importdata/VersionInfoImport.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/importdata/VersionInfoImport.java
deleted file mode 100644
index e9d4174..0000000
--- a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/importdata/VersionInfoImport.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package org.openecomp.core.tools.Commands.importdata;
-
-import com.amdocs.zusammen.datatypes.SessionContext;
-import org.openecomp.core.tools.store.VersionInfoCassandraLoader;
-import org.openecomp.core.utilities.json.JsonUtil;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
-import org.openecomp.sdc.versioning.dao.types.VersionInfoEntity;
-
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-
-import static java.io.File.separator;
-import static org.openecomp.core.tools.Commands.exportdata.ImportProperties.JSON_POSTFIX;
-import static org.openecomp.core.tools.Commands.exportdata.ImportProperties.VERSION_INFO_FILE_PREFIX;
-
-public class VersionInfoImport {
-    private static final Logger logger = LoggerFactory.getLogger(VersionInfoImport.class);
-
-    public void loadPath(SessionContext sessionContext, Path itemPath, String itemId) {
-        try {
-             Path versionInfoFilePath = Paths.get(itemPath.toString() + separator + VERSION_INFO_FILE_PREFIX
-                    + itemId + JSON_POSTFIX);
-            if (!Files.exists(versionInfoFilePath)) {
-                return;
-            }
-            String versionInfoJson = new String(Files.readAllBytes(versionInfoFilePath));
-            if (versionInfoJson.trim().isEmpty()) {
-                return;
-            }
-            VersionInfoEntity versionInfoEntity = JsonUtil.json2Object(versionInfoJson, VersionInfoEntity.class);
-            VersionInfoCassandraLoader versionInfoCassandraLoader = new VersionInfoCassandraLoader();
-            versionInfoCassandraLoader.insertVersionInfo(versionInfoEntity);
-        } catch (Exception ex) {
-            logger.error(ex.getMessage(), ex);
-        }
-    }
-
-
-}
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/concurrent/ItemHealingTask.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/concurrent/ItemHealingTask.java
index 39b62d4..878390f 100644
--- a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/concurrent/ItemHealingTask.java
+++ b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/concurrent/ItemHealingTask.java
@@ -1,13 +1,8 @@
 package org.openecomp.core.tools.concurrent;
 
-import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants;
+import org.openecomp.sdc.healing.api.HealingManager;
 import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductManager;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
-import org.openecomp.sdc.versioning.VersioningManager;
-import org.openecomp.sdc.versioning.VersioningUtil;
 import org.openecomp.sdc.versioning.dao.types.Version;
-import org.openecomp.sdc.versioning.types.VersionInfo;
-import org.openecomp.sdc.versioning.types.VersionableEntityAction;
 
 import java.util.concurrent.Callable;
 
@@ -17,55 +12,44 @@
 public class ItemHealingTask implements Callable<String> {
 
   private String itemId;
-  private String versionId;
-  private String user;
+  private Version version;
   private VendorSoftwareProductManager vspManager;
-  private VersioningManager versioningManager;
+  private HealingManager healingManager;
 
   public String getItemId() {
     return itemId;
   }
 
   public String getVersionId() {
-    return versionId;
+//    return version.getId();
+    return null;
   }
 
 
-  public ItemHealingTask(String itemId, String versionId, String user,
+  public ItemHealingTask(String itemId, String versionId,
                          VendorSoftwareProductManager vspManager,
-                         VersioningManager versioningManager) {
-    this.itemId = itemId;
-    this.versionId = versionId;
-    this.user = user;
-    this.versioningManager = versioningManager;
+                         HealingManager healingManager) {
+//    this.itemId = itemId;
+//    this.version = new Version(versionId);
     this.vspManager = vspManager;
+    this.healingManager = healingManager;
+
   }
 
   @Override
   public String call() throws Exception {
-
-    VersionInfo versionInfo = getVersionInfo(itemId, VersionableEntityAction.Read, user);
-    Version resolvedVersion = VersioningUtil.resolveVersion(Version.valueOf(versionId),
-        versionInfo, user);
-    VspDetails vspDetails = vspManager.getVsp(itemId, resolvedVersion, user);
-
-    try {
-      vspManager.callAutoHeal(itemId, versionInfo, vspDetails, user);
-
-    } catch (Exception e) {
-      return (String.format("healing failed on vsp: %s with id: %s, versionId: %s, resolved " +
-              "Version: %s, with message: %s",vspDetails.getName(),itemId,
-          versionId,resolvedVersion,e.getMessage()));
-    }
-
-    return String.format("healed vsp: %s, with id: %s, versionId:%s, resolved version: %s",
-        vspDetails.getName(), itemId, versionId,resolvedVersion );
-  }
-
-  private VersionInfo getVersionInfo(String vendorSoftwareProductId, VersionableEntityAction action,
-                                     String user) {
-    return versioningManager.getEntityVersionInfo(
-        VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE,
-        vendorSoftwareProductId, user, action);
+//    VspDetails vspDetails = vspManager.getVsp(itemId, version);
+//
+//    try {
+//      healingManager.healItemVersion(itemId, version, ItemType.vsp, true);
+//    } catch (Exception e) {
+//      return (String
+//          .format("healing failed on vsp: %s with id: %s, versionId: %s, with message: %s",
+//              vspDetails.getName(), itemId, version.getId(), e.getMessage()));
+//    }
+//
+//    return String.format("healed vsp: %s, with id: %s, versionId: %s",
+//        vspDetails.getName(), itemId, version.getId());
+    return null;
   }
 }
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/exportinfo/ExportDataCommand.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/exportinfo/ExportDataCommand.java
new file mode 100644
index 0000000..5dcc72d
--- /dev/null
+++ b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/exportinfo/ExportDataCommand.java
@@ -0,0 +1,125 @@
+/**
+ * Copyright © 2016-2017 European Support Limited.
+ */
+package org.openecomp.core.tools.exportinfo;
+
+import com.amdocs.zusammen.datatypes.SessionContext;
+import com.datastax.driver.core.ResultSet;
+import com.datastax.driver.core.ResultSetFuture;
+import com.datastax.driver.core.Session;
+import com.google.common.collect.Sets;
+import com.google.common.util.concurrent.FutureCallback;
+import com.google.common.util.concurrent.Futures;
+import org.apache.commons.io.FileUtils;
+import org.openecomp.core.nosqldb.impl.cassandra.CassandraSessionFactory;
+import org.openecomp.core.tools.importinfo.ImportProperties;
+import org.openecomp.core.tools.util.Utils;
+import org.openecomp.core.tools.util.ZipUtils;
+import org.openecomp.core.zusammen.impl.CassandraConnectionInitializer;
+import org.openecomp.sdc.logging.api.Logger;
+import org.openecomp.sdc.logging.api.LoggerFactory;
+import org.yaml.snakeyaml.Yaml;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.CountDownLatch;
+import java.util.stream.Collectors;
+
+import static java.nio.file.Files.createDirectories;
+
+
+public class ExportDataCommand {
+    private static final Logger logger = LoggerFactory.getLogger(ExportDataCommand.class);
+    public static final String JOIN_DELIMITER = "$#";
+    public static final String JOIN_DELIMITER_SPILTTER = "\\$\\#";
+    public static final String MAP_DELIMITER = "!@";
+    public static final String MAP_DELIMITER_SPLITTER = "\\!\\@";
+    public static final String EXPORT_FILE_NAME = "ITEM_EXPORT";
+
+    public static void exportData(SessionContext sessionContext, String filterItem) {
+        try {
+            CassandraConnectionInitializer.setCassandraConnectionPropertiesToSystem();
+            final Set<String> filteredItems = Sets.newHashSet(filterItem);
+            Path rootDir = Paths.get(ImportProperties.ROOT_DIRECTORY);
+            initDir(rootDir);
+            Set<String> fis = filteredItems.stream().map(fi -> fi.replaceAll("\\r", "")).collect(Collectors.toSet());
+
+            Map<String, List<String>> queries;
+            Yaml yaml = new Yaml();
+            try (InputStream is = ExportDataCommand.class.getResourceAsStream("/queries.yaml")) {
+                queries = (Map<String, List<String>>) yaml.load(is);
+            }
+            List<String> queriesList = queries.get("queries");
+            List<String> itempsColumns = queries.get("item_columns");
+            Set<String> vlms = new HashSet<>();
+            CountDownLatch doneQueries = new CountDownLatch(queriesList.size());
+            for (int i = 0; i < queriesList.size(); i++) {
+                executeQuery(queriesList.get(i), fis, itempsColumns.get(i), vlms, doneQueries);
+            }
+            doneQueries.await();
+            if (!vlms.isEmpty()) {
+                CountDownLatch doneVmls = new CountDownLatch(queriesList.size());
+
+                for (int i = 0; i < queriesList.size(); i++) {
+                    executeQuery(queriesList.get(i), vlms, itempsColumns.get(i), null, doneVmls);
+                }
+
+                doneVmls.await();
+            }
+            zipPath(rootDir);
+            FileUtils.forceDelete(rootDir.toFile());
+        } catch (Exception ex) {
+            Utils.logError(logger, ex);
+        }
+
+    }
+
+
+    private static boolean executeQuery(final String query, final Set<String> filteredItems, final String filteredColumn,
+                                        final Set<String> vlms, final CountDownLatch donequerying) {
+        Session session = CassandraSessionFactory.getSession();
+        ResultSetFuture resultSetFuture = session.executeAsync(query);
+        Futures.addCallback(resultSetFuture, new FutureCallback<ResultSet>() {
+            @Override
+            public void onSuccess(ResultSet resultSet) {
+                new ExportSerializer().serializeResult(resultSet, filteredItems, filteredColumn, vlms);
+                donequerying.countDown();
+            }
+
+            @Override
+            public void onFailure(Throwable t) {
+                Utils.logError(logger, "Query failed :" + query, t);
+                donequerying.countDown();
+            }
+        });
+        return true;
+    }
+
+    private static void zipPath(Path rootDir) throws Exception {
+        LocalDateTime date = LocalDateTime.now();
+        DateTimeFormatter formatter = DateTimeFormatter.ISO_LOCAL_DATE_TIME;
+        String dateStr = date.format(formatter);
+        dateStr = dateStr.replaceAll(":", "_");
+        String zipFile = System.getProperty("user.home") + File.separatorChar + "onboarding_import" + dateStr + ".zip";
+        ZipUtils.createZip(zipFile, rootDir);
+        Utils.printMessage(logger, "Exported file :" + zipFile);
+    }
+
+
+    public static void initDir(Path rootDir) throws IOException {
+        if (rootDir.toFile().exists()) {
+            FileUtils.forceDelete(rootDir.toFile());
+        }
+        createDirectories(rootDir);
+    }
+
+}
\ No newline at end of file
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/exportinfo/ExportSerializer.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/exportinfo/ExportSerializer.java
new file mode 100644
index 0000000..3c917b1
--- /dev/null
+++ b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/exportinfo/ExportSerializer.java
@@ -0,0 +1,152 @@
+/**
+ * Copyright © 2016-2017 European Support Limited.
+ */
+package org.openecomp.core.tools.exportinfo;
+
+import com.datastax.driver.core.DataType.Name;
+import com.datastax.driver.core.ResultSet;
+import com.datastax.driver.core.Row;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonParser;
+import org.codehaus.jackson.map.ObjectMapper;
+import org.openecomp.core.tools.importinfo.ImportProperties;
+import org.openecomp.core.tools.model.ColumnDefinition;
+import org.openecomp.core.tools.model.TableData;
+import org.openecomp.core.tools.util.Utils;
+import org.openecomp.sdc.logging.api.Logger;
+import org.openecomp.sdc.logging.api.LoggerFactory;
+
+import java.io.File;
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.Base64;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+import static org.openecomp.core.tools.importinfo.ImportSingleTable.dataTypesMap;
+
+public class ExportSerializer {
+
+    private static final Logger logger = LoggerFactory.getLogger(ExportDataCommand.class);
+    private static final String ELEMENT_TABLE_NAME = "element";
+    private static final String ELEMENT_INFO_COLUMN_NAME = "info";
+
+    public void serializeResult(final ResultSet resultSet, final Set<String> filteredItems, final String filteredColumn, Set<String> vlms) {
+        try {
+            TableData tableData = new TableData();
+            tableData.definitions = resultSet.getColumnDefinitions().asList().stream().map(column -> new ColumnDefinition(column)).collect(Collectors.toList());
+            String table = tableData.definitions.iterator().next().getTable();
+            boolean isElementTable = table.equals(ELEMENT_TABLE_NAME);
+            Iterator<Row> iterator = resultSet.iterator();
+            iterator.forEachRemaining(row -> {
+                if (!filteredItems.contains(row.getString(filteredColumn))) {
+                    return;
+                }
+                List<String> rowData = new ArrayList<>();
+                for (int i = 0; i < tableData.definitions.size(); i++) {
+                    ColumnDefinition columnDefinition = tableData.definitions.get(i);
+                    Name name = dataTypesMap.get(columnDefinition.getType());
+                    boolean checkForVLM = isElementTable && columnDefinition.getName().equals(ELEMENT_INFO_COLUMN_NAME);
+                    Object data;
+                    data = convertByType(vlms, row, i, name, checkForVLM);
+                    rowData.add(data.toString());
+                }
+                tableData.rows.add(rowData);
+            });
+            ObjectMapper objectMapper = new ObjectMapper();
+            String fileName = ImportProperties.ROOT_DIRECTORY + File.separator + table + "_" + System.currentTimeMillis() + ".json";
+            objectMapper.writeValue(Paths.get(fileName).toFile(), tableData);
+            Utils.printMessage(logger, "File exported is :" + fileName);
+
+        } catch (IOException e) {
+            Utils.logError(logger, e);
+            System.exit(1);
+        }
+    }
+
+    private Object convertByType(Set<String> vlms, Row row, int i, Name name, boolean checkForVLM) {
+        Object data;
+        switch (name) {
+            case VARCHAR:
+            case TEXT:
+            case ASCII:
+                String string = row.getString(i);
+                if (string == null) {
+                    string = "";
+                }
+                if (checkForVLM && vlms != null){
+                    String vlm = extractVlm(string);
+                    if (vlm!= null) {
+                        vlms.add(vlm);
+                    }
+                }
+                data = Base64.getEncoder().encodeToString(string.getBytes());
+                break;
+            case BLOB:
+                ByteBuffer bytes = row.getBytes(i);
+                if (bytes == null) {
+                    bytes = ByteBuffer.wrap("".getBytes());
+                }
+                data = Base64.getEncoder().encodeToString(bytes.array());
+                break;
+            case TIMESTAMP:
+                data = row.getDate(i).getTime();
+                break;
+            case BOOLEAN:
+                data = row.getBool(i);
+                break;
+            case COUNTER:
+                data = row.getLong(i);
+                break;
+            case INT:
+                data = row.getInt(i);
+                break;
+            case FLOAT:
+                data = row.getFloat(i);
+                break;
+            case SET:
+                Set set = row.getSet(i, Object.class);
+                Object joined = set.stream().map(o -> o.toString()).collect(Collectors.joining(ExportDataCommand.JOIN_DELIMITER));
+                data = Base64.getEncoder().encodeToString(joined.toString().getBytes());
+                break;
+            case MAP:
+                Map<Object,Object> map = row.getMap(i, Object.class, Object.class);
+                Set<Map.Entry<Object,Object>> entrySet = map.entrySet();
+                Object mapAsString = entrySet.parallelStream().map(entry -> entry.getKey().toString() + ExportDataCommand.MAP_DELIMITER +entry.getValue().toString())
+                        .collect(Collectors.joining(ExportDataCommand.MAP_DELIMITER));
+                data = Base64.getEncoder().encodeToString(mapAsString.toString().getBytes());
+                break;
+            default:
+                throw new UnsupportedOperationException("Name is not supported :" + name);
+        }
+        return data;
+    }
+
+    protected String extractVlm(String injson) {
+        try {
+            if (injson == null){
+                return null;
+            }
+            JsonElement root = new JsonParser().parse(injson);
+            if (root == null){
+                return null;
+            }
+            JsonElement properties = root.getAsJsonObject().get("properties");
+            if (properties == null){
+                return null;
+            }
+            JsonElement vendorId = properties.getAsJsonObject().get("vendorId");
+            if (vendorId == null){
+                return null;
+            }
+            return vendorId.getAsString();
+        } catch (Exception ex){
+            return null;
+        }
+    }
+}
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/importinfo/ImportDataCommand.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/importinfo/ImportDataCommand.java
new file mode 100644
index 0000000..bae6cfa
--- /dev/null
+++ b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/importinfo/ImportDataCommand.java
@@ -0,0 +1,37 @@
+package org.openecomp.core.tools.importinfo;
+
+
+import com.amdocs.zusammen.datatypes.SessionContext;
+import org.apache.commons.io.FileUtils;
+import org.openecomp.core.tools.exportinfo.ExportDataCommand;
+import org.openecomp.core.tools.util.Utils;
+import org.openecomp.core.tools.util.ZipUtils;
+import org.openecomp.core.zusammen.impl.CassandraConnectionInitializer;
+import org.openecomp.sdc.logging.api.Logger;
+import org.openecomp.sdc.logging.api.LoggerFactory;
+
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.stream.Stream;
+
+public class ImportDataCommand {
+
+    private static final Logger logger = LoggerFactory.getLogger(ImportDataCommand.class);
+
+    public static final void execute(SessionContext sessionContext, String uploadFile) {
+        try {
+            CassandraConnectionInitializer.setCassandraConnectionPropertiesToSystem();
+            Path outputFolder = Paths.get(ImportProperties.ROOT_DIRECTORY);
+            ExportDataCommand.initDir(outputFolder); //clear old imports.
+            ZipUtils.unzip(Paths.get(uploadFile), outputFolder);
+            try( Stream<Path> files = Files.list(outputFolder)) {
+                files.forEach(file -> new ImportSingleTable().importFile(file));
+            }
+            FileUtils.forceDelete(outputFolder.toFile()); // leaves directory clean
+        } catch (IOException e) {
+            Utils.logError(logger, e);
+        }
+    }
+}
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/importinfo/ImportProperties.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/importinfo/ImportProperties.java
new file mode 100644
index 0000000..b9a27fa
--- /dev/null
+++ b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/importinfo/ImportProperties.java
@@ -0,0 +1,7 @@
+package org.openecomp.core.tools.importinfo;
+
+import java.io.File;
+
+public class ImportProperties {
+    public static final String ROOT_DIRECTORY = System.getProperty("user.home")+File.separator+ "onboarding_import";
+}
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/importinfo/ImportSingleTable.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/importinfo/ImportSingleTable.java
new file mode 100644
index 0000000..7504ad1
--- /dev/null
+++ b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/importinfo/ImportSingleTable.java
@@ -0,0 +1,166 @@
+package org.openecomp.core.tools.importinfo;
+
+import com.datastax.driver.core.BoundStatement;
+import com.datastax.driver.core.DataType.Name;
+import com.datastax.driver.core.PreparedStatement;
+import com.datastax.driver.core.ResultSet;
+import com.datastax.driver.core.ResultSetFuture;
+import com.datastax.driver.core.Session;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableMap.Builder;
+import com.google.common.collect.Sets;
+import com.google.common.util.concurrent.FutureCallback;
+import com.google.common.util.concurrent.Futures;
+import org.apache.commons.lang3.StringUtils;
+import org.codehaus.jackson.map.ObjectMapper;
+import org.openecomp.core.nosqldb.impl.cassandra.CassandraSessionFactory;
+import org.openecomp.core.tools.exportinfo.ExportDataCommand;
+import org.openecomp.core.tools.model.ColumnDefinition;
+import org.openecomp.core.tools.model.TableData;
+import org.openecomp.core.tools.util.Utils;
+import org.openecomp.sdc.logging.api.Logger;
+import org.openecomp.sdc.logging.api.LoggerFactory;
+
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.nio.file.Path;
+import java.util.Base64;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+public class ImportSingleTable {
+
+    private static final Logger logger = LoggerFactory.getLogger(ImportSingleTable.class);
+
+    public static final String INSERT_INTO = "INSERT INTO ";
+    public static final String VALUES = " VALUES ";
+    private static final Map<String, PreparedStatement> statementsCache = new HashMap<>();
+
+    public void importFile(Path file) {
+        try {
+            ObjectMapper objectMapper = new ObjectMapper();
+            TableData tableData = objectMapper.readValue(file.toFile(), TableData.class);
+            Session session = CassandraSessionFactory.getSession();
+            PreparedStatement ps = getPrepareStatement(tableData, session);
+            tableData.rows.parallelStream().forEach(row -> executeQuery(session, ps, tableData.definitions, row));
+        } catch (IOException e) {
+            Utils.logError(logger, e);
+        }
+
+    }
+
+    private PreparedStatement getPrepareStatement(TableData tableData, Session session) {
+        String query = createQuery(tableData);
+        if (statementsCache.containsKey(query)) {
+            return statementsCache.get(query);
+        }
+        PreparedStatement preparedStatement = session.prepare(query);
+        statementsCache.put(query, preparedStatement);
+        return preparedStatement;
+    }
+
+    private void executeQuery(Session session, PreparedStatement ps, List<ColumnDefinition> definitions, List<String> rows) {
+        BoundStatement bind = ps.bind();
+        for (int i = 0; i < definitions.size(); i++) {
+            ColumnDefinition columnDefinition = definitions.get(i);
+            String rowData = rows.get(i);
+            Name name = dataTypesMap.get(columnDefinition.getType());
+            handleByType(bind, i, rowData, name);
+        }
+        ResultSetFuture resultSetFuture = session.executeAsync(bind);
+        Futures.addCallback(resultSetFuture, new FutureCallback<ResultSet>() {
+            @Override
+            public void onSuccess(ResultSet resultSet) {
+                Utils.printMessage(logger, "successful write ");
+            }
+
+            @Override
+            public void onFailure(Throwable t) {
+                Utils.logError(logger, t);
+            }
+        });
+    }
+
+    private void handleByType(BoundStatement bind, int i, String rowData, Name name) {
+        switch (name) {
+            case VARCHAR:
+            case TEXT:
+            case ASCII:
+                bind.setString(i, new String(Base64.getDecoder().decode(rowData)));
+                break;
+            case BLOB:
+                bind.setBytes(i, ByteBuffer.wrap(Base64.getDecoder().decode(rowData.getBytes())));
+                break;
+            case TIMESTAMP:
+                bind.setDate(i, new Date(Long.parseLong(rowData)));
+                break;
+            case BOOLEAN:
+                bind.setBool(i, Boolean.parseBoolean(rowData));
+                break;
+            case COUNTER:
+                bind.setLong(i, Long.parseLong(rowData));
+                break;
+            case INT:
+                bind.setInt(i, Integer.parseInt(rowData));
+                break;
+            case FLOAT:
+                bind.setFloat(i, Float.parseFloat(rowData));
+                break;
+            case SET:
+                byte[] decoded = Base64.getDecoder().decode(rowData);
+                String decodedStr = new String(decoded);
+                if (!StringUtils.isEmpty(decodedStr)) {
+                    String[] splitted = decodedStr.split(ExportDataCommand.JOIN_DELIMITER_SPILTTER);
+                    Set set = Sets.newHashSet(splitted);
+                    set.remove("");
+                    bind.setSet(i, set);
+                } else {
+                    bind.setSet(i, null);
+                }
+                break;
+            case MAP:
+                byte[] decodedMap = Base64.getDecoder().decode(rowData);
+                String mapStr = new String(decodedMap);
+                if (!StringUtils.isEmpty(mapStr)) {
+                    String[] splittedMap = mapStr.split(ExportDataCommand.JOIN_DELIMITER_SPILTTER);
+                    Map<String, String> map = new HashMap<>();
+                    for (String keyValue : splittedMap) {
+                        String[] split = keyValue.split(ExportDataCommand.MAP_DELIMITER_SPLITTER);
+                        map.put(split[0], split[1]);
+                    }
+                    bind.setMap(i, map);
+                } else {
+                    bind.setMap(i, null);
+                }
+                break;
+            default:
+                throw new UnsupportedOperationException("Name is not supported :" + name);
+
+        }
+    }
+
+    private String createQuery(TableData tableData) {
+        ColumnDefinition def = tableData.definitions.iterator().next();
+        StringBuilder sb = new StringBuilder();
+        sb.append(INSERT_INTO).append(def.getKeyspace()).append(".").append(def.getTable());
+        sb.append(tableData.definitions.stream().map(definition -> definition.getName()).collect(Collectors.joining(" , ", " ( ", " ) ")));
+        sb.append(VALUES).append(tableData.definitions.stream().map(definition -> "?").collect(Collectors.joining(" , ", " ( ", " ) "))).append(";");
+        return sb.toString();
+    }
+
+    public static final ImmutableMap<String, Name> dataTypesMap;
+
+    static {
+        Builder<String, Name> builder = ImmutableMap.builder();
+        Name[] values = Name.values();
+        for (Name name : values) {
+            builder.put(name.name().toLowerCase(), name);
+        }
+        dataTypesMap = builder.build();
+    }
+
+}
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/loaders/zusammen/VspGeneralLoader.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/loaders/zusammen/VspGeneralLoader.java
deleted file mode 100644
index d92866b..0000000
--- a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/loaders/zusammen/VspGeneralLoader.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package org.openecomp.core.tools.loaders.zusammen;
-
-import com.amdocs.zusammen.datatypes.Id;
-import com.amdocs.zusammen.datatypes.SessionContext;
-import com.amdocs.zusammen.plugin.statestore.cassandra.dao.types.ElementEntityContext;
-import org.openecomp.core.zusammen.plugin.dao.impl.CassandraElementRepository;
-import org.openecomp.core.zusammen.plugin.dao.types.ElementEntity;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.StructureElement;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
-
-public class VspGeneralLoader {
-  public static Map<String, ElementEntity> load(SessionContext context,
-                                                Map<String, List<String>> vspItemVersionsMap) {
-    Map<String, ElementEntity> elementEntityMap = new HashMap<>();
-    System.setProperty("cassandra.dox.keystore", "zusammen_dox");
-    CassandraElementRepository cassandraElementRepository = new CassandraElementRepository();
-    for (Map.Entry<String, List<String>> entry : vspItemVersionsMap.entrySet()) {
-
-      for (String version : entry.getValue()) {
-
-        Optional<ElementEntity> result =
-            cassandraElementRepository.get(context, new ElementEntityContext(
-                    context.getUser().getUserName(),
-                    new Id(entry.getKey()),
-                    new Id(version)),
-                new ElementEntity(new Id(StructureElement.General.name())));
-        if (result.isPresent()) {
-          elementEntityMap.put(context.getUser().getUserName() + "_" + entry.getKey()
-              + "_" + version, result.get());
-        }
-      }
-    }
-
-    return elementEntityMap;
-  }
-}
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/loaders/zusammen/VspItemLoader.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/loaders/zusammen/VspItemLoader.java
deleted file mode 100644
index 78b915c..0000000
--- a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/loaders/zusammen/VspItemLoader.java
+++ /dev/null
@@ -1,4 +0,0 @@
-package org.openecomp.core.tools.loaders.zusammen;
-
-public class VspItemLoader {
-}
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/main/ZusammenMainTool.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/main/ZusammenMainTool.java
index b55d517..1829887 100644
--- a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/main/ZusammenMainTool.java
+++ b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/main/ZusammenMainTool.java
@@ -3,9 +3,9 @@
 import com.amdocs.zusammen.datatypes.SessionContext;
 import com.amdocs.zusammen.datatypes.UserInfo;
 import org.openecomp.core.tools.Commands.HealAll;
-import org.openecomp.core.tools.Commands.ImportCommand;
-import org.openecomp.core.tools.Commands.ExportDataCommand;
-import org.openecomp.core.tools.Commands.ResetOldVersion;
+import org.openecomp.core.tools.Commands.SetHealingFlag;
+import org.openecomp.core.tools.exportinfo.ExportDataCommand;
+import org.openecomp.core.tools.importinfo.ImportDataCommand;
 import org.openecomp.core.tools.util.ToolsUtil;
 import org.openecomp.sdc.logging.api.Logger;
 import org.openecomp.sdc.logging.api.LoggerFactory;
@@ -39,13 +39,13 @@
 
     switch (COMMANDS.valueOf(command)){
       case RESET_OLD_VERSION:
-        ResetOldVersion.reset(context,ToolsUtil.getParam("v",args),ToolsUtil.getParam("n",args));
+        SetHealingFlag.populateHealingTable(ToolsUtil.getParam("v",args));
         break;
       case EXPORT:
         ExportDataCommand.exportData(context,ToolsUtil.getParam("i",args));
         break;
       case IMPORT:
-        ImportCommand.importData(context, ToolsUtil.getParam("f",args),ToolsUtil.getParam("i",args));
+        ImportDataCommand.execute(context, ToolsUtil.getParam("f",args));
         break;
       case HEAL_ALL:
         HealAll.healAll(ToolsUtil.getParam("t",args));
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/model/ColumnDefinition.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/model/ColumnDefinition.java
new file mode 100644
index 0000000..846392c
--- /dev/null
+++ b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/model/ColumnDefinition.java
@@ -0,0 +1,84 @@
+/**
+ * Copyright © 2016-2017 European Support Limited.
+ */
+package org.openecomp.core.tools.model;
+
+import com.datastax.driver.core.ColumnDefinitions.Definition;
+import com.datastax.driver.core.DataType;
+
+import java.util.Arrays;
+
+public class ColumnDefinition {
+
+    private String keyspace;
+    private String table;
+    private String name;
+    private String type;
+
+    public ColumnDefinition() {
+    }
+
+    public ColumnDefinition(String keyspace, String table, String name, DataType type) {
+        this.keyspace = keyspace;
+        this.table = table;
+        this.name = name;
+        this.type = type.getName().toString();
+    }
+
+    public ColumnDefinition(Definition definition) {
+        this(definition.getKeyspace(), definition.getTable(), definition.getName(), definition.getType());
+    }
+
+    /**
+     * The name of the keyspace this column is part of.
+     *
+     * @return the name of the keyspace this column is part of.
+     */
+    public String getKeyspace() {
+        return keyspace;
+    }
+
+    /**
+     * Returns the name of the table this column is part of.
+     *
+     * @return the name of the table this column is part of.
+     */
+    public String getTable() {
+        return table;
+    }
+
+    /**
+     * Returns the name of the column.
+     *
+     * @return the name of the column.
+     */
+    public String getName() {
+        return name;
+    }
+
+    /**
+     * Returns the type of the column.
+     *
+     * @return the type of the column.
+     */
+    public String getType() {
+        return type;
+    }
+
+    @Override
+    public final int hashCode() {
+        return Arrays.hashCode(new Object[]{keyspace, table, name, type});
+    }
+
+    @Override
+    public final boolean equals(Object o) {
+        if (!(o instanceof ColumnDefinition))
+            return false;
+
+        ColumnDefinition other = (ColumnDefinition) o;
+        return keyspace.equals(other.keyspace)
+                && table.equals(other.table)
+                && name.equals(other.name)
+                && type.equals(other.type);
+    }
+}
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/model/TableData.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/model/TableData.java
new file mode 100644
index 0000000..155f35c
--- /dev/null
+++ b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/model/TableData.java
@@ -0,0 +1,12 @@
+/**
+ * Copyright © 2016-2017 European Support Limited.
+ */
+package org.openecomp.core.tools.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class TableData {
+    public List<ColumnDefinition> definitions = new ArrayList<>();
+    public List<List<String>> rows = new ArrayList<>();
+}
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/store/CassandraElementRepository.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/store/CassandraElementRepository.java
index c41b46e..fcc67e1 100644
--- a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/store/CassandraElementRepository.java
+++ b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/store/CassandraElementRepository.java
@@ -34,7 +34,12 @@
 
 import java.lang.reflect.Type;
 import java.nio.ByteBuffer;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Objects;
+import java.util.Optional;
+import java.util.Set;
 import java.util.stream.Collectors;
 
 public class CassandraElementRepository {
@@ -61,18 +66,18 @@
                                      ElementEntity element) {
     Row row = getElementAccessor(context).get(
         elementContext.getSpace(),
-        elementContext.getItemId().toString(),
+        elementContext.getItemId().getValue(),
         getVersionId(elementContext),
-        element.getId().toString()).one();
+        element.getId().getValue()).one();
 
     return row == null ? Optional.empty() : Optional.of(getElementEntity(element, row));
   }
 
 
   private String getVersionId(ElementEntityContext elementContext) {
-    return elementContext.getChangeRef() == null
-        ? elementContext.getVersionId().toString()
-        : elementContext.getChangeRef();
+    return elementContext.getRevisionId() == null
+        ? elementContext.getVersionId().getValue()
+        : elementContext.getRevisionId().getValue();
   }
 
 
@@ -92,7 +97,7 @@
   private void updateElement(SessionContext context, ElementEntityContext elementContext,
                              ElementEntity element) {
 
-    if (elementContext.getChangeRef() == null) {
+    if (elementContext.getRevisionId() == null) {
 
       getElementAccessor(context).update(
           JsonUtil.object2Json(element.getInfo()),
@@ -113,7 +118,7 @@
           element.getVisualization(),
           elementContext.getSpace(),
           elementContext.getItemId().toString(),
-          elementContext.getChangeRef(),
+          elementContext.getRevisionId().getValue(),
           element.getId().toString());
     }
   }
@@ -154,7 +159,7 @@
         getVersionId(elementContext)).one();
     return row == null
         ? new HashSet<>()
-        : row.getSet(CassandraElementRepository.VersionElementsField.ELEMENT_IDS, String.class);
+        : row.getSet(VersionElementsField.ELEMENT_IDS, String.class);
   }
 
   /*
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/store/ElementHandler.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/store/ElementHandler.java
index 5c72c95..d8929ea 100644
--- a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/store/ElementHandler.java
+++ b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/store/ElementHandler.java
@@ -2,7 +2,6 @@
 
 import com.amdocs.zusammen.datatypes.Id;
 import com.amdocs.zusammen.datatypes.SessionContext;
-import com.amdocs.zusammen.datatypes.item.ElementContext;
 import com.amdocs.zusammen.plugin.statestore.cassandra.dao.types.ElementEntityContext;
 import org.openecomp.core.zusammen.plugin.dao.types.ElementEntity;
 
@@ -11,23 +10,17 @@
     private static final String GLOBAL_USER = "GLOBAL_USER";
 
     public static void update(SessionContext context,
-                              String itemId, String versionId, String changeRef,
+                              String itemId, String versionId, String revisionId,
                               ElementEntity elementEntity) {
 
         ElementEntityContext elementContext;
         CassandraElementRepository cassandraElementRepository = new CassandraElementRepository();
-        if (changeRef == null) {
+        if (revisionId == null) {
 
             elementContext = new ElementEntityContext(GLOBAL_USER, new Id(itemId),
-                    new Id(versionId));
+                new Id(versionId));
 
-        } else {
-            elementContext = new ElementEntityContext(GLOBAL_USER, new ElementContext(new Id(itemId),
-                    new Id(versionId),
-                    changeRef));
         }
-        cassandraElementRepository.update(context, elementContext, elementEntity);
-
     }
 }
 
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/store/HealingHandler.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/store/HealingHandler.java
new file mode 100644
index 0000000..78bbdf0
--- /dev/null
+++ b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/store/HealingHandler.java
@@ -0,0 +1,54 @@
+package org.openecomp.core.tools.store;
+
+import com.datastax.driver.core.ResultSet;
+import com.datastax.driver.mapping.annotations.Accessor;
+import com.datastax.driver.mapping.annotations.Query;
+import org.openecomp.core.nosqldb.api.NoSqlDb;
+import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
+import org.openecomp.core.tools.store.zusammen.datatypes.HealingEntity;
+
+import java.util.ArrayList;
+
+/**
+ * Created by ayalaben on 10/15/2017
+ */
+public class HealingHandler {
+
+  private static NoSqlDb nnoSqlDb = NoSqlDbFactory.getInstance().createInterface();
+  private static HealingAccessor accessor =
+      nnoSqlDb.getMappingManager().createAccessor(HealingAccessor.class);
+
+
+  public void populateHealingTable(ArrayList<HealingEntity> healingEntities) {
+    healingEntities.forEach(healingEntity -> {
+      if (isHealingRecordExist(healingEntity)) {
+        accessor.updateFlag(healingEntity.getHealingFlag(), healingEntity.getSpace(),
+            healingEntity.getItemId(), healingEntity.getVersionId());
+      } else {
+        accessor.create(healingEntity.getSpace(), healingEntity.getItemId(),
+            healingEntity.getVersionId(), healingEntity.getHealingFlag(),
+            healingEntity.getOldVersion());
+      }
+    });
+  }
+
+  private boolean isHealingRecordExist(HealingEntity healingEntity) {
+    return accessor.getFlag(healingEntity.getSpace(), healingEntity.getItemId(),
+        healingEntity.getVersionId()).getAvailableWithoutFetching() == 1;
+  }
+
+  @Accessor
+  interface HealingAccessor {
+
+    @Query("SELECT healing_needed FROM healing WHERE space=? AND item_id=? AND version_id=?")
+    ResultSet getFlag(String space, String itemId, String versionId);
+
+    @Query("Insert into healing (space, item_id, version_id, healing_needed, old_version) " +
+        "values (?,?,?,?,?)")
+    void create(String space, String itemId, String versionId, boolean flag, String oldVersion);
+
+    @Query("UPDATE healing SET healing_needed=? WHERE space=? AND item_id=? AND version_id=?")
+    void updateFlag(boolean flag, String space, String itemId, String versionId);
+  }
+
+}
\ No newline at end of file
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/store/VersionCassandraLoader.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/store/VersionCassandraLoader.java
index 851e92d..fd9dc25 100644
--- a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/store/VersionCassandraLoader.java
+++ b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/store/VersionCassandraLoader.java
@@ -20,6 +20,7 @@
 
 package org.openecomp.core.tools.store;
 
+import com.datastax.driver.core.ResultSet;
 import com.datastax.driver.mapping.Mapper;
 import com.datastax.driver.mapping.Result;
 import com.datastax.driver.mapping.annotations.Accessor;
@@ -60,6 +61,8 @@
         return accessor.getAll();
     }
 
+    public ResultSet listItemVersion() { return accessor.getAllItemVersion();}
+
     @Accessor
     interface VersionAccessor {
 
@@ -74,5 +77,8 @@
         @Query("select * from zusammen_dox.version ")
         @QueryParameters(fetchSize = 400)
         Result<VersionEntity> getAll();
+
+        @Query("select space,item_id,version_id from zusammen_dox.version ")
+        ResultSet getAllItemVersion();
     }
 }
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/store/VspGeneralLoader.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/store/VspGeneralLoader.java
index 1d9d2d9..b8620b8 100644
--- a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/store/VspGeneralLoader.java
+++ b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/store/VspGeneralLoader.java
@@ -4,14 +4,13 @@
 import com.amdocs.zusammen.datatypes.SessionContext;
 import com.amdocs.zusammen.datatypes.item.Info;
 import com.amdocs.zusammen.plugin.statestore.cassandra.dao.types.ElementEntityContext;
-import org.openecomp.core.zusammen.plugin.dao.impl.CassandraElementRepository;
 import org.openecomp.core.zusammen.plugin.dao.types.ElementEntity;
 
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.Optional;
 import java.util.Objects;
+import java.util.Optional;
 
 public class VspGeneralLoader {
 
@@ -56,24 +55,24 @@
 
     for (Map.Entry<String, List<String>> entry : vspItemChangeRefssMap.entrySet()) {
 
-      for (String changeRef : entry.getValue()) {
+      for (String revisionId : entry.getValue()) {
 
 
         itemId = new Id(entry.getKey());
 
-        entityId = getEntityIdByInfoNameValue(context, itemId, null, changeRef,null, NAME,
+        entityId = getEntityIdByInfoNameValue(context, itemId, null, revisionId,null, NAME,
                 GENERAL);
         if (entityId != null) {
           ElementEntityContext elementContext = new ElementEntityContext(
                   context.getUser().getUserName(),
                   itemId,
                   null);
-          elementContext.setChangeRef(changeRef);
+          elementContext.setRevisionId(new Id(revisionId));
           Optional<ElementEntity> result =
                   cassandraElementRepository.get(context, elementContext,
                           new ElementEntity(entityId));
           if (result.isPresent()) {
-            elementEntityMap.put(buildKey(context, entry, changeRef), result.get());
+            elementEntityMap.put(buildKey(context, entry, revisionId), result.get());
           }
         }
       }
@@ -90,7 +89,7 @@
   private static Id getEntityIdByInfoNameValue(SessionContext context,
                                                Id itemId,
                                                Id versionId,
-                                               String changeRef,
+                                               String revisionId,
                                                Id elementId,
                                                String name,
                                                String value) {
@@ -100,8 +99,8 @@
             context.getUser().getUserName(),
             itemId,
             versionId);
-    if (changeRef != null) {
-      elementContext.setChangeRef(changeRef);
+    if (revisionId != null) {
+      elementContext.setRevisionId(new Id(revisionId));
     }
     Optional<ElementEntity> result =
             cassandraElementRepository.get(context, elementContext,
@@ -113,8 +112,8 @@
                 context.getUser().getUserName(),
                 itemId,
                 versionId);
-        if(changeRef!= null){
-          subElementContext.setChangeRef(changeRef);
+        if(revisionId!= null){
+          subElementContext.setRevisionId(new Id(revisionId));
         }
         Optional<ElementEntity> subElementEntityOptional =
                 cassandraElementRepository.get(context, subElementContext,
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/store/zusammen/datatypes/HealingEntity.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/store/zusammen/datatypes/HealingEntity.java
new file mode 100644
index 0000000..8c95f79
--- /dev/null
+++ b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/store/zusammen/datatypes/HealingEntity.java
@@ -0,0 +1,78 @@
+package org.openecomp.core.tools.store.zusammen.datatypes;
+
+import com.datastax.driver.mapping.annotations.Column;
+import com.datastax.driver.mapping.annotations.PartitionKey;
+import com.datastax.driver.mapping.annotations.Table;
+
+/**
+ * Created by ayalaben on 10/15/2017
+ */
+@Table(keyspace = "dox", name = "healing")
+public class HealingEntity {
+  @Column(name = "space")
+  @PartitionKey(0)
+  private String space;
+
+  @Column(name = "item_id")
+  @PartitionKey(1)
+  private String itemId;
+
+  @Column(name = "version_id")
+  @PartitionKey(2)
+  private String versionId;
+
+  @Column(name = "healing_needed")
+  private boolean healingFlag;
+
+  @Column(name = "old_version")
+  private String old_version;
+
+  public String getSpace() {
+    return space;
+  }
+
+  public void setSpace(String space) {
+    this.space = space;
+  }
+
+  public String getItemId() {
+    return itemId;
+  }
+
+  public void setItemId(String itemId) {
+    this.itemId = itemId;
+  }
+
+  public String getVersionId() {
+    return versionId;
+  }
+
+  public void setVersionId(String versionId) {
+    this.versionId = versionId;
+  }
+
+  public boolean getHealingFlag() {
+    return healingFlag;
+  }
+
+  public void setHealingFlag(boolean healingFlag) {
+    this.healingFlag = healingFlag;
+  }
+
+  public HealingEntity(String space, String itemId, String versionId, boolean healingFlag,String
+      oldVersion) {
+    this.space = space;
+    this.itemId = itemId;
+    this.versionId = versionId;
+    this.healingFlag = healingFlag;
+    this.old_version = oldVersion;
+  }
+
+  public String getOldVersion() {
+    return old_version;
+  }
+
+  public void setOldVersion(String old_version) {
+    this.old_version = old_version;
+  }
+}
\ No newline at end of file
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/store/zusammen/datatypes/VersionEntity.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/store/zusammen/datatypes/VersionEntity.java
index c7280c8..946c05e 100644
--- a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/store/zusammen/datatypes/VersionEntity.java
+++ b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/store/zusammen/datatypes/VersionEntity.java
@@ -1,6 +1,8 @@
 package org.openecomp.core.tools.store.zusammen.datatypes;
 
-import com.datastax.driver.mapping.annotations.*;
+import com.datastax.driver.mapping.annotations.Column;
+import com.datastax.driver.mapping.annotations.PartitionKey;
+import com.datastax.driver.mapping.annotations.Table;
 
 import java.util.Date;
 
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/util/Utils.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/util/Utils.java
index d1621ad..f48b212 100644
--- a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/util/Utils.java
+++ b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/util/Utils.java
@@ -3,13 +3,36 @@
 import org.openecomp.sdc.logging.api.Logger;
 
 /**
+ * Copyright © 2016-2017 European Support Limited.
  * @author Avrahamg
  * @since April 24, 2017
+ * Since it is a command line tools writing to console will be helpful to users.
  */
 public class Utils {
   public static void printMessage(Logger logger, String message) {
+    /**
+     * Since it is a command line tools writing to console will be helpful to users.
+     */
     System.out.println(message);
     logger.debug(message);
   }
+
+
+  public static void logError(Logger logger, Throwable ex) {
+    /**
+     * Since it is a command line tools writing to console will be helpful to users.
+     */
+    ex.printStackTrace();
+    logger.error(ex.getMessage(),ex);
+  }
+
+  public static void logError(Logger logger, String message, Throwable ex) {
+    /**
+     * Since it is a command line tools writing to console will be helpful to users.
+     */
+    System.out.println(message);
+    ex.printStackTrace();
+    logger.error(message,ex);
+  }
 }
 
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/util/ZipUtils.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/util/ZipUtils.java
index 2f6693d..e0fd1a7 100644
--- a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/util/ZipUtils.java
+++ b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/util/ZipUtils.java
@@ -1,13 +1,17 @@
 package org.openecomp.core.tools.util;
 
 import com.google.common.io.ByteStreams;
+import org.openecomp.sdc.logging.api.Logger;
+import org.openecomp.sdc.logging.api.LoggerFactory;
 
+import java.io.BufferedOutputStream;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
+import java.nio.file.Paths;
 import java.util.Objects;
 import java.util.Scanner;
 import java.util.Set;
@@ -17,12 +21,23 @@
 import java.util.zip.ZipOutputStream;
 
 public class ZipUtils {
-    public static void createZip(String zipFileName, Path dir, Set<String> filterItem) throws Exception {
+
+    private static final Logger logger = LoggerFactory.getLogger(ZipUtils.class);
+
+    public static void createZip(String zipFileName, Path dir) throws IOException {
         File dirObj = dir.toFile();
+        Path zippedFile = Files.createFile(Paths.get(zipFileName));
         try (
-                FileOutputStream fileOutputStream = new FileOutputStream(zipFileName);
-                ZipOutputStream out = new ZipOutputStream(fileOutputStream)) {
-            addDir(dirObj, out, dir.toString(), filterItem);
+                FileOutputStream fileOutputStream = new FileOutputStream(File.separator + zippedFile.toFile());
+                BufferedOutputStream bos = new BufferedOutputStream(fileOutputStream);
+                ZipOutputStream out = new ZipOutputStream(bos)) {
+            File[] files = dirObj.listFiles();
+            for (File file : files) {
+                out.putNextEntry(new ZipEntry(file.getName()));
+                Files.copy(Paths.get(file.getPath()), out);
+                out.closeEntry();
+            }
+            Utils.printMessage(logger, "Zip file was created " + zipFileName);
         }
     }
 
@@ -47,7 +62,7 @@
         for (int i = 0; i < files.length; i++) {
             if (files[i].isDirectory()) {
                 addDir(files[i], out, root, filterItem);
-                String filePath = files[i].getAbsolutePath().replace(root + File.separator, "") + "/";
+                String filePath = files[i].getAbsolutePath().replace(root + File.separator, "") + File.separator;
                 out.putNextEntry(new ZipEntry(filePath));
                 continue;
             }
@@ -57,7 +72,6 @@
                     out.putNextEntry(new ZipEntry(filePath));
                     try {
                         ByteStreams.copy(in, out);
-
                     } finally {
                         out.closeEntry();
                     }
@@ -71,7 +85,7 @@
         if (zipFile == null || outputFolder == null) {
             return;
         }
-        if (!Files.exists(outputFolder)) {
+        if (!outputFolder.toFile().exists()) {
             Files.createDirectories(outputFolder);
         }
 
@@ -83,7 +97,7 @@
                 File newFile = new File(outputFolder.toString() + File.separator + fileName);
                 if (ze.isDirectory()) {
                     Path path = newFile.toPath();
-                    if (!Files.exists(path)) {
+                    if (!path.toFile().exists()) {
                         Files.createDirectories(path);
                     }
                 } else {
diff --git a/openecomp-be/tools/zusammen-tools/src/main/resources/logback.xml b/openecomp-be/tools/zusammen-tools/src/main/resources/logback.xml
index a13dc82..2461aed 100644
--- a/openecomp-be/tools/zusammen-tools/src/main/resources/logback.xml
+++ b/openecomp-be/tools/zusammen-tools/src/main/resources/logback.xml
@@ -1,5 +1,6 @@
 <configuration>
 
+
     <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
         <!-- encoders are assigned the type
              ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
diff --git a/openecomp-be/tools/zusammen-tools/src/main/resources/queries.yaml b/openecomp-be/tools/zusammen-tools/src/main/resources/queries.yaml
new file mode 100644
index 0000000..a93a5a4
--- /dev/null
+++ b/openecomp-be/tools/zusammen-tools/src/main/resources/queries.yaml
@@ -0,0 +1,16 @@
+queries:
+  - select * from zusammen_dox.element;
+  - select * from zusammen_dox.element_namespace;
+  - select * from zusammen_dox.item;
+  - select * from zusammen_dox.version;
+  - select * from zusammen_dox.version_elements;
+  - select * from dox.item_permissions;
+  - select * from dox.vsp_merge_hint ;
+item_columns:
+  - item_id
+  - item_id
+  - item_id
+  - item_id
+  - item_id
+  - item_id
+  - item_id
\ No newline at end of file
diff --git a/openecomp-be/tools/zusammen-tools/src/test/java/org/openecomp/core/tools/Commands/exportinfo/serialize/VLMExtractTest.java b/openecomp-be/tools/zusammen-tools/src/test/java/org/openecomp/core/tools/Commands/exportinfo/serialize/VLMExtractTest.java
new file mode 100644
index 0000000..7b43c46
--- /dev/null
+++ b/openecomp-be/tools/zusammen-tools/src/test/java/org/openecomp/core/tools/Commands/exportinfo/serialize/VLMExtractTest.java
@@ -0,0 +1,48 @@
+package org.openecomp.core.tools.Commands.exportinfo.serialize;
+
+import org.openecomp.core.tools.exportinfo.ExportSerializer;
+import org.testng.annotations.Test;
+
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertNotNull;
+import static org.testng.Assert.assertNull;
+public class VLMExtractTest {
+
+
+
+    @Test
+    public void extractVLM(){
+        String vlmId = "979a56c7b2fa41e6a5742137f53a5c1b";
+        String elemenet_info_string = "{\n" +
+                "  \"name\": \"VendorSoftwareProduct\",\n" +
+                "  \"properties\": {\n" +
+                "    \"subCategory\": \"resourceNewCategory.dcae component.collector\",\n" +
+                "    \"name\": \"vsp1\",\n" +
+                "    \"icon\": \"icon\",\n" +
+                "    \"onboardingMethod\": \"NetworkPackage\",\n" +
+                "    \"description\": \"d\",\n" +
+                "    \"vendorId\": \""+vlmId+"\",\n" +
+                "    \"category\": \"resourceNewCategory.dcae component\",\n" +
+                "    \"vendorName\": \"vlm1\",\n" +
+                "    \"elementType\": \"VendorSoftwareProduct\"\n" +
+                "  }\n" +
+                "}\n"    ;
+        String extractedVlmId = new CustomExportSerializer().extractVlm(elemenet_info_string);
+        assertNotNull(extractedVlmId);
+        assertEquals(extractedVlmId,vlmId);
+
+    }
+
+    @Test
+    public void failToExtractVLMBecauseJsonIsCorrupted(){
+        String elemenet_info_string = "gfhhhghgh";
+        String extractedVlmId = new CustomExportSerializer().extractVlm(elemenet_info_string);
+        assertNull(extractedVlmId);
+    }
+
+    private static final class CustomExportSerializer extends ExportSerializer{
+        public String extractVlm(String injson) {
+            return super.extractVlm(injson);
+        }
+    }
+}
diff --git a/openecomp-be/tools/zusammen-tools/src/test/resources/configuration.yaml b/openecomp-be/tools/zusammen-tools/src/test/resources/configuration.yaml
new file mode 100644
index 0000000..6636e20
--- /dev/null
+++ b/openecomp-be/tools/zusammen-tools/src/test/resources/configuration.yaml
@@ -0,0 +1,251 @@
+identificationHeaderFields:
+   - HTTP_IV_USER
+   - HTTP_CSP_FIRSTNAME
+   - HTTP_CSP_LASTNAME
+   - HTTP_IV_REMOTE_ADDRESS
+   - HTTP_CSP_WSTYPE
+
+
+
+# catalog backend http port
+beHttpPort: 8080
+
+# catalog backend http context
+beContext: /sdc/rest/config/get
+
+# catalog backend protocol
+beProtocol: http
+
+# catalog backend ssl port
+beSslPort: 8443
+
+version: 1.0
+released: 2012-11-30
+
+titanCfgFile: /home/vagrant/catalog-be/config/catalog-be/titan.properties
+titanInMemoryGraph: false
+titanLockTimeout: 30
+titanReconnectIntervalInSeconds: 3
+titanHealthCheckReadTimeout: 1
+esReconnectIntervalInSeconds: 3
+uebHealthCheckReconnectIntervalInSeconds: 15
+uebHealthCheckReadTimeout: 4
+
+# Protocols
+protocols:
+   - http
+   - https
+
+# Users
+users:
+    tom: passwd
+    bob: passwd
+
+neo4j:
+    host: neo4jhost
+    port: 7474
+    user: neo4j
+    password: "12345"
+
+cassandraConfig:
+    cassandraHosts: ['localhost']
+    reconnectTimeout : 30000
+    authenticate: true
+    username: asdc_user
+    password: password
+    ssl: false
+    truststorePath : /path/path
+    truststorePassword : password
+    keySpaces:
+        - { name: dox, replicationStrategy: SimpleStrategy, replicationInfo: ['1']}
+        - { name:  zusammen_dox, replicationStrategy: SimpleStrategy, replicationInfo: ['1']}
+        - { name: sdcartifact, replicationStrategy: SimpleStrategy, replicationInfo: ['1']}
+
+#Application-specific settings of ES
+elasticSearch:
+    # Mapping of index prefix to time-based frame. For example, if below is configured:
+    #
+    # - indexPrefix: auditingevents
+    #    creationPeriod: minute
+    #
+    # then ES object of type which is mapped to "auditingevents-*" template, and created on 2015-12-23 13:24:54, will enter "auditingevents-2015-12-23-13-24" index.
+    # Another object created on 2015-12-23 13:25:54, will enter "auditingevents-2015-12-23-13-25" index.
+    # If creationPeriod: month, both of the above will enter "auditingevents-2015-12" index.
+    #
+    # PLEASE NOTE: the timestamps are created in UTC/GMT timezone! This is needed so that timestamps will be correctly presented in Kibana.
+    #
+    # Legal values for creationPeriod - year, month, day, hour, minute, none (meaning no time-based behaviour).
+    #
+    # If no creationPeriod is configured for indexPrefix, default behavour is creationPeriod: month.
+
+    indicesTimeFrequency:
+      - indexPrefix: auditingevents
+        creationPeriod: month
+      - indexPrefix: monitoring_events
+        creationPeriod: month
+
+artifactTypes:
+   - CHEF
+   - PUPPET
+   - SHELL
+   - YANG
+   - YANG_XML
+   - HEAT
+   - BPEL
+   - DG_XML
+   - MURANO_PKG
+   - OTHER
+
+licenseTypes:
+   - User
+   - Installation
+   - CPU
+
+#Deployment artifacts placeHolder
+deploymentResourceArtifacts:
+  heat:
+      displayName: "HEAT Template"
+      type: HEAT
+
+deploymentResourceInstanceArtifacts:
+  heatEnv:
+      displayName: "HEAT ENV"
+      type: HEAT_ENV
+      description: "Auto-generated HEAT Environment deployment artifact"
+      fileExtension: "env"
+
+#Informational artifacts placeHolder
+excludeResourceCategory:
+  - Generic
+informationalResourceArtifacts:
+  features:
+      displayName: Features
+      type: OTHER
+  capacity:
+      displayName: Capacity
+      type: OTHER
+  vendorTestResult:
+      displayName: Vendor Test Result
+      type: OTHER
+  testScripts:
+      displayName: Test Scripts
+      type: OTHER
+  cloudQuestionnaire:
+      displayName: Cloud Questionnaire (completed)
+      type: OTHER
+  HEATTemplateFromVendor:
+      displayName: HEAT Template from Vendor
+      type: HEAT
+
+excludeServiceCategory:
+
+informationalServiceArtifacts:
+  messageFlows:
+      displayName: Message Flows
+      type: OTHER
+  instantiationFlows:
+      displayName: Management Flows
+      type: OTHER
+  serviceArtifactPlan:
+      displayName: Service Artifact Plan
+      type: OTHER
+  summaryOfImpactsToECOMPElements:
+      displayName: Summary of impacts to OPENECOMP elements,OSSs, BSSs
+      type: OTHER
+  controlLoopFunctions:
+      displayName: Control Loop Functions
+      type: OTHER
+  dimensioningInfo:
+      displayName: Dimensioning Info
+      type: OTHER
+  affinityRules:
+      displayName: Affinity Rules
+      type: OTHER
+  operationalPolicies:
+      displayName: Operational Policies
+      type: OTHER
+  serviceSpecificPolicies:
+      displayName: Service-specific Policies
+      type: OTHER
+  engineeringRules:
+      displayName: Engineering Rules (ERD)
+      type: OTHER
+  distributionInstructions:
+      displayName: Distribution Instructions
+      type: OTHER
+  certificationTestResults:
+      displayName: TD Certification Test Results
+      type: OTHER
+  deploymentVotingRecord:
+      displayName: Deployment Voting Record
+      type: OTHER
+  serviceQuestionnaire:
+      displayName: Service Questionnaire
+      type: OTHER
+
+serviceApiArtifacts:
+  configuration:
+      displayName: Configuration
+      type: OTHER
+  instantiation:
+      displayName: Instantiation
+      type: OTHER
+  monitoring:
+      displayName: Monitoring
+      type: OTHER
+  reporting:
+      displayName: Reporting
+      type: OTHER
+  logging:
+      displayName: Logging
+      type: OTHER
+  testing:
+      displayName: Testing
+      type: OTHER
+
+
+additionalInformationMaxNumberOfKeys: 50
+
+systemMonitoring:
+    enabled: false
+    isProxy: false
+    probeIntervalInSeconds: 15
+
+defaultHeatArtifactTimeoutMinutes: 60
+
+serviceDeploymentArtifacts:
+
+resourceDeploymentArtifacts:
+    HEAT:
+        acceptedTypes:
+            - yaml
+            - yml
+
+resourceInformationalDeployedArtifacts:
+    YANG_XML:
+        acceptedTypes:
+            - xml
+
+
+unLoggedUrls:
+   - /sdc2/rest/healthCheck
+
+cleanComponentsConfiguration:
+    cleanIntervalInMinutes: 1440
+    componentsToClean:
+       - Resource
+
+artifactsIndex: resources
+
+heatEnvArtifactHeader:
+    " # _______________________________________________________________________________________________________________________________________\n
+  #|                                    					    AT&T Proprietary (Restricted)           								 	  |\n
+  #|                                     Only for use by authorized individuals or any above-designated team(s)                            |\n
+  #|                                          within the AT&T companies and not for general distribution      							  |\n
+  #|_______________________________________________________________________________________________________________________________________|\n"
+heatEnvArtifactFooter:
+    " # _______________________________________________________________________________________________________________________________________\n
+  #|                                    					    AT&T Proprietary (Restricted)           								 	  |\n
+  #|                                     Only for use by authorized individuals or any above-designated team(s)                            |\n
+  #|                                          within the AT&T companies and not for general distribution      							  |\n
+  #|_______________________________________________________________________________________________________________________________________|\n"
diff --git a/openecomp-be/tools/zusammen-tools/src/test/resources/queries.yaml b/openecomp-be/tools/zusammen-tools/src/test/resources/queries.yaml
new file mode 100644
index 0000000..6ca8cd6
--- /dev/null
+++ b/openecomp-be/tools/zusammen-tools/src/test/resources/queries.yaml
@@ -0,0 +1,16 @@
+queries:
+  - select * from zusammen_dox.element;
+  - select * from zusammen_dox.element_namespace;
+  - select * from zusammen_dox.item;
+  - select * from zusammen_dox.version;
+  - select * from zusammen_dox.version_elements;
+  - select * from dox.item_permissions;
+  - select * from dox.vsp_merge_hint;
+item_columns:
+  - item_id
+  - item_id
+  - item_id
+  - item_id
+  - item_id
+  - item_id
+  - item_id
\ No newline at end of file
