Merge "Support resource recipe query rest"
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);