diff --git a/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/cloud/CloudIdentity.java b/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/cloud/CloudIdentity.java
index ba9a7d5..3dd4cbf 100644
--- a/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/cloud/CloudIdentity.java
+++ b/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/cloud/CloudIdentity.java
@@ -227,29 +227,18 @@
 	public void setIdentityAuthenticationType(IdentityAuthenticationType identityAuthenticationType) {
 		this.identityAuthenticationType = identityAuthenticationType;
 	}
-	
+
 	@Override
     public String toString () {
-        StringBuilder stringBuilder = new StringBuilder ();
-        stringBuilder.append ("Cloud Identity Service: id=")
-                     .append (id)
-                     .append (", identityUrl=")
-                     .append (this.identityUrl)
-                     .append (", msoId=")
-                     .append (msoId)
-                     .append (", adminTenant=")
-                     .append (adminTenant)
-                     .append (", memberRole=")
-                     .append (memberRole)
-                     .append (", tenantMetadata=")
-                     .append (tenantMetadata)
-                     .append (", identityServerType=")
-                     .append (identityServerType == null ? "null" : identityServerType.toString())
-                     .append (", identityAuthenticationType=")
-                     .append (identityAuthenticationType == null ? "null" : identityAuthenticationType.toString());
-        
-        return stringBuilder.toString ();
-    }
+		return "Cloud Identity Service: id=" + id +
+			", identityUrl=" + this.identityUrl +
+			", msoId=" + msoId +
+			", adminTenant=" + adminTenant +
+			", memberRole=" + memberRole +
+			", tenantMetadata=" + tenantMetadata +
+			", identityServerType=" + (identityServerType == null ? "null" : identityServerType.toString()) +
+			", identityAuthenticationType=" + (identityAuthenticationType == null ? "null" : identityAuthenticationType.toString());
+	}
 
     public static String encryptPassword (String msoPass) {
         try {
diff --git a/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/beans/NetworkInfo.java b/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/beans/NetworkInfo.java
index 2cda8f9..64460b2 100644
--- a/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/beans/NetworkInfo.java
+++ b/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/beans/NetworkInfo.java
@@ -139,15 +139,13 @@
 
 	@Override
 	public String toString() {
-		final StringBuilder sb = new StringBuilder("NetworkInfo{");
-		sb.append("name='").append(name).append('\'');
-		sb.append(", id='").append(id).append('\'');
-		sb.append(", status=").append(status);
-		sb.append(", provider='").append(provider).append('\'');
-		sb.append(", vlans=").append(vlans);
-		sb.append(", subnets=").append(subnets);
-		sb.append('}');
-		return sb.toString();
+		return "NetworkInfo{" + "name='" + name + '\'' +
+			", id='" + id + '\'' +
+			", status=" + status +
+			", provider='" + provider + '\'' +
+			", vlans=" + vlans +
+			", subnets=" + subnets +
+			'}';
 	}
 }
 
diff --git a/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/exceptions/MsoOpenstackException.java b/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/exceptions/MsoOpenstackException.java
index 8aa8d3f..eead843 100644
--- a/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/exceptions/MsoOpenstackException.java
+++ b/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/exceptions/MsoOpenstackException.java
@@ -68,16 +68,13 @@
 		this.statusMessage = message;
 		this.errorDetail = detail;
 	}
-	
+
 	@Override
-	public String toString () {
-		StringBuilder error = new StringBuilder();
-		error.append("");
-		error.append(statusCode);
-		error.append(" ");
-		error.append(statusMessage);
-		error.append(": ");
-		error.append(errorDetail);
-		return error.toString();
+	public String toString() {
+		return statusCode +
+			" " +
+			statusMessage +
+			": " +
+			errorDetail;
 	}
 }
diff --git a/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoHeatEnvironmentEntry.java b/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoHeatEnvironmentEntry.java
index 69da437..04dbf52 100644
--- a/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoHeatEnvironmentEntry.java
+++ b/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoHeatEnvironmentEntry.java
@@ -65,11 +65,9 @@
 
 	@Override
 	public String toString() {
-		final StringBuilder sb = new StringBuilder("MsoHeatEnvironmentEntry{");
-		sb.append("parameters=").append(parameters);
-		sb.append(", resourceRegistryEntryRaw='").append(resourceRegistryEntryRaw).append('\'');
-		sb.append('}');
-		return sb.toString();
+		return "MsoHeatEnvironmentEntry{" + "parameters=" + parameters +
+			", resourceRegistryEntryRaw='" + resourceRegistryEntryRaw + '\'' +
+			'}';
 	}
 
 	public String getRawEntry() {
diff --git a/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoHeatEnvironmentResource.java b/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoHeatEnvironmentResource.java
index a2e605f..a0c9b7a 100644
--- a/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoHeatEnvironmentResource.java
+++ b/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoHeatEnvironmentResource.java
@@ -59,12 +59,10 @@
 
 	@Override
 	public String toString() {
-		StringBuilder str = new StringBuilder();
-		str.append("\"");
-		str.append(this.name);
-		str.append("\": ");
-		str.append(this.value);
-		return str.toString();
+		return "\"" +
+			this.name +
+			"\": " +
+			this.value;
 	}
 
 	@Override
diff --git a/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoHeatUtils.java b/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoHeatUtils.java
index 9fe2d4c..c438d0a 100644
--- a/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoHeatUtils.java
+++ b/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoHeatUtils.java
@@ -1106,11 +1106,8 @@
         }
 
         public boolean isExpired () {
-            if (expires == null) {
-                return true;
-            }
+            return expires == null || System.currentTimeMillis() > expires.getTimeInMillis();
 
-            return System.currentTimeMillis() > expires.getTimeInMillis();
         }
     }
 
@@ -1439,7 +1436,7 @@
 		
 		if (inputs == null) {
 			LOGGER.debug("convertInputMap - inputs is null - nothing to do here");
-			return new HashMap<String, Object>();
+			return new HashMap<>();
 		}
 		
 		LOGGER.debug("convertInputMap in MsoHeatUtils called, with " + inputs.size() + " inputs, and template " + template.getArtifactUuid());
diff --git a/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoHeatUtilsWithUpdate.java b/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoHeatUtilsWithUpdate.java
index 0e0b9cb..f7e67d8 100644
--- a/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoHeatUtilsWithUpdate.java
+++ b/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoHeatUtilsWithUpdate.java
@@ -230,7 +230,7 @@
         if (haveFiles && haveHeatFiles) {
             // Let's do this here - not in the bean
             LOGGER.debug ("Found files AND heatFiles - combine and add!");
-            Map <String, Object> combinedFiles = new HashMap <String, Object> ();
+            Map <String, Object> combinedFiles = new HashMap<>();
             for (String keyString : files.keySet ()) {
                 combinedFiles.put (keyString, files.get (keyString));
             }
@@ -358,7 +358,7 @@
 			sb.append("(outputs is empty)");
 			return sb;
 		}
-		Map<String, Object> outputs = new HashMap<String,Object>();
+		Map<String, Object> outputs = new HashMap<>();
 		for (Output outputItem : outputList) {
 			outputs.put(outputItem.getOutputKey(), outputItem.getOutputValue());
 		}
diff --git a/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoKeystoneUtils.java b/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoKeystoneUtils.java
index be36d67..3b71003 100644
--- a/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoKeystoneUtils.java
+++ b/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoKeystoneUtils.java
@@ -209,7 +209,7 @@
                 return null;
             }
 
-            Map <String, String> metadata = new HashMap <String, String> ();
+            Map <String, String> metadata = new HashMap<>();
             if (cloudSite.getIdentityService ().hasTenantMetadata ()) {
                 OpenStackRequest <Metadata> request = keystoneAdminClient.tenants ().showMetadata (tenant.getId ());
                 Metadata tenantMetadata = executeAndRecordOpenstackRequest (request, msoProps);
@@ -255,7 +255,7 @@
                 return null;
             }
 
-            Map <String, String> metadata = new HashMap <String, String> ();
+            Map <String, String> metadata = new HashMap<>();
             if (cloudSite.getIdentityService ().hasTenantMetadata ()) {
                 OpenStackRequest <Metadata> request = keystoneAdminClient.tenants ().showMetadata (tenant.getId ());
                 Metadata tenantMetadata = executeAndRecordOpenstackRequest (request, msoProps);
@@ -567,11 +567,8 @@
         }
 
         public boolean isExpired () {
-            if (expires == null) {
-                return true;
-            }
+            return expires == null || System.currentTimeMillis() > expires.getTimeInMillis();
 
-            return System.currentTimeMillis() > expires.getTimeInMillis();
         }
     }
 
diff --git a/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoNeutronUtils.java b/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoNeutronUtils.java
index 50a5946..9eba799 100644
--- a/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoNeutronUtils.java
+++ b/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoNeutronUtils.java
@@ -63,7 +63,7 @@
 	// token will be used until it expires.
 	//
 	// The cache key is "tenantId:cloudId"
-	private static Map<String,NeutronCacheEntry> neutronClientCache = new HashMap<String,NeutronCacheEntry>();
+	private static Map<String,NeutronCacheEntry> neutronClientCache = new HashMap<>();
 
 	// Fetch cloud configuration each time (may be cached in CloudConfig class)
 	private CloudConfig cloudConfig;
@@ -129,7 +129,7 @@
 			}
 		} else if (type == NetworkType.MULTI_PROVIDER) {
 			if (provider != null && vlans != null && vlans.size() > 0) {
-				List<Segment> segments = new ArrayList<Segment>(vlans.size());
+				List<Segment> segments = new ArrayList<>(vlans.size());
 				for (int vlan : vlans) {
 					Segment segment = new Segment();
 					segment.setProviderPhysicalNetwork (provider);
@@ -297,7 +297,7 @@
 			}
 		} else if (type == NetworkType.MULTI_PROVIDER) {
 			if (provider != null && vlans != null && vlans.size() > 0) {
-				List<Segment> segments = new ArrayList<Segment>(vlans.size());
+				List<Segment> segments = new ArrayList<>(vlans.size());
 				for (int vlan : vlans) {
 					Segment segment = new Segment();
 					segment.setProviderPhysicalNetwork (provider);
@@ -559,11 +559,7 @@
 		}
 
 		public boolean isExpired() {
-			if (expires == null) {
-                return true;
-            }
-
-            return System.currentTimeMillis() > expires.getTimeInMillis();
+			return expires == null || System.currentTimeMillis() > expires.getTimeInMillis();
 		}
 	}
 
diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/adapter_utils/tests/MsoHeatUtilsTest.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/adapter_utils/tests/MsoHeatUtilsTest.java
index 6fd95d5..c2d4f9b 100644
--- a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/adapter_utils/tests/MsoHeatUtilsTest.java
+++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/adapter_utils/tests/MsoHeatUtilsTest.java
@@ -60,7 +60,7 @@
 	public final void testCreateStackBadCloudConfig()
 			throws MsoStackAlreadyExists, MsoTenantNotFound, MsoException, MsoCloudSiteNotFound {
 		try {
-			msoHeatUtils.createStack("DOESNOTEXIST", "test", "stackName", "test", new HashMap<String, Object>(),
+			msoHeatUtils.createStack("DOESNOTEXIST", "test", "stackName", "test", new HashMap<>(),
 					Boolean.TRUE, 10);
 		} catch (MsoCloudSiteNotFound e) {
 
@@ -74,7 +74,7 @@
 	public final void testCreateStackFailedConnectionHeatClient()
 			throws MsoStackAlreadyExists, MsoTenantNotFound, MsoException, MsoCloudSiteNotFound {
 		try {
-			msoHeatUtils.createStack("MT", "test", "stackName", "test", new HashMap<String, Object>(), Boolean.TRUE,
+			msoHeatUtils.createStack("MT", "test", "stackName", "test", new HashMap<>(), Boolean.TRUE,
 					10);
 		} catch (MsoIOException e) {
 
@@ -86,7 +86,7 @@
 	public final void testCreateStackFailedConnection()
 			throws MsoStackAlreadyExists, MsoTenantNotFound, MsoException, MsoCloudSiteNotFound {
 		try {
-			msoHeatUtils.createStack("MT", "test", "stackName", "test", new HashMap<String, Object>(), Boolean.TRUE,
+			msoHeatUtils.createStack("MT", "test", "stackName", "test", new HashMap<>(), Boolean.TRUE,
 					10);
 		} catch (MsoIOException e) {
 
@@ -97,7 +97,7 @@
 	@Test
 	public final void createStackSuccessWithEnvironment() throws MsoException {
 		try {
-			msoHeatUtils.createStack("MT", "test", "stackName", "test", new HashMap<String, Object>(), Boolean.TRUE, 10,
+			msoHeatUtils.createStack("MT", "test", "stackName", "test", new HashMap<>(), Boolean.TRUE, 10,
 					"environment");
 		} catch (MsoIOException e) {
 
@@ -108,8 +108,8 @@
 	@Test
 	public final void createStackSuccessWithFiles() throws MsoException {
 		try {
-			msoHeatUtils.createStack("MT", "test", "stackName", "test", new HashMap<String, Object>(), Boolean.TRUE, 10,
-					"environment", new HashMap<String, Object>());
+			msoHeatUtils.createStack("MT", "test", "stackName", "test", new HashMap<>(), Boolean.TRUE, 10,
+					"environment", new HashMap<>());
 		} catch (MsoIOException e) {
 
 		}
@@ -119,8 +119,8 @@
 	@Test
 	public final void createStackSuccessWithHeatFiles() throws MsoException {
 		try {
-			msoHeatUtils.createStack("MT", "test", "stackName", "test", new HashMap<String, Object>(), Boolean.TRUE, 10,
-					"environment", new HashMap<String, Object>(), new HashMap<String, Object>());
+			msoHeatUtils.createStack("MT", "test", "stackName", "test", new HashMap<>(), Boolean.TRUE, 10,
+					"environment", new HashMap<>(), new HashMap<>());
 		} catch (MsoIOException e) {
 
 		}
@@ -131,7 +131,7 @@
 		CreateStackParam param = new CreateStackParam();
 		param.setDisableRollback(false);
 		param.setEnvironment("environment");
-		param.setFiles(new HashMap<String, Object>());
+		param.setFiles(new HashMap<>());
 		param.setParameters(new HashMap<>());
 		param.setStackName("stackName");
 		param.setTemplate("template");
diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/CatalogDbAdapterRest.java b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/CatalogDbAdapterRest.java
index bcf2ab3..d0d3999 100644
--- a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/CatalogDbAdapterRest.java
+++ b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/CatalogDbAdapterRest.java
@@ -430,45 +430,46 @@
 		QueryVfModule qryResp;
 		int respStatus = HttpStatus.SC_OK;
 		List<VfModuleCustomization> ret = null;
-		CatalogDatabase db = CatalogDatabase.getInstance();
 
-		try{
-			if(vfModuleModelName != null && !"".equals(vfModuleModelName)){
-				LOGGER.debug ("Query vfModules by vfModuleModuleName: " + vfModuleModelName);
-				VfModuleCustomization vfModule = db.getVfModuleCustomizationByModelName(vfModuleModelName);
-				if(vfModule != null){
-					ret = new ArrayList<>(1);
-					ret.add(vfModule);
-				}
-			}else{
-				throw(new Exception("Incoming parameter is null or blank"));
-			}
-			if(ret == null || ret.isEmpty()){
-				LOGGER.debug ("vfModules not found");
-				respStatus = HttpStatus.SC_NOT_FOUND;
-				qryResp = new QueryVfModule();
-			}else{
-				LOGGER.debug ("vfModules found");
-				qryResp = new QueryVfModule(ret);
-				LOGGER.debug ("vfModules query Results is: "+ qryResp);
-				LOGGER.debug ("vfModules tojsonstring is: "+ qryResp.JSON2(false, false));
-			}
-			LOGGER.debug ("Query vfModules exit");
-			return Response
-					.status(respStatus)
-					.entity(qryResp.JSON2(false, false)) 
-					.header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
-					.build();
-		}catch(Exception e){
-			LOGGER.error (MessageEnum.RA_QUERY_VNF_ERR,  vfModuleModelName, "", "queryVfModules", MsoLogger.ErrorCode.BusinessProcesssError, "Exception during query VfModules by vfModuleModuleName: ", e);
-			CatalogQueryException excResp = new CatalogQueryException(e.getMessage(), CatalogQueryExceptionCategory.INTERNAL, Boolean.FALSE, null);
-			return Response
-					.status(HttpStatus.SC_INTERNAL_SERVER_ERROR)
-					.entity(new GenericEntity<CatalogQueryException>(excResp) {})
-					.build();
-		}finally {
-			db.close();
-		}
+        try (CatalogDatabase db = CatalogDatabase.getInstance()) {
+            if (vfModuleModelName != null && !"".equals(vfModuleModelName)) {
+                LOGGER.debug("Query vfModules by vfModuleModuleName: " + vfModuleModelName);
+                VfModuleCustomization vfModule = db.getVfModuleCustomizationByModelName(vfModuleModelName);
+                if (vfModule != null) {
+                    ret = new ArrayList<>(1);
+                    ret.add(vfModule);
+                }
+            } else {
+                throw (new Exception("Incoming parameter is null or blank"));
+            }
+            if (ret == null || ret.isEmpty()) {
+                LOGGER.debug("vfModules not found");
+                respStatus = HttpStatus.SC_NOT_FOUND;
+                qryResp = new QueryVfModule();
+            } else {
+                LOGGER.debug("vfModules found");
+                qryResp = new QueryVfModule(ret);
+                LOGGER.debug("vfModules query Results is: " + qryResp);
+                LOGGER.debug("vfModules tojsonstring is: " + qryResp.JSON2(false, false));
+            }
+            LOGGER.debug("Query vfModules exit");
+            return Response
+                .status(respStatus)
+                .entity(qryResp.JSON2(false, false))
+                .header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
+                .build();
+        } catch (Exception e) {
+            LOGGER.error(MessageEnum.RA_QUERY_VNF_ERR, vfModuleModelName, "", "queryVfModules",
+                MsoLogger.ErrorCode.BusinessProcesssError, "Exception during query VfModules by vfModuleModuleName: ",
+                e);
+            CatalogQueryException excResp = new CatalogQueryException(e.getMessage(),
+                CatalogQueryExceptionCategory.INTERNAL, Boolean.FALSE, null);
+            return Response
+                .status(HttpStatus.SC_INTERNAL_SERVER_ERROR)
+                .entity(new GenericEntity<CatalogQueryException>(excResp) {
+                })
+                .build();
+        }
 	}
 
 	/**
@@ -484,37 +485,36 @@
     @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
     public Response serviceToscaCsar(@QueryParam("serviceModelUuid") String smUuid) {
         int respStatus = HttpStatus.SC_OK;
-        CatalogDatabase db = CatalogDatabase.getInstance();
         String entity = "";
-        try{
-            if(smUuid != null && !"".equals(smUuid)){
-                LOGGER.debug ("Query Csar by service model uuid: " + smUuid);
+        try (CatalogDatabase db = CatalogDatabase.getInstance()) {
+            if (smUuid != null && !"".equals(smUuid)) {
+                LOGGER.debug("Query Csar by service model uuid: " + smUuid);
                 ToscaCsar toscaCsar = db.getToscaCsarByServiceModelUUID(smUuid);
-                if(toscaCsar != null){
+                if (toscaCsar != null) {
                     QueryServiceCsar serviceCsar = new QueryServiceCsar(toscaCsar);
                     entity = serviceCsar.JSON2(false, false);
-                }
-                else{
+                } else {
                     respStatus = HttpStatus.SC_NOT_FOUND;
                 }
-            }else{
-                throw(new Exception("Incoming parameter is null or blank"));
-            }           
-            LOGGER.debug ("Query Csar exit");
+            } else {
+                throw (new Exception("Incoming parameter is null or blank"));
+            }
+            LOGGER.debug("Query Csar exit");
             return Response
-                    .status(respStatus)
-                    .entity(entity) 
-                    .header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
-                    .build();
-        }catch(Exception e){
-            LOGGER.error (MessageEnum.RA_QUERY_VNF_ERR,  smUuid, "", "ServiceToscaCsar", MsoLogger.ErrorCode.BusinessProcesssError, "Exception during query csar by service model uuid: ", e);
-            CatalogQueryException excResp = new CatalogQueryException(e.getMessage(), CatalogQueryExceptionCategory.INTERNAL, Boolean.FALSE, null);
+                .status(respStatus)
+                .entity(entity)
+                .header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
+                .build();
+        } catch (Exception e) {
+            LOGGER.error(MessageEnum.RA_QUERY_VNF_ERR, smUuid, "", "ServiceToscaCsar",
+                MsoLogger.ErrorCode.BusinessProcesssError, "Exception during query csar by service model uuid: ", e);
+            CatalogQueryException excResp = new CatalogQueryException(e.getMessage(),
+                CatalogQueryExceptionCategory.INTERNAL, Boolean.FALSE, null);
             return Response
-                    .status(HttpStatus.SC_INTERNAL_SERVER_ERROR)
-                    .entity(new GenericEntity<CatalogQueryException>(excResp) {})
-                    .build();
-        }finally {
-            db.close();
+                .status(HttpStatus.SC_INTERNAL_SERVER_ERROR)
+                .entity(new GenericEntity<CatalogQueryException>(excResp) {
+                })
+                .build();
         }
     }
     
diff --git a/adapters/mso-catalog-db-adapter/src/test/java/org/openecomp/mso/adapters/catalogdb/CatalogDbAdapterRestClassTest.java b/adapters/mso-catalog-db-adapter/src/test/java/org/openecomp/mso/adapters/catalogdb/CatalogDbAdapterRestClassTest.java
index 31a5832..3159490 100644
--- a/adapters/mso-catalog-db-adapter/src/test/java/org/openecomp/mso/adapters/catalogdb/CatalogDbAdapterRestClassTest.java
+++ b/adapters/mso-catalog-db-adapter/src/test/java/org/openecomp/mso/adapters/catalogdb/CatalogDbAdapterRestClassTest.java
@@ -70,7 +70,7 @@
 		 * 
 		 */
     	// set up mock return value
-        paramList = new ArrayList<VnfResourceCustomization>();
+        paramList = new ArrayList<>();
         VnfResourceCustomization d1 = new VnfResourceCustomization();
         d1.setModelCustomizationUuid("16ea3e56-a8ce-4ad7-8edd-4d2eae095391");
         d1.setModelInstanceName("ciVFOnboarded-FNAT-aab06c41 1");
diff --git a/adapters/mso-catalog-db-adapter/src/test/java/org/openecomp/mso/adapters/catalogdb/CatalogDbAdapterRestHttpTest.java b/adapters/mso-catalog-db-adapter/src/test/java/org/openecomp/mso/adapters/catalogdb/CatalogDbAdapterRestHttpTest.java
index 33f5553..ae5e663 100644
--- a/adapters/mso-catalog-db-adapter/src/test/java/org/openecomp/mso/adapters/catalogdb/CatalogDbAdapterRestHttpTest.java
+++ b/adapters/mso-catalog-db-adapter/src/test/java/org/openecomp/mso/adapters/catalogdb/CatalogDbAdapterRestHttpTest.java
@@ -114,7 +114,7 @@
     	try {
     	    List<VnfResourceCustomization> paramList;    		
         	// set up mock return value
-            paramList = new ArrayList<VnfResourceCustomization>();
+            paramList = new ArrayList<>();
             VnfResourceCustomization d1 = new VnfResourceCustomization();
             d1.setModelCustomizationUuid("16ea3e56-a8ce-4ad7-8edd-4d2eae095391");
             d1.setModelInstanceName("RG_6-26_mog11 0");
@@ -154,7 +154,7 @@
     	try {
     	    List<VnfResourceCustomization> paramList;    		
         	// set up mock return value
-            paramList = new ArrayList<VnfResourceCustomization>();
+            paramList = new ArrayList<>();
             VnfResourceCustomization d1 = new VnfResourceCustomization();
             d1.setVnfResourceModelUuid("16ea3e56-a8ce-4ad7-8edd-4d2eae095391");
             d1.setModelInstanceName("RG_6-26_mog11 0");
@@ -198,7 +198,7 @@
     	try {
     	    List<VnfResourceCustomization> paramList;    		
         	// set up mock return value
-            paramList = new ArrayList<VnfResourceCustomization>();
+            paramList = new ArrayList<>();
             VnfResourceCustomization d1 = new VnfResourceCustomization();
             d1.setModelCustomizationUuid("16ea3e56-a8ce-4ad7-8edd-4d2eae095391");
             d1.setModelInstanceName("RG_6-26_mog11 0");
@@ -242,7 +242,7 @@
     	try {
     	    List<NetworkResourceCustomization> paramList;    		
         	// set up mock return value
-            paramList = new ArrayList<NetworkResourceCustomization>();
+            paramList = new ArrayList<>();
             NetworkResourceCustomization d1 = new NetworkResourceCustomization();
             d1.setNetworkResourceModelUuid("0cb9b26a-9820-48a7-86e5-16c510e993d9");
             paramList.add(d1);
@@ -282,7 +282,7 @@
     	try {
     	    List<NetworkResourceCustomization> paramList;    		
         	// set up mock return value
-            paramList = new ArrayList<NetworkResourceCustomization>();
+            paramList = new ArrayList<>();
             NetworkResourceCustomization d1 = new NetworkResourceCustomization();
             d1.setNetworkResourceModelUuid("0cb9b26a-9820-48a7-86e5-16c510e993d9");
             paramList.add(d1);
@@ -322,7 +322,7 @@
     	try {
     	    ArrayList<NetworkResourceCustomization> paramList;    		
         	// set up mock return value
-            paramList = new ArrayList<NetworkResourceCustomization>();
+            paramList = new ArrayList<>();
             NetworkResourceCustomization d1 = new NetworkResourceCustomization();
             d1.setNetworkResourceModelUuid("0cb9b26a-9820-48a7-86e5-16c510e993d9");
             paramList.add(d1);
@@ -367,7 +367,7 @@
     	try {
     	    List<AllottedResourceCustomization> paramList;    		
         	// set up mock return value
-            paramList = new ArrayList<AllottedResourceCustomization>();
+            paramList = new ArrayList<>();
             AllottedResourceCustomization d1 = new AllottedResourceCustomization();
             d1.setArModelUuid("0cb9b26a-9820-48a7-86e5-16c510e993d9");
             paramList.add(d1);
@@ -409,7 +409,7 @@
     	try {
     	    List<AllottedResourceCustomization> paramList;    		
         	// set up mock return value
-            paramList = new ArrayList<AllottedResourceCustomization>();
+            paramList = new ArrayList<>();
             AllottedResourceCustomization d1 = new AllottedResourceCustomization();
             d1.setArModelUuid("0cb9b26a-9820-48a7-86e5-16c510e993d9");
             paramList.add(d1);
diff --git a/adapters/mso-catalog-db-adapter/src/test/java/org/openecomp/mso/adapters/catalogdb/catalogrest/CatalogQueryTest.java b/adapters/mso-catalog-db-adapter/src/test/java/org/openecomp/mso/adapters/catalogdb/catalogrest/CatalogQueryTest.java
index 31e828d..ee2c8db 100644
--- a/adapters/mso-catalog-db-adapter/src/test/java/org/openecomp/mso/adapters/catalogdb/catalogrest/CatalogQueryTest.java
+++ b/adapters/mso-catalog-db-adapter/src/test/java/org/openecomp/mso/adapters/catalogdb/catalogrest/CatalogQueryTest.java
@@ -49,7 +49,7 @@
 		CatalogQuery mockCatalogQuery = Mockito.mock(CatalogQuery.class);
 		Mockito.doCallRealMethod().when(mockCatalogQuery).setTemplate(Mockito.anyString(), Mockito.anyMapOf(String.class, String.class));
 		
-		Map<String,String> valueMap = new HashMap<String,String>();
+		Map<String,String> valueMap = new HashMap<>();
 		valueMap.put("somekey", "somevalue");
 		
 		String ret = mockCatalogQuery.setTemplate("<somekey>", valueMap);
@@ -60,7 +60,7 @@
 	@Test
 	public void smartToJson_Test()
 	{
-        List<VnfResourceCustomization> paramList = new ArrayList<VnfResourceCustomization>();
+        List<VnfResourceCustomization> paramList = new ArrayList<>();
         VnfResourceCustomization d1 = new VnfResourceCustomization();
         d1.setModelCustomizationUuid("16ea3e56-a8ce-4ad7-8edd-4d2eae095391");
         d1.setModelInstanceName("RG_6-26_mog11 0");
diff --git a/adapters/mso-catalog-db-adapter/src/test/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryAllottedResourceCustomizationTest.java b/adapters/mso-catalog-db-adapter/src/test/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryAllottedResourceCustomizationTest.java
index 71352b5..0d86a6c 100644
--- a/adapters/mso-catalog-db-adapter/src/test/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryAllottedResourceCustomizationTest.java
+++ b/adapters/mso-catalog-db-adapter/src/test/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryAllottedResourceCustomizationTest.java
@@ -43,7 +43,7 @@
 	public void JSON2_Test()
 	{
 	    List<AllottedResourceCustomization> paramList;    		
-        paramList = new ArrayList<AllottedResourceCustomization>();
+        paramList = new ArrayList<>();
         AllottedResourceCustomization d1 = new AllottedResourceCustomization();
         d1.setModelInstanceName("0cb9b26a-9820-48a7-86e5-16c510e993d9");
         d1.setModelCustomizationUuid("16ea3e56-a8ce-4ad7-8edd-4d2eae095391");
diff --git a/adapters/mso-catalog-db-adapter/src/test/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceMarcoHolderTest.java b/adapters/mso-catalog-db-adapter/src/test/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceMarcoHolderTest.java
index dfbc2dc..3a767a8 100644
--- a/adapters/mso-catalog-db-adapter/src/test/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceMarcoHolderTest.java
+++ b/adapters/mso-catalog-db-adapter/src/test/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceMarcoHolderTest.java
@@ -47,7 +47,7 @@
 		svc.setModelUUID("0cb9b26a-9820-48a7-86e5-16c510e993d9");
 		svc.setModelName("Testing Model One");
 	    ArrayList<NetworkResourceCustomization> paramList;    		
-        paramList = new ArrayList<NetworkResourceCustomization>();
+        paramList = new ArrayList<>();
         NetworkResourceCustomization d1 = new NetworkResourceCustomization();
         d1.setNetworkResourceModelUuid("0cb9b26a-9820-48a7-86e5-16c510e993d9");
         paramList.add(d1);
diff --git a/adapters/mso-catalog-db-adapter/src/test/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceNetworksTest.java b/adapters/mso-catalog-db-adapter/src/test/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceNetworksTest.java
index b237dbe..1c855ea 100644
--- a/adapters/mso-catalog-db-adapter/src/test/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceNetworksTest.java
+++ b/adapters/mso-catalog-db-adapter/src/test/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceNetworksTest.java
@@ -45,7 +45,7 @@
 	public void JSON2_Test()
 	{
 	    ArrayList<NetworkResourceCustomization> paramList;    		
-        paramList = new ArrayList<NetworkResourceCustomization>();
+        paramList = new ArrayList<>();
         NetworkResourceCustomization d1 = new NetworkResourceCustomization();
         d1.setModelInstanceName("0cb9b26a-9820-48a7-86e5-16c510e993d9");
         paramList.add(d1);
diff --git a/adapters/mso-catalog-db-adapter/src/test/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceVnfsTest.java b/adapters/mso-catalog-db-adapter/src/test/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceVnfsTest.java
index 262fe06..8c8fc96 100644
--- a/adapters/mso-catalog-db-adapter/src/test/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceVnfsTest.java
+++ b/adapters/mso-catalog-db-adapter/src/test/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceVnfsTest.java
@@ -44,7 +44,7 @@
 	public void JSON2_Test()
 	{
 	    List<VnfResourceCustomization> paramList;    		
-        paramList = new ArrayList<VnfResourceCustomization>();
+        paramList = new ArrayList<>();
         VnfResourceCustomization d1 = new VnfResourceCustomization();
         d1.setModelInstanceName("0cb9b26a-9820-48a7-86e5-16c510e993d9");
         d1.setVnfResourceModelUuid("0cb9b26a-9820-48a7-86e5-16c510e993d9");
diff --git a/adapters/mso-network-adapter/src/main/java/org/openecomp/mso/adapters/network/MsoNetworkAdapterImpl.java b/adapters/mso-network-adapter/src/main/java/org/openecomp/mso/adapters/network/MsoNetworkAdapterImpl.java
index 82684bd..6063956 100644
--- a/adapters/mso-network-adapter/src/main/java/org/openecomp/mso/adapters/network/MsoNetworkAdapterImpl.java
+++ b/adapters/mso-network-adapter/src/main/java/org/openecomp/mso/adapters/network/MsoNetworkAdapterImpl.java
@@ -288,39 +288,45 @@
         }
 
         // Get a handle to the Catalog Database
-        CatalogDatabase db = getCatalogDB ();
 
         // Make sure DB connection is always closed
-        try {
-            NetworkResource networkResource = networkCheck (db,
-                                                            startTime,
-                                                            networkType,
-                                                            modelCustomizationUuid,
-                                                            networkName,
-                                                            physicalNetworkName,
-                                                            vlans,
-                                                            routeTargets,
-                                                            cloudSiteOpt.get());
-            String mode = networkResource.getOrchestrationMode ();
-            NetworkType neutronNetworkType = NetworkType.valueOf (networkResource.getNeutronNetworkType ());
+        try (CatalogDatabase db = getCatalogDB()) {
+            NetworkResource networkResource = networkCheck(db,
+                startTime,
+                networkType,
+                modelCustomizationUuid,
+                networkName,
+                physicalNetworkName,
+                vlans,
+                routeTargets,
+                cloudSiteOpt.get());
+            String mode = networkResource.getOrchestrationMode();
+            NetworkType neutronNetworkType = NetworkType.valueOf(networkResource.getNeutronNetworkType());
 
-            if (NEUTRON_MODE.equals (mode)) {
+            if (NEUTRON_MODE.equals(mode)) {
 
                 // Use an MsoNeutronUtils for all neutron commands
-                MsoNeutronUtils neutron = new MsoNeutronUtils (MSO_PROP_NETWORK_ADAPTER, cloudConfigFactory);
+                MsoNeutronUtils neutron = new MsoNeutronUtils(MSO_PROP_NETWORK_ADAPTER, cloudConfigFactory);
 
                 // See if the Network already exists (by name)
                 NetworkInfo netInfo = null;
-                long queryNetworkStarttime = System.currentTimeMillis ();
+                long queryNetworkStarttime = System.currentTimeMillis();
                 try {
-                    netInfo = neutron.queryNetwork (networkName, tenantId, cloudSiteId);
-                    LOGGER.recordMetricEvent (queryNetworkStarttime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Response successfully received from OpenStack", "OpenStack", "QueryNetwork", null);
+                    netInfo = neutron.queryNetwork(networkName, tenantId, cloudSiteId);
+                    LOGGER.recordMetricEvent(queryNetworkStarttime, MsoLogger.StatusCode.COMPLETE,
+                        MsoLogger.ResponseCode.Suc, "Response successfully received from OpenStack", "OpenStack",
+                        "QueryNetwork", null);
                 } catch (MsoException me) {
-                    LOGGER.recordMetricEvent (queryNetworkStarttime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, "Exception while querying network from OpenStack", "OpenStack", "QueryNetwork", null);
-                    LOGGER.error (MessageEnum.RA_QUERY_NETWORK_EXC, networkName, cloudSiteId, tenantId, "OpenStack", "", MsoLogger.ErrorCode.BusinessProcesssError, "Exception while querying network from OpenStack", me);
-                    me.addContext (CREATE_NETWORK_CONTEXT);
-                    LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, "Exception while querying network from OpenStack");
-                    throw new NetworkException (me);
+                    LOGGER.recordMetricEvent(queryNetworkStarttime, MsoLogger.StatusCode.ERROR,
+                        MsoLogger.ResponseCode.CommunicationError, "Exception while querying network from OpenStack",
+                        "OpenStack", "QueryNetwork", null);
+                    LOGGER.error(MessageEnum.RA_QUERY_NETWORK_EXC, networkName, cloudSiteId, tenantId, "OpenStack", "",
+                        MsoLogger.ErrorCode.BusinessProcesssError, "Exception while querying network from OpenStack",
+                        me);
+                    me.addContext(CREATE_NETWORK_CONTEXT);
+                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
+                        MsoLogger.ResponseCode.CommunicationError, "Exception while querying network from OpenStack");
+                    throw new NetworkException(me);
                 }
 
                 if (netInfo != null) {
@@ -328,49 +334,59 @@
                     // Otherwise, return an exception.
                     if (failIfExists != null && failIfExists) {
                         String error = "Create Nework: Network " + networkName
-                                       + " already exists in "
-                                       + cloudSiteId
-                                       + "/"
-                                       + tenantId
-                                       + " with ID " + netInfo.getId();
-                        LOGGER.error (MessageEnum.RA_NETWORK_ALREADY_EXIST, networkName, cloudSiteId, tenantId, "OpenStack", "", MsoLogger.ErrorCode.DataError, "Network already exists");
-                        LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.Conflict, error);
+                            + " already exists in "
+                            + cloudSiteId
+                            + "/"
+                            + tenantId
+                            + " with ID " + netInfo.getId();
+                        LOGGER.error(MessageEnum.RA_NETWORK_ALREADY_EXIST, networkName, cloudSiteId, tenantId,
+                            "OpenStack", "", MsoLogger.ErrorCode.DataError, "Network already exists");
+                        LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.Conflict,
+                            error);
                         throw new NetworkException(error, MsoExceptionCategory.USERDATA);
                     } else {
                         // Populate the outputs from the existing network.
-                        networkId.value = netInfo.getId ();
-                        neutronNetworkId.value = netInfo.getId ();
+                        networkId.value = netInfo.getId();
+                        neutronNetworkId.value = netInfo.getId();
                         rollback.value = networkRollback; // Default rollback - no updates performed
-                        String msg = "Found Existing network, status=" + netInfo.getStatus () + " for Neutron mode";
-                        LOGGER.warn (MessageEnum.RA_NETWORK_ALREADY_EXIST, networkName, cloudSiteId, tenantId, "", "", MsoLogger.ErrorCode.DataError, "Found Existing network, status=" + netInfo.getStatus ());
-                        LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, msg);
+                        String msg = "Found Existing network, status=" + netInfo.getStatus() + " for Neutron mode";
+                        LOGGER.warn(MessageEnum.RA_NETWORK_ALREADY_EXIST, networkName, cloudSiteId, tenantId, "", "",
+                            MsoLogger.ErrorCode.DataError, "Found Existing network, status=" + netInfo.getStatus());
+                        LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,
+                            msg);
                     }
                     return;
                 }
 
-                long createNetworkStarttime = System.currentTimeMillis ();
+                long createNetworkStarttime = System.currentTimeMillis();
                 try {
-                    netInfo = neutron.createNetwork (cloudSiteId,
-                                                     tenantId,
-                                                     neutronNetworkType,
-                                                     networkName,
-                                                     physicalNetworkName,
-                                                     vlans);
-                    LOGGER.recordMetricEvent (createNetworkStarttime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Response successfully received from OpenStack", "OpenStack", "CreateNetwork", null);
+                    netInfo = neutron.createNetwork(cloudSiteId,
+                        tenantId,
+                        neutronNetworkType,
+                        networkName,
+                        physicalNetworkName,
+                        vlans);
+                    LOGGER.recordMetricEvent(createNetworkStarttime, MsoLogger.StatusCode.COMPLETE,
+                        MsoLogger.ResponseCode.Suc, "Response successfully received from OpenStack", "OpenStack",
+                        "CreateNetwork", null);
                 } catch (MsoException me) {
-                	me.addContext (CREATE_NETWORK_CONTEXT);
-                    LOGGER.recordMetricEvent (createNetworkStarttime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, "Exception while communicate with OpenStack", "OpenStack", "CreateNetwork", null);
-                	String error = "Create Network: type " + neutronNetworkType
-                                   + " in "
-                                   + cloudSiteId
-                                   + "/"
-                                   + tenantId
-                                   + ": "
-                                   + me;
-                    LOGGER.error (MessageEnum.RA_CREATE_NETWORK_EXC, networkName, cloudSiteId, tenantId, "OpenStack", "", MsoLogger.ErrorCode.DataError, "Exception while communicate with OpenStack", me);
-                    LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
+                    me.addContext(CREATE_NETWORK_CONTEXT);
+                    LOGGER.recordMetricEvent(createNetworkStarttime, MsoLogger.StatusCode.ERROR,
+                        MsoLogger.ResponseCode.CommunicationError, "Exception while communicate with OpenStack",
+                        "OpenStack", "CreateNetwork", null);
+                    String error = "Create Network: type " + neutronNetworkType
+                        + " in "
+                        + cloudSiteId
+                        + "/"
+                        + tenantId
+                        + ": "
+                        + me;
+                    LOGGER.error(MessageEnum.RA_CREATE_NETWORK_EXC, networkName, cloudSiteId, tenantId, "OpenStack", "",
+                        MsoLogger.ErrorCode.DataError, "Exception while communicate with OpenStack", me);
+                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
+                        MsoLogger.ResponseCode.CommunicationError, error);
 
-                    throw new NetworkException (me);
+                    throw new NetworkException(me);
                 }
 
                 // Note: ignoring MsoNetworkAlreadyExists because we already checked.
@@ -378,263 +394,287 @@
                 // If reach this point, network creation is successful.
                 // Since directly created via Neutron, networkId tracked by MSO is the same
                 // as the neutron network ID.
-                networkId.value = netInfo.getId ();
-                neutronNetworkId.value = netInfo.getId ();
+                networkId.value = netInfo.getId();
+                neutronNetworkId.value = netInfo.getId();
 
-                networkRollback.setNetworkCreated (true);
-                networkRollback.setNetworkId (netInfo.getId ());
-                networkRollback.setNeutronNetworkId (netInfo.getId ());
-                networkRollback.setNetworkType (networkType);
+                networkRollback.setNetworkCreated(true);
+                networkRollback.setNetworkId(netInfo.getId());
+                networkRollback.setNeutronNetworkId(netInfo.getId());
+                networkRollback.setNetworkType(networkType);
 
-                LOGGER.debug ("Network " + networkName + " created, id = " + netInfo.getId ());
-            } else if ("HEAT".equals (mode)) {
+                LOGGER.debug("Network " + networkName + " created, id = " + netInfo.getId());
+            } else if ("HEAT".equals(mode)) {
 
                 // Use an MsoHeatUtils for all Heat commands
-                MsoHeatUtils heat = new MsoHeatUtils (MSO_PROP_NETWORK_ADAPTER, msoPropertiesFactory,cloudConfigFactory);
+                MsoHeatUtils heat = new MsoHeatUtils(MSO_PROP_NETWORK_ADAPTER, msoPropertiesFactory,
+                    cloudConfigFactory);
 
                 //HeatTemplate heatTemplate = db.getHeatTemplate (networkResource.getTemplateId ());
-                HeatTemplate heatTemplate = db.getHeatTemplateByArtifactUuidRegularQuery (networkResource.getHeatTemplateArtifactUUID());
+                HeatTemplate heatTemplate = db
+                    .getHeatTemplateByArtifactUuidRegularQuery(networkResource.getHeatTemplateArtifactUUID());
                 if (heatTemplate == null) {
                     String error = "Network error - undefined Heat Template. Network Type = " + networkType;
-                    LOGGER.error (MessageEnum.RA_PARAM_NOT_FOUND, "Heat Template", "Network Type", networkType, "Openstack", "", MsoLogger.ErrorCode.DataError, "Network error - undefined Heat Template. Network Type = " + networkType);
-                    alarmLogger.sendAlarm (MSO_CONFIGURATION_ERROR, MsoAlarmLogger.CRITICAL, error); // Alarm on this
-                                                                                                     // error,
-                                                                                                     // configuration
-                                                                                                     // must be fixed
-                    LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound, error);
-                    throw new NetworkException (error, MsoExceptionCategory.INTERNAL);
+                    LOGGER.error(MessageEnum.RA_PARAM_NOT_FOUND, "Heat Template", "Network Type", networkType,
+                        "Openstack", "", MsoLogger.ErrorCode.DataError,
+                        "Network error - undefined Heat Template. Network Type = " + networkType);
+                    alarmLogger.sendAlarm(MSO_CONFIGURATION_ERROR, MsoAlarmLogger.CRITICAL, error); // Alarm on this
+                    // error,
+                    // configuration
+                    // must be fixed
+                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound,
+                        error);
+                    throw new NetworkException(error, MsoExceptionCategory.INTERNAL);
                 }
 
-                LOGGER.debug ("Got HEAT Template from DB: " + heatTemplate.toString ());
+                LOGGER.debug("Got HEAT Template from DB: " + heatTemplate.toString());
 
                 // "Fix" the template if it has CR/LF (getting this from Oracle)
-                String template = heatTemplate.getHeatTemplate ();
-                template = template.replaceAll ("\r\n", "\n");
+                String template = heatTemplate.getHeatTemplate();
+                template = template.replaceAll("\r\n", "\n");
 
-                boolean aic3template=false;
+                boolean aic3template = false;
                 String aic3nw = AIC3_NW;
                 try {
-                	aic3nw = msoPropertiesFactory.getMsoJavaProperties(MSO_PROP_NETWORK_ADAPTER).getProperty(AIC3_NW_PROPERTY, AIC3_NW);
-        		} catch (MsoPropertiesException e) {
-        			String error = "Unable to get properties:" + MSO_PROP_NETWORK_ADAPTER;
-        			LOGGER.error (MessageEnum.RA_CONFIG_EXC, error, "", "", MsoLogger.ErrorCode.DataError, "Exception - Unable to get properties", e);
-        		}
+                    aic3nw = msoPropertiesFactory.getMsoJavaProperties(MSO_PROP_NETWORK_ADAPTER)
+                        .getProperty(AIC3_NW_PROPERTY, AIC3_NW);
+                } catch (MsoPropertiesException e) {
+                    String error = "Unable to get properties:" + MSO_PROP_NETWORK_ADAPTER;
+                    LOGGER.error(MessageEnum.RA_CONFIG_EXC, error, "", "", MsoLogger.ErrorCode.DataError,
+                        "Exception - Unable to get properties", e);
+                }
 
                 if (template.contains(aic3nw))
-                	aic3template = true;
+                    aic3template = true;
 
                 // First, look up to see if the Network already exists (by name).
                 // For HEAT orchestration of networks, the stack name will always match the network name
                 StackInfo heatStack = null;
-                long queryNetworkStarttime = System.currentTimeMillis ();
+                long queryNetworkStarttime = System.currentTimeMillis();
                 try {
-                    heatStack = heat.queryStack (cloudSiteId, tenantId, networkName);
-                    LOGGER.recordMetricEvent (queryNetworkStarttime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Response successfully received from OpenStack", "OpenStack", "QueryNetwork", null);
+                    heatStack = heat.queryStack(cloudSiteId, tenantId, networkName);
+                    LOGGER.recordMetricEvent(queryNetworkStarttime, MsoLogger.StatusCode.COMPLETE,
+                        MsoLogger.ResponseCode.Suc, "Response successfully received from OpenStack", "OpenStack",
+                        "QueryNetwork", null);
                 } catch (MsoException me) {
-                    me.addContext (CREATE_NETWORK_CONTEXT);
-                    LOGGER.recordMetricEvent (queryNetworkStarttime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, "Exception while querying stack from OpenStack", "OpenStack", "QueryNetwork", null);
-                	String error = "Create Network (heat): query network " + networkName
-                                   + " in "
-                                   + cloudSiteId
-                                   + "/"
-                                   + tenantId
-                                   + ": "
-                                   + me;
-                    LOGGER.error (MessageEnum.RA_QUERY_NETWORK_EXC, networkName, cloudSiteId, tenantId, "OpenStack", "", MsoLogger.ErrorCode.DataError, "Exception while querying stack from OpenStack", me);
-                    LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
-                    throw new NetworkException (me);
+                    me.addContext(CREATE_NETWORK_CONTEXT);
+                    LOGGER.recordMetricEvent(queryNetworkStarttime, MsoLogger.StatusCode.ERROR,
+                        MsoLogger.ResponseCode.CommunicationError, "Exception while querying stack from OpenStack",
+                        "OpenStack", "QueryNetwork", null);
+                    String error = "Create Network (heat): query network " + networkName
+                        + " in "
+                        + cloudSiteId
+                        + "/"
+                        + tenantId
+                        + ": "
+                        + me;
+                    LOGGER.error(MessageEnum.RA_QUERY_NETWORK_EXC, networkName, cloudSiteId, tenantId, "OpenStack", "",
+                        MsoLogger.ErrorCode.DataError, "Exception while querying stack from OpenStack", me);
+                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
+                        MsoLogger.ResponseCode.CommunicationError, error);
+                    throw new NetworkException(me);
                 }
 
-                if (heatStack != null && (heatStack.getStatus () != HeatStatus.NOTFOUND)) {
+                if (heatStack != null && (heatStack.getStatus() != HeatStatus.NOTFOUND)) {
                     // Stack exists. Return success or error depending on input directive
                     if (failIfExists != null && failIfExists) {
                         String error = "CreateNetwork: Stack " + networkName
-                                       + " already exists in "
-                                       + cloudSiteId
-                                       + "/"
-                                       + tenantId
-                                       + " as " + heatStack.getCanonicalName();
-                        LOGGER.error (MessageEnum.RA_NETWORK_ALREADY_EXIST, networkName, cloudSiteId, tenantId, "", "", MsoLogger.ErrorCode.DataError, "Network already exists");
-                        LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.Conflict, error);
+                            + " already exists in "
+                            + cloudSiteId
+                            + "/"
+                            + tenantId
+                            + " as " + heatStack.getCanonicalName();
+                        LOGGER.error(MessageEnum.RA_NETWORK_ALREADY_EXIST, networkName, cloudSiteId, tenantId, "", "",
+                            MsoLogger.ErrorCode.DataError, "Network already exists");
+                        LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.Conflict,
+                            error);
                         throw new NetworkException(error, MsoExceptionCategory.USERDATA);
                     } else {
                         // Populate the outputs from the existing stack.
-                        networkId.value = heatStack.getCanonicalName ();
-                        neutronNetworkId.value = (String) heatStack.getOutputs ().get (NETWORK_ID);
+                        networkId.value = heatStack.getCanonicalName();
+                        neutronNetworkId.value = (String) heatStack.getOutputs().get(NETWORK_ID);
                         rollback.value = networkRollback; // Default rollback - no updates performed
-                        if (aic3template)
-                        {
-                        	networkFqdn.value = (String) heatStack.getOutputs().get(NETWORK_FQDN);
+                        if (aic3template) {
+                            networkFqdn.value = (String) heatStack.getOutputs().get(NETWORK_FQDN);
                         }
-                        Map <String, Object> outputs = heatStack.getOutputs ();
-                        Map <String, String> sMap = new HashMap <> ();
+                        Map<String, Object> outputs = heatStack.getOutputs();
+                        Map<String, String> sMap = new HashMap<>();
                         if (outputs != null) {
-                        	for (String key : outputs.keySet ()) {
-                        		if (key != null && key.startsWith ("subnet")) {
-                        			if (aic3template) //one subnet_id output
-                        			{
-                        				 Map <String, String> map = getSubnetUUId(key, outputs, subnets);
-                        				 sMap.putAll(map);
-                        			}
-                        			else //multiples subnet_%aaid% outputs
-                        			{
-                        				String subnetUUId = (String) outputs.get(key);
-                        				sMap.put (key.substring("subnet_id_".length()), subnetUUId);
-                        			}
-                        		}
-                        	}
+                            for (String key : outputs.keySet()) {
+                                if (key != null && key.startsWith("subnet")) {
+                                    if (aic3template) //one subnet_id output
+                                    {
+                                        Map<String, String> map = getSubnetUUId(key, outputs, subnets);
+                                        sMap.putAll(map);
+                                    } else //multiples subnet_%aaid% outputs
+                                    {
+                                        String subnetUUId = (String) outputs.get(key);
+                                        sMap.put(key.substring("subnet_id_".length()), subnetUUId);
+                                    }
+                                }
+                            }
                         }
                         subnetIdMap.value = sMap;
-                        LOGGER.warn (MessageEnum.RA_NETWORK_ALREADY_EXIST, networkName, cloudSiteId, tenantId, "", "", MsoLogger.ErrorCode.DataError, "Found Existing network stack, status=" + heatStack.getStatus ());
-                        LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.Suc, "Found Existing network stack");
+                        LOGGER.warn(MessageEnum.RA_NETWORK_ALREADY_EXIST, networkName, cloudSiteId, tenantId, "", "",
+                            MsoLogger.ErrorCode.DataError,
+                            "Found Existing network stack, status=" + heatStack.getStatus());
+                        LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.Suc,
+                            "Found Existing network stack");
                     }
                     return;
                 }
 
                 // Ready to deploy the new Network
                 // Build the common set of HEAT template parameters
-                Map <String, Object> stackParams = populateNetworkParams (neutronNetworkType,
-                                                                          networkName,
-                                                                          physicalNetworkName,
-                                                                          vlans,
-                                                                          routeTargets,
-                                                                          shared,
-                                                                          external,
-                                                                          aic3template);
+                Map<String, Object> stackParams = populateNetworkParams(neutronNetworkType,
+                    networkName,
+                    physicalNetworkName,
+                    vlans,
+                    routeTargets,
+                    shared,
+                    external,
+                    aic3template);
 
                 // Validate (and update) the input parameters against the DB definition
                 // Shouldn't happen unless DB config is wrong, since all networks use same inputs
                 // and inputs were already validated.
                 try {
-                    stackParams = heat.validateStackParams (stackParams, heatTemplate);
+                    stackParams = heat.validateStackParams(stackParams, heatTemplate);
                 } catch (IllegalArgumentException e) {
-                    String error = "Create Network: Configuration Error: " + e.getMessage ();
-                    LOGGER.error (MessageEnum.RA_CONFIG_EXC, e.getMessage(), "Openstack", "", MsoLogger.ErrorCode.DataError, "Exception - Create Network, Configuration Error", e);
-                    alarmLogger.sendAlarm (MSO_CONFIGURATION_ERROR, MsoAlarmLogger.CRITICAL, error); // Alarm on this
-                                                                                                     // error,
-                                                                                                     // configuration
-                                                                                                     // must be fixed
-                    LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataError, error);
+                    String error = "Create Network: Configuration Error: " + e.getMessage();
+                    LOGGER.error(MessageEnum.RA_CONFIG_EXC, e.getMessage(), "Openstack", "",
+                        MsoLogger.ErrorCode.DataError, "Exception - Create Network, Configuration Error", e);
+                    alarmLogger.sendAlarm(MSO_CONFIGURATION_ERROR, MsoAlarmLogger.CRITICAL, error); // Alarm on this
+                    // error,
+                    // configuration
+                    // must be fixed
+                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataError,
+                        error);
                     // Input parameters were not valid
-                    throw new NetworkException (error, MsoExceptionCategory.INTERNAL);
+                    throw new NetworkException(error, MsoExceptionCategory.INTERNAL);
                 }
 
                 if (subnets != null) {
-                	try {
-                		if (aic3template)
-                		{
-                			template = mergeSubnetsAIC3 (template, subnets, stackParams);
-                		}
-                		else
-                		{
-                			template = mergeSubnets (template, subnets);
-                		}
-                	} catch (MsoException me) {
-                		me.addContext (CREATE_NETWORK_CONTEXT);
-                		String error = "Create Network (heat): type " + neutronNetworkType
-                				+ " in "
-                				+ cloudSiteId
-                				+ "/"
-                				+ tenantId
-                				+ ": "
-                				+ me;
-                		LOGGER.error (MessageEnum.RA_CREATE_NETWORK_EXC, neutronNetworkType.toString(), cloudSiteId, tenantId, "Openstack", "", MsoLogger.ErrorCode.DataError, "Exception Create Network, merging subnets", me);
-                        LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.InternalError, error);
-                		throw new NetworkException (me);
-                	}
+                    try {
+                        if (aic3template) {
+                            template = mergeSubnetsAIC3(template, subnets, stackParams);
+                        } else {
+                            template = mergeSubnets(template, subnets);
+                        }
+                    } catch (MsoException me) {
+                        me.addContext(CREATE_NETWORK_CONTEXT);
+                        String error = "Create Network (heat): type " + neutronNetworkType
+                            + " in "
+                            + cloudSiteId
+                            + "/"
+                            + tenantId
+                            + ": "
+                            + me;
+                        LOGGER.error(MessageEnum.RA_CREATE_NETWORK_EXC, neutronNetworkType.toString(), cloudSiteId,
+                            tenantId, "Openstack", "", MsoLogger.ErrorCode.DataError,
+                            "Exception Create Network, merging subnets", me);
+                        LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
+                            MsoLogger.ResponseCode.InternalError, error);
+                        throw new NetworkException(me);
+                    }
                 }
 
                 if (policyFqdns != null && !policyFqdns.isEmpty() && aic3template) {
                     try {
-                        mergePolicyRefs (policyFqdns, stackParams);
+                        mergePolicyRefs(policyFqdns, stackParams);
                     } catch (MsoException me) {
-                        me.addContext (CREATE_NETWORK_CONTEXT);
-                    	String error = "Create Network (heat) mergePolicyRefs type " + neutronNetworkType
-                                       + " in "
-                                       + cloudSiteId
-                                       + "/"
-                                       + tenantId
-                                       + ": "
-                                       + me;
-                        LOGGER.error (MessageEnum.RA_CREATE_NETWORK_EXC, neutronNetworkType.toString(), cloudSiteId, tenantId, "Openstack", "", MsoLogger.ErrorCode.DataError, "Exception Create Network, merging policyRefs", me);
-                        LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.InternalError, error);
-                        throw new NetworkException (me);
+                        me.addContext(CREATE_NETWORK_CONTEXT);
+                        String error = "Create Network (heat) mergePolicyRefs type " + neutronNetworkType
+                            + " in "
+                            + cloudSiteId
+                            + "/"
+                            + tenantId
+                            + ": "
+                            + me;
+                        LOGGER.error(MessageEnum.RA_CREATE_NETWORK_EXC, neutronNetworkType.toString(), cloudSiteId,
+                            tenantId, "Openstack", "", MsoLogger.ErrorCode.DataError,
+                            "Exception Create Network, merging policyRefs", me);
+                        LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
+                            MsoLogger.ResponseCode.InternalError, error);
+                        throw new NetworkException(me);
                     }
                 }
 
                 if (routeTableFqdns != null && !routeTableFqdns.isEmpty() && aic3template) {
                     try {
-                        mergeRouteTableRefs (routeTableFqdns, stackParams);
+                        mergeRouteTableRefs(routeTableFqdns, stackParams);
                     } catch (MsoException me) {
-                        me.addContext (CREATE_NETWORK_CONTEXT);
-                    	String error = "Create Network (heat) mergeRouteTableRefs type " + neutronNetworkType
-                                       + " in "
-                                       + cloudSiteId
-                                       + "/"
-                                       + tenantId
-                                       + ": "
-                                       + me;
-                        LOGGER.error (MessageEnum.RA_CREATE_NETWORK_EXC, neutronNetworkType.toString(), cloudSiteId, tenantId, "Openstack", "", MsoLogger.ErrorCode.DataError, "Exception Create Network, merging routeTableRefs", me);
-                        LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.InternalError, error);
-                        throw new NetworkException (me);
+                        me.addContext(CREATE_NETWORK_CONTEXT);
+                        String error = "Create Network (heat) mergeRouteTableRefs type " + neutronNetworkType
+                            + " in "
+                            + cloudSiteId
+                            + "/"
+                            + tenantId
+                            + ": "
+                            + me;
+                        LOGGER.error(MessageEnum.RA_CREATE_NETWORK_EXC, neutronNetworkType.toString(), cloudSiteId,
+                            tenantId, "Openstack", "", MsoLogger.ErrorCode.DataError,
+                            "Exception Create Network, merging routeTableRefs", me);
+                        LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
+                            MsoLogger.ResponseCode.InternalError, error);
+                        throw new NetworkException(me);
                     }
                 }
 
                 // Deploy the network stack
                 // Ignore MsoStackAlreadyExists exception because we already checked.
                 try {
-                	if (backout == null)
-                		backout = true;
-                    heatStack = heat.createStack (cloudSiteId,
-                                                  tenantId,
-                                                  networkName,
-                                                  template,
-                                                  stackParams,
-                                                  true,
-                                                  heatTemplate.getTimeoutMinutes (),
-                                                  null,
-                                                  null,
-                                                  null,
-                                                  backout.booleanValue());
+                    if (backout == null)
+                        backout = true;
+                    heatStack = heat.createStack(cloudSiteId,
+                        tenantId,
+                        networkName,
+                        template,
+                        stackParams,
+                        true,
+                        heatTemplate.getTimeoutMinutes(),
+                        null,
+                        null,
+                        null,
+                        backout.booleanValue());
                 } catch (MsoException me) {
-                    me.addContext (CREATE_NETWORK_CONTEXT);
-                	String error = "Create Network (heat): type " + neutronNetworkType
-                                   + " in "
-                                   + cloudSiteId
-                                   + "/"
-                                   + tenantId
-                                   + ": "
-                                   + me;
-                    LOGGER.error (MessageEnum.RA_CREATE_NETWORK_EXC, networkName, cloudSiteId, tenantId, "Openstack", "", MsoLogger.ErrorCode.DataError, "Exception creating network", me);
-                    LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
-                    throw new NetworkException (me);
+                    me.addContext(CREATE_NETWORK_CONTEXT);
+                    String error = "Create Network (heat): type " + neutronNetworkType
+                        + " in "
+                        + cloudSiteId
+                        + "/"
+                        + tenantId
+                        + ": "
+                        + me;
+                    LOGGER.error(MessageEnum.RA_CREATE_NETWORK_EXC, networkName, cloudSiteId, tenantId, "Openstack", "",
+                        MsoLogger.ErrorCode.DataError, "Exception creating network", me);
+                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
+                        MsoLogger.ResponseCode.CommunicationError, error);
+                    throw new NetworkException(me);
                 }
 
                 // Reach this point if createStack is successful.
 
                 // For Heat-based orchestration, the MSO-tracked network ID is the heat stack,
                 // and the neutronNetworkId is the network UUID returned in stack outputs.
-                networkId.value = heatStack.getCanonicalName ();
-                neutronNetworkId.value = (String) heatStack.getOutputs ().get (NETWORK_ID);
-                if (aic3template)
-                {
-                	networkFqdn.value = (String) heatStack.getOutputs().get(NETWORK_FQDN);
+                networkId.value = heatStack.getCanonicalName();
+                neutronNetworkId.value = (String) heatStack.getOutputs().get(NETWORK_ID);
+                if (aic3template) {
+                    networkFqdn.value = (String) heatStack.getOutputs().get(NETWORK_FQDN);
                 }
-                Map <String, Object> outputs = heatStack.getOutputs ();
-                Map <String, String> sMap = new HashMap <> ();
+                Map<String, Object> outputs = heatStack.getOutputs();
+                Map<String, String> sMap = new HashMap<>();
                 if (outputs != null) {
-                    for (String key : outputs.keySet ()) {
-                        if (key != null && key.startsWith ("subnet")) {
-                        	if (aic3template) //one subnet output expected
-                			{
-                				 Map <String, String> map = getSubnetUUId(key, outputs, subnets);
-                				 sMap.putAll(map);
-                			}
-                			else //multiples subnet_%aaid% outputs allowed
-                			{
-                				String subnetUUId = (String) outputs.get(key);
-                				sMap.put (key.substring("subnet_id_".length()), subnetUUId);
-                			}
+                    for (String key : outputs.keySet()) {
+                        if (key != null && key.startsWith("subnet")) {
+                            if (aic3template) //one subnet output expected
+                            {
+                                Map<String, String> map = getSubnetUUId(key, outputs, subnets);
+                                sMap.putAll(map);
+                            } else //multiples subnet_%aaid% outputs allowed
+                            {
+                                String subnetUUId = (String) outputs.get(key);
+                                sMap.put(key.substring("subnet_id_".length()), subnetUUId);
+                            }
                         }
                     }
                 }
@@ -642,15 +682,13 @@
 
                 rollback.value = networkRollback;
                 // Populate remaining rollback info and response parameters.
-                networkRollback.setNetworkStackId (heatStack.getCanonicalName ());
-                networkRollback.setNeutronNetworkId ((String) heatStack.getOutputs ().get (NETWORK_ID));
-                networkRollback.setNetworkCreated (true);
-                networkRollback.setNetworkType (networkType);
+                networkRollback.setNetworkStackId(heatStack.getCanonicalName());
+                networkRollback.setNeutronNetworkId((String) heatStack.getOutputs().get(NETWORK_ID));
+                networkRollback.setNetworkCreated(true);
+                networkRollback.setNetworkType(networkType);
 
-                LOGGER.debug ("Network " + networkName + " successfully created via HEAT");
+                LOGGER.debug("Network " + networkName + " successfully created via HEAT");
             }
-        } finally {
-            db.close ();
         }
         LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.Suc, "Successfully created network");
         return;
@@ -803,19 +841,18 @@
         }
 
         // Get a handle to the Catalog Database
-        CatalogDatabase db = getCatalogDB ();
 
         // Make sure DB connection is always closed
-        try {
+        try (CatalogDatabase db = getCatalogDB()) {
             NetworkResource networkResource = networkCheck(db,
-                    startTime,
-                    networkType,
-                    modelCustomizationUuid,
-                    networkName,
-                    physicalNetworkName,
-                    vlans,
-                    routeTargets,
-                    cloudSiteOpt.get());
+                startTime,
+                networkType,
+                modelCustomizationUuid,
+                networkName,
+                physicalNetworkName,
+                vlans,
+                routeTargets,
+                cloudSiteOpt.get());
             String mode = networkResource.getOrchestrationMode();
             NetworkType neutronNetworkType = NetworkType.valueOf(networkResource.getNeutronNetworkType());
 
@@ -830,54 +867,66 @@
                 long queryNetworkStarttime = System.currentTimeMillis();
                 try {
                     netInfo = neutron.queryNetwork(networkId, tenantId, cloudSiteId);
-                    LOGGER.recordMetricEvent(queryNetworkStarttime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully received response from Open Stack", "OpenStack", "QueryNetwork", null);
+                    LOGGER.recordMetricEvent(queryNetworkStarttime, MsoLogger.StatusCode.COMPLETE,
+                        MsoLogger.ResponseCode.Suc, "Successfully received response from Open Stack", "OpenStack",
+                        "QueryNetwork", null);
                 } catch (MsoException me) {
                     me.addContext(UPDATE_NETWORK_CONTEXT);
                     String error = "Update Network (neutron): query " + networkId
-                            + " in "
-                            + cloudSiteId
-                            + "/"
-                            + tenantId
-                            + ": "
-                            + me;
-                    LOGGER.recordMetricEvent(queryNetworkStarttime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "QueryNetwork", null);
-                    LOGGER.error(MessageEnum.RA_QUERY_NETWORK_EXC, networkId, cloudSiteId, tenantId, "OpenStack", "QueryNetwork", MsoLogger.ErrorCode.BusinessProcesssError, "Exception - queryNetwork", me);
-                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
+                        + " in "
+                        + cloudSiteId
+                        + "/"
+                        + tenantId
+                        + ": "
+                        + me;
+                    LOGGER.recordMetricEvent(queryNetworkStarttime, MsoLogger.StatusCode.ERROR,
+                        MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "QueryNetwork", null);
+                    LOGGER.error(MessageEnum.RA_QUERY_NETWORK_EXC, networkId, cloudSiteId, tenantId, "OpenStack",
+                        "QueryNetwork", MsoLogger.ErrorCode.BusinessProcesssError, "Exception - queryNetwork", me);
+                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
+                        MsoLogger.ResponseCode.CommunicationError, error);
                     throw new NetworkException(me);
                 }
 
                 if (netInfo == null) {
                     String error = "Update Nework: Network " + networkId
-                            + " does not exist in "
-                            + cloudSiteId
-                            + "/"
-                            + tenantId;
-                    LOGGER.error(MessageEnum.RA_NETWORK_NOT_FOUND, networkId, cloudSiteId, tenantId, "OpenStack", "", MsoLogger.ErrorCode.BusinessProcesssError, "Network not found");
-                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.BadRequest, error);
+                        + " does not exist in "
+                        + cloudSiteId
+                        + "/"
+                        + tenantId;
+                    LOGGER.error(MessageEnum.RA_NETWORK_NOT_FOUND, networkId, cloudSiteId, tenantId, "OpenStack", "",
+                        MsoLogger.ErrorCode.BusinessProcesssError, "Network not found");
+                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.BadRequest,
+                        error);
                     // Does not exist. Throw an exception (can't update a non-existent network)
                     throw new NetworkException(error, MsoExceptionCategory.USERDATA);
                 }
                 long updateNetworkStarttime = System.currentTimeMillis();
                 try {
                     netInfo = neutron.updateNetwork(cloudSiteId,
-                            tenantId,
-                            networkId,
-                            neutronNetworkType,
-                            physicalNetworkName,
-                            vlans);
-                    LOGGER.recordMetricEvent(updateNetworkStarttime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully received response from Open Stack", "OpenStack", "UpdateNetwork", null);
+                        tenantId,
+                        networkId,
+                        neutronNetworkType,
+                        physicalNetworkName,
+                        vlans);
+                    LOGGER.recordMetricEvent(updateNetworkStarttime, MsoLogger.StatusCode.COMPLETE,
+                        MsoLogger.ResponseCode.Suc, "Successfully received response from Open Stack", "OpenStack",
+                        "UpdateNetwork", null);
                 } catch (MsoException me) {
                     me.addContext(UPDATE_NETWORK_CONTEXT);
                     String error = "Update Network (neutron): " + networkId
-                            + " in "
-                            + cloudSiteId
-                            + "/"
-                            + tenantId
-                            + ": "
-                            + me;
-                    LOGGER.error(MessageEnum.RA_UPDATE_NETWORK_ERR, networkId, cloudSiteId, tenantId, "Openstack", "updateNetwork", MsoLogger.ErrorCode.DataError, "Exception - updateNetwork", me);
-                    LOGGER.recordMetricEvent(updateNetworkStarttime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "UpdateNetwork", null);
-                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
+                        + " in "
+                        + cloudSiteId
+                        + "/"
+                        + tenantId
+                        + ": "
+                        + me;
+                    LOGGER.error(MessageEnum.RA_UPDATE_NETWORK_ERR, networkId, cloudSiteId, tenantId, "Openstack",
+                        "updateNetwork", MsoLogger.ErrorCode.DataError, "Exception - updateNetwork", me);
+                    LOGGER.recordMetricEvent(updateNetworkStarttime, MsoLogger.StatusCode.ERROR,
+                        MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "UpdateNetwork", null);
+                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
+                        MsoLogger.ResponseCode.CommunicationError, error);
                     throw new NetworkException(me);
                 }
 
@@ -894,7 +943,8 @@
             } else if ("HEAT".equals(mode)) {
 
                 // Use an MsoHeatUtils for all Heat commands
-                MsoHeatUtilsWithUpdate heat = new MsoHeatUtilsWithUpdate(MSO_PROP_NETWORK_ADAPTER, msoPropertiesFactory, cloudConfigFactory);
+                MsoHeatUtilsWithUpdate heat = new MsoHeatUtilsWithUpdate(MSO_PROP_NETWORK_ADAPTER, msoPropertiesFactory,
+                    cloudConfigFactory);
 
                 // First, look up to see that the Network already exists.
                 // For Heat-based orchestration, the networkId is the network Stack ID.
@@ -902,30 +952,37 @@
                 long queryStackStarttime = System.currentTimeMillis();
                 try {
                     heatStack = heat.queryStack(cloudSiteId, tenantId, networkName);
-                    LOGGER.recordMetricEvent(queryStackStarttime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully received response from Open Stack", "OpenStack", "QueryStack", null);
+                    LOGGER.recordMetricEvent(queryStackStarttime, MsoLogger.StatusCode.COMPLETE,
+                        MsoLogger.ResponseCode.Suc, "Successfully received response from Open Stack", "OpenStack",
+                        "QueryStack", null);
                 } catch (MsoException me) {
                     me.addContext(UPDATE_NETWORK_CONTEXT);
                     String error = "UpdateNetwork (heat): query " + networkName
-                            + " in "
-                            + cloudSiteId
-                            + "/"
-                            + tenantId
-                            + ": "
-                            + me;
-                    LOGGER.recordMetricEvent(queryStackStarttime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "QueryStack", null);
-                    LOGGER.error(MessageEnum.RA_QUERY_NETWORK_EXC, networkId, cloudSiteId, tenantId, "OpenStack", "queryStack", MsoLogger.ErrorCode.DataError, "Exception - QueryStack", me);
-                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
+                        + " in "
+                        + cloudSiteId
+                        + "/"
+                        + tenantId
+                        + ": "
+                        + me;
+                    LOGGER.recordMetricEvent(queryStackStarttime, MsoLogger.StatusCode.ERROR,
+                        MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "QueryStack", null);
+                    LOGGER.error(MessageEnum.RA_QUERY_NETWORK_EXC, networkId, cloudSiteId, tenantId, "OpenStack",
+                        "queryStack", MsoLogger.ErrorCode.DataError, "Exception - QueryStack", me);
+                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
+                        MsoLogger.ResponseCode.CommunicationError, error);
                     throw new NetworkException(me);
                 }
 
                 if (heatStack == null || (heatStack.getStatus() == HeatStatus.NOTFOUND)) {
                     String error = "UpdateNetwork: Stack " + networkName
-                            + " does not exist in "
-                            + cloudSiteId
-                            + "/"
-                            + tenantId;
-                    LOGGER.error(MessageEnum.RA_NETWORK_NOT_FOUND, networkId, cloudSiteId, tenantId, "OpenStack", "queryStack", MsoLogger.ErrorCode.DataError, "Network not found");
-                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.BadRequest, error);
+                        + " does not exist in "
+                        + cloudSiteId
+                        + "/"
+                        + tenantId;
+                    LOGGER.error(MessageEnum.RA_NETWORK_NOT_FOUND, networkId, cloudSiteId, tenantId, "OpenStack",
+                        "queryStack", MsoLogger.ErrorCode.DataError, "Network not found");
+                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.BadRequest,
+                        error);
                     // Network stack does not exist. Return an error
                     throw new NetworkException(error, MsoExceptionCategory.USERDATA);
                 }
@@ -943,7 +1000,8 @@
                         try {
                             previousVlans.add(Integer.parseInt(vlan));
                         } catch (NumberFormatException e) {
-                            LOGGER.warn(MessageEnum.RA_VLAN_PARSE, networkId, vlansParam, "", "", MsoLogger.ErrorCode.DataError, "Exception - VLAN parse", e);
+                            LOGGER.warn(MessageEnum.RA_VLAN_PARSE, networkId, vlansParam, "", "",
+                                MsoLogger.ErrorCode.DataError, "Exception - VLAN parse", e);
                         }
                     }
                 }
@@ -952,12 +1010,16 @@
                 // Ready to deploy the updated Network via Heat
 
                 //HeatTemplate heatTemplate = db.getHeatTemplate (networkResource.getTemplateId ());
-                HeatTemplate heatTemplate = db.getHeatTemplateByArtifactUuidRegularQuery (networkResource.getHeatTemplateArtifactUUID());
+                HeatTemplate heatTemplate = db
+                    .getHeatTemplateByArtifactUuidRegularQuery(networkResource.getHeatTemplateArtifactUUID());
                 if (heatTemplate == null) {
                     String error = "Network error - undefined Heat Template. Network Type=" + networkType;
-                    LOGGER.error(MessageEnum.RA_PARAM_NOT_FOUND, "Heat Template", "Network Type", networkType, "OpenStack", "getHeatTemplate", MsoLogger.ErrorCode.DataError, "Network error - undefined Heat Template. Network Type=" + networkType);
+                    LOGGER.error(MessageEnum.RA_PARAM_NOT_FOUND, "Heat Template", "Network Type", networkType,
+                        "OpenStack", "getHeatTemplate", MsoLogger.ErrorCode.DataError,
+                        "Network error - undefined Heat Template. Network Type=" + networkType);
                     alarmLogger.sendAlarm(MSO_CONFIGURATION_ERROR, MsoAlarmLogger.CRITICAL, error);
-                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.BadRequest, error);
+                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.BadRequest,
+                        error);
                     throw new NetworkException(error, MsoExceptionCategory.INTERNAL);
                 }
 
@@ -970,23 +1032,25 @@
                 boolean aic3template = false;
                 String aic3nw = AIC3_NW;
                 try {
-                    aic3nw = msoPropertiesFactory.getMsoJavaProperties(MSO_PROP_NETWORK_ADAPTER).getProperty(AIC3_NW_PROPERTY, AIC3_NW);
+                    aic3nw = msoPropertiesFactory.getMsoJavaProperties(MSO_PROP_NETWORK_ADAPTER)
+                        .getProperty(AIC3_NW_PROPERTY, AIC3_NW);
                 } catch (MsoPropertiesException e) {
                     String error = "Unable to get properties:" + MSO_PROP_NETWORK_ADAPTER;
-                    LOGGER.error(MessageEnum.RA_CONFIG_EXC, error, "OpenStack", "", MsoLogger.ErrorCode.DataError, "Exception - Unable to get properties", e);
+                    LOGGER.error(MessageEnum.RA_CONFIG_EXC, error, "OpenStack", "", MsoLogger.ErrorCode.DataError,
+                        "Exception - Unable to get properties", e);
                 }
                 if (template.contains(aic3nw))
                     aic3template = true;
 
                 // Build the common set of HEAT template parameters
                 Map<String, Object> stackParams = populateNetworkParams(neutronNetworkType,
-                        networkName,
-                        physicalNetworkName,
-                        vlans,
-                        routeTargets,
-                        shared,
-                        external,
-                        aic3template);
+                    networkName,
+                    physicalNetworkName,
+                    vlans,
+                    routeTargets,
+                    shared,
+                    external,
+                    aic3template);
 
                 // Validate (and update) the input parameters against the DB definition
                 // Shouldn't happen unless DB config is wrong, since all networks use same inputs
@@ -994,9 +1058,11 @@
                     stackParams = heat.validateStackParams(stackParams, heatTemplate);
                 } catch (IllegalArgumentException e) {
                     String error = "UpdateNetwork: Configuration Error: Network Type=" + networkType;
-                    LOGGER.error(MessageEnum.RA_CONFIG_EXC, "Network Type=" + networkType, "OpenStack", "", MsoLogger.ErrorCode.DataError, "Exception - UpdateNetwork: Configuration Error");
+                    LOGGER.error(MessageEnum.RA_CONFIG_EXC, "Network Type=" + networkType, "OpenStack", "",
+                        MsoLogger.ErrorCode.DataError, "Exception - UpdateNetwork: Configuration Error");
                     alarmLogger.sendAlarm(MSO_CONFIGURATION_ERROR, MsoAlarmLogger.CRITICAL, error);
-                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.SchemaError, error);
+                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.SchemaError,
+                        error);
                     throw new NetworkException(error, MsoExceptionCategory.INTERNAL, e);
                 }
 
@@ -1010,14 +1076,17 @@
                     } catch (MsoException me) {
                         me.addContext(UPDATE_NETWORK_CONTEXT);
                         String error = "Update Network (heat): type " + neutronNetworkType
-                                + " in "
-                                + cloudSiteId
-                                + "/"
-                                + tenantId
-                                + ": "
-                                + me;
-                        LOGGER.error(MessageEnum.RA_UPDATE_NETWORK_ERR, neutronNetworkType.toString(), cloudSiteId, tenantId, "OpenStack", "", MsoLogger.ErrorCode.DataError, "Exception - UpdateNetwork mergeSubnets ", me);
-                        LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.InternalError, error);
+                            + " in "
+                            + cloudSiteId
+                            + "/"
+                            + tenantId
+                            + ": "
+                            + me;
+                        LOGGER.error(MessageEnum.RA_UPDATE_NETWORK_ERR, neutronNetworkType.toString(), cloudSiteId,
+                            tenantId, "OpenStack", "", MsoLogger.ErrorCode.DataError,
+                            "Exception - UpdateNetwork mergeSubnets ", me);
+                        LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
+                            MsoLogger.ResponseCode.InternalError, error);
                         throw new NetworkException(me);
                     }
                 }
@@ -1028,14 +1097,17 @@
                     } catch (MsoException me) {
                         me.addContext(UPDATE_NETWORK_CONTEXT);
                         String error = "UpdateNetwork (heat) mergePolicyRefs type " + neutronNetworkType
-                                + " in "
-                                + cloudSiteId
-                                + "/"
-                                + tenantId
-                                + ": "
-                                + me;
-                        LOGGER.error(MessageEnum.RA_UPDATE_NETWORK_ERR, neutronNetworkType.toString(), cloudSiteId, tenantId, "OpenStack", "", MsoLogger.ErrorCode.DataError, "Exception - UpdateNetwork mergePolicyRefs", me);
-                        LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.InternalError, error);
+                            + " in "
+                            + cloudSiteId
+                            + "/"
+                            + tenantId
+                            + ": "
+                            + me;
+                        LOGGER.error(MessageEnum.RA_UPDATE_NETWORK_ERR, neutronNetworkType.toString(), cloudSiteId,
+                            tenantId, "OpenStack", "", MsoLogger.ErrorCode.DataError,
+                            "Exception - UpdateNetwork mergePolicyRefs", me);
+                        LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
+                            MsoLogger.ResponseCode.InternalError, error);
                         throw new NetworkException(me);
                     }
                 }
@@ -1046,14 +1118,17 @@
                     } catch (MsoException me) {
                         me.addContext(UPDATE_NETWORK_CONTEXT);
                         String error = "UpdateNetwork (heat) mergeRouteTableRefs type " + neutronNetworkType
-                                + " in "
-                                + cloudSiteId
-                                + "/"
-                                + tenantId
-                                + ": "
-                                + me;
-                        LOGGER.error(MessageEnum.RA_UPDATE_NETWORK_ERR, neutronNetworkType.toString(), cloudSiteId, tenantId, "Openstack", "", MsoLogger.ErrorCode.DataError, "Exception - UpdateNetwork mergeRouteTableRefs", me);
-                        LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.InternalError, error);
+                            + " in "
+                            + cloudSiteId
+                            + "/"
+                            + tenantId
+                            + ": "
+                            + me;
+                        LOGGER.error(MessageEnum.RA_UPDATE_NETWORK_ERR, neutronNetworkType.toString(), cloudSiteId,
+                            tenantId, "Openstack", "", MsoLogger.ErrorCode.DataError,
+                            "Exception - UpdateNetwork mergeRouteTableRefs", me);
+                        LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
+                            MsoLogger.ResponseCode.InternalError, error);
                         throw new NetworkException(me);
                     }
                 }
@@ -1063,19 +1138,24 @@
                 long updateStackStarttime = System.currentTimeMillis();
                 try {
                     heatStack = heat.updateStack(cloudSiteId,
-                            tenantId,
-                            networkId,
-                            template,
-                            stackParams,
-                            true,
-                            heatTemplate.getTimeoutMinutes());
-                    LOGGER.recordMetricEvent(updateStackStarttime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully received response from Open Stack", "OpenStack", "UpdateStack", null);
+                        tenantId,
+                        networkId,
+                        template,
+                        stackParams,
+                        true,
+                        heatTemplate.getTimeoutMinutes());
+                    LOGGER.recordMetricEvent(updateStackStarttime, MsoLogger.StatusCode.COMPLETE,
+                        MsoLogger.ResponseCode.Suc, "Successfully received response from Open Stack", "OpenStack",
+                        "UpdateStack", null);
                 } catch (MsoException me) {
                     me.addContext(UPDATE_NETWORK_CONTEXT);
                     String error = "Update Network: " + networkId + " in " + cloudSiteId + "/" + tenantId + ": " + me;
-                    LOGGER.recordMetricEvent(updateStackStarttime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "UpdateStack", null);
-                    LOGGER.error(MessageEnum.RA_UPDATE_NETWORK_ERR, networkId, cloudSiteId, tenantId, "OpenStack", "", MsoLogger.ErrorCode.DataError, "Exception - update network", me);
-                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
+                    LOGGER.recordMetricEvent(updateStackStarttime, MsoLogger.StatusCode.COMPLETE,
+                        MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "UpdateStack", null);
+                    LOGGER.error(MessageEnum.RA_UPDATE_NETWORK_ERR, networkId, cloudSiteId, tenantId, "OpenStack", "",
+                        MsoLogger.ErrorCode.DataError, "Exception - update network", me);
+                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
+                        MsoLogger.ResponseCode.CommunicationError, error);
                     throw new NetworkException(me);
                 }
 
@@ -1101,10 +1181,9 @@
                 // Reach this point if createStack is successful.
                 // Populate remaining rollback info and response parameters.
                 networkRollback.setNetworkStackId(heatStack.getCanonicalName());
-                if(null != outputs) {
+                if (null != outputs) {
                     networkRollback.setNeutronNetworkId((String) outputs.get(NETWORK_ID));
-                }
-                else {
+                } else {
                     LOGGER.debug("outputs is NULL");
                 }
                 networkRollback.setNetworkType(networkType);
@@ -1117,8 +1196,6 @@
 
                 LOGGER.debug("Network " + networkId + " successfully updated via HEAT");
             }
-        } finally {
-            db.close ();
         }
         LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully updated network");
         return;
@@ -1472,97 +1549,102 @@
         long startTime = System.currentTimeMillis ();
 
         // Get a handle to the Catalog Database
-        CatalogDatabase db = getCatalogDB ();
 
         // Make sure DB connection is always closed
-        try {
-            if (isNullOrEmpty (cloudSiteId)
-                            || isNullOrEmpty(tenantId)
-                            || isNullOrEmpty(networkId)) {
+        try (CatalogDatabase db = getCatalogDB()) {
+            if (isNullOrEmpty(cloudSiteId)
+                || isNullOrEmpty(tenantId)
+                || isNullOrEmpty(networkId)) {
                 String error = "Missing mandatory parameter cloudSiteId, tenantId or networkId";
-                LOGGER.error (MessageEnum.RA_MISSING_PARAM, "cloudSiteId or tenantId or networkId", "Openstack", "", MsoLogger.ErrorCode.DataError, "Missing mandatory parameter cloudSiteId, tenantId or networkId");
-                LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.BadRequest, error);
-                throw new NetworkException (error, MsoExceptionCategory.USERDATA);
+                LOGGER.error(MessageEnum.RA_MISSING_PARAM, "cloudSiteId or tenantId or networkId", "Openstack", "",
+                    MsoLogger.ErrorCode.DataError, "Missing mandatory parameter cloudSiteId, tenantId or networkId");
+                LOGGER
+                    .recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.BadRequest, error);
+                throw new NetworkException(error, MsoExceptionCategory.USERDATA);
             }
 
             // Retrieve the Network Resource definition
             NetworkResource networkResource = null;
             if (isNullOrEmpty(modelCustomizationUuid)) {
-                networkResource = db.getNetworkResource (networkType);
-            }
-            else if (!isNullOrEmpty(networkType))
-            {
+                networkResource = db.getNetworkResource(networkType);
+            } else if (!isNullOrEmpty(networkType)) {
                 networkResource = db.getNetworkResourceByModelCustUuid(modelCustomizationUuid);
             }
             String mode = "";
             if (networkResource != null) {
-                LOGGER.debug ("Got Network definition from Catalog: " + networkResource.toString ());
+                LOGGER.debug("Got Network definition from Catalog: " + networkResource.toString());
 
-                mode = networkResource.getOrchestrationMode ();
+                mode = networkResource.getOrchestrationMode();
             }
 
-            if (NEUTRON_MODE.equals (mode)) {
+            if (NEUTRON_MODE.equals(mode)) {
 
                 // Use MsoNeutronUtils for all NEUTRON commands
-                MsoNeutronUtils neutron = new MsoNeutronUtils (MSO_PROP_NETWORK_ADAPTER, cloudConfigFactory);
-                long deleteNetworkStarttime = System.currentTimeMillis ();
+                MsoNeutronUtils neutron = new MsoNeutronUtils(MSO_PROP_NETWORK_ADAPTER, cloudConfigFactory);
+                long deleteNetworkStarttime = System.currentTimeMillis();
                 try {
                     // The deleteNetwork function in MsoNeutronUtils returns success if the network
                     // was not found. So don't bother to query first.
-                    boolean deleted = neutron.deleteNetwork (networkId, tenantId, cloudSiteId);
-                    LOGGER.recordMetricEvent (deleteNetworkStarttime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully received response from Open Stack", "OpenStack", "DeleteNetwork", null);
+                    boolean deleted = neutron.deleteNetwork(networkId, tenantId, cloudSiteId);
+                    LOGGER.recordMetricEvent(deleteNetworkStarttime, MsoLogger.StatusCode.COMPLETE,
+                        MsoLogger.ResponseCode.Suc, "Successfully received response from Open Stack", "OpenStack",
+                        "DeleteNetwork", null);
                     networkDeleted.value = deleted;
                 } catch (MsoException me) {
-                    me.addContext ("DeleteNetwork");
-                	String error = "Delete Network (neutron): " + networkId
-                                   + " in "
-                                   + cloudSiteId
-                                   + "/"
-                                   + tenantId
-                                   + ": "
-                                   + me;
-                    LOGGER.recordMetricEvent (deleteNetworkStarttime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "DeleteNetwork", null);
-                    LOGGER.error (MessageEnum.RA_DELETE_NETWORK_EXC, networkId, cloudSiteId, tenantId, "Openstack", "", MsoLogger.ErrorCode.DataError, "Delete Network (neutron)", me);
-                    LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
-                    throw new NetworkException (me);
+                    me.addContext("DeleteNetwork");
+                    String error = "Delete Network (neutron): " + networkId
+                        + " in "
+                        + cloudSiteId
+                        + "/"
+                        + tenantId
+                        + ": "
+                        + me;
+                    LOGGER.recordMetricEvent(deleteNetworkStarttime, MsoLogger.StatusCode.ERROR,
+                        MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "DeleteNetwork", null);
+                    LOGGER.error(MessageEnum.RA_DELETE_NETWORK_EXC, networkId, cloudSiteId, tenantId, "Openstack", "",
+                        MsoLogger.ErrorCode.DataError, "Delete Network (neutron)", me);
+                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
+                        MsoLogger.ResponseCode.CommunicationError, error);
+                    throw new NetworkException(me);
                 }
             } else { // DEFAULT to ("HEAT".equals (mode))
-                long deleteStackStarttime = System.currentTimeMillis ();
+                long deleteStackStarttime = System.currentTimeMillis();
                 // Use MsoHeatUtils for all HEAT commands
-                MsoHeatUtils heat = new MsoHeatUtils (MSO_PROP_NETWORK_ADAPTER, msoPropertiesFactory,cloudConfigFactory);
+                MsoHeatUtils heat = new MsoHeatUtils(MSO_PROP_NETWORK_ADAPTER, msoPropertiesFactory,
+                    cloudConfigFactory);
 
                 try {
                     // The deleteStack function in MsoHeatUtils returns NOTFOUND if the stack was not found or if the stack was deleted.
                     //  So query first to report back if stack WAS deleted or just NOTOFUND
-                	StackInfo heatStack = null;
-                	heatStack = heat.queryStack(cloudSiteId, tenantId, networkId);
-                	if (heatStack != null && heatStack.getStatus() != HeatStatus.NOTFOUND)
-                	{
-                		heat.deleteStack (tenantId, cloudSiteId, networkId, true);
-                		LOGGER.recordMetricEvent (deleteStackStarttime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully received response from Open Stack", "OpenStack", "DeleteStack", null);
-                		networkDeleted.value = true;
-                	}
-                	else
-                	{
-                		networkDeleted.value = false;
-                	}
+                    StackInfo heatStack = null;
+                    heatStack = heat.queryStack(cloudSiteId, tenantId, networkId);
+                    if (heatStack != null && heatStack.getStatus() != HeatStatus.NOTFOUND) {
+                        heat.deleteStack(tenantId, cloudSiteId, networkId, true);
+                        LOGGER.recordMetricEvent(deleteStackStarttime, MsoLogger.StatusCode.COMPLETE,
+                            MsoLogger.ResponseCode.Suc, "Successfully received response from Open Stack", "OpenStack",
+                            "DeleteStack", null);
+                        networkDeleted.value = true;
+                    } else {
+                        networkDeleted.value = false;
+                    }
                 } catch (MsoException me) {
-                    me.addContext ("DeleteNetwork");
-                	String error = "Delete Network (heat): " + networkId
-                                   + " in "
-                                   + cloudSiteId
-                                   + "/"
-                                   + tenantId
-                                   + ": "
-                                   + me;
-                    LOGGER.recordMetricEvent (deleteStackStarttime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "DeleteStack", null);
-                    LOGGER.error (MessageEnum.RA_DELETE_NETWORK_EXC, networkId, cloudSiteId, tenantId, "Openstack", "", MsoLogger.ErrorCode.DataError, "Delete Network (heat)", me);
-                    LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
-                    throw new NetworkException (me);
+                    me.addContext("DeleteNetwork");
+                    String error = "Delete Network (heat): " + networkId
+                        + " in "
+                        + cloudSiteId
+                        + "/"
+                        + tenantId
+                        + ": "
+                        + me;
+                    LOGGER.recordMetricEvent(deleteStackStarttime, MsoLogger.StatusCode.ERROR,
+                        MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "DeleteStack", null);
+                    LOGGER.error(MessageEnum.RA_DELETE_NETWORK_EXC, networkId, cloudSiteId, tenantId, "Openstack", "",
+                        MsoLogger.ErrorCode.DataError, "Delete Network (heat)", me);
+                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
+                        MsoLogger.ResponseCode.CommunicationError, error);
+                    throw new NetworkException(me);
                 }
             }
-        } finally {
-            db.close ();
         }
 
         // On success, nothing is returned.
@@ -1608,80 +1690,89 @@
 
         // rollback may be null (e.g. if network already existed when Create was called)
         // Get a handle to the Catalog Database
-        CatalogDatabase db = getCatalogDB ();
 
         // Make sure DB connection is always closed
-        try {
+        try (CatalogDatabase db = getCatalogDB()) {
 
             // Retrieve the Network Resource definition
             NetworkResource networkResource = null;
             if (isNullOrEmpty(modelCustomizationUuid)) {
-                networkResource = db.getNetworkResource (networkType);
-            }
-            else
-            {
+                networkResource = db.getNetworkResource(networkType);
+            } else {
                 networkResource = db.getNetworkResourceByModelCustUuid(modelCustomizationUuid);
             }
             String mode = "";
             if (networkResource != null) {
 
-                LOGGER.debug ("Got Network definition from Catalog: " + networkResource.toString ());
+                LOGGER.debug("Got Network definition from Catalog: " + networkResource.toString());
 
-                mode = networkResource.getOrchestrationMode ();
+                mode = networkResource.getOrchestrationMode();
             }
 
-            if (rollback.getNetworkCreated ()) {
+            if (rollback.getNetworkCreated()) {
                 // Rolling back a newly created network, so delete it.
-                if (NEUTRON_MODE.equals (mode)) {
+                if (NEUTRON_MODE.equals(mode)) {
                     // Use MsoNeutronUtils for all NEUTRON commands
-                    MsoNeutronUtils neutron = new MsoNeutronUtils (MSO_PROP_NETWORK_ADAPTER, cloudConfigFactory);
-                    long deleteNetworkStarttime = System.currentTimeMillis ();
+                    MsoNeutronUtils neutron = new MsoNeutronUtils(MSO_PROP_NETWORK_ADAPTER, cloudConfigFactory);
+                    long deleteNetworkStarttime = System.currentTimeMillis();
                     try {
                         // The deleteNetwork function in MsoNeutronUtils returns success if the network
                         // was not found. So don't bother to query first.
-                        neutron.deleteNetwork (networkId, tenantId, cloudSiteId);
-                        LOGGER.recordMetricEvent (deleteNetworkStarttime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully received response from Open Stack", "OpenStack", "DeleteNetwork", null);
+                        neutron.deleteNetwork(networkId, tenantId, cloudSiteId);
+                        LOGGER.recordMetricEvent(deleteNetworkStarttime, MsoLogger.StatusCode.COMPLETE,
+                            MsoLogger.ResponseCode.Suc, "Successfully received response from Open Stack", "OpenStack",
+                            "DeleteNetwork", null);
                     } catch (MsoException me) {
-                        me.addContext ("RollbackNetwork");
+                        me.addContext("RollbackNetwork");
                         String error = "Rollback Network (neutron): " + networkId
-                                       + " in "
-                                       + cloudSiteId
-                                       + "/"
-                                       + tenantId
-                                       + ": "
-                                       + me;
-                        LOGGER.recordMetricEvent (deleteNetworkStarttime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "DeleteNetwork", null);
-                        LOGGER.error (MessageEnum.RA_DELETE_NETWORK_EXC, networkId, cloudSiteId, tenantId, "OpenStack", "", MsoLogger.ErrorCode.BusinessProcesssError, "Exception - Rollback Network (neutron)", me);
-                        LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
-                        throw new NetworkException (me);
+                            + " in "
+                            + cloudSiteId
+                            + "/"
+                            + tenantId
+                            + ": "
+                            + me;
+                        LOGGER.recordMetricEvent(deleteNetworkStarttime, MsoLogger.StatusCode.ERROR,
+                            MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "DeleteNetwork", null);
+                        LOGGER
+                            .error(MessageEnum.RA_DELETE_NETWORK_EXC, networkId, cloudSiteId, tenantId, "OpenStack", "",
+                                MsoLogger.ErrorCode.BusinessProcesssError, "Exception - Rollback Network (neutron)",
+                                me);
+                        LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
+                            MsoLogger.ResponseCode.CommunicationError, error);
+                        throw new NetworkException(me);
                     }
                 } else { // DEFAULT to if ("HEAT".equals (mode))
                     // Use MsoHeatUtils for all HEAT commands
-                    MsoHeatUtils heat = new MsoHeatUtils (MSO_PROP_NETWORK_ADAPTER, msoPropertiesFactory,cloudConfigFactory);
-                    long deleteStackStarttime = System.currentTimeMillis ();
+                    MsoHeatUtils heat = new MsoHeatUtils(MSO_PROP_NETWORK_ADAPTER, msoPropertiesFactory,
+                        cloudConfigFactory);
+                    long deleteStackStarttime = System.currentTimeMillis();
                     try {
                         // The deleteStack function in MsoHeatUtils returns success if the stack
                         // was not found. So don't bother to query first.
-                        heat.deleteStack (tenantId, cloudSiteId, networkId, true);
-                        LOGGER.recordMetricEvent (deleteStackStarttime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully received response from Open Stack", "OpenStack", "DeleteStack", null);
+                        heat.deleteStack(tenantId, cloudSiteId, networkId, true);
+                        LOGGER.recordMetricEvent(deleteStackStarttime, MsoLogger.StatusCode.COMPLETE,
+                            MsoLogger.ResponseCode.Suc, "Successfully received response from Open Stack", "OpenStack",
+                            "DeleteStack", null);
                     } catch (MsoException me) {
-                        me.addContext ("RollbackNetwork");
+                        me.addContext("RollbackNetwork");
                         String error = "Rollback Network (heat): " + networkId
-                                       + " in "
-                                       + cloudSiteId
-                                       + "/"
-                                       + tenantId
-                                       + ": "
-                                       + me;
-                        LOGGER.recordMetricEvent (deleteStackStarttime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "DeleteStack", null);
-                        LOGGER.error (MessageEnum.RA_DELETE_NETWORK_EXC, networkId, cloudSiteId, tenantId, "OpenStack", "", MsoLogger.ErrorCode.BusinessProcesssError, "Exception - Rollback Network (heat)", me);
-                        LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
-                        throw new NetworkException (me);
+                            + " in "
+                            + cloudSiteId
+                            + "/"
+                            + tenantId
+                            + ": "
+                            + me;
+                        LOGGER.recordMetricEvent(deleteStackStarttime, MsoLogger.StatusCode.ERROR,
+                            MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "DeleteStack", null);
+                        LOGGER
+                            .error(MessageEnum.RA_DELETE_NETWORK_EXC, networkId, cloudSiteId, tenantId, "OpenStack", "",
+                                MsoLogger.ErrorCode.BusinessProcesssError, "Exception - Rollback Network (heat)", me);
+                        LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
+                            MsoLogger.ResponseCode.CommunicationError, error);
+                        throw new NetworkException(me);
                     }
                 }
             }
-        } finally {
-            db.close ();
         }
         LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully rolled back network");
         return;
diff --git a/adapters/mso-network-adapter/src/test/java/org/openecomp/mso/adapters/network/NetworkBeansTest.java b/adapters/mso-network-adapter/src/test/java/org/openecomp/mso/adapters/network/NetworkBeansTest.java
index e96e416..ae19814 100644
--- a/adapters/mso-network-adapter/src/test/java/org/openecomp/mso/adapters/network/NetworkBeansTest.java
+++ b/adapters/mso-network-adapter/src/test/java/org/openecomp/mso/adapters/network/NetworkBeansTest.java
@@ -71,7 +71,7 @@
 			contrailSubnet.setAddrFromStart(true);
 			contrailSubnet.setDefaultGateway("defaultGateway");
 			contrailSubnet.setEnableDhcp(true);
-			contrailSubnet.setPools(new ArrayList<ContrailSubnetPool>());
+			contrailSubnet.setPools(new ArrayList<>());
 			contrailSubnet.setSubnet(new ContrailSubnetIp());
 			contrailSubnet.setSubnetName("subnetName");
 			contrailSubnet.getAllocationPools();
diff --git a/adapters/mso-tenant-adapter/src/test/java/org/openecomp/mso/adapters/tenant/test/TenantTest.java b/adapters/mso-tenant-adapter/src/test/java/org/openecomp/mso/adapters/tenant/test/TenantTest.java
index 5d0752a..2a33ebc 100644
--- a/adapters/mso-tenant-adapter/src/test/java/org/openecomp/mso/adapters/tenant/test/TenantTest.java
+++ b/adapters/mso-tenant-adapter/src/test/java/org/openecomp/mso/adapters/tenant/test/TenantTest.java
@@ -39,11 +39,11 @@
 		
 		MsoTenantAdapter tenantAdapter = new MsoTenantAdapterImpl();
 		
-		Holder<String> tenantId = new Holder<String>();
-		Holder<String> tenantName = new Holder<String>();
-		Holder<Map<String,String>> tenantMetadata = new Holder<Map<String,String>>();
-		Holder<Boolean> tenantDeleted = new Holder<Boolean>();
-		Holder<TenantRollback> rollback = new Holder<TenantRollback>();
+		Holder<String> tenantId = new Holder<>();
+		Holder<String> tenantName = new Holder<>();
+		Holder<Map<String,String>> tenantMetadata = new Holder<>();
+		Holder<Boolean> tenantDeleted = new Holder<>();
+		Holder<TenantRollback> rollback = new Holder<>();
 		
 		try {
 			tenantAdapter.queryTenant (cloudId, "934a4ac9c4bd4b8d9d8ab3ef900281b0", null, tenantId, tenantName, tenantMetadata);
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 95e62a0..caab1e3 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
@@ -295,7 +295,7 @@
             vnfExists.value = Boolean.FALSE;
             status.value = VnfStatus.NOTFOUND;
             vnfId.value = null;
-            outputs.value = new HashMap <String, String> (); // Return as an empty map
+            outputs.value = new HashMap<>(); // Return as an empty map
 
             LOGGER.debug ("VNF " + vnfName + " not found");
         } else {
@@ -548,7 +548,7 @@
         if (objectMap == null) {
             return null;
         }
-        Map<String, String> stringMap = new HashMap<String, String>();
+        Map<String, String> stringMap = new HashMap<>();
         for (String key : objectMap.keySet()) {
             if (!stringMap.containsKey(key)) {
                 Object obj = objectMap.get(key);
@@ -823,9 +823,7 @@
 
         // Ready to deploy the new VNF
 
-        CatalogDatabase db = CatalogDatabase.getInstance();
-
-        try {
+        try (CatalogDatabase db = CatalogDatabase.getInstance()) {
             // Retrieve the VF
             VfModule vf = null;
             VnfResource vnfResource = null;
@@ -839,10 +837,14 @@
                 //vf = db.getVfModuleByModelCustomizationUuid(mcu);
                 if (vf == null) {
                     LOGGER.debug("Unable to find vfModuleCust with modelCustomizationUuid=" + mcu);
-                    String error = "Create vfModule error: Unable to find vfModuleCust with modelCustomizationUuid=" + mcu;
+                    String error =
+                        "Create vfModule error: Unable to find vfModuleCust with modelCustomizationUuid=" + mcu;
                     LOGGER.error(MessageEnum.RA_VNF_UNKNOWN_PARAM,
-                            "VF Module ModelCustomizationUuid", modelCustomizationUuid, "OpenStack", "", MsoLogger.ErrorCode.DataError, "Create VF Module: Unable to find vfModule with modelCustomizationUuid=" + mcu);
-                    LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound, error);
+                        "VF Module ModelCustomizationUuid", modelCustomizationUuid, "OpenStack", "",
+                        MsoLogger.ErrorCode.DataError,
+                        "Create VF Module: Unable to find vfModule with modelCustomizationUuid=" + mcu);
+                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound,
+                        error);
                     throw new VnfException(error, MsoExceptionCategory.USERDATA);
                 } else {
                     LOGGER.debug("Found vfModuleCust entry " + vfmc.toString());
@@ -853,7 +855,8 @@
                 } else {
                     LOGGER.debug("This is *not* a BASE VF request!");
                     if (!isVolumeRequest && nestedBaseStackId == null) {
-                        LOGGER.debug("DANGER WILL ROBINSON! This is unexpected - no nestedBaseStackId with this non-base request");
+                        LOGGER.debug(
+                            "DANGER WILL ROBINSON! This is unexpected - no nestedBaseStackId with this non-base request");
                     }
                 }
             }
@@ -912,12 +915,13 @@
                 if (vnfResource == null) {
                     String error = "Create VNF: Unknown VNF Type: " + vnfType;
                     LOGGER.error(MessageEnum.RA_VNF_UNKNOWN_PARAM, "VNF Type",
-                            vnfType, "OpenStack", "", MsoLogger.ErrorCode.DataError, "Create VNF: Unknown VNF Type");
-                    LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound, error);
+                        vnfType, "OpenStack", "", MsoLogger.ErrorCode.DataError, "Create VNF: Unknown VNF Type");
+                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound,
+                        error);
                     throw new VnfException(error, MsoExceptionCategory.USERDATA);
                 }
                 LOGGER.debug("Got VNF module definition from Catalog: "
-                        + vnfResource.toString());
+                    + vnfResource.toString());
             }
             // By here - we have either a vf or vnfResource
 
@@ -930,7 +934,8 @@
                     //vnfResource = db.getVnfResourceById(vnfResourceId);
                     vnfResource = db.getVnfResourceByModelUuid(vnfResourceModelUuid);
                     if (vnfResource == null) {
-                        LOGGER.debug("Unable to find vnfResource at " + vnfResourceModelUuid + " will not error for now...");
+                        LOGGER.debug(
+                            "Unable to find vnfResource at " + vnfResourceModelUuid + " will not error for now...");
                     }
                 }
             }
@@ -941,7 +946,7 @@
                     minVersionVnf = vnfResource.getAicVersionMin();
                     maxVersionVnf = vnfResource.getAicVersionMax();
                 } catch (Exception e) {
-                    LOGGER.debug("Unable to pull min/max version for this VNF Resource entry",e);
+                    LOGGER.debug("Unable to pull min/max version for this VNF Resource entry", e);
                     minVersionVnf = null;
                     maxVersionVnf = null;
                 }
@@ -974,17 +979,26 @@
                             moreThanMax = aicV.isMoreRecentThan(maxVersionVnf);
                             equalToMax = aicV.isTheSameVersion(maxVersionVnf);
                         } catch (Exception e) {
-                            LOGGER.debug("An exception occured while trying to test AIC Version " + e.getMessage() + " - will default to not check",e);
+                            LOGGER.debug("An exception occured while trying to test AIC Version " + e.getMessage()
+                                + " - will default to not check", e);
                             doNotTest = true;
                         }
                         if (!doNotTest) {
                             if ((moreThanMin || equalToMin) // aic >= min
-                                    && (equalToMax || !(moreThanMax))) { //aic <= max
-                                LOGGER.debug("VNF Resource " + vnfResource.getModelName() + ", ModelUuid=" + vnfResource.getModelUuid() + " VersionMin=" + minVersionVnf + " VersionMax:" + maxVersionVnf + " supported on Cloud: " + cloudSiteOpt.get().getId() + " with AIC_Version:" + cloudSiteOpt.get().getAic_version());
+                                && (equalToMax || !(moreThanMax))) { //aic <= max
+                                LOGGER.debug("VNF Resource " + vnfResource.getModelName() + ", ModelUuid=" + vnfResource
+                                    .getModelUuid() + " VersionMin=" + minVersionVnf + " VersionMax:" + maxVersionVnf
+                                    + " supported on Cloud: " + cloudSiteOpt.get().getId() + " with AIC_Version:"
+                                    + cloudSiteOpt.get().getAic_version());
                             } else {
                                 // ERROR
-                                String error = "VNF Resource type: " + vnfResource.getModelName() + ", ModelUuid=" + vnfResource.getModelUuid() + " VersionMin=" + minVersionVnf + " VersionMax:" + maxVersionVnf + " NOT supported on Cloud: " + cloudSiteOpt.get().getId() + " with AIC_Version:" + cloudSiteOpt.get().getAic_version();
-                                LOGGER.error(MessageEnum.RA_CONFIG_EXC, error, "OpenStack", "", MsoLogger.ErrorCode.BusinessProcesssError, "Exception - setVersion");
+                                String error =
+                                    "VNF Resource type: " + vnfResource.getModelName() + ", ModelUuid=" + vnfResource
+                                        .getModelUuid() + " VersionMin=" + minVersionVnf + " VersionMax:"
+                                        + maxVersionVnf + " NOT supported on Cloud: " + cloudSiteOpt.get().getId()
+                                        + " with AIC_Version:" + cloudSiteOpt.get().getAic_version();
+                                LOGGER.error(MessageEnum.RA_CONFIG_EXC, error, "OpenStack", "",
+                                    MsoLogger.ErrorCode.BusinessProcesssError, "Exception - setVersion");
                                 LOGGER.debug(error);
                                 throw new VnfException(error, MsoExceptionCategory.USERDATA);
                             }
@@ -996,7 +1010,8 @@
                     LOGGER.debug("cloudConfig is NULL - cannot check cloud site version");
                 }
             } else {
-                LOGGER.debug("AIC Version not set in VNF_Resource - this is expected thru 1607 - do not error here - not checked.");
+                LOGGER.debug(
+                    "AIC Version not set in VNF_Resource - this is expected thru 1607 - do not error here - not checked.");
             }
             // End Version check 1607
 
@@ -1018,7 +1033,8 @@
                 }
             } else {
                 if (isVolumeRequest) {
-                    LOGGER.debug("DANGER WILL ROBINSON! This should never apply - a VNF Request (gamma only now) *and* a volume request?");
+                    LOGGER.debug(
+                        "DANGER WILL ROBINSON! This should never apply - a VNF Request (gamma only now) *and* a volume request?");
                     /*
                     VnfComponent vnfComponent = null;
                     vnfComponent = db.getVnfComponent(vnfResource.getId(), "VOLUME");
@@ -1040,11 +1056,14 @@
             // By the time we get here - heatTemplateId and heatEnvtId should be populated (or null)
             HeatTemplate heatTemplate = null;
             if (heatTemplateArtifactUuid == null || "".equals(heatTemplateArtifactUuid)) {
-                String error = "Create: No Heat Template ID defined in catalog database for " + vnfType + ", reqType=" + requestTypeString;
-                LOGGER.error(MessageEnum.RA_VNF_UNKNOWN_PARAM, "Heat Template ID", vnfType, "OpenStack", "", MsoLogger.ErrorCode.DataError, "Create: No Heat Template ID defined in catalog database");
-                LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound, error);
+                String error = "Create: No Heat Template ID defined in catalog database for " + vnfType + ", reqType="
+                    + requestTypeString;
+                LOGGER.error(MessageEnum.RA_VNF_UNKNOWN_PARAM, "Heat Template ID", vnfType, "OpenStack", "",
+                    MsoLogger.ErrorCode.DataError, "Create: No Heat Template ID defined in catalog database");
+                LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound,
+                    error);
                 alarmLogger.sendAlarm(MSO_CONFIGURATION_ERROR,
-                        MsoAlarmLogger.CRITICAL, error);
+                    MsoAlarmLogger.CRITICAL, error);
                 throw new VnfException(error, MsoExceptionCategory.INTERNAL);
             } else {
                 heatTemplate = db.getHeatTemplateByArtifactUuidRegularQuery(heatTemplateArtifactUuid);
@@ -1052,11 +1071,14 @@
             if (heatTemplate == null) {
                 String error = "Create VF/VNF: no entry found for heat template ID = " + heatTemplateArtifactUuid;
                 LOGGER.error(MessageEnum.RA_VNF_UNKNOWN_PARAM,
-                        "Heat Template ID",
-                        String.valueOf(heatTemplateArtifactUuid), "OpenStack", "", MsoLogger.ErrorCode.BusinessProcesssError, "Create VF/VNF: no entry found for heat template ID = " + heatTemplateArtifactUuid);
-                LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound, error);
+                    "Heat Template ID",
+                    String.valueOf(heatTemplateArtifactUuid), "OpenStack", "",
+                    MsoLogger.ErrorCode.BusinessProcesssError,
+                    "Create VF/VNF: no entry found for heat template ID = " + heatTemplateArtifactUuid);
+                LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound,
+                    error);
                 alarmLogger.sendAlarm(MSO_CONFIGURATION_ERROR,
-                        MsoAlarmLogger.CRITICAL, error);
+                    MsoAlarmLogger.CRITICAL, error);
                 throw new VnfException(error, MsoExceptionCategory.INTERNAL);
             }
             LOGGER.debug("Got HEAT Template from DB");
@@ -1065,45 +1087,49 @@
             String heatEnvironmentString = null;
 
             if (heatEnvironmentArtifactUuid != null && !"".equals(heatEnvironmentArtifactUuid)) {
-                LOGGER.debug ("about to call getHeatEnvironment with :" + heatEnvironmentArtifactUuid + ":");
+                LOGGER.debug("about to call getHeatEnvironment with :" + heatEnvironmentArtifactUuid + ":");
                 heatEnvironment = db.getHeatEnvironmentByArtifactUuid(heatEnvironmentArtifactUuid);
                 if (heatEnvironment == null) {
                     String error = "Create VFModule: undefined Heat Environment. VFModule=" + vfModuleType
-                                   + ", Environment ID="
-                                   + heatEnvironmentArtifactUuid;
-                    LOGGER.error (MessageEnum.RA_VNF_UNKNOWN_PARAM, "Heat Environment ID", String.valueOf(heatEnvironmentArtifactUuid), "OpenStack", "getHeatEnvironment", MsoLogger.ErrorCode.BusinessProcesssError, "Create VFModule: undefined Heat Environment");
-                    LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound, error);
+                        + ", Environment ID="
+                        + heatEnvironmentArtifactUuid;
+                    LOGGER.error(MessageEnum.RA_VNF_UNKNOWN_PARAM, "Heat Environment ID",
+                        String.valueOf(heatEnvironmentArtifactUuid), "OpenStack", "getHeatEnvironment",
+                        MsoLogger.ErrorCode.BusinessProcesssError, "Create VFModule: undefined Heat Environment");
+                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound,
+                        error);
                     // Alarm on this error, configuration must be fixed
-                    alarmLogger.sendAlarm (MSO_CONFIGURATION_ERROR, MsoAlarmLogger.CRITICAL, error);
+                    alarmLogger.sendAlarm(MSO_CONFIGURATION_ERROR, MsoAlarmLogger.CRITICAL, error);
 
-                    throw new VnfException (error, MsoExceptionCategory.INTERNAL);
+                    throw new VnfException(error, MsoExceptionCategory.INTERNAL);
                 } else {
-                    LOGGER.debug ("Got Heat Environment from DB: " + heatEnvironment.toString ());
-                    heatEnvironmentString = heatEnvironment.getEnvironment (); //this.parseEnvironment (heatEnvironment.getEnvironment ());
-                    LOGGER.debug ("after parsing: " + heatEnvironmentString);
+                    LOGGER.debug("Got Heat Environment from DB: " + heatEnvironment.toString());
+                    heatEnvironmentString = heatEnvironment
+                        .getEnvironment(); //this.parseEnvironment (heatEnvironment.getEnvironment ());
+                    LOGGER.debug("after parsing: " + heatEnvironmentString);
                 }
             } else {
-                LOGGER.debug ("no environment parameter found for this Type " + vfModuleType);
+                LOGGER.debug("no environment parameter found for this Type " + vfModuleType);
             }
 
             // 1510 - Add the files: for nested templates *if* there are any
-            LOGGER.debug ("In MsoVnfAdapterImpl, createVfModule about to call db.getNestedTemplates avec templateId="
-                          + heatTemplate.getArtifactUuid());
-            Map <String, Object> nestedTemplates = db.getNestedTemplates (heatTemplate.getArtifactUuid());
-            Map <String, Object> nestedTemplatesChecked = new HashMap <> ();
+            LOGGER.debug("In MsoVnfAdapterImpl, createVfModule about to call db.getNestedTemplates avec templateId="
+                + heatTemplate.getArtifactUuid());
+            Map<String, Object> nestedTemplates = db.getNestedTemplates(heatTemplate.getArtifactUuid());
+            Map<String, Object> nestedTemplatesChecked = new HashMap<>();
             if (nestedTemplates != null) {
                 // for debugging print them out
-                LOGGER.debug ("Contents of nestedTemplates - to be added to files: on stack:");
-                for (Map.Entry<String, Object> entry : nestedTemplates.entrySet ()) {
+                LOGGER.debug("Contents of nestedTemplates - to be added to files: on stack:");
+                for (Map.Entry<String, Object> entry : nestedTemplates.entrySet()) {
                     String providerResourceFile = entry.getKey();
                     Object value = entry.getValue();
                     String providerResourceFileChecked = providerResourceFile; //this.enforceFilePrefix (providerResourceFile);
                     String childTemplateBody = (String) value;
-                    LOGGER.debug (providerResourceFileChecked + " -> " + childTemplateBody);
-                    nestedTemplatesChecked.put (providerResourceFileChecked, childTemplateBody);
+                    LOGGER.debug(providerResourceFileChecked + " -> " + childTemplateBody);
+                    nestedTemplatesChecked.put(providerResourceFileChecked, childTemplateBody);
                 }
             } else {
-                LOGGER.debug ("No nested templates found - nothing to do here");
+                LOGGER.debug("No nested templates found - nothing to do here");
                 nestedTemplatesChecked = null; // just to make sure
             }
 
@@ -1115,25 +1141,29 @@
             // Add ability to turn on adding get_files with volume requests (by property).
             boolean addGetFilesOnVolumeReq = false;
             try {
-                String propertyString = msoPropertiesFactory.getMsoJavaProperties(MSO_PROP_VNF_ADAPTER).getProperty(MsoVnfAdapterImpl.ADD_GET_FILES_ON_VOLUME_REQ, null);
+                String propertyString = msoPropertiesFactory.getMsoJavaProperties(MSO_PROP_VNF_ADAPTER)
+                    .getProperty(MsoVnfAdapterImpl.ADD_GET_FILES_ON_VOLUME_REQ, null);
                 if ("true".equalsIgnoreCase(propertyString) || "y".equalsIgnoreCase(propertyString)) {
                     addGetFilesOnVolumeReq = true;
                     LOGGER.debug("AddGetFilesOnVolumeReq - setting to true! " + propertyString);
                 }
             } catch (Exception e) {
-                LOGGER.debug("An error occured trying to get property " + MsoVnfAdapterImpl.ADD_GET_FILES_ON_VOLUME_REQ + " - default to false", e);
+                LOGGER.debug("An error occured trying to get property " + MsoVnfAdapterImpl.ADD_GET_FILES_ON_VOLUME_REQ
+                    + " - default to false", e);
             }
 
             if (!isVolumeRequest || addGetFilesOnVolumeReq) {
                 if (oldWay) {
-                    LOGGER.debug("In MsoVnfAdapterImpl createVfModule, this should not happen - old way is gamma only - no heat files!");
+                    LOGGER.debug(
+                        "In MsoVnfAdapterImpl createVfModule, this should not happen - old way is gamma only - no heat files!");
                     //heatFiles = db.getHeatFiles(vnfResource.getId());
                 } else {
                     // 1607 - now use VF_MODULE_TO_HEAT_FILES table
-                    LOGGER.debug("In MsoVnfAdapterImpl createVfModule, about to call db.getHeatFilesForVfModule avec vfModuleId="
+                    LOGGER.debug(
+                        "In MsoVnfAdapterImpl createVfModule, about to call db.getHeatFilesForVfModule avec vfModuleId="
                             + vf.getModelUUID());
                     heatFiles = db
-                            .getHeatFilesForVfModule(vf.getModelUUID());
+                        .getHeatFilesForVfModule(vf.getModelUUID());
                 }
                 if (heatFiles != null) {
                     // add these to stack - to be done in createStack
@@ -1147,19 +1177,24 @@
                         HeatFiles value = entry.getValue();
                         if (heatFileName.startsWith("_ERROR|")) {
                             // This means there was an invalid entry in VF_MODULE_TO_HEAT_FILES table - the heat file it pointed to could not be found.
-                            String heatFileId = heatFileName.substring(heatFileName.lastIndexOf("|")+1);
-                            String error = "Create: No HEAT_FILES entry in catalog database for " + vfModuleType + " at HEAT_FILES index=" + heatFileId;
+                            String heatFileId = heatFileName.substring(heatFileName.lastIndexOf("|") + 1);
+                            String error = "Create: No HEAT_FILES entry in catalog database for " + vfModuleType
+                                + " at HEAT_FILES index=" + heatFileId;
                             LOGGER.debug(error);
-                            LOGGER.error (MessageEnum.RA_VNF_UNKNOWN_PARAM, "HEAT_FILES entry not found at " + heatFileId, vfModuleType, "OpenStack", "", MsoLogger.ErrorCode.BusinessProcesssError, "HEAT_FILES entry not found");
-                            LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound, error);
+                            LOGGER
+                                .error(MessageEnum.RA_VNF_UNKNOWN_PARAM, "HEAT_FILES entry not found at " + heatFileId,
+                                    vfModuleType, "OpenStack", "", MsoLogger.ErrorCode.BusinessProcesssError,
+                                    "HEAT_FILES entry not found");
+                            LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
+                                MsoLogger.ResponseCode.DataNotFound, error);
                             // Alarm on this error, configuration must be fixed
-                            alarmLogger.sendAlarm (MSO_CONFIGURATION_ERROR, MsoAlarmLogger.CRITICAL, error);
-                            throw new VnfException (error, MsoExceptionCategory.INTERNAL);
+                            alarmLogger.sendAlarm(MSO_CONFIGURATION_ERROR, MsoAlarmLogger.CRITICAL, error);
+                            throw new VnfException(error, MsoExceptionCategory.INTERNAL);
                         }
                         String heatFileBody = value.getFileBody();
                         String heatFileNameChecked = heatFileName;
                         LOGGER.debug(heatFileNameChecked + " -> "
-                                + heatFileBody);
+                            + heatFileBody);
                         heatFilesObjects.put(heatFileNameChecked, heatFileBody);
                     }
                 } else {
@@ -1167,12 +1202,12 @@
                     heatFilesObjects = null;
                 }
             } else {
-                    LOGGER.debug("Volume request - DO NOT CHECK for HEAT_FILES");
+                LOGGER.debug("Volume request - DO NOT CHECK for HEAT_FILES");
             }
 
             // Check that required parameters have been supplied
             StringBuilder missingParams = null;
-            List <String> paramList = new ArrayList <> ();
+            List<String> paramList = new ArrayList<>();
 
             // New for 1510 - consult the PARAM_ALIAS field to see if we've been
             // supplied an alias. Only check if we don't find it initially.
@@ -1181,23 +1216,23 @@
             // shouldn't
             boolean checkRequiredParameters = true;
             try {
-                String propertyString = msoPropertiesFactory.getMsoJavaProperties (MSO_PROP_VNF_ADAPTER)
-                                                     .getProperty (MsoVnfAdapterImpl.CHECK_REQD_PARAMS,null);
-                if ("false".equalsIgnoreCase (propertyString) || "n".equalsIgnoreCase (propertyString)) {
+                String propertyString = msoPropertiesFactory.getMsoJavaProperties(MSO_PROP_VNF_ADAPTER)
+                    .getProperty(MsoVnfAdapterImpl.CHECK_REQD_PARAMS, null);
+                if ("false".equalsIgnoreCase(propertyString) || "n".equalsIgnoreCase(propertyString)) {
                     checkRequiredParameters = false;
-                    LOGGER.debug ("CheckRequiredParameters is FALSE. Will still check but then skip blocking..."
-                                  + MsoVnfAdapterImpl.CHECK_REQD_PARAMS);
+                    LOGGER.debug("CheckRequiredParameters is FALSE. Will still check but then skip blocking..."
+                        + MsoVnfAdapterImpl.CHECK_REQD_PARAMS);
                 }
             } catch (Exception e) {
                 // No problem - default is true
-                LOGGER.debug ("An exception occured trying to get property " + MsoVnfAdapterImpl.CHECK_REQD_PARAMS, e);
+                LOGGER.debug("An exception occured trying to get property " + MsoVnfAdapterImpl.CHECK_REQD_PARAMS, e);
             }
             // 1604 - Add enhanced environment & parameter checking
             // Part 1: parse envt entries to see if reqd parameter is there (before used a simple grep
             // Part 2: only submit to openstack the parameters in the envt that are in the heat template
             // Note this also removes any comments
             MsoHeatEnvironmentEntry mhee = null;
-            if (heatEnvironmentString != null && heatEnvironmentString.contains ("parameters:")) {
+            if (heatEnvironmentString != null && heatEnvironmentString.contains("parameters:")) {
                 //LOGGER.debug ("Have an Environment argument with a parameters: section - will bypass checking for valid params - but will still check for aliases");
                 LOGGER.debug("Enhanced environment checking enabled - 1604");
                 mhee = MsoHeatEnvironmentEntry.create(heatEnvironmentString);
@@ -1235,7 +1270,7 @@
                 }
                 LOGGER.debug(sb.toString());
             } catch (Exception e) {
-                LOGGER.debug("??An exception occurred trying to go through Parameter Names " + e.getMessage(),e);
+                LOGGER.debug("??An exception occurred trying to go through Parameter Names " + e.getMessage(), e);
             }
             // Step 1 - convert what we got as inputs (Map<String, String>) to a
             // Map<String, Object> - where the object matches the param type identified in the template
@@ -1249,21 +1284,22 @@
             heat.copyBaseOutputsToInputs(goldenInputs, nestedVolumeOutputs, parameterNames, aliasToParam);
             this.sendMapToDebug(goldenInputs, "Final inputs sent to openstack");
 
-            for (HeatTemplateParam parm : heatTemplate.getParameters ()) {
-                LOGGER.debug ("Parameter:'" + parm.getParamName ()
-                              + "', isRequired="
-                              + parm.isRequired ()
-                              + ", alias="
-                              + parm.getParamAlias ());
+            for (HeatTemplateParam parm : heatTemplate.getParameters()) {
+                LOGGER.debug("Parameter:'" + parm.getParamName()
+                    + "', isRequired="
+                    + parm.isRequired()
+                    + ", alias="
+                    + parm.getParamAlias());
 
-                if (parm.isRequired () && (goldenInputs == null || !goldenInputs.containsKey (parm.getParamName ()))) {
+                if (parm.isRequired() && (goldenInputs == null || !goldenInputs.containsKey(parm.getParamName()))) {
                     // The check for an alias was moved to the method in MsoHeatUtils - when we converted the Map<String, String> to Map<String, Object>
-                    LOGGER.debug("**Parameter " + parm.getParamName() + " is required and not in the inputs...check environment");
+                    LOGGER.debug("**Parameter " + parm.getParamName()
+                        + " is required and not in the inputs...check environment");
                     if (mhee != null && mhee.containsParameter(parm.getParamName())) {
-                        LOGGER.debug ("Required parameter " + parm.getParamName ()
-                                      + " appears to be in environment - do not count as missing");
+                        LOGGER.debug("Required parameter " + parm.getParamName()
+                            + " appears to be in environment - do not count as missing");
                     } else {
-                        LOGGER.debug ("adding to missing parameters list: " + parm.getParamName ());
+                        LOGGER.debug("adding to missing parameters list: " + parm.getParamName());
                         if (missingParams == null) {
                             missingParams = new StringBuilder(parm.getParamName());
                         } else {
@@ -1271,20 +1307,22 @@
                         }
                     }
                 }
-                paramList.add (parm.getParamName ());
+                paramList.add(parm.getParamName());
             }
             if (missingParams != null) {
                 if (checkRequiredParameters) {
                     // Problem - missing one or more required parameters
                     String error = "Create VFModule: Missing Required inputs: " + missingParams;
-                    LOGGER.error (MessageEnum.RA_MISSING_PARAM, missingParams.toString(), "OpenStack", "", MsoLogger.ErrorCode.DataError, "Create VFModule: Missing Required inputs");
-                    LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.BadRequest, error);
-                    throw new VnfException (error, MsoExceptionCategory.USERDATA);
+                    LOGGER.error(MessageEnum.RA_MISSING_PARAM, missingParams.toString(), "OpenStack", "",
+                        MsoLogger.ErrorCode.DataError, "Create VFModule: Missing Required inputs");
+                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.BadRequest,
+                        error);
+                    throw new VnfException(error, MsoExceptionCategory.USERDATA);
                 } else {
-                    LOGGER.debug ("found missing parameters - but checkRequiredParameters is false - will not block");
+                    LOGGER.debug("found missing parameters - but checkRequiredParameters is false - will not block");
                 }
             } else {
-                LOGGER.debug ("No missing parameters found - ok to proceed");
+                LOGGER.debug("No missing parameters found - ok to proceed");
             }
             // We can now remove the recreating of the ENV with only legit params - that check is done for us,
             // and it causes problems with json that has arrays
@@ -1294,13 +1332,13 @@
             }
 
             // "Fix" the template if it has CR/LF (getting this from Oracle)
-            String template = heatTemplate.getHeatTemplate ();
-            template = template.replaceAll ("\r\n", "\n");
+            String template = heatTemplate.getHeatTemplate();
+            template = template.replaceAll("\r\n", "\n");
 
             // Have the tenant. Now deploy the stack itself
             // Ignore MsoTenantNotFound and MsoStackAlreadyExists exceptions
             // because we already checked for those.
-            long createStackStarttime = System.currentTimeMillis ();
+            long createStackStarttime = System.currentTimeMillis();
             try {
                 // heatStack = heat.createStack(cloudSiteId, tenantId, vnfName, template, inputs, true,
                 // heatTemplate.getTimeoutMinutes());
@@ -1310,47 +1348,59 @@
                 if (heat != null) {
                     LOGGER.debug("heat is not null!!");
                 }
-                    heatStack = heat.createStack (cloudSiteId,
-                                              tenantId,
-                                              vfModuleName,
-                                              template,
-                        goldenInputs,
-                                              true,
-                                              heatTemplate.getTimeoutMinutes (),
-                                              newEnvironmentString,
-                                              nestedTemplatesChecked,
-                                              heatFilesObjects,
-                                              backout.booleanValue());
-                LOGGER.recordMetricEvent (createStackStarttime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully received response from Open Stack", "OpenStack", "CreateStack", vfModuleName);
+                heatStack = heat.createStack(cloudSiteId,
+                    tenantId,
+                    vfModuleName,
+                    template,
+                    goldenInputs,
+                    true,
+                    heatTemplate.getTimeoutMinutes(),
+                    newEnvironmentString,
+                    nestedTemplatesChecked,
+                    heatFilesObjects,
+                    backout.booleanValue());
+                LOGGER
+                    .recordMetricEvent(createStackStarttime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,
+                        "Successfully received response from Open Stack", "OpenStack", "CreateStack", vfModuleName);
             } catch (MsoException me) {
-                me.addContext ("CreateVFModule");
+                me.addContext("CreateVFModule");
                 String error = "Create VF Module " + vfModuleType + " in " + cloudSiteId + "/" + tenantId + ": " + me;
-                LOGGER.recordMetricEvent (createStackStarttime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "CreateStack", vfModuleName);
-                LOGGER.error (MessageEnum.RA_CREATE_VNF_ERR, vfModuleType, cloudSiteId, tenantId, "OpenStack", "", MsoLogger.ErrorCode.DataError, "MsoException - createStack", me);
-                LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
-                throw new VnfException (me);
+                LOGGER.recordMetricEvent(createStackStarttime, MsoLogger.StatusCode.ERROR,
+                    MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "CreateStack", vfModuleName);
+                LOGGER.error(MessageEnum.RA_CREATE_VNF_ERR, vfModuleType, cloudSiteId, tenantId, "OpenStack", "",
+                    MsoLogger.ErrorCode.DataError, "MsoException - createStack", me);
+                LOGGER
+                    .recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError,
+                        error);
+                throw new VnfException(me);
             } catch (NullPointerException npe) {
                 String error = "Create VFModule " + vfModuleType + " in " + cloudSiteId + "/" + tenantId + ": " + npe;
-                LOGGER.recordMetricEvent (createStackStarttime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "CreateStack", vfModuleName);
-                LOGGER.error (MessageEnum.RA_CREATE_VNF_ERR, vfModuleType, cloudSiteId, tenantId, "OpenStack", "", MsoLogger.ErrorCode.DataError, "NullPointerException - createStack", npe);
-                LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
+                LOGGER.recordMetricEvent(createStackStarttime, MsoLogger.StatusCode.ERROR,
+                    MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "CreateStack", vfModuleName);
+                LOGGER.error(MessageEnum.RA_CREATE_VNF_ERR, vfModuleType, cloudSiteId, tenantId, "OpenStack", "",
+                    MsoLogger.ErrorCode.DataError, "NullPointerException - createStack", npe);
+                LOGGER
+                    .recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError,
+                        error);
                 LOGGER.debug("NULL POINTER EXCEPTION at heat.createStack");
                 //npe.addContext ("CreateVNF");
-                throw new VnfException ("NullPointerException during heat.createStack");
+                throw new VnfException("NullPointerException during heat.createStack");
             } catch (Exception e) {
-                LOGGER.recordMetricEvent (createStackStarttime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, "Exception while creating stack with OpenStack", "OpenStack", "CreateStack", vfModuleName);
-                LOGGER.debug("unhandled exception at heat.createStack",e);
-                LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, "Exception while creating stack with OpenStack");
+                LOGGER.recordMetricEvent(createStackStarttime, MsoLogger.StatusCode.ERROR,
+                    MsoLogger.ResponseCode.CommunicationError, "Exception while creating stack with OpenStack",
+                    "OpenStack", "CreateStack", vfModuleName);
+                LOGGER.debug("unhandled exception at heat.createStack", e);
+                LOGGER
+                    .recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError,
+                        "Exception while creating stack with OpenStack");
                 throw new VnfException("Exception during heat.createStack! " + e.getMessage());
             }
         } catch (Exception e) {
-            LOGGER.debug("unhandled exception in create VF",e);
+            LOGGER.debug("unhandled exception in create VF", e);
             throw new VnfException("Exception during create VF " + e.getMessage());
 
-        } finally {
-            // Make sure DB session is closed
-            db.close ();
         }
+        // Make sure DB session is closed
 
         // Reach this point if createStack is successful.
         // Populate remaining rollback info and response parameters.
@@ -1442,19 +1492,17 @@
         String serviceName = VNF_ADAPTER_SERVICE_NAME + methodName;
         MsoLogger.setServiceName (serviceName);
 
-        StringBuilder sbInit = new StringBuilder();
-        sbInit.append("updateVfModule: \n");
-        sbInit.append("cloudSiteId=").append(cloudSiteId).append("\n");
-        sbInit.append("tenantId=").append(tenantId).append("\n");
-        sbInit.append("vnfType=").append(vnfType).append("\n");
-        sbInit.append("vnfVersion=").append(vnfVersion).append("\n");
-        sbInit.append("vnfName=").append(vnfName).append("\n");
-        sbInit.append("requestType=").append(requestType).append("\n");
-        sbInit.append("volumeGroupHeatStackId=").append(volumeGroupHeatStackId).append("\n");
-        sbInit.append("baseVfHeatStackId=").append(baseVfHeatStackId).append("\n");
-        sbInit.append("vfModuleStackId=").append(vfModuleStackId).append("\n");
-        sbInit.append("modelCustomizationUuid=").append(modelCustomizationUuid).append("\n");
-        LOGGER.debug(sbInit.toString());
+        String strInit = "updateVfModule: cloudSiteId=" + cloudSiteId +
+            ",tenantId=" + tenantId +
+            ",vnfType=" + vnfType +
+            ",vnfVersion=" + vnfVersion +
+            ",vnfName=" + vnfName +
+            ",requestType=" + requestType +
+            ",volumeGroupHeatStackId=" + volumeGroupHeatStackId +
+            ",baseVfHeatStackId=" + baseVfHeatStackId +
+            ",vfModuleStackId=" + vfModuleStackId +
+            ",modelCustomizationUuid=" + modelCustomizationUuid;
+        LOGGER.debug(strInit);
 
         String mcu = modelCustomizationUuid;
         boolean useMCUuid = false;
@@ -1635,10 +1683,9 @@
         // Ready to deploy the new VNF
 
         // Get a handle to the Catalog Database
-        CatalogDatabase db = CatalogDatabase.getInstance();
 
         // Make sure DB session is closed
-        try {
+        try (CatalogDatabase db = CatalogDatabase.getInstance()) {
             // Retrieve the VF definition
             VnfResource vnfResource = null;
             VfModule vf = null;
@@ -1653,20 +1700,22 @@
             } else {
                 LOGGER.debug("1707 and later - MUST PROVIDE Model Customization UUID!");
             }
-                if (vf == null) {
+            if (vf == null) {
                 String error = "Update VfModule: unable to find vfModule with modelCustomizationUuid=" + mcu;
-                LOGGER.error (MessageEnum.RA_VNF_UNKNOWN_PARAM, "VF Module Type", vfModuleType, "OpenStack", "", MsoLogger.ErrorCode.DataError, error);
-                LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataError, error);
-                throw new VnfException (error, MsoExceptionCategory.USERDATA);
+                LOGGER.error(MessageEnum.RA_VNF_UNKNOWN_PARAM, "VF Module Type", vfModuleType, "OpenStack", "",
+                    MsoLogger.ErrorCode.DataError, error);
+                LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataError, error);
+                throw new VnfException(error, MsoExceptionCategory.USERDATA);
             }
-            LOGGER.debug ("Got VF module definition from Catalog: " + vf.toString ());
+            LOGGER.debug("Got VF module definition from Catalog: " + vf.toString());
             if (vf.isBase()) {
                 isBaseRequest = true;
                 LOGGER.debug("This a BASE update request");
             } else {
                 LOGGER.debug("This is *not* a BASE VF update request");
                 if (!isVolumeRequest && nestedBaseStackId == null) {
-                    LOGGER.debug("DANGER WILL ROBINSON! This is unexpected - no nestedBaseStackId with this non-base request");
+                    LOGGER.debug(
+                        "DANGER WILL ROBINSON! This is unexpected - no nestedBaseStackId with this non-base request");
                 }
             }
 
@@ -1678,7 +1727,8 @@
                 //vnfResource = db.getVnfResourceById(vnfResourceId);
                 vnfResource = db.getVnfResourceByModelUuid(vnfResourceModelUuid);
                 if (vnfResource == null) {
-                    LOGGER.debug("Unable to find vnfResource at " + vnfResourceModelUuid + " will not error for now...");
+                    LOGGER
+                        .debug("Unable to find vnfResource at " + vnfResourceModelUuid + " will not error for now...");
                 }
             }
             String minVersionVnf = null;
@@ -1688,35 +1738,42 @@
                     minVersionVnf = vnfResource.getAicVersionMin();
                     maxVersionVnf = vnfResource.getAicVersionMax();
                 } catch (Exception e) {
-                    LOGGER.debug("Unable to pull min/max version for this VNF Resource entry",e);
+                    LOGGER.debug("Unable to pull min/max version for this VNF Resource entry", e);
                     minVersionVnf = null;
                     maxVersionVnf = null;
-                    }
+                }
                 if (minVersionVnf != null && "".equals(minVersionVnf)) {
                     minVersionVnf = null;
                 }
                 if (maxVersionVnf != null && "".equals(maxVersionVnf)) {
                     maxVersionVnf = null;
-                    }
                 }
+            }
             if (minVersionVnf != null && maxVersionVnf != null) {
                 MavenLikeVersioning aicV = new MavenLikeVersioning();
                 //String aicVersion = "";
                 if (this.cloudConfig == null) {
                     this.cloudConfig = this.cloudConfigFactory.getCloudConfig();
-            }
+                }
                 // double check
                 if (this.cloudConfig != null) {
                     Optional<CloudSite> cloudSiteOpt = this.cloudConfig.getCloudSite(cloudSiteId);
                     if (cloudSiteOpt.isPresent()) {
                         aicV.setVersion(cloudSiteOpt.get().getAic_version());
                         if ((aicV.isMoreRecentThan(minVersionVnf) || aicV.isTheSameVersion(minVersionVnf)) // aic >= min
-                                && (aicV.isTheSameVersion(maxVersionVnf) || !(aicV.isMoreRecentThan(maxVersionVnf)))) { //aic <= max
-                            LOGGER.debug("VNF Resource " + vnfResource.getModelName() + " VersionMin=" + minVersionVnf + " VersionMax:" + maxVersionVnf + " supported on Cloud: " + cloudSiteOpt.get().getId() + " with AIC_Version:" + cloudSiteOpt.get().getAic_version());
+                            && (aicV.isTheSameVersion(maxVersionVnf) || !(aicV
+                            .isMoreRecentThan(maxVersionVnf)))) { //aic <= max
+                            LOGGER.debug("VNF Resource " + vnfResource.getModelName() + " VersionMin=" + minVersionVnf
+                                + " VersionMax:" + maxVersionVnf + " supported on Cloud: " + cloudSiteOpt.get().getId()
+                                + " with AIC_Version:" + cloudSiteOpt.get().getAic_version());
                         } else {
                             // ERROR
-                            String error = "VNF Resource type: " + vnfResource.getModelName() + " VersionMin=" + minVersionVnf + " VersionMax:" + maxVersionVnf + " NOT supported on Cloud: " + cloudSiteOpt.get().getId() + " with AIC_Version:" + cloudSiteOpt.get().getAic_version();
-                            LOGGER.error(MessageEnum.RA_CONFIG_EXC, error, "OpenStack", "", MsoLogger.ErrorCode.BusinessProcesssError, "Exception - setVersion");
+                            String error =
+                                "VNF Resource type: " + vnfResource.getModelName() + " VersionMin=" + minVersionVnf
+                                    + " VersionMax:" + maxVersionVnf + " NOT supported on Cloud: " + cloudSiteOpt.get()
+                                    .getId() + " with AIC_Version:" + cloudSiteOpt.get().getAic_version();
+                            LOGGER.error(MessageEnum.RA_CONFIG_EXC, error, "OpenStack", "",
+                                MsoLogger.ErrorCode.BusinessProcesssError, "Exception - setVersion");
                             LOGGER.debug(error);
                             throw new VnfException(error, MsoExceptionCategory.USERDATA);
                         }
@@ -1742,11 +1799,15 @@
                 heatEnvironmentArtifactUuid = vfmc.getHeatEnvironmentArtifactUuid();
             }
             if (heatTemplateArtifactUuid == null) {
-                String error = "UpdateVF: No Heat Template ID defined in catalog database for " + vfModuleType + ", reqType=" + requestTypeString;
-                LOGGER.error(MessageEnum.RA_VNF_UNKNOWN_PARAM, "Heat Template ID", vfModuleType, "OpenStack", "", MsoLogger.ErrorCode.DataError, error);
-                LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound, error);
+                String error =
+                    "UpdateVF: No Heat Template ID defined in catalog database for " + vfModuleType + ", reqType="
+                        + requestTypeString;
+                LOGGER.error(MessageEnum.RA_VNF_UNKNOWN_PARAM, "Heat Template ID", vfModuleType, "OpenStack", "",
+                    MsoLogger.ErrorCode.DataError, error);
+                LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound,
+                    error);
                 alarmLogger.sendAlarm(MSO_CONFIGURATION_ERROR,
-                        MsoAlarmLogger.CRITICAL, error);
+                    MsoAlarmLogger.CRITICAL, error);
                 throw new VnfException(error, MsoExceptionCategory.INTERNAL);
             } else {
                 heatTemplate = db.getHeatTemplateByArtifactUuidRegularQuery(heatTemplateArtifactUuid);
@@ -1754,90 +1815,97 @@
 
             if (heatTemplate == null) {
                 String error = "Update VNF: undefined Heat Template. VF="
-                        + vfModuleType + ", heat template id = " + heatTemplateArtifactUuid;
+                    + vfModuleType + ", heat template id = " + heatTemplateArtifactUuid;
                 LOGGER.error(MessageEnum.RA_VNF_UNKNOWN_PARAM,
-                        "Heat Template ID",
-                        String.valueOf(heatTemplateArtifactUuid), "OpenStack", "", MsoLogger.ErrorCode.DataError, error);
-                LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound, error);
+                    "Heat Template ID",
+                    String.valueOf(heatTemplateArtifactUuid), "OpenStack", "", MsoLogger.ErrorCode.DataError, error);
+                LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound,
+                    error);
                 // Alarm on this error, configuration must be fixed
                 alarmLogger.sendAlarm(MSO_CONFIGURATION_ERROR,
-                        MsoAlarmLogger.CRITICAL, error);
+                    MsoAlarmLogger.CRITICAL, error);
 
                 throw new VnfException(error, MsoExceptionCategory.INTERNAL);
             }
 
-            LOGGER.debug ("Got HEAT Template from DB: " + heatTemplate.toString ());
+            LOGGER.debug("Got HEAT Template from DB: " + heatTemplate.toString());
 
             // Add check for any Environment variable
             HeatEnvironment heatEnvironment = null;
             String heatEnvironmentString = null;
 
             if (heatEnvironmentArtifactUuid != null) {
-                LOGGER.debug ("about to call getHeatEnvironment with :" + heatEnvironmentArtifactUuid + ":");
+                LOGGER.debug("about to call getHeatEnvironment with :" + heatEnvironmentArtifactUuid + ":");
                 heatEnvironment = db.getHeatEnvironmentByArtifactUuid(heatEnvironmentArtifactUuid);
                 if (heatEnvironment == null) {
 
                     String error = "Update VNF: undefined Heat Environment. VF=" + vfModuleType
-                                   + ", Environment ID="
-                                   + heatEnvironmentArtifactUuid;
-                    LOGGER.error (MessageEnum.RA_VNF_UNKNOWN_PARAM, "Heat Environment ID", String.valueOf(heatEnvironmentArtifactUuid), "OpenStack", "", MsoLogger.ErrorCode.DataError, error);
-                    LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound, error);
+                        + ", Environment ID="
+                        + heatEnvironmentArtifactUuid;
+                    LOGGER.error(MessageEnum.RA_VNF_UNKNOWN_PARAM, "Heat Environment ID",
+                        String.valueOf(heatEnvironmentArtifactUuid), "OpenStack", "", MsoLogger.ErrorCode.DataError,
+                        error);
+                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound,
+                        error);
                     // Alarm on this error, configuration must be fixed
-                    alarmLogger.sendAlarm (MSO_CONFIGURATION_ERROR, MsoAlarmLogger.CRITICAL, error);
+                    alarmLogger.sendAlarm(MSO_CONFIGURATION_ERROR, MsoAlarmLogger.CRITICAL, error);
 
-                    throw new VnfException (error, MsoExceptionCategory.INTERNAL);
+                    throw new VnfException(error, MsoExceptionCategory.INTERNAL);
                 } else {
-                    LOGGER.debug ("Got Heat Environment from DB: " + heatEnvironment.toString ());
-                    heatEnvironmentString = heatEnvironment.getEnvironment (); //this.parseEnvironment (heatEnvironment.getEnvironment ());
-                    LOGGER.debug ("After parsing: " + heatEnvironmentString);
+                    LOGGER.debug("Got Heat Environment from DB: " + heatEnvironment.toString());
+                    heatEnvironmentString = heatEnvironment
+                        .getEnvironment(); //this.parseEnvironment (heatEnvironment.getEnvironment ());
+                    LOGGER.debug("After parsing: " + heatEnvironmentString);
                 }
             } else {
-                LOGGER.debug ("no environment parameter for this VFModuleType " + vfModuleType);
+                LOGGER.debug("no environment parameter for this VFModuleType " + vfModuleType);
             }
 
-
-            LOGGER.debug ("In MsoVnfAdapterImpl, about to call db.getNestedTemplates avec templateId="
-                          + heatTemplate.getArtifactUuid ());
-            Map <String, Object> nestedTemplates = db.getNestedTemplates (heatTemplate.getArtifactUuid ());
-            Map <String, Object> nestedTemplatesChecked = new HashMap <> ();
+            LOGGER.debug("In MsoVnfAdapterImpl, about to call db.getNestedTemplates avec templateId="
+                + heatTemplate.getArtifactUuid());
+            Map<String, Object> nestedTemplates = db.getNestedTemplates(heatTemplate.getArtifactUuid());
+            Map<String, Object> nestedTemplatesChecked = new HashMap<>();
             if (nestedTemplates != null) {
                 // for debugging print them out
-                LOGGER.debug ("Contents of nestedTemplates - to be added to files: on stack:");
-                for (Map.Entry<String, Object> entry : nestedTemplates.entrySet ()) {
+                LOGGER.debug("Contents of nestedTemplates - to be added to files: on stack:");
+                for (Map.Entry<String, Object> entry : nestedTemplates.entrySet()) {
                     String providerResourceFile = entry.getKey();
                     Object value = entry.getValue();
                     String providerResourceFileChecked = providerResourceFile; //this.enforceFilePrefix (providerResourceFile);
                     String childTemplateBody = (String) value;
-                    nestedTemplatesChecked.put (providerResourceFileChecked, childTemplateBody);
-                    LOGGER.debug (providerResourceFileChecked + " -> " + childTemplateBody);
+                    nestedTemplatesChecked.put(providerResourceFileChecked, childTemplateBody);
+                    LOGGER.debug(providerResourceFileChecked + " -> " + childTemplateBody);
                 }
             } else {
-                LOGGER.debug ("No nested templates found - nothing to do here");
+                LOGGER.debug("No nested templates found - nothing to do here");
                 nestedTemplatesChecked = null;
             }
 
             // Also add the files: for any get_files associated with this VfModule
             // *if* there are any
-            LOGGER.debug ("In MsoVnfAdapterImpl.updateVfModule, about to call db.getHeatFiles avec vfModuleId="
-                          + vf.getModelUUID());
+            LOGGER.debug("In MsoVnfAdapterImpl.updateVfModule, about to call db.getHeatFiles avec vfModuleId="
+                + vf.getModelUUID());
 
-            Map <String, HeatFiles> heatFiles = null;
+            Map<String, HeatFiles> heatFiles = null;
 //            Map <String, HeatFiles> heatFiles = db.getHeatFiles (vnf.getId ());
-            Map <String, Object> heatFilesObjects = new HashMap <> ();
+            Map<String, Object> heatFilesObjects = new HashMap<>();
 
             // Add ability to turn on adding get_files with volume requests (by property).
             boolean addGetFilesOnVolumeReq = false;
             try {
-                String propertyString = msoPropertiesFactory.getMsoJavaProperties(MSO_PROP_VNF_ADAPTER).getProperty(MsoVnfAdapterImpl.ADD_GET_FILES_ON_VOLUME_REQ, null);
+                String propertyString = msoPropertiesFactory.getMsoJavaProperties(MSO_PROP_VNF_ADAPTER)
+                    .getProperty(MsoVnfAdapterImpl.ADD_GET_FILES_ON_VOLUME_REQ, null);
                 if ("true".equalsIgnoreCase(propertyString) || "y".equalsIgnoreCase(propertyString)) {
                     addGetFilesOnVolumeReq = true;
                     LOGGER.debug("AddGetFilesOnVolumeReq - setting to true! " + propertyString);
                 }
             } catch (Exception e) {
-                LOGGER.debug("An error occured trying to get property " + MsoVnfAdapterImpl.ADD_GET_FILES_ON_VOLUME_REQ + " - default to false", e);
+                LOGGER.debug("An error occured trying to get property " + MsoVnfAdapterImpl.ADD_GET_FILES_ON_VOLUME_REQ
+                    + " - default to false", e);
             }
             if (!isVolumeRequest || addGetFilesOnVolumeReq) {
-                LOGGER.debug("In MsoVnfAdapterImpl updateVfModule, about to call db.getHeatFilesForVfModule avec vfModuleId="
+                LOGGER.debug(
+                    "In MsoVnfAdapterImpl updateVfModule, about to call db.getHeatFilesForVfModule avec vfModuleId="
                         + vf.getModelUUID());
 
                 heatFiles = db.getHeatFilesForVfModule(vf.getModelUUID());
@@ -1845,35 +1913,39 @@
                     // add these to stack - to be done in createStack
                     // here, we will map them to Map<String, Object> from Map<String, HeatFiles>
                     // this will match the nested templates format
-                    LOGGER.debug ("Contents of heatFiles - to be added to files: on stack:");
+                    LOGGER.debug("Contents of heatFiles - to be added to files: on stack:");
 
-                    for (Map.Entry<String, HeatFiles> entry : heatFiles.entrySet ()) {
+                    for (Map.Entry<String, HeatFiles> entry : heatFiles.entrySet()) {
                         String heatFileName = entry.getKey();
                         HeatFiles value = entry.getValue();
                         if (heatFileName.startsWith("_ERROR|")) {
                             // This means there was an invalid entry in VF_MODULE_TO_HEAT_FILES table - the heat file it pointed to could not be found.
-                            String heatFileId = heatFileName.substring(heatFileName.lastIndexOf("|")+1);
-                            String error = "Create: No HEAT_FILES entry in catalog database for " + vfModuleType + " at HEAT_FILES index=" + heatFileId;
+                            String heatFileId = heatFileName.substring(heatFileName.lastIndexOf("|") + 1);
+                            String error = "Create: No HEAT_FILES entry in catalog database for " + vfModuleType
+                                + " at HEAT_FILES index=" + heatFileId;
                             LOGGER.debug(error);
-                            LOGGER.error (MessageEnum.RA_VNF_UNKNOWN_PARAM, "HEAT_FILES entry not found at " + heatFileId, vfModuleType, "OpenStack", "", MsoLogger.ErrorCode.DataError, error);
-                            LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound, error);
+                            LOGGER
+                                .error(MessageEnum.RA_VNF_UNKNOWN_PARAM, "HEAT_FILES entry not found at " + heatFileId,
+                                    vfModuleType, "OpenStack", "", MsoLogger.ErrorCode.DataError, error);
+                            LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
+                                MsoLogger.ResponseCode.DataNotFound, error);
                             // Alarm on this error, configuration must be fixed
-                            alarmLogger.sendAlarm (MSO_CONFIGURATION_ERROR, MsoAlarmLogger.CRITICAL, error);
-                            throw new VnfException (error, MsoExceptionCategory.INTERNAL);
+                            alarmLogger.sendAlarm(MSO_CONFIGURATION_ERROR, MsoAlarmLogger.CRITICAL, error);
+                            throw new VnfException(error, MsoExceptionCategory.INTERNAL);
                         }
-                        String heatFileBody = value.getFileBody ();
-                        LOGGER.debug (heatFileName + " -> " + heatFileBody);
-                        heatFilesObjects.put (heatFileName, heatFileBody);
+                        String heatFileBody = value.getFileBody();
+                        LOGGER.debug(heatFileName + " -> " + heatFileBody);
+                        heatFilesObjects.put(heatFileName, heatFileBody);
                     }
                 } else {
-                    LOGGER.debug ("No heat files found -nothing to do here");
+                    LOGGER.debug("No heat files found -nothing to do here");
                     heatFilesObjects = null;
                 }
             }
 
             // Check that required parameters have been supplied
             StringBuilder missingParams = null;
-            List <String> paramList = new ArrayList <> ();
+            List<String> paramList = new ArrayList<>();
 
             // New for 1510 - consult the PARAM_ALIAS field to see if we've been
             // supplied an alias. Only check if we don't find it initially.
@@ -1883,23 +1955,23 @@
             boolean haveEnvironmentParameters = false;
             boolean checkRequiredParameters = true;
             try {
-                String propertyString = msoPropertiesFactory.getMsoJavaProperties (MSO_PROP_VNF_ADAPTER)
-                                                     .getProperty (MsoVnfAdapterImpl.CHECK_REQD_PARAMS,null);
-                if ("false".equalsIgnoreCase (propertyString) || "n".equalsIgnoreCase (propertyString)) {
+                String propertyString = msoPropertiesFactory.getMsoJavaProperties(MSO_PROP_VNF_ADAPTER)
+                    .getProperty(MsoVnfAdapterImpl.CHECK_REQD_PARAMS, null);
+                if ("false".equalsIgnoreCase(propertyString) || "n".equalsIgnoreCase(propertyString)) {
                     checkRequiredParameters = false;
-                    LOGGER.debug ("CheckRequiredParameters is FALSE. Will still check but then skip blocking..."
-                                  + MsoVnfAdapterImpl.CHECK_REQD_PARAMS);
+                    LOGGER.debug("CheckRequiredParameters is FALSE. Will still check but then skip blocking..."
+                        + MsoVnfAdapterImpl.CHECK_REQD_PARAMS);
                 }
             } catch (Exception e) {
                 // No problem - default is true
-                LOGGER.debug ("An exception occured trying to get property " + MsoVnfAdapterImpl.CHECK_REQD_PARAMS, e);
+                LOGGER.debug("An exception occured trying to get property " + MsoVnfAdapterImpl.CHECK_REQD_PARAMS, e);
             }
             // 1604 - Add enhanced environment & parameter checking
             // Part 1: parse envt entries to see if reqd parameter is there (before used a simple grep
             // Part 2: only submit to openstack the parameters in the envt that are in the heat template
             // Note this also removes any comments
             MsoHeatEnvironmentEntry mhee = null;
-            if (heatEnvironmentString != null && heatEnvironmentString.toLowerCase ().contains ("parameters:")) {
+            if (heatEnvironmentString != null && heatEnvironmentString.toLowerCase().contains("parameters:")) {
                 LOGGER.debug("Enhanced environment checking enabled - 1604");
                 mhee = MsoHeatEnvironmentEntry.create(heatEnvironmentString);
                 StringBuilder sb2 = new StringBuilder("\nHeat Template Parameters:\n");
@@ -1921,12 +1993,12 @@
             HashMap<String, JsonNode> jsonParams = new HashMap<>();
             boolean hasJson = false;
 
-            for (HeatTemplateParam parm : heatTemplate.getParameters ()) {
-                LOGGER.debug ("Parameter:'" + parm.getParamName ()
-                              + "', isRequired="
-                              + parm.isRequired ()
-                              + ", alias="
-                              + parm.getParamAlias ());
+            for (HeatTemplateParam parm : heatTemplate.getParameters()) {
+                LOGGER.debug("Parameter:'" + parm.getParamName()
+                    + "', isRequired="
+                    + parm.isRequired()
+                    + ", alias="
+                    + parm.getParamAlias());
                 // handle json
                 String parameterType = parm.getParamType();
                 if (parameterType == null || "".equals(parameterType.trim())) {
@@ -1934,7 +2006,7 @@
                 }
                 JsonNode jsonNode = null;
                 if ("json".equalsIgnoreCase(parameterType) && inputs != null) {
-                    if (inputs.containsKey(parm.getParamName()) ) {
+                    if (inputs.containsKey(parm.getParamName())) {
                         hasJson = true;
                         String jsonString = null;
                         try {
@@ -1944,12 +2016,12 @@
                             //TODO - what to do here?
                             //for now - send the error to debug, but just leave it as a String
                             String errorMessage = jpe.getMessage();
-                            LOGGER.debug("Json Error Converting " + parm.getParamName() + " - " + errorMessage,jpe);
+                            LOGGER.debug("Json Error Converting " + parm.getParamName() + " - " + errorMessage, jpe);
                             hasJson = false;
                             jsonNode = null;
                         } catch (Exception e) {
                             // or here?
-                            LOGGER.debug("Json Error Converting " + parm.getParamName() + " " + e.getMessage(),e);
+                            LOGGER.debug("Json Error Converting " + parm.getParamName() + " " + e.getMessage(), e);
                             hasJson = false;
                             jsonNode = null;
                         }
@@ -1959,56 +2031,55 @@
                     } else if (inputs.containsKey(parm.getParamAlias())) {
                         hasJson = true;
                         String jsonString = null;
-                           try {
+                        try {
                             jsonString = inputs.get(parm.getParamAlias());
                             jsonNode = new ObjectMapper().readTree(jsonString);
                         } catch (JsonParseException jpe) {
                             //TODO - what to do here?
                             //for now - send the error to debug, but just leave it as a String
                             String errorMessage = jpe.getMessage();
-                            LOGGER.debug("Json Error Converting " + parm.getParamName() + " - " + errorMessage,jpe);
+                            LOGGER.debug("Json Error Converting " + parm.getParamName() + " - " + errorMessage, jpe);
                             hasJson = false;
                             jsonNode = null;
                         } catch (Exception e) {
                             // or here?
-                            LOGGER.debug("Json Error Converting " + parm.getParamName() + " " + e.getMessage(),e);
+                            LOGGER.debug("Json Error Converting " + parm.getParamName() + " " + e.getMessage(), e);
                             hasJson = false;
                             jsonNode = null;
                         }
-                           if (jsonNode != null) {
-                               // Notice here - we add it to the jsonParams hashMap with the actual name -
-                               // then manipulate the inputs so when we check for aliases below - it will not
-                               // get flagged.
-                               jsonParams.put(parm.getParamName(), jsonNode);
-                               inputs.remove(parm.getParamAlias());
-                               inputs.put(parm.getParamName(), jsonString);
-                           }
+                        if (jsonNode != null) {
+                            // Notice here - we add it to the jsonParams hashMap with the actual name -
+                            // then manipulate the inputs so when we check for aliases below - it will not
+                            // get flagged.
+                            jsonParams.put(parm.getParamName(), jsonNode);
+                            inputs.remove(parm.getParamAlias());
+                            inputs.put(parm.getParamName(), jsonString);
+                        }
                     } //TODO add a check for the parameter in the env file
                 }
 
-                if (parm.isRequired () && (inputs == null || !inputs.containsKey (parm.getParamName ()))) {
-                    if (inputs.containsKey (parm.getParamAlias ())) {
+                if (parm.isRequired() && (inputs == null || !inputs.containsKey(parm.getParamName()))) {
+                    if (inputs.containsKey(parm.getParamAlias())) {
                         // They've submitted using an alias name. Remove that from inputs, and add back using real name.
-                        String realParamName = parm.getParamName ();
-                        String alias = parm.getParamAlias ();
-                        String value = inputs.get (alias);
-                        LOGGER.debug ("*Found an Alias: paramName=" + realParamName
-                                      + ",alias="
-                                      + alias
-                                      + ",value="
-                                      + value);
-                        inputs.remove (alias);
-                        inputs.put (realParamName, value);
-                        LOGGER.debug (alias + " entry removed from inputs, added back using " + realParamName);
+                        String realParamName = parm.getParamName();
+                        String alias = parm.getParamAlias();
+                        String value = inputs.get(alias);
+                        LOGGER.debug("*Found an Alias: paramName=" + realParamName
+                            + ",alias="
+                            + alias
+                            + ",value="
+                            + value);
+                        inputs.remove(alias);
+                        inputs.put(realParamName, value);
+                        LOGGER.debug(alias + " entry removed from inputs, added back using " + realParamName);
                     }
                     // enhanced - check if it's in the Environment (note: that method
                     else if (mhee != null && mhee.containsParameter(parm.getParamName())) {
 
-                        LOGGER.debug ("Required parameter " + parm.getParamName ()
-                                      + " appears to be in environment - do not count as missing");
-                    }
-                    else {
-                        LOGGER.debug ("adding to missing parameters list: " + parm.getParamName ());
+                        LOGGER.debug("Required parameter " + parm.getParamName()
+                            + " appears to be in environment - do not count as missing");
+                    } else {
+                        LOGGER.debug("adding to missing parameters list: " + parm.getParamName());
                         if (missingParams == null) {
                             missingParams = new StringBuilder(parm.getParamName());
                         } else {
@@ -2016,20 +2087,22 @@
                         }
                     }
                 }
-                paramList.add (parm.getParamName ());
+                paramList.add(parm.getParamName());
             }
             if (missingParams != null) {
                 // Problem - missing one or more required parameters
                 if (checkRequiredParameters) {
-                String error = "Update VNF: Missing Required inputs: " + missingParams;
-                LOGGER.error (MessageEnum.RA_MISSING_PARAM, missingParams.toString(), "OpenStack", "", MsoLogger.ErrorCode.DataError, error);
-                    LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.BadRequest, error);
-                throw new VnfException (error, MsoExceptionCategory.USERDATA);
+                    String error = "Update VNF: Missing Required inputs: " + missingParams;
+                    LOGGER.error(MessageEnum.RA_MISSING_PARAM, missingParams.toString(), "OpenStack", "",
+                        MsoLogger.ErrorCode.DataError, error);
+                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.BadRequest,
+                        error);
+                    throw new VnfException(error, MsoExceptionCategory.USERDATA);
                 } else {
-                    LOGGER.debug ("found missing parameters - but checkRequiredParameters is false - will not block");
+                    LOGGER.debug("found missing parameters - but checkRequiredParameters is false - will not block");
                 }
             } else {
-                LOGGER.debug ("No missing parameters found - ok to proceed");
+                LOGGER.debug("No missing parameters found - ok to proceed");
             }
 
             // Just submit the envt entry as received from the database
@@ -2040,13 +2113,14 @@
 
             // Remove any extraneous parameters (don't throw an error)
             if (inputs != null) {
-                List <String> extraParams = new ArrayList <> ();
-                extraParams.addAll (inputs.keySet ());
+                List<String> extraParams = new ArrayList<>();
+                extraParams.addAll(inputs.keySet());
                 // This is not a valid parameter for this template
-                extraParams.removeAll (paramList);
-                if (!extraParams.isEmpty ()) {
-                    LOGGER.warn (MessageEnum.RA_VNF_EXTRA_PARAM, vnfType, extraParams.toString(), "OpenStack", "", MsoLogger.ErrorCode.DataError, "Extra params");
-                    inputs.keySet ().removeAll (extraParams);
+                extraParams.removeAll(paramList);
+                if (!extraParams.isEmpty()) {
+                    LOGGER.warn(MessageEnum.RA_VNF_EXTRA_PARAM, vnfType, extraParams.toString(), "OpenStack", "",
+                        MsoLogger.ErrorCode.DataError, "Extra params");
+                    inputs.keySet().removeAll(extraParams);
                 }
             }
             // 1607 - when we get here - we have clean inputs. Create inputsTwo in case we have json
@@ -2065,54 +2139,60 @@
             }
 
             // "Fix" the template if it has CR/LF (getting this from Oracle)
-            String template = heatTemplate.getHeatTemplate ();
-            template = template.replaceAll ("\r\n", "\n");
+            String template = heatTemplate.getHeatTemplate();
+            template = template.replaceAll("\r\n", "\n");
 
             // Have the tenant. Now deploy the stack itself
             // Ignore MsoTenantNotFound and MsoStackAlreadyExists exceptions
             // because we already checked for those.
-            long updateStackStarttime = System.currentTimeMillis ();
+            long updateStackStarttime = System.currentTimeMillis();
             try {
                 if (!hasJson) {
-                    heatStack = heatU.updateStack (cloudSiteId,
-                                               tenantId,
-                                               vfModuleName,
-                                               template,
-                                               copyStringInputs (inputs),
-                                               true,
-                                               heatTemplate.getTimeoutMinutes (),
-                                               newEnvironmentString,
-                                               //heatEnvironmentString,
-                                               nestedTemplatesChecked,
-                                               heatFilesObjects);
-                    LOGGER.recordMetricEvent (updateStackStarttime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully receive response from Open Stack", "OpenStack", "UpdateStack", null);
+                    heatStack = heatU.updateStack(cloudSiteId,
+                        tenantId,
+                        vfModuleName,
+                        template,
+                        copyStringInputs(inputs),
+                        true,
+                        heatTemplate.getTimeoutMinutes(),
+                        newEnvironmentString,
+                        //heatEnvironmentString,
+                        nestedTemplatesChecked,
+                        heatFilesObjects);
+                    LOGGER.recordMetricEvent(updateStackStarttime, MsoLogger.StatusCode.COMPLETE,
+                        MsoLogger.ResponseCode.Suc, "Successfully receive response from Open Stack", "OpenStack",
+                        "UpdateStack", null);
                 } else {
-                    heatStack = heatU.updateStack (cloudSiteId,
-                                               tenantId,
-                                               vfModuleName,
-                                               template,
-                                               inputsTwo,
-                                               true,
-                                               heatTemplate.getTimeoutMinutes (),
-                                               newEnvironmentString,
-                                               //heatEnvironmentString,
-                                               nestedTemplatesChecked,
-                                               heatFilesObjects);
-                    LOGGER.recordMetricEvent (updateStackStarttime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully receive response from Open Stack", "OpenStack", "UpdateStack", null);
+                    heatStack = heatU.updateStack(cloudSiteId,
+                        tenantId,
+                        vfModuleName,
+                        template,
+                        inputsTwo,
+                        true,
+                        heatTemplate.getTimeoutMinutes(),
+                        newEnvironmentString,
+                        //heatEnvironmentString,
+                        nestedTemplatesChecked,
+                        heatFilesObjects);
+                    LOGGER.recordMetricEvent(updateStackStarttime, MsoLogger.StatusCode.COMPLETE,
+                        MsoLogger.ResponseCode.Suc, "Successfully receive response from Open Stack", "OpenStack",
+                        "UpdateStack", null);
 
                 }
             } catch (MsoException me) {
-                me.addContext ("UpdateVFModule");
+                me.addContext("UpdateVFModule");
                 String error = "Update VFModule " + vfModuleType + " in " + cloudSiteId + "/" + tenantId + ": " + me;
-                LOGGER.recordMetricEvent (updateStackStarttime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "UpdateStack", null);
-                LOGGER.error (MessageEnum.RA_UPDATE_VNF_ERR, vfModuleType, cloudSiteId, tenantId, "OpenStack", "", MsoLogger.ErrorCode.DataError, "Exception - " + error, me);
-                LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
-                throw new VnfException (me);
+                LOGGER.recordMetricEvent(updateStackStarttime, MsoLogger.StatusCode.ERROR,
+                    MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "UpdateStack", null);
+                LOGGER.error(MessageEnum.RA_UPDATE_VNF_ERR, vfModuleType, cloudSiteId, tenantId, "OpenStack", "",
+                    MsoLogger.ErrorCode.DataError, "Exception - " + error, me);
+                LOGGER
+                    .recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError,
+                        error);
+                throw new VnfException(me);
             }
-        } finally {
-            // Make sure DB session is closed
-            db.close ();
         }
+        // Make sure DB session is closed
 
         // Reach this point if updateStack is successful.
         // Populate remaining rollback info and response parameters.
diff --git a/adapters/mso-vnf-adapter/src/main/java/org/openecomp/mso/vdu/utils/VduInfo.java b/adapters/mso-vnf-adapter/src/main/java/org/openecomp/mso/vdu/utils/VduInfo.java
index 53300c9..3646b29 100755
--- a/adapters/mso-vnf-adapter/src/main/java/org/openecomp/mso/vdu/utils/VduInfo.java
+++ b/adapters/mso-vnf-adapter/src/main/java/org/openecomp/mso/vdu/utils/VduInfo.java
@@ -35,8 +35,8 @@
 	private String vduInstanceId = "";
 	private String vduInstanceName = "";
 	private VduStatus status = VduStatus.NOTFOUND;
-	private Map<String,Object> outputs = new HashMap<String,Object>();
-	private Map<String,Object> inputs = new HashMap<String,Object>();
+	private Map<String,Object> outputs = new HashMap<>();
+	private Map<String,Object> inputs = new HashMap<>();
 	private String lastAction;
 	private String actionStatus;
 	private String errorMessage;
diff --git a/adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/adapters/vnf/test/MsoVnfAdapterAsyncImplTest.java b/adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/adapters/vnf/test/MsoVnfAdapterAsyncImplTest.java
index a045b00..acde315 100644
--- a/adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/adapters/vnf/test/MsoVnfAdapterAsyncImplTest.java
+++ b/adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/adapters/vnf/test/MsoVnfAdapterAsyncImplTest.java
@@ -44,7 +44,7 @@
 		try {
 
 			instance.createVnfA("mdt1", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "vSAMP12", "VFMOD",
-					"volumeGroupHeatStackId|1", new HashMap<String, String>(), Boolean.FALSE, Boolean.TRUE, "messageId",
+					"volumeGroupHeatStackId|1", new HashMap<>(), Boolean.FALSE, Boolean.TRUE, "messageId",
 					null, "http://org.openecomp.mso/notify/adapterNotify/updateVnfNotificationRequest");
 		} catch (Exception e) {
 
diff --git a/adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/adapters/vnf/test/MsoVnfAdapterImplTest.java b/adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/adapters/vnf/test/MsoVnfAdapterImplTest.java
index 6f01954..eec2257 100644
--- a/adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/adapters/vnf/test/MsoVnfAdapterImplTest.java
+++ b/adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/adapters/vnf/test/MsoVnfAdapterImplTest.java
@@ -48,8 +48,8 @@
 		try {
 			instance.createVfModule("mdt1", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "vSAMP12", "VFMOD",
 					"volumeGroupHeatStackId|1", "baseVfHeatStackId", "88a6ca3ee0394ade9403f075db23167e", map,
-					Boolean.FALSE, Boolean.TRUE, msoRequest, new Holder<>(), new Holder<Map<String, String>>(),
-					new Holder<VnfRollback>());
+					Boolean.FALSE, Boolean.TRUE, msoRequest, new Holder<>(), new Holder<>(),
+                new Holder<>());
 		} catch (Exception e) {
 
 		}
@@ -67,8 +67,8 @@
 		try {
 			instance.updateVfModule("mdt1", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "vSAMP12", "VFMOD",
 					"volumeGroupHeatStackId|1", "baseVfHeatStackId", "vfModuleStackId",
-					"88a6ca3ee0394ade9403f075db23167e", map, msoRequest, new Holder<Map<String, String>>(),
-					new Holder<VnfRollback>());
+					"88a6ca3ee0394ade9403f075db23167e", map, msoRequest, new Holder<>(),
+                new Holder<>());
 		} catch (Exception e) {
 
 		}
@@ -82,7 +82,7 @@
 		msoRequest.setServiceInstanceId("12345");
 		try {
 			instance.deleteVfModule("mdt1", "88a6ca3ee0394ade9403f075db23167e", "vSAMP12", msoRequest,
-					new Holder<Map<String, String>>());
+                new Holder<>());
 		} catch (Exception e) {
 
 		}
diff --git a/adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/adapters/vnf/test/QueryTest.java b/adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/adapters/vnf/test/QueryTest.java
index f6e79e1..d898a65 100644
--- a/adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/adapters/vnf/test/QueryTest.java
+++ b/adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/adapters/vnf/test/QueryTest.java
@@ -55,10 +55,10 @@
             String cloudId = "MT";
             String tenantId = "MSO_Test";
             String vnfName = "VNF_TEST1";
-            Holder<Boolean> vnfExists = new Holder<Boolean>();
-            Holder<String> vnfId = new Holder<String>();
-            Holder<VnfStatus> status = new Holder<VnfStatus>();
-            Holder<Map<String, String>> outputs = new Holder<Map<String, String>>();
+            Holder<Boolean> vnfExists = new Holder<>();
+            Holder<String> vnfId = new Holder<>();
+            Holder<VnfStatus> status = new Holder<>();
+            Holder<Map<String, String>> outputs = new Holder<>();
 
             vnfAdapter.queryVnf(cloudId, tenantId, vnfName, null,
                     vnfExists, vnfId, status, outputs);
@@ -82,10 +82,10 @@
             String cloudId = "MT";
             String tenantId = "MSO_Test";
             String vnfName = "VNF_TEST1";
-            Holder<Boolean> vnfExists = new Holder<Boolean>();
-            Holder<String> vnfId = new Holder<String>();
-            Holder<VnfStatus> status = new Holder<VnfStatus>();
-            Holder<Map<String, String>> outputs = new Holder<Map<String, String>>();
+            Holder<Boolean> vnfExists = new Holder<>();
+            Holder<String> vnfId = new Holder<>();
+            Holder<VnfStatus> status = new Holder<>();
+            Holder<Map<String, String>> outputs = new Holder<>();
 
             vnfAdapter.queryVnf(cloudId, tenantId, vnfName, null,
                     vnfExists, vnfId, status, outputs);
@@ -101,10 +101,10 @@
             String cloudId = "MT";
             String tenantId = "MSO_Test";
             String vnfName = "VNF_TEST1";
-            Holder<Boolean> vnfExists = new Holder<Boolean>();
-            Holder<String> vnfId = new Holder<String>();
-            Holder<VnfStatus> status = new Holder<VnfStatus>();
-            Holder<Map<String, String>> outputs = new Holder<Map<String, String>>();
+            Holder<Boolean> vnfExists = new Holder<>();
+            Holder<String> vnfId = new Holder<>();
+            Holder<VnfStatus> status = new Holder<>();
+            Holder<Map<String, String>> outputs = new Holder<>();
 
             vnfAdapter.queryVnf(cloudId, tenantId, vnfName, null,
                     vnfExists, vnfId, status, outputs);
diff --git a/adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/adapters/vnf/test/VnfCreateTest.java b/adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/adapters/vnf/test/VnfCreateTest.java
index 52e1797..000ed8a 100644
--- a/adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/adapters/vnf/test/VnfCreateTest.java
+++ b/adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/adapters/vnf/test/VnfCreateTest.java
@@ -42,16 +42,16 @@
 		String tenantName = "John_Test";
 		String vnfType = "ApacheDemo";
 		String vnfName = "AdapterTest";
-		Map<String,String> inputs = new HashMap<String,String>();
+		Map<String,String> inputs = new HashMap<>();
 		inputs.put("vnf_id", "abc");
 		inputs.put("extra", "whocares");
 		inputs.put("private_subnet_gateway", "10.4.1.1");
 		inputs.put("private_subnet_cidr", "10.4.1.0/29");
 		
 		// Web Service Outputs
-		Holder<String> vnfId = new Holder<String>();
-		Holder<Map<String,String>> outputs = new Holder<Map<String,String>>();
-		Holder<VnfRollback> vnfRollback = new Holder<VnfRollback>();
+		Holder<String> vnfId = new Holder<>();
+		Holder<Map<String,String>> outputs = new Holder<>();
+		Holder<VnfRollback> vnfRollback = new Holder<>();
 
 		try {
 			vnfAdapter.createVnf(cloudId, tenantName, vnfType,null, vnfName, null, null, inputs, false, true, null,
diff --git a/adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/adapters/vnf/test/VnfQueryTest.java b/adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/adapters/vnf/test/VnfQueryTest.java
index 84f2f2f..bbffddf 100644
--- a/adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/adapters/vnf/test/VnfQueryTest.java
+++ b/adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/adapters/vnf/test/VnfQueryTest.java
@@ -39,10 +39,10 @@
 		String cloudId = "MT";
 		String tenantId = "MSO_Test";
 		String vnfName = "VNF_TEST1";
-		Holder<Boolean> vnfExists = new Holder<Boolean>();
-		Holder<String> vnfId = new Holder<String>();
-		Holder<VnfStatus> status = new Holder<VnfStatus>();
-		Holder<Map<String,String>> outputs = new Holder<Map<String,String>>();
+		Holder<Boolean> vnfExists = new Holder<>();
+		Holder<String> vnfId = new Holder<>();
+		Holder<VnfStatus> status = new Holder<>();
+		Holder<Map<String,String>> outputs = new Holder<>();
 		
 		try {
 			vnfAdapter.queryVnf(cloudId, tenantId, vnfName, null,
diff --git a/adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/vdu/utils/VduBlueprintTest.java b/adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/vdu/utils/VduBlueprintTest.java
index 21a71cc..019ae1e 100644
--- a/adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/vdu/utils/VduBlueprintTest.java
+++ b/adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/vdu/utils/VduBlueprintTest.java
@@ -60,7 +60,7 @@
     @Test
     public void testGetTemplateFiles() {
         byte[] templateFileData = "some template file data".getBytes();
-        templateFiles = new HashMap<String, byte[]>();
+        templateFiles = new HashMap<>();
         templateFiles.put("templateKey1", templateFileData);
         vduBlueprint.setTemplateFiles(templateFiles);
         Assert.assertNotNull(vduBlueprint.getTemplateFiles());
@@ -71,7 +71,7 @@
     @Test
     public void testGetAttachedFiles() {
         byte[] attachedFileData = "some file data".getBytes();
-        attachedFiles = new HashMap<String, byte[]>();
+        attachedFiles = new HashMap<>();
         attachedFiles.put("attachedKey1", attachedFileData);
         vduBlueprint.setAttachedFiles(attachedFiles);
         Assert.assertNotNull(vduBlueprint.getAttachedFiles());
diff --git a/adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/vdu/utils/VduInfoTest.java b/adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/vdu/utils/VduInfoTest.java
new file mode 100644
index 0000000..4a29c32
--- /dev/null
+++ b/adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/vdu/utils/VduInfoTest.java
@@ -0,0 +1,89 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2018 TechMahindra
+ * ================================================================================
+ * 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.vdu.utils;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+public class VduInfoTest {
+
+    private VduInfo vduInfo;
+    private VduStatus status = VduStatus.NOTFOUND;
+    private Map<String, Object> outputs;
+    private Map<String, Object> inputs;
+
+    @Before
+    public void setUp() {
+        vduInfo = new VduInfo();
+    }
+
+    @Test
+    public void testGetVnfInstanceId() {
+        String vnfInstanceId = "vnfInstanceId";
+        vduInfo.setVnfInstanceId(vnfInstanceId);
+        Assert.assertNotNull(vduInfo.getVnfInstanceId());
+        Assert.assertEquals(vduInfo.getVnfInstanceId(), "vnfInstanceId");
+    }
+
+    @Test
+    public void testGetVnfInstanceName() {
+        String vnfInstanceName = "vnfInstanceName";
+        vduInfo.setVnfInstanceName(vnfInstanceName);
+        Assert.assertNotNull(vduInfo.getVnfInstanceName());
+        Assert.assertEquals(vduInfo.getVnfInstanceName(), "vnfInstanceName");
+    }
+
+    @Test
+    public void testGetStatus() {
+        vduInfo.setStatus(status);
+        Assert.assertNotNull(vduInfo.getStatus());
+        Assert.assertEquals(status, vduInfo.getStatus());
+    }
+
+    @Test
+    public void testGetOutputs() {
+        Object obj = new Object();
+        String str = "some text";
+        outputs = new HashMap<String, Object>();
+        outputs.put(str, obj);
+        vduInfo.setOutputs(outputs);
+        Assert.assertNotNull(vduInfo.getOutputs());
+        Assert.assertTrue(vduInfo.getOutputs().containsKey(str));
+        Assert.assertTrue(vduInfo.getOutputs().containsValue(obj));
+    }
+
+    @Test
+    public void testGetInputs() {
+        Object obj = new Object();
+        String str = "some text";
+        inputs = new HashMap<String, Object>();
+        inputs.put(str, obj);
+        vduInfo.setInputs(inputs);
+        Assert.assertNotNull(vduInfo.getInputs());
+        Assert.assertTrue(vduInfo.getInputs().containsKey(str));
+        Assert.assertTrue(vduInfo.getInputs().containsValue(obj));
+    }
+
+}
diff --git a/asdc-controller/src/main/java/org/openecomp/mso/asdc/client/ASDCConfiguration.java b/asdc-controller/src/main/java/org/openecomp/mso/asdc/client/ASDCConfiguration.java
index 6cfe90b..e069989 100644
--- a/asdc-controller/src/main/java/org/openecomp/mso/asdc/client/ASDCConfiguration.java
+++ b/asdc-controller/src/main/java/org/openecomp/mso/asdc/client/ASDCConfiguration.java
@@ -399,7 +399,7 @@
 
         MsoJsonProperties msoProp;
         try {
-            List <String> result = new ArrayList <String> ();
+            List <String> result = new ArrayList<>();
             msoProp = new MsoPropertiesFactory ().getMsoJsonProperties (MSO_PROP_ASDC);
 
             if (msoProp.getJsonRootNode ().get (PARAMETER_PATTERN) != null) {
diff --git a/asdc-controller/src/main/java/org/openecomp/mso/asdc/client/ASDCGlobalController.java b/asdc-controller/src/main/java/org/openecomp/mso/asdc/client/ASDCGlobalController.java
index 251888e..295dddd 100644
--- a/asdc-controller/src/main/java/org/openecomp/mso/asdc/client/ASDCGlobalController.java
+++ b/asdc-controller/src/main/java/org/openecomp/mso/asdc/client/ASDCGlobalController.java
@@ -41,7 +41,7 @@
 public class ASDCGlobalController {
 
     private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.ASDC);
-    private Map <String,ASDCController> controllers = new HashMap <String,ASDCController> ();
+    private Map <String,ASDCController> controllers = new HashMap<>();
         
     private MsoJsonProperties msoProp= null;
     
@@ -149,7 +149,7 @@
     }
 
     public void closeASDC () {
-    	List<String> controllerToRemove = new LinkedList<String>();
+    	List<String> controllerToRemove = new LinkedList<>();
     	
         for (ASDCController controller : controllers.values()) {
             try {
diff --git a/asdc-controller/src/main/java/org/openecomp/mso/asdc/installer/VfModuleStructure.java b/asdc-controller/src/main/java/org/openecomp/mso/asdc/installer/VfModuleStructure.java
index be86574..c9bde98 100644
--- a/asdc-controller/src/main/java/org/openecomp/mso/asdc/installer/VfModuleStructure.java
+++ b/asdc-controller/src/main/java/org/openecomp/mso/asdc/installer/VfModuleStructure.java
@@ -47,7 +47,7 @@
 		vfModuleMetadata = vfmoduleMetadata;
 		parentVfResource = vfParentResource;
 
-		artifactsMap = new HashMap<String, List<VfModuleArtifact>>();
+		artifactsMap = new HashMap<>();
 
 		for (String artifactUUID:this.vfModuleMetadata.getArtifacts()) {
 			if (vfParentResource.getArtifactsMapByUUID().containsKey(artifactUUID)) {
@@ -64,7 +64,7 @@
 			artifactsMap.get(vfModuleArtifact.getArtifactInfo().getArtifactType()).add(vfModuleArtifact);
 
 		} else {
-			List<VfModuleArtifact> nestedList = new LinkedList<VfModuleArtifact>();
+			List<VfModuleArtifact> nestedList = new LinkedList<>();
 			nestedList.add(vfModuleArtifact);
 
 			artifactsMap.put(vfModuleArtifact.getArtifactInfo().getArtifactType(), nestedList);
@@ -73,7 +73,7 @@
 
 	public List<VfModuleArtifact> getOrderedArtifactList() {
 
-		List <VfModuleArtifact> artifactsList = new LinkedList <VfModuleArtifact>();
+		List <VfModuleArtifact> artifactsList = new LinkedList<>();
 
 		artifactsList.addAll(artifactsMap.get(ASDCConfiguration.HEAT));
 		artifactsList.addAll(artifactsMap.get(ASDCConfiguration.HEAT_ENV));
diff --git a/asdc-controller/src/main/java/org/openecomp/mso/asdc/installer/VfResourceStructure.java b/asdc-controller/src/main/java/org/openecomp/mso/asdc/installer/VfResourceStructure.java
index c2879a4..e9e39d7 100644
--- a/asdc-controller/src/main/java/org/openecomp/mso/asdc/installer/VfResourceStructure.java
+++ b/asdc-controller/src/main/java/org/openecomp/mso/asdc/installer/VfResourceStructure.java
@@ -101,8 +101,8 @@
 		resourceInstance=resourceinstance;
 
 
-		vfModulesStructureList = new LinkedList<VfModuleStructure>();
-		artifactsMapByUUID =  new HashMap<String, VfModuleArtifact>();
+		vfModulesStructureList = new LinkedList<>();
+		artifactsMapByUUID = new HashMap<>();
 	}
 
 	//@Override
diff --git a/asdc-controller/src/main/java/org/openecomp/mso/asdc/util/NotificationLogging.java b/asdc-controller/src/main/java/org/openecomp/mso/asdc/util/NotificationLogging.java
index 126114d..c0a1f53 100644
--- a/asdc-controller/src/main/java/org/openecomp/mso/asdc/util/NotificationLogging.java
+++ b/asdc-controller/src/main/java/org/openecomp/mso/asdc/util/NotificationLogging.java
@@ -107,7 +107,7 @@
 		return buffer.toString();
 	}
 	
-	private static final boolean isGetter(Method method) {
+	private static boolean isGetter(Method method) {
 
 		// Must start with a valid (and known) prefix
 		boolean prefixFound = false;
@@ -156,7 +156,7 @@
 				INotificationData.class.getClassLoader(),
 				new Class[] { INotificationData.class },
 				NotificationLogging.getHandler());
-		objectMethodsToLog.put(proxy, new ArrayList<Method>());
+		objectMethodsToLog.put(proxy, new ArrayList<>());
 	}
 	
 	private static <T> void methodToLog(T methodCall) {
diff --git a/asdc-controller/src/main/java/org/openecomp/mso/asdc/util/YamlEditor.java b/asdc-controller/src/main/java/org/openecomp/mso/asdc/util/YamlEditor.java
index a90fdeb..f6f1af5 100644
--- a/asdc-controller/src/main/java/org/openecomp/mso/asdc/util/YamlEditor.java
+++ b/asdc-controller/src/main/java/org/openecomp/mso/asdc/util/YamlEditor.java
@@ -58,7 +58,7 @@
     }
 
     public synchronized List <String> getYamlNestedFileResourceTypeList () {
-        List <String> typeList = new ArrayList <String> ();
+        List <String> typeList = new ArrayList<>();
 
         @SuppressWarnings("unchecked")
         Map <String, Object> resourceMap = (Map <String, Object>) yml.get ("resources");
@@ -78,7 +78,7 @@
     }
     
     public synchronized List <String> getYamlResourceTypeList () {
-        List <String> typeList = new ArrayList <String> ();
+        List <String> typeList = new ArrayList<>();
 
         @SuppressWarnings("unchecked")
         Map <String, Object> resourceMap = (Map <String, Object>) yml.get ("resources");
@@ -95,7 +95,7 @@
     // Within Heat Template, under parameters catalog, it might indicate the default value of the parameter
     // If default value exist, the parameter is not mandatory, otherwise its value should be set
     public synchronized Set <HeatTemplateParam> getParameterList (String artifactUUID) {
-        Set <HeatTemplateParam> paramSet = new HashSet <HeatTemplateParam> ();
+        Set <HeatTemplateParam> paramSet = new HashSet<>();
         @SuppressWarnings("unchecked")
         Map <String, Object> resourceMap = (Map <String, Object>) yml.get ("parameters");
 
@@ -130,11 +130,11 @@
         @SuppressWarnings("unchecked")
         Map <String, Object> resourceMap = (Map <String, Object>) yml.get ("parameters");
         if (resourceMap == null) {
-            resourceMap = new LinkedHashMap <String, Object> ();
+            resourceMap = new LinkedHashMap<>();
             this.yml.put ("parameters", resourceMap);
         }
         for (HeatTemplateParam heatParam : heatSet) {
-            Map <String, Object> paramInfo = new HashMap <String, Object> ();
+            Map <String, Object> paramInfo = new HashMap<>();
             paramInfo.put ("type", heatParam.getParamType ());
 
             resourceMap.put (heatParam.getParamName (), paramInfo);
diff --git a/asdc-controller/src/test/java/org/openecomp/mso/asdc/client/tests/ASDCControllerTest.java b/asdc-controller/src/test/java/org/openecomp/mso/asdc/client/tests/ASDCControllerTest.java
index 45bd7cf..5026b51 100644
--- a/asdc-controller/src/test/java/org/openecomp/mso/asdc/client/tests/ASDCControllerTest.java
+++ b/asdc-controller/src/test/java/org/openecomp/mso/asdc/client/tests/ASDCControllerTest.java
@@ -117,7 +117,7 @@
 		Mockito.when(artifactInfo1.getArtifactDescription()).thenReturn("testos artifact1");
 
 		// Now provision the NotificationData mock
-		List<IArtifactInfo> listArtifact = new ArrayList<IArtifactInfo>();
+		List<IArtifactInfo> listArtifact = new ArrayList<>();
 		listArtifact.add(artifactInfo1);
 
 		// Create fake resource Instance
diff --git a/asdc-controller/src/test/java/org/openecomp/mso/asdc/client/tests/ASDCGlobalControllerTest.java b/asdc-controller/src/test/java/org/openecomp/mso/asdc/client/tests/ASDCGlobalControllerTest.java
index b752cfb..73c5456 100644
--- a/asdc-controller/src/test/java/org/openecomp/mso/asdc/client/tests/ASDCGlobalControllerTest.java
+++ b/asdc-controller/src/test/java/org/openecomp/mso/asdc/client/tests/ASDCGlobalControllerTest.java
@@ -109,7 +109,7 @@
 		Mockito.when(artifactInfo1.getArtifactDescription()).thenReturn("testos artifact1");
 
 		// Now provision the NotificationData mock
-		List<IArtifactInfo> listArtifact = new ArrayList<IArtifactInfo>();
+		List<IArtifactInfo> listArtifact = new ArrayList<>();
 		listArtifact.add(artifactInfo1);
 
 		// Create fake resource Instance
diff --git a/asdc-controller/src/test/java/org/openecomp/mso/asdc/client/tests/YamlTest.java b/asdc-controller/src/test/java/org/openecomp/mso/asdc/client/tests/YamlTest.java
index d7c8315..589968e 100644
--- a/asdc-controller/src/test/java/org/openecomp/mso/asdc/client/tests/YamlTest.java
+++ b/asdc-controller/src/test/java/org/openecomp/mso/asdc/client/tests/YamlTest.java
@@ -76,7 +76,7 @@
 		    	InputStream input = new FileInputStream(new File("src/test/resources/resource-examples/simpleTestWithoutParam.yaml"));
 		    	YamlEditor decoder = new YamlEditor (IOUtils.toByteArray(input));
 		    	
-		    	Set <HeatTemplateParam> newParamSet = new HashSet <HeatTemplateParam> (); 
+		    	Set <HeatTemplateParam> newParamSet = new HashSet<>();
 		    	
 		    	HeatTemplateParam heatParam1 = new HeatTemplateParam();
 		    	heatParam1.setHeatTemplateArtifactUuid("1");
@@ -108,7 +108,7 @@
 		    	InputStream input = new FileInputStream(new File("src/test/resources/resource-examples/simpleTest.yaml"));
 		    	YamlEditor decoder = new YamlEditor (IOUtils.toByteArray(input));
 		    	
-		    	Set <HeatTemplateParam> newParamSet = new HashSet <HeatTemplateParam> (); 
+		    	Set <HeatTemplateParam> newParamSet = new HashSet<>();
 		    	
 		    	HeatTemplateParam heatParam1 = new HeatTemplateParam();
 		    	heatParam1.setHeatTemplateArtifactUuid("1");
diff --git a/asdc-controller/src/test/java/org/openecomp/mso/asdc/installer/heat/tests/ToscaResourceInstallerTest.java b/asdc-controller/src/test/java/org/openecomp/mso/asdc/installer/heat/tests/ToscaResourceInstallerTest.java
index a4563c6..9c20a08 100644
--- a/asdc-controller/src/test/java/org/openecomp/mso/asdc/installer/heat/tests/ToscaResourceInstallerTest.java
+++ b/asdc-controller/src/test/java/org/openecomp/mso/asdc/installer/heat/tests/ToscaResourceInstallerTest.java
@@ -143,7 +143,7 @@
 		distributionClient = Mockito.mock(IDistributionClient.class);
 
 		// Now provision the NotificationData mock
-		List<IArtifactInfo> listArtifact = new ArrayList<IArtifactInfo>();
+		List<IArtifactInfo> listArtifact = new ArrayList<>();
 		listArtifact.add(artifactInfo1);
 
 		// Create fake resource Instance
diff --git a/asdc-controller/src/test/java/org/openecomp/mso/asdc/installer/heat/tests/VfResourceInstallerTest.java b/asdc-controller/src/test/java/org/openecomp/mso/asdc/installer/heat/tests/VfResourceInstallerTest.java
index c4ada74..e2239dc 100644
--- a/asdc-controller/src/test/java/org/openecomp/mso/asdc/installer/heat/tests/VfResourceInstallerTest.java
+++ b/asdc-controller/src/test/java/org/openecomp/mso/asdc/installer/heat/tests/VfResourceInstallerTest.java
@@ -121,7 +121,7 @@
 		distributionClient = Mockito.mock(IDistributionClient.class);
 
 		// Now provision the NotificationData mock
-		List<IArtifactInfo> listArtifact = new ArrayList<IArtifactInfo>();
+		List<IArtifactInfo> listArtifact = new ArrayList<>();
 		listArtifact.add(artifactInfo1);
 
 		// Create fake resource Instance
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/adapter/vnf/MsoRequest.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/adapter/vnf/MsoRequest.java
index 8a9cb95..eabd465 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/adapter/vnf/MsoRequest.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/adapter/vnf/MsoRequest.java
@@ -105,11 +105,8 @@
 
     @Override
     public String toString() {
-        StringBuilder request = new StringBuilder();
-        request.append("<requestId>").append(requestId).append("</requestId>");
-        request.append('\n');
-        request.append("<serviceInstanceId>").append(serviceInstanceId).append("</serviceInstanceId>");
-        return request.toString();
+        return "<requestId>" + requestId + "</requestId>" + '\n' + "<serviceInstanceId>" + serviceInstanceId
+            + "</serviceInstanceId>";
     }
 
 }
diff --git a/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/PropertyConfigurationSetup.java b/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/PropertyConfigurationSetup.java
index ce171b5..b972d6a 100644
--- a/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/PropertyConfigurationSetup.java
+++ b/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/PropertyConfigurationSetup.java
@@ -156,7 +156,7 @@
 	 * Create a map to hold properties to be added to mso.bpmn.properties.
 	 */
 	public static Map<String, String> createBpmnProperties() {
-		Map<String, String> properties = new HashMap<String, String>();
+		Map<String, String> properties = new HashMap<>();
 		properties.put("PROPERTIES-TYPE", PropertyConfiguration.MSO_BPMN_PROPERTIES);
 		return properties;
 	}
@@ -165,7 +165,7 @@
 	 * Create a map to hold properties to be added to mso.bpmn.urn.properties.
 	 */
 	public static Map<String, String> createBpmnUrnProperties() {
-		Map<String, String> properties = new HashMap<String, String>();
+		Map<String, String> properties = new HashMap<>();
 		properties.put("PROPERTIES-TYPE", PropertyConfiguration.MSO_BPMN_URN_PROPERTIES);
 		return properties;
 	}
diff --git a/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/RollbackData.java b/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/RollbackData.java
index 64068d2..f49712e 100644
--- a/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/RollbackData.java
+++ b/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/RollbackData.java
@@ -35,7 +35,7 @@
     private static final long serialVersionUID = 1L;
 
     private Map<String, Map<String, Serializable>> dictionary =
-            new HashMap<String, Map<String, Serializable>>();
+        new HashMap<>();
 
     /**
      * Returns true if the specified type is stored in this object.
@@ -54,12 +54,8 @@
      * @param value the value
      */
     public void put(String type, String key, String value) {
-        Map<String, Serializable> mapForType = dictionary.get(type);
-
-        if (mapForType == null) {
-            mapForType = new HashMap<String, Serializable>();
-            dictionary.put(type, mapForType);
-        }
+        Map<String, Serializable> mapForType = dictionary
+            .computeIfAbsent(type, k -> new HashMap<>());
 
         mapForType.put(key, value);
     }
diff --git a/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/WorkflowException.java b/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/WorkflowException.java
index 21653e2..b555563 100644
--- a/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/WorkflowException.java
+++ b/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/WorkflowException.java
@@ -31,7 +31,7 @@
 	private final String processKey;
 	private final int errorCode;
 	private final String errorMessage;
-	
+
 	/**
 	 * Constructor
 	 * @param processKey the process key for the process that generated the exception
@@ -44,42 +44,34 @@
 		this.errorCode = errorCode;
 		this.errorMessage = errorMessage;
 	}
-			
+
 	/**
 	 * Returns the process key.
 	 */
 	public String getProcessKey() {
 		return processKey;
 	}
-	
+
 	/**
 	 * Returns the error code.
 	 */
 	public int getErrorCode() {
 		return errorCode;
 	}
-	
+
 	/**
 	 * Returns the error message.
 	 */
 	public String getErrorMessage() {
 		return errorMessage;
 	}
-	
+
 	/**
 	 * Returns a string representation of this object.
 	 */
     @Override
 	public String toString() {
-		StringBuilder out = new StringBuilder();
-		out.append(getClass().getSimpleName());
-		out.append("[processKey=");
-		out.append(getProcessKey());
-		out.append(",errorCode=");
-		out.append(getErrorCode());
-		out.append(",errorMessage=");
-		out.append(getErrorMessage());
-		out.append("]");
-		return out.toString();
+		return getClass().getSimpleName() + "[processKey=" + getProcessKey() + ",errorCode=" + getErrorCode()
+			+ ",errorMessage=" + getErrorMessage() + "]";
 	}
 }
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 c81e96d..8581eee 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
@@ -146,15 +146,12 @@
 
 	/**
 	 * This method returns String representation of one combined list of Resources of All Types
-	 * @return
 	 */
 	@JsonIgnore
-	public String getServiceResourcesJsonString(){
-		StringBuilder serviceResourcesJsonStringBuffer = new StringBuilder();
-		serviceResourcesJsonStringBuffer.append(listToJson((this.getServiceNetworks())));
-		serviceResourcesJsonStringBuffer.append(listToJson((this.getServiceVnfs())));
-		serviceResourcesJsonStringBuffer.append(listToJson((this.getServiceAllottedResources())));
-		return serviceResourcesJsonStringBuffer.toString();
+	public String getServiceResourcesJsonString() {
+		return listToJson((this.getServiceNetworks())) +
+			listToJson((this.getServiceVnfs())) +
+			listToJson((this.getServiceAllottedResources()));
 	}
 
 	/**
@@ -203,7 +200,7 @@
 	 */
 	public void addVnfResource(Resource vnfResource) {
 		if (vnfResources == null){
-			vnfResources = new ArrayList<VnfResource>();
+			vnfResources = new ArrayList<>();
 		}
 		this.vnfResources.add((VnfResource)vnfResource);
 	}
@@ -213,7 +210,7 @@
 	 */
 	public void addNetworkResource(Resource networkResource) {
 		if (networkResources == null){
-			networkResources = new ArrayList<NetworkResource>();
+			networkResources = new ArrayList<>();
 		}
 		this.networkResources.add((NetworkResource)networkResource);
 	}
@@ -223,7 +220,7 @@
 	 */
 	public void addAllottedResource(Resource allottedResource) {
 		if (allottedResources == null){
-			allottedResources = new ArrayList<AllottedResource>();
+			allottedResources = new ArrayList<>();
 		}
 		this.allottedResources.add((AllottedResource)allottedResource);
 	}
diff --git a/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/domain/VnfResource.java b/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/domain/VnfResource.java
index 0d8721b..a09f5a7 100644
--- a/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/domain/VnfResource.java
+++ b/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/domain/VnfResource.java
@@ -134,7 +134,7 @@
 	// methods to add to the list
 	public void addVfModule(ModuleResource moduleResource) {
 		if (vfModules == null){
-			vfModules = new ArrayList<ModuleResource>();
+			vfModules = new ArrayList<>();
 		}
 		this.vfModules.add(moduleResource);
 	}
diff --git a/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/mybatis/CustomMyBatisSessionFactory.java b/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/mybatis/CustomMyBatisSessionFactory.java
index ad4a1a5..4dde5ae 100644
--- a/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/mybatis/CustomMyBatisSessionFactory.java
+++ b/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/mybatis/CustomMyBatisSessionFactory.java
@@ -88,7 +88,7 @@
 	@Override
 	protected Collection<? extends CommandInterceptor> getDefaultCommandInterceptorsTxRequired() {
 		List<CommandInterceptor> defaultCommandInterceptorsTxRequired =
-				new ArrayList<CommandInterceptor>();
+            new ArrayList<>();
 		defaultCommandInterceptorsTxRequired.add(new LogInterceptor());
 		defaultCommandInterceptorsTxRequired.add(new CommandContextInterceptor(
 				commandContextFactory, this, true));
diff --git a/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/plugins/WorkflowExceptionPlugin.java b/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/plugins/WorkflowExceptionPlugin.java
index 18113fa..d25dcb6 100644
--- a/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/plugins/WorkflowExceptionPlugin.java
+++ b/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/plugins/WorkflowExceptionPlugin.java
@@ -65,7 +65,7 @@
 			processEngineConfiguration.getCustomPreBPMNParseListeners();
 
 		if (preParseListeners == null) {
-			preParseListeners = new ArrayList<BpmnParseListener>();
+			preParseListeners = new ArrayList<>();
 			processEngineConfiguration.setCustomPreBPMNParseListeners(preParseListeners);
 		}
 
@@ -76,7 +76,7 @@
 		@Override
 		public void parseProcess(Element processElement, ProcessDefinitionEntity processDefinition) {
 			AtomicInteger triggerTaskIndex = new AtomicInteger(1);
-			List<ActivityImpl> activities = new ArrayList<ActivityImpl>(processDefinition.getActivities());
+			List<ActivityImpl> activities = new ArrayList<>(processDefinition.getActivities());
 			recurse(activities, triggerTaskIndex);
 		}
 
@@ -103,7 +103,7 @@
 					// cause the process to die.
 
 					List<PvmTransition> outTransitions =
-						new ArrayList<PvmTransition>(activity.getOutgoingTransitions());
+                        new ArrayList<>(activity.getOutgoingTransitions());
 
 					for (PvmTransition transition : outTransitions) {
 						String triggerTaskId = "WorkflowExceptionTriggerTask_" + triggerTaskIndex;
@@ -112,7 +112,7 @@
 
 						ClassDelegateActivityBehavior behavior = new  ClassDelegateActivityBehavior(
 								WorkflowExceptionTriggerTask.class.getName(),
-								new ArrayList<FieldDeclaration>(0));
+                            new ArrayList<>(0));
 
 						triggerTask.setActivityBehavior(behavior);
 						triggerTask.setName("Workflow Exception Trigger Task " + triggerTaskIndex);
@@ -124,7 +124,7 @@
 						transitionImpl.setDestination(triggerTask);
 					}
 				} else if ("subProcess".equals(type)) {
-					recurse(new ArrayList<ActivityImpl>(activity.getActivities()), triggerTaskIndex);
+					recurse(new ArrayList<>(activity.getActivities()), triggerTaskIndex);
 				}
 			}
 		}
diff --git a/bpmn/MSOCoreBPMN/src/test/java/org/openecomp/mso/bpmn/core/TestBaseTask.java b/bpmn/MSOCoreBPMN/src/test/java/org/openecomp/mso/bpmn/core/TestBaseTask.java
index 9730b12..2d204c3 100644
--- a/bpmn/MSOCoreBPMN/src/test/java/org/openecomp/mso/bpmn/core/TestBaseTask.java
+++ b/bpmn/MSOCoreBPMN/src/test/java/org/openecomp/mso/bpmn/core/TestBaseTask.java
@@ -55,7 +55,7 @@
 	@Test
 	@Deployment(resources={"BaseTaskTest.bpmn"})
 	public void shouldInvokeService() {
-		Map<String, Object> variables = new HashMap<String, Object>();
+		Map<String, Object> variables = new HashMap<>();
 		variables.put("firstName", "Jane");
 		variables.put("lastName", "Doe");
 		variables.put("age", (Integer)25);
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/service/WorkflowResourceApplication.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/service/WorkflowResourceApplication.java
index 80b11bb..dbf5a57 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/service/WorkflowResourceApplication.java
+++ b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/service/WorkflowResourceApplication.java
@@ -32,8 +32,8 @@
 
 @ApplicationPath("/")
 public class WorkflowResourceApplication extends Application {
-    private Set<Object> singletons = new HashSet<Object>();
-    private Set<Class<?>> classes = new HashSet<Class<?>>();
+    private Set<Object> singletons = new HashSet<>();
+    private Set<Class<?>> classes = new HashSet<>();
 
     public WorkflowResourceApplication() {
         singletons.add(new WorkflowResource());
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateGenericALaCarteServiceInstanceTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateGenericALaCarteServiceInstanceTest.java
index 571db76..5496645 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateGenericALaCarteServiceInstanceTest.java
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateGenericALaCarteServiceInstanceTest.java
@@ -113,7 +113,7 @@
 
 	// Success Scenario
 	private Map<String, String> setupVariables() {
-		Map<String, String> variables = new HashMap<String, String>();
+		Map<String, String> variables = new HashMap<>();
 		variables.put("isDebugLogEnabled", "true");
 		variables.put("bpmnRequest", getRequest());
 		variables.put("mso-request-id", "RaaCSIRequestId-1");
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateNetworkInstanceTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateNetworkInstanceTest.java
index c259310..b95ebb5 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateNetworkInstanceTest.java
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateNetworkInstanceTest.java
@@ -430,7 +430,7 @@
 
 	// Success Scenario
 	private Map<String, String> setupVariables1() {
-		Map<String, String> variables = new HashMap<String, String>();
+		Map<String, String> variables = new HashMap<>();
 		variables.put("testMessageId", "88f65519-9a38-4c4b-8445-9eb4a5a5af56");
 		variables.put("msoRequestId", "testRequestId");
 		variables.put("requestId", "testRequestId");
@@ -455,7 +455,7 @@
 
 	// Success Scenario 2
 	private Map<String, String> setupVariables2() {
-		Map<String, String> variables = new HashMap<String, String>();
+		Map<String, String> variables = new HashMap<>();
 		variables.put("testMessageId", "88f65519-9a38-4c4b-8445-9eb4a5a5af56");
 		variables.put("msoRequestId", "testRequestId");
 		variables.put("serviceInstanceId", "f70e927b-6087-4974-9ef8-c5e4d5847ca4");
@@ -479,7 +479,7 @@
 
 	// Active Scenario
 	private Map<String, String> setupVariablesActive() {
-		Map<String, String> variables = new HashMap<String, String>();
+		Map<String, String> variables = new HashMap<>();
 		variables.put("testMessageId", "88f65519-9a38-4c4b-8445-9eb4a5a5af56");
 		variables.put("msoRequestId", "testRequestId");
 		variables.put("serviceInstanceId", "f70e927b-6087-4974-9ef8-c5e4d5847ca4");
@@ -503,7 +503,7 @@
 
 	// Missing Name Scenario
 	private Map<String, String> setupVariablesMissingName() {
-		Map<String, String> variables = new HashMap<String, String>();
+		Map<String, String> variables = new HashMap<>();
 		//variables.put("bpmnRequest", getCreateNetworkRequestMissingName());
 		variables.put("testMessageId", "88f65519-9a38-4c4b-8445-9eb4a5a5af56");
 		variables.put("msoRequestId", "testRequestId");
@@ -524,7 +524,7 @@
 
 	// SDNC Rollback Scenario
 	private Map<String, String> setupVariablesSDNCRollback() {
-		Map<String, String> variables = new HashMap<String, String>();
+		Map<String, String> variables = new HashMap<>();
 		variables.put("testMessageId", "88f65519-9a38-4c4b-8445-9eb4a5a5af56");
 		variables.put("msoRequestId", "testRequestId");
 		variables.put("serviceInstanceId", "f70e927b-6087-4974-9ef8-c5e4d5847ca4");
@@ -609,7 +609,7 @@
 
 	// VID json input
 	private Map<String, String> setupVariablesVID1() {
-		Map<String, String> variables = new HashMap<String, String>();
+		Map<String, String> variables = new HashMap<>();
 		variables.put("bpmnRequest", getCreateNetworkRequestVID1());
 		variables.put("mso-request-id", "testRequestId");
 		//variables.put("msoRequestId", "testRequestId");
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateVfModuleInfraTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateVfModuleInfraTest.java
index 7585899..a28e95a 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateVfModuleInfraTest.java
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateVfModuleInfraTest.java
@@ -175,7 +175,7 @@
 	
 	// Active Scenario
 		private Map<String, Object> setupVariablesSunnyDayVID() {
-			Map<String, Object> variables = new HashMap<String, Object>();
+			Map<String, Object> variables = new HashMap<>();
 			//try {
 				//variables.put("bpmnRequest", FileUtil.readResourceFile("__files/CreateVfModule_VID_request.json"));
 			//}
@@ -263,7 +263,7 @@
 		
 		// Active Scenario
 			private Map<String, Object> setupVariablesSunnyDayVIDWVolumeAttach() {
-				Map<String, Object> variables = new HashMap<String, Object>();
+				Map<String, Object> variables = new HashMap<>();
 				//try {
 				//	variables.put("bpmnRequest", FileUtil.readResourceFile("__files/CreateVfModule_VID_request.json"));
 				//}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateVfModuleVolumeInfraV1Test.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateVfModuleVolumeInfraV1Test.java
index 4496ab0..23999c9 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateVfModuleVolumeInfraV1Test.java
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateVfModuleVolumeInfraV1Test.java
@@ -88,7 +88,7 @@
 		String businessKey = UUID.randomUUID().toString();
 		String createVfModuleVolRequest = FileUtil.readResourceFile("__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_VID_request.json");
 		
-		Map<String, Object> testVariables = new HashMap<String, Object>();
+		Map<String, Object> testVariables = new HashMap<>();
 		testVariables.put("requestId", "TEST-REQUEST-ID-0123");
 		testVariables.put("serviceInstanceId", "test-service-instance-id");
 		testVariables.put("vnfId", "TEST-VNF-ID-0123");
@@ -138,7 +138,7 @@
 		String businessKey = UUID.randomUUID().toString();
 		String createVfModuleVolRequest = FileUtil.readResourceFile("__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_VID_request.json");
 		
-		Map<String, Object> testVariables = new HashMap<String, Object>();
+		Map<String, Object> testVariables = new HashMap<>();
 		testVariables.put("requestId", "TEST-REQUEST-ID-0123");
 		testVariables.put("serviceInstanceId", "test-service-instance-id");
 		testVariables.put("vnfId", "TEST-VNF-ID-0123");
@@ -182,7 +182,7 @@
 		String businessKey = UUID.randomUUID().toString();
 		String createVfModuleVolRequest = FileUtil.readResourceFile("__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_VID_request.json");
 		
-		Map<String, Object> testVariables = new HashMap<String, Object>();
+		Map<String, Object> testVariables = new HashMap<>();
 		testVariables.put("requestId", "TEST-REQUEST-ID-0123");
 		testVariables.put("serviceInstanceId", "test-service-instance-id");
 		testVariables.put("vnfId", "TEST-VNF-ID-0123");
@@ -229,7 +229,7 @@
 		String businessKey = UUID.randomUUID().toString();
 		String createVfModuleVolRequest = FileUtil.readResourceFile("__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_VID_request.json");
 		
-		Map<String, Object> testVariables = new HashMap<String, Object>();
+		Map<String, Object> testVariables = new HashMap<>();
 		testVariables.put("requestId", "TEST-REQUEST-ID-0123");
 		testVariables.put("serviceInstanceId", "test-service-instance-id");
 		testVariables.put("vnfId", "TEST-VNF-ID-0123");
@@ -271,7 +271,7 @@
 		String businessKey = UUID.randomUUID().toString();
 		String createVfModuleVolRequest = FileUtil.readResourceFile("__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_VID_request_noreqparm.json");
 		
-		Map<String, Object> testVariables = new HashMap<String, Object>();
+		Map<String, Object> testVariables = new HashMap<>();
 		testVariables.put("requestId", "TEST-REQUEST-ID-0123");
 		testVariables.put("serviceInstanceId", "test-service-instance-id");
 		testVariables.put("vnfId", "TEST-VNF-ID-0123");
@@ -311,7 +311,7 @@
 		String businessKey = UUID.randomUUID().toString();
 		String createVfModuleVolRequest = FileUtil.readResourceFile("__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_VID_request.json");
 		
-		Map<String, Object> testVariables = new HashMap<String, Object>();
+		Map<String, Object> testVariables = new HashMap<>();
 		testVariables.put("requestId", "TEST-REQUEST-ID-0123");
 		testVariables.put("serviceInstanceId", "test-service-instance-id");
 		//testVariables.put("vnfId", "TEST-VNF-ID-0123");
@@ -349,7 +349,7 @@
 		String businessKey = UUID.randomUUID().toString();
 		String createVfModuleVolRequest = FileUtil.readResourceFile("__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_VID_request.json");
 		
-		Map<String, Object> testVariables = new HashMap<String, Object>();
+		Map<String, Object> testVariables = new HashMap<>();
 		testVariables.put("requestId", "TEST-REQUEST-ID-0123");
 		testVariables.put("serviceInstanceId", "test-service-instance-id");
 		//testVariables.put("vnfId", "TEST-VNF-ID-0123");
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateVnfInfraTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateVnfInfraTest.java
index 803977b..d5f9496 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateVnfInfraTest.java
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateVnfInfraTest.java
@@ -87,7 +87,7 @@
 		mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
 
 		String businessKey = UUID.randomUUID().toString();
-		Map<String, Object> variables = new HashMap<String, Object>();
+		Map<String, Object> variables = new HashMap<>();
 		setVariablesSuccess(variables, createVnfInfraRequest, "testRequestId123", "MIS%2F1604%2F0026%2FSW_INTERNET");
 		TestAsyncResponse asyncResponse = invokeAsyncProcess("CreateVnfInfra",
 				"v1", businessKey, createVnfInfraRequest, variables);
@@ -124,7 +124,7 @@
 
 		mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
 
-		Map<String, String> variables = new HashMap<String, String>();
+		Map<String, String> variables = new HashMap<>();
 		setVariables(variables, null, "testRequestId123", "MIS%2F1604%2F0026%2FSW_INTERNET");
 
 		WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "CreateVnfInfra", variables);
@@ -142,7 +142,7 @@
 		MockNodeQueryServiceInstanceById_404("MIS%2F1604%2F0026%2FSW_INTERNET");
 		mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
 
-		Map<String, String> variables = new HashMap<String, String>();
+		Map<String, String> variables = new HashMap<>();
 		setVariables(variables, createVnfInfraRequest, "testRequestId123", "MIS%2F1604%2F0026%2FSW_INTERNET");
 
 		WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "CreateVnfInfra", variables);
@@ -174,7 +174,7 @@
 		MockPutGenericVnf();
 		mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
 
-		Map<String, String> variables = new HashMap<String, String>();
+		Map<String, String> variables = new HashMap<>();
 		setVariables(variables, createVnfInfraRequest, "testRequestId123", "MIS%2F1604%2F0026%2FSW_INTERNET");
 
 		WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "CreateVnfInfra", variables);
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteGenericALaCarteServiceInstanceTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteGenericALaCarteServiceInstanceTest.java
index 02e236c..aa05953 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteGenericALaCarteServiceInstanceTest.java
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteGenericALaCarteServiceInstanceTest.java
@@ -95,7 +95,7 @@
 
 	// Success Scenario
 	private Map<String, String> setupVariables() {
-		Map<String, String> variables = new HashMap<String, String>();
+		Map<String, String> variables = new HashMap<>();
 		variables.put("isDebugLogEnabled", "true");
 		variables.put("bpmnRequest", getRequest());
 		variables.put("mso-request-id", "RaaTestRequestId-1");
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteNetworkInstanceTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteNetworkInstanceTest.java
index ca04d6f..4317a57 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteNetworkInstanceTest.java
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteNetworkInstanceTest.java
@@ -87,7 +87,7 @@
 		mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
 		MockGetCloudRegion("RDM2WAGPLCP", 200, "DeleteNetworkV2/cloudRegion30_AAIResponse_Success.xml");
 
-		Map<String, String> variables = new HashMap<String, String>();
+		Map<String, String> variables = new HashMap<>();
 		variables.put("mso-request-id", "testRequestId");
 		variables.put("requestId", "testRequestId");
 		variables.put("isBaseVfModule", "true");
@@ -160,7 +160,7 @@
 		String networkModelInfo = "  {\"modelName\": \"modelName\", " + '\n' +
 		                          "   \"networkType\": \"modelName\" }";
 
-		Map<String, String> variables = new HashMap<String, String>();
+		Map<String, String> variables = new HashMap<>();
 		variables.put("testMessageId", "88f65519-9a38-4c4b-8445-9eb4a5a5af56");
 		variables.put("msoRequestId", "testRequestId");
 		variables.put("requestId", "testRequestId");
@@ -236,7 +236,7 @@
 		String networkModelInfo = "  {\"modelCustomizationId\": \"uuid-nrc-001-1234\", " + '\n' +
                 "   \"modelInvariantId\": \"was-ist-das-001-1234\" }";
 
-		Map<String, String> variables = new HashMap<String, String>();
+		Map<String, String> variables = new HashMap<>();
 		variables.put("testMessageId", "88f65519-9a38-4c4b-8445-9eb4a5a5af56");
 		variables.put("msoRequestId", "testRequestId");
 		variables.put("requestId", "testRequestId");
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteVfModuleInfraTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteVfModuleInfraTest.java
index e89c64e..4c478e6 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteVfModuleInfraTest.java
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteVfModuleInfraTest.java
@@ -552,7 +552,7 @@
 	
 	// Active Scenario
 			private Map<String, Object> setupVariablesSunnyDayVID() {
-				Map<String, Object> variables = new HashMap<String, Object>();
+				Map<String, Object> variables = new HashMap<>();
 				//try {
 				//	variables.put("bpmnRequest", FileUtil.readResourceFile("__files/CreateVfModule_VID_request.json"));
 				//}
@@ -576,4 +576,4 @@
 			}
 
 	
-}
+}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteVfModuleVolumeInfraV1Test.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteVfModuleVolumeInfraV1Test.java
index c343c97..84050c4 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteVfModuleVolumeInfraV1Test.java
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteVfModuleVolumeInfraV1Test.java
@@ -65,7 +65,7 @@
 		String deleteVfModuleVolRequest =
 			FileUtil.readResourceFile("__files/DeleteVfModuleVolumeInfraV1/deleteVfModuleVolume_VID_request_st.json");
 		
-		Map<String, Object> testVariables = new HashMap<String, Object>();
+		Map<String, Object> testVariables = new HashMap<>();
 		testVariables.put("requestId", "TEST-REQUEST-ID-0123");
 		testVariables.put("volumeGroupId", "78987");
 		testVariables.put("serviceInstanceId", "test-service-instance-id-0123");
@@ -105,7 +105,7 @@
 		String deleteVfModuleVolRequest =
 			FileUtil.readResourceFile("__files/DeleteVfModuleVolumeInfraV1/deleteVfModuleVolume_VID_request_st.json");
 		
-		Map<String, Object> testVariables = new HashMap<String, Object>();
+		Map<String, Object> testVariables = new HashMap<>();
 		testVariables.put("requestId", "TEST-REQUEST-ID-0123");
 		testVariables.put("volumeGroupId", "78987");
 		
@@ -145,7 +145,7 @@
 		String deleteVfModuleVolRequest =
 			FileUtil.readResourceFile("__files/DeleteVfModuleVolumeInfraV1/deleteVfModuleVolume_VID_request_st.json");
 		
-		Map<String, Object> testVariables = new HashMap<String, Object>();
+		Map<String, Object> testVariables = new HashMap<>();
 		testVariables.put("requestId", "TEST-REQUEST-ID-0123");
 		testVariables.put("volumeGroupId", "78987");
 		
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteVnfInfraTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteVnfInfraTest.java
index 29e278c..89bf141 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteVnfInfraTest.java
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteVnfInfraTest.java
@@ -79,7 +79,7 @@
 		MockDeleteGenericVnf();
 		mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
 
-		Map<String, String> variables = new HashMap<String, String>();
+		Map<String, String> variables = new HashMap<>();
 		setVariables(variables, deleteVnfInfraRequest, "testRequestId123", "MIS%2F1604%2F0026%2FSW_INTERNET");
 		WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "DeleteVnfInfra", variables);
 		waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
@@ -109,7 +109,7 @@
 		MockDeleteGenericVnf();
 		mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
 
-		Map<String, String> variables = new HashMap<String, String>();
+		Map<String, String> variables = new HashMap<>();
 		setVariables(variables, deleteVnfInfraRequestCascadeDelete, "testRequestId123", "MIS%2F1604%2F0026%2FSW_INTERNET");
 		WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "DeleteVnfInfra", variables);
 		waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
@@ -139,7 +139,7 @@
 		MockDeleteGenericVnf_404();
 		mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
 
-		Map<String, String> variables = new HashMap<String, String>();
+		Map<String, String> variables = new HashMap<>();
 		setVariables(variables, deleteVnfInfraRequest, "testRequestId123", "MIS%2F1604%2F0026%2FSW_INTERNET");
 
 		WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "DeleteVnfInfra", variables);
@@ -173,7 +173,7 @@
 		MockDeleteGenericVnf();
 		mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
 
-		Map<String, String> variables = new HashMap<String, String>();
+		Map<String, String> variables = new HashMap<>();
 		setVariables(variables, deleteVnfInfraRequest, "testRequestId123", "MIS%2F1604%2F0026%2FSW_INTERNET");
 
 		WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "DeleteVnfInfra", variables);
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateSIRollbackTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateSIRollbackTest.java
index 852c8f9..16433ca 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateSIRollbackTest.java
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateSIRollbackTest.java
@@ -84,7 +84,7 @@
 		mockUpdateRequestDB(200, "DBUpdateResponse.xml");
 		String businessKey = UUID.randomUUID().toString();
 
-		Map<String, Object> variables =  new HashMap<String, Object>();
+		Map<String, Object> variables = new HashMap<>();
 		setupVariables(variables);
 		invokeSubProcess("DoCreateServiceInstanceRollback", businessKey, variables);
 		injectSDNCCallbacks(callbacks, "deactivate");
@@ -196,4 +196,4 @@
 		variables.put("rollbackData",rollbackData);
 				
 	}
-}
+}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateServiceInstanceTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateServiceInstanceTest.java
index 5f05364..f6c5d90 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateServiceInstanceTest.java
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateServiceInstanceTest.java
@@ -90,7 +90,7 @@
 		mockUpdateRequestDB(200, "DBUpdateResponse.xml");
 		String businessKey = UUID.randomUUID().toString();
 
-		Map<String, Object> variables =  new HashMap<String, Object>();
+		Map<String, Object> variables = new HashMap<>();
 		setupVariables(variables);
 		invokeSubProcess("DoCreateServiceInstance", businessKey, variables);
 		injectSDNCCallbacks(callbacks, "assign");
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVfModuleRollbackTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVfModuleRollbackTest.java
index 1d0cb0c..25787c7 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVfModuleRollbackTest.java
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVfModuleRollbackTest.java
@@ -105,7 +105,7 @@
 		MockPatchVfModuleId("a27ce5a9-29c4-4c22-a017-6615ac73c721", "973ed047-d251-4fb9-bf1a-65b8949e0a73");
 		
 		String businessKey = UUID.randomUUID().toString();
-		Map<String, Object> variables = new HashMap<String, Object>();
+		Map<String, Object> variables = new HashMap<>();
 		RollbackData rollbackData = new RollbackData();
 		rollbackData.put("VFMODULE", "source", "PORTAL");
 		rollbackData.put("VFMODULE", "vnfid", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVfModuleTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVfModuleTest.java
index 84e9ad1..d62c759 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVfModuleTest.java
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVfModuleTest.java
@@ -230,7 +230,7 @@
 	
 	
 	private Map<String, Object> setupVariablesSunnyDayBuildingBlocks() {
-		Map<String, Object> variables = new HashMap<String, Object>();
+		Map<String, Object> variables = new HashMap<>();
 		//try {
 		//	variables.put("bpmnRequest", FileUtil.readResourceFile("__files/CreateVfModule_VID_request.json"));
 		//}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVfModuleVolumeV2Test.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVfModuleVolumeV2Test.java
index f5c8ab6..e9082d9 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVfModuleVolumeV2Test.java
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVfModuleVolumeV2Test.java
@@ -67,7 +67,7 @@
 		String businessKey = UUID.randomUUID().toString();
 		String createVfModuleVolRequest = FileUtil.readResourceFile("__files/DoCreateVfModuleVolumeV1/CreateVfModuleVolumeRequest.xml");
 		
-		Map<String, Object> testVariables = new HashMap<String, Object>();
+		Map<String, Object> testVariables = new HashMap<>();
 		testVariables.put("volumeGroupId", "TEST-VOLUME-VOLUME-GROUP-ID-0123");
 		testVariables.put("vnfId", "TEST-VNF-ID-0123");
 		testVariables.put("lcpCloudRegionId", "AAIAIC25");
@@ -100,7 +100,7 @@
 		String businessKey = UUID.randomUUID().toString();
 		String createVfModuleVolRequest = FileUtil.readResourceFile("__files/DoCreateVfModuleVolumeV1/CreateVfModuleVolumeRequest.xml");
 		
-		Map<String, Object> testVariables = new HashMap<String, Object>();
+		Map<String, Object> testVariables = new HashMap<>();
 		testVariables.put("DCVFMODVOLV2_volumeGroupId", "TEST-VOLUME-VOLUME-GROUP-ID-0123");
 		testVariables.put("vnf-id", "TEST-VNF-ID-0123");
 		testVariables.put("volume-group-id", "TEST-VOLUME-GROUP-ID-0123");
@@ -139,7 +139,7 @@
 		String businessKey = UUID.randomUUID().toString();
 		String createVfModuleVolRequest = FileUtil.readResourceFile("__files/DoCreateVfModuleVolumeV1/CreateVfModuleVolumeRequest.xml");
 		
-		Map<String, Object> testVariables = new HashMap<String, Object>();
+		Map<String, Object> testVariables = new HashMap<>();
 		testVariables.put("DCVFMODVOLV2_volumeGroupId", "TEST-VOLUME-VOLUME-GROUP-ID-0123");
 		testVariables.put("vnf-id", "TEST-VNF-ID-0123");
 		testVariables.put("volume-group-id", "TEST-VOLUME-GROUP-ID-0123");
@@ -176,7 +176,7 @@
 		String businessKey = UUID.randomUUID().toString();
 		String createVfModuleVolRequest = FileUtil.readResourceFile("__files/DoCreateVfModuleVolumeV1/CreateVfModuleVolumeRequest.xml");
 		
-		Map<String, Object> testVariables = new HashMap<String, Object>();
+		Map<String, Object> testVariables = new HashMap<>();
 		testVariables.put("DCVFMODVOLV2_volumeGroupId", "TEST-VOLUME-VOLUME-GROUP-ID-0123");
 		testVariables.put("vnf-id", "TEST-VNF-ID-0123");
 		testVariables.put("volume-group-id", "TEST-VOLUME-GROUP-ID-0123");
@@ -217,7 +217,7 @@
 		String businessKey = UUID.randomUUID().toString();
 		String createVfModuleVolRequest = FileUtil.readResourceFile("__files/DoCreateVfModuleVolumeV1/CreateVfModuleVolumeNoRollbackRequest.xml");
 		
-		Map<String, Object> testVariables = new HashMap<String, Object>();
+		Map<String, Object> testVariables = new HashMap<>();
 		testVariables.put("DCVFMODVOLV2_volumeGroupId", "TEST-VOLUME-VOLUME-GROUP-ID-0123");
 		testVariables.put("vnf-id", "TEST-VNF-ID-0123");
 		testVariables.put("volume-group-id", "TEST-VOLUME-GROUP-ID-0123");
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVnfAndModulesRollbackTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVnfAndModulesRollbackTest.java
index 6c36f12..fb2160d 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVnfAndModulesRollbackTest.java
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVnfAndModulesRollbackTest.java
@@ -145,7 +145,7 @@
 		MockDeleteGenericVnf("a27ce5a9-29c4-4c22-a017-6615ac73c721", "0000021");
 		MockDeleteVfModuleId("a27ce5a9-29c4-4c22-a017-6615ac73c721", "973ed047-d251-4fb9-bf1a-65b8949e0a73", "0000073", 200);
 		String businessKey = UUID.randomUUID().toString();
-		Map<String, Object> variables = new HashMap<String, Object>();
+		Map<String, Object> variables = new HashMap<>();
 		RollbackData rollbackData = new RollbackData();
 
 		rollbackData.put("VFMODULE_BASE", "source", "PORTAL");
@@ -240,7 +240,7 @@
 		MockDoDeleteVfModule_SDNCSuccess();
 		mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
 		String businessKey = UUID.randomUUID().toString();
-		Map<String, Object> variables = new HashMap<String, Object>();
+		Map<String, Object> variables = new HashMap<>();
 		RollbackData rollbackData = new RollbackData();
 
 		rollbackData.put("VNF", "vnfId", "testVnfId123");
@@ -327,7 +327,7 @@
 		MockDeleteGenericVnf("a27ce5a9-29c4-4c22-a017-6615ac73c721", "0000021");
 		MockDeleteVfModuleId("", "", "", 200);
 		String businessKey = UUID.randomUUID().toString();
-		Map<String, Object> variables = new HashMap<String, Object>();
+		Map<String, Object> variables = new HashMap<>();
 		RollbackData rollbackData = new RollbackData();
 	
 		rollbackData.put("VFMODULE_BASE", "source", "PORTAL");
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVnfAndModulesTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVnfAndModulesTest.java
index b2afc87..c8f97ca 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVnfAndModulesTest.java
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVnfAndModulesTest.java
@@ -114,7 +114,7 @@
 		mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
 
 		String businessKey = UUID.randomUUID().toString();
-		Map<String, Object> variables = new HashMap<String, Object>();
+		Map<String, Object> variables = new HashMap<>();
 		setVariablesSuccess(variables, "", "testRequestId123", "MIS%2F1604%2F0026%2FSW_INTERNET");
 		invokeSubProcess("DoCreateVnfAndModules", businessKey, variables);
 
@@ -168,7 +168,7 @@
 		mockSDNCAdapter("VfModularity/StandardSDNCSynchResponse.xml");
 		
 		String businessKey = UUID.randomUUID().toString();
-		Map<String, Object> variables = new HashMap<String, Object>();
+		Map<String, Object> variables = new HashMap<>();
 		setVariablesAddonSuccess(variables, "", "testRequestId123", "MIS%2F1604%2F0026%2FSW_INTERNET");
 		invokeSubProcess("DoCreateVnfAndModules", businessKey, variables);
 
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVnfTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVnfTest.java
index bbdc285..90d562e 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVnfTest.java
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVnfTest.java
@@ -74,7 +74,7 @@
 		mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
 
 		String businessKey = UUID.randomUUID().toString();
-		Map<String, Object> variables = new HashMap<String, Object>();
+		Map<String, Object> variables = new HashMap<>();
 		setVariablesSuccess(variables, createVnfInfraRequest, "testRequestId123", "MIS%2F1604%2F0026%2FSW_INTERNET");
 		invokeSubProcess("DoCreateVnf", businessKey, variables);
 
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteServiceInstanceTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteServiceInstanceTest.java
index e2850b6..3781499 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteServiceInstanceTest.java
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteServiceInstanceTest.java
@@ -84,7 +84,7 @@
 		mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
 		String businessKey = UUID.randomUUID().toString();
 
-		Map<String, Object> variables =  new HashMap<String, Object>();
+		Map<String, Object> variables = new HashMap<>();
 		setupVariables(variables);
 		invokeSubProcess("DoDeleteServiceInstance", businessKey, variables);
 		injectSDNCCallbacks(callbacks, "deactivate");
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteVfModuleFromVnfTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteVfModuleFromVnfTest.java
index c0d5539..13b2f54 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteVfModuleFromVnfTest.java
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteVfModuleFromVnfTest.java
@@ -113,7 +113,7 @@
 		MockAAIDeleteVfModule();
 		
 		String businessKey = UUID.randomUUID().toString();
-		Map<String, Object> variables = new HashMap<String, Object>();		
+		Map<String, Object> variables = new HashMap<>();
 		variables.put("isDebugLogEnabled","true");
 		variables.put("mso-request-id", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
 		variables.put("msoRequestId", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteVfModuleTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteVfModuleTest.java
index c741dfd..578fda3 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteVfModuleTest.java
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteVfModuleTest.java
@@ -128,7 +128,7 @@
 		MockPatchVfModuleId("a27ce5a9-29c4-4c22-a017-6615ac73c721", "973ed047-d251-4fb9-bf1a-65b8949e0a73");
 		
 		String businessKey = UUID.randomUUID().toString();
-		Map<String, Object> variables = new HashMap<String, Object>();		
+		Map<String, Object> variables = new HashMap<>();
 		variables.put("isDebugLogEnabled","true");
 		variables.put("mso-request-id", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
 		variables.put("mso-service-instance-id", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
@@ -173,7 +173,7 @@
 		MockPatchVfModuleId("a27ce5a9-29c4-4c22-a017-6615ac73c721", "973ed047-d251-4fb9-bf1a-65b8949e0a73");
 		
 		String businessKey = UUID.randomUUID().toString();
-		Map<String, Object> variables = new HashMap<String, Object>();		
+		Map<String, Object> variables = new HashMap<>();
 		
 		variables.put("mso-request-id", "a27ce5a9-29c4-4c22-a017-6615ac73c721");	
 		variables.put("requestId", "a27ce5a9-29c4-4c22-a017-6615ac73c721");		
@@ -263,7 +263,7 @@
 		MockPatchVfModuleId("a27ce5a9-29c4-4c22-a017-6615ac73c721", "973ed047-d251-4fb9-bf1a-65b8949e0a73");
 		
 		String businessKey = UUID.randomUUID().toString();
-		Map<String, Object> variables = new HashMap<String, Object>();		
+		Map<String, Object> variables = new HashMap<>();
 		variables.put("isDebugLogEnabled","true");
 		variables.put("mso-request-id", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
 		variables.put("mso-service-instance-id", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
@@ -334,7 +334,7 @@
 		MockPatchVfModuleId("a27ce5a9-29c4-4c22-a017-6615ac73c721", "973ed047-d251-4fb9-bf1a-65b8949e0a73");
 		
 		String businessKey = UUID.randomUUID().toString();
-		Map<String, Object> variables = new HashMap<String, Object>();		
+		Map<String, Object> variables = new HashMap<>();
 		variables.put("isDebugLogEnabled","true");
 		variables.put("mso-request-id", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
 		variables.put("mso-service-instance-id", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
@@ -405,7 +405,7 @@
 		MockPatchVfModuleId("a27ce5a9-29c4-4c22-a017-6615ac73c721", "973ed047-d251-4fb9-bf1a-65b8949e0a73");
 		
 		String businessKey = UUID.randomUUID().toString();
-		Map<String, Object> variables = new HashMap<String, Object>();		
+		Map<String, Object> variables = new HashMap<>();
 		variables.put("isDebugLogEnabled","true");
 		variables.put("mso-request-id", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
 		variables.put("mso-service-instance-id", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
@@ -475,7 +475,7 @@
 		MockPatchVfModuleId("a27ce5a9-29c4-4c22-a017-6615ac73c721", "973ed047-d251-4fb9-bf1a-65b8949e0a73");
 		
 		String businessKey = UUID.randomUUID().toString();
-		Map<String, Object> variables = new HashMap<String, Object>();		
+		Map<String, Object> variables = new HashMap<>();
 		variables.put("isDebugLogEnabled","true");
 		variables.put("mso-request-id", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
 		variables.put("mso-service-instance-id", "a27ce5a9-29c4-4c22-a017-6615ac73c721");
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteVfModuleVolumeV2Test.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteVfModuleVolumeV2Test.java
index 454c530..165debe 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteVfModuleVolumeV2Test.java
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteVfModuleVolumeV2Test.java
@@ -64,7 +64,7 @@
 		MockGetVolumeGroupById("AAIAIC25", "78987", "VfModularity/VolumeGroup.xml");
 		String businessKey = UUID.randomUUID().toString();
 
-		Map<String, Object> testVariables = new HashMap<String, Object>();
+		Map<String, Object> testVariables = new HashMap<>();
 		testVariables.put("mso-request-id", "TEST-REQUEST-ID-0123");
 		testVariables.put("msoRequestId", "TEST-REQUEST-ID-0123");
 		testVariables.put("isDebugLogEnabled", "true");
@@ -102,7 +102,7 @@
 		mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
 		String businessKey = UUID.randomUUID().toString();
 
-		Map<String, Object> testVariables = new HashMap<String, Object>();
+		Map<String, Object> testVariables = new HashMap<>();
 		testVariables.put("mso-request-id", "TEST-REQUEST-ID-0123");
 		testVariables.put("msoRequestId", "TEST-REQUEST-ID-0123");
 		testVariables.put("isDebugLogEnabled", "true");
@@ -138,7 +138,7 @@
 		mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
 		String businessKey = UUID.randomUUID().toString();
 
-		Map<String, Object> testVariables = new HashMap<String, Object>();
+		Map<String, Object> testVariables = new HashMap<>();
 		testVariables.put("mso-request-id", "TEST-REQUEST-ID-0123");
 		testVariables.put("msoRequestId", "TEST-REQUEST-ID-0123");
 		testVariables.put("isDebugLogEnabled", "true");
@@ -174,7 +174,7 @@
 		mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
 		String businessKey = UUID.randomUUID().toString();
 
-		Map<String, Object> testVariables = new HashMap<String, Object>();
+		Map<String, Object> testVariables = new HashMap<>();
 		testVariables.put("mso-request-id", "TEST-REQUEST-ID-0123");
 		testVariables.put("msoRequestId", "TEST-REQUEST-ID-0123");
 		testVariables.put("isDebugLogEnabled", "true");
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteVnfAndModulesTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteVnfAndModulesTest.java
index de2fc86..a9dde90 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteVnfAndModulesTest.java
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteVnfAndModulesTest.java
@@ -77,7 +77,7 @@
 		mockSDNCAdapter(200);
 
 		String businessKey = UUID.randomUUID().toString();
-		Map<String, Object> variables = new HashMap<String, Object>();
+		Map<String, Object> variables = new HashMap<>();
 		setVariablesVnfOnly(variables);
 		invokeSubProcess("DoDeleteVnfAndModules", businessKey, variables);
 		
@@ -142,7 +142,7 @@
 		MockAAIDeleteVfModule();
 
 		String businessKey = UUID.randomUUID().toString();
-		Map<String, Object> variables = new HashMap<String, Object>();
+		Map<String, Object> variables = new HashMap<>();
 		setVariablesVnfAndModules(variables);
 		invokeSubProcess("DoDeleteVnfAndModules", businessKey, variables);
 		
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteVnfTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteVnfTest.java
index 086ac09..8caa9f2 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteVnfTest.java
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteVnfTest.java
@@ -54,7 +54,7 @@
 		mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
 		
 		String businessKey = UUID.randomUUID().toString();
-		Map<String, Object> variables = new HashMap<String, Object>();
+		Map<String, Object> variables = new HashMap<>();
 		setVariables(variables);
 		invokeSubProcess("DoDeleteVnf", businessKey, variables);
 		// Disabled until SDNC support is there
@@ -81,7 +81,7 @@
 		mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
 		
 		String businessKey = UUID.randomUUID().toString();
-		Map<String, Object> variables = new HashMap<String, Object>();
+		Map<String, Object> variables = new HashMap<>();
 		setVariables(variables);
 
 		invokeSubProcess("DoDeleteVnf", businessKey, variables);
@@ -110,7 +110,7 @@
 		mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
 
 		String businessKey = UUID.randomUUID().toString();
-		Map<String, Object> variables = new HashMap<String, Object>();
+		Map<String, Object> variables = new HashMap<>();
 		setVariables(variables);
 
 		invokeSubProcess("DoDeleteVnf", businessKey, variables);
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoUpdateVfModuleTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoUpdateVfModuleTest.java
index a626fde..9fa9323 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoUpdateVfModuleTest.java
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoUpdateVfModuleTest.java
@@ -100,7 +100,7 @@
 		MockGetGenericVnfByIdWithPriority("skask", "supercool", 200, "VfModularity/VfModule-supercool.xml", 1);
 		
 		String businessKey = UUID.randomUUID().toString();
-		Map<String, Object> variables = new HashMap<String, Object>();
+		Map<String, Object> variables = new HashMap<>();
 		variables.put("mso-request-id", "DEV-VF-0011");
 		variables.put("isDebugLogEnabled","true");
 		variables.put("DoUpdateVfModuleRequest", doUpdateVfModuleRequest);
@@ -146,7 +146,7 @@
 		MockVNFAdapterRestVfModule();
 		
 		String businessKey = UUID.randomUUID().toString();
-		Map<String, Object> variables = new HashMap<String, Object>();
+		Map<String, Object> variables = new HashMap<>();
 		variables.put("mso-request-id", "DEV-VF-0011");
 		variables.put("isDebugLogEnabled","true");
 		variables.put("msoRequestId", "DEV-VF-0011");
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoUpdateVnfAndModulesTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoUpdateVnfAndModulesTest.java
index 9f19b35..4def56c 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoUpdateVnfAndModulesTest.java
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoUpdateVnfAndModulesTest.java
@@ -104,7 +104,7 @@
 		mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
 
 		String businessKey = UUID.randomUUID().toString();
-		Map<String, Object> variables = new HashMap<String, Object>();
+		Map<String, Object> variables = new HashMap<>();
 		setVariablesSuccess(variables, "", "testRequestId123", "MIS%2F1604%2F0026%2FSW_INTERNET");
 		invokeSubProcess("DoUpdateVnfAndModules", businessKey, variables);
 
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/ReplaceVnfInfraTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/ReplaceVnfInfraTest.java
index d3d1b5b..64852df 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/ReplaceVnfInfraTest.java
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/ReplaceVnfInfraTest.java
@@ -210,7 +210,7 @@
 	
 	// Active Scenario
 	private Map<String, Object> setupVariablesSunnyDayVID() {
-				Map<String, Object> variables = new HashMap<String, Object>();
+				Map<String, Object> variables = new HashMap<>();
 				//try {
 				//	variables.put("bpmnRequest", FileUtil.readResourceFile("__files/CreateVfModule_VID_request.json"));
 				//}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateNetworkInstanceTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateNetworkInstanceTest.java
index 7aca55d..5b5e4e5 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateNetworkInstanceTest.java
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateNetworkInstanceTest.java
@@ -291,7 +291,7 @@
 
 	// Success Scenario
 	private Map<String, String> setupVariablesVID1() {
-		Map<String, String> variables = new HashMap<String, String>();
+		Map<String, String> variables = new HashMap<>();
 		variables.put("bpmnRequest", getCreateNetworkRequest1());
 		variables.put("mso-request-id", "testRequestId");
 		variables.put("requestId", "testRequestId");
@@ -378,7 +378,7 @@
 
 	// Success Scenario
 	private Map<String, String> setupVariablesVIPER1() {
-		Map<String, String> variables = new HashMap<String, String>();
+		Map<String, String> variables = new HashMap<>();
 		variables.put("testMessageId", "88f65519-9a38-4c4b-8445-9eb4a5a5af56");
 		variables.put("msoRequestId", "testRequestId");
 		variables.put("requestId", "testRequestId");
@@ -402,7 +402,7 @@
 
 	// Missing Name Scenario
 	private Map<String, String> setupVariablesMissingNetworkId() {
-		Map<String, String> variables = new HashMap<String, String>();
+		Map<String, String> variables = new HashMap<>();
 		variables.put("mso-request-id", "88f65519-9a38-4c4b-8445-9eb4a5a5af56");
 		variables.put("bpmnRequest", getCreateNetworkRequestNetworkId());
 		variables.put("requestId", "testRequestId");
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateVfModuleInfraTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateVfModuleInfraTest.java
index 04189a3..37c548a 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateVfModuleInfraTest.java
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateVfModuleInfraTest.java
@@ -118,7 +118,7 @@
 	
 	// Active Scenario
 	private Map<String, Object> setupVariablesSunnyDayVID() {
-				Map<String, Object> variables = new HashMap<String, Object>();
+				Map<String, Object> variables = new HashMap<>();
 				//try {
 				//	variables.put("bpmnRequest", FileUtil.readResourceFile("__files/CreateVfModule_VID_request.json"));
 				//}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateVfModuleInfraV2Test.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateVfModuleInfraV2Test.java
index 6f3ce69..65a514c 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateVfModuleInfraV2Test.java
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateVfModuleInfraV2Test.java
@@ -98,7 +98,7 @@
 	
 	// Active Scenario
 	private Map<String, Object> setupVariablesSunnyDayVID() {
-				Map<String, Object> variables = new HashMap<String, Object>();
+				Map<String, Object> variables = new HashMap<>();
 				variables.put("requestId", "testRequestId");		
 				variables.put("isBaseVfModule", false);
 				variables.put("isDebugLogEnabled", "true");
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateVfModuleVolumeInfraV1Test.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateVfModuleVolumeInfraV1Test.java
index ab72118..b24eb56 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateVfModuleVolumeInfraV1Test.java
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateVfModuleVolumeInfraV1Test.java
@@ -76,7 +76,7 @@
 		String updaetVfModuleVolRequest =
 			FileUtil.readResourceFile("__files/UpdateVfModuleVolumeInfraV1/updateVfModuleVolume_VID_request.json");
 		
-		Map<String, Object> testVariables = new HashMap<String, Object>();
+		Map<String, Object> testVariables = new HashMap<>();
 		testVariables.put("requestId", "TEST-REQUEST-ID-0123");
 		testVariables.put("serviceInstanceId", "test-service-instance-id");
 		testVariables.put("volumeGroupId", "78987");
@@ -122,7 +122,7 @@
 		String updaetVfModuleVolRequest =
 			FileUtil.readResourceFile("__files/UpdateVfModuleVolumeInfraV1/updateVfModuleVolume_VID_request_2.json");
 		
-		Map<String, Object> testVariables = new HashMap<String, Object>();
+		Map<String, Object> testVariables = new HashMap<>();
 		testVariables.put("requestId", "TEST-REQUEST-ID-0123");
 		testVariables.put("serviceInstanceId", "test-service-instance-id");
 		testVariables.put("volumeGroupId", "78987");
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateVnfInfraTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateVnfInfraTest.java
index 5976285..391fc23 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateVnfInfraTest.java
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateVnfInfraTest.java
@@ -152,7 +152,7 @@
 	
 	// Active Scenario
 	private Map<String, Object> setupVariablesSunnyDayVID() {
-				Map<String, Object> variables = new HashMap<String, Object>();
+				Map<String, Object> variables = new HashMap<>();
 				//try {
 				//	variables.put("bpmnRequest", FileUtil.readResourceFile("__files/CreateVfModule_VID_request.json"));
 				//}
diff --git a/bpmn/MSORESTClient/src/main/java/org/openecomp/mso/rest/RESTClient.java b/bpmn/MSORESTClient/src/main/java/org/openecomp/mso/rest/RESTClient.java
index 6504615..87f5786 100644
--- a/bpmn/MSORESTClient/src/main/java/org/openecomp/mso/rest/RESTClient.java
+++ b/bpmn/MSORESTClient/src/main/java/org/openecomp/mso/rest/RESTClient.java
@@ -247,8 +247,8 @@
      * @throws RESTException if unable to create a RESTClient
      */
     public RESTClient(RESTConfig cfg) throws RESTException {
-        this.headers = new LinkedHashMap<String, List<String>>();
-        this.parameters = new LinkedHashMap<String, List<String>>();
+        this.headers = new LinkedHashMap<>();
+        this.parameters = new LinkedHashMap<>();
         this.URL = cfg.getURL();
         this.proxyHost = cfg.getProxyHost();
         this.proxyPort = cfg.getProxyPort();
@@ -266,7 +266,7 @@
      */
     public RESTClient addParameter(String name, String value) {
         if (!parameters.containsKey(name)) {
-            parameters.put(name, new ArrayList<String>());
+            parameters.put(name, new ArrayList<>());
         }
 
         List<String> values = parameters.get(name);
@@ -306,7 +306,7 @@
      */
     public RESTClient addHeader(String name, String value) {
         if (!headers.containsKey(name)) {
-            headers.put(name, new ArrayList<String>());
+            headers.put(name, new ArrayList<>());
         }
 
         List<String> values = headers.get(name);
diff --git a/common/src/main/java/org/openecomp/mso/logger/MsoAlarmLogger.java b/common/src/main/java/org/openecomp/mso/logger/MsoAlarmLogger.java
index 7b9c6a5..b2b8d0a 100644
--- a/common/src/main/java/org/openecomp/mso/logger/MsoAlarmLogger.java
+++ b/common/src/main/java/org/openecomp/mso/logger/MsoAlarmLogger.java
@@ -162,8 +162,8 @@
         encoder.setPattern(logPattern);
         encoder.setContext(context);
         encoder.start();
-        RollingFileAppender<ILoggingEvent> fileAppender=new RollingFileAppender<ILoggingEvent>();
-        TimeBasedRollingPolicy<ILoggingEvent> rollingPolicy=new TimeBasedRollingPolicy<ILoggingEvent>();
+        RollingFileAppender<ILoggingEvent> fileAppender= new RollingFileAppender<>();
+        TimeBasedRollingPolicy<ILoggingEvent> rollingPolicy= new TimeBasedRollingPolicy<>();
         rollingPolicy.setContext(context);
         rollingPolicy.setFileNamePattern(msoAlarmFile + ".%d");
         rollingPolicy.setParent(fileAppender);
diff --git a/common/src/main/java/org/openecomp/mso/properties/MsoPropertiesFactory.java b/common/src/main/java/org/openecomp/mso/properties/MsoPropertiesFactory.java
index cf69cf9..3f81734 100644
--- a/common/src/main/java/org/openecomp/mso/properties/MsoPropertiesFactory.java
+++ b/common/src/main/java/org/openecomp/mso/properties/MsoPropertiesFactory.java
@@ -78,7 +78,7 @@
             // Hardcode if nothing is received
             prefixMsoPropertiesPath = "";
         }
-        msoPropertiesCache = new ConcurrentHashMap <String, MsoPropertiesParameters> ();
+        msoPropertiesCache = new ConcurrentHashMap<>();
     }
 
     private static final ReentrantReadWriteLock rwl = new ReentrantReadWriteLock ();
@@ -268,7 +268,7 @@
      */
     public List <AbstractMsoProperties> getAllMsoProperties () {
 
-        List <AbstractMsoProperties> resultList = new LinkedList <AbstractMsoProperties> ();
+        List <AbstractMsoProperties> resultList = new LinkedList<>();
         rwl.readLock ().lock ();
         try {
 
diff --git a/common/src/main/java/org/openecomp/mso/utils/CheckResults.java b/common/src/main/java/org/openecomp/mso/utils/CheckResults.java
index 75337f0..ad0344d 100644
--- a/common/src/main/java/org/openecomp/mso/utils/CheckResults.java
+++ b/common/src/main/java/org/openecomp/mso/utils/CheckResults.java
@@ -36,7 +36,7 @@
     private List <CheckResult> results;
 
     public CheckResults () {
-        results = new ArrayList <CheckResult> ();
+        results = new ArrayList<>();
     }
 
     public List <CheckResult> getResults () {
diff --git a/common/src/test/java/org/openecomp/mso/adapter_utils/tests/MsoPropertiesFactoryConcurrencyTest.java b/common/src/test/java/org/openecomp/mso/adapter_utils/tests/MsoPropertiesFactoryConcurrencyTest.java
index f038cbc..a814c4e 100644
--- a/common/src/test/java/org/openecomp/mso/adapter_utils/tests/MsoPropertiesFactoryConcurrencyTest.java
+++ b/common/src/test/java/org/openecomp/mso/adapter_utils/tests/MsoPropertiesFactoryConcurrencyTest.java
@@ -146,7 +146,7 @@
 	public final void testGetMsoProperties()
 			throws MsoPropertiesException, InterruptedException, ExecutionException, FileNotFoundException {
 
-		List<Future<Integer>> list = new ArrayList<Future<Integer>>();
+		List<Future<Integer>> list = new ArrayList<>();
 		ExecutorService executor = Executors.newFixedThreadPool(20);
 
 		for (int i = 0; i <= 100000; i++) {
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstances.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstances.java
index 0914516..c51c61e 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstances.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstances.java
@@ -1,940 +1,1155 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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.apihandlerinfra;
-
-import java.io.IOException;
-import java.sql.Timestamp;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-import org.apache.http.HttpResponse;
-import org.apache.http.HttpStatus;
-import org.codehaus.jackson.map.ObjectMapper;
-import org.hibernate.Session;
-import org.json.JSONObject;
-import org.openecomp.mso.apihandler.common.ErrorNumbers;
-import org.openecomp.mso.apihandler.common.RequestClient;
-import org.openecomp.mso.apihandler.common.RequestClientFactory;
-import org.openecomp.mso.apihandler.common.ResponseHandler;
-import org.openecomp.mso.apihandlerinfra.Messages;
-import org.openecomp.mso.apihandlerinfra.MsoException;
-import org.openecomp.mso.apihandlerinfra.MsoRequest;
-import org.openecomp.mso.apihandlerinfra.e2eserviceinstancebeans.DelE2ESvcResp;
-import org.openecomp.mso.apihandlerinfra.e2eserviceinstancebeans.E2EServiceInstanceDeleteRequest;
-import org.openecomp.mso.apihandlerinfra.e2eserviceinstancebeans.E2EServiceInstanceRequest;
-import org.openecomp.mso.apihandlerinfra.e2eserviceinstancebeans.E2EUserParam;
-import org.openecomp.mso.apihandlerinfra.e2eserviceinstancebeans.GetE2EServiceInstanceResponse;
-import org.openecomp.mso.apihandlerinfra.serviceinstancebeans.ModelInfo;
-import org.openecomp.mso.apihandlerinfra.serviceinstancebeans.RequestDetails;
-import org.openecomp.mso.apihandlerinfra.serviceinstancebeans.RequestInfo;
-import org.openecomp.mso.apihandlerinfra.serviceinstancebeans.RequestParameters;
-import org.openecomp.mso.apihandlerinfra.serviceinstancebeans.ServiceInstancesRequest;
-import org.openecomp.mso.apihandlerinfra.serviceinstancebeans.SubscriberInfo;
-import org.openecomp.mso.db.AbstractSessionFactoryManager;
-import org.openecomp.mso.db.catalog.CatalogDatabase;
-import org.openecomp.mso.db.catalog.beans.Service;
-import org.openecomp.mso.db.catalog.beans.ServiceRecipe;
-import org.openecomp.mso.logger.MessageEnum;
-import org.openecomp.mso.logger.MsoAlarmLogger;
-import org.openecomp.mso.logger.MsoLogger;
-import org.openecomp.mso.properties.MsoDatabaseException;
-import org.openecomp.mso.requestsdb.OperationStatus;
-import org.openecomp.mso.requestsdb.RequestsDatabase;
-import org.openecomp.mso.requestsdb.RequestsDbSessionFactoryManager;
-import org.openecomp.mso.utils.UUIDChecker;
-
-import com.wordnik.swagger.annotations.Api;
-import com.wordnik.swagger.annotations.ApiOperation;
-
-@Path("/e2eServiceInstances")
-@Api(value = "/e2eServiceInstances", description = "API Requests for E2E Service Instances")
-public class E2EServiceInstances {
-
-	private HashMap<String, String> instanceIdMap = new HashMap<>();
-	private static MsoLogger msoLogger = MsoLogger
-			.getMsoLogger(MsoLogger.Catalog.APIH);
-	private static MsoAlarmLogger alarmLogger = new MsoAlarmLogger();
-	public static final String MSO_PROP_APIHANDLER_INFRA = "MSO_PROP_APIHANDLER_INFRA";
-	private ServiceInstancesRequest sir = null;
-
-	public static final String END_OF_THE_TRANSACTION = "End of the transaction, the final response is: ";
-	public static final String EXCEPTION_CREATING_DB_RECORD = "Exception while creating record in DB";
-	public static final String EXCEPTION_COMMUNICATE_BPMN_ENGINE = "Exception while communicate with BPMN engine";
-
-	/**
-	 * POST Requests for E2E Service create Instance on a version provided
-	 */
-
-	@POST
-	@Path("/{version:[vV][3-5]}")
-	@Consumes(MediaType.APPLICATION_JSON)
-	@Produces(MediaType.APPLICATION_JSON)
-	@ApiOperation(value = "Create a E2E Service Instance on a version provided", response = Response.class)
-	public Response createE2EServiceInstance(String request,
-			@PathParam("version") String version) {
-
-		return processE2EserviceInstances(request, Action.createInstance, null,
-				version);
-	}
-
-	/**
-	 * DELETE Requests for E2E Service delete Instance on a specified version
-	 * and serviceId
-	 */
-
-	@DELETE
-	@Path("/{version:[vV][3-5]}/{serviceId}")
-	@Consumes(MediaType.APPLICATION_JSON)
-	@Produces(MediaType.APPLICATION_JSON)
-	@ApiOperation(value = "Delete E2E Service Instance on a specified version and serviceId", response = Response.class)
-	public Response deleteE2EServiceInstance(String request,
-			@PathParam("version") String version,
-			@PathParam("serviceId") String serviceId) {
-
-		instanceIdMap.put("serviceId", serviceId);
-
-		return deleteE2EserviceInstances(request, Action.deleteInstance,
-				instanceIdMap, version);
-	}
-
-	@GET
-	@Path("/{version:[vV][3-5]}/{serviceId}/operations/{operationId}")
-	@ApiOperation(value = "Find e2eServiceInstances Requests for a given serviceId and operationId", response = Response.class)
-	@Produces(MediaType.APPLICATION_JSON)
-	public Response getE2EServiceInstances(
-			@PathParam("serviceId") String serviceId,
-			@PathParam("version") String version,
-			@PathParam("operationId") String operationId) {
-		return getE2EServiceInstances(serviceId, operationId);
-	}
-
-	private Response getE2EServiceInstances(String serviceId, String operationId) {
-		RequestsDatabase requestsDB = RequestsDatabase.getInstance();
-
-		GetE2EServiceInstanceResponse e2eServiceResponse = new GetE2EServiceInstanceResponse();
-
-		MsoRequest msoRequest = new MsoRequest(serviceId);
-
-		long startTime = System.currentTimeMillis();
-
-		OperationStatus operationStatus = null;
-
-		try {
-			operationStatus = requestsDB.getOperationStatus(serviceId,
-					operationId);
-
-		} catch (Exception e) {
-			msoLogger
-					.error(MessageEnum.APIH_DB_ACCESS_EXC,
-							MSO_PROP_APIHANDLER_INFRA,
-							"",
-							"",
-							MsoLogger.ErrorCode.AvailabilityError,
-							"Exception while communciate with Request DB - Infra Request Lookup",
-							e);
-			msoRequest
-					.setStatus(org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED);
-			Response response = msoRequest.buildServiceErrorResponse(
-					HttpStatus.SC_NOT_FOUND, MsoException.ServiceException,
-					e.getMessage(),
-					ErrorNumbers.NO_COMMUNICATION_TO_REQUESTS_DB, null);
-			alarmLogger.sendAlarm("MsoDatabaseAccessError",
-					MsoAlarmLogger.CRITICAL, Messages.errors
-							.get(ErrorNumbers.NO_COMMUNICATION_TO_REQUESTS_DB));
-			msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
-					MsoLogger.ResponseCode.DBAccessError,
-					"Exception while communciate with Request DB");
-			msoLogger.debug("End of the transaction, the final response is: "
-					+ (String) response.getEntity());
-			return response;
-
-		}
-
-		if (operationStatus == null) {
-			Response resp = msoRequest.buildServiceErrorResponse(
-					HttpStatus.SC_NO_CONTENT, MsoException.ServiceException,
-					"E2E serviceId " + serviceId + " is not found in DB",
-					ErrorNumbers.SVC_DETAILED_SERVICE_ERROR, null);
-			msoLogger.error(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR,
-					MSO_PROP_APIHANDLER_INFRA, "", "",
-					MsoLogger.ErrorCode.BusinessProcesssError,
-					"Null response from RequestDB when searching by serviceId");
-			msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
-					MsoLogger.ResponseCode.DataNotFound,
-					"Null response from RequestDB when searching by serviceId");
-			msoLogger.debug("End of the transaction, the final response is: "
-					+ (String) resp.getEntity());
-			return resp;
-
-		}
-
-		e2eServiceResponse.setOperationStatus(operationStatus);
-
-		return Response.status(200).entity(e2eServiceResponse).build();
-	}
-
-	private Response deleteE2EserviceInstances(String requestJSON,
-			Action action, HashMap<String, String> instanceIdMap, String version) {
-		// TODO should be a new one or the same service instance Id
-		String requestId = instanceIdMap.get("serviceId");
-		long startTime = System.currentTimeMillis();
-		msoLogger.debug("requestId is: " + requestId);
-		E2EServiceInstanceDeleteRequest e2eDelReq = null;
-
-		MsoRequest msoRequest = new MsoRequest(requestId);
-
-		ObjectMapper mapper = new ObjectMapper();
-		try {
-			e2eDelReq = mapper.readValue(requestJSON,
-					E2EServiceInstanceDeleteRequest.class);
-
-		} catch (Exception e) {
-
-			msoLogger.debug("Mapping of request to JSON object failed : ", e);
-			Response response = msoRequest.buildServiceErrorResponse(
-					HttpStatus.SC_BAD_REQUEST,
-					MsoException.ServiceException,
-					"Mapping of request to JSON object failed.  "
-							+ e.getMessage(), ErrorNumbers.SVC_BAD_PARAMETER,
-					null);
-			msoLogger.error(MessageEnum.APIH_REQUEST_VALIDATION_ERROR,
-					MSO_PROP_APIHANDLER_INFRA, "", "",
-					MsoLogger.ErrorCode.SchemaError, requestJSON, e);
-			msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
-					MsoLogger.ResponseCode.SchemaError,
-					"Mapping of request to JSON object failed");
-			msoLogger.debug("End of the transaction, the final response is: "
-					+ (String) response.getEntity());
-			createOperationStatusRecordForError(action, requestId);
-			return response;
-		}
-
-		CatalogDatabase db = null;
-		RecipeLookupResult recipeLookupResult = null;
-		try {
-			db = CatalogDatabase.getInstance();
-			//TODO  Get the service template model version uuid from AAI.
-			recipeLookupResult = getServiceInstanceOrchestrationURI(db, null, action);
-		} catch (Exception e) {
-			msoLogger.error(MessageEnum.APIH_DB_ACCESS_EXC,
-					MSO_PROP_APIHANDLER_INFRA, "", "",
-					MsoLogger.ErrorCode.AvailabilityError,
-					"Exception while communciate with Catalog DB", e);
-			msoRequest
-					.setStatus(org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED);
-			Response response = msoRequest.buildServiceErrorResponse(
-					HttpStatus.SC_NOT_FOUND, MsoException.ServiceException,
-					"No communication to catalog DB " + e.getMessage(),
-					ErrorNumbers.SVC_NO_SERVER_RESOURCES, null);
-			alarmLogger.sendAlarm("MsoDatabaseAccessError",
-					MsoAlarmLogger.CRITICAL, Messages.errors
-							.get(ErrorNumbers.NO_COMMUNICATION_TO_CATALOG_DB));
-			msoRequest.createRequestRecord(Status.FAILED, action);
-			msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
-					MsoLogger.ResponseCode.DBAccessError,
-					"Exception while communciate with DB");
-			msoLogger.debug(END_OF_THE_TRANSACTION
-					+ (String) response.getEntity());
-			return response;
-		} finally {
-			closeCatalogDB(db);
-		}
-		if (recipeLookupResult == null) {
-			msoLogger.error(MessageEnum.APIH_DB_ATTRIBUTE_NOT_FOUND,
-					MSO_PROP_APIHANDLER_INFRA, "", "",
-					MsoLogger.ErrorCode.DataError, "No recipe found in DB");
-			msoRequest
-					.setStatus(org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED);
-			Response response = msoRequest.buildServiceErrorResponse(
-					HttpStatus.SC_NOT_FOUND, MsoException.ServiceException,
-					"Recipe does not exist in catalog DB",
-					ErrorNumbers.SVC_GENERAL_SERVICE_ERROR, null);
-			msoRequest.createRequestRecord(Status.FAILED, action);
-			msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
-					MsoLogger.ResponseCode.DataNotFound,
-					"No recipe found in DB");
-			msoLogger.debug(END_OF_THE_TRANSACTION
-					+ (String) response.getEntity());
-			createOperationStatusRecordForError(action, requestId);
-			return response;
-		}
-
-		RequestClient requestClient = null;
-		HttpResponse response = null;
-
-		long subStartTime = System.currentTimeMillis();
-		// String sirRequestJson = mapReqJsonToSvcInstReq(e2eSir, requestJSON);
-
-		try {
-			requestClient = RequestClientFactory.getRequestClient(
-					recipeLookupResult.getOrchestrationURI(),
-					MsoPropertiesUtils.loadMsoProperties());
-
-			JSONObject jjo = new JSONObject(requestJSON);
-			jjo.put("operationId", UUIDChecker.generateUUID(msoLogger));
-
-			String bpmnRequest = jjo.toString();
-
-			// Capture audit event
-			msoLogger
-					.debug("MSO API Handler Posting call to BPEL engine for url: "
-							+ requestClient.getUrl());
-			String serviceId = instanceIdMap.get("serviceId");
-			String serviceInstanceType = e2eDelReq.getServiceType();
-			response = requestClient.post(requestId, false,
-					recipeLookupResult.getRecipeTimeout(), action.name(),
-					serviceId, null, null, null, null, serviceInstanceType,
-					null, null, null, bpmnRequest, recipeLookupResult.getRecipeParamXsd());
-
-			msoLogger.recordMetricEvent(subStartTime,
-					MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,
-					"Successfully received response from BPMN engine", "BPMN",
-					recipeLookupResult.getOrchestrationURI(), null);
-		} catch (Exception e) {
-			msoLogger.recordMetricEvent(subStartTime,
-					MsoLogger.StatusCode.ERROR,
-					MsoLogger.ResponseCode.CommunicationError,
-					"Exception while communicate with BPMN engine", "BPMN",
-					recipeLookupResult.getOrchestrationURI(), null);
-			Response resp = msoRequest.buildServiceErrorResponse(
-					HttpStatus.SC_BAD_GATEWAY, MsoException.ServiceException,
-					"Failed calling bpmn " + e.getMessage(),
-					ErrorNumbers.SVC_NO_SERVER_RESOURCES, null);
-			alarmLogger.sendAlarm("MsoConfigurationError",
-					MsoAlarmLogger.CRITICAL,
-					Messages.errors.get(ErrorNumbers.NO_COMMUNICATION_TO_BPEL));
-			msoLogger.error(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR,
-					MSO_PROP_APIHANDLER_INFRA, "", "",
-					MsoLogger.ErrorCode.AvailabilityError,
-					"Exception while communicate with BPMN engine");
-			msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
-					MsoLogger.ResponseCode.CommunicationError,
-					"Exception while communicate with BPMN engine");
-			msoLogger.debug("End of the transaction, the final response is: "
-					+ (String) resp.getEntity());
-			createOperationStatusRecordForError(action, requestId);
-			return resp;
-		}
-
-		if (response == null) {
-			Response resp = msoRequest.buildServiceErrorResponse(
-					HttpStatus.SC_BAD_GATEWAY, MsoException.ServiceException,
-					"bpelResponse is null",
-					ErrorNumbers.SVC_NO_SERVER_RESOURCES, null);
-			msoLogger.error(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR,
-					MSO_PROP_APIHANDLER_INFRA, "", "",
-					MsoLogger.ErrorCode.BusinessProcesssError,
-					"Null response from BPEL");
-			msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
-					MsoLogger.ResponseCode.InternalError,
-					"Null response from BPMN");
-			msoLogger.debug(END_OF_THE_TRANSACTION + (String) resp.getEntity());
-			createOperationStatusRecordForError(action, requestId);
-			return resp;
-		}
-
-		ResponseHandler respHandler = new ResponseHandler(response,
-				requestClient.getType());
-		int bpelStatus = respHandler.getStatus();
-
-		return beplStatusUpdate(requestId, startTime, msoRequest,
-				requestClient, respHandler, bpelStatus, action, instanceIdMap);
-	}
-
-	private Response processE2EserviceInstances(String requestJSON, Action action,
-			HashMap<String, String> instanceIdMap, String version) {
-
-		String requestId = UUIDChecker.generateUUID(msoLogger);
-		long startTime = System.currentTimeMillis();
-		msoLogger.debug("requestId is: " + requestId);
-		E2EServiceInstanceRequest e2eSir = null;
-
-		MsoRequest msoRequest = new MsoRequest(requestId);
-		ObjectMapper mapper = new ObjectMapper();
-		try {
-			e2eSir = mapper.readValue(requestJSON, E2EServiceInstanceRequest.class);
-
-		} catch (Exception e) {
-          //TODO update the service name
-          this.createOperationStatusRecordForError(action, requestId);
-		  
-			msoLogger.debug("Mapping of request to JSON object failed : ", e);
-			Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_REQUEST,
-					MsoException.ServiceException, "Mapping of request to JSON object failed.  " + e.getMessage(),
-					ErrorNumbers.SVC_BAD_PARAMETER, null);
-			msoLogger.error(MessageEnum.APIH_REQUEST_VALIDATION_ERROR, MSO_PROP_APIHANDLER_INFRA, "", "",
-					MsoLogger.ErrorCode.SchemaError, requestJSON, e);
-			msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.SchemaError,
-					"Mapping of request to JSON object failed");
-			msoLogger.debug("End of the transaction, the final response is: " + (String) response.getEntity());
-			return response;
-		}
-
-		mapReqJsonToSvcInstReq(e2eSir, requestJSON);
-		sir.getRequestDetails().getRequestParameters().setaLaCarte(true);
-		try {
-			msoRequest.parse(sir, instanceIdMap, action, version);
-		} catch (Exception e) {
-			msoLogger.debug("Validation failed: ", e);
-			Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_REQUEST,
-					MsoException.ServiceException, "Error parsing request.  " + e.getMessage(),
-					ErrorNumbers.SVC_BAD_PARAMETER, null);
-			if (msoRequest.getRequestId() != null) {
-				msoLogger.debug("Logging failed message to the database");
-				//TODO update the service name
-		          this.createOperationStatusRecordForError(action, requestId);
-			}
-			msoLogger.error(MessageEnum.APIH_REQUEST_VALIDATION_ERROR, MSO_PROP_APIHANDLER_INFRA, "", "",
-					MsoLogger.ErrorCode.SchemaError, requestJSON, e);
-			msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.SchemaError,
-					"Validation of the input request failed");
-			msoLogger.debug("End of the transaction, the final response is: " + (String) response.getEntity());
-			return response;
-		}
-		
-		OperationStatus dup = null;
-		String instanceName = sir.getRequestDetails().getRequestInfo().getInstanceName();
-		String requestScope = sir.getRequestDetails().getModelInfo().getModelType().name();
-		try {
-			if (!(instanceName == null && "service".equals(requestScope)
-					&& (action == Action.createInstance || action == Action.activateInstance))) {
-			  //TODO : Need to check for the duplicate record from the operation status,
-			  //TODO : commenting this check for unblocking current testing for now...  induces dead code...
-				dup = chkDuplicateServiceNameInOperStatus( instanceName);
-			}
-		} catch (Exception e) {
-			msoLogger.error(MessageEnum.APIH_DUPLICATE_CHECK_EXC, MSO_PROP_APIHANDLER_INFRA, "", "",
-					MsoLogger.ErrorCode.DataError, "Error during duplicate check ", e);
-
-			Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_INTERNAL_SERVER_ERROR,
-					MsoException.ServiceException, e.getMessage(), ErrorNumbers.SVC_DETAILED_SERVICE_ERROR, null);
-
-			msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DBAccessError,
-					"Error during duplicate check");
-			msoLogger.debug("End of the transaction, the final response is: " + (String) response.getEntity());
-			return response;
-		}
-
-		if (dup != null) {
-			// Found the duplicate record. Return the appropriate error.
-			String instance = null;
-			if (instanceName != null) {
-				instance = instanceName;
-			} else {
-				instance = instanceIdMap.get(requestScope + "InstanceId");
-			}
-			String dupMessage = "Error: Locked instance - This " + requestScope + " (" + instance + ") "
-					+ "already has a request being worked with a status of " + dup.getProgress() + " (ServiceId - "
-					+ dup.getServiceId() + "). The existing request must finish or be cleaned up before proceeding.";
-
-			Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_CONFLICT,
-					MsoException.ServiceException, dupMessage, ErrorNumbers.SVC_DETAILED_SERVICE_ERROR, null);
-
-			msoLogger.warn(MessageEnum.APIH_DUPLICATE_FOUND, dupMessage, "", "", MsoLogger.ErrorCode.SchemaError,
-					"Duplicate request - Subscriber already has a request for this service");
-			
-			
-			msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.Conflict,
-					dupMessage);
-			msoLogger.debug("End of the transaction, the final response is: " + (String) response.getEntity());
-			createOperationStatusRecordForError(action, requestId);
-			return response;
-		}
-		
-		CatalogDatabase db = null;
-		RecipeLookupResult recipeLookupResult = null;
-		try {
-			db = CatalogDatabase.getInstance();
-			recipeLookupResult = getServiceInstanceOrchestrationURI(db, e2eSir.getService().getTemplateId(), action);
-		} catch (Exception e) {
-			msoLogger.error(MessageEnum.APIH_DB_ACCESS_EXC, MSO_PROP_APIHANDLER_INFRA, "", "",
-					MsoLogger.ErrorCode.AvailabilityError, "Exception while communciate with Catalog DB", e);
-			msoRequest.setStatus(org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED);
-			Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_NOT_FOUND,
-					MsoException.ServiceException, "No communication to catalog DB " + e.getMessage(),
-					ErrorNumbers.SVC_NO_SERVER_RESOURCES, null);
-			alarmLogger.sendAlarm("MsoDatabaseAccessError", MsoAlarmLogger.CRITICAL,
-					Messages.errors.get(ErrorNumbers.NO_COMMUNICATION_TO_CATALOG_DB));
-			
-			msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DBAccessError,
-					"Exception while communciate with DB");
-			msoLogger.debug(END_OF_THE_TRANSACTION + (String) response.getEntity());
-			createOperationStatusRecordForError(action, requestId);
-			return response;
-		} finally {
-			closeCatalogDB(db);
-		}
-
-		if (recipeLookupResult == null) {
-			msoLogger.error(MessageEnum.APIH_DB_ATTRIBUTE_NOT_FOUND, MSO_PROP_APIHANDLER_INFRA, "", "",
-					MsoLogger.ErrorCode.DataError, "No recipe found in DB");
-			msoRequest.setStatus(org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED);
-			Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_NOT_FOUND,
-					MsoException.ServiceException, "Recipe does not exist in catalog DB",
-					ErrorNumbers.SVC_GENERAL_SERVICE_ERROR, null);
-		
-			msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound,
-					"No recipe found in DB");
-			msoLogger.debug(END_OF_THE_TRANSACTION + (String) response.getEntity());
-			createOperationStatusRecordForError(action, requestId);
-			return response;
-		}
-//		try {
-//			msoRequest.createRequestRecord(Status.PENDING, action);
-//			//createOperationStatusRecord(action, requestId);
-//		} catch (Exception e) {
-//			msoLogger.error(MessageEnum.APIH_DB_ACCESS_EXC_REASON, "Exception while creating record in DB", "", "",
-//					MsoLogger.ErrorCode.SchemaError, "Exception while creating record in DB", e);
-//			msoRequest.setStatus(org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED);
-//			Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_INTERNAL_SERVER_ERROR,
-//					MsoException.ServiceException, "Exception while creating record in DB " + e.getMessage(),
-//					ErrorNumbers.SVC_BAD_PARAMETER, null);
-//			msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DBAccessError,
-//					"Exception while creating record in DB");
-//			msoLogger.debug("End of the transaction, the final response is: " + (String) response.getEntity());
-//			return response;
-//		}
-
-		String serviceInstanceType = e2eSir.getService().getParameters().getServiceType();
-
-		String serviceId = "";
-		RequestClient requestClient = null;
-		HttpResponse response = null;
-
-		long subStartTime = System.currentTimeMillis();
-		String sirRequestJson = mapReqJsonToSvcInstReq(e2eSir, requestJSON);
-
-		try {
-			requestClient = RequestClientFactory.getRequestClient(recipeLookupResult.getOrchestrationURI(),
-					MsoPropertiesUtils.loadMsoProperties());
-
-			// Capture audit event
-			msoLogger.debug("MSO API Handler Posting call to BPEL engine for url: " + requestClient.getUrl());
-
-			response = requestClient.post(requestId, false, recipeLookupResult.getRecipeTimeout(), action.name(),
-					serviceId, null, null, null, null, serviceInstanceType, null, null, null, sirRequestJson, recipeLookupResult.getRecipeParamXsd());
-
-			msoLogger.recordMetricEvent(subStartTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,
-					"Successfully received response from BPMN engine", "BPMN", recipeLookupResult.getOrchestrationURI(),
-					null);
-		} catch (Exception e) {
-			msoLogger.recordMetricEvent(subStartTime, MsoLogger.StatusCode.ERROR,
-					MsoLogger.ResponseCode.CommunicationError, "Exception while communicate with BPMN engine", "BPMN",
-					recipeLookupResult.getOrchestrationURI(), null);
-			Response resp = msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_GATEWAY,
-					MsoException.ServiceException, "Failed calling bpmn " + e.getMessage(),
-					ErrorNumbers.SVC_NO_SERVER_RESOURCES, null);
-			alarmLogger.sendAlarm("MsoConfigurationError", MsoAlarmLogger.CRITICAL,
-					Messages.errors.get(ErrorNumbers.NO_COMMUNICATION_TO_BPEL));
-			msoLogger.error(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR, MSO_PROP_APIHANDLER_INFRA, "", "",
-					MsoLogger.ErrorCode.AvailabilityError, "Exception while communicate with BPMN engine");
-			msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError,
-					"Exception while communicate with BPMN engine");
-			msoLogger.debug("End of the transaction, the final response is: " + (String) resp.getEntity());
-			createOperationStatusRecordForError(action, requestId);
-			return resp;
-		}
-
-		if (response == null) {
-			Response resp = msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_GATEWAY,
-					MsoException.ServiceException, "bpelResponse is null", ErrorNumbers.SVC_NO_SERVER_RESOURCES, null);
-			msoLogger.error(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR, MSO_PROP_APIHANDLER_INFRA, "", "",
-					MsoLogger.ErrorCode.BusinessProcesssError, "Null response from BPEL");
-			msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.InternalError,
-					"Null response from BPMN");
-			msoLogger.debug(END_OF_THE_TRANSACTION + (String) resp.getEntity());
-			return resp;
-		}
-
-		ResponseHandler respHandler = new ResponseHandler(response, requestClient.getType());
-		int bpelStatus = respHandler.getStatus();
-
-		return beplStatusUpdate(requestId, startTime, msoRequest, requestClient, respHandler, bpelStatus, action, instanceIdMap);
-	}
-
-	private void closeCatalogDB(CatalogDatabase db) {
-		if (db != null) {
-			db.close();
-		}
-	}
-
-	private Response beplStatusUpdate(String requestId, long startTime,
-			MsoRequest msoRequest, RequestClient requestClient,
-			ResponseHandler respHandler, int bpelStatus, Action action,
-			HashMap<String, String> instanceIdMap) {
-		// BPMN accepted the request, the request is in progress
-		if (bpelStatus == HttpStatus.SC_ACCEPTED) {
-			String camundaJSONResponseBody = respHandler.getResponseBody();
-			msoLogger
-					.debug("Received from Camunda: " + camundaJSONResponseBody);
-
-			// currently only for delete case we update the status here
-			if (action == Action.deleteInstance) {
-				ObjectMapper mapper = new ObjectMapper();
-				try {
-					DelE2ESvcResp jo = mapper.readValue(
-							camundaJSONResponseBody, DelE2ESvcResp.class);
-					String operationId = jo.getOperationId();
-    				this.createOperationStatusRecord("DELETE", requestId,
-								operationId);
-				} catch (Exception ex) {
-					msoLogger.error(MessageEnum.APIH_BPEL_RESPONSE_ERROR,
-							requestClient.getUrl(), "", "",
-							MsoLogger.ErrorCode.BusinessProcesssError,
-							"Response from BPEL engine is failed with HTTP Status="
-									+ bpelStatus);
-				}
-			}
-			msoLogger.recordAuditEvent(startTime,
-					MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,
-					"BPMN accepted the request, the request is in progress");
-			msoLogger.debug(END_OF_THE_TRANSACTION + camundaJSONResponseBody);
-			return Response.status(HttpStatus.SC_ACCEPTED)
-					.entity(camundaJSONResponseBody).build();
-		} else {
-			List<String> variables = new ArrayList<>();
-			variables.add(bpelStatus + "");
-			String camundaJSONResponseBody = respHandler.getResponseBody();
-			if (camundaJSONResponseBody != null
-					&& !camundaJSONResponseBody.isEmpty()) {
-				Response resp = msoRequest.buildServiceErrorResponse(
-						bpelStatus, MsoException.ServiceException,
-						"Request Failed due to BPEL error with HTTP Status= %1 "
-								+ '\n' + camundaJSONResponseBody,
-						ErrorNumbers.SVC_DETAILED_SERVICE_ERROR, variables);
-				msoLogger.error(MessageEnum.APIH_BPEL_RESPONSE_ERROR,
-						requestClient.getUrl(), "", "",
-						MsoLogger.ErrorCode.BusinessProcesssError,
-						"Response from BPEL engine is failed with HTTP Status="
-								+ bpelStatus);
-				msoLogger.recordAuditEvent(startTime,
-						MsoLogger.StatusCode.ERROR,
-						MsoLogger.ResponseCode.InternalError,
-						"Response from BPMN engine is failed");
-				msoLogger.debug(END_OF_THE_TRANSACTION
-						+ (String) resp.getEntity());
-				return resp;
-			} else {
-				Response resp = msoRequest
-						.buildServiceErrorResponse(
-								bpelStatus,
-								MsoException.ServiceException,
-								"Request Failed due to BPEL error with HTTP Status= %1",
-								ErrorNumbers.SVC_DETAILED_SERVICE_ERROR,
-								variables);
-				msoLogger.error(MessageEnum.APIH_BPEL_RESPONSE_ERROR,
-						requestClient.getUrl(), "", "",
-						MsoLogger.ErrorCode.BusinessProcesssError,
-						"Response from BPEL engine is empty");
-				msoLogger.recordAuditEvent(startTime,
-						MsoLogger.StatusCode.ERROR,
-						MsoLogger.ResponseCode.InternalError,
-						"Response from BPEL engine is empty");
-				msoLogger.debug(END_OF_THE_TRANSACTION
-						+ (String) resp.getEntity());
-				return resp;
-			}
-		}
-	}
-
-	/**
-	 * Getting recipes from catalogDb
-	 * 
-	 * @param db the catalog db
-	 * @param serviceModelUUID the service model version uuid
-	 * @param action the action for the service
-	 * @return the service recipe result
-	 */
-	private RecipeLookupResult getServiceInstanceOrchestrationURI(
-			CatalogDatabase db, String serviceModelUUID, Action action) {
-
-		RecipeLookupResult recipeLookupResult = getServiceURI(db, serviceModelUUID, action);
-
-		if (recipeLookupResult != null) {
-			msoLogger.debug("Orchestration URI is: "
-					+ recipeLookupResult.getOrchestrationURI()
-					+ ", recipe Timeout is: "
-					+ Integer.toString(recipeLookupResult.getRecipeTimeout()));
-		} else {
-			msoLogger.debug("No matching recipe record found");
-		}
-		return recipeLookupResult;
-	}
-
-	/**
-	 * Getting recipes from catalogDb
-	 * If Service recipe is not set, use default recipe, if set , use special recipe.
-	 * @param db the catalog db
-	 * @param serviceModelUUID the service version uuid
-	 * @param action the action of the service.
-	 * @return the service recipe result.
-	 */
-	private RecipeLookupResult getServiceURI(CatalogDatabase db, String serviceModelUUID, Action action) {
-
-		String defaultServiceModelName = "UUI_DEFAULT";
-
-		Service defaultServiceRecord = db
-				.getServiceByModelName(defaultServiceModelName);
-		ServiceRecipe defaultRecipe = db.getServiceRecipeByModelUUID(
-		        defaultServiceRecord.getModelUUID(), action.name());
-		//set recipe as default generic recipe
-		ServiceRecipe recipe = defaultRecipe;
-		//check the service special recipe 
-		if(null != serviceModelUUID && ! serviceModelUUID.isEmpty()){
-		      ServiceRecipe serviceSpecialRecipe = db.getServiceRecipeByModelUUID(
-		              serviceModelUUID, action.name());
-		      if(null != serviceSpecialRecipe){
-		          //set service special recipe.
-		          recipe = serviceSpecialRecipe;
-		      }
-		}	
-		
-		if (recipe == null) {
-			return null;
-		}
-		return new RecipeLookupResult(recipe.getOrchestrationUri(),
-				recipe.getRecipeTimeout(), recipe.getServiceParamXSD());
-
-	}
-
-	/**
-	 * Converting E2EServiceInstanceRequest to ServiceInstanceRequest and
-	 * passing it to camunda engine.
-	 * 
-	 * @param e2eSir
-	 * @return
-	 */
-	private String mapReqJsonToSvcInstReq(E2EServiceInstanceRequest e2eSir,
-			String requestJSON) {
-
-		sir = new ServiceInstancesRequest();
-
-		String returnString = null;
-		RequestDetails requestDetails = new RequestDetails();
-		ModelInfo modelInfo = new ModelInfo();
-
-		// ModelInvariantId
-		modelInfo.setModelInvariantId(e2eSir.getService().getServiceDefId());
-
-		// modelNameVersionId
-		modelInfo.setModelNameVersionId(e2eSir.getService().getTemplateId());
-
-		// String modelInfoValue =
-		// e2eSir.getService().getParameters().getNodeTemplateName();
-		// String[] arrayOfInfo = modelInfoValue.split(":");
-		// String modelName = arrayOfInfo[0];
-		// String modelVersion = arrayOfInfo[1];
-
-		// TODO: To ensure, if we dont get the values from the UUI
-		String modelName = "voLTE";
-		String modelVersion = "1.0";
-		// modelName
-		modelInfo.setModelName(modelName);
-
-		// modelVersion
-		modelInfo.setModelVersion(modelVersion);
-
-		// modelType
-		modelInfo.setModelType(ModelType.service);
-
-		// setting modelInfo to requestDetails
-		requestDetails.setModelInfo(modelInfo);
-
-		SubscriberInfo subscriberInfo = new SubscriberInfo();
-
-		// globalsubscriberId
-		subscriberInfo.setGlobalSubscriberId(e2eSir.getService()
-				.getParameters().getGlobalSubscriberId());
-
-		// subscriberName
-		subscriberInfo.setSubscriberName(e2eSir.getService().getParameters()
-				.getSubscriberName());
-
-		// setting subscriberInfo to requestDetails
-		requestDetails.setSubscriberInfo(subscriberInfo);
-
-		RequestInfo requestInfo = new RequestInfo();
-
-		// instanceName
-		requestInfo.setInstanceName(e2eSir.getService().getName());
-
-		// source
-		requestInfo.setSource("UUI");
-
-		// suppressRollback
-		requestInfo.setSuppressRollback(true);
-
-		// setting requestInfo to requestDetails
-		requestDetails.setRequestInfo(requestInfo);
-
-		RequestParameters requestParameters = new RequestParameters();
-
-		// subscriptionServiceType
-		requestParameters.setSubscriptionServiceType("MOG");
-
-		// Userparams
-		List<E2EUserParam> userParams;
-		// userParams =
-		// e2eSir.getService().getParameters().getRequestParameters().getUserParams();
-		List<Map<String, String>> userParamList = new ArrayList<>();
-		Map<String, String> userParamMap = new HashMap<>();
-		// complete json request updated in the camunda
-		userParamMap.put("UUIRequest", requestJSON);
-		userParamMap.put("ServiceInstanceName", e2eSir.getService().getName());
-
-		// Map<String, String> userParamMap3 = null;
-		// for (E2EUserParam userp : userParams) {
-		// userParamMap.put(userp.getName(), userp.getValue());
-		//
-		// }
-		userParamList.add(userParamMap);
-		requestParameters.setUserParams(userParamList);
-
-		// setting requestParameters to requestDetails
-		requestDetails.setRequestParameters(requestParameters);
-
-		sir.setRequestDetails(requestDetails);
-
-		// converting to string
-		ObjectMapper mapper = new ObjectMapper();
-		try {
-			returnString = mapper.writeValueAsString(sir);
-		} catch (IOException e) {
-			msoLogger
-					.debug("Exception while converting ServiceInstancesRequest object to string",
-							e);
-		}
-
-		return returnString;
-	}
-
-	private void createOperationStatusRecordForError(Action action,
-			String requestId) throws MsoDatabaseException {
-
-		AbstractSessionFactoryManager requestsDbSessionFactoryManager = new RequestsDbSessionFactoryManager();
-
-		Session session = null;
-		try {
-
-			session = requestsDbSessionFactoryManager.getSessionFactory()
-					.openSession();
-			session.beginTransaction();
-
-			OperationStatus os = new OperationStatus();
-			os.setOperation(action.name());
-			os.setOperationContent("");
-			os.setOperationId("");
-			os.setProgress("100");
-			os.setReason("");
-			os.setResult("error");
-			os.setServiceId(requestId);
-			os.setUserId("");
-			Timestamp startTimeStamp = new Timestamp(System.currentTimeMillis());
-			Timestamp endTimeStamp = new Timestamp(System.currentTimeMillis());
-			os.setFinishedAt(endTimeStamp);
-			os.setOperateAt(startTimeStamp);
-
-			session.save(os);
-			session.getTransaction().commit();
-
-		} catch (Exception e) {
-			msoLogger.error(MessageEnum.APIH_DB_INSERT_EXC, "", "",
-					MsoLogger.ErrorCode.DataError,
-					"Exception when creation record request in Operation", e);
-			throw new MsoDatabaseException(
-					"Data did inserted in Operatus Status Table for failure", e);
-		} finally {
-			if (null != session) {
-				session.close();
-			}
-		}
-	}
-
-	private void createOperationStatusRecord(String actionNm, String serviceId,
-			String operationId) throws MsoDatabaseException {
-
-		AbstractSessionFactoryManager requestsDbSessionFactoryManager = new RequestsDbSessionFactoryManager();
-
-		Session session = null;
-		try {
-
-			session = requestsDbSessionFactoryManager.getSessionFactory()
-					.openSession();
-			session.beginTransaction();
-
-			OperationStatus os = new OperationStatus();
-			os.setOperation(actionNm);
-			os.setOperationContent("");
-			os.setOperationId(operationId);
-			os.setProgress("0");
-			os.setReason("");
-			os.setResult("processing");
-			os.setServiceId(serviceId);
-			// TODO : to be updated...
-			os.setUserId("");
-			Timestamp startTimeStamp = new Timestamp(System.currentTimeMillis());
-			Timestamp endTimeStamp = new Timestamp(System.currentTimeMillis());
-			os.setFinishedAt(endTimeStamp);
-			os.setOperateAt(startTimeStamp);
-
-			session.save(os);
-			session.getTransaction().commit();
-
-		} catch (Exception e) {
-			msoLogger.error(MessageEnum.APIH_DB_INSERT_EXC, "", "",
-					MsoLogger.ErrorCode.DataError,
-					"Exception when creation record request in Operation", e);
-			throw new MsoDatabaseException(
-					"Data did inserted in Operatus Status Table", e);
-		} finally {
-			if (null != session) {
-				session.close();
-			}
-		}
-	}
-
-	private OperationStatus chkDuplicateServiceInOperStatus(String serviceId) {
-		OperationStatus dupServiceName = (RequestsDatabase.getInstance())
-				.getOperationStatusByServiceId(serviceId);
-
-		return dupServiceName;
-	}
-
-	private OperationStatus chkDuplicateServiceNameInOperStatus(
-			String serviceName) {
-		OperationStatus dupServiceName = (RequestsDatabase.getInstance())
-				.getOperationStatusByServiceName(serviceName);
-
-		return dupServiceName;
-	}
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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.apihandlerinfra;
+
+import java.io.IOException;
+import java.sql.Timestamp;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+import org.apache.http.HttpResponse;
+import org.apache.http.HttpStatus;
+import org.codehaus.jackson.map.ObjectMapper;
+import org.hibernate.Session;
+import org.json.JSONObject;
+import org.openecomp.mso.apihandler.common.ErrorNumbers;
+import org.openecomp.mso.apihandler.common.RequestClient;
+import org.openecomp.mso.apihandler.common.RequestClientFactory;
+import org.openecomp.mso.apihandler.common.ResponseHandler;
+import org.openecomp.mso.apihandlerinfra.Messages;
+import org.openecomp.mso.apihandlerinfra.MsoException;
+import org.openecomp.mso.apihandlerinfra.MsoRequest;
+import org.openecomp.mso.apihandlerinfra.e2eserviceinstancebeans.DelE2ESvcResp;
+import org.openecomp.mso.apihandlerinfra.e2eserviceinstancebeans.E2EServiceInstanceDeleteRequest;
+import org.openecomp.mso.apihandlerinfra.e2eserviceinstancebeans.E2EServiceInstanceRequest;
+import org.openecomp.mso.apihandlerinfra.e2eserviceinstancebeans.E2EUserParam;
+import org.openecomp.mso.apihandlerinfra.e2eserviceinstancebeans.GetE2EServiceInstanceResponse;
+import org.openecomp.mso.apihandlerinfra.serviceinstancebeans.ModelInfo;
+import org.openecomp.mso.apihandlerinfra.serviceinstancebeans.RequestDetails;
+import org.openecomp.mso.apihandlerinfra.serviceinstancebeans.RequestInfo;
+import org.openecomp.mso.apihandlerinfra.serviceinstancebeans.RequestParameters;
+import org.openecomp.mso.apihandlerinfra.serviceinstancebeans.ServiceInstancesRequest;
+import org.openecomp.mso.apihandlerinfra.serviceinstancebeans.SubscriberInfo;
+import org.openecomp.mso.db.AbstractSessionFactoryManager;
+import org.openecomp.mso.db.catalog.CatalogDatabase;
+import org.openecomp.mso.db.catalog.beans.Service;
+import org.openecomp.mso.db.catalog.beans.ServiceRecipe;
+import org.openecomp.mso.logger.MessageEnum;
+import org.openecomp.mso.logger.MsoAlarmLogger;
+import org.openecomp.mso.logger.MsoLogger;
+import org.openecomp.mso.properties.MsoDatabaseException;
+import org.openecomp.mso.requestsdb.OperationStatus;
+import org.openecomp.mso.requestsdb.RequestsDatabase;
+import org.openecomp.mso.requestsdb.RequestsDbSessionFactoryManager;
+import org.openecomp.mso.utils.UUIDChecker;
+
+import com.wordnik.swagger.annotations.Api;
+import com.wordnik.swagger.annotations.ApiOperation;
+
+@Path("/e2eServiceInstances")
+@Api(value = "/e2eServiceInstances", description = "API Requests for E2E Service Instances")
+public class E2EServiceInstances {
+
+	private HashMap<String, String> instanceIdMap = new HashMap<>();
+	private static MsoLogger msoLogger = MsoLogger
+			.getMsoLogger(MsoLogger.Catalog.APIH);
+	private static MsoAlarmLogger alarmLogger = new MsoAlarmLogger();
+	public static final String MSO_PROP_APIHANDLER_INFRA = "MSO_PROP_APIHANDLER_INFRA";
+	private ServiceInstancesRequest sir = null;
+
+	public static final String END_OF_THE_TRANSACTION = "End of the transaction, the final response is: ";
+	public static final String EXCEPTION_CREATING_DB_RECORD = "Exception while creating record in DB";
+	public static final String EXCEPTION_COMMUNICATE_BPMN_ENGINE = "Exception while communicate with BPMN engine";
+
+	/**
+	 * POST Requests for E2E Service create Instance on a version provided
+	 */
+
+	@POST
+	@Path("/{version:[vV][3-5]}")
+	@Consumes(MediaType.APPLICATION_JSON)
+	@Produces(MediaType.APPLICATION_JSON)
+	@ApiOperation(value = "Create an E2E Service Instance on a version provided", response = Response.class)
+	public Response createE2EServiceInstance(String request,
+			@PathParam("version") String version) {
+
+		return processE2EserviceInstances(request, Action.createInstance, null,
+				version);
+	}
+	
+	/**
+	 * PUT Requests for E2E Service update Instance on a version provided
+	 */
+
+	@PUT
+	@Path("/{version:[vV][3-5]}/{serviceId}")
+	@Consumes(MediaType.APPLICATION_JSON)
+	@Produces(MediaType.APPLICATION_JSON)
+	@ApiOperation(value = "Update an E2E Service Instance on a version provided and serviceId", response = Response.class)
+	public Response updateE2EServiceInstance(String request,
+			@PathParam("version") String version,
+			@PathParam("serviceId") String serviceId) {
+		
+		instanceIdMap.put("serviceId", serviceId);
+
+		return updateE2EserviceInstances(request, Action.updateInstance, instanceIdMap,
+				version);
+	}
+
+	/**
+	 * DELETE Requests for E2E Service delete Instance on a specified version
+	 * and serviceId
+	 */
+
+	@DELETE
+	@Path("/{version:[vV][3-5]}/{serviceId}")
+	@Consumes(MediaType.APPLICATION_JSON)
+	@Produces(MediaType.APPLICATION_JSON)
+	@ApiOperation(value = "Delete E2E Service Instance on a specified version and serviceId", response = Response.class)
+	public Response deleteE2EServiceInstance(String request,
+			@PathParam("version") String version,
+			@PathParam("serviceId") String serviceId) {
+
+		instanceIdMap.put("serviceId", serviceId);
+
+		return deleteE2EserviceInstances(request, Action.deleteInstance,
+				instanceIdMap, version);
+	}
+
+	@GET
+	@Path("/{version:[vV][3-5]}/{serviceId}/operations/{operationId}")
+	@ApiOperation(value = "Find e2eServiceInstances Requests for a given serviceId and operationId", response = Response.class)
+	@Produces(MediaType.APPLICATION_JSON)
+	public Response getE2EServiceInstances(
+			@PathParam("serviceId") String serviceId,
+			@PathParam("version") String version,
+			@PathParam("operationId") String operationId) {
+		return getE2EServiceInstances(serviceId, operationId);
+	}
+
+	private Response getE2EServiceInstances(String serviceId, String operationId) {
+		RequestsDatabase requestsDB = RequestsDatabase.getInstance();
+
+		GetE2EServiceInstanceResponse e2eServiceResponse = new GetE2EServiceInstanceResponse();
+
+		MsoRequest msoRequest = new MsoRequest(serviceId);
+
+		long startTime = System.currentTimeMillis();
+
+		OperationStatus operationStatus = null;
+
+		try {
+			operationStatus = requestsDB.getOperationStatus(serviceId,
+					operationId);
+
+		} catch (Exception e) {
+			msoLogger
+					.error(MessageEnum.APIH_DB_ACCESS_EXC,
+							MSO_PROP_APIHANDLER_INFRA,
+							"",
+							"",
+							MsoLogger.ErrorCode.AvailabilityError,
+							"Exception while communciate with Request DB - Infra Request Lookup",
+							e);
+			msoRequest
+					.setStatus(org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED);
+			Response response = msoRequest.buildServiceErrorResponse(
+					HttpStatus.SC_NOT_FOUND, MsoException.ServiceException,
+					e.getMessage(),
+					ErrorNumbers.NO_COMMUNICATION_TO_REQUESTS_DB, null);
+			alarmLogger.sendAlarm("MsoDatabaseAccessError",
+					MsoAlarmLogger.CRITICAL, Messages.errors
+							.get(ErrorNumbers.NO_COMMUNICATION_TO_REQUESTS_DB));
+			msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
+					MsoLogger.ResponseCode.DBAccessError,
+					"Exception while communciate with Request DB");
+			msoLogger.debug("End of the transaction, the final response is: "
+					+ (String) response.getEntity());
+			return response;
+
+		}
+
+		if (operationStatus == null) {
+			Response resp = msoRequest.buildServiceErrorResponse(
+					HttpStatus.SC_NO_CONTENT, MsoException.ServiceException,
+					"E2E serviceId " + serviceId + " is not found in DB",
+					ErrorNumbers.SVC_DETAILED_SERVICE_ERROR, null);
+			msoLogger.error(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR,
+					MSO_PROP_APIHANDLER_INFRA, "", "",
+					MsoLogger.ErrorCode.BusinessProcesssError,
+					"Null response from RequestDB when searching by serviceId");
+			msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
+					MsoLogger.ResponseCode.DataNotFound,
+					"Null response from RequestDB when searching by serviceId");
+			msoLogger.debug("End of the transaction, the final response is: "
+					+ (String) resp.getEntity());
+			return resp;
+
+		}
+
+		e2eServiceResponse.setOperationStatus(operationStatus);
+
+		return Response.status(200).entity(e2eServiceResponse).build();
+	}
+
+	private Response deleteE2EserviceInstances(String requestJSON,
+			Action action, HashMap<String, String> instanceIdMap, String version) {
+		// TODO should be a new one or the same service instance Id
+		String requestId = instanceIdMap.get("serviceId");
+		long startTime = System.currentTimeMillis();
+		msoLogger.debug("requestId is: " + requestId);
+		E2EServiceInstanceDeleteRequest e2eDelReq = null;
+
+		MsoRequest msoRequest = new MsoRequest(requestId);
+
+		ObjectMapper mapper = new ObjectMapper();
+		try {
+			e2eDelReq = mapper.readValue(requestJSON,
+					E2EServiceInstanceDeleteRequest.class);
+
+		} catch (Exception e) {
+
+			msoLogger.debug("Mapping of request to JSON object failed : ", e);
+			Response response = msoRequest.buildServiceErrorResponse(
+					HttpStatus.SC_BAD_REQUEST,
+					MsoException.ServiceException,
+					"Mapping of request to JSON object failed.  "
+							+ e.getMessage(), ErrorNumbers.SVC_BAD_PARAMETER,
+					null);
+			msoLogger.error(MessageEnum.APIH_REQUEST_VALIDATION_ERROR,
+					MSO_PROP_APIHANDLER_INFRA, "", "",
+					MsoLogger.ErrorCode.SchemaError, requestJSON, e);
+			msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
+					MsoLogger.ResponseCode.SchemaError,
+					"Mapping of request to JSON object failed");
+			msoLogger.debug("End of the transaction, the final response is: "
+					+ (String) response.getEntity());
+			createOperationStatusRecordForError(action, requestId);
+			return response;
+		}
+
+		CatalogDatabase db = null;
+		RecipeLookupResult recipeLookupResult = null;
+		try {
+			db = CatalogDatabase.getInstance();
+			//TODO  Get the service template model version uuid from AAI.
+			recipeLookupResult = getServiceInstanceOrchestrationURI(db, null, action);
+		} catch (Exception e) {
+			msoLogger.error(MessageEnum.APIH_DB_ACCESS_EXC,
+					MSO_PROP_APIHANDLER_INFRA, "", "",
+					MsoLogger.ErrorCode.AvailabilityError,
+					"Exception while communciate with Catalog DB", e);
+			msoRequest
+					.setStatus(org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED);
+			Response response = msoRequest.buildServiceErrorResponse(
+					HttpStatus.SC_NOT_FOUND, MsoException.ServiceException,
+					"No communication to catalog DB " + e.getMessage(),
+					ErrorNumbers.SVC_NO_SERVER_RESOURCES, null);
+			alarmLogger.sendAlarm("MsoDatabaseAccessError",
+					MsoAlarmLogger.CRITICAL, Messages.errors
+							.get(ErrorNumbers.NO_COMMUNICATION_TO_CATALOG_DB));
+			msoRequest.createRequestRecord(Status.FAILED, action);
+			msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
+					MsoLogger.ResponseCode.DBAccessError,
+					"Exception while communciate with DB");
+			msoLogger.debug(END_OF_THE_TRANSACTION
+					+ (String) response.getEntity());
+			return response;
+		} finally {
+			closeCatalogDB(db);
+		}
+		if (recipeLookupResult == null) {
+			msoLogger.error(MessageEnum.APIH_DB_ATTRIBUTE_NOT_FOUND,
+					MSO_PROP_APIHANDLER_INFRA, "", "",
+					MsoLogger.ErrorCode.DataError, "No recipe found in DB");
+			msoRequest
+					.setStatus(org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED);
+			Response response = msoRequest.buildServiceErrorResponse(
+					HttpStatus.SC_NOT_FOUND, MsoException.ServiceException,
+					"Recipe does not exist in catalog DB",
+					ErrorNumbers.SVC_GENERAL_SERVICE_ERROR, null);
+			msoRequest.createRequestRecord(Status.FAILED, action);
+			msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
+					MsoLogger.ResponseCode.DataNotFound,
+					"No recipe found in DB");
+			msoLogger.debug(END_OF_THE_TRANSACTION
+					+ (String) response.getEntity());
+			createOperationStatusRecordForError(action, requestId);
+			return response;
+		}
+
+		RequestClient requestClient = null;
+		HttpResponse response = null;
+
+		long subStartTime = System.currentTimeMillis();
+		// String sirRequestJson = mapReqJsonToSvcInstReq(e2eSir, requestJSON);
+
+		try {
+			requestClient = RequestClientFactory.getRequestClient(
+					recipeLookupResult.getOrchestrationURI(),
+					MsoPropertiesUtils.loadMsoProperties());
+
+			JSONObject jjo = new JSONObject(requestJSON);
+			jjo.put("operationId", UUIDChecker.generateUUID(msoLogger));
+
+			String bpmnRequest = jjo.toString();
+
+			// Capture audit event
+			msoLogger
+					.debug("MSO API Handler Posting call to BPEL engine for url: "
+							+ requestClient.getUrl());
+			String serviceId = instanceIdMap.get("serviceId");
+			String serviceInstanceType = e2eDelReq.getServiceType();
+			response = requestClient.post(requestId, false,
+					recipeLookupResult.getRecipeTimeout(), action.name(),
+					serviceId, null, null, null, null, serviceInstanceType,
+					null, null, null, bpmnRequest, recipeLookupResult.getRecipeParamXsd());
+
+			msoLogger.recordMetricEvent(subStartTime,
+					MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,
+					"Successfully received response from BPMN engine", "BPMN",
+					recipeLookupResult.getOrchestrationURI(), null);
+		} catch (Exception e) {
+			msoLogger.recordMetricEvent(subStartTime,
+					MsoLogger.StatusCode.ERROR,
+					MsoLogger.ResponseCode.CommunicationError,
+					"Exception while communicate with BPMN engine", "BPMN",
+					recipeLookupResult.getOrchestrationURI(), null);
+			Response resp = msoRequest.buildServiceErrorResponse(
+					HttpStatus.SC_BAD_GATEWAY, MsoException.ServiceException,
+					"Failed calling bpmn " + e.getMessage(),
+					ErrorNumbers.SVC_NO_SERVER_RESOURCES, null);
+			alarmLogger.sendAlarm("MsoConfigurationError",
+					MsoAlarmLogger.CRITICAL,
+					Messages.errors.get(ErrorNumbers.NO_COMMUNICATION_TO_BPEL));
+			msoLogger.error(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR,
+					MSO_PROP_APIHANDLER_INFRA, "", "",
+					MsoLogger.ErrorCode.AvailabilityError,
+					"Exception while communicate with BPMN engine");
+			msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
+					MsoLogger.ResponseCode.CommunicationError,
+					"Exception while communicate with BPMN engine");
+			msoLogger.debug("End of the transaction, the final response is: "
+					+ (String) resp.getEntity());
+			createOperationStatusRecordForError(action, requestId);
+			return resp;
+		}
+
+		if (response == null) {
+			Response resp = msoRequest.buildServiceErrorResponse(
+					HttpStatus.SC_BAD_GATEWAY, MsoException.ServiceException,
+					"bpelResponse is null",
+					ErrorNumbers.SVC_NO_SERVER_RESOURCES, null);
+			msoLogger.error(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR,
+					MSO_PROP_APIHANDLER_INFRA, "", "",
+					MsoLogger.ErrorCode.BusinessProcesssError,
+					"Null response from BPEL");
+			msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
+					MsoLogger.ResponseCode.InternalError,
+					"Null response from BPMN");
+			msoLogger.debug(END_OF_THE_TRANSACTION + (String) resp.getEntity());
+			createOperationStatusRecordForError(action, requestId);
+			return resp;
+		}
+
+		ResponseHandler respHandler = new ResponseHandler(response,
+				requestClient.getType());
+		int bpelStatus = respHandler.getStatus();
+
+		return beplStatusUpdate(requestId, startTime, msoRequest,
+				requestClient, respHandler, bpelStatus, action, instanceIdMap);
+	}
+
+	private Response updateE2EserviceInstances(String requestJSON, Action action,
+			HashMap<String, String> instanceIdMap, String version) {
+
+		String requestId = instanceIdMap.get("serviceId");
+		long startTime = System.currentTimeMillis();
+		msoLogger.debug("requestId is: " + requestId);
+		E2EServiceInstanceRequest e2eSir = null;
+
+		MsoRequest msoRequest = new MsoRequest(requestId);
+		ObjectMapper mapper = new ObjectMapper();
+		try {
+			e2eSir = mapper.readValue(requestJSON, E2EServiceInstanceRequest.class);
+
+		} catch (Exception e) {
+          
+          this.createOperationStatusRecordForError(action, requestId);
+		  
+			msoLogger.debug("Mapping of request to JSON object failed : ", e);
+			Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_REQUEST,
+					MsoException.ServiceException, "Mapping of request to JSON object failed.  " + e.getMessage(),
+					ErrorNumbers.SVC_BAD_PARAMETER, null);
+			msoLogger.error(MessageEnum.APIH_REQUEST_VALIDATION_ERROR, MSO_PROP_APIHANDLER_INFRA, "", "",
+					MsoLogger.ErrorCode.SchemaError, requestJSON, e);
+			msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.SchemaError,
+					"Mapping of request to JSON object failed");
+			msoLogger.debug("End of the transaction, the final response is: " + (String) response.getEntity());
+			return response;
+		}
+
+		mapReqJsonToSvcInstReq(e2eSir, requestJSON);
+		sir.getRequestDetails().getRequestParameters().setaLaCarte(true);
+		try {
+			msoRequest.parse(sir, instanceIdMap, action, version);
+		} catch (Exception e) {
+			msoLogger.debug("Validation failed: ", e);
+			Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_REQUEST,
+					MsoException.ServiceException, "Error parsing request.  " + e.getMessage(),
+					ErrorNumbers.SVC_BAD_PARAMETER, null);
+			if (msoRequest.getRequestId() != null) {
+				msoLogger.debug("Logging failed message to the database");
+				this.createOperationStatusRecordForError(action, requestId);
+			}
+			msoLogger.error(MessageEnum.APIH_REQUEST_VALIDATION_ERROR, MSO_PROP_APIHANDLER_INFRA, "", "",
+					MsoLogger.ErrorCode.SchemaError, requestJSON, e);
+			msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.SchemaError,
+					"Validation of the input request failed");
+			msoLogger.debug("End of the transaction, the final response is: " + (String) response.getEntity());
+			return response;
+		}
+		
+		//check for the current operation status
+		Response resp = checkE2ESvcInstStatus(action, requestId, startTime, msoRequest);
+		if(resp != null && resp.getStatus() != 200) {
+			return resp;
+		}
+		
+		CatalogDatabase db = null;
+		RecipeLookupResult recipeLookupResult = null;
+		try {
+			db = CatalogDatabase.getInstance();
+			recipeLookupResult = getServiceInstanceOrchestrationURI(db, e2eSir.getService().getTemplateId(), action);
+		} catch (Exception e) {
+			msoLogger.error(MessageEnum.APIH_DB_ACCESS_EXC, MSO_PROP_APIHANDLER_INFRA, "", "",
+					MsoLogger.ErrorCode.AvailabilityError, "Exception while communciate with Catalog DB", e);
+			msoRequest.setStatus(org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED);
+			Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_NOT_FOUND,
+					MsoException.ServiceException, "No communication to catalog DB " + e.getMessage(),
+					ErrorNumbers.SVC_NO_SERVER_RESOURCES, null);
+			alarmLogger.sendAlarm("MsoDatabaseAccessError", MsoAlarmLogger.CRITICAL,
+					Messages.errors.get(ErrorNumbers.NO_COMMUNICATION_TO_CATALOG_DB));
+			
+			msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DBAccessError,
+					"Exception while communciate with DB");
+			msoLogger.debug(END_OF_THE_TRANSACTION + (String) response.getEntity());
+			createOperationStatusRecordForError(action, requestId);
+			return response;
+		} finally {
+			closeCatalogDB(db);
+		}
+
+		if (recipeLookupResult == null) {
+			msoLogger.error(MessageEnum.APIH_DB_ATTRIBUTE_NOT_FOUND, MSO_PROP_APIHANDLER_INFRA, "", "",
+					MsoLogger.ErrorCode.DataError, "No recipe found in DB");
+			msoRequest.setStatus(org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED);
+			Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_NOT_FOUND,
+					MsoException.ServiceException, "Recipe does not exist in catalog DB",
+					ErrorNumbers.SVC_GENERAL_SERVICE_ERROR, null);
+		
+			msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound,
+					"No recipe found in DB");
+			msoLogger.debug(END_OF_THE_TRANSACTION + (String) response.getEntity());
+			createOperationStatusRecordForError(action, requestId);
+			return response;
+		}
+
+		String serviceInstanceType = e2eSir.getService().getParameters().getServiceType();
+
+		String serviceId = "";
+		RequestClient requestClient = null;
+		HttpResponse response = null;
+
+		long subStartTime = System.currentTimeMillis();
+		String sirRequestJson = mapReqJsonToSvcInstReq(e2eSir, requestJSON);
+
+		try {
+			requestClient = RequestClientFactory.getRequestClient(recipeLookupResult.getOrchestrationURI(),
+					MsoPropertiesUtils.loadMsoProperties());
+
+			// Capture audit event
+			msoLogger.debug("MSO API Handler Posting call to BPEL engine for url: " + requestClient.getUrl());
+
+			response = requestClient.post(requestId, false, recipeLookupResult.getRecipeTimeout(), action.name(),
+					serviceId, null, null, null, null, serviceInstanceType, null, null, null, sirRequestJson, recipeLookupResult.getRecipeParamXsd());
+
+			msoLogger.recordMetricEvent(subStartTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,
+					"Successfully received response from BPMN engine", "BPMN", recipeLookupResult.getOrchestrationURI(),
+					null);
+		} catch (Exception e) {
+			msoLogger.recordMetricEvent(subStartTime, MsoLogger.StatusCode.ERROR,
+					MsoLogger.ResponseCode.CommunicationError, "Exception while communicate with BPMN engine", "BPMN",
+					recipeLookupResult.getOrchestrationURI(), null);
+			Response getBPMNResp = msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_GATEWAY,
+					MsoException.ServiceException, "Failed calling bpmn " + e.getMessage(),
+					ErrorNumbers.SVC_NO_SERVER_RESOURCES, null);
+			alarmLogger.sendAlarm("MsoConfigurationError", MsoAlarmLogger.CRITICAL,
+					Messages.errors.get(ErrorNumbers.NO_COMMUNICATION_TO_BPEL));
+			msoLogger.error(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR, MSO_PROP_APIHANDLER_INFRA, "", "",
+					MsoLogger.ErrorCode.AvailabilityError, "Exception while communicate with BPMN engine");
+			msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError,
+					"Exception while communicate with BPMN engine");
+			msoLogger.debug("End of the transaction, the final response is: " + (String) getBPMNResp.getEntity());
+			createOperationStatusRecordForError(action, requestId);
+			return getBPMNResp;
+		}
+
+		if (response == null) {
+			Response getBPMNResp = msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_GATEWAY,
+					MsoException.ServiceException, "bpelResponse is null", ErrorNumbers.SVC_NO_SERVER_RESOURCES, null);
+			msoLogger.error(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR, MSO_PROP_APIHANDLER_INFRA, "", "",
+					MsoLogger.ErrorCode.BusinessProcesssError, "Null response from BPEL");
+			msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.InternalError,
+					"Null response from BPMN");
+			msoLogger.debug(END_OF_THE_TRANSACTION + (String) getBPMNResp.getEntity());
+			return getBPMNResp;
+		}
+
+		ResponseHandler respHandler = new ResponseHandler(response, requestClient.getType());
+		int bpelStatus = respHandler.getStatus();
+
+		return beplStatusUpdate(requestId, startTime, msoRequest, requestClient, respHandler, bpelStatus, action, instanceIdMap);
+	}
+
+	private Response checkE2ESvcInstStatus(Action action, String requestId, long startTime, MsoRequest msoRequest) {
+		OperationStatus curStatus = null;
+//		String instanceName = sir.getRequestDetails().getRequestInfo().getInstanceName();
+		String requestScope = sir.getRequestDetails().getModelInfo().getModelType().name();
+		try {
+			if (!(requestId == null && "service".equals(requestScope) && (action == Action.updateInstance))) {			    
+				curStatus = chkSvcInstOperStatusbySvcId(requestId);
+			}
+		} catch (Exception e) {
+			msoLogger.error(MessageEnum.APIH_DUPLICATE_CHECK_EXC, MSO_PROP_APIHANDLER_INFRA, "", "",
+					MsoLogger.ErrorCode.DataError, "Error during current operation status check ", e);
+
+			Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_INTERNAL_SERVER_ERROR,
+					MsoException.ServiceException, e.getMessage(), ErrorNumbers.SVC_DETAILED_SERVICE_ERROR, null);
+
+			msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DBAccessError,
+					"Error during current operation status check");
+			msoLogger.debug("End of the transaction, the final response is: " + (String) response.getEntity());
+			return response;
+		}
+
+		if (curStatus != null && !curStatus.getProgress().equals("100")) {
+			String chkMessage = "Error: Locked instance - This " + requestScope + " (" + requestId + ") "
+					+ "now being worked with a status of " + curStatus.getProgress() + " (ServiceName - "
+					+ curStatus.getServiceName()
+					+ "). The existing request must finish or be cleaned up before proceeding.";
+
+			Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_CONFLICT,
+					MsoException.ServiceException, chkMessage, ErrorNumbers.SVC_DETAILED_SERVICE_ERROR, null);
+
+			msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.Conflict,
+					chkMessage);
+
+			msoLogger.debug("End of the transaction, the final response is: " + (String) response.getEntity());
+
+			createOperationStatusRecordForError(action, requestId);
+
+			return response;
+		}
+		
+		return Response.status(200).entity(null).build();
+	}
+	
+	private Response processE2EserviceInstances(String requestJSON, Action action,
+			HashMap<String, String> instanceIdMap, String version) {
+
+		String requestId = UUIDChecker.generateUUID(msoLogger);
+		long startTime = System.currentTimeMillis();
+		msoLogger.debug("requestId is: " + requestId);
+		E2EServiceInstanceRequest e2eSir = null;
+
+		MsoRequest msoRequest = new MsoRequest(requestId);
+		ObjectMapper mapper = new ObjectMapper();
+		try {
+			e2eSir = mapper.readValue(requestJSON, E2EServiceInstanceRequest.class);
+
+		} catch (Exception e) {
+          //TODO update the service name
+          this.createOperationStatusRecordForError(action, requestId);
+		  
+			msoLogger.debug("Mapping of request to JSON object failed : ", e);
+			Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_REQUEST,
+					MsoException.ServiceException, "Mapping of request to JSON object failed.  " + e.getMessage(),
+					ErrorNumbers.SVC_BAD_PARAMETER, null);
+			msoLogger.error(MessageEnum.APIH_REQUEST_VALIDATION_ERROR, MSO_PROP_APIHANDLER_INFRA, "", "",
+					MsoLogger.ErrorCode.SchemaError, requestJSON, e);
+			msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.SchemaError,
+					"Mapping of request to JSON object failed");
+			msoLogger.debug("End of the transaction, the final response is: " + (String) response.getEntity());
+			return response;
+		}
+
+		mapReqJsonToSvcInstReq(e2eSir, requestJSON);
+		sir.getRequestDetails().getRequestParameters().setaLaCarte(true);
+		try {
+			msoRequest.parse(sir, instanceIdMap, action, version);
+		} catch (Exception e) {
+			msoLogger.debug("Validation failed: ", e);
+			Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_REQUEST,
+					MsoException.ServiceException, "Error parsing request.  " + e.getMessage(),
+					ErrorNumbers.SVC_BAD_PARAMETER, null);
+			if (msoRequest.getRequestId() != null) {
+				msoLogger.debug("Logging failed message to the database");
+				//TODO update the service name
+		          this.createOperationStatusRecordForError(action, requestId);
+			}
+			msoLogger.error(MessageEnum.APIH_REQUEST_VALIDATION_ERROR, MSO_PROP_APIHANDLER_INFRA, "", "",
+					MsoLogger.ErrorCode.SchemaError, requestJSON, e);
+			msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.SchemaError,
+					"Validation of the input request failed");
+			msoLogger.debug("End of the transaction, the final response is: " + (String) response.getEntity());
+			return response;
+		}
+		
+		OperationStatus dup = null;
+		String instanceName = sir.getRequestDetails().getRequestInfo().getInstanceName();
+		String requestScope = sir.getRequestDetails().getModelInfo().getModelType().name();
+		try {
+			if (!(instanceName == null && "service".equals(requestScope)
+					&& (action == Action.createInstance || action == Action.activateInstance))) {
+			  //TODO : Need to check for the duplicate record from the operation status,
+			  //TODO : commenting this check for unblocking current testing for now...  induces dead code...
+				dup = chkDuplicateServiceNameInOperStatus( instanceName);
+			}
+		} catch (Exception e) {
+			msoLogger.error(MessageEnum.APIH_DUPLICATE_CHECK_EXC, MSO_PROP_APIHANDLER_INFRA, "", "",
+					MsoLogger.ErrorCode.DataError, "Error during duplicate check ", e);
+
+			Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_INTERNAL_SERVER_ERROR,
+					MsoException.ServiceException, e.getMessage(), ErrorNumbers.SVC_DETAILED_SERVICE_ERROR, null);
+
+			msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DBAccessError,
+					"Error during duplicate check");
+			msoLogger.debug("End of the transaction, the final response is: " + (String) response.getEntity());
+			return response;
+		}
+
+		if (dup != null) {
+			// Found the duplicate record. Return the appropriate error.
+			String instance = null;
+			if (instanceName != null) {
+				instance = instanceName;
+			} else {
+				instance = instanceIdMap.get(requestScope + "InstanceId");
+			}
+			String dupMessage = "Error: Locked instance - This " + requestScope + " (" + instance + ") "
+					+ "already has a request being worked with a status of " + dup.getProgress() + " (ServiceId - "
+					+ dup.getServiceId() + "). The existing request must finish or be cleaned up before proceeding.";
+
+			Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_CONFLICT,
+					MsoException.ServiceException, dupMessage, ErrorNumbers.SVC_DETAILED_SERVICE_ERROR, null);
+
+			msoLogger.warn(MessageEnum.APIH_DUPLICATE_FOUND, dupMessage, "", "", MsoLogger.ErrorCode.SchemaError,
+					"Duplicate request - Subscriber already has a request for this service");
+			
+			
+			msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.Conflict,
+					dupMessage);
+			msoLogger.debug("End of the transaction, the final response is: " + (String) response.getEntity());
+			createOperationStatusRecordForError(action, requestId);
+			return response;
+		}
+		
+		CatalogDatabase db = null;
+		RecipeLookupResult recipeLookupResult = null;
+		try {
+			db = CatalogDatabase.getInstance();
+			recipeLookupResult = getServiceInstanceOrchestrationURI(db, e2eSir.getService().getTemplateId(), action);
+		} catch (Exception e) {
+			msoLogger.error(MessageEnum.APIH_DB_ACCESS_EXC, MSO_PROP_APIHANDLER_INFRA, "", "",
+					MsoLogger.ErrorCode.AvailabilityError, "Exception while communciate with Catalog DB", e);
+			msoRequest.setStatus(org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED);
+			Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_NOT_FOUND,
+					MsoException.ServiceException, "No communication to catalog DB " + e.getMessage(),
+					ErrorNumbers.SVC_NO_SERVER_RESOURCES, null);
+			alarmLogger.sendAlarm("MsoDatabaseAccessError", MsoAlarmLogger.CRITICAL,
+					Messages.errors.get(ErrorNumbers.NO_COMMUNICATION_TO_CATALOG_DB));
+			
+			msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DBAccessError,
+					"Exception while communciate with DB");
+			msoLogger.debug(END_OF_THE_TRANSACTION + (String) response.getEntity());
+			createOperationStatusRecordForError(action, requestId);
+			return response;
+		} finally {
+			closeCatalogDB(db);
+		}
+
+		if (recipeLookupResult == null) {
+			msoLogger.error(MessageEnum.APIH_DB_ATTRIBUTE_NOT_FOUND, MSO_PROP_APIHANDLER_INFRA, "", "",
+					MsoLogger.ErrorCode.DataError, "No recipe found in DB");
+			msoRequest.setStatus(org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED);
+			Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_NOT_FOUND,
+					MsoException.ServiceException, "Recipe does not exist in catalog DB",
+					ErrorNumbers.SVC_GENERAL_SERVICE_ERROR, null);
+		
+			msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound,
+					"No recipe found in DB");
+			msoLogger.debug(END_OF_THE_TRANSACTION + (String) response.getEntity());
+			createOperationStatusRecordForError(action, requestId);
+			return response;
+		}
+//		try {
+//			msoRequest.createRequestRecord(Status.PENDING, action);
+//			//createOperationStatusRecord(action, requestId);
+//		} catch (Exception e) {
+//			msoLogger.error(MessageEnum.APIH_DB_ACCESS_EXC_REASON, "Exception while creating record in DB", "", "",
+//					MsoLogger.ErrorCode.SchemaError, "Exception while creating record in DB", e);
+//			msoRequest.setStatus(org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED);
+//			Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_INTERNAL_SERVER_ERROR,
+//					MsoException.ServiceException, "Exception while creating record in DB " + e.getMessage(),
+//					ErrorNumbers.SVC_BAD_PARAMETER, null);
+//			msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DBAccessError,
+//					"Exception while creating record in DB");
+//			msoLogger.debug("End of the transaction, the final response is: " + (String) response.getEntity());
+//			return response;
+//		}
+
+		String serviceInstanceType = e2eSir.getService().getParameters().getServiceType();
+
+		String serviceId = "";
+		RequestClient requestClient = null;
+		HttpResponse response = null;
+
+		long subStartTime = System.currentTimeMillis();
+		String sirRequestJson = mapReqJsonToSvcInstReq(e2eSir, requestJSON);
+
+		try {
+			requestClient = RequestClientFactory.getRequestClient(recipeLookupResult.getOrchestrationURI(),
+					MsoPropertiesUtils.loadMsoProperties());
+
+			// Capture audit event
+			msoLogger.debug("MSO API Handler Posting call to BPEL engine for url: " + requestClient.getUrl());
+
+			response = requestClient.post(requestId, false, recipeLookupResult.getRecipeTimeout(), action.name(),
+					serviceId, null, null, null, null, serviceInstanceType, null, null, null, sirRequestJson, recipeLookupResult.getRecipeParamXsd());
+
+			msoLogger.recordMetricEvent(subStartTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,
+					"Successfully received response from BPMN engine", "BPMN", recipeLookupResult.getOrchestrationURI(),
+					null);
+		} catch (Exception e) {
+			msoLogger.recordMetricEvent(subStartTime, MsoLogger.StatusCode.ERROR,
+					MsoLogger.ResponseCode.CommunicationError, "Exception while communicate with BPMN engine", "BPMN",
+					recipeLookupResult.getOrchestrationURI(), null);
+			Response resp = msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_GATEWAY,
+					MsoException.ServiceException, "Failed calling bpmn " + e.getMessage(),
+					ErrorNumbers.SVC_NO_SERVER_RESOURCES, null);
+			alarmLogger.sendAlarm("MsoConfigurationError", MsoAlarmLogger.CRITICAL,
+					Messages.errors.get(ErrorNumbers.NO_COMMUNICATION_TO_BPEL));
+			msoLogger.error(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR, MSO_PROP_APIHANDLER_INFRA, "", "",
+					MsoLogger.ErrorCode.AvailabilityError, "Exception while communicate with BPMN engine");
+			msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError,
+					"Exception while communicate with BPMN engine");
+			msoLogger.debug("End of the transaction, the final response is: " + (String) resp.getEntity());
+			createOperationStatusRecordForError(action, requestId);
+			return resp;
+		}
+
+		if (response == null) {
+			Response resp = msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_GATEWAY,
+					MsoException.ServiceException, "bpelResponse is null", ErrorNumbers.SVC_NO_SERVER_RESOURCES, null);
+			msoLogger.error(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR, MSO_PROP_APIHANDLER_INFRA, "", "",
+					MsoLogger.ErrorCode.BusinessProcesssError, "Null response from BPEL");
+			msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.InternalError,
+					"Null response from BPMN");
+			msoLogger.debug(END_OF_THE_TRANSACTION + (String) resp.getEntity());
+			return resp;
+		}
+
+		ResponseHandler respHandler = new ResponseHandler(response, requestClient.getType());
+		int bpelStatus = respHandler.getStatus();
+
+		return beplStatusUpdate(requestId, startTime, msoRequest, requestClient, respHandler, bpelStatus, action, instanceIdMap);
+	}
+
+	private void closeCatalogDB(CatalogDatabase db) {
+		if (db != null) {
+			db.close();
+		}
+	}
+
+	private Response beplStatusUpdate(String requestId, long startTime,
+			MsoRequest msoRequest, RequestClient requestClient,
+			ResponseHandler respHandler, int bpelStatus, Action action,
+			HashMap<String, String> instanceIdMap) {
+		// BPMN accepted the request, the request is in progress
+		if (bpelStatus == HttpStatus.SC_ACCEPTED) {
+			String camundaJSONResponseBody = respHandler.getResponseBody();
+			msoLogger
+					.debug("Received from Camunda: " + camundaJSONResponseBody);
+
+			// currently only for delete case we update the status here
+			if (action == Action.deleteInstance) {
+				ObjectMapper mapper = new ObjectMapper();
+				try {
+					DelE2ESvcResp jo = mapper.readValue(
+							camundaJSONResponseBody, DelE2ESvcResp.class);
+					String operationId = jo.getOperationId();
+    				this.createOperationStatusRecord("DELETE", requestId,
+								operationId);
+				} catch (Exception ex) {
+					msoLogger.error(MessageEnum.APIH_BPEL_RESPONSE_ERROR,
+							requestClient.getUrl(), "", "",
+							MsoLogger.ErrorCode.BusinessProcesssError,
+							"Response from BPEL engine is failed with HTTP Status="
+									+ bpelStatus);
+				}
+			}
+			msoLogger.recordAuditEvent(startTime,
+					MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,
+					"BPMN accepted the request, the request is in progress");
+			msoLogger.debug(END_OF_THE_TRANSACTION + camundaJSONResponseBody);
+			return Response.status(HttpStatus.SC_ACCEPTED)
+					.entity(camundaJSONResponseBody).build();
+		} else {
+			List<String> variables = new ArrayList<>();
+			variables.add(bpelStatus + "");
+			String camundaJSONResponseBody = respHandler.getResponseBody();
+			if (camundaJSONResponseBody != null
+					&& !camundaJSONResponseBody.isEmpty()) {
+				Response resp = msoRequest.buildServiceErrorResponse(
+						bpelStatus, MsoException.ServiceException,
+						"Request Failed due to BPEL error with HTTP Status= %1 "
+								+ '\n' + camundaJSONResponseBody,
+						ErrorNumbers.SVC_DETAILED_SERVICE_ERROR, variables);
+				msoLogger.error(MessageEnum.APIH_BPEL_RESPONSE_ERROR,
+						requestClient.getUrl(), "", "",
+						MsoLogger.ErrorCode.BusinessProcesssError,
+						"Response from BPEL engine is failed with HTTP Status="
+								+ bpelStatus);
+				msoLogger.recordAuditEvent(startTime,
+						MsoLogger.StatusCode.ERROR,
+						MsoLogger.ResponseCode.InternalError,
+						"Response from BPMN engine is failed");
+				msoLogger.debug(END_OF_THE_TRANSACTION
+						+ (String) resp.getEntity());
+				return resp;
+			} else {
+				Response resp = msoRequest
+						.buildServiceErrorResponse(
+								bpelStatus,
+								MsoException.ServiceException,
+								"Request Failed due to BPEL error with HTTP Status= %1",
+								ErrorNumbers.SVC_DETAILED_SERVICE_ERROR,
+								variables);
+				msoLogger.error(MessageEnum.APIH_BPEL_RESPONSE_ERROR,
+						requestClient.getUrl(), "", "",
+						MsoLogger.ErrorCode.BusinessProcesssError,
+						"Response from BPEL engine is empty");
+				msoLogger.recordAuditEvent(startTime,
+						MsoLogger.StatusCode.ERROR,
+						MsoLogger.ResponseCode.InternalError,
+						"Response from BPEL engine is empty");
+				msoLogger.debug(END_OF_THE_TRANSACTION
+						+ (String) resp.getEntity());
+				return resp;
+			}
+		}
+	}
+
+	/**
+	 * Getting recipes from catalogDb
+	 * 
+	 * @param db the catalog db
+	 * @param serviceModelUUID the service model version uuid
+	 * @param action the action for the service
+	 * @return the service recipe result
+	 */
+	private RecipeLookupResult getServiceInstanceOrchestrationURI(
+			CatalogDatabase db, String serviceModelUUID, Action action) {
+
+		RecipeLookupResult recipeLookupResult = getServiceURI(db, serviceModelUUID, action);
+
+		if (recipeLookupResult != null) {
+			msoLogger.debug("Orchestration URI is: "
+					+ recipeLookupResult.getOrchestrationURI()
+					+ ", recipe Timeout is: "
+					+ Integer.toString(recipeLookupResult.getRecipeTimeout()));
+		} else {
+			msoLogger.debug("No matching recipe record found");
+		}
+		return recipeLookupResult;
+	}
+
+	/**
+	 * Getting recipes from catalogDb
+	 * If Service recipe is not set, use default recipe, if set , use special recipe.
+	 * @param db the catalog db
+	 * @param serviceModelUUID the service version uuid
+	 * @param action the action of the service.
+	 * @return the service recipe result.
+	 */
+	private RecipeLookupResult getServiceURI(CatalogDatabase db, String serviceModelUUID, Action action) {
+
+		String defaultServiceModelName = "UUI_DEFAULT";
+
+		Service defaultServiceRecord = db
+				.getServiceByModelName(defaultServiceModelName);
+		ServiceRecipe defaultRecipe = db.getServiceRecipeByModelUUID(
+		        defaultServiceRecord.getModelUUID(), action.name());
+		//set recipe as default generic recipe
+		ServiceRecipe recipe = defaultRecipe;
+		//check the service special recipe 
+		if(null != serviceModelUUID && ! serviceModelUUID.isEmpty()){
+		      ServiceRecipe serviceSpecialRecipe = db.getServiceRecipeByModelUUID(
+		              serviceModelUUID, action.name());
+		      if(null != serviceSpecialRecipe){
+		          //set service special recipe.
+		          recipe = serviceSpecialRecipe;
+		      }
+		}	
+		
+		if (recipe == null) {
+			return null;
+		}
+		return new RecipeLookupResult(recipe.getOrchestrationUri(),
+				recipe.getRecipeTimeout(), recipe.getServiceParamXSD());
+
+	}
+
+	/**
+	 * Converting E2EServiceInstanceRequest to ServiceInstanceRequest and
+	 * passing it to camunda engine.
+	 * 
+	 * @param e2eSir
+	 * @return
+	 */
+	private String mapReqJsonToSvcInstReq(E2EServiceInstanceRequest e2eSir,
+			String requestJSON) {
+
+		sir = new ServiceInstancesRequest();
+
+		String returnString = null;
+		RequestDetails requestDetails = new RequestDetails();
+		ModelInfo modelInfo = new ModelInfo();
+
+		// ModelInvariantId
+		modelInfo.setModelInvariantId(e2eSir.getService().getServiceDefId());
+
+		// modelNameVersionId
+		modelInfo.setModelNameVersionId(e2eSir.getService().getTemplateId());
+
+		// String modelInfoValue =
+		// e2eSir.getService().getParameters().getNodeTemplateName();
+		// String[] arrayOfInfo = modelInfoValue.split(":");
+		// String modelName = arrayOfInfo[0];
+		// String modelVersion = arrayOfInfo[1];
+
+		// TODO: To ensure, if we dont get the values from the UUI
+		String modelName = "voLTE";
+		String modelVersion = "1.0";
+		// modelName
+		modelInfo.setModelName(modelName);
+
+		// modelVersion
+		modelInfo.setModelVersion(modelVersion);
+
+		// modelType
+		modelInfo.setModelType(ModelType.service);
+
+		// setting modelInfo to requestDetails
+		requestDetails.setModelInfo(modelInfo);
+
+		SubscriberInfo subscriberInfo = new SubscriberInfo();
+
+		// globalsubscriberId
+		subscriberInfo.setGlobalSubscriberId(e2eSir.getService()
+				.getParameters().getGlobalSubscriberId());
+
+		// subscriberName
+		subscriberInfo.setSubscriberName(e2eSir.getService().getParameters()
+				.getSubscriberName());
+
+		// setting subscriberInfo to requestDetails
+		requestDetails.setSubscriberInfo(subscriberInfo);
+
+		RequestInfo requestInfo = new RequestInfo();
+
+		// instanceName
+		requestInfo.setInstanceName(e2eSir.getService().getName());
+
+		// source
+		requestInfo.setSource("UUI");
+
+		// suppressRollback
+		requestInfo.setSuppressRollback(true);
+
+		// setting requestInfo to requestDetails
+		requestDetails.setRequestInfo(requestInfo);
+
+		RequestParameters requestParameters = new RequestParameters();
+
+		// subscriptionServiceType
+		requestParameters.setSubscriptionServiceType("MOG");
+
+		// Userparams
+		List<E2EUserParam> userParams;
+		// userParams =
+		// e2eSir.getService().getParameters().getRequestParameters().getUserParams();
+		List<Map<String, String>> userParamList = new ArrayList<>();
+		Map<String, String> userParamMap = new HashMap<>();
+		// complete json request updated in the camunda
+		userParamMap.put("UUIRequest", requestJSON);
+		userParamMap.put("ServiceInstanceName", e2eSir.getService().getName());
+
+		// Map<String, String> userParamMap3 = null;
+		// for (E2EUserParam userp : userParams) {
+		// userParamMap.put(userp.getName(), userp.getValue());
+		//
+		// }
+		userParamList.add(userParamMap);
+		requestParameters.setUserParams(userParamList);
+
+		// setting requestParameters to requestDetails
+		requestDetails.setRequestParameters(requestParameters);
+
+		sir.setRequestDetails(requestDetails);
+
+		// converting to string
+		ObjectMapper mapper = new ObjectMapper();
+		try {
+			returnString = mapper.writeValueAsString(sir);
+		} catch (IOException e) {
+			msoLogger
+					.debug("Exception while converting ServiceInstancesRequest object to string",
+							e);
+		}
+
+		return returnString;
+	}
+
+	private void createOperationStatusRecordForError(Action action,
+			String requestId) throws MsoDatabaseException {
+
+		AbstractSessionFactoryManager requestsDbSessionFactoryManager = new RequestsDbSessionFactoryManager();
+
+		Session session = null;
+		try {
+
+			session = requestsDbSessionFactoryManager.getSessionFactory()
+					.openSession();
+			session.beginTransaction();
+
+			OperationStatus os = new OperationStatus();
+			os.setOperation(action.name());
+			os.setOperationContent("");
+			os.setOperationId("");
+			os.setProgress("100");
+			os.setReason("");
+			os.setResult("error");
+			os.setServiceId(requestId);
+			os.setUserId("");
+			Timestamp startTimeStamp = new Timestamp(System.currentTimeMillis());
+			Timestamp endTimeStamp = new Timestamp(System.currentTimeMillis());
+			os.setFinishedAt(endTimeStamp);
+			os.setOperateAt(startTimeStamp);
+
+			session.save(os);
+			session.getTransaction().commit();
+
+		} catch (Exception e) {
+			msoLogger.error(MessageEnum.APIH_DB_INSERT_EXC, "", "",
+					MsoLogger.ErrorCode.DataError,
+					"Exception when creation record request in Operation", e);
+			throw new MsoDatabaseException(
+					"Data did inserted in Operatus Status Table for failure", e);
+		} finally {
+			if (null != session) {
+				session.close();
+			}
+		}
+	}
+
+	private void createOperationStatusRecord(String actionNm, String serviceId,
+			String operationId) throws MsoDatabaseException {
+
+		AbstractSessionFactoryManager requestsDbSessionFactoryManager = new RequestsDbSessionFactoryManager();
+
+		Session session = null;
+		try {
+
+			session = requestsDbSessionFactoryManager.getSessionFactory()
+					.openSession();
+			session.beginTransaction();
+
+			OperationStatus os = new OperationStatus();
+			os.setOperation(actionNm);
+			os.setOperationContent("");
+			os.setOperationId(operationId);
+			os.setProgress("0");
+			os.setReason("");
+			os.setResult("processing");
+			os.setServiceId(serviceId);
+			// TODO : to be updated...
+			os.setUserId("");
+			Timestamp startTimeStamp = new Timestamp(System.currentTimeMillis());
+			Timestamp endTimeStamp = new Timestamp(System.currentTimeMillis());
+			os.setFinishedAt(endTimeStamp);
+			os.setOperateAt(startTimeStamp);
+
+			session.save(os);
+			session.getTransaction().commit();
+
+		} catch (Exception e) {
+			msoLogger.error(MessageEnum.APIH_DB_INSERT_EXC, "", "",
+					MsoLogger.ErrorCode.DataError,
+					"Exception when creation record request in Operation", e);
+			throw new MsoDatabaseException(
+					"Data did inserted in Operatus Status Table", e);
+		} finally {
+			if (null != session) {
+				session.close();
+			}
+		}
+	}
+
+	private OperationStatus chkSvcInstOperStatusbySvcId(String serviceId) {
+		OperationStatus svcInstanceOperStatus = (RequestsDatabase.getInstance())
+				.getOperationStatusByServiceId(serviceId);
+
+		return svcInstanceOperStatus;
+	}
+
+	private OperationStatus chkDuplicateServiceNameInOperStatus(
+			String serviceName) {
+		OperationStatus dupServiceName = (RequestsDatabase.getInstance())
+				.getOperationStatusByServiceName(serviceName);
+
+		return dupServiceName;
+	}
 }
\ No newline at end of file
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/MsoRequest.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/MsoRequest.java
index ad76a15..79ac76f 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/MsoRequest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/MsoRequest.java
@@ -252,15 +252,12 @@
         }
 
         RequestParameters requestParameters = sir.getRequestDetails().getRequestParameters();
-        if(this.reqVersion >= 3){
-	        if(requestParameters!=null){
-	        	this.aLaCarteFlag = sir.getRequestDetails().getRequestParameters().isaLaCarte();
-	        }else{
-	        	this.aLaCarteFlag = false;
-	        }
-        }else{
-        	this.aLaCarteFlag = true;
-        }
+		if (this.reqVersion >= 3) {
+			this.aLaCarteFlag =
+				requestParameters != null && sir.getRequestDetails().getRequestParameters().isaLaCarte();
+		} else {
+			this.aLaCarteFlag = true;
+		}
 
 		if(requestParameters != null && (reqVersion < 3) && requestParameters.getAutoBuildVfModules()){
     		throw new ValidationException("AutoBuildVfModule", version);
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/VnfRequestHandler.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/VnfRequestHandler.java
index 7a61c64..2b7e71a 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/VnfRequestHandler.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/VnfRequestHandler.java
@@ -307,7 +307,7 @@
                                                                                                    queryValue,
                                                                                                    getRequestType ());
 
-        List <VnfRequest> queryResponseList = new LinkedList <VnfRequest> ();
+        List <VnfRequest> queryResponseList = new LinkedList<>();
 
         if (activeReqList != null) {
             // build response for active
@@ -351,7 +351,7 @@
     }
 
     private List <VnfRequest> infraRequestsResponses (List <? extends InfraRequests> arList, String version) {
-        List <VnfRequest> queryResponseList = new LinkedList <VnfRequest> ();
+        List <VnfRequest> queryResponseList = new LinkedList<>();
 
         for (InfraRequests ar : arList) {
             VnfRequest qr = fillGeneric (ar);
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/VolumeRequestHandler.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/VolumeRequestHandler.java
index 3fa4a7a..d1c1c18 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/VolumeRequestHandler.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/VolumeRequestHandler.java
@@ -289,7 +289,7 @@
                                                                                                    queryValue,
                                                                                                    "VOLUME");
   
-        List <VolumeRequest> queryResponseList = new LinkedList <VolumeRequest> ();
+        List <VolumeRequest> queryResponseList = new LinkedList<>();
 
         if (activeReqList != null) {
             // build response for active
@@ -334,7 +334,7 @@
     }
 
     private List <VolumeRequest> infraRequestsResponses (List <? extends InfraRequests> arList, String version) {
-        List <VolumeRequest> queryResponseList = new LinkedList <VolumeRequest> ();
+        List <VolumeRequest> queryResponseList = new LinkedList<>();
 
         for (InfraRequests ar : arList) {
             VolumeRequest qr = fillGeneric (ar);
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/e2eserviceinstancebeans/NsParameters.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/e2eserviceinstancebeans/NsParameters.java
index 6121e47..4343847 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/e2eserviceinstancebeans/NsParameters.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/e2eserviceinstancebeans/NsParameters.java
@@ -35,7 +35,7 @@
 
     private List<LocationConstraint> locationConstraints;
 
-    private Map<String, Object> additionalParamForNs = new HashMap<String,Object>();
+    private Map<String, Object> additionalParamForNs = new HashMap<>();
     /**
      * @return Returns the locationConstraints.
      */
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/networkbeans/NetworkRequests.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/networkbeans/NetworkRequests.java
index 036694b..a223d6e 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/networkbeans/NetworkRequests.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/networkbeans/NetworkRequests.java
@@ -91,7 +91,7 @@
      */
     public List<NetworkRequest> getNetworkRequest() {
         if (networkRequest == null) {
-            networkRequest = new ArrayList<NetworkRequest>();
+            networkRequest = new ArrayList<>();
         }
         return this.networkRequest;
     }
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/networkbeans/NetworkTypes.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/networkbeans/NetworkTypes.java
index 0c0b622..9e9a832 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/networkbeans/NetworkTypes.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/networkbeans/NetworkTypes.java
@@ -91,7 +91,7 @@
      */
     public List<NetworkType> getNetworkType() {
         if (networkType == null) {
-            networkType = new ArrayList<NetworkType>();
+            networkType = new ArrayList<>();
         }
         return this.networkType;
     }
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/networkbeans/ObjectFactory.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/networkbeans/ObjectFactory.java
index 3655643..652c6a3 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/networkbeans/ObjectFactory.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/networkbeans/ObjectFactory.java
@@ -123,7 +123,7 @@
      */
     @XmlElementDecl(namespace = "http://org.openecomp/mso/infra/network-request/v1", name = "network-params")
     public JAXBElement<Object> createNetworkParams(Object value) {
-        return new JAXBElement<Object>(_NetworkParams_QNAME, Object.class, null, value);
+        return new JAXBElement<>(_NetworkParams_QNAME, Object.class, null, value);
     }
 
 }
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/serviceinstancebeans/ExceptionType.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/serviceinstancebeans/ExceptionType.java
index e4faf72..a3ad61c 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/serviceinstancebeans/ExceptionType.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/serviceinstancebeans/ExceptionType.java
@@ -148,7 +148,7 @@
      */
     public List<String> getVariables() {
         if (variables == null) {
-            variables = new ArrayList<String>();
+            variables = new ArrayList<>();
         }
         return this.variables;
     }
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/vnfbeans/ObjectFactory.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/vnfbeans/ObjectFactory.java
index cfd49d2..e77257c 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/vnfbeans/ObjectFactory.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/vnfbeans/ObjectFactory.java
@@ -144,7 +144,7 @@
      */
     @XmlElementDecl(namespace = "http://org.openecomp/mso/infra/vnf-request/v1", name = "vnf-params")
     public JAXBElement<Object> createVnfParams(Object value) {
-        return new JAXBElement<Object>(_VnfParams_QNAME, Object.class, null, value);
+        return new JAXBElement<>(_VnfParams_QNAME, Object.class, null, value);
     }
 
 }
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/vnfbeans/VfModuleModelNames.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/vnfbeans/VfModuleModelNames.java
index c3f6ec7..371cbb8 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/vnfbeans/VfModuleModelNames.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/vnfbeans/VfModuleModelNames.java
@@ -91,7 +91,7 @@
      */
     public List<VfModuleModelName> getVfModuleModelName() {
         if (vfModuleModelName == null) {
-            vfModuleModelName = new ArrayList<VfModuleModelName>();
+            vfModuleModelName = new ArrayList<>();
         }
         return this.vfModuleModelName;
     }
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/vnfbeans/VnfRequests.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/vnfbeans/VnfRequests.java
index 336cad5..993c76c 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/vnfbeans/VnfRequests.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/vnfbeans/VnfRequests.java
@@ -91,7 +91,7 @@
      */
     public List<VnfRequest> getVnfRequest() {
         if (vnfRequest == null) {
-            vnfRequest = new ArrayList<VnfRequest>();
+            vnfRequest = new ArrayList<>();
         }
         return this.vnfRequest;
     }
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/vnfbeans/VnfTypes.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/vnfbeans/VnfTypes.java
index eebb1d9..c066ff4 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/vnfbeans/VnfTypes.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/vnfbeans/VnfTypes.java
@@ -91,7 +91,7 @@
      */
     public List<VnfType> getVnfType() {
         if (vnfType == null) {
-            vnfType = new ArrayList<VnfType>();
+            vnfType = new ArrayList<>();
         }
         return this.vnfType;
     }
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/volumebeans/ObjectFactory.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/volumebeans/ObjectFactory.java
index 48cca8f..2d4d588 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/volumebeans/ObjectFactory.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/volumebeans/ObjectFactory.java
@@ -109,7 +109,7 @@
      */
     @XmlElementDecl(namespace = "http://org.openecomp/mso/infra/volume-request/v1", name = "volume-params")
     public JAXBElement<Object> createVolumeParams(Object value) {
-        return new JAXBElement<Object>(_VolumeParams_QNAME, Object.class, null, value);
+        return new JAXBElement<>(_VolumeParams_QNAME, Object.class, null, value);
     }
 
 }
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/volumebeans/VolumeRequests.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/volumebeans/VolumeRequests.java
index 00c88a0..318ff90 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/volumebeans/VolumeRequests.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/volumebeans/VolumeRequests.java
@@ -91,7 +91,7 @@
      */
     public List<VolumeRequest> getVolumeRequest() {
         if (volumeRequest == null) {
-            volumeRequest = new ArrayList<VolumeRequest>();
+            volumeRequest = new ArrayList<>();
         }
         return this.volumeRequest;
     }
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/MsoRequestTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/MsoRequestTest.java
index 6a7fc2c..c4a1c1f 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/MsoRequestTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/MsoRequestTest.java
@@ -76,7 +76,7 @@
 	            return;
 	        }
 			ObjectMapper mapper = new ObjectMapper();
-			 HashMap<String, String> instanceIdMap = new HashMap<String,String>();
+			 HashMap<String, String> instanceIdMap = new HashMap<>();
 			instanceIdMap.put("serviceInstanceId", "3eecada1-83a4-4f33-9ed2-7937e7b8dbbc");
 			ServiceInstancesRequest sir  = mapper.readValue(requestJSON, ServiceInstancesRequest.class);
 			MsoRequest msoRequest = new MsoRequest ("1234");
@@ -101,7 +101,7 @@
 	            return;
 	        }
 			ObjectMapper mapper = new ObjectMapper();
-			 HashMap<String, String> instanceIdMap = new HashMap<String,String>();
+			 HashMap<String, String> instanceIdMap = new HashMap<>();
 			instanceIdMap.put("serviceInstanceId", "3eecada1-83a4-4f33-9ed2-7937e7b8dbbc");
 			ServiceInstancesRequest sir  = mapper.readValue(requestJSON, ServiceInstancesRequest.class);
 			MsoRequest msoRequest = new MsoRequest ("1234");
@@ -121,7 +121,7 @@
 	            return;
 	        }
 			ObjectMapper mapper = new ObjectMapper();
-			 HashMap<String, String> instanceIdMap = new HashMap<String,String>();
+			 HashMap<String, String> instanceIdMap = new HashMap<>();
 			instanceIdMap.put("serviceInstanceId", "3eecada1-83a4-4f33-9ed2-7937e7b8dbbc");
 			ServiceInstancesRequest sir  = mapper.readValue(requestJSON, ServiceInstancesRequest.class);
 			MsoRequest msoRequest = new MsoRequest ("1234");
@@ -141,7 +141,7 @@
 	            return;
 	        }
 			ObjectMapper mapper = new ObjectMapper();
-			 HashMap<String, String> instanceIdMap = new HashMap<String,String>();
+			 HashMap<String, String> instanceIdMap = new HashMap<>();
 			instanceIdMap.put("serviceInstanceId", "3eecada1-83a4-4f33-9ed2-7937e7b8dbbc");
 			ServiceInstancesRequest sir  = mapper.readValue(requestJSON, ServiceInstancesRequest.class);
 			MsoRequest msoRequest = new MsoRequest ("1234");
@@ -161,7 +161,7 @@
 	            return;
 	        }
 			ObjectMapper mapper = new ObjectMapper();
-			 HashMap<String, String> instanceIdMap = new HashMap<String,String>();
+			 HashMap<String, String> instanceIdMap = new HashMap<>();
 			instanceIdMap.put("serviceInstanceId", "3eecada1-83a4-4f33-9ed2-7937e7b8dbbc");
 			ServiceInstancesRequest sir  = mapper.readValue(requestJSON, ServiceInstancesRequest.class);
 			MsoRequest msoRequest = new MsoRequest ("1234");
@@ -181,7 +181,7 @@
 	            return;
 	        }
 			ObjectMapper mapper = new ObjectMapper();
-			 HashMap<String, String> instanceIdMap = new HashMap<String,String>();
+			 HashMap<String, String> instanceIdMap = new HashMap<>();
 			instanceIdMap.put("serviceInstanceId", "3eecada1-83a4-4f33-9ed2-7937e7b8dbbc");
 			ServiceInstancesRequest sir  = mapper.readValue(requestJSON1, ServiceInstancesRequest.class);
 			MsoRequest msoRequest = new MsoRequest ("1234");
@@ -210,7 +210,7 @@
 	            return;
 	        }
 			ObjectMapper mapper = new ObjectMapper();
-			 HashMap<String, String> instanceIdMap = new HashMap<String,String>();
+			 HashMap<String, String> instanceIdMap = new HashMap<>();
 			instanceIdMap.put("serviceInstanceId", "3eecada1-83a4-4f33-9ed2-7937e7b8dbbc");
 			ServiceInstancesRequest sir  = mapper.readValue(requestJSON2, ServiceInstancesRequest.class);
 			MsoRequest msoRequest = new MsoRequest ("1234");
@@ -230,7 +230,7 @@
 	            return;
 	        }
 			ObjectMapper mapper = new ObjectMapper();
-			 HashMap<String, String> instanceIdMap = new HashMap<String,String>();
+			 HashMap<String, String> instanceIdMap = new HashMap<>();
 			instanceIdMap.put("serviceInstanceId", "3eecada1-83a4-4f33-9ed2-7937e7b8dbbc");
 			ServiceInstancesRequest sir  = mapper.readValue(requestJSON, ServiceInstancesRequest.class);
 			MsoRequest msoRequest = new MsoRequest ("1234");
@@ -251,7 +251,7 @@
 	        }
 		 
 			ObjectMapper mapper = new ObjectMapper();
-			HashMap<String, String> instanceIdMap = new HashMap<String,String>();
+			HashMap<String, String> instanceIdMap = new HashMap<>();
 			instanceIdMap.put("serviceInstanceId", "3eecada1-83a4-4f33-9ed2-7937e7b8dbbc");
 			instanceIdMap.put("vnfInstanceId", "3eecada1-83a4-4f33-9ed2-7937e7b8dbbc");
 			ServiceInstancesRequest sir  = mapper.readValue(requestJSON, ServiceInstancesRequest.class);
@@ -270,7 +270,7 @@
 	        }
 		 
 			mapper = new ObjectMapper();
-			instanceIdMap = new HashMap<String,String>();
+			instanceIdMap = new HashMap<>();
 			instanceIdMap.put("serviceInstanceId", "3eecada1-83a4-4f33-9ed2-7937e7b8dbbc");
 			instanceIdMap.put("vnfInstanceId", "3eecada1-83a4-4f33-9ed2-7937e7b8dbbc");
 			sir  = mapper.readValue(requestJSON, ServiceInstancesRequest.class);
@@ -291,7 +291,7 @@
 	        }
 		 
 			ObjectMapper mapper = new ObjectMapper();
-			HashMap<String, String> instanceIdMap = new HashMap<String,String>();
+			HashMap<String, String> instanceIdMap = new HashMap<>();
 			instanceIdMap.put("serviceInstanceId", "3eecada1-83a4-4f33-9ed2-7937e7b8dbbc");
 			instanceIdMap.put("vnfInstanceId", "3eecada1-83a4-4f33-9ed2-7937e7b8dbbc");
 			ServiceInstancesRequest sir  = mapper.readValue(requestJSON, ServiceInstancesRequest.class);
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/NetworkRequestHandlerTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/NetworkRequestHandlerTest.java
index 89d4d0c..c1da76e 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/NetworkRequestHandlerTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/NetworkRequestHandlerTest.java
@@ -179,7 +179,7 @@
 			public List <InfraActiveRequests> getRequestListFromInfraActive (String queryAttributeName,
                     String queryValue,
                     String requestType) {
-				List <InfraActiveRequests> list = new ArrayList<InfraActiveRequests>();
+				List <InfraActiveRequests> list = new ArrayList<>();
 				InfraActiveRequests req = new InfraActiveRequests();
 				req.setAaiServiceId("299392");
 				req.setAction("CREATE");
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/VfModuleModelNamesHandlerTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/VfModuleModelNamesHandlerTest.java
index 4305db3..1c3c856 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/VfModuleModelNamesHandlerTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/VfModuleModelNamesHandlerTest.java
@@ -49,7 +49,7 @@
 		new MockUp<CatalogDatabase>() {
 			@Mock
 			public  List <VfModule>  getAllVfModules(){
-				List <VfModule> list = new ArrayList<VfModule>();
+				List <VfModule> list = new ArrayList<>();
 				VfModule resource = new VfModule();
 				list.add(resource);
 				return list;
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/VnfRequestHandlerTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/VnfRequestHandlerTest.java
index 205bb8d..9c9ebae 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/VnfRequestHandlerTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/VnfRequestHandlerTest.java
@@ -177,7 +177,7 @@
 			public List <InfraActiveRequests> getRequestListFromInfraActive (String queryAttributeName,
                     String queryValue,
                     String requestType) {
-				List <InfraActiveRequests> list = new ArrayList<InfraActiveRequests>();
+				List <InfraActiveRequests> list = new ArrayList<>();
 				InfraActiveRequests req = new InfraActiveRequests();
 				req.setAaiServiceId("299392");
 				req.setAction("CREATE");
@@ -202,7 +202,7 @@
 			public List <InfraActiveRequests> getRequestListFromInfraActive (String queryAttributeName,
                     String queryValue,
                     String requestType) {
-				List <InfraActiveRequests> list = new ArrayList<InfraActiveRequests>();
+				List <InfraActiveRequests> list = new ArrayList<>();
 				InfraActiveRequests req = new InfraActiveRequests();
 				req.setAaiServiceId("299392");
 				req.setAction("CREATE");
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/VnfTypesHandlerTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/VnfTypesHandlerTest.java
index 7eabc1a..1800bb4 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/VnfTypesHandlerTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/VnfTypesHandlerTest.java
@@ -62,7 +62,7 @@
 		new MockUp<CatalogDatabase>() {
 			@Mock
 			public  List <VnfResource>  getAllVnfResources(){
-				List <VnfResource> list = new ArrayList<VnfResource>();
+				List <VnfResource> list = new ArrayList<>();
 				VnfResource resource = new VnfResource();
 				list.add(resource);
 				return list;
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/VolumeRequestHandlerTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/VolumeRequestHandlerTest.java
index fa6b06b..fa5e094 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/VolumeRequestHandlerTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/VolumeRequestHandlerTest.java
@@ -151,7 +151,7 @@
 			public List <InfraActiveRequests> getRequestListFromInfraActive (String queryAttributeName,
                     String queryValue,
                     String requestType) {
-				List <InfraActiveRequests> list = new ArrayList<InfraActiveRequests>();
+				List <InfraActiveRequests> list = new ArrayList<>();
 				InfraActiveRequests req = new InfraActiveRequests();
 				req.setAaiServiceId("299392");
 				req.setAction("CREATE");
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 e3c7cda..c88f31c 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
@@ -30,7 +30,7 @@
 	private Map<String, InfraActiveRequests> activeRequests;
 	
 	public MockRequestsDatabase() {
-		activeRequests = new HashMap<String, InfraActiveRequests>();
+		activeRequests = new HashMap<>();
 	}
 	
 	public void addRecord(InfraActiveRequests record) {
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/RequestsDatabase.java b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/RequestsDatabase.java
index d9448d0..7f2f78d 100644
--- a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/RequestsDatabase.java
+++ b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/RequestsDatabase.java
@@ -178,7 +178,7 @@
         long startTime = System.currentTimeMillis ();
         msoLogger.debug ("Execute query on infra active request table");
         
-        List <InfraActiveRequests> results = new ArrayList<InfraActiveRequests>();
+        List <InfraActiveRequests> results = new ArrayList<>();
 
         Session session = sessionFactoryRequestDB.getSessionFactory ().openSession ();
         try {
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/CatalogDatabase.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/CatalogDatabase.java
index 26b641d..bd3b988 100644
--- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/CatalogDatabase.java
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/CatalogDatabase.java
@@ -207,7 +207,7 @@
             LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully. No template found", "CatalogDB", "getHeatTemplate", null);
             return null;
         }
-        Collections.sort(resultList, new MavenLikeVersioningComparator());
+        resultList.sort(new MavenLikeVersioningComparator());
         Collections.reverse(resultList);
 
         LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getHeatTemplate", null);
@@ -368,7 +368,7 @@
             LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully. Service not found", "CatalogDB", "getServiceByName", null);
             return null;
         }
-        Collections.sort (resultList, new MavenLikeVersioningComparator ());
+        resultList.sort(new MavenLikeVersioningComparator());
         Collections.reverse (resultList);
 
         LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getServiceByName", null);
@@ -530,7 +530,7 @@
             LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully. Service not found", "CatalogDB", "getServiceByModelName", null);
             return null;
         }
-        Collections.sort(resultList, new MavenLikeVersioningComparator ());
+        resultList.sort(new MavenLikeVersioningComparator());
         Collections.reverse(resultList);
 
         LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getServiceByModelName", null);
@@ -602,7 +602,7 @@
                                 return null;
                         }
 
-        Collections.sort (resultList, new MavenLikeVersioningComparator ());
+        resultList.sort(new MavenLikeVersioningComparator());
         Collections.reverse (resultList);
 
         LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getServiceRecipe", null);
@@ -646,7 +646,7 @@
             return null;
         }
 
-        Collections.sort(resultList, new MavenLikeVersioningComparator());
+        resultList.sort(new MavenLikeVersioningComparator());
         Collections.reverse(resultList);
 
         LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getServiceRecipe", null);
@@ -673,7 +673,7 @@
             return Collections.EMPTY_LIST;
         }
 
-        Collections.sort(resultList, new MavenLikeVersioningComparator());
+        resultList.sort(new MavenLikeVersioningComparator());
         Collections.reverse(resultList);
 
         LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getServiceRecipes", null);
@@ -750,7 +750,7 @@
             LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully. VNF not found", "CatalogDB", "getVnfResource", null);
             return null;
         }
-        Collections.sort(resultList, new MavenLikeVersioningComparator());
+        resultList.sort(new MavenLikeVersioningComparator());
         Collections.reverse(resultList);
 
         LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getVnfResource", null);
@@ -876,7 +876,7 @@
             return null;
         }
         
-        Collections.sort(resultList, new MavenLikeVersioningComparator());
+        resultList.sort(new MavenLikeVersioningComparator());
         Collections.reverse(resultList);
 
         LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getVnfResourceCustomizationByModelCustomizationName", null);
@@ -977,7 +977,7 @@
             LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully. VF not found", "CatalogDB", "getVfModuleModelName", null);
             return null;
         }
-        Collections.sort(resultList, new MavenLikeVersioningComparator());
+        resultList.sort(new MavenLikeVersioningComparator());
         Collections.reverse(resultList);
 
         LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getVfModuleModelName", null);
@@ -1075,7 +1075,7 @@
             return null;
         }
 
-        Collections.sort(resultList, new MavenLikeVersioningComparator());
+        resultList.sort(new MavenLikeVersioningComparator());
         Collections.reverse(resultList);
         LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getNetworkResource", null);
         return resultList.get(0);
@@ -1124,7 +1124,7 @@
             return null;
         }
 
-        Collections.sort(resultList, new MavenLikeVersioningComparator());
+        resultList.sort(new MavenLikeVersioningComparator());
         Collections.reverse(resultList);
 
         LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getVnfRecipe", null);
@@ -1141,14 +1141,13 @@
      * @return VnfRecipe object or null if none found
      */
     public VnfRecipe getVnfRecipe(String vnfType, String action) {
-        StringBuilder hql = new StringBuilder("FROM VnfRecipe WHERE vnfType = :vnfType AND action = :action ");
 
         long startTime = System.currentTimeMillis();
         LOGGER.debug("Catalog database - get VNF recipe with name " + vnfType
                                       + " and action "
                                       + action);
 
-        Query query = getSession().createQuery(hql.toString());
+        Query query = getSession().createQuery("FROM VnfRecipe WHERE vnfType = :vnfType AND action = :action ");
         query.setParameter(VNF_TYPE, vnfType);
         query.setParameter(ACTION, action);
 
@@ -1160,7 +1159,7 @@
             return null;
         }
 
-        Collections.sort(resultList, new MavenLikeVersioningComparator());
+        resultList.sort(new MavenLikeVersioningComparator());
         Collections.reverse(resultList);
 
         LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getVnfRecipe", null);
@@ -1233,12 +1232,10 @@
      */
     public VnfRecipe getVnfRecipeByVfModuleId(String vnfType, String vfModuleId, String action) {
 
-    	StringBuilder hql = new StringBuilder("FROM VnfRecipe WHERE vfModuleId = :vfModuleId and action = :action  ");
-
         long startTime = System.currentTimeMillis();
         LOGGER.debug("Catalog database - get VNF Recipe with vfModuleId " + vfModuleId);
 
-        Query query = getSession().createQuery(hql.toString ());
+        Query query = getSession().createQuery("FROM VnfRecipe WHERE vfModuleId = :vfModuleId and action = :action  ");
         query.setParameter(VF_MODULE_MODEL_UUID, vfModuleId);
         query.setParameter(ACTION, action);
 
@@ -1250,7 +1247,7 @@
             return null;
         }
 
-        Collections.sort(resultList, new MavenLikeVersioningComparator());
+        resultList.sort(new MavenLikeVersioningComparator());
         Collections.reverse(resultList);
 
         LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully. VNF Recipe Entry found", "CatalogDB", "getVnfRecipeByVfModuleId", null);
@@ -1307,7 +1304,7 @@
             LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully. VF not found", "CatalogDB", "getVfModuleType", null);
             return null;
     	}
-        Collections.sort (resultList, new MavenLikeVersioningComparator ());
+        resultList.sort(new MavenLikeVersioningComparator());
         Collections.reverse (resultList);
 
         LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getVfModuleType", null);
@@ -1434,7 +1431,7 @@
         VfModule module = null;
         
         if (modules != null && ! modules.isEmpty()) {
-        	Collections.sort (modules, new MavenLikeVersioningComparator ());
+        	modules.sort(new MavenLikeVersioningComparator());
         	Collections.reverse (modules);
         	module =  modules.get(0);
         }
@@ -1890,7 +1887,7 @@
             return null;
         }
         
-        Collections.sort (resultList, new MavenLikeVersioningComparator ());
+        resultList.sort(new MavenLikeVersioningComparator());
         Collections.reverse (resultList);
 
         LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getVnfResourceCustomizationByVnfModelCustomizationNameAndModelVersionId", null);
@@ -1954,17 +1951,17 @@
         } else {
         	LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getVnfResourceByModelUuid", null);
         }
-        return vnfResource;	
+        return vnfResource;
     }
-    
+
     public VnfResCustomToVfModuleCustom getVnfResCustomToVfModule(String vnfId, String vfId) {
     	long startTime = System.currentTimeMillis();
     	LOGGER.debug("Catalog database - getVnfResCustomToVfModule - vnfResourceCustModelCustUuid: " + vnfId + ", vfModuleCustModelCustomUuid=" + vfId);
-    	StringBuilder hql = new StringBuilder("FROM VnfResCustomToVfModuleCustom where vnfResourceCustModelCustomizationUuid = :vnfIdValue and vfModuleCustModelCustomizationUuid = :vfIdValue"); 	
-    	HashMap<String, String> parameters = new HashMap<>();
+        HashMap<String, String> parameters = new HashMap<>();
     	parameters.put("vnfIdValue", vnfId);
     	parameters.put("vfIdValue", vfId);
-    	VnfResCustomToVfModuleCustom vrctvmc = this.executeQuerySingleRow(hql.toString(), parameters, true);
+    	VnfResCustomToVfModuleCustom vrctvmc = this.executeQuerySingleRow(
+            "FROM VnfResCustomToVfModuleCustom where vnfResourceCustModelCustomizationUuid = :vnfIdValue and vfModuleCustModelCustomizationUuid = :vfIdValue", parameters, true);
         if (vrctvmc == null) {
         	LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "NotFound", "CatalogDB", "getVnfResCustomToVfModule", null);
         } else {
@@ -1987,8 +1984,7 @@
     public List<VfModule> getVfModulesForVnfResource(String vnfResourceModelUuid) {
         long startTime = System.currentTimeMillis();
     	LOGGER.debug("Catalog database - getVfModulesForVnfResource - vnfResourceModelUuid: " + vnfResourceModelUuid);
-    	StringBuilder hql = new StringBuilder("FROM VfModule where vnfResourceModelUUId = :vnfResourceModelUUId");
-        Query query = getSession().createQuery(hql.toString());
+        Query query = getSession().createQuery("FROM VfModule where vnfResourceModelUUId = :vnfResourceModelUUId");
     	query.setParameter("vnfResourceModelUUId", vnfResourceModelUuid);
         List<VfModule> resultList = null;
         try {
@@ -2236,8 +2232,7 @@
     public List<NetworkResourceCustomization> getAllNetworksByServiceModelInvariantUuid(String serviceModelInvariantUuid) {
         LOGGER.debug("Catalog database: getServiceNetworksByServiceModelInvariantUuid - " + serviceModelInvariantUuid);
 
-        StringBuilder hql = new StringBuilder("FROM Service WHERE modelInvariantUUID = :serviceModelInvariantUuid");
-        Query query = getSession().createQuery(hql.toString());
+        Query query = getSession().createQuery("FROM Service WHERE modelInvariantUUID = :serviceModelInvariantUuid");
         query.setParameter("serviceModelInvariantUuid", serviceModelInvariantUuid);
         @SuppressWarnings("unchecked")
         List<Service> serviceList = query.list();
@@ -2247,7 +2242,7 @@
             return new ArrayList<>();
         }
 
-        Collections.sort (serviceList, new MavenLikeVersioningComparator ());
+        serviceList.sort(new MavenLikeVersioningComparator());
         Collections.reverse (serviceList);
         Service service = serviceList.get(0);
 
@@ -2260,8 +2255,8 @@
     public List<NetworkResourceCustomization> getAllNetworksByServiceModelInvariantUuid(String serviceModelInvariantUuid, String serviceModelVersion) {
         LOGGER.debug("Catalog database: getServiceNetworksByServiceModelInvariantUuid - " + serviceModelInvariantUuid + ", version=" + serviceModelVersion);
 
-        StringBuilder hql = new StringBuilder("FROM Service WHERE modelInvariantUUID = :serviceModelInvariantUuid and version = :serviceModelVersion");
-        Query query = getSession().createQuery(hql.toString());
+        Query query = getSession().createQuery(
+            "FROM Service WHERE modelInvariantUUID = :serviceModelInvariantUuid and version = :serviceModelVersion");
         query.setParameter("serviceModelInvariantUuid", serviceModelInvariantUuid);
         query.setParameter("serviceModelVersion", serviceModelVersion);
 
@@ -2275,7 +2270,7 @@
             return new ArrayList<>();
         }
 
-        Collections.sort (serviceList, new MavenLikeVersioningComparator ());
+        serviceList.sort(new MavenLikeVersioningComparator());
         Collections.reverse (serviceList);
         Service service = serviceList.get(0);
 
@@ -2289,18 +2284,18 @@
         long startTime = System.currentTimeMillis();
         LOGGER.debug("Catalog database: getAllNetworksByNetworkModelCustomizationUuid - " + networkModelCustomizationUuid);
 
-        StringBuilder hql = new StringBuilder("FROM NetworkResourceCustomization WHERE modelCustomizationUuid = :networkModelCustomizationUuid");
-    	//Query query = getSession().createQuery(hql.toString());
+        //Query query = getSession().createQuery(hql.toString());
     	//query.setParameter("networkModelCustomizationUuid", networkModelCustomizationUuid);
     	//LOGGER.debug("QUERY: " + hql.toString() + ", networkModelCustomizationUuid=" + networkModelCustomizationUuid);
-    	
+
     	//@SuppressWarnings("unchecked")
     	//List<NetworkResourceCustomization> resultList = query.list();
-    	
+
     	HashMap<String, String> params = new HashMap<>();
     	params.put("networkModelCustomizationUuid", networkModelCustomizationUuid);
 
-    	List<NetworkResourceCustomization> resultList = this.executeQueryMultipleRows(hql.toString(), params, true);
+    	List<NetworkResourceCustomization> resultList = this.executeQueryMultipleRows(
+            "FROM NetworkResourceCustomization WHERE modelCustomizationUuid = :networkModelCustomizationUuid", params, true);
 
     	if (resultList.isEmpty()) {
     		LOGGER.debug("Unable to find an NMC with nmcu=" + networkModelCustomizationUuid);
@@ -2309,7 +2304,6 @@
     	for (NetworkResourceCustomization nrc : resultList) {
     		nrc.setNetworkResource(this.getNetworkResourceById(nrc.getNetworkResourceModelUuid()));
     	}
-     	
 
         LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getAllNetworksByNetworkModelCustomizationUuid", null);
         return resultList;
@@ -2326,9 +2320,9 @@
     	String networkResourceId = nr.getModelUUID();
 
         LOGGER.debug("Now searching for NRC's with networkResourceId = " + networkResourceId);
-    	StringBuilder hql = new StringBuilder("FROM NetworkResourceCustomization WHERE networkResourceModelUuid = :networkResourceId");
 
-        Query query = getSession().createQuery(hql.toString());
+        Query query = getSession().createQuery(
+            "FROM NetworkResourceCustomization WHERE networkResourceModelUuid = :networkResourceId");
         query.setParameter("networkResourceId", networkResourceId);
 
         @SuppressWarnings("unchecked")
@@ -2347,7 +2341,7 @@
     }
     public ArrayList<VfModuleCustomization> getAllVfmcForVrc(VnfResourceCustomization vrc) {
     	LOGGER.debug("Catalog database: getAllVfmcForVrc - " + vrc.getModelCustomizationUuid());
-    	
+
     	List<VnfResCustomToVfModuleCustom> vfmcs = this.getVRCtoVFMC(vrc.getModelCustomizationUuid(), null);
     	if (vfmcs == null || vfmcs.isEmpty()) {
     		return new ArrayList<>();
@@ -2367,8 +2361,7 @@
     public List<VnfResourceCustomization> getAllVnfsByServiceModelUuid(String serviceModelUuid) {
         LOGGER.debug("Catalog database: getAllVnfsByServiceModelUuid - " + serviceModelUuid);
 
-    	StringBuilder hql = new StringBuilder("FROM Service WHERE modelUUID = :serviceModelUuid");
-        Query query = getSession().createQuery(hql.toString());
+        Query query = getSession().createQuery("FROM Service WHERE modelUUID = :serviceModelUuid");
         query.setParameter("serviceModelUuid", serviceModelUuid);
         @SuppressWarnings("unchecked")
         List<Service> serviceList = query.list();
@@ -2378,7 +2371,7 @@
     		return new ArrayList<>();
         }
 
-        Collections.sort (serviceList, new MavenLikeVersioningComparator ());
+        serviceList.sort(new MavenLikeVersioningComparator());
         Collections.reverse (serviceList);
 
         // Step 2 - Now query to get the related VnfResourceCustomizations
@@ -2389,7 +2382,7 @@
     		LOGGER.debug("Unable to find any related vnfs to a service with modelUuid=" + serviceModelUuid);
         	return new ArrayList<>();
     }
-        
+
         ArrayList<VnfResourceCustomization> allVrcs = new ArrayList<>();
         for (ServiceToResourceCustomization strc : strcs) {
         	LOGGER.debug("Try to find VRC for mcu=" + strc.getResourceModelCustomizationUUID());
@@ -2398,13 +2391,12 @@
         		allVrcs.add(vrc);
         }
         return allVrcs;
-    	
+
     }
     public List<VnfResourceCustomization> getAllVnfsByServiceModelInvariantUuid(String serviceModelInvariantUuid) {
         LOGGER.debug("Catalog database: getAllVnfsByServiceModelInvariantUuid - " + serviceModelInvariantUuid);
 
-        StringBuilder hqlService = new StringBuilder("FROM Service WHERE modelInvariantUUID = :serviceModelInvariantUuid");
-        Query query = getSession().createQuery(hqlService.toString());
+        Query query = getSession().createQuery("FROM Service WHERE modelInvariantUUID = :serviceModelInvariantUuid");
         query.setParameter("serviceModelInvariantUuid", serviceModelInvariantUuid);
         @SuppressWarnings("unchecked")
         List<Service> resultList = query.list();
@@ -2412,7 +2404,7 @@
         if (resultList.isEmpty()) {
     		return new ArrayList<>();
         }
-        Collections.sort (resultList, new MavenLikeVersioningComparator ());
+        resultList.sort(new MavenLikeVersioningComparator());
         Collections.reverse (resultList);
         Service service = resultList.get(0);
         //now just call the method that takes the version - the service object will have the highest version
@@ -2422,8 +2414,8 @@
         long startTime = System.currentTimeMillis();
         LOGGER.debug("Catalog database: getAllVnfsByServiceModelInvariantUuid - " + serviceModelInvariantUuid + ", version=" + serviceModelVersion);
 
-    	StringBuilder hql = new StringBuilder("FROM Service WHERE modelInvariantUUID = :serviceModelInvariantUuid and version = :serviceModelVersion");
-        Query query = getSession().createQuery(hql.toString());
+        Query query = getSession().createQuery(
+            "FROM Service WHERE modelInvariantUUID = :serviceModelInvariantUuid and version = :serviceModelVersion");
         query.setParameter("serviceModelInvariantUuid", serviceModelInvariantUuid);
         query.setParameter("serviceModelVersion", serviceModelVersion);
 
@@ -2433,7 +2425,7 @@
         if (resultList.isEmpty()) {
     		return new ArrayList<>();
                 }
-        Collections.sort (resultList, new MavenLikeVersioningComparator ());
+        resultList.sort(new MavenLikeVersioningComparator());
         Collections.reverse (resultList);
         Service service = resultList.get(0);
         LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getAllVnfsByServiceModelInvariantUuid", null);
@@ -2446,8 +2438,8 @@
             return this.getAllVnfsByServiceName(serviceName);
         }
 
-    	StringBuilder hql = new StringBuilder("FROM Service WHERE modelName = :serviceName and version = :serviceVersion");
-        Query query = getSession().createQuery(hql.toString());
+        Query query = getSession().createQuery(
+            "FROM Service WHERE modelName = :serviceName and version = :serviceVersion");
         query.setParameter("serviceName", serviceName);
         query.setParameter("serviceVersion", serviceVersion);
 
@@ -2463,8 +2455,7 @@
     public List<VnfResourceCustomization> getAllVnfsByServiceName(String serviceName) {
         LOGGER.debug("Catalog database: getAllVnfsByServiceName - " + serviceName);
 
-    	StringBuilder hql = new StringBuilder("FROM Service WHERE modelName = :serviceName");
-        Query query = getSession().createQuery(hql.toString());
+        Query query = getSession().createQuery("FROM Service WHERE modelName = :serviceName");
         query.setParameter("serviceName", serviceName);
 
         @SuppressWarnings("unchecked")
@@ -2473,7 +2464,7 @@
         if (resultList.isEmpty()) {
             return Collections.EMPTY_LIST;
         }
-        Collections.sort (resultList, new MavenLikeVersioningComparator ());
+        resultList.sort(new MavenLikeVersioningComparator());
         Collections.reverse (resultList);
         Service service = resultList.get(0);
 
@@ -2484,8 +2475,7 @@
         long startTime = System.currentTimeMillis();
         LOGGER.debug("Catalog database: getAllVnfsByVnfModelCustomizationUuid - " + vnfModelCustomizationUuid);
 
-    	StringBuilder hql1 = new StringBuilder("FROM VnfResourceCustomization WHERE modelCustomizationUuid = :vrcmcu");
-    	Query query1 = getSession().createQuery(hql1.toString());
+        Query query1 = getSession().createQuery("FROM VnfResourceCustomization WHERE modelCustomizationUuid = :vrcmcu");
     	query1.setParameter("vrcmcu", vnfModelCustomizationUuid);
         @SuppressWarnings("unchecked")
     	List<VnfResourceCustomization> resultList1 = query1.list();
@@ -2494,12 +2484,12 @@
             LOGGER.debug("Found no records matching " + vnfModelCustomizationUuid);
             return Collections.EMPTY_LIST;
         }
-    	
-    	for (VnfResourceCustomization vrc : resultList1) {
-    		VnfResource vr = this.getVnfResourceByModelUuid(vrc.getVnfResourceModelUuid());
-    		vrc.setVnfResource(vr);
-    		vrc.setVfModuleCustomizations(this.getAllVfmcForVrc(vrc));
-                }
+
+        for (VnfResourceCustomization vrc : resultList1) {
+            VnfResource vr = this.getVnfResourceByModelUuid(vrc.getVnfResourceModelUuid());
+            vrc.setVnfResource(vr);
+            vrc.setVfModuleCustomizations(this.getAllVfmcForVrc(vrc));
+        }
 
     	LOGGER.debug("Returning " + resultList1.size() + " vnf modules");
         LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getAllVnfsByVnfModelCustomizationUuid", null);
@@ -2534,8 +2524,7 @@
     public List<AllottedResourceCustomization> getAllAllottedResourcesByServiceModelInvariantUuid(String serviceModelInvariantUuid) {
         LOGGER.debug("Catalog database: getAllAllottedResourcesByServiceModelInvariantUuid - " + serviceModelInvariantUuid);
 
-        StringBuilder hql = new StringBuilder("FROM Service WHERE modelInvariantUUID = :serviceModelInvariantUuid");
-        Query query = getSession().createQuery(hql.toString());
+        Query query = getSession().createQuery("FROM Service WHERE modelInvariantUUID = :serviceModelInvariantUuid");
         query.setParameter("serviceModelInvariantUuid", serviceModelInvariantUuid);
         @SuppressWarnings("unchecked")
         List<Service> serviceList = query.list();
@@ -2545,7 +2534,7 @@
             return new ArrayList<>();
         }
 
-        Collections.sort (serviceList, new MavenLikeVersioningComparator ());
+        serviceList.sort(new MavenLikeVersioningComparator());
         Collections.reverse (serviceList);
         Service service = serviceList.get(0);
 
@@ -2558,8 +2547,8 @@
     public List<AllottedResourceCustomization> getAllAllottedResourcesByServiceModelInvariantUuid(String serviceModelInvariantUuid, String serviceModelVersion) {
         LOGGER.debug("Catalog database: getAllAllottedResourcesByServiceModelInvariantUuid - " + serviceModelInvariantUuid + ", version=" + serviceModelVersion);
 
-        StringBuilder hql = new StringBuilder("FROM Service WHERE modelInvariantUUID = :serviceModelInvariantUuid and version = :serviceModelVersion");
-        Query query = getSession().createQuery(hql.toString());
+        Query query = getSession().createQuery(
+            "FROM Service WHERE modelInvariantUUID = :serviceModelInvariantUuid and version = :serviceModelVersion");
         query.setParameter("serviceModelInvariantUuid", serviceModelInvariantUuid);
         query.setParameter("serviceModelVersion", serviceModelVersion);
 
@@ -2571,7 +2560,7 @@
             return new ArrayList<>();
         }
 
-        Collections.sort (serviceList, new MavenLikeVersioningComparator ());
+        serviceList.sort(new MavenLikeVersioningComparator());
         Collections.reverse (serviceList);
         Service service = serviceList.get(0);
 
@@ -2584,8 +2573,8 @@
         long startTime = System.currentTimeMillis();
         LOGGER.debug("Catalog database: getAllAllottedResourcesByArModelCustomizationUuid - " + arModelCustomizationUuid);
 
-        StringBuilder hql = new StringBuilder("FROM AllottedResourceCustomization WHERE modelCustomizationUuid = :arModelCustomizationUuid");
-        Query query = getSession().createQuery(hql.toString());
+        Query query = getSession().createQuery(
+            "FROM AllottedResourceCustomization WHERE modelCustomizationUuid = :arModelCustomizationUuid");
         query.setParameter("arModelCustomizationUuid", arModelCustomizationUuid);
 
         @SuppressWarnings("unchecked")
@@ -2643,7 +2632,7 @@
             return new ServiceMacroHolder();
         }
 
-        Collections.sort (serviceList, new MavenLikeVersioningComparator ());
+        serviceList.sort(new MavenLikeVersioningComparator());
         Collections.reverse (serviceList);
         Service service = serviceList.get(0);
 
@@ -2662,8 +2651,7 @@
         long startTime = System.currentTimeMillis();
         LOGGER.debug("Catalog database: getAllResourcesByServiceModelInvariantUuid - " + serviceModelInvariantUuid);
 
-        StringBuilder hql = new StringBuilder("FROM Service WHERE modelInvariantUUID = :serviceModelInvariantUuid");
-        Query query = getSession().createQuery(hql.toString());
+        Query query = getSession().createQuery("FROM Service WHERE modelInvariantUUID = :serviceModelInvariantUuid");
         query.setParameter("serviceModelInvariantUuid", serviceModelInvariantUuid);
         @SuppressWarnings("unchecked")
         List<Service> serviceList = query.list();
@@ -2673,7 +2661,7 @@
             return new ServiceMacroHolder();
         }
 
-        Collections.sort (serviceList, new MavenLikeVersioningComparator ());
+        serviceList.sort(new MavenLikeVersioningComparator());
         Collections.reverse (serviceList);
         Service service = serviceList.get(0);
 
@@ -2693,8 +2681,8 @@
         long startTime = System.currentTimeMillis();
         LOGGER.debug("Catalog database: getAllResourcesByServiceModelInvariantUuid - " + serviceModelInvariantUuid + ", version=" + serviceModelVersion);
 
-        StringBuilder hql = new StringBuilder("FROM Service WHERE modelInvariantUUID = :serviceModelInvariantUuid and version = :serviceModelVersion");
-        Query query = getSession().createQuery(hql.toString());
+        Query query = getSession().createQuery(
+            "FROM Service WHERE modelInvariantUUID = :serviceModelInvariantUuid and version = :serviceModelVersion");
         query.setParameter("serviceModelInvariantUuid", serviceModelInvariantUuid);
         query.setParameter("serviceModelVersion", serviceModelVersion);
         //TODO make this a unique query
@@ -2706,7 +2694,7 @@
             return new ServiceMacroHolder();
         }
 
-        Collections.sort (serviceList, new MavenLikeVersioningComparator ());
+        serviceList.sort(new MavenLikeVersioningComparator());
         Collections.reverse (serviceList);
         Service service = serviceList.get(0);
 
@@ -2754,7 +2742,7 @@
     }
 
     private void populateNetworkResourceType(List<NetworkResourceCustomization> resultList) {
-        HashMap<String, NetworkResource> networkResources = new HashMap<String, NetworkResource>();
+        HashMap<String, NetworkResource> networkResources = new HashMap<>();
 
         for (NetworkResourceCustomization nrc : resultList) {
         	String network_id = nrc.getNetworkResourceModelUuid();
@@ -2792,12 +2780,10 @@
     public VnfRecipe getVfModuleRecipe (String vnfType, String vfModuleModelName, String action) {
     	String vfModuleType = vnfType + "::" + vfModuleModelName;
 
-    	StringBuilder hql = new StringBuilder ("FROM VfModule WHERE type = :type ");
-
         long startTime = System.currentTimeMillis ();
         LOGGER.debug ("Catalog database - get VF MODULE  with type " + vfModuleType);
 
-        Query query = getSession ().createQuery (hql.toString ());
+        Query query = getSession ().createQuery ("FROM VfModule WHERE type = :type ");
         query.setParameter (TYPE, vfModuleType);
 
         @SuppressWarnings("unchecked")
@@ -2808,20 +2794,18 @@
             return null;
         }
 
-        Collections.sort (resultList, new MavenLikeVersioningComparator ());
+        resultList.sort(new MavenLikeVersioningComparator());
         Collections.reverse (resultList);
 
         VfModule vfMod = resultList.get(0);
 
         String vfModuleId = vfMod.getModelUUID();
 
-        StringBuilder hql1 = new StringBuilder ("FROM VnfRecipe WHERE vfModuleId = :vfModuleId AND action = :action ");
-
         LOGGER.debug ("Catalog database - get VNF recipe with vf module id " + vfModuleId
                                       + " and action "
                                       + action);
 
-        Query query1 = getSession ().createQuery (hql1.toString ());
+        Query query1 = getSession ().createQuery ("FROM VnfRecipe WHERE vfModuleId = :vfModuleId AND action = :action ");
         query1.setParameter (VF_MODULE_MODEL_UUID, vfModuleId);
         query1.setParameter (ACTION, action);
 
@@ -2833,7 +2817,7 @@
             return null;
         }
 
-        Collections.sort (resultList1, new MavenLikeVersioningComparator ());
+        resultList1.sort(new MavenLikeVersioningComparator());
         Collections.reverse (resultList1);
 
         LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully. VNF recipe found", "CatalogDB", "getVfModuleRecipe", null);
@@ -2900,20 +2884,19 @@
             return null;
         }
 
-        Collections.sort (resultList, new MavenLikeVersioningComparator ());
+        resultList.sort(new MavenLikeVersioningComparator());
         Collections.reverse (resultList);
 
         VfModule vfMod = resultList.get(0);
 
         String vfModuleId = vfMod.getModelUUID();
 
-        StringBuilder hql1 = new StringBuilder ("FROM VnfComponentsRecipe WHERE vfModuleId = :vfModuleId AND action = :action ");
-
         LOGGER.debug ("Catalog database - get Vnf Components recipe with vf module id " + vfModuleId
                 + " and action "
                 + action);
 
-        Query query1 = getSession ().createQuery (hql1.toString ());
+        Query query1 = getSession ().createQuery (
+            "FROM VnfComponentsRecipe WHERE vfModuleId = :vfModuleId AND action = :action ");
         query1.setParameter (VF_MODULE_MODEL_UUID, vfModuleId);
         query1.setParameter (ACTION, action);
 
@@ -2925,7 +2908,7 @@
             return null;
         }
 
-        Collections.sort (resultList1, new MavenLikeVersioningComparator ());
+        resultList1.sort(new MavenLikeVersioningComparator());
         Collections.reverse (resultList1);
 
         LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully. VNF recipe found", "CatalogDB", "getVnfComponentsRecipe", null);
@@ -2955,20 +2938,19 @@
             return null;
         }
 
-        Collections.sort (resultList, new MavenLikeVersioningComparator ());
+        resultList.sort(new MavenLikeVersioningComparator());
         Collections.reverse (resultList);
 
         VfModule vfMod = resultList.get(0);
 
-        String vfModuleId = vfMod.getModelName();      
-
-        StringBuilder hql1 = new StringBuilder ("FROM VnfComponentsRecipe WHERE vfModuleId = :vfModuleId AND action = :action ");
+        String vfModuleId = vfMod.getModelName();
 
         LOGGER.debug ("Catalog database - get Vnf Components recipe with vf module id " + vfModuleId
                                       + " and action "
                                       + action);
 
-        Query query1 = getSession ().createQuery (hql1.toString ());
+        Query query1 = getSession ().createQuery (
+            "FROM VnfComponentsRecipe WHERE vfModuleId = :vfModuleId AND action = :action ");
         query1.setParameter (VF_MODULE_MODEL_UUID, vfModuleId);
         query1.setParameter (ACTION, action);
 
@@ -2980,7 +2962,7 @@
             return null;
         }
 
-        Collections.sort (resultList1, new MavenLikeVersioningComparator ());
+        resultList1.sort(new MavenLikeVersioningComparator());
         Collections.reverse (resultList1);
 
         LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully. VNF recipe found", "CatalogDB", "getVnfComponentsRecipe", null);
@@ -4444,7 +4426,7 @@
                 return null;
             }
             
-            Collections.sort (resultList, new MavenLikeVersioningComparator ());
+            resultList.sort(new MavenLikeVersioningComparator());
             Collections.reverse (resultList);
             
             return resultList.get (0);
@@ -4495,7 +4477,7 @@
                 return null;
             }
 
-            Collections.sort (resultList, new MavenLikeVersioningComparator ());
+            resultList.sort(new MavenLikeVersioningComparator());
             Collections.reverse (resultList);
 
             return resultList.get (0);
@@ -4554,7 +4536,7 @@
                 return null;
             }
 
-            Collections.sort (resultList, new MavenLikeVersioningComparator ());
+            resultList.sort(new MavenLikeVersioningComparator());
             Collections.reverse (resultList);
 
             return resultList.get (0);
@@ -4628,7 +4610,7 @@
                 return null;
             }
 
-            Collections.sort (resultList, new MavenLikeVersioningComparator ());
+            resultList.sort(new MavenLikeVersioningComparator());
             Collections.reverse (resultList);
 
             return resultList.get (0);
@@ -4685,7 +4667,7 @@
             if (resultList.isEmpty ()) {
                 return null;
             }
-            Collections.sort (resultList, new MavenLikeVersioningComparator ());
+            resultList.sort(new MavenLikeVersioningComparator());
             Collections.reverse (resultList);
 
             return resultList.get (0);
@@ -4728,7 +4710,7 @@
             if (resultList.isEmpty ()) {
                 return null;
             }
-            Collections.sort (resultList, new MavenLikeVersioningComparator ());
+            resultList.sort(new MavenLikeVersioningComparator());
             Collections.reverse (resultList);
 
             return resultList.get (0);
@@ -4757,7 +4739,7 @@
             return Collections.EMPTY_LIST;
         }
         
-        Collections.sort (resultList, new MavenLikeVersioningComparator ());
+        resultList.sort(new MavenLikeVersioningComparator());
         Collections.reverse (resultList);
 
         LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getVfModuleRecipes", null);
@@ -4807,7 +4789,7 @@
             if (resultList.isEmpty ()) {
                 return null;
             }
-            Collections.sort (resultList, new MavenLikeVersioningComparator ());
+            resultList.sort(new MavenLikeVersioningComparator());
             Collections.reverse (resultList);
 
             return resultList.get (0);
@@ -4841,7 +4823,7 @@
             if (resultList.isEmpty ()) {
                 return null;
             }
-            Collections.sort (resultList, new MavenLikeVersioningComparator ());
+            resultList.sort(new MavenLikeVersioningComparator());
             Collections.reverse (resultList);
 
             return resultList.get (0);
@@ -4882,7 +4864,7 @@
 				LOGGER.debug("Catalog database - recipeResultList is null");
 				return null;
 			}
-			Collections.sort(recipeResultList, new MavenLikeVersioningComparator());
+			recipeResultList.sort(new MavenLikeVersioningComparator());
 			Collections.reverse(recipeResultList);
 			LOGGER.debug("Catalog database - recipeResultList contains " + recipeResultList.get(0).toString());
 
@@ -4954,7 +4936,7 @@
 				LOGGER.debug("Catalog database - recipeResultList is null");
 				return null;
 			}
-			Collections.sort(recipeResultList, new MavenLikeVersioningComparator());
+			recipeResultList.sort(new MavenLikeVersioningComparator());
 			Collections.reverse(recipeResultList);
 			LOGGER.debug("Catalog database - recipeResultList contains " + recipeResultList.get(0).toString());
 
@@ -5002,7 +4984,7 @@
                 LOGGER.debug("Catalog database - modelResultList is null");
                 return null;
             }
-            Collections.sort(modelResultList, new MavenLikeVersioningComparator());
+            modelResultList.sort(new MavenLikeVersioningComparator());
             Collections.reverse(modelResultList);
             LOGGER.debug("Catalog database - modelResultList contains " + modelResultList.get(0).toString());
 
@@ -5019,7 +5001,7 @@
                 LOGGER.debug("Catalog database - recipeResultList is null");
                 return null;
             }
-            Collections.sort(recipeResultList, new MavenLikeVersioningComparator());
+            recipeResultList.sort(new MavenLikeVersioningComparator());
             Collections.reverse(recipeResultList);
             LOGGER.debug("Catalog database - recipeResultList contains " + recipeResultList.get(0).toString());
 
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/AllottedResourceCustomization.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/AllottedResourceCustomization.java
index daeefcc..6fdf236 100644
--- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/AllottedResourceCustomization.java
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/AllottedResourceCustomization.java
@@ -130,20 +130,12 @@
 	}
 
 	@Override
-	public String toString () {
-		StringBuilder sb = new StringBuilder();
-		sb.append("modelCustomizationUuid=");
-		sb.append(this.modelCustomizationUuid);
-		sb.append(",modelInstanceName=");
-		sb.append(this.modelInstanceName);
-		sb.append(",modelInstanceName=");
-		sb.append(this.modelInstanceName);
-		sb.append(",created=");
-		sb.append(this.created);
-		sb.append(",ar=");
-		sb.append(this.ar);
-
-		return sb.toString();
+	public String toString() {
+		return "modelCustomizationUuid=" + this.modelCustomizationUuid +
+			",modelInstanceName=" + this.modelInstanceName +
+			",modelInstanceName=" + this.modelInstanceName +
+			",created=" + this.created +
+			",ar=" + this.ar;
 	}
 
 }
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatTemplateArtifactUuidModelUuid.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatTemplateArtifactUuidModelUuid.java
index 54acf12..f6202b7 100644
--- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatTemplateArtifactUuidModelUuid.java
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatTemplateArtifactUuidModelUuid.java
@@ -44,15 +44,12 @@
 	public void setModelUuid(String modelUuid) {
 		this.modelUuid = modelUuid;
 	}
-	
+
 	@Override
 	public String toString() {
-		StringBuilder sb = new StringBuilder();
-		sb.append("heatTemplateArtifactUuid=").append(this.heatTemplateArtifactUuid);
-		sb.append(" modelUuid=").append(this.modelUuid);
-		return sb.toString();
+		return "heatTemplateArtifactUuid=" + this.heatTemplateArtifactUuid + " modelUuid=" + this.modelUuid;
 	}
-	
+
     @Override
     public boolean equals (Object o) {
         if (!(o instanceof HeatTemplateArtifactUuidModelUuid)) {
@@ -73,9 +70,7 @@
     public int hashCode () {
         // hash code does not have to be a unique result - only that two objects that should be treated as equal
         // return the same value. so this should work.
-        int result;
-        result = this.heatTemplateArtifactUuid.hashCode() + this.modelUuid.hashCode();
-        return result;
+        return this.heatTemplateArtifactUuid.hashCode() + this.modelUuid.hashCode();
     }
 
 }
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/NetworkRecipe.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/NetworkRecipe.java
index 4e905b6..eeaa363 100644
--- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/NetworkRecipe.java
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/NetworkRecipe.java
@@ -37,10 +37,6 @@
 
 	@Override
 	public String toString () {
-		StringBuilder sb = new StringBuilder();
-		sb.append(super.toString());
-		sb.append(",modelName=").append(modelName);
-		sb.append(",networkParamXSD=").append(getParamXSD());
-		return sb.toString();
+		return super.toString() + ",modelName=" + modelName + ",networkParamXSD=" + getParamXSD();
 	}
 }
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/NetworkResourceCustomization.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/NetworkResourceCustomization.java
index ef09fef..b581545 100644
--- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/NetworkResourceCustomization.java
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/NetworkResourceCustomization.java
@@ -103,24 +103,14 @@
 	}
 
 	@Override
-	public String toString () {
-		StringBuilder sb = new StringBuilder();
-		sb.append("modelCustomizationUuid=");
-		sb.append(this.modelCustomizationUuid);
-		sb.append("networkResourceModelUuid=");
-		sb.append(this.networkResourceModelUuid);
-		sb.append("modelInstanceName=");
-		sb.append(this.modelInstanceName);
-		sb.append("networkType=");
-		sb.append(this.networkType);
-		sb.append("networkTechnology=");
-		sb.append(this.networkTechnology);
-		sb.append("networkScope=");
-		sb.append(this.networkScope);
-		sb.append("networkRole=");
-		sb.append(this.networkRole);
-
-		return sb.toString();
+	public String toString() {
+		return "modelCustomizationUuid=" + this.modelCustomizationUuid +
+			"networkResourceModelUuid=" + this.networkResourceModelUuid +
+			"modelInstanceName=" + this.modelInstanceName +
+			"networkType=" + this.networkType +
+			"networkTechnology=" + this.networkTechnology +
+			"networkScope=" + this.networkScope +
+			"networkRole=" + this.networkRole;
 	}
 
     @Override
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceMacroHolder.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceMacroHolder.java
index 645626d..78f94e4 100644
--- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceMacroHolder.java
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceMacroHolder.java
@@ -43,7 +43,7 @@
 	public ServiceMacroHolder() {
 		super();
 		this.service = null;
-		this.vnfResources = new ArrayList<VnfResource>();
+		this.vnfResources = new ArrayList<>();
 		this.networkResourceCustomizations = new ArrayList<>();
 		this.allottedResourceCustomizations = new ArrayList<>();
 		this.vnfResourceCustomizations = new ArrayList<>();
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceToAllottedResources.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceToAllottedResources.java
index 59495f4..6515a12 100644
--- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceToAllottedResources.java
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceToAllottedResources.java
@@ -71,22 +71,16 @@
 	
 	@Override 
 	public int hashCode() {
-		
+
 		int code = this.arModelCustomizationUuid == null ? 0 : this.arModelCustomizationUuid.hashCode();
 		code += this.serviceModelUuid == null ? 0 : this.serviceModelUuid.hashCode();
 		
 		return code;
 	}
-	
+
 	@Override
 	public String toString() {
-		StringBuilder sb = new StringBuilder();
-		sb.append("serviceModelUuid=");
-		sb.append(this.serviceModelUuid);
-		sb.append("arModelCustomizationUuid=");
-		sb.append(this.arModelCustomizationUuid);
-
-		return sb.toString();
+		return "serviceModelUuid=" + this.serviceModelUuid + "arModelCustomizationUuid=" + this.arModelCustomizationUuid;
 	}
 
 }
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceToNetworks.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceToNetworks.java
index a380a58..69dc327 100644
--- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceToNetworks.java
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceToNetworks.java
@@ -80,14 +80,11 @@
 		
 		return code;
 	}
-	
+
 	@Override
 	public String toString() {
-		StringBuilder sb = new StringBuilder();
-		sb.append("ServiceToNetworks mapping: ");
-		sb.append("serviceModelUuid=").append(this.serviceModelUuid);
-		sb.append(",networkModelCustomizationUuid=").append(networkModelCustomizationUuid);
-		return sb.toString();
+		return "ServiceToNetworks mapping: " + "serviceModelUuid=" + this.serviceModelUuid
+			+ ",networkModelCustomizationUuid=" + networkModelCustomizationUuid;
 	}
 
 }
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/TempNetworkHeatTemplateLookup.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/TempNetworkHeatTemplateLookup.java
index 783fc2d..3ef7e6e 100644
--- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/TempNetworkHeatTemplateLookup.java
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/TempNetworkHeatTemplateLookup.java
@@ -23,7 +23,7 @@
 import java.io.Serializable;
 
 public class TempNetworkHeatTemplateLookup implements Serializable {
-	
+
 	private String networkResourceModelName;
 	private String heatTemplateArtifactUuid;
 	private String aicVersionMin;
@@ -33,14 +33,14 @@
 	public TempNetworkHeatTemplateLookup() {
 		super();
 	}
-	
+
 	public String getNetworkResourceModelName() {
 		return this.networkResourceModelName;
 	}
 	public void setNetworkResourceModelName(String networkResourceModelName) {
 		this.networkResourceModelName = networkResourceModelName;
 	}
-	
+
 	public String getHeatTemplateArtifactUuid() {
 		return this.heatTemplateArtifactUuid;
 	}
@@ -50,29 +50,26 @@
 	public String getAicVersionMin() {
 		return this.aicVersionMin;
 	}
-	
+
 	public void setAicVersionMin(String aicVersionMin) {
 		this.aicVersionMin = aicVersionMin;
 	}
-	
+
 	public String getAicVersionMax() {
 		return this.aicVersionMax;
 	}
-	
+
 	public void setAicVersionMax(String aicVersionMax) {
 		this.aicVersionMax = aicVersionMax;
 	}
 
 	@Override
 	public String toString() {
-		StringBuilder sb = new StringBuilder();
-		sb.append("NetworkResourceModelName=").append(this.networkResourceModelName);
-		sb.append("HeatTemplateArtifactUuid=").append(this.heatTemplateArtifactUuid);
-		sb.append("aicVersionMin=").append(this.aicVersionMin);
-		sb.append("aicVersionMax=").append(this.aicVersionMax);
-		return sb.toString();
+		return "NetworkResourceModelName=" + this.networkResourceModelName + "HeatTemplateArtifactUuid=" +
+			this.heatTemplateArtifactUuid + "aicVersionMin=" + this.aicVersionMin + "aicVersionMax=" + this.aicVersionMax;
 	}
-    @Override
+
+	@Override
     public boolean equals (Object o) {
         if (!(o instanceof TempNetworkHeatTemplateLookup)) {
             return false;
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VfModuleCustomization.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VfModuleCustomization.java
index 9f2dae5..db3a266 100644
--- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VfModuleCustomization.java
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VfModuleCustomization.java
@@ -109,22 +109,22 @@
 	public void setVfModule(VfModule vfModule) {
 		this.vfModule = vfModule;
 	}
+
 	@Override
 	public String toString() {
-		StringBuilder sb = new StringBuilder();
-		sb.append("modelCustomizationUuid=").append(this.modelCustomizationUuid);
-		sb.append("vfModuleModelUuid=").append(this.vfModuleModelUuid);
-		sb.append("label=").append(this.label);
-		sb.append("initalCount=").append(this.initialCount);
-		sb.append("minInstances=").append(this.minInstances);
-		sb.append("maxInstances=").append(this.maxInstances);
-		sb.append("availabilityZoneCount=").append(this.availabilityZoneCount);
-		sb.append("heatEnvironmentArtifactUuid=").append(this.heatEnvironmentArtifactUuid);
-		sb.append("volEnvironmentArtifactUuid=").append(this.volEnvironmentArtifactUuid);
-		sb.append("created=").append(this.created);
-		return sb.toString();
+		return "modelCustomizationUuid=" + this.modelCustomizationUuid +
+			"vfModuleModelUuid=" + this.vfModuleModelUuid +
+			"label=" + this.label +
+			"initalCount=" + this.initialCount +
+			"minInstances=" + this.minInstances +
+			"maxInstances=" + this.maxInstances +
+			"availabilityZoneCount=" + this.availabilityZoneCount +
+			"heatEnvironmentArtifactUuid=" + this.heatEnvironmentArtifactUuid +
+			"volEnvironmentArtifactUuid=" + this.volEnvironmentArtifactUuid +
+			"created=" + this.created;
 	}
-    @Override
+
+	@Override
     public boolean equals (Object o) {
         if (!(o instanceof VfModuleCustomization)) {
             return false;
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VfModuleToHeatFiles.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VfModuleToHeatFiles.java
index 476283e..611604e 100644
--- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VfModuleToHeatFiles.java
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VfModuleToHeatFiles.java
@@ -46,13 +46,10 @@
 	public void setHeatFilesArtifactUuid(String heatFilesArtifactUuid) {
 		this.heatFilesArtifactUuid = heatFilesArtifactUuid;
 	}
-	
-    @Override
-    public String toString () {
-        StringBuilder sb = new StringBuilder ();
-        sb.append("vfModuleModelUuid=").append(this.vfModuleModelUuid);
-        sb.append(", heatFilesArtifactUuid=").append(this.heatFilesArtifactUuid);
-        return sb.toString ();
-    }
+
+	@Override
+	public String toString() {
+		return "vfModuleModelUuid=" + this.vfModuleModelUuid + ", heatFilesArtifactUuid=" + this.heatFilesArtifactUuid;
+	}
 
 }
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfComponentsRecipe.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfComponentsRecipe.java
index 6eac5a2..30a5133 100644
--- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfComponentsRecipe.java
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfComponentsRecipe.java
@@ -56,12 +56,7 @@
 
 	@Override
 	public String toString () {
-		StringBuilder sb = new StringBuilder();
-		sb.append(super.toString());
-		sb.append(",vnfComponentParamXSD=").append(getParamXSD());
-		sb.append(",serviceType=").append(getServiceType());
-		sb.append(",vnfComponentType=").append(getVnfComponentType());
-		sb.append(",vfModuleId=").append(getVfModuleModelUUId());
-		return sb.toString();
+		return super.toString() + ",vnfComponentParamXSD=" + getParamXSD() + ",serviceType=" + getServiceType() +
+			",vnfComponentType=" + getVnfComponentType() + ",vfModuleId=" + getVfModuleModelUUId();
 	}
 }
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfRecipe.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfRecipe.java
index 46017c2..0dd38cb 100644
--- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfRecipe.java
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfRecipe.java
@@ -48,11 +48,7 @@
 	
 	@Override
 	public String toString () {
-		StringBuilder sb = new StringBuilder();
-		sb.append(super.toString());
-		sb.append(",vnfParamXSD=").append(getParamXSD());
-		sb.append(",serviceType=").append(getServiceType());
-		sb.append(",vfModuleId=").append(getVfModuleId());
-		return sb.toString();
+		return super.toString() + ",vnfParamXSD=" + getParamXSD() + ",serviceType=" + getServiceType() + ",vfModuleId=" +
+			getVfModuleId();
 	}
 }
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfResCustomToVfModuleCustom.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfResCustomToVfModuleCustom.java
index 7b2364d..fd1e6b6 100644
--- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfResCustomToVfModuleCustom.java
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfResCustomToVfModuleCustom.java
@@ -53,15 +53,14 @@
 	public void setCreated(Timestamp created) {
 		this.created = created;
 	}
+
 	@Override
 	public String toString() {
-		StringBuilder sb = new StringBuilder();
-		sb.append("vnfResourceCustModelCustomizationUuid=").append(this.vnfResourceCustModelCustomizationUuid);
-		sb.append("vfModuleCustModelCustomizationUuid=").append(this.vfModuleCustModelCustomizationUuid);
-		sb.append("created=").append(this.created);
-		return sb.toString();
+		return "vnfResourceCustModelCustomizationUuid=" + this.vnfResourceCustModelCustomizationUuid +
+			"vfModuleCustModelCustomizationUuid=" + this.vfModuleCustModelCustomizationUuid + "created=" + this.created;
 	}
-    @Override
+
+	@Override
     public boolean equals (Object o) {
         if (!(o instanceof VnfResCustomToVfModuleCustom)) {
             return false;
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfResource.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfResource.java
index f0b990a..806cbeb 100644
--- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfResource.java
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfResource.java
@@ -195,7 +195,7 @@
 	}
 
 	public List<VfModuleCustomization> getVfModuleCustomizations() {
-		return this.vfModuleCustomizations == null ? new ArrayList<VfModuleCustomization>() : this.vfModuleCustomizations;
+		return this.vfModuleCustomizations == null ? new ArrayList<>() : this.vfModuleCustomizations;
 	}
 	public void setVfModuleCustomizations(ArrayList<VfModuleCustomization> vfModuleCustomizations) {
 		this.vfModuleCustomizations = vfModuleCustomizations;
@@ -205,7 +205,7 @@
 			if (this.vfModuleCustomizations != null) {
 				this.vfModuleCustomizations.add(vfmc);
 			} else {
-				this.vfModuleCustomizations = new ArrayList<VfModuleCustomization>();
+				this.vfModuleCustomizations = new ArrayList<>();
 				this.vfModuleCustomizations.add(vfmc);
 			}
 	}
@@ -216,7 +216,7 @@
 			if (this.vfModules != null) {
 				this.vfModules.add(vfm);
 			} else {
-				this.vfModules = new HashSet<VfModule>();
+				this.vfModules = new HashSet<>();
 				this.vfModules.add(vfm);
 			}
 		}
@@ -225,7 +225,7 @@
 		if (this.vfModules == null || this.vfModules.size() < 1) {
 			return null;
 	}
-		ArrayList<VfModule> list = new ArrayList<VfModule>();
+		ArrayList<VfModule> list = new ArrayList<>();
 		list.addAll(this.vfModules);
 		return list;
 	}
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfResourceCustomization.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfResourceCustomization.java
index 151c9e5..b211dbd 100644
--- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfResourceCustomization.java
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfResourceCustomization.java
@@ -155,7 +155,7 @@
 			if (this.vfModuleCustomizations != null) {
 				this.vfModuleCustomizations.add(vfmc);
 			} else {
-				this.vfModuleCustomizations = new ArrayList<VfModuleCustomization>();
+				this.vfModuleCustomizations = new ArrayList<>();
 				this.vfModuleCustomizations.add(vfmc);
 			}
 		}
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/utils/MavenLikeVersioning.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/utils/MavenLikeVersioning.java
index 564fd5a..e42f734 100644
--- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/utils/MavenLikeVersioning.java
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/utils/MavenLikeVersioning.java
@@ -51,29 +51,32 @@
 	 *
 	 */
 	public boolean isMoreRecentThan (String versionToCompare) {
-		if (versionToCompare == null || versionToCompare.trim().equals("") || this.version == null || this.version.trim().equals("")) {
+		if (versionToCompare == null || versionToCompare.trim().isEmpty() || this.version == null || this.version.trim().isEmpty()) {
 			return false;
 		}
-		String [] currentVersionArray = this.version.split("\\.");
-		String [] specifiedVersionArray = versionToCompare.split("\\.");
+		String[] currentVersionArray = this.version.split("\\.");
+		String[] specifiedVersionArray = versionToCompare.split("\\.");
 
-        int smalestStringLength = Math.min(currentVersionArray.length, specifiedVersionArray.length);
+		int smalestStringLength = Math.min(currentVersionArray.length, specifiedVersionArray.length);
 
-		for (int currentVersionIndex=0;currentVersionIndex < smalestStringLength;++currentVersionIndex) {
+		for (int currentVersionIndex = 0; currentVersionIndex < smalestStringLength; ++currentVersionIndex) {
 
-			if (Integer.parseInt(currentVersionArray[currentVersionIndex]) < Integer.parseInt(specifiedVersionArray[currentVersionIndex])) {
+			if (Integer.parseInt(currentVersionArray[currentVersionIndex]) < Integer
+				.parseInt(specifiedVersionArray[currentVersionIndex])) {
 				return false;
-			} else if (Integer.parseInt(currentVersionArray[currentVersionIndex]) > Integer.parseInt(specifiedVersionArray[currentVersionIndex])) {
+			} else if (Integer.parseInt(currentVersionArray[currentVersionIndex]) > Integer
+				.parseInt(specifiedVersionArray[currentVersionIndex])) {
 				return true;
 			}
 		}
-
-		// Even if versionToCompare has more digits, it means versionToCompare is more recent
-		if (Integer.parseInt(currentVersionArray[smalestStringLength-1]) == Integer.parseInt(specifiedVersionArray[smalestStringLength-1])) {
-		    return currentVersionArray.length > specifiedVersionArray.length;
+		try {
+			// Even if versionToCompare has more digits, it means versionToCompare is more recent
+			return Integer.parseInt(currentVersionArray[smalestStringLength - 1]) != Integer
+				.parseInt(specifiedVersionArray[smalestStringLength - 1])
+				|| currentVersionArray.length > specifiedVersionArray.length;
+		} catch (NumberFormatException e) {
+			return false;
 		}
-
-		return true;
 	}
 
 	/**
diff --git a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/CatalogDatabaseTest.java b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/CatalogDatabaseTest.java
index e9f080b..3cab4f2 100644
--- a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/CatalogDatabaseTest.java
+++ b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/CatalogDatabaseTest.java
@@ -2445,7 +2445,7 @@
     @Test(expected = Exception.class)
     public void saveHeatTemplateTest(){
         HeatTemplate heat = new HeatTemplate();
-        Set <HeatTemplateParam> paramSet = new HashSet<HeatTemplateParam>();
+        Set <HeatTemplateParam> paramSet = new HashSet<>();
         cd.saveHeatTemplate(heat,paramSet);
     }
     @Test(expected = Exception.class)
@@ -2665,12 +2665,12 @@
     @Test(expected = Exception.class)
     public void executeQuerySingleRow(){
         VnfComponent ar = new VnfComponent();
-        HashMap<String, String> variables = new HashMap<String, String>();
+        HashMap<String, String> variables = new HashMap<>();
         cd.executeQuerySingleRow("tets",variables,false);
     }
     @Test(expected = Exception.class)
     public void executeQueryMultipleRows(){
-        HashMap<String, String> variables = new HashMap<String, String>();
+        HashMap<String, String> variables = new HashMap<>();
         cd.executeQueryMultipleRows("select",variables,false);
     }
 }
diff --git a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/MavenVersioningTest.java b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/MavenVersioningTest.java
index 5bcadb7..3dddb17 100644
--- a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/MavenVersioningTest.java
+++ b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/MavenVersioningTest.java
@@ -153,7 +153,7 @@
 		MavenLikeVersioning test12 = new MavenLikeVersioning();
 		test12.setVersion("2.0");
 		
-		List<MavenLikeVersioning> list= new LinkedList<MavenLikeVersioning>();
+		List<MavenLikeVersioning> list= new LinkedList<>();
 		list.add(test1);
 		list.add(test2);
 		list.add(test3);
