diff options
author | Marcus Williams <marcus.williams@intel.com> | 2018-06-14 22:56:23 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-06-14 22:56:23 +0000 |
commit | 1336ef0ccd540266b63924d9aad4d375dc74b79b (patch) | |
tree | a127e7e85dcf67f25bed74db0fa46671512de89b | |
parent | e141f084f716fc9bde7c4fac68a77039b7c22509 (diff) | |
parent | a2c1fbdc59c7be3f8c818de371ae9d3d70f8ea9f (diff) |
Merge "Define constant instead of literal getVnfRecipe"
-rw-r--r-- | mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/CatalogDatabase.java | 20 |
1 files changed, 11 insertions, 9 deletions
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 98f5329687..1ef1313158 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 @@ -96,7 +96,8 @@ public class CatalogDatabase implements Closeable { private static final String VF_MODULE_MODEL_UUID = "vfModuleModelUUId"; private static final String NETWORK_SERVICE = "network service"; private static final String TEMPLATE_NAME = "template_name"; - + private static final String GET_VNF_RECIPE = "getVnfRecipe"; + protected static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.GENERAL); protected Session session = null; @@ -124,6 +125,7 @@ public class CatalogDatabase implements Closeable { return session; } + /** * Close an open Catalog Database session. * This method should always be called when a client is finished using a @@ -1122,14 +1124,14 @@ public class CatalogDatabase implements Closeable { List <VnfRecipe> resultList = query.list(); if (resultList.isEmpty()) { - LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully. VNF recipe not found", "CatalogDB", "getVnfRecipe", null); + LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully. VNF recipe not found", "CatalogDB", GET_VNF_RECIPE, null); return null; } resultList.sort(new MavenLikeVersioningComparator()); Collections.reverse(resultList); - LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getVnfRecipe", null); + LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", GET_VNF_RECIPE, null); return resultList.get(0); } @@ -1157,14 +1159,14 @@ public class CatalogDatabase implements Closeable { List <VnfRecipe> resultList = query.list(); if (resultList.isEmpty()) { - LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully. VNF recipe not found", "CatalogDB", "getVnfRecipe", null); + LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully. VNF recipe not found", "CatalogDB", GET_VNF_RECIPE, null); return null; } resultList.sort(new MavenLikeVersioningComparator()); Collections.reverse(resultList); - LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getVnfRecipe", null); + LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", GET_VNF_RECIPE, null); return resultList.get(0); } @@ -1190,14 +1192,14 @@ public class CatalogDatabase implements Closeable { List <VnfRecipe> resultList = query.list(); if (resultList.isEmpty()) { - LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully. VNF recipe not found", "CatalogDB", "getVnfRecipe", null); + LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully. VNF recipe not found", "CatalogDB", GET_VNF_RECIPE, null); return null; } resultList.sort(new MavenLikeVersioningComparator()); Collections.reverse(resultList); - LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getVnfRecipe", null); + LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", GET_VNF_RECIPE, null); return resultList.get(0); } @@ -1238,11 +1240,11 @@ public class CatalogDatabase implements Closeable { List <VnfRecipe> resultList = query.list(); if (resultList.isEmpty()) { - LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully. VNF recipe not found", "CatalogDB", "getVnfRecipe", null); + LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully. VNF recipe not found", "CatalogDB", GET_VNF_RECIPE, null); return null; } - LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getVnfRecipe", null); + LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", GET_VNF_RECIPE, null); return resultList.get(0); } |