diff options
author | Kalkere Ramesh, Sharan (sk720x) <sk720x@att.com> | 2018-12-05 15:30:26 -0500 |
---|---|---|
committer | Steve Smokowski <ss835w@att.com> | 2018-12-06 17:41:36 +0000 |
commit | 2d675c4163ba06d741a1d982386c7bfe5e254175 (patch) | |
tree | de15b28aba33e1c02ac2b739f32cb46ff3646f53 /bpmn/so-bpmn-tasks/src/main | |
parent | 35726250e078b57ebe6ea4e53b4b8ccd56573e50 (diff) |
fix how we get cloud info in GR_API
added jpa repo for northbound request with a cloudowner
Change-Id: I3a2aeb3547f194bc404ed1bc08ba6d8560961a79
Issue-ID: SO-1283
Signed-off-by: Kalkere Ramesh, Sharan (sk720x) <sk720x@att.com>
Diffstat (limited to 'bpmn/so-bpmn-tasks/src/main')
-rw-r--r-- | bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java index 3e1673017e..294fd56cfd 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java @@ -62,6 +62,7 @@ import org.onap.so.db.catalog.beans.VnfVfmoduleCvnfcConfigurationCustomization; import org.onap.so.db.catalog.beans.macro.NorthBoundRequest; import org.onap.so.db.catalog.beans.macro.OrchestrationFlow; import org.onap.so.db.catalog.client.CatalogDbClient; +import org.onap.so.logger.MsoLogger; import org.onap.so.serviceinstancebeans.ModelInfo; import org.onap.so.serviceinstancebeans.ModelType; import org.onap.so.serviceinstancebeans.Networks; @@ -72,6 +73,7 @@ import org.onap.so.serviceinstancebeans.VfModules; import org.onap.so.serviceinstancebeans.Vnfs; import org.slf4j.Logger; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.env.Environment; import org.springframework.stereotype.Component; import com.fasterxml.jackson.databind.ObjectMapper; @@ -89,7 +91,6 @@ public class WorkflowAction { private static final String G_REQUEST_ID = "mso-request-id"; private static final String G_BPMN_REQUEST = "bpmnRequest"; private static final String G_ALACARTE = "aLaCarte"; - private static final String CLOUD_OWNER = "cloudOwner"; private static final String G_APIVERSION = "apiVersion"; private static final String G_URI = "requestUri"; private static final String G_ISTOPLEVELFLOW = "isTopLevelFlow"; @@ -119,6 +120,9 @@ public class WorkflowAction { private CatalogDbClient catalogDbClient; @Autowired private AAIConfigurationResources aaiConfigurationResources; + @Autowired + private Environment environment; + private String defaultCloudOwner = "org.onap.so.cloud-owner"; public void setBbInputSetupUtils(BBInputSetupUtils bbInputSetupUtils) { this.bbInputSetupUtils = bbInputSetupUtils; @@ -134,7 +138,6 @@ public class WorkflowAction { final String bpmnRequest = (String) execution.getVariable(G_BPMN_REQUEST); final boolean aLaCarte = (boolean) execution.getVariable(G_ALACARTE); final String apiVersion = (String) execution.getVariable(G_APIVERSION); - final String cloudOwner = (String) execution.getVariable(CLOUD_OWNER); final String uri = (String) execution.getVariable(G_URI); final String vnfType = (String) execution.getVariable(VNF_TYPE); List<OrchestrationFlow> orchFlows = (List<OrchestrationFlow>) execution.getVariable(G_ORCHESTRATION_FLOW); @@ -151,6 +154,12 @@ public class WorkflowAction { execution.setVariable(G_ISTOPLEVELFLOW, true); ServiceInstancesRequest sIRequest = mapper.readValue(bpmnRequest, ServiceInstancesRequest.class); RequestDetails requestDetails = sIRequest.getRequestDetails(); + String cloudOwner = ""; + try{ + cloudOwner = requestDetails.getCloudConfiguration().getCloudOwner(); + } catch (Exception ex) { + cloudOwner = environment.getProperty(defaultCloudOwner); + } Resource resource = extractResourceIdAndTypeFromUri(uri); WorkflowType resourceType = resource.getResourceType(); execution.setVariable("resourceName", resourceType.toString()); |