summaryrefslogtreecommitdiffstats
path: root/mso-api-handlers/mso-api-handler-infra/src/main/java/org
diff options
context:
space:
mode:
authorKalkere Ramesh, Sharan (sk720x) <sk720x@att.com>2018-12-10 16:17:44 -0500
committerKalkere Ramesh, Sharan (sk720x) <sk720x@att.com>2018-12-10 16:19:48 -0500
commit57f1d8052877d1114bd59b8e4383e4c86f41b4a6 (patch)
treeaeb97f5ccc3b80772e2e43c6c9d09d39438a6b16 /mso-api-handlers/mso-api-handler-infra/src/main/java/org
parent533311a4934838b67ffd0ca49d7958f69059bccd (diff)
Added lookup of serviceType and sent to BPMN
Change-Id: I8da48da63211c5875a056f1d95cfc6bdf073a9fb Issue-ID: SO-1316 Signed-off-by: Kalkere Ramesh, Sharan (sk720x) <sk720x@att.com>
Diffstat (limited to 'mso-api-handlers/mso-api-handler-infra/src/main/java/org')
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ServiceInstances.java29
1 files changed, 27 insertions, 2 deletions
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ServiceInstances.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ServiceInstances.java
index 32693c356e..676dca101b 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ServiceInstances.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ServiceInstances.java
@@ -705,7 +705,6 @@ public class ServiceInstances {
String vnfType = msoRequest.getVnfType(sir,requestScope,action,requestVersion);
String networkType = msoRequest.getNetworkType(sir,requestScope);
String sdcServiceModelVersion = msoRequest.getSDCServiceModelVersion(sir);
- String serviceInstanceType = msoRequest.getServiceInstanceType(sir,requestScope);
String vfModuleType = msoRequest.getVfModuleType(sir,requestScope,action,requestVersion);
if(requestScope.equalsIgnoreCase(ModelType.vnf.name()) && vnfType != null){
@@ -732,7 +731,7 @@ public class ServiceInstances {
Boolean isBaseVfModule = false;
RecipeLookupResult recipeLookupResult = getServiceInstanceOrchestrationURI(sir, action, alaCarteFlag, currentActiveReq);
-
+ String serviceInstanceType = getServiceType(requestScope, sir, alaCarteFlag);
ModelType modelType;
ModelInfo modelInfo = sir.getRequestDetails().getModelInfo();
if (action == Action.applyUpdatedConfig || action == Action.inPlaceSoftwareUpdate) {
@@ -1857,4 +1856,30 @@ public class ServiceInstances {
}
}
}
+ protected String getServiceType(String requestScope, ServiceInstancesRequest sir, Boolean aLaCarteFlag){
+ String serviceType = null;
+ if(requestScope.equalsIgnoreCase(ModelType.service.toString())){
+ String defaultServiceModelName = getDefaultModel(sir);
+ org.onap.so.db.catalog.beans.Service serviceRecord;
+ if(aLaCarteFlag){
+ serviceRecord = catalogDbClient.getFirstByModelNameOrderByModelVersionDesc(defaultServiceModelName);
+ if(serviceRecord != null){
+ serviceType = serviceRecord.getServiceType();
+ }
+ }else{
+ serviceRecord = catalogDbClient.getServiceByID(sir.getRequestDetails().getModelInfo().getModelVersionId());
+ if(serviceRecord != null){
+ serviceType = serviceRecord.getServiceType();
+ }else{
+ serviceRecord = catalogDbClient.getFirstByModelNameOrderByModelVersionDesc(defaultServiceModelName);
+ if(serviceRecord != null){
+ serviceType = serviceRecord.getServiceType();
+ }
+ }
+ }
+ }else{
+ serviceType = msoRequest.getServiceInstanceType(sir, requestScope);
+ }
+ return serviceType;
+ }
}