aboutsummaryrefslogtreecommitdiffstats
path: root/mso-api-handlers/mso-api-handler-infra
diff options
context:
space:
mode:
authorAbhishek Shekhar <abhishek.shekhar1@amdocs.com>2018-01-23 19:17:29 +0530
committerAbhishek Shekhar <abhishek.shekhar1@amdocs.com>2018-01-23 19:17:29 +0530
commit6f5c4e507866e2036e293cf90094dd5396eaa5bf (patch)
treeae9508940531be8e4e364ecbf7e2b1f66c12d0e9 /mso-api-handlers/mso-api-handler-infra
parent1b9f60bf292b24a33df33cedacad83bb868b450c (diff)
Default Recipe Mapping for Service
Change-Id: Ib01f46eae63963496a809e255dc71c977e79c759 Issue-ID: SO-384 Signed-off-by: Abhishek Shekhar <abhishek.shekhar1@amdocs.com>
Diffstat (limited to 'mso-api-handlers/mso-api-handler-infra')
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/ServiceInstances.java18
1 files changed, 13 insertions, 5 deletions
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/ServiceInstances.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/ServiceInstances.java
index 3c40003dd0..6f6d2972d1 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/ServiceInstances.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/ServiceInstances.java
@@ -757,12 +757,16 @@ public class ServiceInstances {
// }
// TODO need to make this a configurable property
- String defaultServiceModelName = msoRequest.getRequestInfo().getSource() + "_DEFAULT";
+ String defaultServiceModelName = "*";
+ String defaultSourceServiceModelName = msoRequest.getRequestInfo().getSource() + "_DEFAULT";
Service serviceRecord;
ModelInfo modelInfo = msoRequest.getModelInfo();
if(msoRequest.getALaCarteFlag()){
- serviceRecord = db.getServiceByModelName(defaultServiceModelName);
+ serviceRecord = db.getServiceByModelName(defaultSourceServiceModelName);
+ if (serviceRecord == null) {
+ serviceRecord = db.getServiceByModelName(defaultServiceModelName);
+ }
}else{
serviceRecord = db.getServiceByModelUUID(modelInfo.getModelVersionId()); // ModelVersionId is not required in v3
if(serviceRecord == null) {
@@ -778,12 +782,16 @@ public class ServiceInstances {
RequestParameters reqParam = msoRequest.getServiceInstancesRequest().getRequestDetails().getRequestParameters();
if(reqParam!=null && reqParam.isaLaCarteSet() && recipe==null){
return null;
- }else if (recipe == null) { //aLaCarte wasn't sent, so we'll try the default
+ }
+
+ //aLaCarte wasn't sent, so we'll try the default
+ serviceRecord = db.getServiceByModelName(defaultSourceServiceModelName);
+ if (serviceRecord == null) {
serviceRecord = db.getServiceByModelName(defaultServiceModelName);
- recipe = db.getServiceRecipeByModelUUID(serviceRecord.getModelUUID(), action.name());
}
- if(modelInfo.getModelVersionId() == null) {
+ recipe = db.getServiceRecipeByModelUUID(serviceRecord.getModelUUID(), action.name());
+ if(modelInfo.getModelVersionId() == null) {
modelInfo.setModelVersionId(serviceRecord.getModelUUID());
}
if(recipe==null){