summaryrefslogtreecommitdiffstats
path: root/bpmn/so-bpmn-tasks
diff options
context:
space:
mode:
Diffstat (limited to 'bpmn/so-bpmn-tasks')
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/buildingblock/SniroHomingV2.java125
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java32
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIDeleteTasks.java9
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIFlagTasks.java8
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIQueryTasks.java11
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasks.java40
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/activity/ExecuteActivity.java18
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterUpdateTasks.java32
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterCreateTasks.java7
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterDeleteTasks.java7
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterImpl.java19
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasks.java22
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/AssignNetwork.java10
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/AssignNetworkBBUtils.java10
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/CloudSiteCatalogUtils.java76
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigurationScaleOut.java24
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/CreateNetwork.java7
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/CreateNetworkCollection.java7
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericVnfHealthCheck.java33
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/UnassignNetworkBB.java7
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCActivateTasks.java7
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasks.java9
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCDeactivateTasks.java8
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCQueryTasks.java8
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCUnassignTasks.java7
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/validations/CloudRegionOrchestrationValidator.java2
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidator.java7
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/sdno/tasks/SDNOHealthCheckTasks.java11
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterObjectMapper.java6
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java60
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/namingservice/NamingClient.java11
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/namingservice/NamingClientResponseValidator.java42
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIServiceInstanceResources.java8
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIVfModuleResources.java7
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIVnfResources.java9
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIVolumeGroupResources.java7
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/NamingServiceResources.java7
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCNetworkResources.java8
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCVfModuleResources.java8
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCVnfResources.java7
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/VnfAdapterVfModuleResources.java7
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/VnfAdapterVolumeGroupResources.java7
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SDNCClient.java7
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SdnCommonTasks.java41
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/GCTopologyOperationRequestMapper.java18
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/GeneralTopologyObjectMapper.java52
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/NetworkTopologyOperationRequestMapper.java27
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/ServiceTopologyOperationMapper.java21
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/VfModuleTopologyOperationRequestMapper.java47
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/VnfTopologyOperationRequestMapper.java29
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/SniroClient.java23
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/SniroValidator.java43
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/SniroConductorRequest.java10
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/SniroManagerRequest.java11
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/FileUtil.java9
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasksTest.java24
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterUpdateTasksTest.java39
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/CloudSiteCatalogUtilsTest.java88
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/SniroHomingV2IT.java25
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterObjectMapperTest.java13
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapperPayloadTest.java22
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapperTest.java2
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/SDNCConfigurationResourcesTest.java35
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/GCTopologyOperationRequestMapperTest.java23
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/GeneralTopologyObjectMapperTest.java3
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/NetworkTopologyOperationRequestMapperTest.java24
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/ServiceTopologyOperationMapperTest.java15
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/VfModuleTopologyOperationRequestMapperTest.java23
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/VnfTopologyOperationRequestMapperTest.java15
69 files changed, 948 insertions, 498 deletions
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/buildingblock/SniroHomingV2.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/buildingblock/SniroHomingV2.java
index cb893ce950..2e7184b9ff 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/buildingblock/SniroHomingV2.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/buildingblock/SniroHomingV2.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -67,7 +69,8 @@ import org.onap.so.client.sniro.beans.ServiceInfo;
import org.onap.so.client.sniro.beans.SniroManagerRequest;
import org.onap.so.client.sniro.beans.SubscriberInfo;
import org.onap.so.db.catalog.beans.OrchestrationStatus;
-import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
@@ -84,7 +87,7 @@ import org.springframework.web.util.UriUtils;
@Component("SniroHoming")
public class SniroHomingV2 {
- private static final MsoLogger log = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, SniroHomingV2.class);
+ private static final Logger logger = LoggerFactory.getLogger(SniroHomingV2.class);
private JsonUtils jsonUtils = new JsonUtils();
@Autowired
private Environment env;
@@ -100,7 +103,6 @@ public class SniroHomingV2 {
private static final String RESOURCE_MODULE_NAME = "resourceModuleName";
private static final String RESOURCE_MODEL_INFO = "resourceModelInfo";
private static final String IDENTIFIER_TYPE = "identifierType";
- private static final String INVENTORY_TYPE = "inventoryType";
private static final String SOLUTIONS = "solutions";
private static final String RESOURCE_MISSING_DATA = "Resource does not contain: ";
private static final String SERVICE_MISSING_DATA = "Service Instance does not contain: ";
@@ -114,7 +116,7 @@ public class SniroHomingV2 {
* @param execution
*/
public void callSniro(BuildingBlockExecution execution){
- log.debug("Started Sniro Homing Call Sniro");
+ logger.debug("Started Sniro Homing Call Sniro");
try{
GeneralBuildingBlock bb = execution.getGeneralBuildingBlock();
@@ -153,7 +155,7 @@ public class SniroHomingV2 {
if(placementDemands.size() > 0 || licenseDemands.size() > 0){
client.postDemands(request);
}else{
- log.debug(SERVICE_MISSING_DATA + "resources eligible for homing or licensing");
+ logger.debug(SERVICE_MISSING_DATA + "resources eligible for homing or licensing");
throw new BpmnError(UNPROCESSABLE, SERVICE_MISSING_DATA + "resources eligible for homing or licensing");
}
@@ -162,15 +164,15 @@ public class SniroHomingV2 {
execution.setVariable("asyncMessageType", "SNIROResponse");
execution.setVariable("asyncTimeout", timeout);
- log.trace("Completed Sniro Homing Call Sniro");
+ logger.trace("Completed Sniro Homing Call Sniro");
}catch(BpmnError e){
- log.error(e);
+ logger.error("Exception occurred", e);
exceptionUtil.buildAndThrowWorkflowException(execution, Integer.parseInt(e.getErrorCode()), e.getMessage());
}catch(BadResponseException e){
- log.error(e);
+ logger.error("Exception occurred", e);
exceptionUtil.buildAndThrowWorkflowException(execution, 400, e.getMessage());
}catch(Exception e){
- log.error(e);
+ logger.error("Exception occurred", e);
exceptionUtil.buildAndThrowWorkflowException(execution, INTERNAL, "Internal Error - occurred while preparing sniro request: " + e.getMessage());
}
}
@@ -183,13 +185,13 @@ public class SniroHomingV2 {
* @param asyncResponse
*/
public void processSolution(BuildingBlockExecution execution, String asyncResponse){
- log.trace("Started Sniro Homing Process Solution");
+ logger.trace("Started Sniro Homing Process Solution");
try{
//TODO improve handling multiple solutions but is dependent on sniro enhancing api + work with sniro conductor to improve "inventoryType" representation
validateSolution(asyncResponse);
ServiceInstance serviceInstance = execution.getGeneralBuildingBlock().getCustomer().getServiceSubscription().getServiceInstances().get(0);
- log.debug("Processing sniro manager asyncronous response");
+ logger.debug("Processing sniro manager asyncronous response");
JSONObject response = new JSONObject(asyncResponse);
if(response.has(SOLUTIONS)){
JSONObject allSolutions = response.getJSONObject(SOLUTIONS);
@@ -212,15 +214,15 @@ public class SniroHomingV2 {
execution.setVariable("generalBuildingBlock", execution.getGeneralBuildingBlock());
- log.trace("Completed Sniro Homing Process Solution");
+ logger.trace("Completed Sniro Homing Process Solution");
}catch(BpmnError e){
- log.error(e);
+ logger.error("Exception occurred", e);
exceptionUtil.buildAndThrowWorkflowException(execution, Integer.parseInt(e.getErrorCode()), e.getMessage());
}catch(BadResponseException e){
- log.error(e);
+ logger.error("Exception occurred", e);
exceptionUtil.buildAndThrowWorkflowException(execution, 400, e.getMessage());
}catch(Exception e){
- log.error(e);
+ logger.error("Exception occurred", e);
exceptionUtil.buildAndThrowWorkflowException(execution, INTERNAL, "Internal Error - occurred while processing sniro asynchronous response: " + e.getMessage());
}
}
@@ -231,7 +233,7 @@ public class SniroHomingV2 {
* @throws Exception
*/
private RequestInfo buildRequestInfo(String requestId, String timeout) throws Exception{
- log.trace("Building request information");
+ logger.trace("Building request information");
RequestInfo requestInfo = new RequestInfo();
if(requestId != null){
String host = env.getProperty("mso.workflow.message.endpoint");
@@ -256,7 +258,7 @@ public class SniroHomingV2 {
*
*/
private ServiceInfo buildServiceInfo(ServiceInstance serviceInstance){
- log.trace("Building service information");
+ logger.trace("Building service information");
ServiceInfo info = new ServiceInfo();
ModelInfoServiceInstance modelInfo = serviceInstance.getModelInfoServiceInstance();
if(isNotBlank(modelInfo.getModelInvariantUuid()) && isNotBlank(modelInfo.getModelUuid())){
@@ -281,14 +283,14 @@ public class SniroHomingV2 {
private PlacementInfo buildPlacementInfo(Customer customer, RequestParameters requestParams){
PlacementInfo placementInfo = new PlacementInfo();
if(customer != null){
- log.debug("Adding subscriber to placement information");
+ logger.debug("Adding subscriber to placement information");
SubscriberInfo subscriber = new SubscriberInfo();
subscriber.setGlobalSubscriberId(customer.getGlobalCustomerId());
subscriber.setSubscriberName(customer.getSubscriberName());
subscriber.setSubscriberCommonSiteId(customer.getSubscriberCommonSiteId());
placementInfo.setSubscriberInfo(subscriber);
if(requestParams != null){
- log.debug("Adding request parameters to placement information");
+ logger.debug("Adding request parameters to placement information");
placementInfo.setRequestParameters(requestParams.toJsonString());
}
}else{
@@ -303,12 +305,12 @@ public class SniroHomingV2 {
*
*/
private List<Demand> buildPlacementDemands(ServiceInstance serviceInstance){
- log.trace("Building placement information demands");
+ logger.trace("Building placement information demands");
List<Demand> placementDemands = new ArrayList<Demand>();
List<AllottedResource> allottedResourceList = serviceInstance.getAllottedResources();
if(!allottedResourceList.isEmpty()){
- log.debug("Adding allotted resources to placement demands list");
+ logger.debug("Adding allotted resources to placement demands list");
for(AllottedResource ar : allottedResourceList){
if(isBlank(ar.getId())){
ar.setId(UUID.randomUUID().toString());
@@ -320,7 +322,7 @@ public class SniroHomingV2 {
}
List<VpnBondingLink> vpnBondingLinkList = serviceInstance.getVpnBondingLinks();
if(!vpnBondingLinkList.isEmpty()){
- log.debug("Adding vpn bonding links to placement demands list");
+ logger.debug("Adding vpn bonding links to placement demands list");
for(VpnBondingLink vbl:vpnBondingLinkList){
List<ServiceProxy> serviceProxyList = vbl.getServiceProxies();
for(ServiceProxy sp : serviceProxyList){
@@ -341,11 +343,11 @@ public class SniroHomingV2 {
*
*/
private List<Demand> buildLicenseDemands(ServiceInstance serviceInstance){
- log.trace("Building license information");
+ logger.trace("Building license information");
List<Demand> licenseDemands = new ArrayList<Demand>();
List<GenericVnf> vnfList = serviceInstance.getVnfs();
if(!vnfList.isEmpty()){
- log.debug("Adding vnfs to license demands list");
+ logger.debug("Adding vnfs to license demands list");
for(GenericVnf vnf : vnfList){
Demand demand = buildDemand(vnf.getVnfId(), vnf.getModelInfoGenericVnf());
licenseDemands.add(demand);
@@ -359,7 +361,7 @@ public class SniroHomingV2 {
*
*/
private Demand buildDemand(String id, ModelInfoMetadata metadata){
- log.debug("Building demand for service or resource: " + id);
+ logger.debug("Building demand for service or resource: " + id);
Demand demand = new Demand();
if(isNotBlank(id) && isNotBlank(metadata.getModelInstanceName())){
demand.setServiceResourceId(id);
@@ -431,7 +433,7 @@ public class SniroHomingV2 {
private void processLicenseSolution(ServiceInstance serviceInstance, JSONArray licenseSolutions){
List<GenericVnf> vnfs = serviceInstance.getVnfs();
- log.debug("Processing the license solution");
+ logger.debug("Processing the license solution");
for(int i = 0; i < licenseSolutions.length(); i++){
JSONObject licenseSolution = licenseSolutions.getJSONObject(i);
for(GenericVnf vnf:vnfs){
@@ -460,7 +462,7 @@ public class SniroHomingV2 {
List<AllottedResource> allottes = serviceInstance.getAllottedResources();
List<GenericVnf> vnfs = serviceInstance.getVnfs();
- log.debug("Processing placement solution " + i+1);
+ logger.debug("Processing placement solution " + i+1);
for(int p = 0; p < placements.length(); p++){
JSONObject placement = placements.getJSONObject(p);
SolutionInfo solutionInfo = new SolutionInfo();
@@ -508,7 +510,7 @@ public class SniroHomingV2 {
*
*/
private ServiceInstance setSolution(SolutionInfo solutionInfo, JSONObject placement){
- log.debug("Mapping placement solution");
+ logger.debug("Mapping placement solution");
String invalidMessage = "Sniro Managers Response contains invalid: ";
JSONObject solution = placement.getJSONObject("solution");
@@ -519,51 +521,40 @@ public class SniroHomingV2 {
JSONArray assignments = placement.getJSONArray("assignmentInfo");
Map<String, String> assignmentsMap = jsonUtils.entryArrayToMap(assignments.toString(), "key", "value");
solutionInfo.setRehome(Boolean.parseBoolean(assignmentsMap.get("isRehome")));
- String type = placement.getString(INVENTORY_TYPE);
ServiceInstance si = new ServiceInstance();
CloudRegion cloud = setCloud(assignmentsMap);
- if(type.equals("service")){
- if(identifierType.equals(CandidateType.SERVICE_INSTANCE_ID.toString())){
- solutionInfo.setHomed(true);
- si.setServiceInstanceId(identifierValue);
- si.setOrchestrationStatus(OrchestrationStatus.CREATED);
- cloud.setLcpCloudRegionId(assignmentsMap.get("cloudRegionId"));
- if(assignmentsMap.containsKey("vnfHostName")){
- log.debug("Resources has been homed to a vnf");
- GenericVnf vnf = setVnf(assignmentsMap);
- vnf.setCloudRegion(cloud);
- si.getVnfs().add(vnf);
-
- }else if(assignmentsMap.containsKey("primaryPnfName")){
- log.debug("Resources has been homed to a pnf");
- Pnf priPnf = setPnf(assignmentsMap, "primary");
- priPnf.setCloudRegion(cloud);
- si.getPnfs().add(priPnf);
- if(assignmentsMap.containsKey("secondaryPnfName")){
- Pnf secPnf = setPnf(assignmentsMap, "secondary");
- secPnf.setCloudRegion(cloud);
- si.getPnfs().add(secPnf);
- }
+ if(identifierType.equals(CandidateType.SERVICE_INSTANCE_ID.toString())){
+ solutionInfo.setHomed(true);
+ si.setServiceInstanceId(identifierValue);
+ si.setOrchestrationStatus(OrchestrationStatus.CREATED);
+ cloud.setLcpCloudRegionId(assignmentsMap.get("cloudRegionId"));
+ if(assignmentsMap.containsKey("vnfHostName")){
+ logger.debug("Resources has been homed to a vnf");
+ GenericVnf vnf = setVnf(assignmentsMap);
+ vnf.setCloudRegion(cloud);
+ si.getVnfs().add(vnf);
+
+ }else if(assignmentsMap.containsKey("primaryPnfName")){
+ logger.debug("Resources has been homed to a pnf");
+ Pnf priPnf = setPnf(assignmentsMap, "primary");
+ priPnf.setCloudRegion(cloud);
+ si.getPnfs().add(priPnf);
+ if(assignmentsMap.containsKey("secondaryPnfName")){
+ Pnf secPnf = setPnf(assignmentsMap, "secondary");
+ secPnf.setCloudRegion(cloud);
+ si.getPnfs().add(secPnf);
}
- }else{
- log.debug(invalidMessage + IDENTIFIER_TYPE);
- throw new BpmnError(UNPROCESSABLE, invalidMessage + IDENTIFIER_TYPE);
- }
- }else if(type.equals("cloud")){
- if(identifierType.equals(CandidateType.CLOUD_REGION_ID.toString())){
- log.debug("Resources has been homed to a cloud region");
- cloud.setLcpCloudRegionId(identifierValue);
- solutionInfo.setHomed(false);
- solutionInfo.setTargetedCloudRegion(cloud);
- si.setOrchestrationStatus(OrchestrationStatus.PRECREATED);
- }else{
- log.debug(invalidMessage + IDENTIFIER_TYPE);
- throw new BpmnError(UNPROCESSABLE, invalidMessage + IDENTIFIER_TYPE);
}
+ }else if(identifierType.equals(CandidateType.CLOUD_REGION_ID.toString())){
+ logger.debug("Resources has been homed to a cloud region");
+ cloud.setLcpCloudRegionId(identifierValue);
+ solutionInfo.setHomed(false);
+ solutionInfo.setTargetedCloudRegion(cloud);
+ si.setOrchestrationStatus(OrchestrationStatus.PRECREATED);
}else{
- log.debug(invalidMessage + INVENTORY_TYPE);
- throw new BpmnError(UNPROCESSABLE, invalidMessage + INVENTORY_TYPE);
+ logger.debug(invalidMessage + IDENTIFIER_TYPE);
+ throw new BpmnError(UNPROCESSABLE, invalidMessage + IDENTIFIER_TYPE);
}
si.setSolutionInfo(solutionInfo);
return si;
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java
index f47781082d..8711f965fd 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -70,9 +72,7 @@ import org.springframework.stereotype.Component;
@Component
public class AAICreateTasks {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, AAICreateTasks.class);
- private static final Logger logger = LoggerFactory.getLogger(AAICreateTasks.class.getName());
-
+ private static final Logger logger = LoggerFactory.getLogger(AAICreateTasks.class);
private static final String networkTypeProvider = "PROVIDER";
private static String NETWORK_COLLECTION_NAME = "networkCollectionName";
private static String CONTRAIL_NETWORK_POLICY_FQDN_LIST = "contrailNetworkPolicyFqdnList";
@@ -117,9 +117,9 @@ public class AAICreateTasks {
if (null == customer) {
String errorMessage = "Exception in creating ServiceSubscription. Customer not present for ServiceInstanceID: "
+ serviceInstance.getServiceInstanceId();
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, errorMessage, "BPMN", MsoLogger.getServiceName(),
- MsoLogger.ErrorCode.UnknownError, errorMessage);
- exceptionUtil.buildAndThrowWorkflowException(execution, 7000, errorMessage);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), errorMessage, "BPMN",
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), errorMessage);
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, errorMessage);
}
aaiSIResources.createServiceSubscription(customer);
} catch (BpmnError ex) {
@@ -136,7 +136,7 @@ public class AAICreateTasks {
Project project = serviceInstance.getProject();
if(project != null) {
if (project.getProjectName() == null || "".equals(project.getProjectName())) {
- msoLogger.info("ProjectName is null in input. Skipping create project...");
+ logger.info("ProjectName is null in input. Skipping create project...");
} else {
aaiSIResources.createProjectandConnectServiceInstance(project, serviceInstance);
}
@@ -162,14 +162,14 @@ public class AAICreateTasks {
} else {
if (owningEntityName == null || "".equals(owningEntityName)) {
String msg = "Exception in AAICreateOwningEntity. Can't create an owningEntity with no owningEntityName.";
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, msg, "BPMN", MsoLogger.getServiceName(),
- MsoLogger.ErrorCode.UnknownError, msg);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), msg);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg);
} else {
if(aaiSIResources.existsOwningEntityName(owningEntityName)){
String msg = "Exception in AAICreateOwningEntity. Can't create OwningEntity as name already exists in AAI associated with a different owning-entity-id (name must be unique)";
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, msg, "BPMN", MsoLogger.getServiceName(),
- MsoLogger.ErrorCode.UnknownError, msg);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), msg);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg);
}else{
aaiSIResources.createOwningEntityandConnectServiceInstance(owningEntity, serviceInstance);
@@ -199,7 +199,7 @@ public class AAICreateTasks {
Platform platform = vnf.getPlatform();
if(platform != null) {
if (platform.getPlatformName() == null || "".equals(platform.getPlatformName())) {
- msoLogger.debug("PlatformName is null in input. Skipping create platform...");
+ logger.debug("PlatformName is null in input. Skipping create platform...");
} else {
aaiVnfResources.createPlatformandConnectVnf(platform,vnf);
}
@@ -216,7 +216,7 @@ public class AAICreateTasks {
LineOfBusiness lineOfBusiness = vnf.getLineOfBusiness();
if(lineOfBusiness != null) {
if (lineOfBusiness.getLineOfBusinessName() == null || "".equals(lineOfBusiness.getLineOfBusinessName())) {
- msoLogger.info("lineOfBusiness is null in input. Skipping create lineOfBusiness...");
+ logger.info("lineOfBusiness is null in input. Skipping create lineOfBusiness...");
} else {
aaiVnfResources.createLineOfBusinessandConnectVnf(lineOfBusiness,vnf);
}
@@ -269,7 +269,7 @@ public class AAICreateTasks {
try{
volumeGroup = extractPojosForBB.extractByKey(execution, ResourceKey.VOLUME_GROUP_ID, execution.getLookupMap().get(ResourceKey.VOLUME_GROUP_ID));
} catch (BBObjectNotFoundException e){
- msoLogger.info("VolumeGroup not found. Skipping Connect between VfModule and VolumeGroup");
+ logger.info("VolumeGroup not found. Skipping Connect between VfModule and VolumeGroup");
}
if (volumeGroup != null) {
aaiVfModuleResources.connectVfModuleToVolumeGroup(vnf, vfModule, volumeGroup, execution.getGeneralBuildingBlock().getCloudRegion());
@@ -463,9 +463,9 @@ public class AAICreateTasks {
uri.queryParam(NETWORK_POLICY_FQDN_PARAM, fqdn);
Optional<org.onap.aai.domain.yang.NetworkPolicy> oNetPolicy = aaiNetworkResources.getNetworkPolicy(uri);
if(!oNetPolicy.isPresent()) {
- msoLogger.debug("This network policy FQDN is not in AAI yet: " + fqdn);
+ logger.debug("This network policy FQDN is not in AAI yet: {}", fqdn);
String networkPolicyId = UUID.randomUUID().toString();
- msoLogger.debug("Adding network-policy with network-policy-id " + networkPolicyId);
+ logger.debug("Adding network-policy with network-policy-id {}", networkPolicyId);
NetworkPolicy networkPolicy = new NetworkPolicy();
networkPolicy.setNetworkPolicyId(networkPolicyId);
networkPolicy.setNetworkPolicyFqdn(fqdn);
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIDeleteTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIDeleteTasks.java
index 0d9aeed1ae..4908cda26a 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIDeleteTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIDeleteTasks.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -46,13 +48,14 @@ import org.onap.so.client.orchestration.AAIServiceInstanceResources;
import org.onap.so.client.orchestration.AAIVfModuleResources;
import org.onap.so.client.orchestration.AAIVnfResources;
import org.onap.so.client.orchestration.AAIVolumeGroupResources;
-import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class AAIDeleteTasks {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, AAIDeleteTasks.class);
+ private static final Logger logger = LoggerFactory.getLogger(AAIDeleteTasks.class);
private static String CONTRAIL_NETWORK_POLICY_FQDN_LIST = "contrailNetworkPolicyFqdnList";
private static String NETWORK_POLICY_FQDN_PARAM = "network-policy-fqdn";
@@ -177,7 +180,7 @@ public class AAIDeleteTasks {
if (networkPolicyList != null && !networkPolicyList.isEmpty()) {
NetworkPolicy networkPolicy = networkPolicyList.get(0);
String networkPolicyId = networkPolicy.getNetworkPolicyId();
- msoLogger.debug("Deleting network-policy with network-policy-id " + networkPolicyId);
+ logger.debug("Deleting network-policy with network-policy-id {}", networkPolicyId);
aaiNetworkResources.deleteNetworkPolicy(networkPolicyId);
}
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIFlagTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIFlagTasks.java
index 53d0e0a45c..94529f915b 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIFlagTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIFlagTasks.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -25,15 +27,15 @@ import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey;
import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB;
import org.onap.so.client.exception.ExceptionBuilder;
-import org.onap.so.client.orchestration.AAIVfModuleResources;
import org.onap.so.client.orchestration.AAIVnfResources;
-import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class AAIFlagTasks {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, AAIFlagTasks.class);
+ private static final Logger logger = LoggerFactory.getLogger(AAIFlagTasks.class);
@Autowired
private AAIVnfResources aaiVnfResources;
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIQueryTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIQueryTasks.java
index 46ff8495f9..e89dffc6d9 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIQueryTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIQueryTasks.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -42,14 +44,15 @@ import org.onap.so.client.aai.entities.Relationships;
import org.onap.so.client.aai.entities.uri.AAIResourceUri;
import org.onap.so.client.exception.ExceptionBuilder;
import org.onap.so.client.orchestration.AAINetworkResources;
-import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class AAIQueryTasks {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, AAIQueryTasks.class);
+ private static final Logger logger = LoggerFactory.getLogger(AAIQueryTasks.class);
private static final String ERROR_MSG = "No relationships were returned from AAIResultWrapper.getRelationships()";
@Autowired
private ExtractPojosForBB extractPojosForBB;
@@ -116,7 +119,7 @@ public class AAIQueryTasks {
.getRelatedAAIUris(AAIObjectType.VPN_BINDING);
List<org.onap.so.openstack.beans.RouteTarget> routeTargets = new ArrayList<>();
for (AAIResourceUri netBindingUri : netBindingsUriList) {
- msoLogger.info("Get Route Targests");
+ logger.info("Get Route Targests");
Optional<VpnBinding> oVpnBinding = aaiNetworkResources.getVpnBinding(netBindingUri);
if (oVpnBinding.isPresent()) {
VpnBinding vpnBinding = oVpnBinding.get();
@@ -247,4 +250,4 @@ public class AAIQueryTasks {
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
-} \ No newline at end of file
+}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasks.java
index 5176bee0d6..34598ef00a 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasks.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -24,6 +26,7 @@ import java.util.List;
import java.util.Map;
import org.onap.so.adapters.nwrest.CreateNetworkResponse;
+import org.onap.so.adapters.nwrest.UpdateNetworkResponse;
import org.onap.so.bpmn.common.BuildingBlockExecution;
import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion;
import org.onap.so.bpmn.servicedecomposition.bbobjects.Collection;
@@ -47,13 +50,14 @@ import org.onap.so.client.orchestration.AAIVfModuleResources;
import org.onap.so.client.orchestration.AAIVnfResources;
import org.onap.so.client.orchestration.AAIVolumeGroupResources;
import org.onap.so.db.catalog.beans.OrchestrationStatus;
-import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class AAIUpdateTasks {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, AAIUpdateTasks.class);
+ private static final Logger logger = LoggerFactory.getLogger(AAIUpdateTasks.class);
private static final String ALACARTE = "aLaCarte";
private static final String MULTI_STAGE_DESIGN_OFF = "false";
private static final String MULTI_STAGE_DESIGN_ON = "true";
@@ -335,7 +339,7 @@ public class AAIUpdateTasks {
}
/**
- * BPMN access method to update L3Network after it was created in AIC
+ * BPMN access method to update L3Network after it was created in cloud
* @param execution
* @throws Exception
*/
@@ -376,6 +380,34 @@ public class AAIUpdateTasks {
}
}
+ /**
+ * BPMN access method to update L3Network after it was updated in cloud
+ * @param execution
+ * @throws Exception
+ */
+ public void updateNetworkUpdated(BuildingBlockExecution execution) throws Exception {
+ L3Network l3network = extractPojosForBB.extractByKey(execution, ResourceKey.NETWORK_ID, execution.getLookupMap().get(ResourceKey.NETWORK_ID));
+ L3Network copiedl3network = l3network.shallowCopyId();
+ UpdateNetworkResponse response = execution.getVariable("updateNetworkResponse");
+ try {
+ copiedl3network.setNeutronNetworkId(response.getNeutronNetworkId());
+ aaiNetworkResources.updateNetwork(copiedl3network);
+
+ Map<String, String> subnetMap = response.getSubnetMap();
+ List<Subnet> subnets = l3network.getSubnets();
+ if (subnets != null && subnetMap != null){
+ for (Subnet subnet: subnets){
+ Subnet copiedSubnet = subnet.shallowCopyId();
+ copiedSubnet.setNeutronSubnetId(subnetMap.get(copiedSubnet.getSubnetId()));
+ copiedSubnet.setOrchestrationStatus(OrchestrationStatus.CREATED);
+ aaiNetworkResources.updateSubnet(copiedl3network, copiedSubnet);
+ }
+ }
+ } catch (Exception ex) {
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
+ }
+ }
+
public void updateObjectNetwork(BuildingBlockExecution execution) {
try {
L3Network l3network = extractPojosForBB.extractByKey(execution, ResourceKey.NETWORK_ID, execution.getLookupMap().get(ResourceKey.NETWORK_ID));
@@ -498,4 +530,4 @@ public class AAIUpdateTasks {
}
}
-} \ No newline at end of file
+}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/activity/ExecuteActivity.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/activity/ExecuteActivity.java
index acef0cb354..1402cebfbc 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/activity/ExecuteActivity.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/activity/ExecuteActivity.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -38,6 +40,8 @@ import org.onap.so.logger.MessageEnum;
import org.onap.so.logger.MsoLogger;
import org.onap.so.serviceinstancebeans.RequestDetails;
import org.onap.so.serviceinstancebeans.ServiceInstancesRequest;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@@ -46,7 +50,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
@Component("ExecuteActivity")
public class ExecuteActivity implements JavaDelegate {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, ExecuteActivity.class);
+ private static final Logger logger = LoggerFactory.getLogger(ExecuteActivity.class);
private static final String G_BPMN_REQUEST = "bpmnRequest";
private static final String VNF_TYPE = "vnfType";
private static final String G_ACTION = "requestAction";
@@ -70,12 +74,12 @@ public class ExecuteActivity implements JavaDelegate {
try {
final String implementationString = execution.getBpmnModelElementInstance().getAttributeValue(SERVICE_TASK_IMPLEMENTATION_ATTRIBUTE);
- msoLogger.debug("activity implementation String: " + implementationString);
+ logger.debug("activity implementation String: {}", implementationString);
if (!implementationString.startsWith(ACTIVITY_PREFIX)) {
buildAndThrowException(execution, "Implementation attribute has a wrong format");
}
String activityName = implementationString.replaceFirst(ACTIVITY_PREFIX, "");
- msoLogger.info("activityName is: " + activityName);
+ logger.info("activityName is: {}", activityName);
BuildingBlock buildingBlock = buildBuildingBlock(activityName);
ExecuteBuildingBlock executeBuildingBlock = buildExecuteBuildingBlock(execution, requestId, buildingBlock);
@@ -91,7 +95,7 @@ public class ExecuteActivity implements JavaDelegate {
WorkflowException workflowException = (WorkflowException) variableMap.get("WorklfowException");
if (workflowException != null) {
- msoLogger.error("Workflow exception is: " + workflowException.getErrorMessage());
+ logger.error("Workflow exception is: {}", workflowException.getErrorMessage());
}
execution.setVariable("WorkflowException", workflowException);
}
@@ -131,14 +135,14 @@ public class ExecuteActivity implements JavaDelegate {
}
protected void buildAndThrowException(DelegateExecution execution, String msg, Exception ex) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, msg, "BPMN", MsoLogger.getServiceName(),
- MsoLogger.ErrorCode.UnknownError, msg, ex);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), msg, ex);
execution.setVariable("ExecuteActivityErrorMessage", msg);
exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, msg);
}
protected void buildAndThrowException(DelegateExecution execution, String msg) {
- msoLogger.error(msg);
+ logger.error(msg);
execution.setVariable("ExecuteActuvityErrorMessage", msg);
exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, msg);
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterUpdateTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterUpdateTasks.java
index ef2cf86f01..61687081d9 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterUpdateTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterUpdateTasks.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -20,8 +22,7 @@
package org.onap.so.bpmn.infrastructure.adapter.network.tasks;
-import java.util.Optional;
-
+import org.onap.so.adapters.nwrest.UpdateNetworkRequest;
import org.onap.so.adapters.nwrest.UpdateNetworkResponse;
import org.onap.so.bpmn.common.BuildingBlockExecution;
import org.onap.so.bpmn.servicedecomposition.bbobjects.L3Network;
@@ -29,20 +30,22 @@ import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance;
import org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock;
import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey;
import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB;
+import org.onap.so.client.adapter.network.mapper.NetworkAdapterObjectMapper;
import org.onap.so.client.exception.ExceptionBuilder;
import org.onap.so.client.orchestration.NetworkAdapterResources;
-import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class NetworkAdapterUpdateTasks {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, NetworkAdapterUpdateTasks.class);
+ private static final Logger logger = LoggerFactory.getLogger(NetworkAdapterUpdateTasks.class);
@Autowired
private ExtractPojosForBB extractPojosForBB;
@Autowired
- private NetworkAdapterResources networkAdapterResources;
+ private NetworkAdapterObjectMapper networkAdapterObjectMapper;
@Autowired
private ExceptionBuilder exceptionUtil;
@@ -51,14 +54,23 @@ public class NetworkAdapterUpdateTasks {
GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock();
ServiceInstance serviceInstance = extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID, execution.getLookupMap().get(ResourceKey.SERVICE_INSTANCE_ID));
L3Network l3Network = extractPojosForBB.extractByKey(execution, ResourceKey.NETWORK_ID, execution.getLookupMap().get(ResourceKey.NETWORK_ID));
- Optional<UpdateNetworkResponse> oUpdateNetworkResponse = networkAdapterResources.updateNetwork(gBBInput.getRequestContext(), gBBInput.getCloudRegion(), gBBInput.getOrchContext(), serviceInstance, l3Network, gBBInput.getUserInput(), gBBInput.getCustomer());
- if(oUpdateNetworkResponse.isPresent()) {
- UpdateNetworkResponse updateNetworkResponse = oUpdateNetworkResponse.get();
- execution.setVariable("NetworkAdapterUpdateNetworkResponse", updateNetworkResponse);
- }
+ UpdateNetworkRequest updateNetworkRequest = networkAdapterObjectMapper.createNetworkUpdateRequestMapper(gBBInput.getRequestContext(), gBBInput.getCloudRegion(), gBBInput.getOrchContext(), serviceInstance, l3Network, gBBInput.getUserInput(), gBBInput.getCustomer());
+ execution.setVariable("networkAdapterRequest", updateNetworkRequest);
+
} catch(Exception ex) {
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
+
+ public void processResponseFromOpenstack(BuildingBlockExecution execution) {
+ try {
+ UpdateNetworkResponse updateNetworkResponse = execution.getVariable("updateNetworkResponse");
+ if(updateNetworkResponse == null) {
+ throw new Exception("No response was sent back from NetworkAdapterRestV1 subflow.");
+ }
+ } catch (Exception ex) {
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
+ }
+ }
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterCreateTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterCreateTasks.java
index 3456fa1c56..932558d8ad 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterCreateTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterCreateTasks.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -37,13 +39,14 @@ import org.onap.so.client.exception.BBObjectNotFoundException;
import org.onap.so.client.exception.ExceptionBuilder;
import org.onap.so.client.orchestration.VnfAdapterVfModuleResources;
import org.onap.so.client.orchestration.VnfAdapterVolumeGroupResources;
-import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class VnfAdapterCreateTasks {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, VnfAdapterCreateTasks.class);
+ private static final Logger logger = LoggerFactory.getLogger(VnfAdapterCreateTasks.class);
private static final String VNFREST_REQUEST = "VNFREST_Request";
@Autowired
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterDeleteTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterDeleteTasks.java
index 48b4ebb982..759ec61878 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterDeleteTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterDeleteTasks.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -33,13 +35,14 @@ import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB;
import org.onap.so.client.exception.ExceptionBuilder;
import org.onap.so.client.orchestration.VnfAdapterVfModuleResources;
import org.onap.so.client.orchestration.VnfAdapterVolumeGroupResources;
-import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class VnfAdapterDeleteTasks {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, VnfAdapterDeleteTasks.class);
+ private static final Logger logger = LoggerFactory.getLogger(VnfAdapterDeleteTasks.class);
private static final String VNFREST_REQUEST = "VNFREST_Request";
@Autowired
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterImpl.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterImpl.java
index 0851dc9d95..47357d8ef3 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterImpl.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterImpl.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -37,6 +39,8 @@ import org.onap.so.client.exception.ExceptionBuilder;
import org.onap.so.exceptions.MarshallerException;
import org.onap.so.logger.MessageEnum;
import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.xml.sax.InputSource;
@@ -55,7 +59,7 @@ import java.util.Map;
@Component
public class VnfAdapterImpl {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, VnfAdapterImpl.class);
+ private static final Logger logger = LoggerFactory.getLogger(VnfAdapterImpl.class);
private static final String CONTRAIL_SERVICE_INSTANCE_FQDN = "contrailServiceInstanceFqdn";
private static final String OAM_MANAGEMENT_V4_ADDRESS = "oamManagementV4Address";
private static final String OAM_MANAGEMENT_V6_ADDRESS = "oamManagementV6Address";
@@ -163,8 +167,9 @@ public class VnfAdapterImpl {
SAXSource source = new SAXSource(xmlReader, inputSource);
return jaxbUnmarshaller.unmarshal(source);
} catch (Exception e) {
- msoLogger.error(MessageEnum.GENERAL_EXCEPTION, "", "", "", MsoLogger.ErrorCode.SchemaError, e.getMessage(), e);
- throw new MarshallerException("Error parsing VNF Adapter response. " + e.getMessage(), MsoLogger.ErrorCode.SchemaError.getValue(), e);
+ logger.error("{} {} {}", MessageEnum.GENERAL_EXCEPTION.toString(), MsoLogger.ErrorCode.SchemaError.getValue(),
+ e.getMessage(), e);
+ throw new MarshallerException("Error parsing VNF Adapter response. " + e.getMessage(), MsoLogger.ErrorCode.SchemaError.getValue(), e);
}
}
@@ -181,24 +186,24 @@ public class VnfAdapterImpl {
String key = keys.next();
if (key.equals("contrail-service-instance-fqdn")) {
String contrailServiceInstanceFqdn = vfModuleOutputs.get(key);
- msoLogger.debug("Obtained contrailServiceInstanceFqdn: " + contrailServiceInstanceFqdn);
+ logger.debug("Obtained contrailServiceInstanceFqdn: {}", contrailServiceInstanceFqdn);
vfModule.setContrailServiceInstanceFqdn(contrailServiceInstanceFqdn);
execution.setVariable(CONTRAIL_SERVICE_INSTANCE_FQDN, contrailServiceInstanceFqdn);
}
else if (key.endsWith("contrail_network_policy_fqdn")) {
String contrailNetworkPolicyFqdn = vfModuleOutputs.get(key);
- msoLogger.debug("Obtained contrailNetworkPolicyFqdn: " + contrailNetworkPolicyFqdn);
+ logger.debug("Obtained contrailNetworkPolicyFqdn: {}", contrailNetworkPolicyFqdn);
contrailNetworkPolicyFqdnList.add(contrailNetworkPolicyFqdn);
}
else if (key.equals("oam_management_v4_address")) {
String oamManagementV4Address = vfModuleOutputs.get(key);
- msoLogger.debug("Obtained oamManagementV4Address: " + oamManagementV4Address);
+ logger.debug("Obtained oamManagementV4Address: {}", oamManagementV4Address);
genericVnf.setIpv4OamAddress(oamManagementV4Address);
execution.setVariable(OAM_MANAGEMENT_V4_ADDRESS, oamManagementV4Address);
}
else if (key.equals("oam_management_v6_address")) {
String oamManagementV6Address = vfModuleOutputs.get(key);
- msoLogger.debug("Obtained oamManagementV6Address: " + oamManagementV6Address);
+ logger.debug("Obtained oamManagementV6Address: {}", oamManagementV6Address);
genericVnf.setManagementV6Address(oamManagementV6Address);
execution.setVariable(OAM_MANAGEMENT_V6_ADDRESS, oamManagementV6Address);
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasks.java
index e0cbb82484..e0516ce9af 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasks.java
@@ -39,12 +39,14 @@ import org.onap.so.db.catalog.beans.ControllerSelectionReference;
import org.onap.so.db.catalog.client.CatalogDbClient;
import org.onap.so.logger.MessageEnum;
import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class AppcRunTasks {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, AppcRunTasks.class);
+ private static final Logger logger = LoggerFactory.getLogger(AppcRunTasks.class);
@Autowired
private ExceptionBuilder exceptionUtil;
@Autowired
@@ -72,7 +74,7 @@ public class AppcRunTasks {
}
public void runAppcCommand(BuildingBlockExecution execution, Action action) {
- msoLogger.trace("Start runAppcCommand ");
+ logger.trace("Start runAppcCommand ");
String appcCode = "1002";
String appcMessage = "";
try {
@@ -123,22 +125,24 @@ public class AppcRunTasks {
if (pay != null) {
payload = Optional.of(pay);
}
- }
- msoLogger.debug("Running APP-C action: " + action.toString());
- msoLogger.debug("VNFID: " + vnfId);
+ }
+ logger.debug("Running APP-C action: {}", action.toString());
+ logger.debug("VNFID: {}", vnfId);
appCClient.runAppCCommand(action, msoRequestId, vnfId, payload, payloadInfo, controllerType);
appcCode = appCClient.getErrorCode();
appcMessage = appCClient.getErrorMessage();
mapRollbackVariables(execution, action, appcCode);
}
catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION, "Caught exception in runAppcCommand", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "APPC Error", e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION.toString(),
+ "Caught exception in runAppcCommand", "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "APPC Error", e);
appcMessage = e.getMessage();
}
- msoLogger.error("Error Message: " + appcMessage);
- msoLogger.error("ERROR CODE: " + appcCode);
- msoLogger.trace("End of runAppCommand ");
+ logger.error("Error Message: {}", appcMessage);
+ logger.error("ERROR CODE: {}", appcCode);
+ logger.trace("End of runAppCommand ");
if (appcCode != null && !appcCode.equals("0")) {
exceptionUtil.buildAndThrowWorkflowException(execution, Integer.parseInt(appcCode), appcMessage);
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/AssignNetwork.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/AssignNetwork.java
index 7c9e000a44..753a29f208 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/AssignNetwork.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/AssignNetwork.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -24,15 +26,15 @@ import org.onap.so.bpmn.servicedecomposition.bbobjects.L3Network;
import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey;
import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB;
import org.onap.so.db.catalog.beans.OrchestrationStatus;
-import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class AssignNetwork {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL,
- AssignNetwork.class);
+ private static final Logger logger = LoggerFactory.getLogger(AssignNetwork.class);
@Autowired
private ExtractPojosForBB extractPojosForBB;
@@ -50,7 +52,7 @@ public class AssignNetwork {
if (!OrchestrationStatus.PRECREATED.equals(l3network.getOrchestrationStatus())){
networkFound = true;
- msoLogger.debug("network found in NOT PRECREATED status");
+ logger.debug("network found in NOT PRECREATED status");
}
} catch (Exception ex) {
// return false if no network present
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/AssignNetworkBBUtils.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/AssignNetworkBBUtils.java
index 6217f87420..df3f5465e6 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/AssignNetworkBBUtils.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/AssignNetworkBBUtils.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -27,15 +29,15 @@ import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB;
import org.onap.so.client.exception.ExceptionBuilder;
import org.onap.so.client.orchestration.AAINetworkResources;
import org.onap.so.client.orchestration.SDNCNetworkResources;
-import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class AssignNetworkBBUtils {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL,
- AssignNetworkBBUtils.class);
+ private static final Logger logger = LoggerFactory.getLogger(AssignNetworkBBUtils.class);
@Autowired
private ExceptionBuilder exceptionUtil;
@Autowired
@@ -85,7 +87,7 @@ public class AssignNetworkBBUtils {
*/
public void processSilentSuccess(BuildingBlockExecution execution) {
String msg = "Silent success processing network assign";
- msoLogger.info(msg);
+ logger.info(msg);
}
/**
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/CloudSiteCatalogUtils.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/CloudSiteCatalogUtils.java
new file mode 100644
index 0000000000..bba883e727
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/CloudSiteCatalogUtils.java
@@ -0,0 +1,76 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.so.bpmn.infrastructure.flowspecific.tasks;
+
+import java.util.Optional;
+
+import org.camunda.bpm.engine.delegate.DelegateExecution;
+import org.onap.so.client.exception.ExceptionBuilder;
+import org.onap.so.db.catalog.client.CatalogDbClient;
+import org.onap.so.db.catalog.beans.CloudSite;
+import org.onap.so.logger.MsoLogger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class CloudSiteCatalogUtils {
+
+ private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, CloudSiteCatalogUtils.class);
+ @Autowired
+ private ExceptionBuilder exceptionUtil;
+
+ @Autowired
+ private CatalogDbClient catalogDbClient;
+
+
+ public void getIdentityUrlFromCloudSite(DelegateExecution execution) {
+ String cloudRegionId = (String) execution.getVariable("lcpCloudRegionId");
+
+ if (cloudRegionId != null) {
+ Optional<CloudSite> cloudSite = getCloudSite(cloudRegionId);
+ if (!cloudSite.isPresent()) {
+ msoLogger.debug("Cloud Region with cloudRegionId " + cloudRegionId + " not found in Catalog DB");
+ exceptionUtil.buildAndThrowWorkflowException(execution, 404, "Cloud Region with cloudRegionId " + cloudRegionId + " not found in Catalog DB");
+ }
+
+ if (cloudSite.get().getIdentityService() == null) {
+ msoLogger.debug("No identityService found for Cloud Region with cloudRegionId " + cloudRegionId + " in Catalog DB");
+ exceptionUtil.buildAndThrowWorkflowException(execution, 404, "No identityService found for Cloud Region with cloudRegionId " + cloudRegionId + " in Catalog DB");
+ }
+ String identityUrl = cloudSite.get().getIdentityService().getIdentityUrl();
+
+ msoLogger.debug("identityUrl from Catalog DB is: " + identityUrl);
+ execution.setVariable("identityUrl", identityUrl);
+ }
+ }
+
+ protected Optional<CloudSite> getCloudSite(String id) {
+ if (id == null) {
+ return Optional.empty();
+ }
+ CloudSite cloudSite = catalogDbClient.getCloudSite(id);
+
+ if (cloudSite != null) {
+ return Optional.of(cloudSite);
+ } else {
+ return(Optional.of(catalogDbClient.getCloudSiteByClliAndAicVersion(id,"2.5")));
+ }
+ }
+} \ No newline at end of file
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigurationScaleOut.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigurationScaleOut.java
index 615b7279dc..ba04b16b14 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigurationScaleOut.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigurationScaleOut.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -39,6 +41,8 @@ import org.onap.so.db.catalog.beans.ControllerSelectionReference;
import org.onap.so.db.catalog.client.CatalogDbClient;
import org.onap.so.logger.MessageEnum;
import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@@ -48,7 +52,7 @@ import com.jayway.jsonpath.JsonPath;
@Component
public class ConfigurationScaleOut {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, ConfigurationScaleOut.class);
+ private static final Logger logger = LoggerFactory.getLogger(ConfigurationScaleOut.class);
@Autowired
private ExceptionBuilder exceptionUtil;
@Autowired
@@ -100,7 +104,7 @@ public class ConfigurationScaleOut {
configScaleOutParam = JsonPath.parse(sdncVfModuleQueryResponse).read(paramValue);
}catch(ClassCastException e){
configScaleOutParam = null;
- msoLogger.warnSimple("Incorrect JSON path. Path points to object rather than value causing: ", e);
+ logger.warn("Incorrect JSON path. Path points to object rather than value causing: ", e);
}
paramsMap.put(key, configScaleOutParam);
}
@@ -125,7 +129,7 @@ public class ConfigurationScaleOut {
}
public void callAppcClient(BuildingBlockExecution execution) {
- msoLogger.trace("Start runAppcCommand ");
+ logger.trace("Start runAppcCommand ");
String appcCode = "1002";
String appcMessage = "";
try{
@@ -141,20 +145,22 @@ public class ConfigurationScaleOut {
HashMap<String, String> payloadInfo = new HashMap<>();
payloadInfo.put(VNF_NAME, execution.getVariable(VNF_NAME));
payloadInfo.put(VFMODULE_ID,execution.getVariable(VFMODULE_ID));
- msoLogger.debug("Running APP-C action: " + commandAction.toString());
- msoLogger.debug("VNFID: " + vnfId);
+ logger.debug("Running APP-C action: {}", commandAction.toString());
+ logger.debug("VNFID: {}", vnfId);
//PayloadInfo contains extra information that adds on to payload before making request to appc
appCClient.runAppCCommand(commandAction, msoRequestId, vnfId, payloadString, payloadInfo, controllerType);
appcCode = appCClient.getErrorCode();
appcMessage = appCClient.getErrorMessage();
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION, "Caught exception in runAppcCommand in ConfigurationScaleOut", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "APPC Error", e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION.toString(),
+ "Caught exception in runAppcCommand in ConfigurationScaleOut", "BPMN",
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), "APPC Error", e);
appcMessage = e.getMessage();
}
- msoLogger.error("Error Message: " + appcMessage);
- msoLogger.error("ERROR CODE: " + appcCode);
- msoLogger.trace("End of runAppCommand ");
+ logger.error("Error Message: " + appcMessage);
+ logger.error("ERROR CODE: " + appcCode);
+ logger.trace("End of runAppCommand ");
if (appcCode != null && !appcCode.equals("0")) {
exceptionUtil.buildAndThrowWorkflowException(execution, Integer.parseInt(appcCode), appcMessage);
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/CreateNetwork.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/CreateNetwork.java
index 08d5afcc44..962d4fa8c4 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/CreateNetwork.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/CreateNetwork.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -30,14 +32,15 @@ import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey;
import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB;
import org.onap.so.client.adapter.network.mapper.NetworkAdapterObjectMapper;
import org.onap.so.client.exception.ExceptionBuilder;
-import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class CreateNetwork {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, CreateNetwork.class);
+ private static final Logger logger = LoggerFactory.getLogger(CreateNetwork.class);
@Autowired
private ExceptionBuilder exceptionUtil;
@Autowired
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/CreateNetworkCollection.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/CreateNetworkCollection.java
index c8c4d439bd..060775e1d7 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/CreateNetworkCollection.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/CreateNetworkCollection.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -27,13 +29,14 @@ import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey;
import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB;
import org.onap.so.client.exception.ExceptionBuilder;
import org.onap.so.client.orchestration.AAINetworkResources;
-import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class CreateNetworkCollection {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, CreateNetworkCollection.class);
+ private static final Logger logger = LoggerFactory.getLogger(CreateNetworkCollection.class);
@Autowired
private ExceptionBuilder exceptionUtil;
@Autowired
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericVnfHealthCheck.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericVnfHealthCheck.java
index 4f2e2c98d2..bb33b521d6 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericVnfHealthCheck.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericVnfHealthCheck.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -21,9 +23,6 @@ package org.onap.so.bpmn.infrastructure.flowspecific.tasks;
import java.util.HashMap;
import java.util.Optional;
-import java.net.HttpURLConnection;
-import java.net.SocketTimeoutException;
-import org.apache.http.conn.ConnectTimeoutException;
import org.camunda.bpm.engine.delegate.BpmnError;
import org.onap.appc.client.lcm.model.Action;
import org.onap.so.bpmn.common.BuildingBlockExecution;
@@ -37,13 +36,15 @@ import org.onap.so.db.catalog.client.CatalogDbClient;
import org.onap.so.db.catalog.beans.ControllerSelectionReference;
import org.onap.so.logger.MessageEnum;
import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class GenericVnfHealthCheck {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, GenericVnfHealthCheck.class);
+ private static final Logger logger = LoggerFactory.getLogger(GenericVnfHealthCheck.class);
@Autowired
private ExceptionBuilder exceptionUtil;
@Autowired
@@ -82,7 +83,7 @@ public class GenericVnfHealthCheck {
}
public void callAppcClient(BuildingBlockExecution execution) {
- msoLogger.trace("Start runAppcCommand ");
+ logger.trace("Start runAppcCommand ");
String appcCode = "1002";
String appcMessage = "";
try {
@@ -102,32 +103,38 @@ public class GenericVnfHealthCheck {
payloadInfo.put("oamIpAddress",execution.getVariable("oamIpAddress"));
payloadInfo.put("vnfHostIpAddress",execution.getVariable("vnfHostIpAddress"));
- msoLogger.debug("Running APP-C action: " + action.toString());
- msoLogger.debug("VNFID: " + vnfId);
+ logger.debug("Running APP-C action: {}", action.toString());
+ logger.debug("VNFID: {}", vnfId);
//PayloadInfo contains extra information that adds on to payload before making request to appc
appCClient.runAppCCommand(action, msoRequestId, vnfId, payload, payloadInfo, controllerType);
appcCode = appCClient.getErrorCode();
appcMessage = appCClient.getErrorMessage();
} catch (BpmnError ex) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Caught exception in GenericVnfHealthCheck", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + ex);
+ logger.error("", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), "Caught exception in GenericVnfHealthCheck", "BPMN",
+ MsoLogger
+ .getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), ex);
appcMessage = ex.getMessage();
exceptionUtil.buildAndThrowWorkflowException(execution, Integer.parseInt(appcCode), appcMessage);
} catch (Exception e) {
if (e instanceof java.util.concurrent.TimeoutException )
{
appcMessage = "Request to APPC timed out. ";
- msoLogger.error(MessageEnum.RA_CONNECTION_EXCEPTION, "Caught timedOut exception in runAppcCommand in GenericVnfHealthCheck", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "APPC Error", e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.RA_CONNECTION_EXCEPTION.toString(),
+ "Caught timedOut exception in runAppcCommand in GenericVnfHealthCheck", "BPMN",
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), "APPC Error", e);
throw e;
}
else {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION, "Caught exception in runAppcCommand in GenericVnfHealthCheck", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "APPC Error", e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION.toString(),
+ "Caught exception in runAppcCommand in GenericVnfHealthCheck", "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "APPC Error", e);
appcMessage = e.getMessage();
exceptionUtil.buildAndThrowWorkflowException(execution, Integer.parseInt(appcCode), appcMessage);
}
}
- msoLogger.error("Error Message: " + appcMessage);
- msoLogger.error("ERROR CODE: " + appcCode);
- msoLogger.trace("End of runAppCommand ");
+ logger.error("Error Message: " + appcMessage);
+ logger.error("ERROR CODE: " + appcCode);
+ logger.trace("End of runAppCommand ");
if (appcCode != null && !appcCode.equals("0")) {
exceptionUtil.buildAndThrowWorkflowException(execution, Integer.parseInt(appcCode), appcMessage);
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/UnassignNetworkBB.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/UnassignNetworkBB.java
index c45a47bc12..c7fd41c77a 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/UnassignNetworkBB.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/UnassignNetworkBB.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -29,14 +31,15 @@ import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB;
import org.onap.so.client.aai.entities.AAIResultWrapper;
import org.onap.so.client.exception.ExceptionBuilder;
import org.onap.so.client.orchestration.AAINetworkResources;
-import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class UnassignNetworkBB {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, UnassignNetworkBB.class);
+ private static final Logger logger = LoggerFactory.getLogger(UnassignNetworkBB.class);
private static String MESSAGE_CANNOT_PERFORM_UNASSIGN = "Cannot perform Unassign Network. Network is still related to ";
private static String MESSAGE_ERROR_ROLLBACK = " Rollback is not possible. Please restore data manually.";
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCActivateTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCActivateTasks.java
index 43ee71e676..3793adc5d0 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCActivateTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCActivateTasks.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -41,13 +43,14 @@ import org.onap.so.client.orchestration.SDNCVfModuleResources;
import org.onap.so.client.orchestration.SDNCVnfResources;
import org.onap.so.client.sdnc.beans.SDNCRequest;
import org.onap.so.client.sdnc.endpoint.SDNCTopology;
-import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class SDNCActivateTasks {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, SDNCActivateTasks.class);
+ private static final Logger logger = LoggerFactory.getLogger(SDNCActivateTasks.class);
@Autowired
private SDNCVnfResources sdncVnfResources;
@Autowired
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasks.java
index 2695a170b4..715322bef3 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasks.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -44,13 +46,14 @@ import org.onap.so.client.orchestration.SDNCVfModuleResources;
import org.onap.so.client.orchestration.SDNCVnfResources;
import org.onap.so.client.sdnc.beans.SDNCRequest;
import org.onap.so.client.sdnc.endpoint.SDNCTopology;
-import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class SDNCAssignTasks {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, SDNCAssignTasks.class);
+ private static final Logger logger = LoggerFactory.getLogger(SDNCAssignTasks.class);
@Autowired
private SDNCServiceInstanceResources sdncSIResources;
@Autowired
@@ -109,7 +112,7 @@ public class SDNCAssignTasks {
try{
volumeGroup = extractPojosForBB.extractByKey(execution, ResourceKey.VOLUME_GROUP_ID, execution.getLookupMap().get(ResourceKey.VOLUME_GROUP_ID));
} catch (BBObjectNotFoundException e){
- msoLogger.info("No volume group was found.");
+ logger.info("No volume group was found.");
}
Customer customer = gBBInput.getCustomer();
CloudRegion cloudRegion = gBBInput.getCloudRegion();
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCDeactivateTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCDeactivateTasks.java
index eb078e04b4..d7313ad9a4 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCDeactivateTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCDeactivateTasks.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -42,14 +44,14 @@ import org.onap.so.client.orchestration.SDNCVfModuleResources;
import org.onap.so.client.orchestration.SDNCVnfResources;
import org.onap.so.client.sdnc.beans.SDNCRequest;
import org.onap.so.client.sdnc.endpoint.SDNCTopology;
-import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class SDNCDeactivateTasks {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL,
- SDNCDeactivateTasks.class);
+ private static final Logger logger = LoggerFactory.getLogger(SDNCDeactivateTasks.class);
@Autowired
private SDNCNetworkResources sdncNetworkResources;
@Autowired
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCQueryTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCQueryTasks.java
index 81ebfb1f41..b636fe1292 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCQueryTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCQueryTasks.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -27,17 +29,17 @@ import org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule;
import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey;
import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB;
import org.onap.so.client.exception.BBObjectNotFoundException;
-import org.onap.so.client.exception.BadResponseException;
import org.onap.so.client.exception.ExceptionBuilder;
import org.onap.so.client.orchestration.SDNCVnfResources;
import org.onap.so.client.orchestration.SDNCVfModuleResources;
-import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class SDNCQueryTasks {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, SDNCQueryTasks.class);
+ private static final Logger logger = LoggerFactory.getLogger(SDNCQueryTasks.class);
@Autowired
private SDNCVnfResources sdncVnfResources;
@Autowired
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCUnassignTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCUnassignTasks.java
index 960fb9988a..292f29c349 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCUnassignTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCUnassignTasks.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -42,13 +44,14 @@ import org.onap.so.client.orchestration.SDNCVfModuleResources;
import org.onap.so.client.orchestration.SDNCVnfResources;
import org.onap.so.client.sdnc.beans.SDNCRequest;
import org.onap.so.client.sdnc.endpoint.SDNCTopology;
-import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class SDNCUnassignTasks {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, SDNCUnassignTasks.class);
+ private static final Logger logger = LoggerFactory.getLogger(SDNCUnassignTasks.class);
@Autowired
private SDNCServiceInstanceResources sdncSIResources;
@Autowired
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/validations/CloudRegionOrchestrationValidator.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/validations/CloudRegionOrchestrationValidator.java
index 7a433c06a6..c457034eca 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/validations/CloudRegionOrchestrationValidator.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/validations/CloudRegionOrchestrationValidator.java
@@ -5,6 +5,7 @@ import java.util.regex.Pattern;
import org.onap.so.bpmn.common.BuildingBlockExecution;
import org.onap.so.bpmn.common.validation.PreBuildingBlockValidator;
+import org.onap.so.bpmn.common.validation.Skip;
import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion;
import org.onap.so.client.exception.ExceptionBuilder;
import org.slf4j.Logger;
@@ -13,6 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
+@Skip
public class CloudRegionOrchestrationValidator implements PreBuildingBlockValidator {
private static Logger logger = LoggerFactory.getLogger(CloudRegionOrchestrationValidator.class);
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidator.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidator.java
index 2065dfb71e..75f293655f 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidator.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidator.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -33,13 +35,14 @@ import org.onap.so.db.catalog.beans.OrchestrationStatusStateTransitionDirective;
import org.onap.so.db.catalog.beans.OrchestrationStatusValidationDirective;
import org.onap.so.db.catalog.beans.ResourceType;
import org.onap.so.db.catalog.client.CatalogDbClient;
-import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class OrchestrationStatusValidator {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, OrchestrationStatusValidator.class);
+ private static final Logger logger = LoggerFactory.getLogger(OrchestrationStatusValidator.class);
private static final String BUILDING_BLOCK_DETAIL_NOT_FOUND = "Building Block (%s) not set up in Orchestration_Status_Validation table in CatalogDB.";
private static final String UNKNOWN_RESOURCE_TYPE = "Building Block (%s) not set up correctly in Orchestration_Status_Validation table in CatalogDB. ResourceType=(%s), TargetAction=(%s)";
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/sdno/tasks/SDNOHealthCheckTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/sdno/tasks/SDNOHealthCheckTasks.java
index 9075fcc3cf..36162af740 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/sdno/tasks/SDNOHealthCheckTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/sdno/tasks/SDNOHealthCheckTasks.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -30,13 +32,14 @@ import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext;
import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB;
import org.onap.so.client.exception.ExceptionBuilder;
import org.onap.so.client.orchestration.SDNOHealthCheckResources;
-import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class SDNOHealthCheckTasks {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, SDNOHealthCheckTasks.class);
+ private static final Logger logger = LoggerFactory.getLogger(SDNOHealthCheckTasks.class);
@Autowired
private ExceptionBuilder exceptionUtil;
@Autowired
@@ -61,12 +64,12 @@ public class SDNOHealthCheckTasks {
response = sdnoHealthCheckResources.healthCheck(vnf, requestContext);
}
catch (Exception ex) {
- msoLogger.error(ex);
+ logger.error("Exception occurred", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex.getMessage());
}
if (!response) {
- msoLogger.error("SDNO Health Check failed");
+ logger.error("SDNO Health Check failed");
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, "SDNO Health Check failed");
}
}
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 701817ab58..2559087619 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
@@ -110,8 +110,8 @@ public class VnfAdapterObjectMapper {
return deleteVolumeGroupRequest;
}
- public Map<String, String> createVolumeGroupParams(RequestContext requestContext,GenericVnf genericVnf, VolumeGroup volumeGroup, String sdncVfModuleQueryResponse) throws JsonParseException, JsonMappingException, IOException {
- Map<String, String> volumeGroupParams = new HashMap<>();
+ public Map<String, Object> createVolumeGroupParams(RequestContext requestContext,GenericVnf genericVnf, VolumeGroup volumeGroup, String sdncVfModuleQueryResponse) throws JsonParseException, JsonMappingException, IOException {
+ Map<String, Object> volumeGroupParams = new HashMap<>();
final String USER_PARAM_NAME_KEY = "name";
final String USER_PARAM_VALUE_KEY = "value";
// sdncVfModuleQueryResponse will not be available in aLaCarte case
@@ -147,7 +147,7 @@ public class VnfAdapterObjectMapper {
return msoRequest;
}
- private void buildParamsMapFromSdncParams(Map<String,String> volumeGroupParams, GenericResourceApiParam sdncParameters) {
+ private void buildParamsMapFromSdncParams(Map<String,Object> volumeGroupParams, GenericResourceApiParam sdncParameters) {
if (sdncParameters != null) {
List<GenericResourceApiParamParam> sdncParametersList = sdncParameters.getParam();
if (sdncParametersList != null) {
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 352d4ec7d1..98174d59b6 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
@@ -161,7 +161,7 @@ public class VnfAdapterVfModuleObjectMapper {
return msoRequest;
}
- private Map<String,String> buildVfModuleParamsMap(RequestContext requestContext, ServiceInstance serviceInstance, GenericVnf genericVnf,
+ private Map<String,Object> buildVfModuleParamsMap(RequestContext requestContext, ServiceInstance serviceInstance, GenericVnf genericVnf,
VfModule vfModule, String sdncVnfQueryResponse, String sdncVfModuleQueryResponse) throws JsonParseException, JsonMappingException, IOException {
@@ -169,7 +169,7 @@ public class VnfAdapterVfModuleObjectMapper {
GenericResourceApiVfModuleTopology vfModuleTop = mapper.readValue(sdncVfModuleQueryResponse, GenericResourceApiVfModuleTopology.class);
GenericResourceApiVnftopologyVnfTopology vnfTopology = vnfTop.getVnfTopology();
GenericResourceApiVfmoduletopologyVfModuleTopology vfModuleTopology = vfModuleTop.getVfModuleTopology();
- Map<String,String> paramsMap = new HashMap<>();
+ Map<String,Object> paramsMap = new HashMap<>();
if( vfModuleTopology.getSdncGeneratedCloudResources()) {
buildParamsMapFromVfModuleSdncResponse(paramsMap, vfModuleTopology, true);
@@ -184,17 +184,15 @@ public class VnfAdapterVfModuleObjectMapper {
buildMandatoryParamsMap(paramsMap, serviceInstance, genericVnf, vfModule);
// Parameters received from the request should overwrite any parameters received from SDNC
+ paramsMap.putAll(requestContext.getUserParams());
- if (requestContext.getUserParams() != null) {
- paramsMap.putAll(requestContext.getUserParams());
- }
if (vfModule.getCloudParams() != null) {
paramsMap.putAll(vfModule.getCloudParams());
}
return paramsMap;
}
- private void buildMandatoryParamsMap(Map<String,String> paramsMap, ServiceInstance serviceInstance, GenericVnf genericVnf, VfModule vfModule) {
+ private void buildMandatoryParamsMap(Map<String,Object> paramsMap, ServiceInstance serviceInstance, GenericVnf genericVnf, VfModule vfModule) {
paramsMap.put("vnf_id", genericVnf.getVnfId());
paramsMap.put("vnf_name", genericVnf.getVnfName());
paramsMap.put("vf_module_id", vfModule.getVfModuleId());
@@ -209,7 +207,7 @@ public class VnfAdapterVfModuleObjectMapper {
}
}
- private void buildParamsMapFromVnfSdncResponse(Map<String,String> paramsMap, GenericResourceApiVnftopologyVnfTopology vnfTopology, Map<String,String> networkRoleMap, boolean skipVnfResourceAssignments) throws JsonParseException, JsonMappingException, IOException {
+ private void buildParamsMapFromVnfSdncResponse(Map<String,Object> paramsMap, GenericResourceApiVnftopologyVnfTopology vnfTopology, Map<String,String> networkRoleMap, boolean skipVnfResourceAssignments) throws JsonParseException, JsonMappingException, IOException {
// Get VNF parameters from SDNC response
GenericResourceApiParam vnfParametersData = vnfTopology.getVnfParametersData();
buildParamsMapFromSdncParams(paramsMap, vnfParametersData);
@@ -225,7 +223,7 @@ public class VnfAdapterVfModuleObjectMapper {
}
}
- private void buildAvailabilityZones (Map<String,String> paramsMap, GenericResourceApiVnfresourceassignmentsVnfResourceAssignments vnfResourceAssignments) {
+ private void buildAvailabilityZones (Map<String,Object> paramsMap, GenericResourceApiVnfresourceassignmentsVnfResourceAssignments vnfResourceAssignments) {
GenericResourceApiVnfresourceassignmentsVnfresourceassignmentsAvailabilityZones availabilityZones = vnfResourceAssignments.getAvailabilityZones();
if (availabilityZones != null) {
List<String> availabilityZonesList = availabilityZones.getAvailabilityZone();
@@ -237,7 +235,7 @@ public class VnfAdapterVfModuleObjectMapper {
}
}
- private void buildVnfNetworks (Map<String,String> paramsMap, GenericResourceApiVnfresourceassignmentsVnfResourceAssignments vnfResourceAssignments, Map<String,String> networkRoleMap) {
+ private void buildVnfNetworks (Map<String,Object> paramsMap, GenericResourceApiVnfresourceassignmentsVnfResourceAssignments vnfResourceAssignments, Map<String,String> networkRoleMap) {
GenericResourceApiVnfresourceassignmentsVnfresourceassignmentsVnfNetworks vnfNetworks = vnfResourceAssignments.getVnfNetworks();
if (vnfNetworks != null) {
List<GenericResourceApiVnfNetworkData> vnfNetworksList = vnfNetworks.getVnfNetwork();
@@ -264,7 +262,7 @@ public class VnfAdapterVfModuleObjectMapper {
}
}
- private void buildVnfNetworkSubnets(Map<String,String> paramsMap, GenericResourceApiVnfNetworkData vnfNetwork, String vnfNetworkKey) {
+ private void buildVnfNetworkSubnets(Map<String,Object> paramsMap, GenericResourceApiVnfNetworkData vnfNetwork, String vnfNetworkKey) {
String vnfNetworkString = convertToString(vnfNetwork);
Optional<String> ipv4Ips = jsonPath.locateResult(vnfNetworkString, "$.subnets-data.subnet-data[*].[?(@.ip-version == 'ipv4' && @.dhcp-enabled == 'Y')].subnet-id");
if(ipv4Ips.isPresent())
@@ -275,7 +273,7 @@ public class VnfAdapterVfModuleObjectMapper {
addPairToMap(paramsMap, vnfNetworkKey, V6_SUBNET_ID, ipv6Ips.get());
}
- private void buildParamsMapFromVfModuleSdncResponse(Map<String,String> paramsMap, GenericResourceApiVfmoduletopologyVfModuleTopology vfModuleTopology, boolean skipVfModuleAssignments) throws JsonParseException, JsonMappingException, IOException {
+ private void buildParamsMapFromVfModuleSdncResponse(Map<String,Object> paramsMap, GenericResourceApiVfmoduletopologyVfModuleTopology vfModuleTopology, boolean skipVfModuleAssignments) throws JsonParseException, JsonMappingException, IOException {
// Get VF Module parameters from SDNC response
GenericResourceApiParam vfModuleParametersData = vfModuleTopology.getVfModuleParameters();
buildParamsMapFromSdncParams(paramsMap, vfModuleParametersData);
@@ -322,7 +320,7 @@ public class VnfAdapterVfModuleObjectMapper {
}
}
- protected void buildVlanInformation(Map<String, String> paramsMap,
+ protected void buildVlanInformation(Map<String, Object> paramsMap,
GenericResourceApiVmNetworkData network, String key, String networkKey) {
String networkString = convertToString(network);
@@ -352,7 +350,7 @@ public class VnfAdapterVfModuleObjectMapper {
}
}
- private void buildVfModuleVmNames(Map<String,String> paramsMap, GenericResourceApiVmTopologyData vm, String key) {
+ private void buildVfModuleVmNames(Map<String,Object> paramsMap, GenericResourceApiVmTopologyData vm, String key) {
String values = "";
GenericResourceApiVmtopologydataVmNames vmNames = vm.getVmNames();
if (vmNames != null) {
@@ -373,7 +371,7 @@ public class VnfAdapterVfModuleObjectMapper {
}
}
- private void buildVfModuleFloatingIps(Map<String,String> paramsMap, GenericResourceApiVmNetworkData network, String key, String networkKey) {
+ private void buildVfModuleFloatingIps(Map<String,Object> paramsMap, GenericResourceApiVmNetworkData network, String key, String networkKey) {
GenericResourceApiVmnetworkdataFloatingIps floatingIps = network.getFloatingIps();
if (floatingIps != null) {
List<String> floatingIpV4List = floatingIps.getFloatingIpV4();
@@ -397,7 +395,7 @@ public class VnfAdapterVfModuleObjectMapper {
}
}
- private void buildVfModuleInterfaceRoutePrefixes(Map<String,String> paramsMap, GenericResourceApiVmNetworkData network, String key, String networkKey) {
+ private void buildVfModuleInterfaceRoutePrefixes(Map<String,Object> paramsMap, GenericResourceApiVmNetworkData network, String key, String networkKey) {
GenericResourceApiVmnetworkdataInterfaceRoutePrefixes interfaceRoutePrefixes = network.getInterfaceRoutePrefixes();
if (interfaceRoutePrefixes != null) {
List<String> interfaceRoutePrefixesList = interfaceRoutePrefixes.getInterfaceRoutePrefix();
@@ -421,7 +419,7 @@ public class VnfAdapterVfModuleObjectMapper {
}
}
- private void buildVfModuleSriovParameters(Map<String,String> paramsMap, GenericResourceApiVmNetworkData network, String networkKey) {
+ private void buildVfModuleSriovParameters(Map<String,Object> paramsMap, GenericResourceApiVmNetworkData network, String networkKey) {
// SRIOV Parameters
GenericResourceApiVmnetworkdataSriovParameters sriovParameters = network.getSriovParameters();
if (sriovParameters != null) {
@@ -447,7 +445,7 @@ public class VnfAdapterVfModuleObjectMapper {
}
}
- private void buildVfModuleNetworkInformation(Map<String,String> paramsMap, GenericResourceApiVmNetworkData network, String key, String networkKey) {
+ private void buildVfModuleNetworkInformation(Map<String,Object> paramsMap, GenericResourceApiVmNetworkData network, String key, String networkKey) {
GenericResourceApiVmnetworkdataNetworkInformationItems networkInformationItems = network.getNetworkInformationItems();
StringBuilder sbIpv4Ips = new StringBuilder();
@@ -500,7 +498,7 @@ public class VnfAdapterVfModuleObjectMapper {
* Build Count of SubInterfaces, VLAN Tag, network_name, network_id,
* ip_address (V4 and V6) and Floating IPs Addresses (V4 and V6) for Heat Template
*/
- private void buildParamsMapFromVfModuleForHeatTemplate(Map<String,String> paramsMap, GenericResourceApiVmTopologyData vm) {
+ private void buildParamsMapFromVfModuleForHeatTemplate(Map<String,Object> paramsMap, GenericResourceApiVmTopologyData vm) {
GenericResourceApiVmtopologydataVmNames vmNames = vm.getVmNames();
if (vmNames != null) {
@@ -520,7 +518,7 @@ public class VnfAdapterVfModuleObjectMapper {
/*
* Parse vnfcNames data to build Mapping from GenericResourceApi SDNC for Heat Template.
*/
- private void parseVnfcNamesData(Map<String,String> paramsMap, GenericResourceApiVmtopologydataVmnamesVnfcNames vnfcNames) {
+ private void parseVnfcNamesData(Map<String,Object> paramsMap, GenericResourceApiVmtopologydataVmnamesVnfcNames vnfcNames) {
if (vnfcNames != null) {
GenericResourceApiVnfcNetworkData vnfcNetworks = vnfcNames.getVnfcNetworks();
@@ -544,7 +542,7 @@ public class VnfAdapterVfModuleObjectMapper {
* Build Count of SubInterfaces, VLAN Tag, network_name, network_id,
* ip_address (V4 and V6) and Floating IPs Addresses (V4 and V6) for Heat Template
*/
- private void parseVnfcNetworkData(Map<String,String> paramsMap, GenericResourceApiVnfcnetworkdataVnfcNetworkData vnfcNetworkdata, int networkDataIdx) {
+ private void parseVnfcNetworkData(Map<String,Object> paramsMap, GenericResourceApiVnfcnetworkdataVnfcNetworkData vnfcNetworkdata, int networkDataIdx) {
String vmTypeKey = vnfcNetworkdata.getVnfcType();
GenericResourceApiVnfcnetworkdataVnfcnetworkdataVnfcPorts vnfcPorts = vnfcNetworkdata.getVnfcPorts();
@@ -588,7 +586,7 @@ public class VnfAdapterVfModuleObjectMapper {
* Example: fw_subint_ctrl_port_0_subintcount
*
*/
- private void buildVfModuleSubInterfacesCount(Map<String,String> paramsMap, String keyPrefix, GenericResourceApiSubInterfaceNetworkData vnicSubInterfaces) {
+ private void buildVfModuleSubInterfacesCount(Map<String,Object> paramsMap, String keyPrefix, GenericResourceApiSubInterfaceNetworkData vnicSubInterfaces) {
List<GenericResourceApiSubinterfacenetworkdataSubInterfaceNetworkData> subInterfaceNetworkDataList = vnicSubInterfaces.getSubInterfaceNetworkData();
@@ -614,7 +612,7 @@ public class VnfAdapterVfModuleObjectMapper {
* Example: fw_0_subint_ctrl_port_0_vlan_ids
*
*/
- protected void buildVfModuleVlanTag(Map<String,String> paramsMap, String keyPrefix, String vnicSubInterfaces) {
+ protected void buildVfModuleVlanTag(Map<String,Object> paramsMap, String keyPrefix, String vnicSubInterfaces) {
List<String> vlanTagIds = jsonPath.locateResultList(vnicSubInterfaces, "$.sub-interface-network-data[*].vlan-tag-id");
@@ -627,7 +625,7 @@ public class VnfAdapterVfModuleObjectMapper {
* Example: fw_0_subint_ctrl_port_0_net_names
*
*/
- protected void buildVfModuleNetworkName(Map<String,String> paramsMap, String keyPrefix, String vnicSubInterfaces) {
+ protected void buildVfModuleNetworkName(Map<String,Object> paramsMap, String keyPrefix, String vnicSubInterfaces) {
List<String> neworkNames = jsonPath.locateResultList(vnicSubInterfaces, "$.sub-interface-network-data[*].network-name");
@@ -641,7 +639,7 @@ public class VnfAdapterVfModuleObjectMapper {
* Example: fw_0_subint_ctrl_port_0_net_ids
*
*/
- protected void buildVfModuleNetworkId(Map<String,String> paramsMap, String keyPrefix, String vnicSubInterfaces) {
+ protected void buildVfModuleNetworkId(Map<String,Object> paramsMap, String keyPrefix, String vnicSubInterfaces) {
List<String> neworkIds = jsonPath.locateResultList(vnicSubInterfaces, "$.sub-interface-network-data[*].network-id");
@@ -654,7 +652,7 @@ public class VnfAdapterVfModuleObjectMapper {
* {vm-type}_{index}_subint_{network-role}_port_{index}_ip_{index} -- for ipV4
* key = vm-type, networkRoleKey = NetWork-Role
*/
- protected void buildVfModuleIpV4AddressHeatTemplate(Map<String,String> paramsMap, String keyPrefix, String vnicSubInterfaces) {
+ protected void buildVfModuleIpV4AddressHeatTemplate(Map<String,Object> paramsMap, String keyPrefix, String vnicSubInterfaces) {
List<String> ipv4Ips = jsonPath.locateResultList(vnicSubInterfaces, "$.sub-interface-network-data[*].network-information-items.network-information-item[?(@.ip-version == 'ipv4')].network-ips.network-ip[*]");
@@ -672,7 +670,7 @@ public class VnfAdapterVfModuleObjectMapper {
* {vm-type}_{index}_subint_{network-role}_port_{index}_v6_ip_{index} -- for ipV6
* key = vm-type, networkRoleKey = NetWork-Role
*/
- protected void buildVfModuleIpV6AddressHeatTemplate(Map<String,String> paramsMap, String keyPrefix, String vnicSubInterfaces) {
+ protected void buildVfModuleIpV6AddressHeatTemplate(Map<String,Object> paramsMap, String keyPrefix, String vnicSubInterfaces) {
List<String> ipv6Ips = jsonPath.locateResultList(vnicSubInterfaces, "$.sub-interface-network-data[*].network-information-items.network-information-item[?(@.ip-version == 'ipv6')].network-ips.network-ip[*]");
@@ -688,7 +686,7 @@ public class VnfAdapterVfModuleObjectMapper {
* Building Criteria :
* {vm-type}_subint_{network-role}_port_{index}_floating_ip -- for ipV4
*/
- protected void buildVfModuleFloatingIpV4HeatTemplate(Map<String,String> paramsMap, String keyPrefix, String vnicSubInterfaces) {
+ protected void buildVfModuleFloatingIpV4HeatTemplate(Map<String,Object> paramsMap, String keyPrefix, String vnicSubInterfaces) {
List<String> floatingV4 = jsonPath.locateResultList(vnicSubInterfaces, "$.sub-interface-network-data[*].floating-ips.floating-ip-v4[*]");
@@ -704,7 +702,7 @@ public class VnfAdapterVfModuleObjectMapper {
* Building Criteria :
* {vm-type}_subint_{network-role}_port_{index}_floating_v6_ip -- for ipV6
*/
- protected void buildVfModuleFloatingIpV6HeatTemplate(Map<String,String> paramsMap, String keyPrefix, String vnicSubInterfaces) {
+ protected void buildVfModuleFloatingIpV6HeatTemplate(Map<String,Object> paramsMap, String keyPrefix, String vnicSubInterfaces) {
List<String> floatingV6 = jsonPath.locateResultList(vnicSubInterfaces, "$.sub-interface-network-data[*].floating-ips.floating-ip-v6[*]");
@@ -714,19 +712,19 @@ public class VnfAdapterVfModuleObjectMapper {
addPairToMap(paramsMap, keyPrefix, FLOATING_V6_IP, floatingV6);
}
- protected void addPairToMap(Map<String, String> paramsMap, String keyPrefix, String key, String value) {
+ protected void addPairToMap(Map<String, Object> paramsMap, String keyPrefix, String key, String value) {
addPairToMap(paramsMap, keyPrefix, key, Collections.singletonList(value));
}
- protected void addPairToMap(Map<String, String> paramsMap, String keyPrefix, String key, List<String> value) {
+ protected void addPairToMap(Map<String, Object> paramsMap, String keyPrefix, String key, List<String> value) {
if (!value.isEmpty()) {
paramsMap.put(keyPrefix + key, Joiner.on(",").join(value));
}
}
- private void buildParamsMapFromSdncParams(Map<String,String> paramsMap, GenericResourceApiParam parametersData) {
+ private void buildParamsMapFromSdncParams(Map<String,Object> paramsMap, GenericResourceApiParam parametersData) {
if (parametersData != null) {
List<GenericResourceApiParamParam> paramsList = parametersData.getParam();
if (paramsList != null) {
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/namingservice/NamingClient.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/namingservice/NamingClient.java
index 0419896444..9613fbdcf1 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/namingservice/NamingClient.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/namingservice/NamingClient.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 - 2019 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -29,7 +31,8 @@ import org.onap.namingservice.model.NameGenDeleteResponse;
import org.onap.namingservice.model.NameGenRequest;
import org.onap.namingservice.model.NameGenResponse;
import org.onap.so.client.exception.BadResponseException;
-import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.http.HttpEntity;
@@ -45,7 +48,7 @@ import org.springframework.web.client.RestTemplate;
@Component
public class NamingClient{
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, NamingClient.class);
+ private static final Logger logger = LoggerFactory.getLogger(NamingClient.class);
private static final String ENDPOINT = "mso.naming.endpoint";
private static final String AUTH = "mso.naming.auth";
@@ -59,7 +62,7 @@ public class NamingClient{
public String postNameGenRequest(NameGenRequest request) throws BadResponseException, IOException {
String targetUrl = env.getProperty(ENDPOINT);
HttpHeaders headers = setHeaders(env.getProperty(AUTH));
- msoLogger.info("Sending postNameGenRequest to url: " + targetUrl);
+ logger.info("Sending postNameGenRequest to url: {}", targetUrl);
HttpEntity<NameGenRequest> requestEntity = new HttpEntity<>(request, headers);
ResponseEntity<NameGenResponse> response;
try{
@@ -73,7 +76,7 @@ public class NamingClient{
public String deleteNameGenRequest(NameGenDeleteRequest request) throws BadResponseException, IOException {
String targetUrl = env.getProperty(ENDPOINT);
HttpHeaders headers = setHeaders(env.getProperty(AUTH));
- msoLogger.info("Sending deleteNameGenRequest to url: " + targetUrl);
+ logger.info("Sending deleteNameGenRequest to url: {}", targetUrl);
HttpEntity<NameGenDeleteRequest> requestEntity = new HttpEntity<>(request, headers);
ResponseEntity<NameGenDeleteResponse> response;
try{
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/namingservice/NamingClientResponseValidator.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/namingservice/NamingClientResponseValidator.java
index 3dcafe0ff4..787b811501 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/namingservice/NamingClientResponseValidator.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/namingservice/NamingClientResponseValidator.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 - 2019 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -31,6 +33,8 @@ import org.onap.namingservice.model.Respelement;
import org.onap.so.client.exception.BadResponseException;
import org.onap.so.logger.MessageEnum;
import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import org.springframework.web.client.HttpStatusCodeException;
@@ -39,7 +43,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
@Component
public class NamingClientResponseValidator {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, NamingClientResponseValidator.class);
+ private static final Logger logger = LoggerFactory.getLogger(NamingClientResponseValidator.class);
private static final String INSTANCE_GROUP_NAME = "instance-group-name";
private static final String NO_RESPONSE_FROM_NAMING_SERVICE = "Error did not receive a response from Naming Service.";
private static final String NULL_RESPONSE_FROM_NAMING_SERVICE = "Error received a null response from Naming Service.";
@@ -47,8 +51,9 @@ public class NamingClientResponseValidator {
public String validateNameGenResponse(ResponseEntity<NameGenResponse> response) throws BadResponseException {
if (response == null) {
- msoLogger.error(MessageEnum.RA_GENERAL_EXCEPTION, NO_RESPONSE_FROM_NAMING_SERVICE, "BPMN",
- MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, NO_RESPONSE_FROM_NAMING_SERVICE);
+ logger.error("{} {} {} {} {} {}", MessageEnum.RA_GENERAL_EXCEPTION.toString(), NO_RESPONSE_FROM_NAMING_SERVICE,
+ "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(),
+ NO_RESPONSE_FROM_NAMING_SERVICE);
throw new BadResponseException(NO_RESPONSE_FROM_NAMING_SERVICE);
}
@@ -56,13 +61,14 @@ public class NamingClientResponseValidator {
String generatedName = "";
NameGenResponse responseBody = response.getBody();
if (responseBody == null) {
- msoLogger.error(MessageEnum.RA_GENERAL_EXCEPTION, NULL_RESPONSE_FROM_NAMING_SERVICE, "BPMN",
- MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, NULL_RESPONSE_FROM_NAMING_SERVICE);
+ logger.error("{} {} {} {} {} {}", MessageEnum.RA_GENERAL_EXCEPTION.toString(), NULL_RESPONSE_FROM_NAMING_SERVICE,
+ "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(),
+ NULL_RESPONSE_FROM_NAMING_SERVICE);
throw new BadResponseException(NULL_RESPONSE_FROM_NAMING_SERVICE);
}
if (isHttpCodeSuccess(responseCode)) {
- msoLogger.info("Successful Response from Naming Service");
+ logger.info("Successful Response from Naming Service");
List<Respelement> respList = responseBody.getElements();
if (respList != null) {
@@ -85,16 +91,17 @@ public class NamingClientResponseValidator {
errorMessageString = error.getMessage();
}
String errorMessage = String.format(NAMING_SERVICE_ERROR, errorMessageString);
- msoLogger.error(MessageEnum.RA_GENERAL_EXCEPTION, errorMessage, "BPMN", MsoLogger.getServiceName(),
- MsoLogger.ErrorCode.DataError, errorMessage);
+ logger.error("{} {} {} {} {} {}", MessageEnum.RA_GENERAL_EXCEPTION.toString(), errorMessage, "BPMN",
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.DataError.getValue(), errorMessage);
throw new BadResponseException(errorMessage);
}
}
public String validateNameGenDeleteResponse(ResponseEntity<NameGenDeleteResponse> response) throws BadResponseException {
if (response == null) {
- msoLogger.error(MessageEnum.RA_GENERAL_EXCEPTION, NO_RESPONSE_FROM_NAMING_SERVICE, "BPMN",
- MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, NO_RESPONSE_FROM_NAMING_SERVICE);
+ logger.error("{} {} {} {} {} {}", MessageEnum.RA_GENERAL_EXCEPTION.toString(), NO_RESPONSE_FROM_NAMING_SERVICE,
+ "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(),
+ NO_RESPONSE_FROM_NAMING_SERVICE);
throw new BadResponseException(NO_RESPONSE_FROM_NAMING_SERVICE);
}
@@ -102,20 +109,21 @@ public class NamingClientResponseValidator {
String responseMessage = "";
NameGenDeleteResponse responseBody = response.getBody();
if (responseBody == null) {
- msoLogger.error(MessageEnum.RA_GENERAL_EXCEPTION, NULL_RESPONSE_FROM_NAMING_SERVICE, "BPMN",
- MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, NULL_RESPONSE_FROM_NAMING_SERVICE);
+ logger.error("{} {} {} {} {} {}", MessageEnum.RA_GENERAL_EXCEPTION.toString(), NULL_RESPONSE_FROM_NAMING_SERVICE,
+ "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(),
+ NULL_RESPONSE_FROM_NAMING_SERVICE);
throw new BadResponseException(NULL_RESPONSE_FROM_NAMING_SERVICE);
}
if (isHttpCodeSuccess(responseCode)) {
- msoLogger.info("Successful Response from Naming Service");
+ logger.info("Successful Response from Naming Service");
return responseMessage;
} else {
String errorMessageString = NAMING_SERVICE_ERROR;
String errorMessage = String.format(NAMING_SERVICE_ERROR, errorMessageString);
- msoLogger.error(MessageEnum.RA_GENERAL_EXCEPTION, errorMessage, "BPMN", MsoLogger.getServiceName(),
- MsoLogger.ErrorCode.DataError, errorMessage);
+ logger.error("{} {} {} {} {} {}", MessageEnum.RA_GENERAL_EXCEPTION.toString(), errorMessage, "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.DataError.getValue(), errorMessage);
throw new BadResponseException(errorMessage);
}
}
@@ -134,8 +142,8 @@ public class NamingClientResponseValidator {
errorMessageString = error.getMessage();
}
String errorMessage = String.format(NAMING_SERVICE_ERROR, errorMessageString);
- msoLogger.error(MessageEnum.RA_GENERAL_EXCEPTION, errorMessage, "BPMN", MsoLogger.getServiceName(),
- MsoLogger.ErrorCode.DataError, errorMessage);
+ logger.error("{} {} {} {} {} {}", MessageEnum.RA_GENERAL_EXCEPTION.toString(), errorMessage, "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.DataError.getValue(), errorMessage);
return errorMessage;
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIServiceInstanceResources.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIServiceInstanceResources.java
index 86dd22b65c..3032b66e6d 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIServiceInstanceResources.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIServiceInstanceResources.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -34,13 +36,15 @@ import org.onap.so.client.aai.entities.uri.AAIResourceUri;
import org.onap.so.client.aai.entities.uri.AAIUriFactory;
import org.onap.so.client.aai.mapper.AAIObjectMapper;
import org.onap.so.db.catalog.beans.OrchestrationStatus;
-import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class AAIServiceInstanceResources {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, AAIServiceInstanceResources.class);
+ private static final Logger logger = LoggerFactory.getLogger(AAIServiceInstanceResources
+ .class);
@Autowired
private InjectionHelper injectionHelper;
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIVfModuleResources.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIVfModuleResources.java
index ef61319eee..5fa73c85ff 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIVfModuleResources.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIVfModuleResources.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -32,13 +34,14 @@ import org.onap.so.client.aai.entities.uri.AAIResourceUri;
import org.onap.so.client.aai.entities.uri.AAIUriFactory;
import org.onap.so.client.aai.mapper.AAIObjectMapper;
import org.onap.so.db.catalog.beans.OrchestrationStatus;
-import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class AAIVfModuleResources {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, AAIVfModuleResources.class);
+ private static final Logger logger = LoggerFactory.getLogger(AAIVfModuleResources.class);
@Autowired
private InjectionHelper injectionHelper;
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIVnfResources.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIVnfResources.java
index a9a52bd115..0c65abfe0c 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIVnfResources.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIVnfResources.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -27,21 +29,20 @@ import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion;
import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
import org.onap.so.bpmn.servicedecomposition.bbobjects.LineOfBusiness;
import org.onap.so.bpmn.servicedecomposition.bbobjects.Platform;
-import org.onap.so.bpmn.servicedecomposition.bbobjects.Project;
import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance;
-import org.onap.so.bpmn.servicedecomposition.bbobjects.VolumeGroup;
import org.onap.so.client.aai.AAIObjectType;
import org.onap.so.client.aai.entities.uri.AAIResourceUri;
import org.onap.so.client.aai.entities.uri.AAIUriFactory;
import org.onap.so.client.aai.mapper.AAIObjectMapper;
import org.onap.so.db.catalog.beans.OrchestrationStatus;
-import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class AAIVnfResources {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, AAIVnfResources.class);
+ private static final Logger logger = LoggerFactory.getLogger(AAIVnfResources.class);
@Autowired
private InjectionHelper injectionHelper;
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIVolumeGroupResources.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIVolumeGroupResources.java
index af97e55c14..7bb96ec2ed 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIVolumeGroupResources.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIVolumeGroupResources.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -29,13 +31,14 @@ import org.onap.so.client.aai.entities.uri.AAIResourceUri;
import org.onap.so.client.aai.entities.uri.AAIUriFactory;
import org.onap.so.client.aai.mapper.AAIObjectMapper;
import org.onap.so.db.catalog.beans.OrchestrationStatus;
-import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class AAIVolumeGroupResources {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, AAIVolumeGroupResources.class);
+ private static final Logger logger = LoggerFactory.getLogger(AAIVolumeGroupResources.class);
@Autowired
private InjectionHelper injectionHelper;
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/NamingServiceResources.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/NamingServiceResources.java
index d0bf6da6c9..2a25ec5ba1 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/NamingServiceResources.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/NamingServiceResources.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -30,13 +32,14 @@ import org.onap.so.bpmn.servicedecomposition.bbobjects.InstanceGroup;
import org.onap.so.client.exception.BadResponseException;
import org.onap.so.client.namingservice.NamingClient;
import org.onap.so.client.namingservice.NamingRequestObjectBuilder;
-import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class NamingServiceResources {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, NamingServiceResources.class);
+ private static final Logger logger = LoggerFactory.getLogger(NamingServiceResources.class);
private static final String NAMING_TYPE = "instanceGroup";
@Autowired
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCNetworkResources.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCNetworkResources.java
index 8b53c28547..fb828c1981 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCNetworkResources.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCNetworkResources.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -30,14 +32,14 @@ import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext;
import org.onap.so.client.sdnc.beans.SDNCSvcAction;
import org.onap.so.client.sdnc.beans.SDNCSvcOperation;
import org.onap.so.client.sdnc.mapper.NetworkTopologyOperationRequestMapper;
-import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class SDNCNetworkResources {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL,
- SDNCNetworkResources.class);
+ private static final Logger logger = LoggerFactory.getLogger(SDNCNetworkResources.class);
@Autowired
private NetworkTopologyOperationRequestMapper sdncRM;
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCVfModuleResources.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCVfModuleResources.java
index e7f0a40d2a..1e3d655298 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCVfModuleResources.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCVfModuleResources.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -34,14 +36,14 @@ import org.onap.so.client.sdnc.SDNCClient;
import org.onap.so.client.sdnc.beans.SDNCSvcAction;
import org.onap.so.client.sdnc.beans.SDNCSvcOperation;
import org.onap.so.client.sdnc.mapper.VfModuleTopologyOperationRequestMapper;
-import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class SDNCVfModuleResources {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL,
- SDNCVfModuleResources.class);
+ private static final Logger logger = LoggerFactory.getLogger(SDNCVfModuleResources.class);
@Autowired
private VfModuleTopologyOperationRequestMapper sdncRM;
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCVnfResources.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCVnfResources.java
index e5194e3e37..d8f2e47224 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCVnfResources.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCVnfResources.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -33,13 +35,14 @@ import org.onap.so.client.sdnc.SDNCClient;
import org.onap.so.client.sdnc.beans.SDNCSvcAction;
import org.onap.so.client.sdnc.beans.SDNCSvcOperation;
import org.onap.so.client.sdnc.mapper.VnfTopologyOperationRequestMapper;
-import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class SDNCVnfResources {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, SDNCVnfResources.class);
+ private static final Logger logger = LoggerFactory.getLogger(SDNCVnfResources.class);
@Autowired
private VnfTopologyOperationRequestMapper sdncRM;
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/VnfAdapterVfModuleResources.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/VnfAdapterVfModuleResources.java
index 2d9032c7c0..de59e6835e 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/VnfAdapterVfModuleResources.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/VnfAdapterVfModuleResources.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -32,13 +34,14 @@ import org.onap.so.bpmn.servicedecomposition.bbobjects.VolumeGroup;
import org.onap.so.bpmn.servicedecomposition.generalobjects.OrchestrationContext;
import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext;
import org.onap.so.client.adapter.vnf.mapper.VnfAdapterVfModuleObjectMapper;
-import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class VnfAdapterVfModuleResources {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, VnfAdapterVfModuleResources.class);
+ private static final Logger logger = LoggerFactory.getLogger(VnfAdapterVfModuleResources.class);
@Autowired
private VnfAdapterVfModuleObjectMapper vnfAdapterVfModuleObjectMapper;
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/VnfAdapterVolumeGroupResources.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/VnfAdapterVolumeGroupResources.java
index efbbeae737..737e9eeb37 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/VnfAdapterVolumeGroupResources.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/VnfAdapterVolumeGroupResources.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -30,13 +32,14 @@ import org.onap.so.bpmn.servicedecomposition.generalobjects.OrchestrationContext
import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext;
import org.onap.so.client.adapter.vnf.VnfVolumeAdapterClientImpl;
import org.onap.so.client.adapter.vnf.mapper.VnfAdapterObjectMapper;
-import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class VnfAdapterVolumeGroupResources {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, VnfAdapterVolumeGroupResources.class);
+ private static final Logger logger = LoggerFactory.getLogger(VnfAdapterVolumeGroupResources.class);
@Autowired
private VnfAdapterObjectMapper vnfAdapterObjectMapper;
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SDNCClient.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SDNCClient.java
index 7ad2ef00b2..99d5fca31f 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SDNCClient.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SDNCClient.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -29,7 +31,8 @@ import org.onap.so.client.exception.BadResponseException;
import org.onap.so.client.exception.MapperException;
import org.onap.so.client.sdnc.beans.SDNCProperties;
import org.onap.so.client.sdnc.endpoint.SDNCTopology;
-import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpHeaders;
@@ -38,7 +41,7 @@ import org.springframework.stereotype.Component;
@Component
public class SDNCClient {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, SDNCClient.class);
+ private static final Logger logger = LoggerFactory.getLogger(SDNCClient.class);
private BaseClient<String, LinkedHashMap<String, Object>> STOClient = new BaseClient<>();
@Autowired
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SdnCommonTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SdnCommonTasks.java
index 13ba107576..2f9c8da5f0 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SdnCommonTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SdnCommonTasks.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -30,6 +32,8 @@ import org.onap.so.client.exception.BadResponseException;
import org.onap.so.client.exception.MapperException;
import org.onap.so.logger.MessageEnum;
import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Component;
@@ -42,7 +46,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
@Component
public class SdnCommonTasks {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, SDNCClient.class);
+ private static final Logger logger = LoggerFactory.getLogger(SDNCClient.class);
private static final String RESPONSE_CODE = "response-code";
private static final String RESPONSE_MESSAGE = "response-message";
private static final String NO_RESPONSE_FROM_SDNC = "Error did not receive a response from SDNC.";
@@ -63,11 +67,13 @@ public class SdnCommonTasks {
try {
jsonRequest = objMapper.writerWithDefaultPrettyPrinter().writeValueAsString(request);
} catch (JsonProcessingException e) {
- msoLogger.error(MessageEnum.JAXB_EXCEPTION, COULD_NOT_CONVERT_SDNC_POJO_TO_JSON, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.DataError, e.getMessage());
+ logger.error("{} {} {} {} {} {}", MessageEnum.JAXB_EXCEPTION.toString(),
+ COULD_NOT_CONVERT_SDNC_POJO_TO_JSON,
+ "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.DataError.getValue(), e.getMessage());
throw new MapperException(COULD_NOT_CONVERT_SDNC_POJO_TO_JSON);
}
jsonRequest = "{\"input\":" + jsonRequest + "}";
- msoLogger.info(jsonRequest);
+ logger.info(jsonRequest);
return jsonRequest;
}
@@ -94,8 +100,8 @@ public class SdnCommonTasks {
*/
public String validateSDNResponse(LinkedHashMap<String, Object> output) throws BadResponseException {
if (CollectionUtils.isEmpty(output)) {
- msoLogger.error(MessageEnum.RA_RESPONSE_FROM_SDNC, NO_RESPONSE_FROM_SDNC, "BPMN",
- MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, NO_RESPONSE_FROM_SDNC);
+ logger.error("{} {} {} {} {} {}", MessageEnum.RA_RESPONSE_FROM_SDNC.toString(), NO_RESPONSE_FROM_SDNC, "BPMN",
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), NO_RESPONSE_FROM_SDNC);
throw new BadResponseException(NO_RESPONSE_FROM_SDNC);
}
LinkedHashMap<String, Object> embeddedResponse =(LinkedHashMap<String, Object>) output.get("output");
@@ -109,21 +115,21 @@ public class SdnCommonTasks {
String jsonResponse;
try {
jsonResponse = objMapper.writeValueAsString(output);
- msoLogger.debug(jsonResponse);
+ logger.debug(jsonResponse);
} catch (JsonProcessingException e) {
- msoLogger.warnSimple("Could not convert SDNC Response to String", e);
+ logger.warn("Could not convert SDNC Response to String", e);
jsonResponse = "";
}
- msoLogger.info("ResponseCode: " + responseCode + " ResponseMessage: " + responseMessage);
+ logger.info("ResponseCode: {} ResponseMessage: {}", responseCode, responseMessage);
int code = StringUtils.isNotEmpty(responseCode) ? Integer.parseInt(responseCode) : 0;
if (isHttpCodeSuccess(code)) {
- msoLogger.info("Successful Response from SDNC");
+ logger.info("Successful Response from SDNC");
return jsonResponse;
} else {
String errorMessage = String.format(SDNC_CODE_NOT_0_OR_IN_200_299, responseMessage);
- msoLogger.error(MessageEnum.RA_RESPONSE_FROM_SDNC, errorMessage, "BPMN", MsoLogger.getServiceName(),
- MsoLogger.ErrorCode.DataError, errorMessage);
- throw new BadResponseException(errorMessage);
+ logger.error("{} {} {} {} {} {}", MessageEnum.RA_RESPONSE_FROM_SDNC.toString(), errorMessage, "BPMN",
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.DataError.getValue(), errorMessage);
+ throw new BadResponseException(errorMessage);
}
}
@@ -135,20 +141,23 @@ public class SdnCommonTasks {
*/
public String validateSDNGetResponse(LinkedHashMap<String, Object> output) throws BadResponseException {
if (CollectionUtils.isEmpty(output)) {
- msoLogger.error(MessageEnum.RA_RESPONSE_FROM_SDNC, NO_RESPONSE_FROM_SDNC, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, NO_RESPONSE_FROM_SDNC);
+ logger.error("{} {} {} {} {} {}", MessageEnum.RA_RESPONSE_FROM_SDNC.toString(), NO_RESPONSE_FROM_SDNC, "BPMN",
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), NO_RESPONSE_FROM_SDNC);
throw new BadResponseException(NO_RESPONSE_FROM_SDNC);
}
ObjectMapper objMapper = new ObjectMapper();
- msoLogger.debug("Using object mapper");
+ logger.debug("Using object mapper");
String stringOutput = "";
try {
stringOutput = objMapper.writeValueAsString(output);
}
catch (Exception e) {
- msoLogger.error(MessageEnum.RA_RESPONSE_FROM_SDNC, BAD_RESPONSE_FROM_SDNC, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, BAD_RESPONSE_FROM_SDNC);
+ logger.error("{} {} {} {} {} {}", MessageEnum.RA_RESPONSE_FROM_SDNC.toString(), BAD_RESPONSE_FROM_SDNC,
+ "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(),
+ BAD_RESPONSE_FROM_SDNC);
throw new BadResponseException(BAD_RESPONSE_FROM_SDNC);
}
- msoLogger.debug("Received from GET request: " + stringOutput);
+ logger.debug("Received from GET request: {}", stringOutput);
return stringOutput;
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/GCTopologyOperationRequestMapper.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/GCTopologyOperationRequestMapper.java
index 2cd0947fa8..e46c456f88 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/GCTopologyOperationRequestMapper.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/GCTopologyOperationRequestMapper.java
@@ -22,16 +22,27 @@ package org.onap.so.client.sdnc.mapper;
import java.net.URI;
-import org.onap.sdnc.northbound.client.model.*;
-import org.onap.so.bpmn.servicedecomposition.bbobjects.*;
+import org.onap.sdnc.northbound.client.model.GenericResourceApiConfigurationinformationConfigurationInformation;
+import org.onap.sdnc.northbound.client.model.GenericResourceApiGcTopologyOperationInformation;
+import org.onap.sdnc.northbound.client.model.GenericResourceApiGcrequestinputGcRequestInput;
+import org.onap.sdnc.northbound.client.model.GenericResourceApiRequestActionEnumeration;
+import org.onap.sdnc.northbound.client.model.GenericResourceApiRequestinformationRequestInformation;
+import org.onap.sdnc.northbound.client.model.GenericResourceApiSdncrequestheaderSdncRequestHeader;
+import org.onap.sdnc.northbound.client.model.GenericResourceApiServiceinformationServiceInformation;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.Configuration;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.Customer;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance;
import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext;
import org.onap.so.client.sdnc.beans.SDNCSvcAction;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component(value = "sdncGCTopologyOperationRequestMapper")
public class GCTopologyOperationRequestMapper {
- private static final GeneralTopologyObjectMapper generalTopologyObjectMapper = new GeneralTopologyObjectMapper();
+ @Autowired
+ private GeneralTopologyObjectMapper generalTopologyObjectMapper;
public GenericResourceApiGcTopologyOperationInformation assignOrActivateVnrReqMapper(SDNCSvcAction svcAction,
GenericResourceApiRequestActionEnumeration reqAction,
@@ -82,5 +93,4 @@ public class GCTopologyOperationRequestMapper {
}
-
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/GeneralTopologyObjectMapper.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/GeneralTopologyObjectMapper.java
index 7632831111..fedbde251e 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/GeneralTopologyObjectMapper.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/GeneralTopologyObjectMapper.java
@@ -20,18 +20,42 @@
package org.onap.so.client.sdnc.mapper;
-import org.onap.sdnc.northbound.client.model.*;
-import org.onap.so.bpmn.servicedecomposition.bbobjects.*;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.onap.sdnc.northbound.client.model.GenericResourceApiConfigurationinformationConfigurationInformation;
+import org.onap.sdnc.northbound.client.model.GenericResourceApiGcrequestinputGcRequestInput;
+import org.onap.sdnc.northbound.client.model.GenericResourceApiNetworkinformationNetworkInformation;
+import org.onap.sdnc.northbound.client.model.GenericResourceApiOnapmodelinformationOnapModelInformation;
+import org.onap.sdnc.northbound.client.model.GenericResourceApiParam;
+import org.onap.sdnc.northbound.client.model.GenericResourceApiRequestActionEnumeration;
+import org.onap.sdnc.northbound.client.model.GenericResourceApiRequestinformationRequestInformation;
+import org.onap.sdnc.northbound.client.model.GenericResourceApiSdncrequestheaderSdncRequestHeader;
+import org.onap.sdnc.northbound.client.model.GenericResourceApiServiceinformationServiceInformation;
+import org.onap.sdnc.northbound.client.model.GenericResourceApiVfmoduleinformationVfModuleInformation;
+import org.onap.sdnc.northbound.client.model.GenericResourceApiVnfinformationVnfInformation;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.Configuration;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.Customer;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.L3Network;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule;
import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext;
+import org.onap.so.client.exception.MapperException;
import org.onap.so.client.sdnc.beans.SDNCSvcAction;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.core.env.Environment;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
-import org.onap.so.client.exception.MapperException;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
@Component
public class GeneralTopologyObjectMapper {
+ private static final Logger logger = LoggerFactory.getLogger(GeneralTopologyObjectMapper.class);
+ private ObjectMapper mapper = new ObjectMapper();
/*
* Build GenericResourceApiRequestinformationRequestInformation
@@ -194,4 +218,22 @@ public class GeneralTopologyObjectMapper {
}
return gcRequestInput;
}
+
+
+ public String mapUserParamValue(Object value) {
+ if (value == null) {
+ return null;
+ } else {
+ if (value instanceof Map || value instanceof Set || value instanceof List) {
+ try {
+ return mapper.writeValueAsString(value);
+ } catch (JsonProcessingException e) {
+ logger.error("could not map value to string", e);
+ throw new IllegalArgumentException(e);
+ }
+ } else {
+ return value.toString();
+ }
+ }
+ }
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/NetworkTopologyOperationRequestMapper.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/NetworkTopologyOperationRequestMapper.java
index 2b4834af42..188a228e5d 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/NetworkTopologyOperationRequestMapper.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/NetworkTopologyOperationRequestMapper.java
@@ -23,15 +23,6 @@ package org.onap.so.client.sdnc.mapper;
import java.util.Map;
import java.util.UUID;
-import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion;
-import org.onap.so.bpmn.servicedecomposition.bbobjects.Customer;
-import org.onap.so.bpmn.servicedecomposition.bbobjects.L3Network;
-import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance;
-import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext;
-import org.onap.so.client.sdnc.beans.SDNCSvcAction;
-import org.onap.so.client.sdnc.beans.SDNCSvcOperation;
-import org.springframework.stereotype.Component;
-
import org.onap.sdnc.northbound.client.model.GenericResourceApiNetworkOperationInformation;
import org.onap.sdnc.northbound.client.model.GenericResourceApiNetworkinformationNetworkInformation;
import org.onap.sdnc.northbound.client.model.GenericResourceApiNetworkrequestinputNetworkRequestInput;
@@ -41,6 +32,15 @@ import org.onap.sdnc.northbound.client.model.GenericResourceApiRequestActionEnum
import org.onap.sdnc.northbound.client.model.GenericResourceApiRequestinformationRequestInformation;
import org.onap.sdnc.northbound.client.model.GenericResourceApiSdncrequestheaderSdncRequestHeader;
import org.onap.sdnc.northbound.client.model.GenericResourceApiServiceinformationServiceInformation;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.Customer;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.L3Network;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance;
+import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext;
+import org.onap.so.client.sdnc.beans.SDNCSvcAction;
+import org.onap.so.client.sdnc.beans.SDNCSvcOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
/**
* Mapper creating SDNC request
@@ -49,7 +49,8 @@ import org.onap.sdnc.northbound.client.model.GenericResourceApiServiceinformatio
@Component
public class NetworkTopologyOperationRequestMapper {
- static GeneralTopologyObjectMapper generalTopologyObjectMapper = new GeneralTopologyObjectMapper();
+ @Autowired
+ private GeneralTopologyObjectMapper generalTopologyObjectMapper;
public GenericResourceApiNetworkOperationInformation reqMapper(SDNCSvcOperation svcOperation,
SDNCSvcAction svcAction, GenericResourceApiRequestActionEnumeration reqAction, L3Network network, ServiceInstance serviceInstance,
@@ -68,11 +69,11 @@ public class NetworkTopologyOperationRequestMapper {
req.setNetworkInformation(networkInformation);
if (requestContext.getUserParams() != null) {
- for (Map.Entry<String, String> entry : requestContext.getUserParams().entrySet()) {
+ for (Map.Entry<String, Object> entry : requestContext.getUserParams().entrySet()) {
GenericResourceApiParam networkInputParameters = new GenericResourceApiParam();
GenericResourceApiParamParam paramItem = new GenericResourceApiParamParam();
- paramItem.setName(entry.getKey());
- paramItem.setValue(entry.getValue());
+ paramItem.setName(entry.getKey());
+ paramItem.setValue(generalTopologyObjectMapper.mapUserParamValue(entry.getValue()));
networkInputParameters.addParamItem(paramItem);
networkRequestInput.setNetworkInputParameters(networkInputParameters);
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/ServiceTopologyOperationMapper.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/ServiceTopologyOperationMapper.java
index 5b23707cb9..505466b22c 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/ServiceTopologyOperationMapper.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/ServiceTopologyOperationMapper.java
@@ -23,13 +23,6 @@ package org.onap.so.client.sdnc.mapper;
import java.util.Map;
import java.util.UUID;
-import org.onap.so.bpmn.servicedecomposition.bbobjects.Customer;
-import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance;
-import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext;
-import org.onap.so.client.sdnc.beans.SDNCSvcAction;
-import org.onap.so.client.sdnc.beans.SDNCSvcOperation;
-import org.springframework.stereotype.Component;
-
import org.onap.sdnc.northbound.client.model.GenericResourceApiParam;
import org.onap.sdnc.northbound.client.model.GenericResourceApiParamParam;
import org.onap.sdnc.northbound.client.model.GenericResourceApiRequestActionEnumeration;
@@ -38,11 +31,19 @@ import org.onap.sdnc.northbound.client.model.GenericResourceApiSdncrequestheader
import org.onap.sdnc.northbound.client.model.GenericResourceApiServiceOperationInformation;
import org.onap.sdnc.northbound.client.model.GenericResourceApiServiceinformationServiceInformation;
import org.onap.sdnc.northbound.client.model.GenericResourceApiServicerequestinputServiceRequestInput;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.Customer;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance;
+import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext;
+import org.onap.so.client.sdnc.beans.SDNCSvcAction;
+import org.onap.so.client.sdnc.beans.SDNCSvcOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
@Component
public class ServiceTopologyOperationMapper{
- static GeneralTopologyObjectMapper generalTopologyObjectMapper = new GeneralTopologyObjectMapper();
+ @Autowired
+ public GeneralTopologyObjectMapper generalTopologyObjectMapper;
public GenericResourceApiServiceOperationInformation reqMapper (SDNCSvcOperation svcOperation,
SDNCSvcAction svcAction, GenericResourceApiRequestActionEnumeration resourceAction,ServiceInstance serviceInstance, Customer customer, RequestContext requestContext) {
@@ -62,13 +63,13 @@ public class ServiceTopologyOperationMapper{
servOpInput.setServiceRequestInput(servReqInfo);
if(requestContext.getUserParams()!=null){
- for (Map.Entry<String, String> entry : requestContext.getUserParams().entrySet()) {
+ for (Map.Entry<String, Object> entry : requestContext.getUserParams().entrySet()) {
GenericResourceApiServicerequestinputServiceRequestInput serviceRequestInput = new GenericResourceApiServicerequestinputServiceRequestInput();
serviceRequestInput.setServiceInstanceName(serviceInstance.getServiceInstanceName());
GenericResourceApiParam serviceInputParameters = new GenericResourceApiParam();
GenericResourceApiParamParam paramItem = new GenericResourceApiParamParam();
paramItem.setName(entry.getKey());
- paramItem.setValue(entry.getValue());
+ paramItem.setValue(generalTopologyObjectMapper.mapUserParamValue(entry.getValue()));
serviceInputParameters.addParamItem(paramItem );
serviceRequestInput.serviceInputParameters(serviceInputParameters);
servOpInput.setServiceRequestInput(serviceRequestInput );
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/VfModuleTopologyOperationRequestMapper.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/VfModuleTopologyOperationRequestMapper.java
index b656579c69..f70ac8399f 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/VfModuleTopologyOperationRequestMapper.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/VfModuleTopologyOperationRequestMapper.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -23,39 +25,43 @@ package org.onap.so.client.sdnc.mapper;
import java.util.Map;
import java.util.UUID;
+import org.onap.sdnc.northbound.client.model.GenericResourceApiParam;
+import org.onap.sdnc.northbound.client.model.GenericResourceApiParamParam;
+import org.onap.sdnc.northbound.client.model.GenericResourceApiRequestActionEnumeration;
+import org.onap.sdnc.northbound.client.model.GenericResourceApiRequestinformationRequestInformation;
+import org.onap.sdnc.northbound.client.model.GenericResourceApiSdncrequestheaderSdncRequestHeader;
+import org.onap.sdnc.northbound.client.model.GenericResourceApiServiceinformationServiceInformation;
+import org.onap.sdnc.northbound.client.model.GenericResourceApiSvcActionEnumeration;
+import org.onap.sdnc.northbound.client.model.GenericResourceApiVfModuleOperationInformation;
+import org.onap.sdnc.northbound.client.model.GenericResourceApiVfModuleResponseInformation;
+import org.onap.sdnc.northbound.client.model.GenericResourceApiVfmoduleinformationVfModuleInformation;
+import org.onap.sdnc.northbound.client.model.GenericResourceApiVfmodulerequestinputVfModuleRequestInput;
+import org.onap.sdnc.northbound.client.model.GenericResourceApiVnfinformationVnfInformation;
import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion;
import org.onap.so.bpmn.servicedecomposition.bbobjects.Customer;
import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance;
import org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule;
import org.onap.so.bpmn.servicedecomposition.bbobjects.VolumeGroup;
import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext;
-import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance;
import org.onap.so.client.exception.MapperException;
import org.onap.so.client.sdnc.beans.SDNCSvcAction;
import org.onap.so.client.sdnc.beans.SDNCSvcOperation;
import org.onap.so.logger.MessageEnum;
import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
-import org.onap.sdnc.northbound.client.model.GenericResourceApiParam;
-import org.onap.sdnc.northbound.client.model.GenericResourceApiParamParam;
-import org.onap.sdnc.northbound.client.model.GenericResourceApiRequestActionEnumeration;
-import org.onap.sdnc.northbound.client.model.GenericResourceApiRequestinformationRequestInformation;
-import org.onap.sdnc.northbound.client.model.GenericResourceApiSdncrequestheaderSdncRequestHeader;
-import org.onap.sdnc.northbound.client.model.GenericResourceApiServiceinformationServiceInformation;
-import org.onap.sdnc.northbound.client.model.GenericResourceApiSvcActionEnumeration;
-import org.onap.sdnc.northbound.client.model.GenericResourceApiVfModuleOperationInformation;
-import org.onap.sdnc.northbound.client.model.GenericResourceApiVnfinformationVnfInformation;
-import org.onap.sdnc.northbound.client.model.GenericResourceApiVfmoduleinformationVfModuleInformation;
-import org.onap.sdnc.northbound.client.model.GenericResourceApiVfmodulerequestinputVfModuleRequestInput;
-import org.onap.sdnc.northbound.client.model.GenericResourceApiVfModuleResponseInformation;
-
import com.fasterxml.jackson.databind.ObjectMapper;
@Component
public class VfModuleTopologyOperationRequestMapper {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, VfModuleTopologyOperationRequestMapper.class);
- static GeneralTopologyObjectMapper generalTopologyObjectMapper = new GeneralTopologyObjectMapper();
+ private static final Logger logger = LoggerFactory.getLogger(VfModuleTopologyOperationRequestMapper.class);
+
+ @Autowired
+ private GeneralTopologyObjectMapper generalTopologyObjectMapper;
public GenericResourceApiVfModuleOperationInformation reqMapper(SDNCSvcOperation svcOperation,
SDNCSvcAction svcAction, VfModule vfModule, VolumeGroup volumeGroup, GenericVnf vnf, ServiceInstance serviceInstance,
@@ -122,10 +128,10 @@ public class VfModuleTopologyOperationRequestMapper {
GenericResourceApiParam vfModuleInputParameters = new GenericResourceApiParam();
if (requestContext != null && requestContext.getUserParams() != null) {
- for (Map.Entry<String, String> entry : requestContext.getUserParams().entrySet()) {
+ for (Map.Entry<String, Object> entry : requestContext.getUserParams().entrySet()) {
GenericResourceApiParamParam paramItem = new GenericResourceApiParamParam();
paramItem.setName(entry.getKey());
- paramItem.setValue(entry.getValue());
+ paramItem.setValue(generalTopologyObjectMapper.mapUserParamValue(entry.getValue()));
vfModuleInputParameters.addParamItem(paramItem);
}
}
@@ -166,8 +172,9 @@ public class VfModuleTopologyOperationRequestMapper {
try {
GenericResourceApiVfModuleResponseInformation assignResponseInfo = mapper.readValue(sdncAssignResponse, GenericResourceApiVfModuleResponseInformation.class);
objectPath = assignResponseInfo.getVfModuleResponseInformation().getObjectPath();
- } catch (Exception e) {
- msoLogger.error(MessageEnum.RA_RESPONSE_FROM_SDNC, e.getMessage(), "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, e.getMessage());
+ } catch (Exception e) {
+ logger.error("{} {} {} {} {} {}", MessageEnum.RA_RESPONSE_FROM_SDNC.toString(), e.getMessage(), "BPMN",
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), e.getMessage());
}
}
return objectPath;
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/VnfTopologyOperationRequestMapper.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/VnfTopologyOperationRequestMapper.java
index e860d3cc48..7de393bb2f 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/VnfTopologyOperationRequestMapper.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/VnfTopologyOperationRequestMapper.java
@@ -26,6 +26,16 @@ import java.util.Map;
import java.util.UUID;
import org.apache.commons.lang.StringUtils;
+import org.onap.sdnc.northbound.client.model.GenericResourceApiParam;
+import org.onap.sdnc.northbound.client.model.GenericResourceApiParamParam;
+import org.onap.sdnc.northbound.client.model.GenericResourceApiRequestActionEnumeration;
+import org.onap.sdnc.northbound.client.model.GenericResourceApiRequestinformationRequestInformation;
+import org.onap.sdnc.northbound.client.model.GenericResourceApiSdncrequestheaderSdncRequestHeader;
+import org.onap.sdnc.northbound.client.model.GenericResourceApiServiceinformationServiceInformation;
+import org.onap.sdnc.northbound.client.model.GenericResourceApiVnfOperationInformation;
+import org.onap.sdnc.northbound.client.model.GenericResourceApiVnfinformationVnfInformation;
+import org.onap.sdnc.northbound.client.model.GenericResourceApiVnfrequestinputVnfRequestInput;
+import org.onap.sdnc.northbound.client.model.GenericResourceApiVnfrequestinputVnfrequestinputVnfNetworkInstanceGroupIds;
import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion;
import org.onap.so.bpmn.servicedecomposition.bbobjects.Customer;
import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
@@ -36,23 +46,14 @@ import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext;
import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoInstanceGroup;
import org.onap.so.client.sdnc.beans.SDNCSvcAction;
import org.onap.so.client.sdnc.beans.SDNCSvcOperation;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
-import org.onap.sdnc.northbound.client.model.GenericResourceApiParam;
-import org.onap.sdnc.northbound.client.model.GenericResourceApiParamParam;
-import org.onap.sdnc.northbound.client.model.GenericResourceApiRequestActionEnumeration;
-import org.onap.sdnc.northbound.client.model.GenericResourceApiRequestinformationRequestInformation;
-import org.onap.sdnc.northbound.client.model.GenericResourceApiSdncrequestheaderSdncRequestHeader;
-import org.onap.sdnc.northbound.client.model.GenericResourceApiServiceinformationServiceInformation;
-import org.onap.sdnc.northbound.client.model.GenericResourceApiVnfOperationInformation;
-import org.onap.sdnc.northbound.client.model.GenericResourceApiVnfinformationVnfInformation;
-import org.onap.sdnc.northbound.client.model.GenericResourceApiVnfrequestinputVnfRequestInput;
-import org.onap.sdnc.northbound.client.model.GenericResourceApiVnfrequestinputVnfrequestinputVnfNetworkInstanceGroupIds;
-
@Component
public class VnfTopologyOperationRequestMapper {
- static GeneralTopologyObjectMapper generalTopologyObjectMapper = new GeneralTopologyObjectMapper();
+ @Autowired
+ private GeneralTopologyObjectMapper generalTopologyObjectMapper;
public GenericResourceApiVnfOperationInformation reqMapper(SDNCSvcOperation svcOperation, SDNCSvcAction svcAction,
GenericResourceApiRequestActionEnumeration requestAction, GenericVnf vnf, ServiceInstance serviceInstance,
@@ -84,10 +85,10 @@ public class VnfTopologyOperationRequestMapper {
GenericResourceApiParam vnfInputParameters = new GenericResourceApiParam();
if (requestContext.getUserParams() != null) {
- for (Map.Entry<String, String> entry : requestContext.getUserParams().entrySet()) {
+ for (Map.Entry<String, Object> entry : requestContext.getUserParams().entrySet()) {
GenericResourceApiParamParam paramItem = new GenericResourceApiParamParam();
paramItem.setName(entry.getKey());
- paramItem.setValue(entry.getValue());
+ paramItem.setValue(generalTopologyObjectMapper.mapUserParamValue(entry.getValue()));
vnfInputParameters.addParamItem(paramItem);
vnfRequestInput.setVnfInputParameters(vnfInputParameters);
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/SniroClient.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/SniroClient.java
index 7f09305d95..5a48a757bc 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/SniroClient.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/SniroClient.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -29,7 +31,8 @@ import org.onap.so.client.exception.BadResponseException;
import org.onap.so.client.sniro.beans.ManagerProperties;
import org.onap.so.client.sniro.beans.SniroConductorRequest;
import org.onap.so.client.sniro.beans.SniroManagerRequest;
-import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpHeaders;
@@ -42,7 +45,7 @@ import com.fasterxml.jackson.core.JsonProcessingException;
@Component
public class SniroClient {
- private static final MsoLogger log = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, SniroClient.class);
+ private static final Logger logger = LoggerFactory.getLogger(SniroClient.class);
@Autowired
private ManagerProperties managerProperties;
@@ -61,10 +64,10 @@ public class SniroClient {
* @throws BpmnError
*/
public void postDemands(SniroManagerRequest homingRequest) throws BadResponseException, JsonProcessingException{
- log.trace("Started Sniro Client Post Demands");
+ logger.trace("Started Sniro Client Post Demands");
String url = managerProperties.getHost() + managerProperties.getUri().get("v2");
- log.debug("Post demands url: " + url);
- log.debug("Post demands payload: " + homingRequest.toJsonString());
+ logger.debug("Post demands url: {}", url);
+ logger.debug("Post demands payload: {}", homingRequest.toJsonString());
HttpHeaders header = new HttpHeaders();
header.setContentType(MediaType.APPLICATION_JSON);
@@ -79,7 +82,7 @@ public class SniroClient {
LinkedHashMap<String, Object> response = baseClient.post(homingRequest.toJsonString(), new ParameterizedTypeReference<LinkedHashMap<String, Object>>() {});
validator.validateDemandsResponse(response);
- log.trace("Completed Sniro Client Post Demands");
+ logger.trace("Completed Sniro Client Post Demands");
}
/**
@@ -94,10 +97,10 @@ public class SniroClient {
* @throws BadResponseException
*/
public void postRelease(SniroConductorRequest releaseRequest) throws BadResponseException {
- log.trace("Started Sniro Client Post Release");
+ logger.trace("Started Sniro Client Post Release");
String url = UrnPropertiesReader.getVariable("sniro.conductor.host") + UrnPropertiesReader.getVariable("sniro.conductor.uri");
- log.debug("Post release url: " + url);
- log.debug("Post release payload: " + releaseRequest.toJsonString());
+ logger.debug("Post release url: {}", url);
+ logger.debug("Post release payload: {}", releaseRequest.toJsonString());
HttpHeaders header = new HttpHeaders();
header.setContentType(MediaType.APPLICATION_JSON);
@@ -110,7 +113,7 @@ public class SniroClient {
LinkedHashMap<String, Object> response = baseClient.post(releaseRequest.toJsonString(), new ParameterizedTypeReference<LinkedHashMap<String, Object>>() {});
SniroValidator v = new SniroValidator();
v.validateReleaseResponse(response);
- log.trace("Completed Sniro Client Post Release");
+ logger.trace("Completed Sniro Client Post Release");
}
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/SniroValidator.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/SniroValidator.java
index 0d0c1be5aa..dcccd319c6 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/SniroValidator.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/SniroValidator.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -28,7 +30,8 @@ import java.util.LinkedHashMap;
import org.json.JSONObject;
import org.onap.so.client.exception.BadResponseException;
-import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
@@ -36,7 +39,7 @@ import org.springframework.stereotype.Component;
@Component
public class SniroValidator {
- private static final MsoLogger log = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, SniroValidator.class);
+ private static final Logger logger = LoggerFactory.getLogger(SniroValidator.class);
/**
* Validates the synchronous homing response from sniro manager
@@ -44,29 +47,29 @@ public class SniroValidator {
* @throws BadResponseException
*/
public void validateDemandsResponse(LinkedHashMap<String, Object> response) throws BadResponseException {
- log.debug("Validating Sniro Managers synchronous response");
+ logger.debug("Validating Sniro Managers synchronous response");
if(!response.isEmpty()){
JSONObject jsonResponse = new JSONObject(response);
if(jsonResponse.has("requestStatus")){
String status = jsonResponse.getString("requestStatus");
if(status.equals("accepted")){
- log.debug("Sniro Managers synchronous response indicates accepted");
+ logger.debug("Sniro Managers synchronous response indicates accepted");
}else{
String message = jsonResponse.getString("statusMessage");
if(isNotBlank(message)){
- log.debug("Sniro Managers response indicates failed: " + message);
+ logger.debug("Sniro Managers response indicates failed: " + message);
}else{
- log.debug("Sniro Managers response indicates failed: no status message provided");
+ logger.debug("Sniro Managers response indicates failed: no status message provided");
message = "error message not provided";
}
throw new BadResponseException("Sniro Managers synchronous response indicates failed: " + message);
}
}else{
- log.debug("Sniro Managers synchronous response does not contain: request status");
+ logger.debug("Sniro Managers synchronous response does not contain: request status");
throw new BadResponseException("Sniro Managers synchronous response does not contain: request status");
}
}else{
- log.debug("Sniro Managers synchronous response is empty");
+ logger.debug("Sniro Managers synchronous response is empty");
throw new BadResponseException("Sniro Managers synchronous response i is empty");
}
}
@@ -78,23 +81,23 @@ public class SniroValidator {
* @throws BadResponseException
*/
public static void validateSolution(String response) throws BadResponseException{
- log.debug("Validating Sniro Managers asynchronous callback response");
+ logger.debug("Validating Sniro Managers asynchronous callback response");
if(isNotBlank(response)) {
JSONObject jsonResponse = new JSONObject(response);
if(!jsonResponse.has("serviceException")){
- log.debug("Sniro Managers asynchronous response is valid");
+ logger.debug("Sniro Managers asynchronous response is valid");
}else{
String message = jsonResponse.getJSONObject("serviceException").getString("text");
if(isNotBlank(message)){
- log.debug("Sniro Managers response contains a service exception: " + message);
+ logger.debug("Sniro Managers response contains a service exception: " + message);
}else{
- log.debug("Sniro Managers response contains a service exception: no service exception text provided");
+ logger.debug("Sniro Managers response contains a service exception: no service exception text provided");
message = "error message not provided";
}
throw new BadResponseException("Sniro Managers asynchronous response contains a service exception: " + message);
}
}else{
- log.debug("Sniro Managers asynchronous response is empty");
+ logger.debug("Sniro Managers asynchronous response is empty");
throw new BadResponseException("Sniro Managers asynchronous response is empty");
}
}
@@ -106,33 +109,31 @@ public class SniroValidator {
* @throws BadResponseException
*/
public void validateReleaseResponse(LinkedHashMap<String, Object> response) throws BadResponseException {
- log.debug("Validating Sniro Conductors response");
+ logger.debug("Validating Sniro Conductors response");
if(!response.isEmpty()){
String status = (String) response.get("status");
if(isNotBlank(status)){
if(status.equals("success")){
- log.debug("Sniro Conductors synchronous response indicates success");
+ logger.debug("Sniro Conductors synchronous response indicates success");
}else{
String message = (String) response.get("message");
if(isNotBlank(message)){
- log.debug("Sniro Conductors response indicates failed: " + message);
+ logger.debug("Sniro Conductors response indicates failed: " + message);
}else{
- log.debug("Sniro Conductors response indicates failed: error message not provided");
+ logger.debug("Sniro Conductors response indicates failed: error message not provided");
message = "error message not provided";
}
throw new BadResponseException("Sniro Conductors synchronous response indicates failed: " + message);
}
}else{
- log.debug("Sniro Managers Conductors response does not contain: status");
+ logger.debug("Sniro Managers Conductors response does not contain: status");
throw new BadResponseException("Sniro Conductors synchronous response does not contain: status");
}
}else{
- log.debug("Sniro Conductors response is empty");
+ logger.debug("Sniro Conductors response is empty");
throw new BadResponseException("Sniro Conductors response is empty");
}
}
-
-
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/SniroConductorRequest.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/SniroConductorRequest.java
index bc8e27ce86..11417d646c 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/SniroConductorRequest.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/SniroConductorRequest.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -24,19 +26,19 @@ import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
-import org.onap.so.logger.MsoLogger;
-
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class SniroConductorRequest implements Serializable{
private static final long serialVersionUID = 1906052095861777655L;
- private static final MsoLogger log = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, SniroConductorRequest.class);
+ private static final Logger logger = LoggerFactory.getLogger(SniroConductorRequest.class);
@JsonProperty("release-locks")
private List<Resource> resources = new ArrayList<Resource>();
@@ -55,7 +57,7 @@ public class SniroConductorRequest implements Serializable{
try{
json = ow.writeValueAsString(this);
}catch (Exception e){
- log.error("Unable to convert SniroConductorRequest to string", e);
+ logger.error("Unable to convert SniroConductorRequest to string", e);
}
return json;
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/SniroManagerRequest.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/SniroManagerRequest.java
index 3c39456318..c1e376814f 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/SniroManagerRequest.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/SniroManagerRequest.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -22,20 +24,19 @@ package org.onap.so.client.sniro.beans;
import java.io.Serializable;
-import org.onap.so.logger.MsoLogger;
-
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonRawValue;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class SniroManagerRequest implements Serializable{
private static final long serialVersionUID = -1541132882892163132L;
- private static final MsoLogger log = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, SniroManagerRequest.class);
+ private static final Logger logger = LoggerFactory.getLogger(SniroManagerRequest.class);
@JsonProperty("requestInfo")
private RequestInfo requestInformation;
@@ -82,7 +83,7 @@ public class SniroManagerRequest implements Serializable{
try{
json = ow.writeValueAsString(this);
}catch (Exception e){
- log.error("Unable to convert SniroManagerRequest to string", e);
+ logger.error("Unable to convert SniroManagerRequest to string", e);
}
return json.replaceAll("\\\\", "");
}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/FileUtil.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/FileUtil.java
index e35fe0db9f..366c9c11a9 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/FileUtil.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/FileUtil.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -22,7 +24,8 @@ package org.onap.so;
import java.io.IOException;
import java.io.InputStream;
-import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
*
@@ -35,7 +38,7 @@ import org.onap.so.logger.MsoLogger;
*/
public class FileUtil {
- private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA, FileUtil.class);
+ private static final Logger logger = LoggerFactory.getLogger(FileUtil.class);
/**
* Read the specified resource file and return the contents as a String.
@@ -58,7 +61,7 @@ public class FileUtil {
return "";
}
} catch (IOException e) {
- LOGGER.debug("Exception:", e);
+ logger.debug("Exception:", e);
return "";
}
}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasksTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasksTest.java
index 73d7257632..a8a249f386 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasksTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasksTest.java
@@ -43,6 +43,7 @@ import org.mockito.ArgumentMatchers;
import org.mockito.InjectMocks;
import org.mockito.Mockito;
import org.onap.so.adapters.nwrest.CreateNetworkResponse;
+import org.onap.so.adapters.nwrest.UpdateNetworkResponse;
import org.onap.so.bpmn.BaseTaskTest;
import org.onap.so.bpmn.common.BuildingBlockExecution;
import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion;
@@ -456,6 +457,29 @@ public class AAIUpdateTasksTest extends BaseTaskTest{
String neutronSubnetId = createNetworkResponse.getSubnetMap().entrySet().iterator().next().getValue();
assertEquals(neutronSubnetId, network.getSubnets().get(0).getNeutronSubnetId());
}
+
+ @Test
+ public void updateNetworkUpdatedTest() throws Exception {
+ UpdateNetworkResponse updateNetworkResponse = new UpdateNetworkResponse();
+ updateNetworkResponse.setNeutronNetworkId("testNeutronNetworkId");
+ HashMap<String, String> subnetMap = new HashMap<>();
+ subnetMap.put("testSubnetId", "testNeutronSubnetId");
+ updateNetworkResponse.setSubnetMap(subnetMap);
+
+ network.getSubnets().add(subnet);
+
+ execution.setVariable("updateNetworkResponse", updateNetworkResponse);
+
+ doNothing().when(aaiNetworkResources).updateNetwork(network);
+ doNothing().when(aaiNetworkResources).updateSubnet(network, subnet);
+
+ aaiUpdateTasks.updateNetworkUpdated(execution);
+ verify(aaiNetworkResources, times(1)).updateNetwork(network);
+ verify(aaiNetworkResources, times(1)).updateSubnet(network, subnet);
+
+ String neutronSubnetId = updateNetworkResponse.getSubnetMap().entrySet().iterator().next().getValue();
+ assertEquals(neutronSubnetId, network.getSubnets().get(0).getNeutronSubnetId());
+ }
@Test
public void updateOrchestrationStatusNetworkTest() {
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterUpdateTasksTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterUpdateTasksTest.java
index 9f2f2fbdcc..478c512b0a 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterUpdateTasksTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterUpdateTasksTest.java
@@ -24,6 +24,7 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.ArgumentMatchers.isA;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.times;
@@ -39,6 +40,8 @@ import org.junit.Before;
import org.junit.Test;
import org.mockito.ArgumentMatchers;
import org.mockito.InjectMocks;
+import org.onap.so.adapters.nwrest.CreateNetworkRequest;
+import org.onap.so.adapters.nwrest.UpdateNetworkRequest;
import org.onap.so.adapters.nwrest.UpdateNetworkResponse;
import org.onap.so.bpmn.BaseTaskTest;
import org.onap.so.bpmn.common.BuildingBlockExecution;
@@ -83,35 +86,15 @@ public class NetworkAdapterUpdateTasksTest extends BaseTaskTest{
@Test
public void updateNetworkTest() throws Exception {
- UpdateNetworkResponse updateNetworkResponse = new UpdateNetworkResponse();
- updateNetworkResponse.setMessageId("messageId");
- updateNetworkResponse.setNetworkId("networkId");
- Optional<UpdateNetworkResponse> oUpdateNetworkResponse = Optional.of(updateNetworkResponse);
-
- doReturn(oUpdateNetworkResponse).when(networkAdapterResources).updateNetwork(requestContext, cloudRegion, orchestrationContext, serviceInstance, network, userInput, customer);
-
- networkAdapterUpdateTasks.updateNetwork(execution);
-
- verify(networkAdapterResources, times(1)).updateNetwork(requestContext, cloudRegion, orchestrationContext, serviceInstance, network, userInput, customer);
- assertEquals(updateNetworkResponse, execution.getVariable("NetworkAdapterUpdateNetworkResponse"));
- }
-
- @Test
- public void updateNetworkNoResponseTest() throws Exception {
- doReturn(Optional.empty()).when(networkAdapterResources).updateNetwork(requestContext, cloudRegion, orchestrationContext, serviceInstance, network, userInput, customer);
-
+ String cloudRegionPo = "cloudRegionPo";
+ UpdateNetworkRequest updateNetworkRequest = new UpdateNetworkRequest();
+ execution.setVariable("cloudRegionPo", cloudRegionPo);
+
+ doReturn(updateNetworkRequest).when(networkAdapterObjectMapper).createNetworkUpdateRequestMapper(isA(RequestContext.class), isA(CloudRegion.class), isA(OrchestrationContext.class), isA(ServiceInstance.class), isA(L3Network.class), isA(Map.class), isA(Customer.class));
networkAdapterUpdateTasks.updateNetwork(execution);
-
- verify(networkAdapterResources, times(1)).updateNetwork(requestContext, cloudRegion, orchestrationContext, serviceInstance, network, userInput, customer);
- assertNull(execution.getVariable("NetworkAdapterUpdateNetworkResponse"));
+ verify(networkAdapterObjectMapper, times(1)).createNetworkUpdateRequestMapper(requestContext, cloudRegion, orchestrationContext, serviceInstance, network, userInput, customer);
+ assertEquals(updateNetworkRequest, execution.getVariable("networkAdapterRequest"));
}
- @Test
- public void updateNetworkExceptionTest() throws UnsupportedEncodingException, NetworkAdapterClientException {
- expectedException.expect(BpmnError.class);
- doThrow(new NetworkAdapterClientException("ERROR")).when(networkAdapterResources).updateNetwork(any(RequestContext.class),any(CloudRegion.class),
- any(OrchestrationContext.class),eq(serviceInstance),eq(network),any(Map.class),any(Customer.class));
- doThrow(new BpmnError("BPMN Error")).when(exceptionUtil).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(7000), any(Exception.class));
- networkAdapterUpdateTasks.updateNetwork(execution);
- }
+
}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/CloudSiteCatalogUtilsTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/CloudSiteCatalogUtilsTest.java
new file mode 100644
index 0000000000..125c97109c
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/CloudSiteCatalogUtilsTest.java
@@ -0,0 +1,88 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.so.bpmn.infrastructure.flowspecific.tasks;
+
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Mockito.doReturn;
+import java.util.Optional;
+import org.junit.Test;
+import org.mockito.InjectMocks;
+import org.onap.so.bpmn.BaseTaskTest;
+
+import org.onap.so.db.catalog.beans.CloudIdentity;
+import org.onap.so.db.catalog.beans.CloudSite;
+
+public class CloudSiteCatalogUtilsTest extends BaseTaskTest {
+
+ @InjectMocks
+ private CloudSiteCatalogUtils cloudSiteCatalogUtils = new CloudSiteCatalogUtils();
+
+ @Test
+ public void testGetCloudSiteGetVersion30Test() throws Exception {
+ CloudSite cloudSite = new CloudSite();
+ String testCloudSiteId = "testCloudSiteId";
+ cloudSite.setClli(testCloudSiteId);
+ doReturn(cloudSite).when(catalogDbClient).getCloudSite(testCloudSiteId);
+ Optional<CloudSite> actualCloudSite = cloudSiteCatalogUtils.getCloudSite(testCloudSiteId);
+ assertEquals(actualCloudSite.get().getClli(), testCloudSiteId);
+ }
+
+ @Test
+ public void testGetCloudSiteGetVersion25Test() throws Exception {
+ CloudSite cloudSite = new CloudSite();
+ String testCloudSiteId = "testCloudSiteId";
+ cloudSite.setClli(testCloudSiteId);
+ doReturn(null).when(catalogDbClient).getCloudSite(testCloudSiteId);
+ doReturn(cloudSite).when(catalogDbClient).getCloudSiteByClliAndAicVersion(testCloudSiteId, "2.5");
+ Optional<CloudSite> actualCloudSite = cloudSiteCatalogUtils.getCloudSite(testCloudSiteId);
+ assertEquals(actualCloudSite.get().getClli(), testCloudSiteId);
+ }
+
+ @Test
+ public void testGetIdentityUrlFromCloudSiteSuccessTest() throws Exception {
+ CloudSite cloudSite = new CloudSite();
+ String testCloudSiteId = "testCloudSiteId";
+ String testIdentityUrl = "testIdentityUrl";
+ delegateExecution.setVariable("lcpCloudRegionId", testCloudSiteId);
+ cloudSite.setClli(testCloudSiteId);
+ CloudIdentity cloudIdentity = new CloudIdentity();
+ cloudIdentity.setIdentityUrl(testIdentityUrl);
+ cloudSite.setIdentityService(cloudIdentity);
+ doReturn(cloudSite).when(catalogDbClient).getCloudSite(testCloudSiteId);
+ cloudSiteCatalogUtils.getIdentityUrlFromCloudSite(delegateExecution);
+ String actualIdentityUrl = (String) delegateExecution.getVariable("identityUrl");
+ assertEquals(testIdentityUrl, actualIdentityUrl);
+ }
+
+ @Test
+ public void testGetIdentityUrlFromCloudSiteNoCloudIdProvidedTest() throws Exception {
+ CloudSite cloudSite = new CloudSite();
+ String testCloudSiteId = "testCloudSiteId";
+ String testIdentityUrl = "testIdentityUrl";
+ cloudSite.setClli(testCloudSiteId);
+ CloudIdentity cloudIdentity = new CloudIdentity();
+ cloudIdentity.setIdentityUrl(testIdentityUrl);
+ cloudSite.setIdentityService(cloudIdentity);
+ doReturn(cloudSite).when(catalogDbClient).getCloudSite(testCloudSiteId);
+ cloudSiteCatalogUtils.getIdentityUrlFromCloudSite(delegateExecution);
+ String actualIdentityUrl = (String) delegateExecution.getVariable("identityUrl");
+ assertEquals(null, actualIdentityUrl);
+ }
+}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/SniroHomingV2IT.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/SniroHomingV2IT.java
index 59fad5cdd6..c4129a3b96 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/SniroHomingV2IT.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/SniroHomingV2IT.java
@@ -39,7 +39,6 @@ import org.camunda.bpm.engine.delegate.BpmnError;
import org.json.JSONArray;
import org.json.JSONObject;
import org.junit.Before;
-import org.junit.Ignore;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
import org.onap.so.bpmn.servicedecomposition.bbobjects.AllottedResource;
@@ -211,13 +210,13 @@ public class SniroHomingV2IT extends BaseIntegrationTest{
JSONObject asyncResponse = new JSONObject();
asyncResponse.put("transactionId", "testRequestId").put("requestId", "testRequestId").put("requestState", "completed");
JSONArray solution1 = new JSONArray();
- solution1.put(new JSONObject().put("serviceResourceId", "testProxyId1").put("inventoryType", "service").put("solution", new JSONObject()
+ solution1.put(new JSONObject().put("serviceResourceId", "testProxyId1").put("solution", new JSONObject()
.put("identifierType", "serviceInstanceId").put("identifiers", new JSONArray().put("testServiceInstanceId1")))
.put("assignmentInfo", new JSONArray().put(new JSONObject().put("key", "isRehome").put("value", "False"))
.put(new JSONObject().put("key", "cloudOwner").put("value", "aic")).put(new JSONObject().put("key", "vnfHostName").put("value", "testVnfHostName1"))
.put(new JSONObject().put("key", "aicClli").put("value", "testAicClli1")).put(new JSONObject().put("key", "aicVersion").put("value", "3"))
.put(new JSONObject().put("key", "vnfId").put("value", "testVnfId1")).put(new JSONObject().put("key", "cloudRegionId").put("value", "testSloudRegionId1"))));
- solution1.put(new JSONObject().put("serviceResourceId", "testProxyId2").put("inventoryType", "service").put("solution", new JSONObject()
+ solution1.put(new JSONObject().put("serviceResourceId", "testProxyId2").put("solution", new JSONObject()
.put("identifierType", "serviceInstanceId").put("identifiers", new JSONArray().put("testServiceInstanceId2")))
.put("assignmentInfo", new JSONArray().put(new JSONObject().put("key", "isRehome").put("value", "False"))
.put(new JSONObject().put("key", "cloudOwner").put("value", "aic")).put(new JSONObject().put("key", "primaryPnfName").put("value", "testPrimaryPnfName2"))
@@ -255,13 +254,13 @@ public class SniroHomingV2IT extends BaseIntegrationTest{
JSONObject asyncResponse = new JSONObject();
asyncResponse.put("transactionId", "testRequestId").put("requestId", "testRequestId").put("requestState", "completed");
JSONArray solution1 = new JSONArray();
- solution1.put(new JSONObject().put("serviceResourceId", "testProxyId1").put("inventoryType", "service").put("solution", new JSONObject()
+ solution1.put(new JSONObject().put("serviceResourceId", "testProxyId1").put("solution", new JSONObject()
.put("identifierType", "serviceInstanceId").put("identifiers", new JSONArray().put("testServiceInstanceId1")))
.put("assignmentInfo", new JSONArray().put(new JSONObject().put("key", "isRehome").put("value", "False"))
.put(new JSONObject().put("key", "cloudOwner").put("value", "aic")).put(new JSONObject().put("key", "vnfHostName").put("value", "testVnfHostName1"))
.put(new JSONObject().put("key", "aicClli").put("value", "testAicClli1")).put(new JSONObject().put("key", "aicVersion").put("value", "3"))
.put(new JSONObject().put("key", "vnfId").put("value", "testVnfId1")).put(new JSONObject().put("key", "cloudRegionId").put("value", "testSloudRegionId1"))));
- solution1.put(new JSONObject().put("serviceResourceId", "testProxyId2").put("inventoryType", "service").put("solution", new JSONObject()
+ solution1.put(new JSONObject().put("serviceResourceId", "testProxyId2").put("solution", new JSONObject()
.put("identifierType", "serviceInstanceId").put("identifiers", new JSONArray().put("testServiceInstanceId2")))
.put("assignmentInfo", new JSONArray().put(new JSONObject().put("key", "isRehome").put("value", "False"))
.put(new JSONObject().put("key", "cloudOwner").put("value", "aic")).put(new JSONObject().put("key", "primaryPnfName").put("value", "testPrimaryPnfName2"))
@@ -269,13 +268,13 @@ public class SniroHomingV2IT extends BaseIntegrationTest{
.put(new JSONObject().put("key", "secondaryPnfName").put("value", "testSecondaryPnfName2")).put(new JSONObject().put("key", "cloudRegionId").put("value", "testSloudRegionId2"))));
JSONArray solution2 = new JSONArray();
- solution2.put(new JSONObject().put("serviceResourceId", "testProxyId1").put("inventoryType", "service").put("solution", new JSONObject()
+ solution2.put(new JSONObject().put("serviceResourceId", "testProxyId1").put("solution", new JSONObject()
.put("identifierType", "serviceInstanceId").put("identifiers", new JSONArray().put("testServiceInstanceId3")))
.put("assignmentInfo", new JSONArray().put(new JSONObject().put("key", "isRehome").put("value", "False"))
.put(new JSONObject().put("key", "cloudOwner").put("value", "aic")).put(new JSONObject().put("key", "vnfHostName").put("value", "testVnfHostName3"))
.put(new JSONObject().put("key", "aicClli").put("value", "testAicClli3")).put(new JSONObject().put("key", "aicVersion").put("value", "3"))
.put(new JSONObject().put("key", "vnfId").put("value", "testVnfId3")).put(new JSONObject().put("key", "cloudRegionId").put("value", "testSloudRegionId3"))));
- solution2.put(new JSONObject().put("serviceResourceId", "testProxyId2").put("inventoryType", "service").put("solution", new JSONObject()
+ solution2.put(new JSONObject().put("serviceResourceId", "testProxyId2").put("solution", new JSONObject()
.put("identifierType", "serviceInstanceId").put("identifiers", new JSONArray().put("testServiceInstanceId4")))
.put("assignmentInfo", new JSONArray().put(new JSONObject().put("key", "isRehome").put("value", "False"))
.put(new JSONObject().put("key", "cloudOwner").put("value", "aic")).put(new JSONObject().put("key", "primaryPnfName").put("value", "testPrimaryPnfName4"))
@@ -335,19 +334,19 @@ public class SniroHomingV2IT extends BaseIntegrationTest{
JSONObject asyncResponse = new JSONObject();
asyncResponse.put("transactionId", "testRequestId").put("requestId", "testRequestId").put("requestState", "completed");
JSONArray solution1 = new JSONArray();
- solution1.put(new JSONObject().put("serviceResourceId", "testAllottedResourceId1").put("inventoryType", "service").put("solution", new JSONObject()
+ solution1.put(new JSONObject().put("serviceResourceId", "testAllottedResourceId1").put("solution", new JSONObject()
.put("identifierType", "serviceInstanceId").put("identifiers", new JSONArray().put("testServiceInstanceId1")))
.put("assignmentInfo", new JSONArray().put(new JSONObject().put("key", "isRehome").put("value", "True"))
.put(new JSONObject().put("key", "cloudOwner").put("value", "aic")).put(new JSONObject().put("key", "vnfHostName").put("value", "testVnfHostName1"))
.put(new JSONObject().put("key", "aicClli").put("value", "testAicClli1")).put(new JSONObject().put("key", "aicVersion").put("value", "3"))
.put(new JSONObject().put("key", "vnfId").put("value", "testVnfId1")).put(new JSONObject().put("key", "cloudRegionId").put("value", "testCloudRegionId1"))));
- solution1.put(new JSONObject().put("serviceResourceId", "testAllottedResourceId2").put("inventoryType", "service").put("solution", new JSONObject()
+ solution1.put(new JSONObject().put("serviceResourceId", "testAllottedResourceId2").put("solution", new JSONObject()
.put("identifierType", "serviceInstanceId").put("identifiers", new JSONArray().put("testServiceInstanceId2")))
.put("assignmentInfo", new JSONArray().put(new JSONObject().put("key", "isRehome").put("value", "True"))
.put(new JSONObject().put("key", "cloudOwner").put("value", "aic")).put(new JSONObject().put("key", "vnfHostName").put("value", "testVnfHostName2"))
.put(new JSONObject().put("key", "aicClli").put("value", "testAicClli2")).put(new JSONObject().put("key", "aicVersion").put("value", "3"))
.put(new JSONObject().put("key", "vnfId").put("value", "testVnfId1")).put(new JSONObject().put("key", "cloudRegionId").put("value", "testCloudRegionId2"))));
- solution1.put(new JSONObject().put("serviceResourceId", "testAllottedResourceId3").put("inventoryType", "cloud").put("solution", new JSONObject()
+ solution1.put(new JSONObject().put("serviceResourceId", "testAllottedResourceId3").put("solution", new JSONObject()
.put("identifierType", "cloudRegionId").put("identifiers", new JSONArray().put("testCloudRegionId3")))
.put("assignmentInfo", new JSONArray().put(new JSONObject().put("key", "isRehome").put("value", "True"))
.put(new JSONObject().put("key", "cloudOwner").put("value", "aic"))
@@ -387,19 +386,19 @@ public class SniroHomingV2IT extends BaseIntegrationTest{
asyncResponse.put("transactionId", "testRequestId").put("requestId", "testRequestId").put("requestState", "completed");
JSONArray solution1 = new JSONArray();
JSONArray licenseSolution = new JSONArray();
- solution1.put(new JSONObject().put("serviceResourceId", "testAllottedResourceId1").put("inventoryType", "service").put("solution", new JSONObject()
+ solution1.put(new JSONObject().put("serviceResourceId", "testAllottedResourceId1").put("solution", new JSONObject()
.put("identifierType", "serviceInstanceId").put("identifiers", new JSONArray().put("testServiceInstanceId1")))
.put("assignmentInfo", new JSONArray().put(new JSONObject().put("key", "isRehome").put("value", "True"))
.put(new JSONObject().put("key", "cloudOwner").put("value", "aic")).put(new JSONObject().put("key", "vnfHostName").put("value", "testVnfHostName1"))
.put(new JSONObject().put("key", "aicClli").put("value", "testAicClli1")).put(new JSONObject().put("key", "aicVersion").put("value", "3"))
.put(new JSONObject().put("key", "vnfId").put("value", "testVnfId1")).put(new JSONObject().put("key", "cloudRegionId").put("value", "testCloudRegionId1"))));
- solution1.put(new JSONObject().put("serviceResourceId", "testAllottedResourceId2").put("inventoryType", "service").put("solution", new JSONObject()
+ solution1.put(new JSONObject().put("serviceResourceId", "testAllottedResourceId2").put("solution", new JSONObject()
.put("identifierType", "serviceInstanceId").put("identifiers", new JSONArray().put("testServiceInstanceId2")))
.put("assignmentInfo", new JSONArray().put(new JSONObject().put("key", "isRehome").put("value", "True"))
.put(new JSONObject().put("key", "cloudOwner").put("value", "aic")).put(new JSONObject().put("key", "vnfHostName").put("value", "testVnfHostName2"))
.put(new JSONObject().put("key", "aicClli").put("value", "testAicClli2")).put(new JSONObject().put("key", "aicVersion").put("value", "3"))
.put(new JSONObject().put("key", "vnfId").put("value", "testVnfId1")).put(new JSONObject().put("key", "cloudRegionId").put("value", "testCloudRegionId2"))));
- solution1.put(new JSONObject().put("serviceResourceId", "testAllottedResourceId3").put("inventoryType", "cloud").put("solution", new JSONObject()
+ solution1.put(new JSONObject().put("serviceResourceId", "testAllottedResourceId3").put("solution", new JSONObject()
.put("identifierType", "cloudRegionId").put("identifiers", new JSONArray().put("testCloudRegionId3")))
.put("assignmentInfo", new JSONArray().put(new JSONObject().put("key", "isRehome").put("value", "True"))
.put(new JSONObject().put("key", "cloudOwner").put("value", "aic")).put(new JSONObject().put("key", "aicClli").put("value", "testAicClli2"))
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterObjectMapperTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterObjectMapperTest.java
index 339e9cbf17..5169663add 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterObjectMapperTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterObjectMapperTest.java
@@ -72,7 +72,6 @@ public class VnfAdapterObjectMapperTest {
}
@Test
- @Ignore
public void test_createVolumeGroupRequestMapper() throws Exception {
RequestContext requestContext = new RequestContext();
requestContext.setMsoRequestId("msoRequestId");
@@ -123,7 +122,7 @@ public class VnfAdapterObjectMapperTest {
expectedCreateVolumeGroupRequest.setVfModuleType(volumeGroup.getModelInfoVfModule().getModelName());
expectedCreateVolumeGroupRequest.setModelCustomizationUuid(volumeGroup.getModelInfoVfModule().getModelCustomizationUUID());
- Map<String, String> volumeGroupParams = new HashMap<>();
+ Map<String, Object> volumeGroupParams = new HashMap<>();
volumeGroupParams.put("vnf_id", genericVnf.getVnfId());
volumeGroupParams.put("vnf_name", genericVnf.getVnfName());
volumeGroupParams.put("vf_module_id", volumeGroup.getVolumeGroupId());
@@ -201,7 +200,7 @@ public class VnfAdapterObjectMapperTest {
expectedCreateVolumeGroupRequest.setVfModuleType(volumeGroup.getModelInfoVfModule().getModelName());
expectedCreateVolumeGroupRequest.setModelCustomizationUuid(volumeGroup.getModelInfoVfModule().getModelCustomizationUUID());
- Map<String, String> volumeGroupParams = new HashMap<>();
+ Map<String, Object> volumeGroupParams = new HashMap<>();
volumeGroupParams.put("vnf_id", genericVnf.getVnfId());
volumeGroupParams.put("vnf_name", genericVnf.getVnfName());
volumeGroupParams.put("vf_module_id", volumeGroup.getVolumeGroupId());
@@ -285,7 +284,6 @@ public class VnfAdapterObjectMapperTest {
}
@Test
- @Ignore
public void test_createVolumeGroupParams() throws Exception {
GenericVnf genericVnf = new GenericVnf();
genericVnf.setVnfId("vnfId");
@@ -308,7 +306,7 @@ public class VnfAdapterObjectMapperTest {
expectedVolumeGroupParams.put("paramTwo", "paramTwoValue");
expectedVolumeGroupParams.put("paramThree", "paramThreeValue");
- Map<String, String> actualVolumeGroupParams = vnfAdapterObjectMapper.createVolumeGroupParams(requestContext,genericVnf, volumeGroup, sdncVfModuleQueryResponse);
+ Map<String, Object> actualVolumeGroupParams = vnfAdapterObjectMapper.createVolumeGroupParams(requestContext,genericVnf, volumeGroup, sdncVfModuleQueryResponse);
assertEquals(expectedVolumeGroupParams, actualVolumeGroupParams);
}
@@ -329,13 +327,12 @@ public class VnfAdapterObjectMapperTest {
expectedVolumeGroupParams.put("vf_module_id", volumeGroup.getVolumeGroupId());
expectedVolumeGroupParams.put("vf_module_name", volumeGroup.getVolumeGroupName());
RequestContext requestContext = new RequestContext();
- Map<String, String> actualVolumeGroupParams = vnfAdapterObjectMapper.createVolumeGroupParams(requestContext,genericVnf, volumeGroup, null);
+ Map<String, Object> actualVolumeGroupParams = vnfAdapterObjectMapper.createVolumeGroupParams(requestContext,genericVnf, volumeGroup, null);
assertEquals(expectedVolumeGroupParams, actualVolumeGroupParams);
}
@Test
- @Ignore
public void test_createVolumeGroupParams_with_user_params() throws Exception {
GenericVnf genericVnf = new GenericVnf();
genericVnf.setVnfId("vnfId");
@@ -366,7 +363,7 @@ public class VnfAdapterObjectMapperTest {
expectedVolumeGroupParams.put("paramThree", "paramThreeValue");
expectedVolumeGroupParams.put("userParamKey", "userParamValue");
- Map<String, String> actualVolumeGroupParams = vnfAdapterObjectMapper.createVolumeGroupParams(requestContext,genericVnf, volumeGroup, sdncVfModuleQueryResponse);
+ Map<String, Object> actualVolumeGroupParams = vnfAdapterObjectMapper.createVolumeGroupParams(requestContext,genericVnf, volumeGroup, sdncVfModuleQueryResponse);
assertEquals(expectedVolumeGroupParams, actualVolumeGroupParams);
}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapperPayloadTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapperPayloadTest.java
index a156c382d1..00e5c10f73 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapperPayloadTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapperPayloadTest.java
@@ -76,7 +76,7 @@ public class VnfAdapterVfModuleObjectMapperPayloadTest {
serviceInstance.setModelInfoServiceInstance(modelInfoServiceInstance);
RequestContext requestContext = new RequestContext();
- HashMap<String, String> userParams = new HashMap<String, String>();
+ Map<String, Object> userParams = new HashMap<>();
userParams.put("key1", "value2");
requestContext.setMsoRequestId("requestId");
requestContext.setUserParams(userParams);
@@ -150,7 +150,7 @@ public class VnfAdapterVfModuleObjectMapperPayloadTest {
serviceInstance.setModelInfoServiceInstance(modelInfoServiceInstance);
RequestContext requestContext = new RequestContext();
- HashMap<String, String> userParams = new HashMap<String, String>();
+ Map<String, Object> userParams = new HashMap<>();
userParams.put("key1", "value2");
requestContext.setMsoRequestId("requestId");
requestContext.setUserParams(userParams);
@@ -223,7 +223,7 @@ public class VnfAdapterVfModuleObjectMapperPayloadTest {
serviceInstance.setModelInfoServiceInstance(modelInfoServiceInstance);
RequestContext requestContext = new RequestContext();
- HashMap<String, String> userParams = new HashMap<String, String>();
+ Map<String, Object> userParams = new HashMap<>();
userParams.put("key1", "value2");
requestContext.setMsoRequestId("requestId");
requestContext.setUserParams(userParams);
@@ -295,7 +295,7 @@ public class VnfAdapterVfModuleObjectMapperPayloadTest {
//
RequestContext requestContext = new RequestContext();
- HashMap<String, String> userParams = new HashMap<String, String>();
+ Map<String, Object> userParams = new HashMap<>();
userParams.put("key1", "value2");
requestContext.setMsoRequestId("requestId");
requestContext.setUserParams(userParams);
@@ -375,7 +375,7 @@ public class VnfAdapterVfModuleObjectMapperPayloadTest {
//
RequestContext requestContext = new RequestContext();
- HashMap<String, String> userParams = new HashMap<String, String>();
+ Map<String, Object> userParams = new HashMap<>();
userParams.put("key1", "value2");
requestContext.setMsoRequestId("requestId");
requestContext.setUserParams(userParams);
@@ -450,7 +450,7 @@ public class VnfAdapterVfModuleObjectMapperPayloadTest {
serviceInstance.setModelInfoServiceInstance(modelInfoServiceInstance);
RequestContext requestContext = new RequestContext();
- HashMap<String, String> userParams = new HashMap<String, String>();
+ Map<String, Object> userParams = new HashMap<>();
userParams.put("key1", "value2");
requestContext.setMsoRequestId("requestId");
requestContext.setUserParams(userParams);
@@ -521,7 +521,7 @@ public class VnfAdapterVfModuleObjectMapperPayloadTest {
serviceInstance.setModelInfoServiceInstance(modelInfoServiceInstance);
RequestContext requestContext = new RequestContext();
- HashMap<String, String> userParams = new HashMap<String, String>();
+ Map<String, Object> userParams = new HashMap<>();
userParams.put("key1", "value1");
requestContext.setMsoRequestId("requestId");
requestContext.setUserParams(userParams);
@@ -591,7 +591,7 @@ public class VnfAdapterVfModuleObjectMapperPayloadTest {
serviceInstance.setModelInfoServiceInstance(modelInfoServiceInstance);
RequestContext requestContext = new RequestContext();
- HashMap<String, String> userParams = new HashMap<String, String>();
+ Map<String, Object> userParams = new HashMap<>();
userParams.put("key1", "value1");
requestContext.setMsoRequestId("requestId");
requestContext.setUserParams(userParams);
@@ -661,7 +661,7 @@ public class VnfAdapterVfModuleObjectMapperPayloadTest {
serviceInstance.setModelInfoServiceInstance(modelInfoServiceInstance);
RequestContext requestContext = new RequestContext();
- HashMap<String, String> userParams = new HashMap<String, String>();
+ Map<String, Object> userParams = new HashMap<>();
userParams.put("key1", "value1");
requestContext.setMsoRequestId("requestId");
requestContext.setUserParams(userParams);
@@ -798,7 +798,7 @@ public class VnfAdapterVfModuleObjectMapperPayloadTest {
serviceInstance.setModelInfoServiceInstance(modelInfoServiceInstance);
RequestContext requestContext = new RequestContext();
- HashMap<String, String> userParams = new HashMap<String, String>();
+ Map<String, Object> userParams = new HashMap<>();
userParams.put("key1", "value1");
requestContext.setMsoRequestId("requestId");
requestContext.setUserParams(userParams);
@@ -853,7 +853,7 @@ public class VnfAdapterVfModuleObjectMapperPayloadTest {
String json = new String(Files.readAllBytes(Paths.get(JSON_FILE_LOCATION + "grApiVmNetworkSubSectionWith5GParams.json")));
GenericResourceApiVmNetworkData network = omapper.readValue(json, GenericResourceApiVmNetworkData.class);
- Map<String, String> paramsMap = new HashMap<>();
+ Map<String, Object> paramsMap = new HashMap<>();
vfModuleObjectMapper.buildVlanInformation(paramsMap, network, "testKey", "testType");
assertEquals("1,3", paramsMap.get("testKey_testType_private_vlans"));
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapperTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapperTest.java
index 160feed426..81d30e33c5 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapperTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapperTest.java
@@ -67,7 +67,7 @@ public class VnfAdapterVfModuleObjectMapperTest {
@Test
public void addPairToMapTest() {
- Map<String, String> map = new HashMap<>();
+ Map<String, Object> map = new HashMap<>();
mapper.addPairToMap(map, "test", "_key", Arrays.asList("a", "b"));
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/SDNCConfigurationResourcesTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/SDNCConfigurationResourcesTest.java
index 4d90a3fcc9..0023066949 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/SDNCConfigurationResourcesTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/SDNCConfigurationResourcesTest.java
@@ -22,9 +22,7 @@ package org.onap.so.client.orchestration;
import static org.junit.Assert.assertNotNull;
import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.ArgumentMatchers.isA;
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.times;
+import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.verify;
import java.net.URI;
@@ -35,10 +33,11 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.Spy;
import org.mockito.junit.MockitoJUnitRunner;
+import org.onap.sdnc.northbound.client.model.GenericResourceApiGcTopologyOperationInformation;
+import org.onap.sdnc.northbound.client.model.GenericResourceApiRequestActionEnumeration;
import org.onap.so.bpmn.common.data.TestDataSetup;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.Configuration;
import org.onap.so.bpmn.servicedecomposition.bbobjects.Customer;
import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance;
@@ -47,19 +46,17 @@ import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext;
import org.onap.so.client.exception.BadResponseException;
import org.onap.so.client.exception.MapperException;
import org.onap.so.client.sdnc.SDNCClient;
-import org.onap.so.client.sdnc.endpoint.SDNCTopology;
+import org.onap.so.client.sdnc.beans.SDNCSvcAction;
import org.onap.so.client.sdnc.mapper.GCTopologyOperationRequestMapper;
-import org.onap.sdnc.northbound.client.model.GenericResourceApiGcTopologyOperationInformation;
-
@RunWith(MockitoJUnitRunner.Silent.class)
public class SDNCConfigurationResourcesTest extends TestDataSetup{
@InjectMocks
private SDNCConfigurationResources sdncConfigurationResources = new SDNCConfigurationResources();
- @Spy
- GCTopologyOperationRequestMapper MOCK_gcTopologyMapper ;
+ @Mock
+ private GCTopologyOperationRequestMapper MOCK_gcTopologyMapper ;
@Mock
protected SDNCClient MOCK_sdncClient;
@@ -82,24 +79,34 @@ public class SDNCConfigurationResourcesTest extends TestDataSetup{
@Test
public void activateVnrConfigurationTest() throws BadResponseException, MapperException, URISyntaxException {
GenericResourceApiGcTopologyOperationInformation response = sdncConfigurationResources.activateVnrConfiguration(serviceInstance,requestContext,customer,vpnBondingLink.getVnrConfiguration(),vnf,"uuid",new URI("http://localhost"));
- assertNotNull(response);
+ verify(MOCK_gcTopologyMapper).assignOrActivateVnrReqMapper(
+ eq(SDNCSvcAction.ACTIVATE), eq(GenericResourceApiRequestActionEnumeration.CREATEGENERICCONFIGURATIONINSTANCE),
+ eq(serviceInstance), eq(requestContext), eq(customer), any(Configuration.class), any(GenericVnf.class), any(String.class), any(URI.class));
+
}
@Test
public void assignVnrConfigurationTest() throws BadResponseException, MapperException, URISyntaxException {
GenericResourceApiGcTopologyOperationInformation response = sdncConfigurationResources.assignVnrConfiguration(serviceInstance,requestContext,customer,vpnBondingLink.getVnrConfiguration(),vnf,"uuid",new URI("http://localhost"));
- assertNotNull(response);
+ verify(MOCK_gcTopologyMapper).assignOrActivateVnrReqMapper(
+ eq(SDNCSvcAction.ASSIGN), eq(GenericResourceApiRequestActionEnumeration.CREATEGENERICCONFIGURATIONINSTANCE),
+ eq(serviceInstance), eq(requestContext), eq(customer), any(Configuration.class), any(GenericVnf.class), any(String.class), any(URI.class));
+
}
@Test
public void unAssignVnrConfigurationTest() throws BadResponseException, MapperException , URISyntaxException{
GenericResourceApiGcTopologyOperationInformation response = sdncConfigurationResources.unAssignVnrConfiguration(serviceInstance,requestContext,vpnBondingLink.getVnrConfiguration(),"uuid",new URI("http://localhost"));
- assertNotNull(response);
+ verify(MOCK_gcTopologyMapper).deactivateOrUnassignVnrReqMapper(
+ eq(SDNCSvcAction.UNASSIGN), eq(serviceInstance), eq(requestContext), any(Configuration.class), any(String.class), any(URI.class));
+
}
@Test
public void deactivateVnrConfigurationTest() throws BadResponseException, MapperException , URISyntaxException{
GenericResourceApiGcTopologyOperationInformation response = sdncConfigurationResources.deactivateVnrConfiguration(serviceInstance,requestContext,vpnBondingLink.getVnrConfiguration(),"uuid",new URI("http://localhost"));
- assertNotNull(response);
+ verify(MOCK_gcTopologyMapper).deactivateOrUnassignVnrReqMapper(
+ eq(SDNCSvcAction.DEACTIVATE), eq(serviceInstance), eq(requestContext), any(Configuration.class), any(String.class), any(URI.class));
+
}
}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/GCTopologyOperationRequestMapperTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/GCTopologyOperationRequestMapperTest.java
index f01eeaeae8..f4d442bbc3 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/GCTopologyOperationRequestMapperTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/GCTopologyOperationRequestMapperTest.java
@@ -24,9 +24,15 @@ import java.net.URI;
import java.net.URISyntaxException;
import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import org.junit.Assert;
import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.mockito.Spy;
+import org.mockito.junit.MockitoJUnitRunner;
+import org.onap.sdnc.northbound.client.model.GenericResourceApiGcTopologyOperationInformation;
import org.onap.so.bpmn.common.data.TestDataSetup;
import org.onap.so.bpmn.servicedecomposition.bbobjects.Configuration;
import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
@@ -38,11 +44,14 @@ import org.onap.so.bpmn.servicedecomposition.bbobjects.VpnBondingLink;
import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext;
import org.onap.so.client.sdnc.beans.SDNCSvcAction;
-import org.onap.sdnc.northbound.client.model.GenericResourceApiGcTopologyOperationInformation;
-
-
-public class GCTopologyOperationRequestMapperTest extends TestDataSetup{
+@RunWith(MockitoJUnitRunner.Silent.class)
+public class GCTopologyOperationRequestMapperTest extends TestDataSetup {
+
+ @Spy
+ private GeneralTopologyObjectMapper generalTopologyObjectMapper;
+
+ @InjectMocks
private GCTopologyOperationRequestMapper genObjMapper = new GCTopologyOperationRequestMapper();
@Test
@@ -80,13 +89,13 @@ public class GCTopologyOperationRequestMapperTest extends TestDataSetup{
private RequestContext getRequestContext() {
RequestContext requestContext = new RequestContext();
requestContext.setMsoRequestId("MsoRequestId");
- HashMap<String, String> userParams = getUserParams();
+ Map<String, Object> userParams = getUserParams();
requestContext.setUserParams(userParams);
return requestContext;
}
- private HashMap<String, String> getUserParams() {
- HashMap<String,String> userParams = new HashMap<>();
+ private Map<String, Object> getUserParams() {
+ Map<String,Object> userParams = new HashMap<>();
userParams.put("lppCustomerId","lppCustomerId");
return userParams;
}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/GeneralTopologyObjectMapperTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/GeneralTopologyObjectMapperTest.java
index bf2cd347c0..3bb54278b6 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/GeneralTopologyObjectMapperTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/GeneralTopologyObjectMapperTest.java
@@ -29,6 +29,7 @@ import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import java.util.HashMap;
+import java.util.Map;
import org.junit.After;
import org.junit.Before;
@@ -104,7 +105,7 @@ public class GeneralTopologyObjectMapperTest extends TestDataSetup {
customer.getServiceSubscription().getServiceInstances().add(serviceInstance);
//
RequestContext requestContext = new RequestContext();
- HashMap<String, String> userParams = new HashMap<String, String>();
+ Map<String, Object> userParams = new HashMap<>();
userParams.put("key1", "value1");
requestContext.setUserParams(userParams);
requestContext.setProductFamilyId("productFamilyId");
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/NetworkTopologyOperationRequestMapperTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/NetworkTopologyOperationRequestMapperTest.java
index 307fe289a1..6a14f8b567 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/NetworkTopologyOperationRequestMapperTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/NetworkTopologyOperationRequestMapperTest.java
@@ -29,9 +29,16 @@ import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.HashMap;
+import java.util.Map;
import org.junit.Before;
import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.mockito.Spy;
+import org.mockito.junit.MockitoJUnitRunner;
+import org.onap.sdnc.northbound.client.model.GenericResourceApiNetworkOperationInformation;
+import org.onap.sdnc.northbound.client.model.GenericResourceApiRequestActionEnumeration;
import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion;
import org.onap.so.bpmn.servicedecomposition.bbobjects.Collection;
import org.onap.so.bpmn.servicedecomposition.bbobjects.Customer;
@@ -45,10 +52,9 @@ import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceInstance;
import org.onap.so.client.sdnc.beans.SDNCSvcAction;
import org.onap.so.client.sdnc.beans.SDNCSvcOperation;
-import org.onap.sdnc.northbound.client.model.GenericResourceApiNetworkOperationInformation;
-import org.onap.sdnc.northbound.client.model.GenericResourceApiRequestActionEnumeration;
import com.fasterxml.jackson.databind.ObjectMapper;
+@RunWith(MockitoJUnitRunner.class)
public class NetworkTopologyOperationRequestMapperTest {
private final static String JSON_FILE_LOCATION = "src/test/resources/__files/BuildingBlocks/";
@@ -59,6 +65,12 @@ public class NetworkTopologyOperationRequestMapperTest {
private RequestContext requestContext;
private L3Network network;
private CloudRegion cloudRegion;
+
+ @Spy
+ private GeneralTopologyObjectMapper generalTopologyObjectMapper;
+
+ @InjectMocks
+ private NetworkTopologyOperationRequestMapper mapper = new NetworkTopologyOperationRequestMapper();
@Before
public void before() {
@@ -93,7 +105,7 @@ public class NetworkTopologyOperationRequestMapperTest {
serviceInstance.setCollection(networkCollection);
//
requestContext = new RequestContext();
- HashMap<String, String> userParams = new HashMap<String, String>();
+ Map<String, Object> userParams = new HashMap<>();
userParams.put("key1", "value1");
requestContext.setUserParams(userParams);
requestContext.setProductFamilyId("productFamilyId");
@@ -115,7 +127,6 @@ public class NetworkTopologyOperationRequestMapperTest {
@Test
public void createGenericResourceApiNetworkOperationInformationTest() throws Exception {
- NetworkTopologyOperationRequestMapper mapper = new NetworkTopologyOperationRequestMapper();
GenericResourceApiNetworkOperationInformation networkSDNCrequest = mapper.reqMapper(
SDNCSvcOperation.NETWORK_TOPOLOGY_OPERATION, SDNCSvcAction.ASSIGN, GenericResourceApiRequestActionEnumeration.CREATENETWORKINSTANCE, network, serviceInstance, customer,
requestContext, cloudRegion);
@@ -132,7 +143,6 @@ public class NetworkTopologyOperationRequestMapperTest {
@Test
public void reqMapperTest() throws Exception {
- NetworkTopologyOperationRequestMapper mapper = new NetworkTopologyOperationRequestMapper();
GenericResourceApiNetworkOperationInformation networkSDNCrequest = mapper.reqMapper(
SDNCSvcOperation.NETWORK_TOPOLOGY_OPERATION, SDNCSvcAction.ASSIGN, GenericResourceApiRequestActionEnumeration.CREATENETWORKINSTANCE, network, serviceInstance, customer,
requestContext, cloudRegion);
@@ -143,7 +153,6 @@ public class NetworkTopologyOperationRequestMapperTest {
@Test
public void reqMapperNoCollectionTest() throws Exception {
- NetworkTopologyOperationRequestMapper mapper = new NetworkTopologyOperationRequestMapper();
GenericResourceApiNetworkOperationInformation networkSDNCrequest = mapper.reqMapper(
SDNCSvcOperation.NETWORK_TOPOLOGY_OPERATION, SDNCSvcAction.ASSIGN, GenericResourceApiRequestActionEnumeration.CREATENETWORKINSTANCE, network, serviceInstanceNoCollection, customer,
requestContext, cloudRegion);
@@ -154,7 +163,7 @@ public class NetworkTopologyOperationRequestMapperTest {
@Test
public void createGenericResourceApiNetworkOperationInformation_UnassignTest() throws Exception {
- NetworkTopologyOperationRequestMapper mapperUnassign = new NetworkTopologyOperationRequestMapper();
+ NetworkTopologyOperationRequestMapper mapperUnassign = mapper;
GenericResourceApiNetworkOperationInformation networkSDNCrequestUnassign = mapperUnassign.reqMapper(
SDNCSvcOperation.NETWORK_TOPOLOGY_OPERATION, SDNCSvcAction.UNASSIGN, GenericResourceApiRequestActionEnumeration.DELETENETWORKINSTANCE, network, serviceInstance, customer,
requestContext, cloudRegion);
@@ -172,7 +181,6 @@ public class NetworkTopologyOperationRequestMapperTest {
@Test
public void createGenericResourceApiNetworkOperationInformationNoNetworkNameTest() throws Exception {
- NetworkTopologyOperationRequestMapper mapper = new NetworkTopologyOperationRequestMapper();
//set network name NULL
network.setNetworkName(null);
GenericResourceApiNetworkOperationInformation networkSDNCrequest = mapper.reqMapper(
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/ServiceTopologyOperationMapperTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/ServiceTopologyOperationMapperTest.java
index 5d8b31b3bf..0bf06a0bb0 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/ServiceTopologyOperationMapperTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/ServiceTopologyOperationMapperTest.java
@@ -26,8 +26,13 @@ import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.HashMap;
+import java.util.Map;
import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.mockito.Spy;
+import org.mockito.junit.MockitoJUnitRunner;
import org.onap.so.bpmn.servicedecomposition.bbobjects.Customer;
import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance;
import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceSubscription;
@@ -41,8 +46,15 @@ import org.onap.sdnc.northbound.client.model.GenericResourceApiRequestActionEnum
import org.onap.sdnc.northbound.client.model.GenericResourceApiServiceOperationInformation;
import com.fasterxml.jackson.databind.ObjectMapper;
+@RunWith(MockitoJUnitRunner.class)
public class ServiceTopologyOperationMapperTest {
+ @Spy
+ private GeneralTopologyObjectMapper generalTopologyObjectMapper;
+
+ @InjectMocks
+ private ServiceTopologyOperationMapper mapper = new ServiceTopologyOperationMapper();
+
@Test
public void reqMapperTest() throws Exception {
// prepare and set service instance
@@ -64,12 +76,11 @@ public class ServiceTopologyOperationMapperTest {
//prepare RequestContext
RequestContext requestContext = new RequestContext();
- HashMap<String, String> userParams = new HashMap<String, String>();
+ Map<String, Object> userParams = new HashMap<>();
userParams.put("key1", "value1");
requestContext.setUserParams(userParams);
requestContext.setProductFamilyId("productFamilyId");
- ServiceTopologyOperationMapper mapper = new ServiceTopologyOperationMapper();
GenericResourceApiServiceOperationInformation serviceOpInformation = mapper.reqMapper(
SDNCSvcOperation.SERVICE_TOPOLOGY_OPERATION, SDNCSvcAction.ASSIGN, GenericResourceApiRequestActionEnumeration.CREATESERVICEINSTANCE, serviceInstance, customer,
requestContext);
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/VfModuleTopologyOperationRequestMapperTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/VfModuleTopologyOperationRequestMapperTest.java
index 7d5aa9d1d9..282f23caa7 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/VfModuleTopologyOperationRequestMapperTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/VfModuleTopologyOperationRequestMapperTest.java
@@ -35,6 +35,10 @@ import java.util.Map;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.mockito.Spy;
+import org.mockito.junit.MockitoJUnitRunner;
import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion;
import org.onap.so.bpmn.servicedecomposition.bbobjects.Customer;
import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
@@ -54,11 +58,18 @@ import org.onap.so.client.sdnc.beans.SDNCSvcOperation;
import org.onap.sdnc.northbound.client.model.GenericResourceApiVfModuleOperationInformation;
import com.fasterxml.jackson.databind.ObjectMapper;
+@RunWith(MockitoJUnitRunner.class)
public class VfModuleTopologyOperationRequestMapperTest {
private final static String JSON_FILE_LOCATION = "src/test/resources/__files/BuildingBlocks/";
private final static String ERRORMESSAGE = "VF Module model info is null for testVfModuleId";
+ @Spy
+ private GeneralTopologyObjectMapper generalTopologyObjectMapper;
+
+ @InjectMocks
+ private VfModuleTopologyOperationRequestMapper mapper = new VfModuleTopologyOperationRequestMapper();
+
@Rule
public ExpectedException expectedException = ExpectedException.none();
@@ -84,7 +95,7 @@ public class VfModuleTopologyOperationRequestMapperTest {
customer.getServiceSubscription().getServiceInstances().add(serviceInstance);
//
RequestContext requestContext = new RequestContext();
- HashMap<String,String> userParams = new HashMap<String,String>();
+ Map<String,Object> userParams = new HashMap<>();
userParams.put("key1", "value1");
requestContext.setUserParams(userParams);
requestContext.setProductFamilyId("productFamilyId");
@@ -124,7 +135,6 @@ public class VfModuleTopologyOperationRequestMapperTest {
CloudRegion cloudRegion = new CloudRegion();
- VfModuleTopologyOperationRequestMapper mapper = new VfModuleTopologyOperationRequestMapper();
GenericResourceApiVfModuleOperationInformation vfModuleSDNCrequest = mapper.reqMapper(
SDNCSvcOperation.VF_MODULE_TOPOLOGY_OPERATION, SDNCSvcAction.ASSIGN, vfModule, volumeGroup, vnf, serviceInstance, customer,
cloudRegion, requestContext, null);
@@ -159,7 +169,6 @@ public class VfModuleTopologyOperationRequestMapperTest {
vfModule.setVfModuleId("testVfModuleId");
vfModule.setVfModuleName("testVfModuleName");
- VfModuleTopologyOperationRequestMapper mapper = new VfModuleTopologyOperationRequestMapper();
GenericResourceApiVfModuleOperationInformation vfModuleSDNCrequest = mapper.reqMapper(
SDNCSvcOperation.VF_MODULE_TOPOLOGY_OPERATION, SDNCSvcAction.UNASSIGN, vfModule, null, vnf, serviceInstance, null,
null, null, null);
@@ -197,9 +206,9 @@ public class VfModuleTopologyOperationRequestMapperTest {
//
RequestContext requestContext = new RequestContext();
RequestParameters requestParameters = new RequestParameters();
- HashMap<String,Object> userParams1 = new HashMap<String,Object>();
+ HashMap<String,Object> userParams1 = new HashMap<>();
userParams1.put("key1", "value1");
- List<Map<String,Object>> userParams = new ArrayList<Map<String,Object>>();
+ List<Map<String,Object>> userParams = new ArrayList<>();
userParams.add(userParams1);
requestParameters.setUserParams(userParams);
@@ -230,7 +239,6 @@ public class VfModuleTopologyOperationRequestMapperTest {
CloudRegion cloudRegion = new CloudRegion();
- VfModuleTopologyOperationRequestMapper mapper = new VfModuleTopologyOperationRequestMapper();
GenericResourceApiVfModuleOperationInformation vfModuleSDNCrequest = mapper.reqMapper(
SDNCSvcOperation.VF_MODULE_TOPOLOGY_OPERATION, SDNCSvcAction.ASSIGN, vfModule, null, vnf, serviceInstance, customer,
cloudRegion, requestContext, null);
@@ -261,7 +269,7 @@ public class VfModuleTopologyOperationRequestMapperTest {
customer.getServiceSubscription().getServiceInstances().add(serviceInstance);
//
RequestContext requestContext = new RequestContext();
- HashMap<String, String> userParams = new HashMap<String, String>();
+ Map<String, Object> userParams = new HashMap<String, Object>();
userParams.put("key1", "value1");
requestContext.setUserParams(userParams);
requestContext.setProductFamilyId("productFamilyId");
@@ -284,7 +292,6 @@ public class VfModuleTopologyOperationRequestMapperTest {
CloudRegion cloudRegion = new CloudRegion();
- VfModuleTopologyOperationRequestMapper mapper = new VfModuleTopologyOperationRequestMapper();
expectedException.expect(MapperException.class);
expectedException.expectMessage(ERRORMESSAGE);
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/VnfTopologyOperationRequestMapperTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/VnfTopologyOperationRequestMapperTest.java
index 63c3680e8c..229a8cf601 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/VnfTopologyOperationRequestMapperTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/VnfTopologyOperationRequestMapperTest.java
@@ -25,9 +25,14 @@ import static org.junit.Assert.assertNull;
import java.util.ArrayList;
import java.util.HashMap;
+import java.util.Map;
import java.util.List;
import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.mockito.Spy;
+import org.mockito.junit.MockitoJUnitRunner;
import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion;
import org.onap.so.bpmn.servicedecomposition.bbobjects.Customer;
import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
@@ -45,8 +50,15 @@ import org.onap.so.client.sdnc.beans.SDNCSvcOperation;
import org.onap.sdnc.northbound.client.model.GenericResourceApiRequestActionEnumeration;
import org.onap.sdnc.northbound.client.model.GenericResourceApiVnfOperationInformation;
+@RunWith(MockitoJUnitRunner.class)
public class VnfTopologyOperationRequestMapperTest {
+ @Spy
+ private GeneralTopologyObjectMapper generalTopologyObjectMapper;
+
+ @InjectMocks
+ private VnfTopologyOperationRequestMapper mapper = new VnfTopologyOperationRequestMapper();
+
@Test
public void reqMapperTest() throws Exception {
// prepare and set service instance
@@ -106,14 +118,13 @@ public class VnfTopologyOperationRequestMapperTest {
//prepare RequestContext
RequestContext requestContext = new RequestContext();
- HashMap<String, String> userParams = new HashMap<String, String>();
+ Map<String, Object> userParams = new HashMap<>();
userParams.put("key1", "value1");
requestContext.setUserParams(userParams);
requestContext.setProductFamilyId("productFamilyId");
CloudRegion cloudRegion = new CloudRegion();
- VnfTopologyOperationRequestMapper mapper = new VnfTopologyOperationRequestMapper();
GenericResourceApiVnfOperationInformation vnfOpInformation = mapper.reqMapper(
SDNCSvcOperation.VNF_TOPOLOGY_OPERATION, SDNCSvcAction.ASSIGN,GenericResourceApiRequestActionEnumeration.CREATEVNFINSTANCE, vnf, serviceInstance, customer,
cloudRegion, requestContext,true);