aboutsummaryrefslogtreecommitdiffstats
path: root/mso-catalog-db
diff options
context:
space:
mode:
authorSeshu Kumar M <seshu.kumar.m@huawei.com>2017-08-10 06:52:09 +0000
committerGerrit Code Review <gerrit@onap.org>2017-08-10 06:52:09 +0000
commit59a326947cb83a4ac1b7bef7793982b5ed653654 (patch)
tree3b6563439f5cf2d42f732b5e8841be7e7f0ffd9e /mso-catalog-db
parent7255957aa5015de4daae554730ed15158c28abe6 (diff)
parent49f38ff32c2323f5460e18ee300eff015bbd8772 (diff)
Merge "fixed for defect SO-70 - recipe lookup mechanism doesn't allow to define default recipe mapping for any 'source' at level of 'service' and 'network' resources."
Diffstat (limited to 'mso-catalog-db')
-rw-r--r--mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/CatalogDatabase.java13
1 files changed, 13 insertions, 0 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 fcdaff7395..7ddaedcd30 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
@@ -514,6 +514,19 @@ public class CatalogDatabase implements Closeable {
return resultList.get (0);
}
+ /**
+ * @param serviceName
+ * @param action
+ * @return ServiceRecipe object or null if none found. returns a newest version of Service recipe that matches a given serviceName, action and for the newest service version
+ */
+ public ServiceRecipe getServiceRecipeByServiceNameAndAction(String serviceName, String action) {
+ Service service = getServiceByName(serviceName);
+ if (service != null ){
+ return getServiceRecipe(service.getId(),action);
+ }
+ return null;
+ }
+
public List<ServiceRecipe> getServiceRecipes (int serviceId) {
StringBuilder hql = null;