diff options
author | Mnushkin, Dmitry <dmitry.mnushkin@att.com> | 2019-12-04 16:55:13 -0500 |
---|---|---|
committer | Benjamin, Max (mb388a) <mb388a@att.com> | 2019-12-04 16:55:13 -0500 |
commit | d9eb882cbfefa4ab0fb67eaea4a20e5c2ac92a03 (patch) | |
tree | eb75e5cc771c08558d97f67e8f56cd2ffa9e337b /bpmn/so-bpmn-tasks/src/main | |
parent | b9765b97e0fd8a99c5b27263638eb05483f14e29 (diff) |
use config value to set enable heatbridge flag
use config value to set enable heatbridge flag
Issue-ID: SO-2552
Signed-off-by: Benjamin, Max (mb388a) <mb388a@att.com>
Change-Id: I0d92b15cc2f31ce01c60c901f0f3af1c4105e06c
Diffstat (limited to 'bpmn/so-bpmn-tasks/src/main')
2 files changed, 17 insertions, 0 deletions
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterObjectMapper.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterObjectMapper.java index ebebae3cce..293bcf9f0e 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterObjectMapper.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterObjectMapper.java @@ -52,6 +52,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; @Component public class VnfAdapterObjectMapper { private ObjectMapper mapper = new ObjectMapper(); + private static final String ENABLE_BRIDGE = "mso.bridgeEnabled"; @PostConstruct public void init() { @@ -86,6 +87,10 @@ public class VnfAdapterObjectMapper { createVolumeGroupRequest.setMessageId(messageId); createVolumeGroupRequest.setNotificationUrl(createCallbackUrl("VNFAResponse", messageId)); + String enableBridge = getProperty(ENABLE_BRIDGE); + if (enableBridge == null || Boolean.valueOf(enableBridge)) { + createVolumeGroupRequest.setEnableBridge(true); + } return createVolumeGroupRequest; } diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java index 685531e9a7..9857adbd09 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java @@ -68,6 +68,7 @@ import org.onap.sdnc.northbound.client.model.GenericResourceApiVnfresourceassign import org.onap.sdnc.northbound.client.model.GenericResourceApiVnftopologyVnfTopology; import org.onap.so.adapters.vnfrest.CreateVfModuleRequest; import org.onap.so.adapters.vnfrest.DeleteVfModuleRequest; +import org.onap.so.bpmn.core.UrnPropertiesReader; import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion; import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf; import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance; @@ -95,6 +96,7 @@ import com.google.common.base.Joiner; public class VnfAdapterVfModuleObjectMapper { @Autowired protected VnfAdapterObjectMapperUtils vnfAdapterObjectMapperUtils; + private static final Logger logger = LoggerFactory.getLogger(VnfAdapterVfModuleObjectMapper.class); private static List<String> sdncResponseParamsToSkip = asList("vnf_id", "vf_module_id", "vnf_name", "vf_module_name"); @@ -114,6 +116,7 @@ public class VnfAdapterVfModuleObjectMapper { private static final String FLOATING_IP = "_floating_ip"; private static final String FLOATING_V6_IP = "_floating_v6_ip"; private static final String UNDERSCORE = "_"; + private static final String ENABLE_BRIDGE = "mso.bridgeEnabled"; @PostConstruct public void init() { @@ -160,6 +163,11 @@ public class VnfAdapterVfModuleObjectMapper { createVfModuleRequest .setNotificationUrl(vnfAdapterObjectMapperUtils.createCallbackUrl("VNFAResponse", messageId)); + String enableBridge = getProperty(ENABLE_BRIDGE); + if (enableBridge == null || Boolean.valueOf(enableBridge)) { + createVfModuleRequest.setEnableBridge(true); + } + return createVfModuleRequest; } @@ -916,4 +924,8 @@ public class VnfAdapterVfModuleObjectMapper { } return baseVfModule; } + + protected String getProperty(String key) { + return UrnPropertiesReader.getVariable(key); + } } |