diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/json/MapDeserializer.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/json/MapDeserializer.java
index 6d3f8f7..f51cb0d 100644
--- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/json/MapDeserializer.java
+++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/json/MapDeserializer.java
@@ -55,7 +55,7 @@
 		ObjectMapper mapper = new ObjectMapper();
 		JsonNode tree = mapper.readTree(parser);
 
-		Map<String, String> map = new LinkedHashMap<String, String>();
+		Map<String, String> map = new LinkedHashMap<>();
 		Iterator<JsonNode> iterator = tree.iterator();
 
 		while (iterator.hasNext()) {
@@ -71,4 +71,4 @@
 
 		return map;
 	}
-}
\ No newline at end of file
+}
diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/json/MapSerializer.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/json/MapSerializer.java
index 1db69f4..c2ea824 100644
--- a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/json/MapSerializer.java
+++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/json/MapSerializer.java
@@ -53,8 +53,9 @@
 		jsonGenerator.writeStartObject();
 		jsonGenerator.writeArrayFieldStart("entry");
 
-		for (String key : map.keySet()) {
-			String value = map.get(key);
+		for (Map.Entry<String,String> entry : map.entrySet()) {
+			String key = entry.getKey();
+			String value = entry.getValue();
 			jsonGenerator.writeStartObject();
 			jsonGenerator.writeStringField("key", key);
 			jsonGenerator.writeStringField("value", value);
@@ -64,4 +65,4 @@
 		jsonGenerator.writeEndArray();
 		jsonGenerator.writeEndObject();
 	}
-}
\ No newline at end of file
+}
diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/CatalogQueryExceptionCommon.java b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/CatalogQueryExceptionCommon.java
index 9f70914..a1bc085 100644
--- a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/CatalogQueryExceptionCommon.java
+++ b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/CatalogQueryExceptionCommon.java
@@ -40,7 +40,7 @@
 
 	public String toJsonString() {
 		try {
-			String jsonString = null;
+			String jsonString;
 			ObjectMapper mapper = new ObjectMapper();
 			mapper.enable(SerializationConfig.Feature.WRAP_ROOT_VALUE);
 			jsonString = mapper.writeValueAsString(this);
diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryAllottedResourceCustomization.java b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryAllottedResourceCustomization.java
index 75262e3..9a82ed2 100644
--- a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryAllottedResourceCustomization.java
+++ b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryAllottedResourceCustomization.java
@@ -54,7 +54,7 @@
 		"\t}";
 //		"\t}}";
 
-	public QueryAllottedResourceCustomization() { super(); allottedResourceCustomization = new ArrayList<AllottedResourceCustomization>(); }
+	public QueryAllottedResourceCustomization() { super(); allottedResourceCustomization = new ArrayList<>(); }
 	public QueryAllottedResourceCustomization(List<AllottedResourceCustomization> vlist) { allottedResourceCustomization = vlist; }
 
 	public List<AllottedResourceCustomization> getServiceAllottedResources(){ return this.allottedResourceCustomization; }
@@ -62,7 +62,7 @@
 
 	@Override
 	public String toString () {
-		StringBuffer buf = new StringBuffer();
+		StringBuilder buf = new StringBuilder();
 
 		boolean first = true;
 		int i = 1;
@@ -76,10 +76,10 @@
 
 	@Override
 	public String JSON2(boolean isArray, boolean isEmbed) {
-		StringBuffer buf = new StringBuffer();
+		StringBuilder buf = new StringBuilder();
 		if (!isEmbed && isArray) buf.append("{ ");
 		if (isArray) buf.append("\"serviceAllottedResources\": [");
-		Map<String, String> valueMap = new HashMap<String, String>();
+		Map<String, String> valueMap = new HashMap<>();
 		String sep = "";
 		boolean first = true;
 
@@ -114,4 +114,4 @@
 		return buf.toString();
 	}
 
-}
\ No newline at end of file
+}
diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceMacroHolder.java b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceMacroHolder.java
index 0e2aa71..e514767 100644
--- a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceMacroHolder.java
+++ b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceMacroHolder.java
@@ -60,8 +60,8 @@
 		Service service = serviceMacroHolder.getService();
 		if (service == null) return "\"serviceResources\": null";
 
-		StringBuffer buf = new StringBuffer();
-		Map<String, String> valueMap = new HashMap<String, String>();
+		StringBuilder buf = new StringBuilder();
+		Map<String, String> valueMap = new HashMap<>();
 
 		put(valueMap, "SERVICE_MODEL_NAME",         service.getModelName()); //getServiceModelName());
 		put(valueMap, "SERVICE_MODEL_UUID",         service.getModelUUID()); //getServiceModelUuid());
@@ -84,4 +84,4 @@
 		return buf.toString();
 	}
 
-}
\ No newline at end of file
+}
diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceNetworks.java b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceNetworks.java
index 42b6b65..59c601e 100644
--- a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceNetworks.java
+++ b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceNetworks.java
@@ -51,10 +51,10 @@
 		"\t}";
 //		"\t}}";
 
-	public QueryServiceNetworks() { super(); serviceNetworks = new ArrayList<NetworkResourceCustomization>(); }
+	public QueryServiceNetworks() { super(); serviceNetworks = new ArrayList<>(); }
 	public QueryServiceNetworks(List<NetworkResourceCustomization> vlist) {
 		LOGGER.debug ("QueryServiceNetworks:");
-		serviceNetworks = new ArrayList<NetworkResourceCustomization>();
+		serviceNetworks = new ArrayList<>();
 		for (NetworkResourceCustomization o : vlist) {
 			LOGGER.debug (o.toString());
 			serviceNetworks.add(o);
@@ -67,7 +67,7 @@
 
 	@Override
 	public String toString () {
-		StringBuffer buf = new StringBuffer();
+		StringBuilder buf = new StringBuilder();
 
 		boolean first = true;
 		int i = 1;
@@ -81,11 +81,11 @@
 
 	@Override
 	public String JSON2(boolean isArray, boolean isEmbed) {
-		StringBuffer buf = new StringBuffer();
+		StringBuilder buf = new StringBuilder();
 		if (!isEmbed && isArray) buf.append("{ ");
 		if (isArray) buf.append("\"serviceNetworks\": [");
 		//if (isArray) buf.append("[");
-		Map<String, String> valueMap = new HashMap<String, String>();
+		Map<String, String> valueMap = new HashMap<>();
 		String sep = "";
 		boolean first = true;
 
@@ -112,4 +112,4 @@
 		if (!isEmbed && isArray) buf.append("}");
 		return buf.toString();
 	}
-}
\ No newline at end of file
+}
diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceVnfs.java b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceVnfs.java
index ee3c86a..cfbb781 100644
--- a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceVnfs.java
+++ b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceVnfs.java
@@ -55,10 +55,10 @@
 			"\t}";
 //			"\t}}";
 
-	public QueryServiceVnfs() { super(); serviceVnfs = new ArrayList<VnfResourceCustomization>(); }
+	public QueryServiceVnfs() { super(); serviceVnfs = new ArrayList<>(); }
 	public QueryServiceVnfs(List<VnfResourceCustomization> vlist) { 
 		LOGGER.debug ("QueryServiceVnfs:");
-		serviceVnfs = new ArrayList<VnfResourceCustomization>();
+		serviceVnfs = new ArrayList<>();
 		for (VnfResourceCustomization o : vlist) {
 			LOGGER.debug ("-- o is a  serviceVnfs ----");
 			LOGGER.debug (o.toString());
@@ -72,7 +72,7 @@
 
 	@Override
 	public String toString () {
-		StringBuffer buf = new StringBuffer();
+		StringBuilder buf = new StringBuilder();
 
 		boolean first = true;
 		int i = 1;
@@ -86,10 +86,10 @@
 
 	@Override
 	public String JSON2(boolean isArray, boolean isEmbed) {
-		StringBuffer buf = new StringBuffer();
+		StringBuilder buf = new StringBuilder();
 		if (!isEmbed && isArray) buf.append("{ ");
 		if (isArray) buf.append("\"serviceVnfs\": [");
-		Map<String, String> valueMap = new HashMap<String, String>();
+		Map<String, String> valueMap = new HashMap<>();
 		String sep = "";
 		boolean first = true;
 
@@ -121,4 +121,4 @@
 		if (!isEmbed && isArray) buf.append("}");
 		return buf.toString();
 	}
-}
\ No newline at end of file
+}
diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryVfModule.java b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryVfModule.java
index 4675858..309aa06 100644
--- a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryVfModule.java
+++ b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryVfModule.java
@@ -50,10 +50,10 @@
 		"\t}";
 //		"\t}}";
 
-	public QueryVfModule() { super(); vfModules = new ArrayList<VfModuleCustomization>(); }
+	public QueryVfModule() { super(); vfModules = new ArrayList<>(); }
 	public QueryVfModule(List<VfModuleCustomization> vlist) { 
 		LOGGER.debug ("QueryVfModule:");
-		vfModules = new ArrayList<VfModuleCustomization>();
+		vfModules = new ArrayList<>();
 		if (vlist != null) {
 			for (VfModuleCustomization o : vlist) {
 			LOGGER.debug ("-- o is a  vfModules ----");
@@ -69,7 +69,7 @@
 
 	@Override
 	public String toString () {
-		StringBuffer buf = new StringBuffer();
+		StringBuilder buf = new StringBuilder();
 
 		boolean first = true;
 		int i = 1;
@@ -83,9 +83,9 @@
 
 	@Override
 	public String JSON2(boolean isArray, boolean x) {
-		StringBuffer buf = new StringBuffer();
+		StringBuilder buf = new StringBuilder();
 		if (isArray) buf.append("\"vfModules\": [");
-		Map<String, String> valueMap = new HashMap<String, String>();
+		Map<String, String> valueMap = new HashMap<>();
 		String sep = "";
 		boolean first = true;
 
@@ -95,7 +95,7 @@
 			boolean vfNull = o.getVfModule() == null ? true : false;
 			boolean hasVolumeGroup = false;
 			String envt = o.getHeatEnvironmentArtifactUuid();
-			if (envt != null && !envt.equals("")) {
+			if (envt != null && !"".equals(envt)) {
 				hasVolumeGroup = true;
 			}
 
@@ -116,4 +116,4 @@
 		if (isArray) buf.append("]");
 		return buf.toString();
 	}
-}
\ No newline at end of file
+}
diff --git a/adapters/mso-network-adapter/src/main/java/org/openecomp/mso/adapters/network/ContrailSubnet.java b/adapters/mso-network-adapter/src/main/java/org/openecomp/mso/adapters/network/ContrailSubnet.java
index b755cad..ec523b8 100644
--- a/adapters/mso-network-adapter/src/main/java/org/openecomp/mso/adapters/network/ContrailSubnet.java
+++ b/adapters/mso-network-adapter/src/main/java/org/openecomp/mso/adapters/network/ContrailSubnet.java
@@ -34,22 +34,22 @@
 import static org.openecomp.mso.openstack.utils.MsoCommonUtils.isNullOrEmpty;
 
 public class ContrailSubnet {
-	private static MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA);
+	private static MsoLogger logger = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA);
 
 	@JsonProperty("network_ipam_refs_data_ipam_subnets_subnet")
 	private ContrailSubnetIp subnet = new ContrailSubnetIp();
 	
 	@JsonProperty("network_ipam_refs_data_ipam_subnets_default_gateway")
-	private String default_gateway;
+	private String defaultGateway;
 	
 	@JsonProperty("network_ipam_refs_data_ipam_subnets_subnet_name")
-	private String subnet_name;
+	private String subnetName;
 	
 	@JsonProperty("network_ipam_refs_data_ipam_subnets_enable_dhcp")
-	private Boolean enable_dhcp;
+	private Boolean enableDhcp;
 	
 	@JsonProperty("network_ipam_refs_data_ipam_subnets_addr_from_start")
-	private Boolean addr_from_start = true;
+	private Boolean addrFromStart = true;
 	
 	/** future - leave this commented
 	private String subnet_uuid;
@@ -60,18 +60,18 @@
 	**/
 	
 	@JsonProperty("network_ipam_refs_data_ipam_subnets_allocation_pools")
-	private List<ContrailSubnetPool> allocation_pools =  new ArrayList <> ();
+	private List<ContrailSubnetPool> allocationPools =  new ArrayList <> ();
 
 	public ContrailSubnet() {
 		super();
 	}
 
-	public String getDefault_gateway() {
-		return default_gateway;
+	public String getDefaultGateway() {
+		return defaultGateway;
 	}
 
-	public void setDefault_gateway(String default_gateway) {
-		this.default_gateway = default_gateway;
+	public void setDefaultGateway(String defaultGateway) {
+		this.defaultGateway = defaultGateway;
 	}
 
 	public ContrailSubnetIp getSubnet() {
@@ -82,36 +82,36 @@
 		this.subnet = subnet;
 	}
 
-	public Boolean isEnable_dhcp() {
-		return enable_dhcp;
+	public Boolean isEnableDhcp() {
+		return enableDhcp;
 	}
 
-	public void setEnable_dhcp(Boolean enable_dhcp) {
-		this.enable_dhcp = enable_dhcp;
+	public void setEnableDhcp(Boolean enableDhcp) {
+		this.enableDhcp = enableDhcp;
 	}
 
-	public String getSubnet_name() {
-		return subnet_name;
+	public String getSubnetName() {
+		return subnetName;
 	}
 
-	public void setSubnet_name(String subnet_name) {
-		this.subnet_name = subnet_name;
+	public void setSubnetName(String subnetName) {
+		this.subnetName = subnetName;
 	}
 
-	public List<ContrailSubnetPool> getAllocation_pools() {
-		return allocation_pools;
+	public List<ContrailSubnetPool> getAllocationPools() {
+		return allocationPools;
 	}
 
-	public void setPools(List<ContrailSubnetPool> allocation_pools) {
-		this.allocation_pools = allocation_pools;
+	public void setPools(List<ContrailSubnetPool> allocationPools) {
+		this.allocationPools = allocationPools;
 	}
 
-	public Boolean isAddr_from_start() {
-		return addr_from_start;
+	public Boolean isAddrFromStart() {
+		return addrFromStart;
 	}
 
-	public void setAddr_from_start(Boolean addr_from_start) {
-		this.addr_from_start = addr_from_start;
+	public void setAddrFromStart(Boolean addrFromStart) {
+		this.addrFromStart = addrFromStart;
 	}
 
 	public JsonNode toJsonNode()
@@ -124,8 +124,8 @@
 		}
 		catch (Exception e)
 		{
-			String error = "Error creating JsonNode for Contrail Subnet:" + subnet_name;
-			LOGGER.error (MessageEnum.RA_MARSHING_ERROR, error, "", "", MsoLogger.ErrorCode.SchemaError, "Exception creating JsonNode for Contrail Subnet", e);
+			String error = "Error creating JsonNode for Contrail Subnet:" + subnetName;
+			logger.error (MessageEnum.RA_MARSHING_ERROR, error, "", "", MsoLogger.ErrorCode.SchemaError, "Exception creating JsonNode for Contrail Subnet", e);
 		}
 		
 		return node;
@@ -141,41 +141,41 @@
 		}
 		catch (Exception e)
 		{
-			String error = "Error creating JsonString for Contrail Subnet:" + subnet_name;
-			LOGGER.error (MessageEnum.RA_MARSHING_ERROR, error, "", "", MsoLogger.ErrorCode.SchemaError, "Exception creating JsonString for Contrail Subnet", e);
+			String error = "Error creating JsonString for Contrail Subnet:" + subnetName;
+			logger.error (MessageEnum.RA_MARSHING_ERROR, error, "", "", MsoLogger.ErrorCode.SchemaError, "Exception creating JsonString for Contrail Subnet", e);
 		}
 		
 		return jsonString;
 	}
 	//poulate contrail subnet with input(from bopel) subnet
-	public void populateWith(Subnet i_subnet)
+	public void populateWith(Subnet inputSubnet)
 	{
-		if (i_subnet != null)
+		if (inputSubnet != null)
 		{
-			if (!isNullOrEmpty(i_subnet.getSubnetName()))
-				subnet_name = i_subnet.getSubnetName();
+			if (!isNullOrEmpty(inputSubnet.getSubnetName()))
+				subnetName = inputSubnet.getSubnetName();
 			else
-				subnet_name = i_subnet.getSubnetId();
-			enable_dhcp = i_subnet.getEnableDHCP();
-			default_gateway = i_subnet.getGatewayIp();
-			if (!isNullOrEmpty(i_subnet.getCidr()) )
+				subnetName = inputSubnet.getSubnetId();
+			enableDhcp = inputSubnet.getEnableDHCP();
+			defaultGateway = inputSubnet.getGatewayIp();
+			if (!isNullOrEmpty(inputSubnet.getCidr()) )
 			{
-				int idx = i_subnet.getCidr().indexOf("/");
+				int idx = inputSubnet.getCidr().indexOf("/");
 				if (idx != -1)
 				{
-					subnet.setIp_prefix(i_subnet.getCidr().substring(0, idx));
-					subnet.setIp_prefix_len(i_subnet.getCidr().substring(idx+1));
+					subnet.setIpPrefix(inputSubnet.getCidr().substring(0, idx));
+					subnet.setIpPrefixLen(inputSubnet.getCidr().substring(idx+1));
 				}
 			}
-			if (i_subnet.getAllocationPools() != null)
+			if (inputSubnet.getAllocationPools() != null)
 			{
-				for (Pool pool : i_subnet.getAllocationPools())
+				for (Pool pool : inputSubnet.getAllocationPools())
 				{
 					if ( !isNullOrEmpty(pool.getStart()) && !isNullOrEmpty(pool.getEnd()) )
 					{		
 						ContrailSubnetPool csp = new ContrailSubnetPool();
 						csp.populateWith(pool);
-						allocation_pools.add (csp);
+						allocationPools.add (csp);
 					}
 				}
 			}
@@ -186,11 +186,11 @@
 	public String toString() {
 		
 		StringBuilder buf = new StringBuilder ();
-		for (ContrailSubnetPool pool : allocation_pools)
+		for (ContrailSubnetPool pool : allocationPools)
 		{
 			 buf.append(pool.toString());
 		}
-		return "ContrailSubnet [subnet=" + subnet.toString() + " default_gateway=" + default_gateway
-				+ " enable_dhcp=" + enable_dhcp +  " addr_from_start=" + addr_from_start + " subnet_name=" + subnet_name + " allocation_pools=" + buf + " ]";
+		return "ContrailSubnet [subnet=" + subnet.toString() + " default_gateway=" + defaultGateway
+				+ " enable_dhcp=" + enableDhcp +  " addr_from_start=" + addrFromStart + " subnet_name=" + subnetName + " allocation_pools=" + buf + " ]";
 	}
 }
diff --git a/adapters/mso-network-adapter/src/main/java/org/openecomp/mso/adapters/network/ContrailSubnetIp.java b/adapters/mso-network-adapter/src/main/java/org/openecomp/mso/adapters/network/ContrailSubnetIp.java
index ce7fec3..b7af894 100644
--- a/adapters/mso-network-adapter/src/main/java/org/openecomp/mso/adapters/network/ContrailSubnetIp.java
+++ b/adapters/mso-network-adapter/src/main/java/org/openecomp/mso/adapters/network/ContrailSubnetIp.java
@@ -26,33 +26,34 @@
 public class ContrailSubnetIp {
 	
 	@JsonProperty("network_ipam_refs_data_ipam_subnets_subnet_ip_prefix")
-	private String ip_prefix;
+	private String ipPrefix;
 	
 	@JsonProperty("network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len")
-	private String ip_prefix_len; 
+	private String ipPrefixLen;
 
 	public ContrailSubnetIp() {
+		/* Empty constructor */
 	}
 
-	public String getIp_prefix() {
-		return ip_prefix;
+	public String getIpPrefix() {
+		return ipPrefix;
 	}
 
-	public void setIp_prefix(String ip_prefix) {
-		this.ip_prefix = ip_prefix;
+	public void setIpPrefix(String ipPrefix) {
+		this.ipPrefix = ipPrefix;
 	}
 
-	public String getIp_prefix_len() {
-		return ip_prefix_len;
+	public String getIpPrefixLen() {
+		return ipPrefixLen;
 	}
 
-	public void setIp_prefix_len(String ip_prefix_len) {
-		this.ip_prefix_len = ip_prefix_len;
+	public void setIpPrefixLen(String ipPrefixLen) {
+		this.ipPrefixLen = ipPrefixLen;
 	}
 
 	@Override
 	public String toString() {
-		return "ContrailSubnetIp [ip_prefix=" + ip_prefix + ", ip_prefix_len=" + ip_prefix_len + "]";
+		return "ContrailSubnetIp [ip_prefix=" + ipPrefix + ", ip_prefix_len=" + ipPrefixLen + "]";
 	}
 
 }
diff --git a/adapters/mso-network-adapter/src/main/java/org/openecomp/mso/adapters/network/ContrailSubnetPool.java b/adapters/mso-network-adapter/src/main/java/org/openecomp/mso/adapters/network/ContrailSubnetPool.java
index 71b9ebb..6429e49 100644
--- a/adapters/mso-network-adapter/src/main/java/org/openecomp/mso/adapters/network/ContrailSubnetPool.java
+++ b/adapters/mso-network-adapter/src/main/java/org/openecomp/mso/adapters/network/ContrailSubnetPool.java
@@ -32,6 +32,7 @@
 	private String end;
 
 	public ContrailSubnetPool() {
+		/* Empty constructor */
 	}
 
 	public String getStart() {
diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/MsoRequestsDbAdapter.java b/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/MsoRequestsDbAdapter.java
index 15f74c4..9648922 100644
--- a/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/MsoRequestsDbAdapter.java
+++ b/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/MsoRequestsDbAdapter.java
@@ -27,7 +27,6 @@
 
 import org.openecomp.mso.adapters.requestsdb.exceptions.MsoRequestsDbException;
 import org.openecomp.mso.requestsdb.InfraActiveRequests;
-import org.openecomp.mso.requestsdb.SiteStatus;
 
 /**
  * MSO Request DB Adapter Web Service
diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/MsoRequestsDbAdapterImpl.java b/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/MsoRequestsDbAdapterImpl.java
index a5e9690..f8a2c98 100644
--- a/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/MsoRequestsDbAdapterImpl.java
+++ b/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/MsoRequestsDbAdapterImpl.java
@@ -21,7 +21,6 @@
 package org.openecomp.mso.adapters.requestsdb;
 
 import java.sql.Timestamp;
-import java.util.List;
 
 import javax.jws.WebService;
 
@@ -43,7 +42,7 @@
 
     protected AbstractSessionFactoryManager requestsDbSessionFactoryManager = new RequestsDbSessionFactoryManager ();
     
-    private static MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA);
+    private static MsoLogger logger = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA);
 
     @Override
     public void updateInfraRequest (String requestId,
@@ -110,90 +109,90 @@
             }
             queryString += "lastModifiedBy = :lastModifiedBy where requestId = :requestId OR clientRequestId = :requestId";
 
-            LOGGER.debug("Executing update: " + queryString);
+            logger.debug("Executing update: " + queryString);
 
             Query query = session.createQuery (queryString);
             query.setParameter ("requestId", requestId);
             if (statusMessage != null) {
                 query.setParameter ("statusMessage", statusMessage);
-                LOGGER.debug ("StatusMessage in updateInfraRequest is set to: " + statusMessage);
+                logger.debug ("StatusMessage in updateInfraRequest is set to: " + statusMessage);
             }
             if (responseBody != null) {
             	query.setParameter ("responseBody", responseBody);
-            	LOGGER.debug ("ResponseBody in updateInfraRequest is set to: " + responseBody);
+                logger.debug ("ResponseBody in updateInfraRequest is set to: " + responseBody);
             }
             if (requestStatus != null) {
                 query.setParameter ("requestStatus", requestStatus.toString ());
-                LOGGER.debug ("RequestStatus in updateInfraRequest is set to: " + requestStatus.toString());
+                logger.debug ("RequestStatus in updateInfraRequest is set to: " + requestStatus.toString());
             }
 
             if (progress != null) {
                 query.setParameter ("progress", Long.parseLong (progress));
-                LOGGER.debug ("Progress in updateInfraRequest is set to: " + progress);
+                logger.debug ("Progress in updateInfraRequest is set to: " + progress);
             }
             if (vnfOutputs != null) {
                 query.setParameter ("vnfOutputs", vnfOutputs);
-                LOGGER.debug ("VnfOutputs in updateInfraRequest is set to: " + vnfOutputs);
+                logger.debug ("VnfOutputs in updateInfraRequest is set to: " + vnfOutputs);
             }
             if (serviceInstanceId != null) {
                 query.setParameter ("serviceInstanceId", serviceInstanceId);
-                LOGGER.debug ("ServiceInstanceId in updateInfraRequest is set to: " + serviceInstanceId);
+                logger.debug ("ServiceInstanceId in updateInfraRequest is set to: " + serviceInstanceId);
             }
             if (networkId != null) {
                 query.setParameter ("networkId", networkId);
-                LOGGER.debug ("NetworkId in updateInfraRequest is set to: " + networkId);
+                logger.debug ("NetworkId in updateInfraRequest is set to: " + networkId);
             }
             if (vnfId != null) {
                 query.setParameter ("vnfId", vnfId);
-                LOGGER.debug ("VnfId in updateInfraRequest is set to: " + vnfId);
+                logger.debug ("VnfId in updateInfraRequest is set to: " + vnfId);
             }
             if (vfModuleId != null) {
                 query.setParameter ("vfModuleId", vfModuleId);
-                LOGGER.debug ("vfModuleId in updateInfraRequest is set to: " + vfModuleId);
+                logger.debug ("vfModuleId in updateInfraRequest is set to: " + vfModuleId);
             }
             if (volumeGroupId != null) {
                 query.setParameter ("volumeGroupId", volumeGroupId);
-                LOGGER.debug ("VolumeGroupId in updateInfraRequest is set to: " + volumeGroupId);
+                logger.debug ("VolumeGroupId in updateInfraRequest is set to: " + volumeGroupId);
             }
             if (serviceInstanceName != null) {
                 query.setParameter ("serviceInstanceName", serviceInstanceName);
-                LOGGER.debug ("ServiceInstanceName in updateInfraRequest is set to: " + serviceInstanceName);
+                logger.debug ("ServiceInstanceName in updateInfraRequest is set to: " + serviceInstanceName);
             }
             if (vfModuleName != null) {
                 query.setParameter ("vfModuleName", vfModuleName);
-                LOGGER.debug ("vfModuleName in updateInfraRequest is set to: " + vfModuleName);
+                logger.debug ("vfModuleName in updateInfraRequest is set to: " + vfModuleName);
             }
             Timestamp nowTimeStamp = new Timestamp (System.currentTimeMillis ());
             if (requestStatus == RequestStatusType.COMPLETE || requestStatus == RequestStatusType.FAILED) {
                 query.setParameter ("endTime", nowTimeStamp);
-                LOGGER.debug ("EndTime in updateInfraRequest is set to: " + nowTimeStamp);
+                logger.debug ("EndTime in updateInfraRequest is set to: " + nowTimeStamp);
             } else {
                 query.setParameter ("modifyTime", nowTimeStamp);
-                LOGGER.debug ("ModifyTime in updateInfraRequest is set to: " + nowTimeStamp);
+                logger.debug ("ModifyTime in updateInfraRequest is set to: " + nowTimeStamp);
             }
             query.setParameter ("lastModifiedBy", lastModifiedBy);
-            LOGGER.debug ("LastModifiedBy in updateInfraRequest is set to: " + lastModifiedBy);
+            logger.debug ("LastModifiedBy in updateInfraRequest is set to: " + lastModifiedBy);
             result = query.executeUpdate ();
-            checkIfExists (result, requestId, startTime);
+            checkIfExists (result, requestId);
             session.getTransaction ().commit ();
         } catch (HibernateException e) {
             String error = "Unable to update MSO Requests DB: " + e.getMessage ();
-            LOGGER.error (MessageEnum.RA_CANT_UPDATE_REQUEST, "infra request parameters", requestId, "", "", MsoLogger.ErrorCode.BusinessProcesssError, "HibernateException - " + error, e);
-            LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DBAccessError, error);
+            logger.error (MessageEnum.RA_CANT_UPDATE_REQUEST, "infra request parameters", requestId, "", "", MsoLogger.ErrorCode.BusinessProcesssError, "HibernateException - " + error, e);
+            logger.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DBAccessError, error);
             throw new MsoRequestsDbException (error, e);
         } finally {
             if (session != null && session.isOpen ()) {
                 session.close ();
             }
         }
-        LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successful");
+        logger.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successful");
     }
 
 
-    private void checkIfExists (int result, String requestId, long startTime) throws MsoRequestsDbException {
+    private void checkIfExists (int result, String requestId) throws MsoRequestsDbException {
         if (result == 0) {
             String error = "Request ID does not exist in MSO Requests DB: " + requestId;
-            LOGGER.error (MessageEnum.RA_DB_REQUEST_NOT_EXIST, requestId, "", "", MsoLogger.ErrorCode.DataError, error);
+            logger.error (MessageEnum.RA_DB_REQUEST_NOT_EXIST, requestId, "", "", MsoLogger.ErrorCode.DataError, error);
             throw new MsoRequestsDbException (error);
         }
     }
@@ -205,7 +204,7 @@
         MsoLogger.setLogContext (requestId, null);
         Session session = requestsDbSessionFactoryManager.getSessionFactory ().openSession ();
 
-        LOGGER.debug ("Call to MSO Infra RequestsDb adapter get method with request Id: " + requestId);
+        logger.debug ("Call to MSO Infra RequestsDb adapter get method with request Id: " + requestId);
 
         InfraActiveRequests request = null;
         try {
@@ -216,15 +215,15 @@
         } catch (HibernateException e) {
             String error = "Unable to retrieve MSO Infra Requests DB for Request ID "
                            + requestId;
-            LOGGER.error (MessageEnum.RA_DB_REQUEST_NOT_EXIST, "Get Infra request", requestId, "", "", MsoLogger.ErrorCode.BusinessProcesssError, "HibernateException - " + error, e);
-            LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DBAccessError, error);
+            logger.error (MessageEnum.RA_DB_REQUEST_NOT_EXIST, "Get Infra request", requestId, "", "", MsoLogger.ErrorCode.BusinessProcesssError, "HibernateException - " + error, e);
+            logger.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DBAccessError, error);
             throw new MsoRequestsDbException (error, e);
         } finally {
             if (session != null && session.isOpen ()) {
                 session.close ();
             }
         }
-        LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successful");
+        logger.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successful");
         return request;
     }
 
@@ -235,13 +234,14 @@
      * @param siteName The unique name of the site
      * @return Status of that site
      */
+    @Override
     public boolean getSiteStatus (String siteName) {
-        UUIDChecker.generateUUID (LOGGER);
+        UUIDChecker.generateUUID (logger);
         Session session = requestsDbSessionFactoryManager.getSessionFactory ().openSession ();
 
         long startTime = System.currentTimeMillis ();
         SiteStatus siteStatus = null;
-        LOGGER.debug ("Request database - get Site Status with Site name:" + siteName);
+        logger.debug ("Request database - get Site Status with Site name:" + siteName);
         try {
             String hql = "FROM SiteStatus WHERE siteName = :site_name";
             Query query = session.createQuery (hql);
@@ -255,10 +255,10 @@
         }
         if (siteStatus == null) {
             // if not exist in DB, it means the site is not disabled, thus return true
-            LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successful");
+            logger.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successful");
             return true;
         } else {
-            LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successful");
+            logger.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successful");
             return siteStatus.getStatus();
         }
     }
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/client/SDNCCallbackAdapterPortType.java b/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/client/SDNCCallbackAdapterPortType.java
index 0e72861..1b717b4 100644
--- a/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/client/SDNCCallbackAdapterPortType.java
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/client/SDNCCallbackAdapterPortType.java
@@ -40,6 +40,7 @@
 @WebService(targetNamespace = "http://org.openecomp/workflow/sdnc/adapter/callback/wsdl/v1", name = "SDNCCallbackAdapterPortType")
 @XmlSeeAlso({ObjectFactory.class})
 @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
+@FunctionalInterface
 public interface SDNCCallbackAdapterPortType {
 
     @WebResult(name = "SDNCAdapterResponse", targetNamespace = "http://org.openecomp/workflow/sdnc/adapter/schema/v1", partName = "SDNCAdapterCallbackResponse")
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/client/SDNCCallbackAdapterService.java b/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/client/SDNCCallbackAdapterService.java
index 9e0718c..d63e852 100644
--- a/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/client/SDNCCallbackAdapterService.java
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/client/SDNCCallbackAdapterService.java
@@ -45,14 +45,13 @@
 
 	private static MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA);
 
-    public final static URL WSDL_LOCATION;
-    public final static QName SERVICE = new QName("http://org.openecomp/workflow/sdnc/adapter/callback/wsdl/v1", "SDNCCallbackAdapterService");
-    public final static QName SDNCCallbackAdapterSoapHttpPort = new QName("http://org.openecomp/workflow/sdnc/adapter/callback/wsdl/v1", "SDNCCallbackAdapterSoapHttpPort");
+    public static final URL WSDL_LOCATION;
+    public static final QName SERVICE = new QName("http://org.openecomp/workflow/sdnc/adapter/callback/wsdl/v1", "SDNCCallbackAdapterService");
+    public static final QName SDNCCallbackAdapterSoapHttpPort = new QName("http://org.openecomp/workflow/sdnc/adapter/callback/wsdl/v1", "SDNCCallbackAdapterSoapHttpPort");
     static {
         URL wsdlUrl = null;
         try {
         	wsdlUrl = Thread.currentThread().getContextClassLoader().getResource("main/resources/SDNCCallbackAdapter.wsdl");
-        	//wsdlUrl = SDNCCallbackAdapterService.class.getClassLoader().getResource("SDNCCallbackAdapter.wsdl");
         } catch (Exception e) {
             msoLogger.error(MessageEnum.RA_WSDL_NOT_FOUND, "SDNCCallbackAdapter.wsdl", "SDNC", "", MsoLogger.ErrorCode.DataError, "Exception - WSDL not found", e);
         }
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/impl/Utils.java b/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/impl/Utils.java
index 525002f..6ab9ade 100644
--- a/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/impl/Utils.java
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/impl/Utils.java
@@ -41,6 +41,9 @@
 
 	private static MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA);
 
+	private Utils() {
+	}
+
 	public static String genSdncReq(Document reqDoc, RequestTunables rt) {
 		try {
 
diff --git a/adapters/mso-vnf-adapter/src/main/java/org/openecomp/mso/adapters/vnf/MsoVnfAdapterImpl.java b/adapters/mso-vnf-adapter/src/main/java/org/openecomp/mso/adapters/vnf/MsoVnfAdapterImpl.java
index c8c036d..cba378e 100644
--- a/adapters/mso-vnf-adapter/src/main/java/org/openecomp/mso/adapters/vnf/MsoVnfAdapterImpl.java
+++ b/adapters/mso-vnf-adapter/src/main/java/org/openecomp/mso/adapters/vnf/MsoVnfAdapterImpl.java
@@ -22,10 +22,17 @@
 package org.openecomp.mso.adapters.vnf;
 
 
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStreamReader;
+
+import java.util.Arrays;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.concurrent.TimeUnit;
 import java.util.Scanner;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
@@ -540,6 +547,41 @@
         return string;
     }
 
+    private boolean callHeatbridge(String heatStackId) {
+    	String executionDir = "/usr/local/lib/python2.7/dist-packages/heatbridge";
+    	String openstackIdentityUrl = "", username = "", password = "", tenant = "", region = "", owner = "";
+    	long waitTimeMs = 10000l;
+    	try {
+    		String[] cmdarray = {"/usr/bin/python", "HeatBridgeMain.py", openstackIdentityUrl, username, password, tenant, region, owner, heatStackId};
+    		String[] envp = null;
+    		File dir = new File(executionDir);
+    		LOGGER.debug("Calling HeatBridgeMain.py in " + dir + " with arguments " + Arrays.toString(cmdarray));
+    		Runtime r = Runtime.getRuntime();
+    		Process p = r.exec(cmdarray, envp, dir);
+    		/*			
+ 			BufferedReader stdout = new BufferedReader(new InputStreamReader(p.getInputStream()));
+ 			String linein = stdout.readLine();
+ 			while (linein!=null) {
+ 				System.out.println(linein);
+ 				linein = stdout.readLine();
+ 			}
+    		 */
+    		boolean wait = p.waitFor(waitTimeMs, TimeUnit.MILLISECONDS);
+
+    		LOGGER.debug(" HeatBridgeMain.py returned " + wait + " with code " + p.exitValue());
+    		return (wait && p.exitValue()==0);
+    	} catch (IOException e) {
+    		LOGGER.debug(" HeatBridgeMain.py failed with IO Exception! " + e);
+    		return false;
+    	} catch (InterruptedException e) {
+    		LOGGER.debug(" HeatBridgeMain.py failed when interrupted! " + e);
+    		return false;
+    	} catch (RuntimeException e) {
+    		LOGGER.debug(" HeatBridgeMain.py failed for unknown reasons!" + e);
+    		return false;
+    	}
+    }
+
     private void sendMapToDebug(Map<String, Object> inputs, String optionalName) {
     	int i = 0;
     	StringBuilder sb = new StringBuilder(optionalName == null ? "\ninputs" : "\n" + optionalName);
@@ -731,6 +773,9 @@
         vfRollback.setIsBase(isBaseRequest);
         vfRollback.setModelCustomizationUuid(mcu);
 
+        // Put data into A&AI through Heatstack
+        boolean heatStackCallSuccess = callHeatbridge(baseVfHeatStackId);
+
         // First, look up to see if the VF already exists.
         MsoHeatUtils heat = new MsoHeatUtils (MSO_PROP_VNF_ADAPTER, msoPropertiesFactory,cloudConfigFactory);
 
diff --git a/asdc-controller/src/main/java/org/openecomp/mso/asdc/client/ASDCController.java b/asdc-controller/src/main/java/org/openecomp/mso/asdc/client/ASDCController.java
index 3ca8527..22c4b04 100644
--- a/asdc-controller/src/main/java/org/openecomp/mso/asdc/client/ASDCController.java
+++ b/asdc-controller/src/main/java/org/openecomp/mso/asdc/client/ASDCController.java
@@ -442,7 +442,7 @@
         try {
         	String resourceType = resourceStructure.getResourceInstance().getResourceType();
         	String category = resourceStructure.getResourceInstance().getCategory();
-        	if(resourceType.equals("VF") && !category.equalsIgnoreCase("Allotted Resource")){
+        	if("VF".equals(resourceType) && !"Allotted Resource".equalsIgnoreCase(category)){
         		resourceStructure.createVfModuleStructures();
         	}
         	//resourceInstaller.installTheResource (resourceStructure);
diff --git a/asdc-controller/src/main/java/org/openecomp/mso/asdc/installer/heat/ToscaResourceInstaller.java b/asdc-controller/src/main/java/org/openecomp/mso/asdc/installer/heat/ToscaResourceInstaller.java
index 11199dc..24950db 100644
--- a/asdc-controller/src/main/java/org/openecomp/mso/asdc/installer/heat/ToscaResourceInstaller.java
+++ b/asdc-controller/src/main/java/org/openecomp/mso/asdc/installer/heat/ToscaResourceInstaller.java
@@ -786,7 +786,7 @@
 		
 		String providerNetwork = toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(networkNodeTemplate, SdcPropertyNames.PROPERTY_NAME_PROVIDERNETWORK_ISPROVIDERNETWORK);
 		
-		if(providerNetwork != null && providerNetwork.equalsIgnoreCase("true")){
+		if("true".equalsIgnoreCase(providerNetwork)){
 			networkResource.setNeutronNetworkType("PROVIDER");
 		} else {
 			networkResource.setNeutronNetworkType("BASIC");
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/AAIRestClientImpl.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/AAIRestClientImpl.java
index c58f22f..ae8638f 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/AAIRestClientImpl.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/AAIRestClientImpl.java
@@ -42,8 +42,6 @@
 import org.openecomp.mso.bpmn.core.PropertyConfiguration;
 import org.openecomp.mso.client.aai.entities.CustomQuery;
 import org.openecomp.mso.client.aai.entities.Results;
-import org.openecomp.mso.logger.MsoLogger;
-import org.openecomp.mso.properties.MsoPropertiesFactory;
 import org.springframework.stereotype.Service;
 
 import com.fasterxml.jackson.core.JsonParseException;
@@ -56,15 +54,10 @@
 
 	private final WebTarget webTarget;
 
-	private static MsoPropertiesFactory msoPropertiesFactory = new MsoPropertiesFactory();
-
-	private static MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.GENERAL);
-
 	private static final String ENDPOINT_VERSION = "v10";
 	private static final String ENDPOINT_GET_ALL = ENDPOINT_VERSION + "/cloud-infrastructure/pservers";
 	private static final String ENDPOINT_GET_ALL_VNFS = ENDPOINT_VERSION + "/network/generic-vnfs";
 	private static final String ENDPOINT_CUSTOM_QUERY = ENDPOINT_VERSION + "/query";
-	private static final String PSERVER_BY_VNF_QUERY = "g.V().has('aai-node-type', 'generic-vnf').has('vnf-name','USAUTOUFTIL2001UJDM02').out('runsOnPserver').has('aai-node-type', 'pserver')";
 	private static final String PSERVER_VNF_QUERY = "pservers-fromVnf";
 	private static final String GENERIC_VNF_PATH = ENDPOINT_VERSION + "/network/generic-vnfs/generic-vnf";
 	private static final String SERVICE_TOPOLOGY_BY_SERVICE_INSTANCE_ID = "store(‘x’).union(__.in(‘subscribesTo’).has(‘aai-node-type’,’customer’).store(‘x’),__.out(‘uses’).has(‘aai-node-type’,’allotted-resource’).store(‘x’),__.in(‘hasInstance’).has(‘aai-node-type’,’generic-vnf’).store(‘x’).union("
@@ -92,7 +85,6 @@
 	public AAIRestClientImpl(final String host) throws NoSuchAlgorithmException {
 		Logger logger = Logger.getLogger(getClass().getName());
 		Client client = this.getSSLClient();
-		Map<String, String> properties = PropertyConfiguration.getInstance().getProperties("mso.bpmn.urn.properties");
 		webTarget = client.register(logger).register(new AAIClientResponseExceptionMapper()).target(host + "/aai");
 	}
 
@@ -107,7 +99,7 @@
 	@Override
 	public List<Pserver> getPhysicalServerByVnfId(String vnfId, String transactionLoggingUuid)
 			throws JsonParseException, JsonMappingException, IOException {
-		List<String> startNodes = new ArrayList<String>();
+		List<String> startNodes = new ArrayList<>();
 		startNodes.add("network/generic-vnfs/generic-vnf/" + vnfId);
 		String jsonInput = webTarget.register(AAIQueryObjectMapperProvider.class).path(ENDPOINT_CUSTOM_QUERY)
 				.queryParam("format", "resource").request().header("X-FromAppId", "MSO")
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/entities/Results.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/entities/Results.java
index c9c12c4..aea223d 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/entities/Results.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/entities/Results.java
@@ -42,7 +42,7 @@
 	
     public List<T> getResult() {
         if (result == null) {
-        	result = new ArrayList<T>();
+        	result = new ArrayList<>();
         }
         return this.result;
     }
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/appc/ApplicationControllerClient.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/appc/ApplicationControllerClient.java
index b164682..26c1c4a 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/appc/ApplicationControllerClient.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/appc/ApplicationControllerClient.java
@@ -63,15 +63,7 @@
 
     private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA);
     
-	private static final int ACCEPT_SERIES = 100;
-	private static final int ERROR_SERIES = 200;
-	private static final int REJECT_SERIES = 300;
-	private static final int SUCCESS_SERIES = 400;
-	private static final int SUCCESS_STATUS = SUCCESS_SERIES + 0;
 	private static final int PARTIAL_SERIES = 500;
-	private static final int PARTIAL_SUCCESS_STATUS = PARTIAL_SERIES + 0;
-
-	private final boolean useLCMBypass = false;
 
 	private final String apiVer = "2.00";
 	private final String originatorId = "MSO";
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/LoggingFilter.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/LoggingFilter.java
index abd8543..665b905 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/LoggingFilter.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/LoggingFilter.java
@@ -53,19 +53,20 @@
 
 	private InputStream logInboundEntity(final StringBuilder b, InputStream stream, final Charset charset)
 			throws IOException {
-		if (!stream.markSupported()) {
-			stream = new BufferedInputStream(stream);
+		InputStream inputStream = stream;
+		if (!inputStream.markSupported()) {
+			inputStream = new BufferedInputStream(inputStream);
 		}
-		stream.mark(maxEntitySize + 1);
+		inputStream.mark(maxEntitySize + 1);
 		final byte[] entity = new byte[maxEntitySize + 1];
-		final int entitySize = stream.read(entity);
+		final int entitySize = inputStream.read(entity);
 		b.append(new String(entity, 0, Math.min(entitySize, maxEntitySize), charset));
 		if (entitySize > maxEntitySize) {
 			b.append("...more...");
 		}
 		b.append('\n');
-		stream.reset();
-		return stream;
+		inputStream.reset();
+		return inputStream;
 	}
 
 	@Override
@@ -126,4 +127,4 @@
 			out.write(i);
 		}
 	}
-}
\ No newline at end of file
+}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/Body.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/Body.java
index 3138349..2db4dea 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/Body.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/Body.java
@@ -41,7 +41,7 @@
     @JsonProperty("input")
     private Input input;
     @JsonIgnore
-    private Map<String, Object> additionalProperties = new HashMap<String, Object>();
+    private Map<String, Object> additionalProperties = new HashMap<>();
     private final static long serialVersionUID = 9101706044452851559L;
 
     @JsonProperty("input")
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/Input.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/Input.java
index 27efe03..25eb2ed 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/Input.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/Input.java
@@ -41,7 +41,7 @@
     @JsonProperty("request-healthdiagnostic")
     private RequestHealthDiagnostic RequestHealthDiagnostic;
     @JsonIgnore
-    private Map<String, Object> additionalProperties = new HashMap<String, Object>();
+    private Map<String, Object> additionalProperties = new HashMap<>();
     private final static long serialVersionUID = 7155546785389227528L;
 
     @JsonProperty("request-healthdiagnostic")
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/RequestHealthDiagnostic.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/RequestHealthDiagnostic.java
index 20bd735..b1ed77b 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/RequestHealthDiagnostic.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/RequestHealthDiagnostic.java
@@ -59,7 +59,7 @@
     @JsonProperty("health-diagnostic-code")
     private String healthDiagnosticCode;
     @JsonIgnore
-    private Map<String, Object> additionalProperties = new HashMap<String, Object>();
+    private Map<String, Object> additionalProperties = new HashMap<>();
     private final static long serialVersionUID = 1166788526178388021L;
 
     @JsonProperty("request-client-name")
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/ResultInfo.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/ResultInfo.java
index 63894b9..0997b2d 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/ResultInfo.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/ResultInfo.java
@@ -51,7 +51,7 @@
 @JsonProperty("status")
 private String status;
 @JsonIgnore
-private Map<String, Object> additionalProperties = new HashMap<String, Object>();
+private Map<String, Object> additionalProperties = new HashMap<>();
 
 @JsonProperty("client-name")
 public String getClientName() {
diff --git a/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/XQueryScriptTask.java b/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/XQueryScriptTask.java
index 6080768..419f4aa 100644
--- a/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/XQueryScriptTask.java
+++ b/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/XQueryScriptTask.java
@@ -71,6 +71,7 @@
 	private Expression atomicInputVariables;
 	private Expression outputVariable;
 
+    @Override
 	public void execute(DelegateExecution execution) throws Exception {
 		if (msoLogger.isDebugEnabled()) {
 			msoLogger.debug("Started Executing " + getTaskName());
@@ -222,12 +223,11 @@
 	 */
 	private XQueryExecutable compile(XQueryCompiler compiler, String resource)
 			throws Exception {
-	    try (InputStream xqStream = getClass().getResourceAsStream(resource)) {
-		XQueryExecutable executable = compiler.compile(xqStream);
-		return executable;
-	    } catch (Exception e) {
-		msoLogger.debug ("Exception at resourceFile stream:", e);
-		return null;
-	    }
+		try (InputStream xqStream = getClass().getResourceAsStream(resource)) {
+            return compiler.compile(xqStream);
+		} catch (Exception e) {
+			msoLogger.debug ("Exception at resourceFile stream:", e);
+			return null;
+		}
 	}
 }
\ No newline at end of file
diff --git a/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/domain/ServiceDecomposition.java b/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/domain/ServiceDecomposition.java
index da340a0..1e68c84 100644
--- a/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/domain/ServiceDecomposition.java
+++ b/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/domain/ServiceDecomposition.java
@@ -235,7 +235,7 @@
 			Resource resource = iter.next();
 			//resource.getModelInfo().getModelInvariantId();
 
-			if (resourceObjectId.equals("extracted information")){
+			if ("extracted information".equals(resourceObjectId)){
 				return resource.toJsonString();
 			}
 		}
diff --git a/bpmn/MSOInfrastructureBPMN/pom.xml b/bpmn/MSOInfrastructureBPMN/pom.xml
index be03cb4..3ca9c63 100644
--- a/bpmn/MSOInfrastructureBPMN/pom.xml
+++ b/bpmn/MSOInfrastructureBPMN/pom.xml
@@ -414,7 +414,7 @@
 		</dependency>
 
 		<!--for yang tools-->
-		<dependency>
+<!--		<dependency>
 			<groupId>org.openecomp.so</groupId>
 			<artifactId>common</artifactId>
 			<version>1.1.0-SNAPSHOT</version>
@@ -424,6 +424,6 @@
 			<groupId>org.onap.sdnc.northbound</groupId>
 			<artifactId>generic-resource-api.model</artifactId>
 			<version>1.2.0</version>
-		</dependency>
+		</dependency>-->
 	</dependencies>
 </project>
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/SdncOperationTaskYangToolsImpl.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/SdncOperationTaskYangToolsImpl.java
deleted file mode 100644
index 25727bd..0000000
--- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/SdncOperationTaskYangToolsImpl.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * 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.mso.bpmn.infrastructure.workflow.serviceTask;
-
-import okhttp3.RequestBody;
-import okhttp3.ResponseBody;
-import org.camunda.bpm.engine.delegate.DelegateExecution;
-import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.NetworkTopologyOperationOutput;
-import org.openecomp.mso.bpmn.core.WorkflowException;
-import org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.GenericResourceApi;
-import org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.builder.NetworkTopologyRequestBodyBuilder;
-import org.openecomp.mso.requestsdb.RequestsDbConstant;
-import org.openecomp.mso.yangDecoder.transform.api.ITransformJava2StringService;
-import org.openecomp.mso.yangDecoder.transform.impl.TransfromJava2StringFactory;
-
-import java.util.Map;
-
-/**
- * Created by 10112215 on 2017/9/20.
- */
-public class SdncOperationTaskYangToolsImpl extends AbstractSdncOperationTask {
-
-    public void sendRestrequestAndHandleResponse(DelegateExecution execution,
-                                                 Map<String, String> inputs,
-                                                 GenericResourceApi genericResourceApiClient) throws Exception {
-        updateProgress(execution, null, null, "40", "sendRestrequestAndHandleResponse begin!");
-        NetworkTopologyRequestBodyBuilder builder = new NetworkTopologyRequestBodyBuilder();
-        RequestBody body = builder.build(execution, inputs);
-        updateProgress(execution, null, null, "50", "RequestBody build finished!");
-        ResponseBody responseBody = genericResourceApiClient.postNetworkTopologyOperation(body).execute().body();
-        updateProgress(execution, null, null, "90", "sendRestrequestAndHandleResponse finished!");
-        saveResponse(execution, responseBody);
-    }
-
-    private void saveResponse(DelegateExecution execution, ResponseBody responseBody) throws Exception {
-        ITransformJava2StringService java2jsonService = TransfromJava2StringFactory.getJava2jsonService();
-        NetworkTopologyOperationOutput output = (NetworkTopologyOperationOutput) java2jsonService.
-                transformRpcDataObjectFromString(NetworkTopologyRequestBodyBuilder.URI_PATH, responseBody.string());
-        String responseCode = output.getResponseCode();
-        if (!"200".equals(responseCode)) {
-            String processKey = getProcessKey(execution);
-            int errorCode = Integer.valueOf(responseCode);
-            String errorMessage = output.getResponseMessage();
-            WorkflowException workflowException = new WorkflowException(processKey, errorCode, errorMessage);
-            execution.setVariable("SDNCA_SuccessIndicator", workflowException);
-            updateProgress(execution, RequestsDbConstant.Status.ERROR, String.valueOf(errorCode), null, errorMessage);
-            throw new Exception("");
-        }
-    }
-}
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/builder/AbstractBuilder.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/builder/AbstractBuilder.java
index 91b95df..41fa8f2 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/builder/AbstractBuilder.java
+++ b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/builder/AbstractBuilder.java
@@ -22,8 +22,6 @@
 
 import org.apache.commons.lang3.StringUtils;
 import org.camunda.bpm.engine.delegate.DelegateExecution;
-import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.request.information.RequestInformation;
-import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.sdnc.request.header.SdncRequestHeader;
 import org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.SdncUnderlayVpnPreprocessTask;
 import org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.entity.OnapModelInformationEntity;
 import org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.entity.ParamEntity;
@@ -36,35 +34,101 @@
 import java.util.Map;
 import java.util.UUID;
 
+//import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.request.information.RequestInformation;
+//import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.sdnc.request.header.SdncRequestHeader;
+
 /**
  * Created by 10112215 on 2017/9/20.
  */
 public abstract class AbstractBuilder<IN, OUT> {
+     public static enum RequestAction {
+          CreateNetworkInstance(0, "CreateNetworkInstance"),
+          ActivateNetworkInstance(1, "ActivateNetworkInstance"),
+          CreateServiceInstance(2, "CreateServiceInstance"),
+          DeleteServiceInstance(3, "DeleteServiceInstance"),
+          DeleteNetworkInstance(4, "DeleteNetworkInstance"),
+          CreateVnfInstance(5, "CreateVnfInstance"),
+          ActivateVnfInstance(6, "ActivateVnfInstance"),
+          DeleteVnfInstance(7, "DeleteVnfInstance"),
+          CreateVfModuleInstance(8, "CreateVfModuleInstance"),
+          ActivateVfModuleInstance(9, "ActivateVfModuleInstance"),
+          DeleteVfModuleInstance(10, "DeleteVfModuleInstance"),
+          CreateContrailRouteInstance(11, "CreateContrailRouteInstance"),
+          DeleteContrailRouteInstance(12, "DeleteContrailRouteInstance"),
+          CreateSecurityZoneInstance(13, "CreateSecurityZoneInstance"),
+          DeleteSecurityZoneInstance(14, "DeleteSecurityZoneInstance");
+
+          String name;
+          int value;
+
+          private RequestAction(int value, String name) {
+               this.value = value;
+               this.name = name;
+          }
+
+          public String getName() {
+               return this.name;
+          }
+
+          public int getIntValue() {
+               return this.value;
+          }
+     }
+
+     public enum SvcAction {
+          Reserve(0, "reserve"),
+          Assign(1, "assign"),
+          Activate(2, "activate"),
+          Delete(3, "delete"),
+          Changeassign(4, "changeassign"),
+          Changedelete(5, "changedelete"),
+          Rollback(6, "rollback"),
+          Deactivate(7, "deactivate"),
+          Unassign(8, "unassign"),
+          Create(9, "create");
+
+          String name;
+          int value;
+
+          private SvcAction(int value, String name) {
+               this.value = value;
+               this.name = name;
+          }
+
+          public String getName() {
+               return this.name;
+          }
+
+          public int getIntValue() {
+               return this.value;
+          }
+     }
+
      protected String requestId = null;
 
      abstract OUT build(DelegateExecution execution, IN input) throws Exception;
 
      protected String getRequestActoin(DelegateExecution execution) {
-          String action = RequestInformation.RequestAction.CreateNetworkInstance.name();
+          String action = /*RequestInformation.*/RequestAction.CreateNetworkInstance.name();
           String operType = getOperType(execution);
           if (!StringUtils.isBlank(operType)) {
                if (RequestsDbConstant.OperationType.DELETE.equals(operType)) {
-                    action = RequestInformation.RequestAction.DeleteNetworkInstance.name();
+                    action = /*RequestInformation.*/RequestAction.DeleteNetworkInstance.name();
                } else if (RequestsDbConstant.OperationType.CREATE.equals(operType)) {
-                    action = RequestInformation.RequestAction.CreateNetworkInstance.name();
+                    action = /*RequestInformation.*/RequestAction.CreateNetworkInstance.name();
                }
           }
           return action;
      }
 
      protected String getOperationType(DelegateExecution execution) {
-          String action = SdncRequestHeader.SvcAction.Create.name();
+          String action = /*SdncRequestHeader.*/SvcAction.Create.name();
           String operType = getOperType(execution);
           if (!StringUtils.isBlank(operType)) {
                if (RequestsDbConstant.OperationType.DELETE.equals(operType)) {
-                    action = SdncRequestHeader.SvcAction.Delete.name();
+                    action = /*SdncRequestHeader.*/SvcAction.Delete.name();
                } else if (RequestsDbConstant.OperationType.CREATE.equals(operType)) {
-                    action = SdncRequestHeader.SvcAction.Create.name();
+                    action = /*SdncRequestHeader.*/SvcAction.Create.name();
                }
           }
           return action;
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/builder/NetworkTopologyRequestBodyBuilder.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/builder/NetworkTopologyRequestBodyBuilder.java
deleted file mode 100644
index d5ba528..0000000
--- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/builder/NetworkTopologyRequestBodyBuilder.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * 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.mso.bpmn.infrastructure.workflow.serviceTask.client.builder;
-
-import okhttp3.RequestBody;
-import org.apache.commons.lang3.StringUtils;
-import org.camunda.bpm.engine.delegate.DelegateExecution;
-import org.json.JSONObject;
-import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.NetworkTopologyOperationInput;
-import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.NetworkTopologyOperationInputBuilder;
-import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.network.request.input.NetworkRequestInputBuilder;
-import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.network.request.input.network.request.input.NetworkInputParametersBuilder;
-import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.param.Param;
-import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.param.ParamBuilder;
-import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.param.ParamKey;
-import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.request.information.RequestInformation;
-import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.request.information.RequestInformationBuilder;
-import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.sdnc.request.header.SdncRequestHeader;
-import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.sdnc.request.header.SdncRequestHeaderBuilder;
-import org.openecomp.mso.yangDecoder.transform.api.ITransformJava2StringService;
-import org.openecomp.mso.yangDecoder.transform.impl.TransfromJava2StringFactory;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-/**
- * Created by 10112215 on 2017/9/20.
- */
-public class NetworkTopologyRequestBodyBuilder extends AbstractBuilder<Map<String, String>, RequestBody> {
-
-    public static final String URI_PATH = "GENERIC-RESOURCE-API:network-topology-operation";
-    public static final SdncRequestHeader.SvcAction SVC_DEFAULT_ACTION = SdncRequestHeader.SvcAction.Create;
-    public static final String SVC_REQUEST_ID = "MSO";
-    public static final String SDC_ACTION = "SDC_ACTION";
-    public static final RequestInformation.RequestAction REQUEST_ACTION = RequestInformation.RequestAction.CreateNetworkInstance;
-    protected static ITransformJava2StringService java2jsonService;
-
-    static
-    {
-        try {
-            java2jsonService = TransfromJava2StringFactory.getJava2jsonService();
-        } catch (Exception e) {
-            e.printStackTrace();
-            java2jsonService = null;
-        }
-    }
-
-    @Override
-    public RequestBody build(DelegateExecution execution, Map<String, String> input) throws Exception {
-        NetworkTopologyOperationInput sdncInput = getSdncInput(input);
-        RequestBody body = getRequestBody(sdncInput);
-        return body;
-    }
-
-    protected String getJsonInput(NetworkTopologyOperationInput sdncInput) throws Exception {
-        return java2jsonService.transformRpcDataObjectToString(URI_PATH, sdncInput);
-    }
-
-    private RequestBody getRequestBody(NetworkTopologyOperationInput sdncInput) throws Exception {
-        String jsonString = getJsonInput(sdncInput);
-        String json = (new JSONObject(jsonString)).toString();
-        return RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"),json);
-    }
-
-    protected NetworkTopologyOperationInput getSdncInput(Map<String, String> inputs) {
-        NetworkTopologyOperationInputBuilder networkTopologyOperationInputBuilder = new NetworkTopologyOperationInputBuilder();
-        {
-            loadSdncRequestHeader(inputs, networkTopologyOperationInputBuilder);
-            loadRequestInformation(networkTopologyOperationInputBuilder);
-            loadNetworkInputParameters(inputs, networkTopologyOperationInputBuilder);
-        }
-        return networkTopologyOperationInputBuilder.build();
-    }
-
-    private void loadNetworkInputParameters(Map<String, String> inputs, NetworkTopologyOperationInputBuilder networkTopologyOperationInputBuilder) {
-        NetworkRequestInputBuilder networkRequestInputBuilder = new NetworkRequestInputBuilder();
-        {
-            NetworkInputParametersBuilder networkInputParametersBuilder = new NetworkInputParametersBuilder();
-            {
-                List<Param> paramList = getParamList(inputs);
-                networkInputParametersBuilder.setParam(paramList);
-            }
-            networkRequestInputBuilder.setNetworkInputParameters(networkInputParametersBuilder.build());
-        }
-        networkTopologyOperationInputBuilder.setNetworkRequestInput(networkRequestInputBuilder.build());
-    }
-
-    private void loadRequestInformation(NetworkTopologyOperationInputBuilder networkTopologyOperationInputBuilder) {
-        RequestInformationBuilder requestInformationBuilder = new RequestInformationBuilder();
-        {
-            requestInformationBuilder.setRequestId(SVC_REQUEST_ID);
-            requestInformationBuilder.setRequestAction(REQUEST_ACTION);
-        }
-        networkTopologyOperationInputBuilder.setRequestInformation(requestInformationBuilder.build());
-    }
-
-    private void loadSdncRequestHeader(Map<String, String> inputs, NetworkTopologyOperationInputBuilder networkTopologyOperationInputBuilder) {
-        SdncRequestHeaderBuilder sdncRequestHeaderBuilder = new SdncRequestHeaderBuilder();
-        {
-            sdncRequestHeaderBuilder.setSvcRequestId(SVC_REQUEST_ID);
-            SdncRequestHeader.SvcAction svcAction = SVC_DEFAULT_ACTION;
-            String action = inputs.get(SDC_ACTION);
-            if (!StringUtils.isBlank(action)) {
-                if (action.toLowerCase().contains("delete")) {
-                    svcAction = SdncRequestHeader.SvcAction.Delete;
-                } else if (action.toLowerCase().contains("create")) {
-                    svcAction = SdncRequestHeader.SvcAction.Create;
-                }
-            }
-            sdncRequestHeaderBuilder.setSvcAction(svcAction);
-        }
-        networkTopologyOperationInputBuilder.setSdncRequestHeader(sdncRequestHeaderBuilder.build());
-    }
-
-    private List<Param> getParamList(Map<String, String> inputs) {
-        List<Param> paramList = new ArrayList<>();
-        if (inputs != null && !inputs.isEmpty()) {
-            inputs.keySet().forEach(key -> {
-                ParamBuilder paramBuilder = new ParamBuilder();
-                paramBuilder.setName(key);
-                paramBuilder.setValue(inputs.get(key));
-                paramBuilder.setKey(new ParamKey(key));
-                paramList.add(paramBuilder.build());
-            });
-        }
-        return paramList;
-    }
-}
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/vcpe/workflow/WorkflowAsyncVcpeResource.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/vcpe/workflow/WorkflowAsyncVcpeResource.java
index dbddbee..b11a1d0 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/vcpe/workflow/WorkflowAsyncVcpeResource.java
+++ b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/vcpe/workflow/WorkflowAsyncVcpeResource.java
@@ -39,7 +39,8 @@
  */
 @Path("/async")
 public class WorkflowAsyncVcpeResource extends WorkflowAsyncResource {
-	
+
+	@Override	
 	protected ProcessEngineServices getProcessEngineServices() {
 		return pes4junit.orElse(ProcessEngines.getProcessEngine("vcpe"));
 	}
diff --git a/bpmn/MSOURN-plugin/src/main/java/org/openecomp/camunda/bpmn/plugin/urnmap/db/MyBatisExtendedSessionFactory.java b/bpmn/MSOURN-plugin/src/main/java/org/openecomp/camunda/bpmn/plugin/urnmap/db/MyBatisExtendedSessionFactory.java
index 9e43ee3..60d6566 100644
--- a/bpmn/MSOURN-plugin/src/main/java/org/openecomp/camunda/bpmn/plugin/urnmap/db/MyBatisExtendedSessionFactory.java
+++ b/bpmn/MSOURN-plugin/src/main/java/org/openecomp/camunda/bpmn/plugin/urnmap/db/MyBatisExtendedSessionFactory.java
@@ -37,6 +37,7 @@
 
   private String resourceName;
 
+  @Override
   protected void init() {
     throw new IllegalArgumentException(
             "Normal 'init' on process engine only used for extended MyBatis mappings is not allowed, please use 'initFromProcessEngineConfiguration'. You cannot construct a process engine with this configuration.");
@@ -55,7 +56,6 @@
     setDatabaseTablePrefix(processEngineConfiguration.getDatabaseTablePrefix());
 
     initDataSource();
-    //initVariableTypes();
     initCommandContextFactory();
     initTransactionFactory();
     initTransactionContextFactory();
@@ -75,7 +75,7 @@
    */
   @Override
   protected Collection<? extends CommandInterceptor> getDefaultCommandInterceptorsTxRequired() {
-    List<CommandInterceptor> defaultCommandInterceptorsTxRequired = new ArrayList<CommandInterceptor>();
+    List<CommandInterceptor> defaultCommandInterceptorsTxRequired = new ArrayList<>();
     defaultCommandInterceptorsTxRequired.add(new LogInterceptor());
     defaultCommandInterceptorsTxRequired.add(new CommandContextInterceptor(commandContextFactory, this, true));
     return defaultCommandInterceptorsTxRequired;
diff --git a/common/pom.xml b/common/pom.xml
index 4c756ae..5726ae9 100644
--- a/common/pom.xml
+++ b/common/pom.xml
@@ -151,7 +151,7 @@
 			<version>1.3.0</version>
 		</dependency>
         <!--for yang decoder-->
-        <dependency>
+        <!--<dependency>
             <groupId>org.opendaylight.yangtools</groupId>
             <artifactId>yang-data-codec-gson</artifactId>
             <version>1.1.1-Carbon</version>
@@ -175,7 +175,7 @@
             <groupId>org.dom4j</groupId>
             <artifactId>dom4j</artifactId>
             <version>2.0.0</version>
-        </dependency>
+        </dependency>-->
     </dependencies>
     <build>
         <resources>
diff --git a/common/src/main/java/org/openecomp/mso/yangDecoder/base/DataBrokerTestCustomizer.java b/common/src/main/java/org/openecomp/mso/yangDecoder/base/DataBrokerTestCustomizer.java
deleted file mode 100644
index 8560cbd..0000000
--- a/common/src/main/java/org/openecomp/mso/yangDecoder/base/DataBrokerTestCustomizer.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * 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.mso.yangDecoder.base;
-
-import com.google.common.collect.ImmutableMap;
-import com.google.common.util.concurrent.ListeningExecutorService;
-import com.google.common.util.concurrent.MoreExecutors;
-import javassist.ClassPool;
-import org.opendaylight.mdsal.binding.api.DataBroker;
-import org.opendaylight.mdsal.binding.api.NotificationPublishService;
-import org.opendaylight.mdsal.binding.api.NotificationService;
-import org.opendaylight.mdsal.binding.dom.adapter.BindingDOMDataBrokerAdapter;
-import org.opendaylight.mdsal.binding.dom.adapter.BindingDOMNotificationPublishServiceAdapter;
-import org.opendaylight.mdsal.binding.dom.adapter.BindingDOMNotificationServiceAdapter;
-import org.opendaylight.mdsal.binding.dom.adapter.BindingToNormalizedNodeCodec;
-import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
-import org.opendaylight.mdsal.dom.api.DOMDataBroker;
-import org.opendaylight.mdsal.dom.api.DOMSchemaService;
-import org.opendaylight.mdsal.dom.broker.DOMNotificationRouter;
-import org.opendaylight.mdsal.dom.broker.SerializedDOMDataBroker;
-import org.opendaylight.mdsal.dom.spi.store.DOMStore;
-import org.opendaylight.mdsal.dom.store.inmemory.InMemoryDOMDataStore;
-import org.opendaylight.yangtools.binding.data.codec.gen.impl.DataObjectSerializerGenerator;
-import org.opendaylight.yangtools.binding.data.codec.gen.impl.StreamWriterGenerator;
-import org.opendaylight.yangtools.binding.data.codec.impl.BindingNormalizedNodeCodecRegistry;
-import org.opendaylight.mdsal.binding.generator.impl.GeneratedClassLoadingStrategy;
-import org.opendaylight.mdsal.binding.generator.util.JavassistUtils;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-
-public class DataBrokerTestCustomizer {
-
-    private DOMDataBroker domDataBroker;
-    private final DOMNotificationRouter domNotificationRouter;
-    private final MockSchemaService schemaService;
-    private ImmutableMap<LogicalDatastoreType, DOMStore> datastores;
-    private final BindingToNormalizedNodeCodec bindingToNormalized;
-
-    public ImmutableMap<LogicalDatastoreType, DOMStore> createDatastores() {
-        return ImmutableMap.<LogicalDatastoreType, DOMStore>builder()
-                .put(LogicalDatastoreType.OPERATIONAL, createOperationalDatastore())
-                .put(LogicalDatastoreType.CONFIGURATION,createConfigurationDatastore())
-                .build();
-    }
-
-    public DataBrokerTestCustomizer() {
-        schemaService = new MockSchemaService();
-        final ClassPool pool = ClassPool.getDefault();
-        final DataObjectSerializerGenerator generator = StreamWriterGenerator.create(JavassistUtils.forClassPool(pool));
-        final BindingNormalizedNodeCodecRegistry codecRegistry = new BindingNormalizedNodeCodecRegistry(generator);
-        final GeneratedClassLoadingStrategy loading = GeneratedClassLoadingStrategy.getTCCLClassLoadingStrategy();
-        bindingToNormalized = new BindingToNormalizedNodeCodec(loading, codecRegistry);
-        schemaService.registerSchemaContextListener(bindingToNormalized);
-        domNotificationRouter = DOMNotificationRouter.create(16);
-    }
-
-    public DOMStore createConfigurationDatastore() {
-        final InMemoryDOMDataStore store = new InMemoryDOMDataStore("CFG", MoreExecutors.sameThreadExecutor());
-        schemaService.registerSchemaContextListener(store);
-        return store;
-    }
-
-    public DOMStore createOperationalDatastore() {
-        final InMemoryDOMDataStore store = new InMemoryDOMDataStore("OPER", MoreExecutors.sameThreadExecutor());
-        schemaService.registerSchemaContextListener(store);
-        return store;
-    }
-
-    public DOMDataBroker createDOMDataBroker() {
-        return new SerializedDOMDataBroker(getDatastores(), getCommitCoordinatorExecutor());
-    }
-
-    public NotificationService createNotificationService() {
-        return new BindingDOMNotificationServiceAdapter(bindingToNormalized.getCodecRegistry(), domNotificationRouter);
-    }
-
-    public NotificationPublishService createNotificationPublishService() {
-        return new BindingDOMNotificationPublishServiceAdapter(bindingToNormalized, domNotificationRouter);
-    }
-
-
-    public ListeningExecutorService getCommitCoordinatorExecutor() {
-        return MoreExecutors.sameThreadExecutor();
-    }
-
-    public DataBroker createDataBroker() {
-        return new BindingDOMDataBrokerAdapter(getDOMDataBroker(), bindingToNormalized);
-    }
-
-    public BindingToNormalizedNodeCodec getBindingToNormalized() {
-        return bindingToNormalized;
-    }
-
-    public DOMSchemaService getSchemaService() {
-        return schemaService;
-    }
-
-    private DOMDataBroker getDOMDataBroker() {
-        if(domDataBroker == null) {
-            domDataBroker = createDOMDataBroker();
-        }
-        return domDataBroker;
-    }
-
-    private synchronized ImmutableMap<LogicalDatastoreType, DOMStore> getDatastores() {
-        if (datastores == null) {
-            datastores = createDatastores();
-        }
-        return datastores;
-    }
-
-    public void updateSchema(final SchemaContext ctx) {
-        schemaService.changeSchema(ctx);
-    }
-
-    public DOMNotificationRouter getDomNotificationRouter() {
-        return domNotificationRouter;
-    }
-    public void close()
-    {
-    	if(bindingToNormalized!=null)bindingToNormalized.close();
-    	if(domNotificationRouter!=null)domNotificationRouter.close();
-    }
-}
diff --git a/common/src/main/java/org/openecomp/mso/yangDecoder/base/MockSchemaService.java b/common/src/main/java/org/openecomp/mso/yangDecoder/base/MockSchemaService.java
deleted file mode 100644
index 5c4883c..0000000
--- a/common/src/main/java/org/openecomp/mso/yangDecoder/base/MockSchemaService.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * 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.mso.yangDecoder.base;
-import org.opendaylight.mdsal.dom.api.DOMSchemaService;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
-import org.opendaylight.yangtools.util.ListenerRegistry;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-import org.opendaylight.yangtools.yang.model.api.SchemaContextListener;
-import org.opendaylight.yangtools.yang.model.api.SchemaContextProvider;
-
-public final class MockSchemaService implements DOMSchemaService, SchemaContextProvider {
-
-    private SchemaContext schemaContext;
-
-    ListenerRegistry<SchemaContextListener> listeners = ListenerRegistry.create();
-
-    @Override
-    public synchronized SchemaContext getGlobalContext() {
-        return schemaContext;
-    }
-
-    @Override
-    public synchronized SchemaContext getSessionContext() {
-        return schemaContext;
-    }
-
-    @Override
-    public ListenerRegistration<SchemaContextListener> registerSchemaContextListener(
-            final SchemaContextListener listener) {
-        return listeners.register(listener);
-    }
-
-    @Override
-    public synchronized SchemaContext getSchemaContext() {
-        return schemaContext;
-    }
-
-    public synchronized void changeSchema(final SchemaContext newContext) {
-        schemaContext = newContext;
-        for (ListenerRegistration<SchemaContextListener> listener : listeners) {
-            listener.getInstance().onGlobalContextUpdated(schemaContext);
-        }
-    }
-}
diff --git a/common/src/main/java/org/openecomp/mso/yangDecoder/base/TYangJsonXmlBase.java b/common/src/main/java/org/openecomp/mso/yangDecoder/base/TYangJsonXmlBase.java
deleted file mode 100644
index 16af7a8..0000000
--- a/common/src/main/java/org/openecomp/mso/yangDecoder/base/TYangJsonXmlBase.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * 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.mso.yangDecoder.base;
-
-import org.opendaylight.mdsal.binding.api.DataBroker;
-import org.opendaylight.mdsal.dom.api.DOMDataBroker;
-import org.opendaylight.mdsal.binding.generator.impl.ModuleInfoBackedContext;
-import org.opendaylight.yangtools.yang.binding.YangModuleInfo;
-import org.opendaylight.yangtools.yang.binding.util.BindingReflections;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileWriter;
-
-//--
-
-public abstract class TYangJsonXmlBase {
-
-    private Iterable<YangModuleInfo> moduleInfos;
-    protected SchemaContext schemaContext;
-//----------
-    private DataBrokerTestCustomizer testCustomizer;
-    private DataBroker dataBroker;
-    private DOMDataBroker domBroker;
-
-    protected Iterable<YangModuleInfo> getModuleInfos() throws Exception {
-        return BindingReflections.loadModuleInfos();
-    }
-    public static void writefile(String confname, String strx)
-    {
-    	final String outd="outdir";
-    	File dir = new File(outd);  
-    	dir.mkdir();
-        String fn = outd+File.separatorChar+confname;
-        try(FileWriter fw = new FileWriter(fn); BufferedWriter writer = new BufferedWriter(fw))
-        {
-            // FileWriter fw = new FileWriter(fn);
-            // BufferedWriter writer = new BufferedWriter(fw);
-            writer.write(strx);
-            // writer.close();
-            // fw.close();
-        }
-        catch (Exception e)
-        {
-        }
-    }
- 
-    public final void setup() throws Exception {
-        moduleInfos = getModuleInfos();
-        ModuleInfoBackedContext moduleContext = ModuleInfoBackedContext.create();
-        moduleContext.addModuleInfos(moduleInfos);
-        schemaContext = moduleContext.tryToCreateSchemaContext().get();
-        setupWithSchema(schemaContext);
-    }
-
-    /**
-     * Setups test with Schema context.
-     *
-     * @param context schema context
-     */
-    protected  void setupWithSchema(SchemaContext context){
-        testCustomizer = createDataBrokerTestCustomizer();
-        dataBroker = testCustomizer.createDataBroker();
-        domBroker = testCustomizer.createDOMDataBroker();
-        testCustomizer.updateSchema(context);
-        setupWithDataBroker(dataBroker);
-    }
-    protected void setupWithDataBroker(final DataBroker dataBroker) {
-        // Intentionally left No-op, subclasses may customize it
-    }
-
-    protected DataBrokerTestCustomizer createDataBrokerTestCustomizer() {
-        return new DataBrokerTestCustomizer();
-    }
-
-    public DataBroker getDataBroker() {
-        return dataBroker;
-    }
-
-    public DOMDataBroker getDomBroker() {
-        return domBroker;
-    }
-    public void close()
-    {
-    	//domBroker.
-    	testCustomizer.close();
-    }
-}
\ No newline at end of file
diff --git a/common/src/main/java/org/openecomp/mso/yangDecoder/base/TYangJsonXmlOSGIBase.java b/common/src/main/java/org/openecomp/mso/yangDecoder/base/TYangJsonXmlOSGIBase.java
deleted file mode 100644
index 7ec9637..0000000
--- a/common/src/main/java/org/openecomp/mso/yangDecoder/base/TYangJsonXmlOSGIBase.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * 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.mso.yangDecoder.base;
-
-import org.openecomp.mso.yangDecoder.transform.api.ITransformJava2StringService;
-import org.opendaylight.yangtools.binding.data.codec.api.BindingNormalizedNodeSerializer;
-
-public interface TYangJsonXmlOSGIBase {
-
-	public abstract void init(BindingNormalizedNodeSerializer mappingService)
-			throws Exception;
-
-	public abstract ITransformJava2StringService getJava2StringService(
-            String jsonorxml);
-
-	public abstract void close();
-
-}
\ No newline at end of file
diff --git a/common/src/main/java/org/openecomp/mso/yangDecoder/transform/api/ITransformJava2StringService.java b/common/src/main/java/org/openecomp/mso/yangDecoder/transform/api/ITransformJava2StringService.java
deleted file mode 100644
index 978ce4b..0000000
--- a/common/src/main/java/org/openecomp/mso/yangDecoder/transform/api/ITransformJava2StringService.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * 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.mso.yangDecoder.transform.api;
-
-import org.opendaylight.yangtools.yang.binding.DataObject;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.opendaylight.yangtools.yang.binding.Notification;
-
-/**
- * Created by Administrator on 2017/3/21.
- */
-public interface ITransformJava2StringService {
-	//following function encode 
-    <T extends DataObject>
-    String transformContrainerDataObjectToString(InstanceIdentifier<T> instanceIdentifier, String uriPath, T dataObject)
-            throws Exception;
-    <T extends Notification>
-    String transformNotificationToString(String uriPath, T notification)  throws Exception;
-    <T extends DataObject>
-    String transformRpcDataObjectToString(String uriPath, T dataObject)  throws Exception;
-
-    //following function decode
-    //for container
-    DataObject  transformContrainerDataObjectFromString(String uriPath, String sxml, boolean ispost) throws Exception;
-    //notification
-    Notification transformNotificationFromString(String notficationName, String sxml) throws Exception;
-    //for rpc
-    DataObject transformRpcDataObjectFromString(String rpcName, String sxml) throws Exception;
-}
diff --git a/common/src/main/java/org/openecomp/mso/yangDecoder/transform/api/NormalizedNodeVisitor.java b/common/src/main/java/org/openecomp/mso/yangDecoder/transform/api/NormalizedNodeVisitor.java
deleted file mode 100644
index 179b995..0000000
--- a/common/src/main/java/org/openecomp/mso/yangDecoder/transform/api/NormalizedNodeVisitor.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * 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.mso.yangDecoder.transform.api;
-import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
-
-public interface NormalizedNodeVisitor {
-    void visitNode(int var1, String var2, NormalizedNode<?, ?> var3, boolean start);
-}
\ No newline at end of file
diff --git a/common/src/main/java/org/openecomp/mso/yangDecoder/transform/impl/JsonParserStream.java b/common/src/main/java/org/openecomp/mso/yangDecoder/transform/impl/JsonParserStream.java
deleted file mode 100644
index 7795a4c..0000000
--- a/common/src/main/java/org/openecomp/mso/yangDecoder/transform/impl/JsonParserStream.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * 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.mso.yangDecoder.transform.impl;
-
-import com.google.common.base.Preconditions;
-import org.opendaylight.yangtools.yang.data.util.RpcAsContainer;
-import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
-import org.opendaylight.yangtools.yang.model.api.NotificationDefinition;
-import org.opendaylight.yangtools.yang.model.api.RpcDefinition;
-import org.opendaylight.yangtools.yang.model.api.SchemaNode;
-
-/**
- * Created by 10112215 on 2017/9/17.
- */
-public class JsonParserStream {
-    public static DataSchemaNode getWrapSchemaNode(SchemaNode parentNode) {
-        if(parentNode instanceof RpcDefinition) {
-            return new RpcAsContainer((RpcDefinition)parentNode);
-        } else if(parentNode instanceof NotificationDefinition) {
-            return new NotificationAsContainer((NotificationDefinition)parentNode);
-        } else {
-            Preconditions.checkArgument(parentNode instanceof DataSchemaNode, "Instance of DataSchemaNode class awaited.");
-            return (DataSchemaNode)parentNode;
-        }
-    }
-}
diff --git a/common/src/main/java/org/openecomp/mso/yangDecoder/transform/impl/NormalizedNodeNavigator.java b/common/src/main/java/org/openecomp/mso/yangDecoder/transform/impl/NormalizedNodeNavigator.java
deleted file mode 100644
index 8623dc9..0000000
--- a/common/src/main/java/org/openecomp/mso/yangDecoder/transform/impl/NormalizedNodeNavigator.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * 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.mso.yangDecoder.transform.impl;
-
-import com.google.common.base.Preconditions;
-import org.openecomp.mso.yangDecoder.transform.api.NormalizedNodeVisitor;
-import org.opendaylight.yangtools.yang.data.api.schema.*;
-
-import java.util.Collection;
-import java.util.Iterator;
-
-/**
- * Created by 10036837 on 16-7-22.
- */
-public class NormalizedNodeNavigator {
-    private final NormalizedNodeVisitor visitor;
-
-    public NormalizedNodeNavigator(NormalizedNodeVisitor visitor) {
-        Preconditions.checkNotNull(visitor, "visitor should not be null");
-        this.visitor = visitor;
-    }
-
-    public void navigate(String parentPath, NormalizedNode<?, ?> normalizedNode) {
-        if (parentPath == null) {
-            parentPath = "";
-        }
-
-        this.navigateNormalizedNode(0, parentPath, normalizedNode);
-
-    }
-
-    private void navigateDataContainerNode(int level, String parentPath, DataContainerNode<?> dataContainerNode) {
-        this.visitor.visitNode(level, parentPath, dataContainerNode, true);
-        String newParentPath = parentPath + "/" + dataContainerNode.getIdentifier().toString();
-        Collection value = dataContainerNode.getValue();
-        Iterator var6 = value.iterator();
-
-        while (var6.hasNext()) {
-            NormalizedNode node = (NormalizedNode) var6.next();
-            if (node instanceof MixinNode && node instanceof NormalizedNodeContainer) {
-                this.navigateNormalizedNodeContainerMixin(level, newParentPath, (NormalizedNodeContainer) node);
-            } else {
-                this.navigateNormalizedNode(level, newParentPath, node);
-            }
-        }
-        this.visitor.visitNode(level, parentPath, dataContainerNode, false);
-    }
-
-    private void navigateOrderedNodeContainer(int level, String parentPath, OrderedNodeContainer<?> node) {
-        String newParentPath = parentPath + "/" + node.getIdentifier().toString();
-        Collection value = node.getValue();
-        Iterator var6 = value.iterator();
-
-        while (var6.hasNext()) {
-            NormalizedNode normalizedNode = (NormalizedNode) var6.next();
-            if (normalizedNode instanceof OrderedNodeContainer) {
-                this.navigateOrderedNodeContainer(level, newParentPath, (OrderedNodeContainer) normalizedNode);
-            } else {
-                this.navigateNormalizedNode(level, newParentPath, normalizedNode);
-            }
-        }
-
-    }
-
-    private void navigateNormalizedNodeContainerMixin(int level, String parentPath, NormalizedNodeContainer<?, ?, ?> node) {
-
-        String newParentPath = parentPath + "/" + node.getIdentifier().toString();
-        Collection value = node.getValue();
-        Iterator var6 = value.iterator();
-
-        while (var6.hasNext()) {
-            NormalizedNode normalizedNode = (NormalizedNode) var6.next();
-            if (normalizedNode instanceof MixinNode && normalizedNode instanceof NormalizedNodeContainer) {
-                this.navigateNormalizedNodeContainerMixin(level, newParentPath, (NormalizedNodeContainer) normalizedNode);
-            } else {
-                this.navigateNormalizedNode(level, newParentPath, normalizedNode);
-            }
-        }
-
-    }
-
-    private void navigateNormalizedNode(int level, String parentPath, NormalizedNode<?, ?> normalizedNode) {
-        if (normalizedNode instanceof DataContainerNode) {
-            DataContainerNode dataContainerNode = (DataContainerNode) normalizedNode;
-            this.navigateDataContainerNode(level+1, parentPath, dataContainerNode);
-        } else if (normalizedNode instanceof OrderedNodeContainer) {
-            this.navigateOrderedNodeContainer(level, parentPath, (OrderedNodeContainer) normalizedNode);
-        } else {
-            this.visitor.visitNode(level + 1, parentPath, normalizedNode, false);
-        }
-
-    }
-}
diff --git a/common/src/main/java/org/openecomp/mso/yangDecoder/transform/impl/NormalizedNodePrinter.java b/common/src/main/java/org/openecomp/mso/yangDecoder/transform/impl/NormalizedNodePrinter.java
deleted file mode 100644
index 1c3ff2c..0000000
--- a/common/src/main/java/org/openecomp/mso/yangDecoder/transform/impl/NormalizedNodePrinter.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * 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.mso.yangDecoder.transform.impl;
-import org.openecomp.mso.yangDecoder.transform.api.NormalizedNodeVisitor;
-import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.data.api.schema.LeafNode;
-import org.opendaylight.yangtools.yang.data.api.schema.LeafSetEntryNode;
-import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
-
-
-/**
- * Created by 10036837 on 16-7-21.
- */
-public class NormalizedNodePrinter implements NormalizedNodeVisitor {
-    StringBuilder result;
-    private static final String CODES = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
-    public NormalizedNodePrinter(StringBuilder result) {
-        this.result = result;
-    }
-    private final static String endl=System.getProperty("line.separator");
-    public final static String getEndl(){
-        return endl;
-    }
-    private static String spaces(int n) {
-        StringBuilder builder = new StringBuilder();
-        for (int i = 0; i < n; i++) {
-            builder.append(' ');
-        }
-        return builder.toString();
-    }
-
-    @Override
-    public void visitNode(int level, String parentPath, NormalizedNode<?, ?> normalizedNode, boolean start) {
-        if(normalizedNode == null)
-        {
-            return;
-        }
-        if(normalizedNode.getNodeType() == null)
-        {
-            return;
-        }
-
-        String localName = normalizedNode.getNodeType().getLocalName();
-        if (normalizedNode instanceof LeafNode || normalizedNode instanceof LeafSetEntryNode) {
-            if(normalizedNode.getValue() instanceof  byte[]){
-                result.append(spaces((level-1) * 4) + "<" + localName + ">" + (normalizedNode.getValue() == null ? "" : base64Encode((byte[]) normalizedNode.getValue())) + "</" + localName + ">"+endl);
-            }
-            else {
-               String svalue=normalizedNode.getValue().toString();
-                if(normalizedNode.getValue() instanceof QName){
-                    QName qn=(QName)normalizedNode.getValue();
-                    svalue= qn.getLocalName();
-                }
-                result.append(spaces((level - 1) * 4) + "<" + localName + ">" + (normalizedNode.getValue() == null ? "" :svalue) + "</" + localName + ">"+endl);
-            }
-        } else {
-            if (start) {
-                if (level == 1) {
-                    result.append(spaces((level-1) * 4) + "<" + localName + " xmlns=\"" + normalizedNode.getNodeType().getNamespace() + "\">"+endl);
-                } else {
-                    result.append(spaces((level-1) * 4) + "<" + localName + ">"+endl);
-                }
-            } else {
-                result.append(spaces((level-1) * 4) + "</" + localName + ">"+endl);
-            }
-        }
-    }
-    private String base64Encode(byte[] in) {
-        StringBuilder out = new StringBuilder((in.length * 4) / 3);
-        int b;
-        for (int i = 0; i < in.length; i += 3) {
-            b = (in[i] & 0xFC) >> 2;
-            out.append(CODES.charAt(b));
-            b = (in[i] & 0x03) << 4;
-            if (i + 1 < in.length) {
-                b |= (in[i + 1] & 0xF0) >> 4;
-                out.append(CODES.charAt(b));
-                b = (in[i + 1] & 0x0F) << 2;
-                if (i + 2 < in.length) {
-                    b |= (in[i + 2] & 0xC0) >> 6;
-                    out.append(CODES.charAt(b));
-                    b = in[i + 2] & 0x3F;
-                    out.append(CODES.charAt(b));
-                } else {
-                    out.append(CODES.charAt(b));
-                    out.append('=');
-                }
-            } else {
-                out.append(CODES.charAt(b));
-                out.append("==");
-            }
-        }
-        return out.toString();
-    }
-}
\ No newline at end of file
diff --git a/common/src/main/java/org/openecomp/mso/yangDecoder/transform/impl/NotificationAsContainer.java b/common/src/main/java/org/openecomp/mso/yangDecoder/transform/impl/NotificationAsContainer.java
deleted file mode 100644
index 8e468b9..0000000
--- a/common/src/main/java/org/openecomp/mso/yangDecoder/transform/impl/NotificationAsContainer.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * 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.mso.yangDecoder.transform.impl;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import java.util.Set;
-import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.model.api.AugmentationSchema;
-import org.opendaylight.yangtools.yang.model.api.ConstraintDefinition;
-import org.opendaylight.yangtools.yang.model.api.ContainerSchemaNode;
-import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
-import org.opendaylight.yangtools.yang.model.api.GroupingDefinition;
-import org.opendaylight.yangtools.yang.model.api.NotificationDefinition;
-import org.opendaylight.yangtools.yang.model.api.SchemaPath;
-import org.opendaylight.yangtools.yang.model.api.Status;
-import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
-import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
-import org.opendaylight.yangtools.yang.model.api.UsesNode;
-
-final class NotificationAsContainer implements ContainerSchemaNode {
-    private final NotificationDefinition delegate;
-
-    public String getDescription() {
-        return this.delegate.getDescription();
-    }
-
-    public String getReference() {
-        return this.delegate.getReference();
-    }
-
-    public Set<TypeDefinition<?>> getTypeDefinitions() {
-        return this.delegate.getTypeDefinitions();
-    }
-
-    public Set<GroupingDefinition> getGroupings() {
-        return this.delegate.getGroupings();
-    }
-
-    public Status getStatus() {
-        return this.delegate.getStatus();
-    }
-
-    public ContainerSchemaNode getInput() {
-        return null;
-    }
-
-    public ContainerSchemaNode getOutput() {
-        return null;
-    }
-
-    NotificationAsContainer(NotificationDefinition parentNode) {
-        this.delegate = parentNode;
-    }
-
-    public QName getQName() {
-        return this.delegate.getQName();
-    }
-
-    public SchemaPath getPath() {
-        return this.delegate.getPath();
-    }
-
-    public List<UnknownSchemaNode> getUnknownSchemaNodes() {
-        return Collections.emptyList();
-    }
-
-    public DataSchemaNode getDataChildByName(QName name) {
-        return this.getDataChildByName(name.getLocalName());
-    }
-
-    public DataSchemaNode getDataChildByName(String name) {
-        byte var3 = -1;
-        switch(name.hashCode()) {
-            case -1005512447:
-                if(name.equals("output")) {
-                    var3 = 1;
-                }
-                break;
-            case 100358090:
-                if(name.equals("input")) {
-                    var3 = 0;
-                }
-        }
-
-        switch(var3) {
-            case 0:
-                return null;
-            case 1:
-                return null;
-            default:
-                return null;
-        }
-    }
-
-    public Set<UsesNode> getUses() {
-        return Collections.emptySet();
-    }
-
-    public Set<AugmentationSchema> getAvailableAugmentations() {
-        return Collections.emptySet();
-    }
-
-    public boolean isPresenceContainer() {
-        return false;
-    }
-
-    public Collection<DataSchemaNode> getChildNodes() {
-        ArrayList ret = new ArrayList();
-        ret.addAll(this.delegate.getChildNodes());
-        return ret;
-    }
-
-    public boolean isAugmenting() {
-        return false;
-    }
-
-    public boolean isAddedByUses() {
-        return false;
-    }
-
-    public boolean isConfiguration() {
-        return false;
-    }
-
-    public ConstraintDefinition getConstraints() {
-        return null;
-    }
-}
diff --git a/common/src/main/java/org/openecomp/mso/yangDecoder/transform/impl/TransformJava2JsonFactory.java b/common/src/main/java/org/openecomp/mso/yangDecoder/transform/impl/TransformJava2JsonFactory.java
deleted file mode 100644
index b99cd1a..0000000
--- a/common/src/main/java/org/openecomp/mso/yangDecoder/transform/impl/TransformJava2JsonFactory.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * 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.mso.yangDecoder.transform.impl;
-
-import javassist.ClassPool;
-import org.openecomp.mso.yangDecoder.base.TYangJsonXmlBase;
-import org.opendaylight.mdsal.binding.api.DataBroker;
-import org.opendaylight.mdsal.binding.dom.adapter.BindingToNormalizedNodeCodec;
-import org.opendaylight.netconf.sal.restconf.impl.ControllerContext;
-import org.opendaylight.yangtools.binding.data.codec.gen.impl.StreamWriterGenerator;
-import org.opendaylight.yangtools.binding.data.codec.impl.BindingNormalizedNodeCodecRegistry;
-import org.opendaylight.mdsal.binding.generator.impl.GeneratedClassLoadingStrategy;
-import org.opendaylight.mdsal.binding.generator.impl.ModuleInfoBackedContext;
-import org.opendaylight.mdsal.binding.generator.util.JavassistUtils;
-import org.opendaylight.yangtools.yang.binding.YangModuleInfo;
-
-/**
- * Created by 10112215 on 2017/3/26.
- */
-public class TransformJava2JsonFactory  extends TYangJsonXmlBase {
-    BindingToNormalizedNodeCodec mappingservice;
-    ModuleInfoBackedContext moduleInfoBackedContext;
-    protected final static ControllerContext controllerContext = ControllerContext.getInstance();
-
-    public TransformJava2JsonServiceImpl getJava2jsonService() {
-        if (java2jsonService == null) {
-            try {
-                setup2();
-            } catch (Exception e) {
-                e.printStackTrace();
-                return null;
-            }
-        }
-        return java2jsonService;
-    }
-
-    TransformJava2JsonServiceImpl java2jsonService;
-
-    @Override
-    protected void setupWithDataBroker(final DataBroker dataBroker) {
-        // Intentionally left No-op, subclasses may customize it
-        
-        // moduleInfoBackedContext.registerModuleInfo(BindingReflections.getModuleInfo(SncTunnels.class));
-
-        try {
-        	mappingservice = new BindingToNormalizedNodeCodec(GeneratedClassLoadingStrategy.getTCCLClassLoadingStrategy(),
-                    new BindingNormalizedNodeCodecRegistry(StreamWriterGenerator.create(JavassistUtils.forClassPool(ClassPool.getDefault()))));
-            moduleInfoBackedContext = ModuleInfoBackedContext.create();
-            
-            for (YangModuleInfo yangModuleInfo : getModuleInfos()) {
-                moduleInfoBackedContext.registerModuleInfo(yangModuleInfo);
-            }
-            schemaContext = moduleInfoBackedContext.tryToCreateSchemaContext().get();
-            mappingservice.onGlobalContextUpdated(schemaContext);
-            controllerContext.setSchemas(schemaContext);
-        } catch (Exception e) {
-            e.printStackTrace();
-        } finally {
-        	if(null != mappingservice){
-        		mappingservice.close();
-        	}
-        }
-        
-
-    }
-
-    public final void setup2() throws Exception {
-        super.setup();
-        if(java2jsonService==null)
-            java2jsonService = new TransformJava2JsonServiceImpl(mappingservice, schemaContext);
-    }
-}
diff --git a/common/src/main/java/org/openecomp/mso/yangDecoder/transform/impl/TransformJava2JsonServiceImpl.java b/common/src/main/java/org/openecomp/mso/yangDecoder/transform/impl/TransformJava2JsonServiceImpl.java
deleted file mode 100644
index ef9bdc4..0000000
--- a/common/src/main/java/org/openecomp/mso/yangDecoder/transform/impl/TransformJava2JsonServiceImpl.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * 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.mso.yangDecoder.transform.impl;
-
-import org.openecomp.mso.yangDecoder.transform.api.ITransformJava2StringService;
-import org.opendaylight.netconf.sal.restconf.impl.ControllerContext;
-import org.opendaylight.netconf.sal.restconf.impl.InstanceIdentifierContext;
-import org.opendaylight.netconf.sal.restconf.impl.NormalizedNodeContext;
-import org.opendaylight.yangtools.binding.data.codec.api.BindingNormalizedNodeSerializer;
-import org.opendaylight.yangtools.yang.binding.DataObject;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.opendaylight.yangtools.yang.binding.Notification;
-import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
-import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
-import org.opendaylight.yangtools.yang.model.api.*;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Created by Administrator on 2017/3/20.
- */
-public class TransformJava2JsonServiceImpl  implements ITransformJava2StringService {
-    private static final Logger LOG = LoggerFactory.getLogger(TransformJava2JsonServiceImpl.class);
-    BindingNormalizedNodeSerializer mappingservice;
-    SchemaContext schemaContext;
-    YangDataTransformNN2JsonServiceImpl nn2jsonService;
-    YangDataTransformJava2NNServiceImpl java2nnService;
-    public TransformJava2JsonServiceImpl(BindingNormalizedNodeSerializer mappingservice, SchemaContext schemaContext){
-       this.mappingservice=mappingservice;
-        this.schemaContext=schemaContext;
-        nn2jsonService=new YangDataTransformNN2JsonServiceImpl();
-        java2nnService=new YangDataTransformJava2NNServiceImpl(mappingservice);
-    }
-    @Override
-    public <T extends DataObject> String transformContrainerDataObjectToString(InstanceIdentifier<T> instanceIdentifier, String uriPath,T dataObject) throws Exception {
-        // TODO Auto-generated method stub
-        NormalizedNode nn = java2nnService.yangDataObjecttoNN(instanceIdentifier, dataObject);
-        NormalizedNodeContext nnc = java2nnService.yangNNtoNNC(nn, uriPath);
-        String sjson = nn2jsonService.transformNNCToString(nnc);
-        return sjson;
-    }
-    @Override
-    public <T extends Notification> String transformNotificationToString(String uriPath,T notification)throws Exception  {
-        NormalizedNode nn = mappingservice.toNormalizedNodeNotification(notification);
-        NormalizedNodeContext nnc = java2nnService.yangNNtoNNC(nn, uriPath);
-        String sjson = nn2jsonService.transformNNCToString(nnc);
-        return sjson;
-    }
-    @Override
-    public <T extends DataObject> String transformRpcDataObjectToString(String uriPath,T dataObject) throws Exception  {
-        NormalizedNode nn = mappingservice.toNormalizedNodeRpcData(dataObject);
-        NormalizedNodeContext nnc = java2nnService.yangNNtoNNC(nn, uriPath);
-        String sjson = nn2jsonService.transformNNCToString(nnc);
-        return sjson;
-    }
-    @Override
-    public  DataObject  transformContrainerDataObjectFromString(String uriPath,String sjson,boolean ispost) throws Exception {
-        NormalizedNodeContext nnc= nn2jsonService.transformDataObjectNNCFromString(uriPath,sjson,ispost);
-        return java2nnService.yangDataObjectfromNNC(nnc);
-    }
-    @Override
-    public Notification transformNotificationFromString(String notficationName,String sjson) throws Exception {
-        final InstanceIdentifierContext<?> iicontext = ControllerContext.getInstance().toInstanceIdentifier(notficationName);
-        NormalizedNodeContext nnc= nn2jsonService.transformNotficationNNCFromString(notficationName,sjson);
-        ContainerNode contn= (ContainerNode)nnc.getData();
-        return mappingservice.fromNormalizedNodeNotification(iicontext.getSchemaNode().getPath(),contn);
-    }
-    @Override
-    public DataObject transformRpcDataObjectFromString(String rpcName,String sjson) throws Exception {
-        final InstanceIdentifierContext<?> iicontext = ControllerContext.getInstance().toInstanceIdentifier(rpcName);
-        NormalizedNodeContext nnc= nn2jsonService.transformRPCNNCFromString(rpcName,sjson);
-        return  java2nnService.yangRpcDatafromNN(iicontext,nnc.getData());
-    /*    ContainerNode contn= (ContainerNode)nnc.getData();
-        DataSchemaNode schemaNode;
-        final SchemaNode schemaNode0 = iicontext.getSchemaNode();
-        boolean isInput = false;
-        if (schemaNode0 instanceof RpcDefinition) {
-            if (contn.getNodeType().getLocalName().contains("output")) {
-                schemaNode = ((RpcDefinition) schemaNode0).getOutput();
-                isInput = false;
-            } else {
-                schemaNode = ((RpcDefinition) schemaNode0).getInput();
-                isInput = true;
-            }
-
-        } else if (schemaNode0 instanceof DataSchemaNode) {
-            schemaNode = (DataSchemaNode) schemaNode0;
-        } else {
-            throw new IllegalStateException("Unknow SchemaNode");
-        }
-       return mappingservice.fromNormalizedNodeRpcData(schemaNode.getPath(),contn); */
-        //return mappingservice.toNormalizedNodeRpcData((DataContainer) nnc.getData());
-      //  return  java2nnService.yangDataObjectfromNNC(nnc);
-    }
-}
diff --git a/common/src/main/java/org/openecomp/mso/yangDecoder/transform/impl/TransformJava2XMLFactory.java b/common/src/main/java/org/openecomp/mso/yangDecoder/transform/impl/TransformJava2XMLFactory.java
deleted file mode 100644
index 8595988..0000000
--- a/common/src/main/java/org/openecomp/mso/yangDecoder/transform/impl/TransformJava2XMLFactory.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * 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.mso.yangDecoder.transform.impl;
-
-import javassist.ClassPool;
-import org.openecomp.mso.yangDecoder.base.TYangJsonXmlBase;
-import org.opendaylight.mdsal.binding.api.DataBroker;
-import org.opendaylight.mdsal.binding.dom.adapter.BindingToNormalizedNodeCodec;
-import org.opendaylight.netconf.sal.restconf.impl.ControllerContext;
-import org.opendaylight.yangtools.binding.data.codec.gen.impl.StreamWriterGenerator;
-import org.opendaylight.yangtools.binding.data.codec.impl.BindingNormalizedNodeCodecRegistry;
-import org.opendaylight.mdsal.binding.generator.impl.GeneratedClassLoadingStrategy;
-import org.opendaylight.mdsal.binding.generator.impl.ModuleInfoBackedContext;
-import org.opendaylight.mdsal.binding.generator.util.JavassistUtils;
-import org.opendaylight.yangtools.yang.binding.YangModuleInfo;
-
-/**
- * Created by 10112215 on 2017/3/26.
- */
-public class TransformJava2XMLFactory extends TYangJsonXmlBase {
-    BindingToNormalizedNodeCodec mappingservice;
-    ModuleInfoBackedContext moduleInfoBackedContext;
-    protected final static ControllerContext controllerContext = ControllerContext.getInstance();
-
-    public TransformJava2XMLServiceImpl getJava2xmlService() {
-        if (java2xmlService == null) {
-            try {
-                setup2();
-            } catch (Exception e) {
-                e.printStackTrace();
-                return null;
-            }
-        }
-        return java2xmlService;
-    }
-
-    TransformJava2XMLServiceImpl java2xmlService;
-
-    @Override
-    protected void setupWithDataBroker(final DataBroker dataBroker) {
-        // Intentionally left No-op, subclasses may customize it
-        
-        // moduleInfoBackedContext.registerModuleInfo(BindingReflections.getModuleInfo(SncTunnels.class));
-        try {
-        	mappingservice = new BindingToNormalizedNodeCodec(GeneratedClassLoadingStrategy.getTCCLClassLoadingStrategy(),
-                    new BindingNormalizedNodeCodecRegistry(StreamWriterGenerator.create(JavassistUtils.forClassPool(ClassPool.getDefault()))));
-            moduleInfoBackedContext = ModuleInfoBackedContext.create();
-            
-            for (YangModuleInfo yangModuleInfo : getModuleInfos()) {
-                moduleInfoBackedContext.registerModuleInfo(yangModuleInfo);
-            }
-            
-            schemaContext = moduleInfoBackedContext.tryToCreateSchemaContext().get();
-            mappingservice.onGlobalContextUpdated(schemaContext);
-            controllerContext.setSchemas(schemaContext);
-        } catch (Exception e) {
-            e.printStackTrace();
-        } finally {
-        	if(null != mappingservice){
-        		mappingservice.close();
-        	}
-        }
-        
-
-    }
-
-    public final void setup2() throws Exception {
-        super.setup();
-        if(java2xmlService==null)
-            java2xmlService = new TransformJava2XMLServiceImpl(mappingservice, schemaContext);
-    }
-
-
-}
diff --git a/common/src/main/java/org/openecomp/mso/yangDecoder/transform/impl/TransformJava2XMLServiceImpl.java b/common/src/main/java/org/openecomp/mso/yangDecoder/transform/impl/TransformJava2XMLServiceImpl.java
deleted file mode 100644
index 9a1d570..0000000
--- a/common/src/main/java/org/openecomp/mso/yangDecoder/transform/impl/TransformJava2XMLServiceImpl.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * 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.mso.yangDecoder.transform.impl;
-
-import org.openecomp.mso.yangDecoder.transform.api.ITransformJava2StringService;
-import org.opendaylight.netconf.sal.restconf.impl.ControllerContext;
-import org.opendaylight.netconf.sal.restconf.impl.InstanceIdentifierContext;
-import org.opendaylight.netconf.sal.restconf.impl.NormalizedNodeContext;
-import org.opendaylight.yangtools.binding.data.codec.api.BindingNormalizedNodeSerializer;
-import org.opendaylight.yangtools.yang.binding.DataObject;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.opendaylight.yangtools.yang.binding.Notification;
-import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
-import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
-import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-import org.opendaylight.yangtools.yang.model.api.SchemaNode;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.Map;
-
-/**
- * Created by Administrator on 2017/3/20.
- */
-public class TransformJava2XMLServiceImpl implements ITransformJava2StringService {
-    private static final Logger LOG = LoggerFactory.getLogger(TransformJava2XMLServiceImpl.class);
-    BindingNormalizedNodeSerializer mappingservice;
-    SchemaContext schemaContext;
-    YangDataTransformJava2NNServiceImpl  java2nnService;
-    YangDataTransformNN2XMLServiceImpl   nn2xmlService;
-    YangOdlNN2XMLImpl yangODLnn2xml;
-    public TransformJava2XMLServiceImpl(BindingNormalizedNodeSerializer mappingService, SchemaContext schemaContext){
-        this.mappingservice=mappingService;
-        this.schemaContext=schemaContext;
-        java2nnService=new YangDataTransformJava2NNServiceImpl(mappingService);
-        nn2xmlService=new YangDataTransformNN2XMLServiceImpl(mappingService,schemaContext);
-        yangODLnn2xml=new YangOdlNN2XMLImpl(schemaContext);
-    }
-    @Override
-    public <T extends DataObject> String transformContrainerDataObjectToString(InstanceIdentifier<T> instanceIdentifier, String uriPath, T dataObject)
-            throws Exception {
-        // TODO Auto-generated method stub
-        NormalizedNode nn=java2nnService.yangDataObjecttoNN(instanceIdentifier,dataObject);
-        return yangODLnn2xml.yangNNtoXML(uriPath,nn);
-    }
-    @Override
-    public <T extends Notification> String transformNotificationToString(String uriPath, T notification)
-            throws Exception  {
-        NormalizedNode nn= mappingservice.toNormalizedNodeNotification(notification);
-        return yangODLnn2xml.yangNNtoXML(uriPath,nn);
-    }
-    @Override
-    public <T extends DataObject> String transformRpcDataObjectToString(String uriPath, T dataObject)
-            throws Exception {
-        NormalizedNode nn=mappingservice.toNormalizedNodeRpcData(dataObject);
-        return yangODLnn2xml.yangNNtoXML(uriPath,nn);
-    }
-    //for container
-    public <T extends DataObject> String transformContrainerDataObjectToString(InstanceIdentifier<T> instanceIdentifier, T dataObject) {
-        // TODO Auto-generated method stub
-        NormalizedNode nn=java2nnService.yangDataObjecttoNN(instanceIdentifier,dataObject);
-        return nn2xmlService.transformNNToString(nn);
-    }
-
-    public <T extends Notification> String transformNotificationToString(T notification) {
-        NormalizedNode nn= mappingservice.toNormalizedNodeNotification(notification);
-        return nn2xmlService.transformNNToString(nn);
-    }
-
-    //for rpc
-    public <T extends DataObject> String transformRpcDataObjectToString(T dataObject) {
-        NormalizedNode nn=mappingservice.toNormalizedNodeRpcData(dataObject);
-        return nn2xmlService.transformNNToString(nn);
-    }
-
-    //for container
-    @Override
-    public  DataObject  transformContrainerDataObjectFromString(String uriPath, String sxml,boolean ispost) throws Exception  {
-        // TODO Auto-generated method stub
-    	if(ispost)
-    	{
-    		NormalizedNodeContext nnc=YangOdlNNC2XMLImpl.fromXML(uriPath,sxml, ispost);
-    		 final InstanceIdentifierContext<?> iicontext=nnc.getInstanceIdentifierContext();
-    		Map.Entry<InstanceIdentifier<?>, DataObject> temp = mappingservice.fromNormalizedNode(iicontext.getInstanceIdentifier(),nnc.getData());
-    		return (DataObject)temp.getValue();
-    	}
-        final InstanceIdentifierContext<?> iicontext = ControllerContext.getInstance().toInstanceIdentifier(uriPath);
-        NormalizedNode nn =nn2xmlService.transformNNFromString(sxml);
-        Map.Entry<InstanceIdentifier<?>, DataObject> temp = mappingservice.fromNormalizedNode(iicontext.getInstanceIdentifier(),nn);
-        if (null == temp) {
-            return null;
-        } else {
-            return   temp.getValue();
-        }
-    }
-    @Override
-    public Notification transformNotificationFromString(String notficationName, String sxml) throws Exception {
-
-        final InstanceIdentifierContext<?> iicontext = ControllerContext.getInstance().toInstanceIdentifier(notficationName);
-        NormalizedNode nn = nn2xmlService.transformNotificationStringtoNN(sxml, notficationName);
-        ContainerNode noti = (ContainerNode) nn;
-        SchemaNode snode=iicontext.getSchemaNode() ;
-        Notification obj = mappingservice.fromNormalizedNodeNotification(snode.getPath(), noti);
-        return obj;
-    }
-        //for rpc
-    @Override
-    public DataObject transformRpcDataObjectFromString(String rpcName, String sxml) throws Exception {
-        final InstanceIdentifierContext<?> iicontext = ControllerContext.getInstance().toInstanceIdentifier(rpcName);
-        Map.Entry<DataSchemaNode, NormalizedNode>  nnentry = nn2xmlService.transformRpcNNEntryfromString(sxml,iicontext);
-        ContainerNode rpc = (ContainerNode) nnentry.getValue();
-        DataObject rpcdata= mappingservice.fromNormalizedNodeRpcData(nnentry.getKey().getPath(),rpc);
-        return rpcdata;
-    }
-}
diff --git a/common/src/main/java/org/openecomp/mso/yangDecoder/transform/impl/TransfromJava2StringFactory.java b/common/src/main/java/org/openecomp/mso/yangDecoder/transform/impl/TransfromJava2StringFactory.java
deleted file mode 100644
index a45b587..0000000
--- a/common/src/main/java/org/openecomp/mso/yangDecoder/transform/impl/TransfromJava2StringFactory.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * 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.mso.yangDecoder.transform.impl;
-
-import org.dom4j.DocumentException;
-import org.dom4j.DocumentHelper;
-import org.openecomp.mso.yangDecoder.transform.api.ITransformJava2StringService;
-
-/**
- * Created by 10112215 on 2017/3/24.
- */
-public class TransfromJava2StringFactory {
-
-    private static TransformJava2JsonServiceImpl java2jsonService = (new TransformJava2JsonFactory()).getJava2jsonService();
-
-    private static TransformJava2XMLServiceImpl java2XMLService/* = (new TransformJava2XMLFactory()).getJava2xmlService()*/;
-
-    public static boolean isXML(String value) {
-        try {
-            DocumentHelper.parseText(value);
-        } catch (DocumentException e) {
-            return false;
-        }
-        return true;
-    }
-
-    public static ITransformJava2StringService getJava2StringService(String input) throws Exception {
-        ITransformJava2StringService java2jsonService;
-        if (isXML(input)) {
-            java2jsonService = getJava2XMLService();
-        } else {
-            java2jsonService = getJava2jsonService();
-        }
-        return java2jsonService;
-    }
-
-    public static void init() {
-        // do no shit for static initialization
-    }
-
-    public static ITransformJava2StringService getJava2jsonService() throws Exception {
-        if (java2jsonService == null) {
-            TransformJava2JsonFactory transformJava2JsonFactory = new TransformJava2JsonFactory();
-            java2jsonService = transformJava2JsonFactory.getJava2jsonService();
-        }
-        return java2jsonService;
-    }
-
-    public static ITransformJava2StringService getJava2XMLService() throws Exception {
-        if (java2XMLService == null) {
-            TransformJava2XMLFactory transformJava2XMLFactory = new TransformJava2XMLFactory();
-            java2XMLService = transformJava2XMLFactory.getJava2xmlService();
-        }
-        return java2XMLService;
-    }
-
-}
diff --git a/common/src/main/java/org/openecomp/mso/yangDecoder/transform/impl/XmlNormalizedNodeBodyReaderUmeImpl.java b/common/src/main/java/org/openecomp/mso/yangDecoder/transform/impl/XmlNormalizedNodeBodyReaderUmeImpl.java
deleted file mode 100644
index d9add78..0000000
--- a/common/src/main/java/org/openecomp/mso/yangDecoder/transform/impl/XmlNormalizedNodeBodyReaderUmeImpl.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * 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.mso.yangDecoder.transform.impl;
-
-import org.opendaylight.netconf.sal.rest.impl.XmlNormalizedNodeBodyReader;
-import org.opendaylight.netconf.sal.restconf.impl.InstanceIdentifierContext;
-
-public class XmlNormalizedNodeBodyReaderUmeImpl extends
-		XmlNormalizedNodeBodyReader {
- 	InstanceIdentifierContext<?> iic; 
- 	boolean  ispost=false;
- 	@Override
-	 protected InstanceIdentifierContext<?> getInstanceIdentifierContext() {
-	        return iic;
-	    }
- 	@Override
-	 protected boolean isPost() {
-	        return ispost;
-	    } 
-	public void Set(InstanceIdentifierContext<?> iic,boolean ispost)
-	{
-		this.iic=iic;
-		this.ispost=ispost;
-	}
-	 
-}
diff --git a/common/src/main/java/org/openecomp/mso/yangDecoder/transform/impl/YangDataTransformJava2NNServiceImpl.java b/common/src/main/java/org/openecomp/mso/yangDecoder/transform/impl/YangDataTransformJava2NNServiceImpl.java
deleted file mode 100644
index 4d56767..0000000
--- a/common/src/main/java/org/openecomp/mso/yangDecoder/transform/impl/YangDataTransformJava2NNServiceImpl.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * 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.mso.yangDecoder.transform.impl;
-
-//import org.opendaylight.mdsal.binding.dom.adapter.BindingToNormalizedNodeCodec;
-
-import org.opendaylight.netconf.sal.restconf.impl.ControllerContext;
-import org.opendaylight.netconf.sal.restconf.impl.InstanceIdentifierContext;
-import org.opendaylight.netconf.sal.restconf.impl.NormalizedNodeContext;
-import org.opendaylight.netconf.sal.restconf.impl.WriterParameters;
-import org.opendaylight.yangtools.binding.data.codec.api.BindingNormalizedNodeSerializer;
-import org.opendaylight.yangtools.yang.binding.DataContainer;
-import org.opendaylight.yangtools.yang.binding.DataObject;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
-import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
-import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
-import org.opendaylight.yangtools.yang.model.api.*;
-
-import java.util.Map;
-
-/**
- * Created by Administrator on 2017/3/17.
- */
-public class YangDataTransformJava2NNServiceImpl {
-    BindingNormalizedNodeSerializer mappingService;
-    public YangDataTransformJava2NNServiceImpl(BindingNormalizedNodeSerializer mappingService)
-    {
-        this.mappingService=mappingService;
-    }
-    public  <T extends DataObject>  NormalizedNodeContext yangDataObjecttoNNC(InstanceIdentifier<T> identifier, String uri, T dobj)
-    {
-        final InstanceIdentifierContext<?> iiContext = ControllerContext.getInstance().toInstanceIdentifier(uri);
-        Map.Entry<YangInstanceIdentifier, NormalizedNode<?, ?>> temp = mappingService.toNormalizedNode(identifier, dobj);
-        WriterParameters.WriterParametersBuilder aa=new WriterParameters.WriterParametersBuilder();
-        aa.setPrettyPrint(true);
-        return new NormalizedNodeContext( iiContext, temp.getValue() ,aa.build());
-    }
-    public  <T extends DataObject> NormalizedNode yangDataObjecttoNN( InstanceIdentifier<T> identifier,T dobj) {
-        Map.Entry<YangInstanceIdentifier, NormalizedNode<?, ?>> temp = mappingService.toNormalizedNode(identifier, dobj);
-        if (null == temp) {
-            return null;
-        } else {
-            return temp.getValue();
-        }
-    }
-    public NormalizedNodeContext yangNNtoNNC(NormalizedNode nn, String uri){
-        final InstanceIdentifierContext<?> iiContext = ControllerContext.getInstance().toInstanceIdentifier(uri);
-        WriterParameters.WriterParametersBuilder aa=new WriterParameters.WriterParametersBuilder();
-        aa.setPrettyPrint(true);
-        return new NormalizedNodeContext(iiContext, nn,aa.build());
-    }
-    public  <T extends DataObject> T yangDataObjectfromNN(YangInstanceIdentifier identifier,NormalizedNode node) {
-        Map.Entry<InstanceIdentifier<?>, DataObject> temp = mappingService.fromNormalizedNode(identifier, node);
-        if (null == temp) {
-            return null;
-        } else {
-            return (T) temp.getValue();
-        }
-    }
-    public  <T extends DataObject> T yangDataObjectfromNNC(NormalizedNodeContext nnc)
-    {
-        return yangDataObjectfromNN(nnc.getInstanceIdentifierContext().getInstanceIdentifier(),nnc.getData());
-    }
-    public ContainerNode yangRpcDatatoNN(final DataContainer rpcdata){
-        return mappingService.toNormalizedNodeRpcData(rpcdata);
-    }
-    public DataObject yangRpcDatafromNN(SchemaPath path, final ContainerNode data)
-    {
-        return mappingService.fromNormalizedNodeRpcData(path,data);
-    }
-    public static DataSchemaNode findDataSchemaNode(String uriPath,String inputoroutput)
-    {
-        final InstanceIdentifierContext<?> iicontext = ControllerContext.getInstance().toInstanceIdentifier(uriPath);
-        DataSchemaNode dsn=JsonParserStream.getWrapSchemaNode( iicontext.getSchemaNode());
-        return dsn;
-    }
-    public static SchemaNode findSchemaNode(final InstanceIdentifierContext<?> iicontext ,String inputoroutput)
-    {
-        SchemaNode schemaNode;
-
-        final SchemaNode schemaNode0 = iicontext.getSchemaNode();
-        if (schemaNode0 instanceof RpcDefinition) {
-            if (inputoroutput.contains("output")) {
-                schemaNode = ((RpcDefinition) schemaNode0).getOutput();
-            } else {
-                schemaNode = ((RpcDefinition) schemaNode0).getInput();
-            }
-
-        } else if(schemaNode0 instanceof NotificationDefinition)
-        {
-            schemaNode=schemaNode0;
-        }
-        else if (schemaNode0 instanceof DataSchemaNode) {
-            schemaNode =  schemaNode0;
-        } else {
-            throw new IllegalStateException("Unknow SchemaNode");
-        }
-        return schemaNode;
-    }
-
-    public static DataSchemaNode findRpcSchemaNode(final InstanceIdentifierContext<?> iicontext,String inputoroutput)
-    {
-        DataSchemaNode schemaNode;
-        final SchemaNode schemaNode0 = iicontext.getSchemaNode();
-        boolean isInput = false;
-        if (schemaNode0 instanceof RpcDefinition) {
-            if (inputoroutput.contains("output")) {
-                schemaNode = ((RpcDefinition) schemaNode0).getOutput();
-                isInput = false;
-            } else {
-                schemaNode = ((RpcDefinition) schemaNode0).getInput();
-                isInput = true;
-            }
-
-        } else if (schemaNode0 instanceof DataSchemaNode) {
-            schemaNode = (DataSchemaNode) schemaNode0;
-        } else {
-            throw new IllegalStateException("Unknow SchemaNode");
-        }
-        return   schemaNode;
-    }
-    public DataObject yangRpcDatafromNN(final InstanceIdentifierContext<?> iicontext , final NormalizedNode data) {
-       // final InstanceIdentifierContext<?> iicontext = ControllerContext.getInstance().toInstanceIdentifier(uriPath);
-        ContainerNode contn= (ContainerNode)data;
-        DataSchemaNode schemaNode= findRpcSchemaNode(iicontext,contn.getNodeType().getLocalName());;
-    /*    final SchemaNode schemaNode0 = iicontext.getSchemaNode();
-        boolean isInput = false;
-        if (schemaNode0 instanceof RpcDefinition) {
-            if (contn.getNodeType().getLocalName().contains("output")) {
-                schemaNode = ((RpcDefinition) schemaNode0).getOutput();
-                isInput = false;
-            } else {
-                schemaNode = ((RpcDefinition) schemaNode0).getInput();
-                isInput = true;
-            }
-
-        } else if (schemaNode0 instanceof DataSchemaNode) {
-            schemaNode = (DataSchemaNode) schemaNode0;
-        } else {
-            throw new IllegalStateException("Unknow SchemaNode");
-        }*/
-        SchemaPath path=schemaNode.getPath();
-        return  mappingService.fromNormalizedNodeRpcData(path,contn);
-    }
-}
diff --git a/common/src/main/java/org/openecomp/mso/yangDecoder/transform/impl/YangDataTransformNN2JsonServiceImpl.java b/common/src/main/java/org/openecomp/mso/yangDecoder/transform/impl/YangDataTransformNN2JsonServiceImpl.java
deleted file mode 100644
index 23872ca..0000000
--- a/common/src/main/java/org/openecomp/mso/yangDecoder/transform/impl/YangDataTransformNN2JsonServiceImpl.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * 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.mso.yangDecoder.transform.impl;
-
-import com.google.common.base.Charsets;
-import org.opendaylight.netconf.sal.rest.impl.JsonNormalizedNodeBodyReader;
-import org.opendaylight.netconf.sal.rest.impl.NormalizedNodeJsonBodyWriter;
-import org.opendaylight.netconf.sal.restconf.impl.NormalizedNodeContext;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.ws.rs.core.MediaType;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.lang.annotation.Annotation;
-
-/**
- * Created by Administrator on 2017/3/17.
- */
-public class YangDataTransformNN2JsonServiceImpl {
-    private static final Logger LOG = LoggerFactory.getLogger(YangDataTransformNN2JsonServiceImpl.class);
-    private static final Annotation[] EMPTY_ANNOTATIONS = new Annotation[0];
-
-    public NormalizedNodeContext transformNNCFromString(String uriPath,String jsonpayload,boolean isPost){
-
-        InputStream entityStream = new ByteArrayInputStream(jsonpayload.getBytes(Charsets.UTF_8));
-        NormalizedNodeContext normalnodes3 = JsonNormalizedNodeBodyReader.readFrom(uriPath, entityStream, isPost);
-        return normalnodes3;
-    }
-    public String transformNNCToString(NormalizedNodeContext readData) throws IOException {
-        NormalizedNodeJsonBodyWriter writer = new NormalizedNodeJsonBodyWriter();
-        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
-        //readData.getWriterParameters().isPrettyPrint()
-        writer.writeTo(readData, NormalizedNodeContext.class, null, EMPTY_ANNOTATIONS,
-                MediaType.APPLICATION_JSON_TYPE, null, outputStream );
-        return outputStream.toString(Charsets.UTF_8.name());
-    }
-    public NormalizedNodeContext transformRPCNNCFromString(String uriPath,String jsonpayload)
-    {
-        return transformNNCFromString(uriPath,jsonpayload,true);
-    }
-    public NormalizedNodeContext transformDataObjectNNCFromString(String uriPath,String jsonpayload,boolean ispost)
-    {
-        return transformNNCFromString(uriPath,jsonpayload,ispost);
-    }
-    public NormalizedNodeContext transformNotficationNNCFromString(String uriPath,String jsonpayload)
-    {
-        return transformNNCFromString(uriPath,jsonpayload,true);
-    }
-}
diff --git a/common/src/main/java/org/openecomp/mso/yangDecoder/transform/impl/YangDataTransformNN2XMLServiceImpl.java b/common/src/main/java/org/openecomp/mso/yangDecoder/transform/impl/YangDataTransformNN2XMLServiceImpl.java
deleted file mode 100644
index a77977e..0000000
--- a/common/src/main/java/org/openecomp/mso/yangDecoder/transform/impl/YangDataTransformNN2XMLServiceImpl.java
+++ /dev/null
@@ -1,273 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * 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.mso.yangDecoder.transform.impl;
-
-import com.google.common.base.Charsets;
-import com.google.common.base.Preconditions;
-import com.google.common.collect.Lists;
-import org.opendaylight.netconf.sal.restconf.impl.ControllerContext;
-import org.opendaylight.netconf.sal.restconf.impl.InstanceIdentifierContext;
-import org.opendaylight.yangtools.binding.data.codec.api.BindingNormalizedNodeSerializer;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
-import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
-import org.opendaylight.yangtools.yang.data.impl.schema.transform.dom.DomUtils;
-import org.opendaylight.yangtools.yang.data.impl.schema.transform.dom.parser.DomToNormalizedNodeParserFactory;
-import org.opendaylight.yangtools.yang.model.api.*;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.xml.sax.SAXException;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.stream.XMLOutputFactory;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.AbstractMap.SimpleEntry;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-
-import static org.openecomp.mso.yangDecoder.transform.impl.JsonParserStream.getWrapSchemaNode;
-
-public class YangDataTransformNN2XMLServiceImpl {
-    private static final XMLOutputFactory XML_FACTORY;
-    private static final DocumentBuilderFactory BUILDERFACTORY;
-    static {
-        XML_FACTORY = XMLOutputFactory.newFactory();
-        XML_FACTORY.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, false);
-        final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-        factory.setNamespaceAware(true);
-        factory.setCoalescing(true);
-        factory.setIgnoringElementContentWhitespace(true);
-        factory.setIgnoringComments(true);
-        BUILDERFACTORY = factory;
-    }
-    BindingNormalizedNodeSerializer mappingservice;
-    SchemaContext schemaContext;
-    private static final Logger LOG = LoggerFactory.getLogger(YangDataTransformNN2XMLServiceImpl.class);
-
-    public YangDataTransformNN2XMLServiceImpl(BindingNormalizedNodeSerializer mappingservice, SchemaContext context ) {
-
-        this.schemaContext = context;
-        this.mappingservice=mappingservice;
-    }
-
-    public String transformNNToString(NormalizedNode nn)
-    {
-        StringBuilder stringBuilder = new StringBuilder();
-        stringBuilder.append(YangOdlNNC2XMLImpl.getXMLHeader());
-        new NormalizedNodeNavigator(new NormalizedNodePrinter(stringBuilder)).navigate(null, nn);
-        return stringBuilder.toString();
-    }
-
-
-    public static DataSchemaNode getSchemaNodebyNs(final SchemaContext context, final String ns, final String childNodeName) {
-        for (Module module : context.getModules()) {
-            if (module.getNamespace().toString().equals(ns)) {
-                DataSchemaNode found = findChildNode(module.getChildNodes(), childNodeName);
-                Preconditions.checkState(found != null, "Unable to find %s", childNodeName);
-                return found;
-            }
-        }
-        throw new IllegalStateException("Unable to find child node " + childNodeName);
-    }
-    private static DataSchemaNode findChildNode(final Iterable<DataSchemaNode> children, final String name) {
-        List<DataNodeContainer> containers = Lists.newArrayList();
-
-        for (DataSchemaNode dataSchemaNode : children) {
-            if (dataSchemaNode.getQName().getLocalName().equals(name)) {
-                return dataSchemaNode;
-            }
-            if (dataSchemaNode instanceof DataNodeContainer) {
-                containers.add((DataNodeContainer) dataSchemaNode);
-            } else if (dataSchemaNode instanceof ChoiceSchemaNode) {
-                containers.addAll(((ChoiceSchemaNode) dataSchemaNode).getCases());
-            }
-        }
-
-        for (DataNodeContainer container : containers) {
-            DataSchemaNode retVal = findChildNode(container.getChildNodes(), name);
-            if (retVal != null) {
-                return retVal;
-            }
-        }
-
-        return null;
-    }
-    public NormalizedNode transformNNFromString(String sxml) throws Exception {
-        InputStream in_nocode = new ByteArrayInputStream(sxml.getBytes(Charsets.UTF_8));//.getBytes("UTF-8")
-         //xml2nn
-            final Document docxml = readXmlToDocument(in_nocode);
-            Element element0 = docxml.getDocumentElement();
-            String localname = element0.getNodeName();
-            String ns = element0.getAttribute("xmlns");
-           // final ContainerSchemaNode containerNodex = (ContainerSchemaNode)null;
-           final DataSchemaNode dsn=getSchemaNodebyNs(schemaContext, ns, localname);
-            //cn.getNodeType().getNamespace().toString(), cn.getNodeType().getLocalName());
-        DomToNormalizedNodeParserFactory parserFactory =DomToNormalizedNodeParserFactory.getInstance(DomUtils.defaultValueCodecProvider(), schemaContext);
-        NormalizedNode parsed = null;
-        final List<Element> elements = Collections.singletonList(docxml.getDocumentElement());
-        if (dsn instanceof ContainerSchemaNode) {
-            parsed= parserFactory.getContainerNodeParser().parse(elements, (ContainerSchemaNode)dsn);
-        }else   if (dsn instanceof ListSchemaNode) {
-            final ListSchemaNode casted = (ListSchemaNode) dsn;
-            parsed=parserFactory.getMapEntryNodeParser().parse(elements, casted);
-        }
-        return parsed;
-
-    }
-
-
-
-    public NormalizedNode transformNotificationNNfromString(String sxml, final InstanceIdentifierContext<?> iicontext) throws Exception
-    {
-        SchemaNode schemaNode = getWrapSchemaNode(iicontext.getSchemaNode());
-        InputStream in_nocode = new ByteArrayInputStream(sxml.getBytes(Charsets.UTF_8));//.getBytes("UTF-8")
-        //xml2nn
-        final Document docxml = readXmlToDocument(in_nocode);
-        Element element0 = docxml.getDocumentElement();
-        String localname = element0.getNodeName();
-        String ns = element0.getAttribute("xmlns");
-        // final ContainerSchemaNode containerNodex = (ContainerSchemaNode)null;
-        //  final DataSchemaNode dsn=(DataSchemaNode)schemaNode;/*getSchemaNodebyNs(schemaContext, ns, localname);*/
-        //cn.getNodeType().getNamespace().toString(), cn.getNodeType().getLocalName());
-        DomToNormalizedNodeParserFactory parserFactory =DomToNormalizedNodeParserFactory.getInstance(DomUtils.defaultValueCodecProvider(), schemaContext);
-        NormalizedNode parsed = null;
-        final List<Element> elements = Collections.singletonList(docxml.getDocumentElement());
-        if (schemaNode instanceof ContainerSchemaNode) {
-            parsed= parserFactory.getContainerNodeParser().parse(elements, (ContainerSchemaNode)schemaNode);
-        }else   if (schemaNode instanceof ListSchemaNode) {
-            final ListSchemaNode casted = (ListSchemaNode) schemaNode;
-            parsed=parserFactory.getMapEntryNodeParser().parse(elements, casted);
-        }
-        return parsed;
-    }
-    public NormalizedNode transformNotificationStringtoNN(String sxml,String notficationName) throws Exception {
-        final InstanceIdentifierContext<?> iicontext= ControllerContext.getInstance().toInstanceIdentifier(notficationName);
-         return transformNotificationNNfromString(sxml,iicontext);
-    }
-    public Map.Entry<DataSchemaNode, NormalizedNode>  transformRpcNNEntryfromString(String sxml, final InstanceIdentifierContext<?> iirpccontext) throws Exception{
-        InputStream in_nocode = new ByteArrayInputStream(sxml.getBytes(Charsets.UTF_8));//.getBytes("UTF-8")
-        //xml2nn
-        final Document docxml = readXmlToDocument(in_nocode);
-        Element element0 = docxml.getDocumentElement();
-        String localname = element0.getNodeName();
-        String ns = element0.getAttribute("xmlns");
-        DataSchemaNode schemaNode;
-        final SchemaNode schemaNode0 = iirpccontext.getSchemaNode();
-        boolean isInput = false;
-        if (schemaNode0 instanceof RpcDefinition) {
-            if (docxml.getDocumentElement().getLocalName().contains("output")) {
-                schemaNode = ((RpcDefinition) schemaNode0).getOutput();
-                isInput = false;
-            } else {
-                schemaNode = ((RpcDefinition) schemaNode0).getInput();
-                isInput = true;
-            }
-
-        } else if (docxml instanceof DataSchemaNode) {
-            schemaNode = (DataSchemaNode) docxml;
-        } else {
-            throw new IllegalStateException("Unknow SchemaNode");
-        }
-
-        final List<YangInstanceIdentifier.PathArgument> iiToDataList = new ArrayList<>();
-        InstanceIdentifierContext<? extends SchemaNode> outIIContext;
-        // final ContainerSchemaNode containerNodex = (ContainerSchemaNode)null;
-        //  final DataSchemaNode dsn=(DataSchemaNode)schemaNode;/*getSchemaNodebyNs(schemaContext, ns, localname);*/
-        //cn.getNodeType().getNamespace().toString(), cn.getNodeType().getLocalName());
-        DomToNormalizedNodeParserFactory parserFactory =DomToNormalizedNodeParserFactory.getInstance(DomUtils.defaultValueCodecProvider(), schemaContext);
-        NormalizedNode parsed = null;
-        final List<Element> elements = Collections.singletonList(docxml.getDocumentElement());
-        if (schemaNode instanceof ContainerSchemaNode) {
-            parsed= parserFactory.getContainerNodeParser().parse(elements, (ContainerSchemaNode)schemaNode);
-        }else   if (schemaNode instanceof ListSchemaNode) {
-            final ListSchemaNode casted = (ListSchemaNode) schemaNode;
-            parsed=parserFactory.getMapEntryNodeParser().parse(elements, casted);
-        }
-        return new SimpleEntry<DataSchemaNode, NormalizedNode>(schemaNode,parsed);
-    }
-    public NormalizedNode transformRpcNNfromString(String sxml, final InstanceIdentifierContext<?> iirpccontext) throws Exception{
-
-        InputStream in_nocode = new ByteArrayInputStream(sxml.getBytes(Charsets.UTF_8));//.getBytes("UTF-8")
-        //xml2nn
-        final Document docxml = readXmlToDocument(in_nocode);
-        Element element0 = docxml.getDocumentElement();
-        String localname = element0.getNodeName();
-        String ns = element0.getAttribute("xmlns");
-        DataSchemaNode schemaNode;
-        final SchemaNode schemaNode0 = iirpccontext.getSchemaNode();
-        boolean isInput = false;
-        if (schemaNode0 instanceof RpcDefinition) {
-            if (docxml.getDocumentElement().getLocalName().contains("output")) {
-                schemaNode = ((RpcDefinition) schemaNode0).getOutput();
-                isInput = false;
-            } else {
-                schemaNode = ((RpcDefinition) schemaNode0).getInput();
-                isInput = true;
-            }
-
-        } else if (docxml instanceof DataSchemaNode) {
-            schemaNode = (DataSchemaNode) docxml;
-        } else {
-            throw new IllegalStateException("Unknow SchemaNode");
-        }
-
-        final List<YangInstanceIdentifier.PathArgument> iiToDataList = new ArrayList<>();
-        InstanceIdentifierContext<? extends SchemaNode> outIIContext;
-        // final ContainerSchemaNode containerNodex = (ContainerSchemaNode)null;
-        //  final DataSchemaNode dsn=(DataSchemaNode)schemaNode;/*getSchemaNodebyNs(schemaContext, ns, localname);*/
-        //cn.getNodeType().getNamespace().toString(), cn.getNodeType().getLocalName());
-        DomToNormalizedNodeParserFactory parserFactory =DomToNormalizedNodeParserFactory.getInstance(DomUtils.defaultValueCodecProvider(), schemaContext);
-        NormalizedNode parsed = null;
-        final List<Element> elements = Collections.singletonList(docxml.getDocumentElement());
-        if (schemaNode instanceof ContainerSchemaNode) {
-            parsed= parserFactory.getContainerNodeParser().parse(elements, (ContainerSchemaNode)schemaNode);
-        }else   if (schemaNode instanceof ListSchemaNode) {
-            final ListSchemaNode casted = (ListSchemaNode) schemaNode;
-            parsed=parserFactory.getMapEntryNodeParser().parse(elements, casted);
-        }
-        return parsed;
-    }
-    public NormalizedNode transformRpcNNfromString(String sxml, String rpcName) throws Exception {
-        final InstanceIdentifierContext<?> iicontext= ControllerContext.getInstance().toInstanceIdentifier(rpcName);
-        return this.transformRpcNNfromString(sxml,iicontext);
-
-    }
-    public static Document readXmlToDocument(final InputStream xmlContent) throws IOException, SAXException {
-        final DocumentBuilder dBuilder;
-        try {
-            dBuilder = BUILDERFACTORY.newDocumentBuilder();
-        } catch (final ParserConfigurationException e) {
-            throw new RuntimeException("Failed to parse XML document", e);
-        }
-        final Document doc = dBuilder.parse(xmlContent);
-
-        doc.getDocumentElement().normalize();
-        return doc;
-    }
-
-}
diff --git a/common/src/main/java/org/openecomp/mso/yangDecoder/transform/impl/YangOdlNN2XMLImpl.java b/common/src/main/java/org/openecomp/mso/yangDecoder/transform/impl/YangOdlNN2XMLImpl.java
deleted file mode 100644
index 9ad2336..0000000
--- a/common/src/main/java/org/openecomp/mso/yangDecoder/transform/impl/YangOdlNN2XMLImpl.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * 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.mso.yangDecoder.transform.impl;
-
-import org.opendaylight.netconf.sal.restconf.impl.ControllerContext;
-import org.opendaylight.netconf.sal.restconf.impl.InstanceIdentifierContext;
-import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
-import org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter;
-import org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeWriter;
-import org.opendaylight.yangtools.yang.data.impl.codec.xml.XMLStreamNormalizedNodeStreamWriter;
-import org.opendaylight.yangtools.yang.data.impl.codec.xml.XmlDocumentUtils;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-import org.opendaylight.yangtools.yang.model.api.SchemaNode;
-import org.opendaylight.yangtools.yang.model.api.SchemaPath;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-import javax.xml.stream.XMLOutputFactory;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamWriter;
-import javax.xml.transform.*;
-import javax.xml.transform.dom.DOMResult;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-import java.io.IOException;
-import java.io.StringWriter;
-
-/**
- * Created by Administrator on 2017/3/21.
- */
-public class YangOdlNN2XMLImpl {
-    private static final XMLOutputFactory XML_FACTORY;
-    static {
-        XML_FACTORY = XMLOutputFactory.newFactory();
-        XML_FACTORY.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, false);
-    }
-    SchemaContext schemaContext;
-    public YangOdlNN2XMLImpl(SchemaContext schemaContext){
-        this.schemaContext=schemaContext;
-    }
-    //general for contain/listitem/rpc/notification
-    public String yangNNtoXML(String uriPath,NormalizedNode nn) throws Exception {
-        final InstanceIdentifierContext<?> iicontext = ControllerContext.getInstance().toInstanceIdentifier(uriPath);
-        SchemaNode snode = YangDataTransformJava2NNServiceImpl.findSchemaNode(iicontext, nn.getNodeType().getLocalName());
-        String strx = snode.toString();
-        SchemaPath path = snode.getPath();
-        int it=uriPath.lastIndexOf("/");
-        if (strx.contains("container ")&&(it<0)) {
-           // path = SchemaPath.create(true);
-        }
-        String sxml =writeNormalizedNodetoXml(nn,path,schemaContext);
-        return sxml;
-    }
-    public  static String writeNormalizedNodetoXml(final NormalizedNode<?, ?> cn,
-                                                   final SchemaPath schemaPath, final SchemaContext schemaContext)
-    {
-
-        String serializationResultXMLString = null;
-        try {
-            //nn2xml
-            final Document doc = XmlDocumentUtils.getDocument();
-            final DOMResult serializationResult = new DOMResult(doc);
-            writeNormalizedNode(cn,serializationResult,schemaPath, schemaContext);
-            serializationResultXMLString = toString(serializationResult.getNode());
-        } catch (IOException |XMLStreamException e) {
-            e.printStackTrace();
-        }
-        return serializationResultXMLString;
-    }
-    public static void writeNormalizedNode(final NormalizedNode<?, ?> normalized, final DOMResult result,
-                                           final SchemaPath schemaPath, final SchemaContext context) throws IOException, XMLStreamException {
-        NormalizedNodeWriter normalizedNodeWriter = null;
-        NormalizedNodeStreamWriter normalizedNodeStreamWriter = null;
-        XMLStreamWriter writer = null;
-        try {
-            writer = XML_FACTORY.createXMLStreamWriter(result);
-            normalizedNodeStreamWriter = XMLStreamNormalizedNodeStreamWriter.create(writer, context, schemaPath);
-            normalizedNodeWriter = NormalizedNodeWriter.forStreamWriter(normalizedNodeStreamWriter);
-
-            normalizedNodeWriter.write(normalized);
-
-            normalizedNodeWriter.flush();
-        } finally {
-            if (normalizedNodeWriter != null) {
-                normalizedNodeWriter.close();
-            }
-            if (normalizedNodeStreamWriter != null) {
-                normalizedNodeStreamWriter.close();
-            }
-            if (writer != null) {
-                writer.close();
-            }
-        }
-    }
-    public static String toString(final Node xml) {
-        try {
-            final Transformer transformer = TransformerFactory.newInstance().newTransformer();
-            transformer.setOutputProperty(OutputKeys.INDENT, "yes");
-            transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4");
-            final StreamResult result = new StreamResult(new StringWriter());
-            final DOMSource source = new DOMSource(xml);
-            transformer.transform(source, result);
-            return result.getWriter().toString();
-        } catch (IllegalArgumentException | TransformerFactoryConfigurationError | TransformerException e) {
-            throw new RuntimeException("Unable to serialize xml element " + xml, e);
-        }
-    }
-}
diff --git a/common/src/main/java/org/openecomp/mso/yangDecoder/transform/impl/YangOdlNNC2XMLImpl.java b/common/src/main/java/org/openecomp/mso/yangDecoder/transform/impl/YangOdlNNC2XMLImpl.java
deleted file mode 100644
index 023a4a2..0000000
--- a/common/src/main/java/org/openecomp/mso/yangDecoder/transform/impl/YangOdlNNC2XMLImpl.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * 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.mso.yangDecoder.transform.impl;
-
-import com.google.common.base.Charsets;
-import org.opendaylight.netconf.sal.rest.impl.NormalizedNodeXmlBodyWriter;
-import org.opendaylight.netconf.sal.restconf.impl.ControllerContext;
-import org.opendaylight.netconf.sal.restconf.impl.InstanceIdentifierContext;
-import org.opendaylight.netconf.sal.restconf.impl.NormalizedNodeContext;
-import org.opendaylight.netconf.sal.restconf.impl.WriterParameters;
-
-import javax.ws.rs.core.MediaType;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.lang.reflect.Field;
-
-public class YangOdlNNC2XMLImpl {
-   final static MediaType mediaType=getMediaType();
-   static    protected MediaType getMediaType() {
-       return new MediaType(MediaType.APPLICATION_XML, null);
-   }
-   static Field requestField=getprettyPrintField();
-   
-   private static Field getprettyPrintField( ) 
-   {
-	    Field rf=null;
-		try {
-			rf = WriterParameters.class.getDeclaredField("prettyPrint");
-			  rf.setAccessible(true);
-		} catch (NoSuchFieldException | SecurityException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		}
-	   return rf;
-   }
-   public static String getXMLHeader()
-   {
-	   return "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>"+NormalizedNodePrinter.getEndl();
-   }
-    public static String toXML(final NormalizedNodeContext normalizedNodeContext) throws Exception
-    {
-        final NormalizedNodeXmlBodyWriter xmlBodyWriter = new NormalizedNodeXmlBodyWriter();
-        final OutputStream output = new ByteArrayOutputStream();
-        requestField.set(normalizedNodeContext.getWriterParameters(), true);
-        output.write(getXMLHeader().getBytes(Charsets.UTF_8));
-        xmlBodyWriter.writeTo(normalizedNodeContext, null, null, null,
-        		mediaType, null, output);
-        final String outputXML = output.toString();
-        return outputXML;
-    }
-    
-    public static NormalizedNodeContext fromXML(String uriPath,final  String xmlpayload,boolean ispost) throws Exception
-    {
-    	final InstanceIdentifierContext<?> iicontext = ControllerContext.getInstance().toInstanceIdentifier(uriPath);
-    	InputStream inputStream = new ByteArrayInputStream(xmlpayload.getBytes(Charsets.UTF_8));
-    	XmlNormalizedNodeBodyReaderUmeImpl xmlBodyReader = new XmlNormalizedNodeBodyReaderUmeImpl();
-    	xmlBodyReader.Set(iicontext, ispost);
-//    	final NormalizedNodeContext returnValue = xmlBodyReader.readFrom(iicontext, inputStream);
-        final NormalizedNodeContext returnValue = xmlBodyReader.readFrom(null,
-                null, null, mediaType, null, inputStream);
-        return returnValue; 
-    }
-
-}
diff --git a/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/camundabeans/BpmnRequest.java b/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/camundabeans/BpmnRequest.java
index f63e129..27a310f 100644
--- a/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/camundabeans/BpmnRequest.java
+++ b/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/camundabeans/BpmnRequest.java
@@ -40,11 +40,7 @@
 	CommonConstants.REQUEST_DETAILS_VARIABLE})
 @JsonRootName(CommonConstants.CAMUNDA_ROOT_INPUT)
 public class BpmnRequest {
-	
-	public BpmnRequest() {
-		
-	}
-	
+
 	@JsonProperty(CommonConstants.CAMUNDA_HOST)
 	private CamundaInput host;
 	
@@ -89,8 +85,11 @@
 	
 	@JsonProperty(CommonConstants.REQUEST_DETAILS_VARIABLE)
 	private CamundaInput requestDetails;
-	
-	
+
+	public BpmnRequest() {
+		/* Empty constructor */
+
+	}
 	
 	@JsonProperty(CommonConstants.CAMUNDA_HOST)
 	public CamundaInput getHost() {
@@ -246,9 +245,7 @@
 	
 	@Override
 	public String toString() {
-		//return "CamundaRequest [requestId=" +  + ", host="
-		//		+ host + ", schema=" + schema + ", reqid=" + reqid + ", svcid="
-			//	+ svcid + ", timeout=" + timeout + "]";
+
 		return "BpmnRequest";
 	}	
 	
diff --git a/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/camundabeans/CamundaBpmnRequestInput.java b/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/camundabeans/CamundaBpmnRequestInput.java
index 7c882be..f738296 100644
--- a/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/camundabeans/CamundaBpmnRequestInput.java
+++ b/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/camundabeans/CamundaBpmnRequestInput.java
@@ -21,7 +21,6 @@
 package org.openecomp.mso.apihandler.camundabeans;
 
 import org.codehaus.jackson.annotate.JsonProperty;
-import org.codehaus.jackson.map.annotate.JsonRootName;
 
 import org.openecomp.mso.apihandler.common.CommonConstants;
 
@@ -38,6 +37,7 @@
 
 
     public CamundaBpmnRequestInput() {
+        /* Empty constructor */
     }
 
     @JsonProperty(CommonConstants.CAMUNDA_VALUE)
diff --git a/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/camundabeans/CamundaInput.java b/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/camundabeans/CamundaInput.java
index 8a90db6..0c69a76 100644
--- a/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/camundabeans/CamundaInput.java
+++ b/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/camundabeans/CamundaInput.java
@@ -22,7 +22,6 @@
 
 
 import org.codehaus.jackson.annotate.JsonProperty;
-import org.codehaus.jackson.map.annotate.JsonRootName;
 
 import org.openecomp.mso.apihandler.common.CommonConstants;
 
@@ -42,6 +41,7 @@
 
 
 	public CamundaInput() {
+		/* Empty constructor */
 	}
 	
 	@JsonProperty(CommonConstants.CAMUNDA_VALUE)
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/MockRequestsDatabase.java b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/MockRequestsDatabase.java
index c4ded17..e3c7cda 100644
--- a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/MockRequestsDatabase.java
+++ b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/MockRequestsDatabase.java
@@ -60,10 +60,10 @@
 		InfraActiveRequests returnRecord = null;
 		if (record != null) {
 			String requestAction = record.getRequestAction();
-			if (requestAction == null || !requestAction.equals("GetLayer3ServiceDetailsRequest")) {
+			if (!"GetLayer3ServiceDetailsRequest".equals(requestAction)) {
 				String status = record.getRequestStatus();
-				if (status != null && status.equals("COMPLETED")) {
-					return returnRecord = record;
+				if ("COMPLETED".equals(status)) {
+					returnRecord = record;
 				}
 			}
 		}
diff --git a/packages/arquillian-unit-tests/src/test/resources/docker/mso/mso-docker.json b/packages/arquillian-unit-tests/src/test/resources/docker/mso/mso-docker.json
index 5552efe..3d24819 100644
--- a/packages/arquillian-unit-tests/src/test/resources/docker/mso/mso-docker.json
+++ b/packages/arquillian-unit-tests/src/test/resources/docker/mso/mso-docker.json
@@ -59,7 +59,10 @@
                 "https://localhost:8443/restconf/operations/Firewall-API:",
                 "https://localhost:8443/restconf/config",
                 "https://localhost:8443/restconf/operations/VNF-API:",
-                "https://localhost:8443/restconf/operations/NBNC-API:"
+                "https://localhost:8443/restconf/operations/NBNC-API:",
+                "https://localhost:8443/restconf/operations/NORTHBOUND-API:service-topology-operation",
+                "https://localhost:8443/restconf/operations/GENERIC-RESOURCE-API:",
+                "https://localhost:8443/restconf/operations/VNFTOPOLOGYAIC-API:"
             ],
 
             "bpelurl": "http://mso:8080/mso/SDNCAdapterCallbackService",
diff --git a/packages/docker/src/main/docker/docker-files/Dockerfile.mso-chef-final b/packages/docker/src/main/docker/docker-files/Dockerfile.mso-chef-final
index 2e227be..8238923 100644
--- a/packages/docker/src/main/docker/docker-files/Dockerfile.mso-chef-final
+++ b/packages/docker/src/main/docker/docker-files/Dockerfile.mso-chef-final
@@ -81,6 +81,12 @@
 
 RUN mkdir -p /etc/mso/config.d/ASDC && chown -R jboss:jboss /etc/mso/config.d/ASDC && chmod u+xrw /etc/mso/config.d/ASDC
 
+## Install heatbridge
+RUN apt-get install -y python && apt-get install -y python-pip && echo 'PIP Installed, doing upgrade' && pip install --upgrade pip
+RUN mkdir /opt/mso/heatbridge
+COPY heatbridge/heatbridge-0.3.0.dev0-py2-none-any.whl /opt/mso/heatbridge
+RUN pip install /opt/mso/heatbridge/heatbridge-0.3.0.dev0-py2-none-any.whl
+
 ### Open Ports
 EXPOSE 8080
 
diff --git a/packages/docker/src/main/docker/docker-files/heatbridge/heatbridge-0.3.0.dev0-py2-none-any.whl b/packages/docker/src/main/docker/docker-files/heatbridge/heatbridge-0.3.0.dev0-py2-none-any.whl
new file mode 100644
index 0000000..357a669
--- /dev/null
+++ b/packages/docker/src/main/docker/docker-files/heatbridge/heatbridge-0.3.0.dev0-py2-none-any.whl
Binary files differ
