summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/SDNCAdapterService.java20
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/client/SDNCAdapterCallbackRequest.java12
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/client/SDNCCallbackAdapterService.java24
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/impl/MapRequestTunables.java31
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/impl/SDNCAdapterPortTypeImpl.java13
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/impl/SDNCRestClient.java57
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/impl/Utils.java24
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/BPRestCallback.java31
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/MapTypedRequestTunablesData.java33
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCAdapterUtils.java10
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCConnector.java49
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCServiceRequestConnector.java10
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCServiceRequestTask.java33
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SNIROResponse.java31
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/TypedRequestTunables.java9
-rw-r--r--adapters/mso-sdnc-adapter/src/test/java/org/onap/so/adapters/sdnc/FileUtil.java9
-rw-r--r--adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/NSResourceInputParameter.java11
-rw-r--r--adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/rest/HealthCheckHandler.java10
-rw-r--r--adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/rest/VfcAdapterRest.java46
-rw-r--r--adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/util/JsonUtil.java11
-rw-r--r--adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/util/RestfulUtil.java31
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/GeneralTopologyObjectMapper.java2
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/GeneralTopologyObjectMapperTest.java4
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/genericResourceApiVfModuleOperationInformationUnassign.json2
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/RequestParametersValidation.java4
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/validation/RequestParametersValidationTest.java15
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/VfModuleRequestParametersNoALaCarte.json55
27 files changed, 349 insertions, 238 deletions
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/SDNCAdapterService.java b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/SDNCAdapterService.java
index e74dd64bb3..5deec41d94 100644
--- a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/SDNCAdapterService.java
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/SDNCAdapterService.java
@@ -5,6 +5,7 @@
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Modifications Copyright (C) 2018 IBM.
+ * 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.
@@ -33,6 +34,8 @@ import javax.xml.ws.WebServiceFeature;
import org.onap.so.logger.MessageEnum;
import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* This class was generated by Apache CXF 2.7.11.redhat-3
@@ -46,7 +49,7 @@ import org.onap.so.logger.MsoLogger;
targetNamespace = "http://org.onap/workflow/sdnc/adapter/wsdl/v1")
public class SDNCAdapterService extends Service {
- private static MsoLogger logger = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA, SDNCAdapterService.class);
+ private static Logger logger = LoggerFactory.getLogger(SDNCAdapterService.class);
private static final String SDNC_ADAPTER_WSDL="SDNCAdapter.wsdl";
public static final URL WSDL_LOCATION;
@@ -58,16 +61,19 @@ public class SDNCAdapterService extends Service {
try {
wsdlUrl = Thread.currentThread().getContextClassLoader().getResource("main/resources/SDNCAdapter.wsdl");
} catch (Exception e) {
- logger.error(MessageEnum.RA_WSDL_NOT_FOUND, SDNC_ADAPTER_WSDL, "", "", MsoLogger.ErrorCode.DataError, "Exception - WSDL not found", e);
+ logger.error("{} {} {} {}", MessageEnum.RA_WSDL_NOT_FOUND.toString(), SDNC_ADAPTER_WSDL,
+ MsoLogger.ErrorCode.DataError.getValue(), "Exception - WSDL not found", e);
}
if(wsdlUrl == null) {
- logger.error(MessageEnum.RA_WSDL_NOT_FOUND, SDNC_ADAPTER_WSDL, "", "", MsoLogger.ErrorCode.DataError, "WSDL not found");
- } else {
+ logger.error("{} {} {} {}", MessageEnum.RA_WSDL_NOT_FOUND.toString(), SDNC_ADAPTER_WSDL,
+ MsoLogger.ErrorCode.DataError.getValue(), "WSDL not found");
+ } else {
try {
- logger.info(MessageEnum.RA_PRINT_URL, SDNC_ADAPTER_WSDL, wsdlUrl.toURI().toString(), "");
+ logger.info("{} {} {}", MessageEnum.RA_PRINT_URL.toString(), SDNC_ADAPTER_WSDL, wsdlUrl.toURI().toString());
} catch (Exception e) {
- logger.error(MessageEnum.RA_WSDL_URL_CONVENTION_EXC, SDNC_ADAPTER_WSDL, "", "", MsoLogger.ErrorCode.DataError, "Exception - print URL", e);
- }
+ logger.error("{} {} {} {}", MessageEnum.RA_WSDL_URL_CONVENTION_EXC.toString(), SDNC_ADAPTER_WSDL,
+ MsoLogger.ErrorCode.DataError.getValue(), "Exception - print URL", e);
+ }
}
WSDL_LOCATION = wsdlUrl;
}
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/client/SDNCAdapterCallbackRequest.java b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/client/SDNCAdapterCallbackRequest.java
index 7ec20afffd..3dcd008ba5 100644
--- a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/client/SDNCAdapterCallbackRequest.java
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/client/SDNCAdapterCallbackRequest.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,6 +35,9 @@ import javax.xml.bind.annotation.XmlType;
import org.onap.so.logger.MessageEnum;
import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
/**
* <p>Java class for anonymous complex type.
*
@@ -67,7 +72,7 @@ public class SDNCAdapterCallbackRequest {
@XmlElement(name = "RequestData")
protected Object requestData;
- private static MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA, SDNCAdapterCallbackRequest.class);
+ private static Logger logger = LoggerFactory.getLogger(SDNCAdapterCallbackRequest.class);
/**
* Gets the value of the callbackHeader property.
@@ -130,8 +135,9 @@ public class SDNCAdapterCallbackRequest {
}
catch (Exception e)
{
- msoLogger.error(MessageEnum.RA_MARSHING_ERROR, "", "", MsoLogger.ErrorCode.DataError, "Exception - MARSHING_ERROR", e);
- }
+ logger.error("{} {} {}", MessageEnum.RA_MARSHING_ERROR.toString(), MsoLogger.ErrorCode.DataError.getValue(),
+ "Exception - MARSHING_ERROR", e);
+ }
return "";
}
}
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/client/SDNCCallbackAdapterService.java b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/client/SDNCCallbackAdapterService.java
index e4882090bf..fd288c6a04 100644
--- a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/client/SDNCCallbackAdapterService.java
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/client/SDNCCallbackAdapterService.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
@@ -31,6 +33,8 @@ import javax.xml.ws.WebServiceFeature;
import org.onap.so.logger.MessageEnum;
import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* This class was generated by Apache CXF 2.7.11.redhat-3
@@ -44,7 +48,7 @@ import org.onap.so.logger.MsoLogger;
targetNamespace = "http://org.onap/workflow/sdnc/adapter/callback/wsdl/v1")
public class SDNCCallbackAdapterService extends Service {
- private static MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA, SDNCCallbackAdapterService.class);
+ private static Logger logger = LoggerFactory.getLogger(SDNCCallbackAdapterService.class);
private static final String SDNC_CALLBACK_ADAPTER_WSDL="SDNCCallbackAdapter.wsdl";
public static final URL WSDL_LOCATION;
public static final QName SERVICE = new QName("http://org.onap/workflow/sdnc/adapter/callback/wsdl/v1", "SDNCCallbackAdapterService");
@@ -54,16 +58,20 @@ public class SDNCCallbackAdapterService extends Service {
try {
wsdlUrl = Thread.currentThread().getContextClassLoader().getResource("main/resources/SDNCCallbackAdapter.wsdl");
} catch (Exception e) {
- msoLogger.error(MessageEnum.RA_WSDL_NOT_FOUND, SDNC_CALLBACK_ADAPTER_WSDL, "SDNC", "", MsoLogger.ErrorCode.DataError, "Exception - WSDL not found", e);
+ logger.error("{} {} {} {} {}", MessageEnum.RA_WSDL_NOT_FOUND.toString(), SDNC_CALLBACK_ADAPTER_WSDL, "SDNC",
+ MsoLogger.ErrorCode.DataError.getValue(), "Exception - WSDL not found", e);
}
if(wsdlUrl == null) {
- msoLogger.error(MessageEnum.RA_WSDL_NOT_FOUND, SDNC_CALLBACK_ADAPTER_WSDL, "SDNC", "", MsoLogger.ErrorCode.DataError, "WSDL not found");
- } else {
+ logger.error("{} {} {} {} {}", MessageEnum.RA_WSDL_NOT_FOUND.toString(), SDNC_CALLBACK_ADAPTER_WSDL, "SDNC",
+ MsoLogger.ErrorCode.DataError.getValue(), "WSDL not found");
+ } else {
try {
- msoLogger.info(MessageEnum.RA_PRINT_URL, SDNC_CALLBACK_ADAPTER_WSDL, wsdlUrl.toURI().toString(), "SDNC");
- } catch (Exception e) {
- msoLogger.error(MessageEnum.RA_WSDL_URL_CONVENTION_EXC, SDNC_CALLBACK_ADAPTER_WSDL, "SDNC", "", MsoLogger.ErrorCode.DataError, "Exception - URL convention problem", e);
- }
+ logger.info("{} {} {} {}", MessageEnum.RA_PRINT_URL.toString(), SDNC_CALLBACK_ADAPTER_WSDL,
+ wsdlUrl.toURI().toString(), "SDNC");
+ } catch (Exception e) {
+ logger.error("{} {} {} {} {}", MessageEnum.RA_WSDL_URL_CONVENTION_EXC.toString(), SDNC_CALLBACK_ADAPTER_WSDL,
+ "SDNC", MsoLogger.ErrorCode.DataError.getValue(), "Exception - URL convention problem", e);
+ }
}
WSDL_LOCATION = wsdlUrl;
}
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/impl/MapRequestTunables.java b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/impl/MapRequestTunables.java
index a5800fc73d..6262f2d86f 100644
--- a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/impl/MapRequestTunables.java
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/impl/MapRequestTunables.java
@@ -5,6 +5,7 @@
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Modifications Copyright (C) 2018 IBM.
+ * 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.
@@ -24,6 +25,8 @@ package org.onap.so.adapters.sdnc.impl;
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.core.env.Environment;
import org.springframework.stereotype.Component;
@@ -31,7 +34,7 @@ import org.springframework.stereotype.Component;
@Component
public class MapRequestTunables {
- private static MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA,MapRequestTunables.class);
+ private static Logger logger = LoggerFactory.getLogger(MapRequestTunables.class);
public static final String GENERATED_KEY = "Generated key: ";
@Autowired
@@ -44,14 +47,14 @@ public class MapRequestTunables {
String key;
if ("query".equals(reqTunable.getAction())) { //due to variable format for reqTunable.getOperation() eg services/layer3-service-list/8fe4ba4f-35cf-4d9b-a04a-fd3f5d4c5cc9
key = Constants.REQUEST_TUNABLES + "." + reqTunable.getMsoAction() + ".." + reqTunable.getAction();
- msoLogger.debug(GENERATED_KEY + key);
+ logger.debug(GENERATED_KEY + key);
}
else if ("put".equals(reqTunable.getAction()) || "restdelete".equals(reqTunable.getAction())) { //due to variable format for reqTunable.getOperation() eg services/layer3-service-list/8fe4ba4f-35cf-4d9b-a04a-fd3f5d4c5cc9
key = Constants.REQUEST_TUNABLES + "..." + reqTunable.getAction();
- msoLogger.debug(GENERATED_KEY + key);
+ logger.debug(GENERATED_KEY + key);
} else {
key = Constants.REQUEST_TUNABLES + "." + reqTunable.getMsoAction() + "." + reqTunable.getOperation() +"." + reqTunable.getAction();
- msoLogger.debug(GENERATED_KEY + key);
+ logger.debug(GENERATED_KEY + key);
}
String value;
@@ -61,31 +64,32 @@ public class MapRequestTunables {
String[] parts = value.split("\\|"); //escape pipe
if (parts.length < 3) {
- msoLogger.warn(MessageEnum.RA_SDNC_INVALID_CONFIG, key, value, "SDNC", "", MsoLogger.ErrorCode.DataError, "Invalid config");
+ logger.warn("{} {} {} {} {} {}", MessageEnum.RA_SDNC_INVALID_CONFIG.toString(), key, value, "SDNC",
+ MsoLogger.ErrorCode.DataError.getValue(), "Invalid config");
}
for (int i = 0; i < parts.length; i++) {
if (i == 0) {
reqTunable.setReqMethod(parts[i]) ;
- msoLogger.debug("Request Method is set to: " + reqTunable.getReqMethod());
+ logger.debug("Request Method is set to: {}", reqTunable.getReqMethod());
} else if (i == 1) {
reqTunable.setTimeout( parts[i]);
- msoLogger.debug("Timeout is set to: " + reqTunable.getTimeout());
+ logger.debug("Timeout is set to: {}", reqTunable.getTimeout());
} else if (i == 2) {
reqTunable.setSdncUrl(env.getProperty(Constants.REQUEST_TUNABLES + "." + parts[i],""));
if (reqTunable.getOperation() != null && reqTunable.getSdncUrl() != null) {
reqTunable.setSdncUrl(reqTunable.getSdncUrl() + reqTunable.getOperation());
}
- msoLogger.debug("SDNC Url is set to: " + reqTunable.getSdncUrl());
+ logger.debug("SDNC Url is set to: {}", reqTunable.getSdncUrl());
} else if (i == 3) {
reqTunable.setHeaderName(parts[i]);
- msoLogger.debug("HeaderName is set to: " + reqTunable.getHeaderName());
+ logger.debug("HeaderName is set to: {}", reqTunable.getHeaderName());
} else if (i == 4) {
reqTunable.setNamespace(parts[i]);
- msoLogger.debug("NameSpace is set to: " + reqTunable.getNamespace());
+ logger.debug("NameSpace is set to: {}", reqTunable.getNamespace());
} else if (i == 5) {
reqTunable.setAsyncInd(parts[i]);
- msoLogger.debug("AsyncInd is set to: " + reqTunable.getAsyncInd());
+ logger.debug("AsyncInd is set to: {}", reqTunable.getAsyncInd());
}
}
@@ -96,9 +100,10 @@ public class MapRequestTunables {
error = "Missing configuration for:" + key;
}
if (error != null) {
- msoLogger.error(MessageEnum.RA_SDNC_MISS_CONFIG_PARAM, key, "SDNC", "", MsoLogger.ErrorCode.DataError, "Missing config param");
+ logger.error("{} {} {} {} {}", MessageEnum.RA_SDNC_MISS_CONFIG_PARAM.toString(), key, "SDNC",
+ MsoLogger.ErrorCode.DataError.getValue(), "Missing config param");
}
- msoLogger.debug ("RequestTunables Key:" + key + " Value:" + value + " Tunables:" + this.toString());
+ logger.debug("RequestTunables Key:{} Value:{} Tunables:{}", key, value, this.toString());
return reqTunable;
}
}
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/impl/SDNCAdapterPortTypeImpl.java b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/impl/SDNCAdapterPortTypeImpl.java
index 4a6ac9f5e2..cf81ae4be0 100644
--- a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/impl/SDNCAdapterPortTypeImpl.java
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/impl/SDNCAdapterPortTypeImpl.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,6 +32,8 @@ import org.onap.so.adapters.sdnc.SDNCAdapterResponse;
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;
@@ -40,7 +44,7 @@ public class SDNCAdapterPortTypeImpl implements SDNCAdapterPortType {
- private static MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA,SDNCAdapterPortTypeImpl.class);
+ private static Logger logger = LoggerFactory.getLogger(SDNCAdapterPortTypeImpl.class);
@Autowired
@@ -48,7 +52,7 @@ public class SDNCAdapterPortTypeImpl implements SDNCAdapterPortType {
@PostConstruct
public void init () {
- msoLogger.info(MessageEnum.RA_INIT_SDNC_ADAPTER, "SDNC", "SDNCAdapterPortType", "");
+ logger.info("{} {} {}", MessageEnum.RA_INIT_SDNC_ADAPTER.toString(), "SDNC", "SDNCAdapterPortType");
}
/**
@@ -57,7 +61,7 @@ public class SDNCAdapterPortTypeImpl implements SDNCAdapterPortType {
@Override
public void healthCheck ()
{
- msoLogger.debug("Health check call in SDNC Adapter");
+ logger.debug("Health check call in SDNC Adapter");
}
@@ -70,7 +74,8 @@ public class SDNCAdapterPortTypeImpl implements SDNCAdapterPortType {
}
catch (Exception e){
String respMsg = "Error sending request to SDNC. Failed to start SDNC Client thread " + e.getMessage();
- msoLogger.error(MessageEnum.RA_SEND_REQUEST_SDNC_ERR, "SDNC", "", MsoLogger.ErrorCode.DataError, respMsg, e);
+ logger.error("{} {} {} {}", MessageEnum.RA_SEND_REQUEST_SDNC_ERR.toString(), "SDNC",
+ MsoLogger.ErrorCode.DataError.getValue(), respMsg, e);
SDNCResponse sdncResp = new SDNCResponse(bpelReqId);
sdncResp.setRespCode(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/impl/SDNCRestClient.java b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/impl/SDNCRestClient.java
index 59884f25b8..d7f2c11d0b 100644
--- a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/impl/SDNCRestClient.java
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/impl/SDNCRestClient.java
@@ -55,6 +55,8 @@ import org.onap.so.adapters.sdnc.client.SDNCCallbackAdapterService;
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.core.env.Environment;
import org.springframework.scheduling.annotation.Async;
@@ -74,7 +76,7 @@ public class SDNCRestClient{
@Autowired
private MapRequestTunables tunablesMapper;
- private static MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA,SDNCRestClient.class);
+ private static Logger logger = LoggerFactory.getLogger(SDNCRestClient.class);
private static final String EXCEPTION_MSG="Exception while evaluate xpath";
private static final String MSO_INTERNAL_ERROR="MsoInternalError";
@@ -83,7 +85,7 @@ public class SDNCRestClient{
public void executeRequest(SDNCAdapterRequest bpelRequest)
{
- msoLogger.debug("BPEL Request:" + bpelRequest.toString());
+ logger.debug("BPEL Request:" + bpelRequest.toString());
// Added delay to allow completion of create request to SDNC
// before executing activate of create request.
@@ -124,11 +126,9 @@ public class SDNCRestClient{
}
long sdncStartTime = System.currentTimeMillis();
SDNCResponse sdncResp = getSdncResp(sdncReqBody, rt);
- msoLogger.recordMetricEvent (sdncStartTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully received response from SDNC", "SDNC", action + "." + operation, null);
- msoLogger.debug ("Got the SDNC Response: " + sdncResp.getSdncRespXml());
+ logger.debug ("Got the SDNC Response: {}", sdncResp.getSdncRespXml());
long bpelStartTime = System.currentTimeMillis();
sendRespToBpel(callbackUrl, sdncResp);
- msoLogger.recordMetricEvent (bpelStartTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully send reauest to BPEL", "BPMN", callbackUrl, null);
return;
}
@@ -142,8 +142,8 @@ public class SDNCRestClient{
SDNCResponse sdncResp = new SDNCResponse(rt.getReqId());
StringBuilder response = new StringBuilder();
- msoLogger.info(MessageEnum.RA_SEND_REQUEST_SDNC.name() + ":\n" + rt.toString(), "SDNC", "");
- msoLogger.trace("SDNC Request Body:\n" + sdncReqBody);
+ logger.info("{} :\n {} {}", MessageEnum.RA_SEND_REQUEST_SDNC.name(), rt.toString(), "SDNC");
+ logger.trace("SDNC Request Body:{} \n", sdncReqBody);
try {
@@ -186,12 +186,13 @@ public class SDNCRestClient{
}
sdncResp.setSdncRespXml(response.toString());
- msoLogger.info(MessageEnum.RA_RESPONSE_FROM_SDNC.name() + ":\n" + sdncResp.toString(), "SDNC", "");
+ logger.info("{} :\n {} {}", MessageEnum.RA_RESPONSE_FROM_SDNC.name(), sdncResp.toString(), "SDNC");
return(sdncResp);
}
catch (Exception e)
{
- msoLogger.error(MessageEnum.RA_EXCEPTION_COMMUNICATE_SDNC, "SDNC", "", MsoLogger.ErrorCode.BusinessProcesssError, "Exception processing request to SDNC", e);
+ logger.error("{} {} {} {}", MessageEnum.RA_EXCEPTION_COMMUNICATE_SDNC.toString(), "SDNC",
+ MsoLogger.ErrorCode.BusinessProcesssError.getValue(), "Exception processing request to SDNC", e);
//default
sdncResp.setRespCode(HttpURLConnection.HTTP_INTERNAL_ERROR);
String respMsg = "Error processing request to SDNC. ";
@@ -231,7 +232,8 @@ public class SDNCRestClient{
eType = xpath.evaluate("error-type", error);
sdncErrMsg = new StringBuilder(". SDNC Returned-[error-type:" + eType);
} catch (Exception e3) {
- msoLogger.error (MessageEnum.RA_EVALUATE_XPATH_ERROR, "error-type", error.toString(), "SDNC", "", MsoLogger.ErrorCode.DataError, EXCEPTION_MSG, e3);
+ logger.error("{} {} {} {} {} {}", MessageEnum.RA_EVALUATE_XPATH_ERROR.toString(), "error-type",
+ error.toString(), "SDNC", MsoLogger.ErrorCode.DataError.getValue(), EXCEPTION_MSG, e3);
}
String eTag = null;
@@ -239,7 +241,8 @@ public class SDNCRestClient{
eTag = xpath.evaluate( "error-tag", error);
sdncErrMsg.append(", error-tag:").append(eTag);
} catch (Exception e3) {
- msoLogger.error (MessageEnum.RA_EVALUATE_XPATH_ERROR, "error-tag", error.toString(), "SDNC", "", MsoLogger.ErrorCode.DataError, EXCEPTION_MSG, e3);
+ logger.error("{} {} {} {} {} {}", MessageEnum.RA_EVALUATE_XPATH_ERROR.toString(), "error-tag",
+ error.toString(), "SDNC", MsoLogger.ErrorCode.DataError.getValue(), EXCEPTION_MSG, e3);
}
String eMsg = null;
@@ -247,15 +250,18 @@ public class SDNCRestClient{
eMsg = xpath.evaluate("error-message", error);
sdncErrMsg.append(", error-message:").append(eMsg).append("]");
} catch (Exception e3) {
- msoLogger.error (MessageEnum.RA_EVALUATE_XPATH_ERROR, "error-message", error.toString(), "SDNC", "", MsoLogger.ErrorCode.DataError, EXCEPTION_MSG, e3);
+ logger.error("{} {} {} {} {} {}", MessageEnum.RA_EVALUATE_XPATH_ERROR.toString(), "error-message", error.toString(),
+ "SDNC", MsoLogger.ErrorCode.DataError.getValue(), EXCEPTION_MSG, e3);
}
}
} catch (Exception e2) {
- msoLogger.error (MessageEnum.RA_ANALYZE_ERROR_EXC, "SDNC", "", MsoLogger.ErrorCode.DataError, "Exception while analyse error", e2);
+ logger.error("{} {} {} {}", MessageEnum.RA_ANALYZE_ERROR_EXC.toString(), "SDNC",
+ MsoLogger.ErrorCode.DataError.getValue(), "Exception while analyse error", e2);
}
} //is != null
} catch (Exception e1) {
- msoLogger.error (MessageEnum.RA_ERROR_GET_RESPONSE_SDNC, "SDNC", "", MsoLogger.ErrorCode.BusinessProcesssError, "Exception while get SDNC response", e1);
+ logger.error("{} {} {} {}", MessageEnum.RA_ERROR_GET_RESPONSE_SDNC.toString(), "SDNC",
+ MsoLogger.ErrorCode.BusinessProcesssError.getValue(), "Exception while get SDNC response", e1);
}
} //con != null
@@ -266,7 +272,8 @@ public class SDNCRestClient{
sdncResp.setRespMsg(respMsg);
- msoLogger.error(MessageEnum.RA_EXCEPTION_COMMUNICATE_SDNC, "SDNC", "", MsoLogger.ErrorCode.AvailabilityError, "Exception while communicate with SDNC", e);
+ logger.error("{} {} {} {}", MessageEnum.RA_EXCEPTION_COMMUNICATE_SDNC.toString(), "SDNC",
+ MsoLogger.ErrorCode.AvailabilityError.getValue(), "Exception while communicate with SDNC", e);
return sdncResp;
}
@@ -289,14 +296,15 @@ public class SDNCRestClient{
{
cbReq.setRequestData(sdncResp.getSdncRespXml());
}
- msoLogger.info(MessageEnum.RA_CALLBACK_BPEL.name() + ":\n" + cbReq.toString(), CAMUNDA, "");
+ logger.info("{} :\n {} {}", MessageEnum.RA_CALLBACK_BPEL.name(), cbReq.toString(), CAMUNDA);
URL wsdlUrl = null;
try {
wsdlUrl = new URL (bpelUrl);
} catch (MalformedURLException e1) {
error = "Caught exception initializing Callback wsdl " + e1.getMessage();
- msoLogger.error(MessageEnum.RA_INIT_CALLBACK_WSDL_ERR, CAMUNDA, "", MsoLogger.ErrorCode.DataError, "Exception initializing Callback wsdl", e1);
+ logger.error("{} {} {} {}", MessageEnum.RA_INIT_CALLBACK_WSDL_ERR.toString(), CAMUNDA,
+ MsoLogger.ErrorCode.DataError.getValue(), "Exception initializing Callback wsdl", e1);
}
@@ -310,7 +318,7 @@ public class SDNCRestClient{
bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, wsdlUrl.toExternalForm());
}
else {
- msoLogger.debug("wsdlUrl is NULL:");
+ logger.debug("wsdlUrl is NULL:");
}
//authentication
@@ -326,22 +334,23 @@ public class SDNCRestClient{
}
catch (Exception e2) {
error = "Unable to set authorization in callback request " + e2.getMessage();
- msoLogger.error(MessageEnum.RA_SET_CALLBACK_AUTH_EXC, CAMUNDA, "", MsoLogger.ErrorCode.BusinessProcesssError, "Exception - Unable to set authorization in callback request", e2);
+ logger.error("{} {} {} {}", MessageEnum.RA_SET_CALLBACK_AUTH_EXC.toString(), CAMUNDA,
+ MsoLogger.ErrorCode.BusinessProcesssError.getValue(),
+ "Exception - Unable to set authorization in callback request", e2);
}
- msoLogger.debug("Invoking Bpel Callback. BpelCallbackUrl:" + bpelUrl);
+ logger.debug("Invoking Bpel Callback. BpelCallbackUrl:{}", bpelUrl);
cbPort.sdncAdapterCallback(cbReq);
}
catch (Exception e)
{
error = "Error sending BpelCallback request" + e.getMessage();
- msoLogger.error("Error " + MsoLogger.ErrorCode.BusinessProcesssError + " - " + MessageEnum.RA_CALLBACK_BPEL_EXC + " - " + error, e);
-
+ logger.error("Error {} - {} - {}", MsoLogger.ErrorCode.BusinessProcesssError.getValue(),
+ MessageEnum.RA_CALLBACK_BPEL_EXC.toString(), error, e);
}
- msoLogger.info(MessageEnum.RA_CALLBACK_BPEL_COMPLETE.name(), CAMUNDA, "");
+ logger.info(MessageEnum.RA_CALLBACK_BPEL_COMPLETE.name(), CAMUNDA);
return;
}
-
}
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/impl/Utils.java b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/impl/Utils.java
index 55af0d7cad..96e7dcf51a 100644
--- a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/impl/Utils.java
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/impl/Utils.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,15 @@ import javax.xml.transform.stream.StreamResult;
import org.onap.so.logger.MessageEnum;
import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
public class Utils {
- private static MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA, Utils.class);
+ private static Logger logger = LoggerFactory.getLogger(Utils.class);
private Utils() {
}
@@ -94,11 +98,12 @@ public class Utils {
}
String s = domToStr(newdoc);
- msoLogger.debug("Formatted SdncReq:\n" + s);
+ logger.debug("Formatted SdncReq:\n", s);
return s;
} catch (Exception e) {
- msoLogger.error(MessageEnum.RA_ERROR_CREATE_SDNC_REQUEST, "SDNC", "", MsoLogger.ErrorCode.BusinessProcesssError, "Exception in genSdncReq", e);
+ logger.error("{} {} {} {}", MessageEnum.RA_ERROR_CREATE_SDNC_REQUEST.toString(), "SDNC",
+ MsoLogger.ErrorCode.BusinessProcesssError.getValue(), "Exception in genSdncReq", e);
}
return null;
}
@@ -127,11 +132,12 @@ public class Utils {
}
String s = domToStr(newdoc);
- msoLogger.debug("Formatted SdncPutReq:\n" + s);
+ logger.debug("Formatted SdncPutReq:\n {}", s);
return s;
} catch (Exception e) {
- msoLogger.error(MessageEnum.RA_ERROR_CREATE_SDNC_REQUEST, "SDNC", "", MsoLogger.ErrorCode.DataError, "Exception in genSdncPutReq", e);
+ logger.error("{} {} {} {}", MessageEnum.RA_ERROR_CREATE_SDNC_REQUEST.toString(), "SDNC",
+ MsoLogger.ErrorCode.DataError.getValue(), "Exception in genSdncPutReq", e);
}
return null;
}
@@ -161,11 +167,12 @@ public class Utils {
root.appendChild(elem3);
String s = domToStr(newdoc);
- msoLogger.debug("Formatted SdncReq:" + s);
+ logger.debug("Formatted SdncReq: {}", s);
return s;
} catch (Exception e) {
- msoLogger.error(MessageEnum.RA_ERROR_CREATE_SDNC_RESPONSE, "SDNC", "", MsoLogger.ErrorCode.DataError, "Exception in genMsoFailResp", e);
+ logger.error("{} {} {} {}", MessageEnum.RA_ERROR_CREATE_SDNC_RESPONSE.toString(), "SDNC",
+ MsoLogger.ErrorCode.DataError.getValue(), "Exception in genMsoFailResp", e);
}
return null;
}
@@ -191,7 +198,8 @@ public class Utils {
s = s.replaceAll("xmlns=\"\"", "");
return s;
} catch (Exception e) {
- msoLogger.error(MessageEnum.RA_ERROR_CONVERT_XML2STR, "", "", MsoLogger.ErrorCode.DataError, "Exception - domToStr", e);
+ logger.error("{} {} {}", MessageEnum.RA_ERROR_CONVERT_XML2STR.toString(), MsoLogger.ErrorCode.DataError
+ .getValue(), "Exception - domToStr", e);
}
}
return null;
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/BPRestCallback.java b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/BPRestCallback.java
index e427423763..6a66770d29 100644
--- a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/BPRestCallback.java
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/BPRestCallback.java
@@ -6,6 +6,7 @@
* Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
* ================================================================================
* Modifications Copyright (C) 2018 IBM.
+ * 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.
@@ -38,6 +39,8 @@ import org.onap.so.adapters.sdnc.impl.Constants;
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.so.utils.CryptoUtils;
@@ -49,7 +52,7 @@ import org.springframework.core.env.Environment;
*/
@Component
public class BPRestCallback {
- private static final MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA,BPRestCallback.class);
+ private static final Logger logger = LoggerFactory.getLogger(BPRestCallback.class);
private static final String CAMUNDA="Camunda";
private static final String MSO_INTERNAL_ERROR="MsoInternalError";
@@ -66,7 +69,7 @@ public class BPRestCallback {
* @return true if the message was consumed successfully by the endpoint
*/
public boolean send(String workflowMessageUrl, String messageType, String correlator, String message) {
- LOGGER.debug(getClass().getSimpleName() + ".send("
+ logger.debug(getClass().getSimpleName() + ".send("
+ "workflowMessageUrl=" + workflowMessageUrl
+ " messageType=" + messageType
+ " correlator=" + correlator
@@ -91,12 +94,13 @@ public class BPRestCallback {
* @return true if the message was consumed successfully by the endpoint
*/
public boolean send(String url, String message) {
- LOGGER.debug(getClass().getSimpleName() + ".send("
+ logger.debug(getClass().getSimpleName() + ".send("
+ "url=" + url
+ " message=" + message
+ ")");
- LOGGER.info(MessageEnum.RA_CALLBACK_BPEL, message == null ? "[no content]" : message, CAMUNDA, "");
+ logger.info("{} {} {}", MessageEnum.RA_CALLBACK_BPEL.toString(), message == null ? "[no content]" : message,
+ CAMUNDA);
HttpPost method = null;
HttpResponse httpResponse = null;
@@ -129,8 +133,8 @@ public class BPRestCallback {
method.setHeader(ONAPLogConstants.Headers.INVOCATION_ID,MDC.get(ONAPLogConstants.MDCs.INVOCATION_ID));
method.setHeader(ONAPLogConstants.Headers.PARTNER_NAME,"SO-SDNCAdapter");
} catch (Exception e) {
- LOGGER.error(MessageEnum.RA_SET_CALLBACK_AUTH_EXC, CAMUNDA, "", MsoLogger.ErrorCode.BusinessProcesssError,
- "Unable to set authorization in callback request", e);
+ logger.error("{} {} {} {}", MessageEnum.RA_SET_CALLBACK_AUTH_EXC.toString(), CAMUNDA,
+ MsoLogger.ErrorCode.BusinessProcesssError.getValue(), "Unable to set authorization in callback request", e);
error = true;
}
@@ -146,14 +150,15 @@ public class BPRestCallback {
if (httpResponse.getStatusLine().getStatusCode() >= 300) {
String msg = "Received error response to callback request: " + httpResponse.getStatusLine();
- LOGGER.error(MessageEnum.RA_CALLBACK_BPEL_EXC, CAMUNDA, "", MsoLogger.ErrorCode.BusinessProcesssError, msg);
+ logger.error("{} {} {} {}", MessageEnum.RA_CALLBACK_BPEL_EXC.toString(), CAMUNDA, MsoLogger.ErrorCode
+ .BusinessProcesssError.getValue(), msg);
}
}
return true;
} catch (Exception e) {
- LOGGER.error(MessageEnum.RA_CALLBACK_BPEL_EXC, CAMUNDA, "", MsoLogger.ErrorCode.BusinessProcesssError,
- "Error sending callback request", e);
+ logger.error("{} {} {} {}", MessageEnum.RA_CALLBACK_BPEL_EXC.toString(), CAMUNDA,
+ MsoLogger.ErrorCode.BusinessProcesssError.getValue(), "Error sending callback request", e);
return false;
} finally {
if (httpResponse != null) {
@@ -161,7 +166,7 @@ public class BPRestCallback {
EntityUtils.consume(httpResponse.getEntity());
httpResponse = null;
} catch (Exception e) {
- LOGGER.debug("Exception:", e);
+ logger.debug("Exception:", e);
}
}
@@ -169,10 +174,10 @@ public class BPRestCallback {
try {
method.reset();
} catch (Exception e) {
- LOGGER.debug("Exception:", e);
+ logger.debug("Exception:", e);
}
}
- LOGGER.info(MessageEnum.RA_CALLBACK_BPEL_COMPLETE, CAMUNDA, "","");
+ logger.info("{} {}", MessageEnum.RA_CALLBACK_BPEL_COMPLETE.toString(), CAMUNDA);
}
}
-} \ No newline at end of file
+}
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/MapTypedRequestTunablesData.java b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/MapTypedRequestTunablesData.java
index 6f40ba07a9..fd9ce4c719 100644
--- a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/MapTypedRequestTunablesData.java
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/MapTypedRequestTunablesData.java
@@ -5,6 +5,7 @@
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Modifications Copyright (C) 2018 IBM.
+ * 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.
@@ -27,6 +28,8 @@ import org.onap.so.adapters.sdnc.impl.Constants;
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.core.env.Environment;
import org.springframework.stereotype.Component;
@@ -34,9 +37,7 @@ import org.springframework.stereotype.Component;
@Component
public class MapTypedRequestTunablesData {
- private static MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA,MapTypedRequestTunablesData.class);
-
-
+ private static Logger logger = LoggerFactory.getLogger(MapTypedRequestTunablesData.class);
private static final String MISSING_CONFIGURATION_ERROR_MSG= "Missing configuration for: ";
private static final String MISSING_CONFIG_PARAM_ERROR_MSG="Missing config param";
@@ -54,7 +55,8 @@ public class MapTypedRequestTunablesData {
if ("".equals(value)) {
error= MISSING_CONFIGURATION_ERROR_MSG + reqTunable.getKey();
- msoLogger.error(MessageEnum.RA_SDNC_MISS_CONFIG_PARAM, reqTunable.getKey(), "SDNC", "", MsoLogger.ErrorCode.DataError, MISSING_CONFIG_PARAM_ERROR_MSG);
+ logger.error("{} {} {} {} {}", MessageEnum.RA_SDNC_MISS_CONFIG_PARAM.toString(), reqTunable.getKey(), "SDNC",
+ MsoLogger.ErrorCode.DataError.getValue(), MISSING_CONFIG_PARAM_ERROR_MSG);
throw new SDNCAdapterException(error);
}
@@ -63,41 +65,42 @@ public class MapTypedRequestTunablesData {
if (parts.length != 5) {
error="Invalid configuration for: " + reqTunable.getKey();
- msoLogger.error(MessageEnum.RA_SDNC_INVALID_CONFIG, reqTunable.getKey(), value, "SDNC", "", MsoLogger.ErrorCode.DataError, "Invalid config");
-
+ logger.error("{} {} {} {} {} {}", MessageEnum.RA_SDNC_INVALID_CONFIG.toString(), reqTunable.getKey(), value, "SDNC",
+ MsoLogger.ErrorCode.DataError.getValue(), "Invalid config");
throw new SDNCAdapterException(error);
}
reqTunable.setReqMethod(parts[0]);
- msoLogger.trace("Request Method is set to: " + reqTunable.getReqMethod());
+ logger.trace("Request Method is set to: {}", reqTunable.getReqMethod());
reqTunable.setTimeout(parts[1]);
- msoLogger.trace("Timeout is set to: " + reqTunable.getTimeout());
+ logger.trace("Timeout is set to: {}", reqTunable.getTimeout());
String urlPropKey = Constants.REQUEST_TUNABLES + "." + parts[2];
reqTunable.setSdncUrl(env.getProperty(urlPropKey, ""));
if ("".equals(reqTunable.getSdncUrl())) {
error=MISSING_CONFIGURATION_ERROR_MSG + urlPropKey;
- msoLogger.error(MessageEnum.RA_SDNC_MISS_CONFIG_PARAM, urlPropKey, "SDNC", "", MsoLogger.ErrorCode.DataError, MISSING_CONFIG_PARAM_ERROR_MSG);
+ logger.error("{} {} {} {} {}", MessageEnum.RA_SDNC_MISS_CONFIG_PARAM.toString(), urlPropKey, "SDNC",
+ MsoLogger.ErrorCode.DataError.getValue(), MISSING_CONFIG_PARAM_ERROR_MSG);
throw new SDNCAdapterException(error);
}
- msoLogger.trace("SDNC Url is set to: " + reqTunable.getSdncUrl());
+ logger.trace("SDNC Url is set to: {}", reqTunable.getSdncUrl());
reqTunable.setHeaderName(parts[3]);
- msoLogger.trace("Header Name is set to: " + reqTunable.getHeaderName());
+ logger.trace("Header Name is set to: {}", reqTunable.getHeaderName());
reqTunable.setNamespace(parts[4]);
- msoLogger.trace("Namespace is set to: " + reqTunable.getNamespace());
+ logger.trace("Namespace is set to: {}", reqTunable.getNamespace());
reqTunable.setMyUrl(env.getProperty(Constants.MY_URL_PROP, ""));
if ("".equals(reqTunable.getMyUrl())) {
error=MISSING_CONFIGURATION_ERROR_MSG + Constants.MY_URL_PROP;
- msoLogger.error(MessageEnum.RA_SDNC_MISS_CONFIG_PARAM, Constants.MY_URL_PROP, "SDNC", "",
- MsoLogger.ErrorCode.DataError, MISSING_CONFIG_PARAM_ERROR_MSG);
+ logger.error("{} {} {} {} {}", MessageEnum.RA_SDNC_MISS_CONFIG_PARAM.toString(), Constants.MY_URL_PROP, "SDNC",
+ MsoLogger.ErrorCode.DataError.getValue(), MISSING_CONFIG_PARAM_ERROR_MSG);
throw new SDNCAdapterException(error);
}
@@ -108,7 +111,7 @@ public class MapTypedRequestTunablesData {
reqTunable.setMyUrl(reqTunable.getMyUrl().concat(reqTunable.getMyUrlSuffix()));
- msoLogger.debug(reqTunable.toString());
+ logger.debug(reqTunable.toString());
return reqTunable;
}
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCAdapterUtils.java b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCAdapterUtils.java
index dcb1fdae8c..8cafbda325 100644
--- a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCAdapterUtils.java
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCAdapterUtils.java
@@ -5,6 +5,8 @@
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* Copyright (C) 2017 Huawei Technologies Co., Ltd. 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,11 +23,11 @@
package org.onap.so.adapters.sdnc.sdncrest;
-import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;
-import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.web.util.UriUtils;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -35,7 +37,7 @@ import org.w3c.dom.NodeList;
* Utility methods used by SDNCAdapterRest.
*/
public final class SDNCAdapterUtils {
- private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA, SDNCAdapterUtils.class);
+ private static final Logger logger = LoggerFactory.getLogger(SDNCAdapterUtils.class);
/**
* Instantiation is not allowed.
*/
@@ -67,4 +69,4 @@ public final class SDNCAdapterUtils {
public static String encodeURLPathSegment(String pathSegment) {
return UriUtils.encodePathSegment(pathSegment, "UTF-8");
}
-} \ No newline at end of file
+}
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCConnector.java b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCConnector.java
index 3ecf6337cf..06e7ab23a6 100644
--- a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCConnector.java
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCConnector.java
@@ -6,6 +6,7 @@
* Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
* ================================================================================
* Modifications Copyright (C) 2018 IBM.
+ * 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.
@@ -54,6 +55,8 @@ import org.onap.so.adapters.sdncrest.SDNCResponseCommon;
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.w3c.dom.Document;
@@ -68,7 +71,7 @@ import org.springframework.core.env.Environment;
*/
@Component
public abstract class SDNCConnector {
- private static final MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA,SDNCConnector.class);
+ private static final Logger logger = LoggerFactory.getLogger(SDNCConnector.class);
private static final String MSO_INTERNAL_ERROR="MsoInternalError";
private static final String XPATH_EXCEPTION="XPath Exception";
@@ -76,8 +79,8 @@ public abstract class SDNCConnector {
private Environment env;
public SDNCResponseCommon send(String content, TypedRequestTunables rt) {
- LOGGER.debug("SDNC URL: " + rt.getSdncUrl());
- LOGGER.debug("SDNC Request Body:\n" + content);
+ logger.debug("SDNC URL: {}", rt.getSdncUrl());
+ logger.debug("SDNC Request Body:\n {}", content);
HttpRequestBase method = null;
HttpResponse httpResponse = null;
@@ -122,7 +125,7 @@ public abstract class SDNCConnector {
method.setHeader("Accept", "application/yang.data+xml");
}
else {
- LOGGER.debug("method is NULL:");
+ logger.debug("method is NULL:");
}
@@ -137,8 +140,8 @@ public abstract class SDNCConnector {
int statusCode = httpResponse.getStatusLine().getStatusCode();
String statusMessage = httpResponse.getStatusLine().getReasonPhrase();
- LOGGER.debug("SDNC Response: " + statusCode + " " + statusMessage
- + (responseContent == null ? "" : System.lineSeparator() + responseContent));
+ logger.debug("SDNC Response: {} {}", statusCode,
+ statusMessage + (responseContent == null ? "" : System.lineSeparator() + responseContent));
if (httpResponse.getStatusLine().getStatusCode() >= 300) {
String errMsg = "SDNC returned " + statusCode + " " + statusMessage;
@@ -159,12 +162,12 @@ public abstract class SDNCConnector {
method.reset();
}
else {
- LOGGER.debug("method is NULL:");
+ logger.debug("method is NULL:");
}
method = null;
- LOGGER.info(MessageEnum.RA_RESPONSE_FROM_SDNC, responseContent, "SDNC", "");
+ logger.info("{} {} {}", MessageEnum.RA_RESPONSE_FROM_SDNC.toString(), responseContent, "SDNC");
return createResponseFromContent(statusCode, statusMessage, responseContent, rt);
} catch (SocketTimeoutException | ConnectTimeoutException e) {
@@ -182,7 +185,7 @@ public abstract class SDNCConnector {
try {
EntityUtils.consume(httpResponse.getEntity());
} catch (Exception e) {
- LOGGER.debug("Exception:", e);
+ logger.debug("Exception:", e);
}
}
@@ -190,22 +193,20 @@ public abstract class SDNCConnector {
try {
method.reset();
} catch (Exception e) {
- LOGGER.debug("Exception:", e);
+ logger.debug("Exception:", e);
}
}
}
}
protected void logError(String errMsg) {
- LOGGER.error(MessageEnum.RA_EXCEPTION_COMMUNICATE_SDNC, "SDNC", "",
- MsoLogger.ErrorCode.AvailabilityError, errMsg);
-
+ logger.error("{} {} {} {}", MessageEnum.RA_EXCEPTION_COMMUNICATE_SDNC.toString(), "SDNC",
+ MsoLogger.ErrorCode.AvailabilityError.getValue(), errMsg);
}
protected void logError(String errMsg, Throwable t) {
- LOGGER.error(MessageEnum.RA_EXCEPTION_COMMUNICATE_SDNC, "SDNC", "",
- MsoLogger.ErrorCode.AvailabilityError, errMsg, t);
-
+ logger.error("{} {} {} {}", MessageEnum.RA_EXCEPTION_COMMUNICATE_SDNC.toString(), "SDNC",
+ MsoLogger.ErrorCode.AvailabilityError.getValue(), errMsg, t);
}
/**
@@ -288,8 +289,8 @@ public abstract class SDNCConnector {
String errorType = xpath.evaluate("error-type", error);
info += "error-type:" + errorType;
} catch (XPathExpressionException e) {
- LOGGER.error(MessageEnum.RA_EVALUATE_XPATH_ERROR, "error-type", error.toString(), "SDNC", "",
- MsoLogger.ErrorCode.DataError, XPATH_EXCEPTION, e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.RA_EVALUATE_XPATH_ERROR.toString(), "error-type", error.toString(),
+ "SDNC", MsoLogger.ErrorCode.DataError.getValue(), XPATH_EXCEPTION, e);
}
try {
@@ -299,8 +300,8 @@ public abstract class SDNCConnector {
}
info += "error-tag:" + errorTag;
} catch (XPathExpressionException e) {
- LOGGER.error(MessageEnum.RA_EVALUATE_XPATH_ERROR, "error-tag", error.toString(), "SDNC", "",
- MsoLogger.ErrorCode.DataError, XPATH_EXCEPTION, e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.RA_EVALUATE_XPATH_ERROR.toString(), "error-tag", error.toString(),
+ "SDNC", MsoLogger.ErrorCode.DataError.getValue(), XPATH_EXCEPTION, e);
}
try {
@@ -310,8 +311,8 @@ public abstract class SDNCConnector {
}
info += "error-message:" + errorMessage;
} catch (Exception e) {
- LOGGER.error(MessageEnum.RA_EVALUATE_XPATH_ERROR, "error-message", error.toString(), "SDNC", "",
- MsoLogger.ErrorCode.DataError, XPATH_EXCEPTION, e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.RA_EVALUATE_XPATH_ERROR.toString(), "error-message",
+ error.toString(), "SDNC", MsoLogger.ErrorCode.DataError.getValue(), XPATH_EXCEPTION, e);
}
if (!info.isEmpty()) {
@@ -323,8 +324,8 @@ public abstract class SDNCConnector {
}
}
} catch (Exception e) {
- LOGGER.error (MessageEnum.RA_ANALYZE_ERROR_EXC, "SDNC", "",
- MsoLogger.ErrorCode.DataError, "Exception while analyzing errors", e);
+ logger.error("{} {} {} {}", MessageEnum.RA_ANALYZE_ERROR_EXC.toString(), "SDNC",
+ MsoLogger.ErrorCode.DataError.getValue(), "Exception while analyzing errors", e);
}
return output.toString();
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCServiceRequestConnector.java b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCServiceRequestConnector.java
index 8ca14501e5..57051e570e 100644
--- a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCServiceRequestConnector.java
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCServiceRequestConnector.java
@@ -6,6 +6,7 @@
* Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
* ================================================================================
* Modifications Copyright (C) 2018 IBM.
+ * 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.
@@ -38,7 +39,8 @@ import org.onap.so.adapters.sdncrest.SDNCErrorCommon;
import org.onap.so.adapters.sdncrest.SDNCResponseCommon;
import org.onap.so.adapters.sdncrest.SDNCServiceError;
import org.onap.so.adapters.sdncrest.SDNCServiceResponse;
-import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -52,17 +54,17 @@ import org.xml.sax.SAXException;
@Component
public class SDNCServiceRequestConnector extends SDNCConnector {
- private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA,SDNCServiceRequestConnector.class);
+ private static final Logger logger = LoggerFactory.getLogger(SDNCServiceRequestConnector.class);
@Override
protected SDNCResponseCommon createResponseFromContent(int statusCode, String statusMessage,
String responseContent, TypedRequestTunables rt) {
try {
return parseResponseContent(responseContent);
} catch (ParseException e) {
- LOGGER.error(e);
+ logger.error("Error occured:", e);
return createErrorResponse(HttpURLConnection.HTTP_INTERNAL_ERROR, e.getMessage(), rt);
}catch (Exception e) {
- LOGGER.error(e);
+ logger.error("Error occured:", e);
return createErrorResponse(HttpURLConnection.HTTP_INTERNAL_ERROR, e.getMessage(), rt);
}
}
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCServiceRequestTask.java b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCServiceRequestTask.java
index deb39ac54e..62233273b1 100644
--- a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCServiceRequestTask.java
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCServiceRequestTask.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,12 +36,13 @@ import javax.xml.transform.stream.StreamResult;
import org.apache.http.HttpStatus;
import org.onap.so.adapters.sdnc.exception.SDNCAdapterException;
import org.onap.so.adapters.sdncrest.RequestInformation;
-import org.onap.so.adapters.sdncrest.SDNCErrorCommon;
import org.onap.so.adapters.sdncrest.SDNCResponseCommon;
import org.onap.so.adapters.sdncrest.SDNCServiceError;
import org.onap.so.adapters.sdncrest.SDNCServiceRequest;
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.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
@@ -48,7 +51,7 @@ import org.w3c.dom.Element;
@Component
public class SDNCServiceRequestTask {
- private static final MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA,SDNCServiceRequestTask.class);
+ private static final Logger logger = LoggerFactory.getLogger(SDNCServiceRequestTask.class);
@Autowired
private SDNCServiceRequestConnector connector;
@@ -91,24 +94,8 @@ public class SDNCServiceRequestTask {
long sdncStartTime = System.currentTimeMillis();
SDNCResponseCommon response = connector.send(xml, mappedTunables);
- if (response instanceof SDNCErrorCommon) {
- LOGGER.recordMetricEvent(sdncStartTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,
- "Received success response from SDNC", "SDNC", sdncService + "." + sdncOperation, null);
- } else {
- LOGGER.recordMetricEvent(sdncStartTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError,
- "Received error response from SDNC", "SDNC", sdncService + "." + sdncOperation, null);
- }
-
long bpStartTime = System.currentTimeMillis();
boolean callbackSuccess = bpRestCallback.send(request.getBPNotificationUrl(), response.toJson());
-
- if (callbackSuccess) {
- LOGGER.recordMetricEvent(bpStartTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,
- "Sent notification", "BPMN", request.getBPNotificationUrl(), null);
- } else {
- LOGGER.recordMetricEvent(bpStartTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError,
- "Failed to send notification", "BPMN", request.getBPNotificationUrl(), null);
- }
}
private Element addChild(Element parent, String tag) {
@@ -206,8 +193,8 @@ public class SDNCServiceRequestTask {
addTextChild(agnosticServiceInformation, "content-type", contentType);
addTextChild(agnosticServiceInformation, "anydata", anydata);
} catch (Exception e) {
- LOGGER.error(MessageEnum.RA_ERROR_CREATE_SDNC_REQUEST, "SDNC", "",
- MsoLogger.ErrorCode.BusinessProcesssError, "Exception in genSdncReq", e);
+ logger.error("{} {} {} {}", MessageEnum.RA_ERROR_CREATE_SDNC_REQUEST.toString(), "SDNC",
+ MsoLogger.ErrorCode.BusinessProcesssError.getValue(), "Exception in genSdncReq", e);
return null;
}
@@ -225,12 +212,12 @@ public class SDNCServiceRequestTask {
transformer.transform(new DOMSource(doc), new StreamResult(writer));
xml = writer.toString();
} catch (Exception e) {
- LOGGER.error(MessageEnum.RA_ERROR_CONVERT_XML2STR, "", "",
- MsoLogger.ErrorCode.DataError, "Exception - domToStr", e);
+ logger.error("{} {} {}", MessageEnum.RA_ERROR_CONVERT_XML2STR.toString(), MsoLogger.ErrorCode.DataError.getValue(),
+ "Exception - domToStr", e);
return null;
}
- LOGGER.trace("Formatted SDNC service request XML:\n" + xml);
+ logger.trace("Formatted SDNC service request XML:\n {}", xml);
return xml;
}
}
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SNIROResponse.java b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SNIROResponse.java
index 48bc2d84bb..75a0b07643 100644
--- a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SNIROResponse.java
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SNIROResponse.java
@@ -5,6 +5,7 @@
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Modifications Copyright (C) 2018 IBM.
+ * 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.
@@ -35,6 +36,8 @@ import org.onap.so.adapters.sdnc.impl.Constants;
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.core.env.Environment;
import org.springframework.stereotype.Component;
@@ -47,7 +50,7 @@ import org.springframework.stereotype.Component;
@Path("/")
@Component
public class SNIROResponse {
- private static final MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA,SNIROResponse.class);
+ private static final Logger logger = LoggerFactory.getLogger(SNIROResponse.class);
@Autowired
@@ -61,34 +64,18 @@ public class SNIROResponse {
@Consumes("*/*")
@Produces({MediaType.TEXT_PLAIN})
public Response serviceNotification(@PathParam("correlator") String correlator, String content) {
- LOGGER.info(MessageEnum.RA_RECEIVE_SDNC_NOTIF, content, "SDNC", "SDNCNotify/SNIROResponse");
-
- long startTime = System.currentTimeMillis();
+ logger.info("{} {} {} {}", MessageEnum.RA_RECEIVE_SDNC_NOTIF.toString(), content, "SDNC",
+ "SDNCNotify/SNIROResponse");
String bpUrl = env.getProperty(Constants.BPEL_REST_URL_PROP, "");
if (bpUrl == null || ("").equals(bpUrl)) {
String error = "Missing configuration for: " + Constants.BPEL_REST_URL_PROP;
- LOGGER.error(MessageEnum.RA_SDNC_MISS_CONFIG_PARAM, Constants.BPEL_REST_URL_PROP, "SDNC", "",
- MsoLogger.ErrorCode.DataError, "Missing config param");
+ logger.error("{} {} {} {} {}", MessageEnum.RA_SDNC_MISS_CONFIG_PARAM.toString(), Constants.BPEL_REST_URL_PROP,
+ "SDNC", MsoLogger.ErrorCode.DataError.getValue(), "Missing config param");
return Response.status(HttpServletResponse.SC_BAD_REQUEST).entity(error).build();
}
-
- long bpStartTime = System.currentTimeMillis();
- boolean callbackSuccess = callback.send(bpUrl, "SNIROResponse", correlator, content);
-
- if (callbackSuccess) {
- LOGGER.recordMetricEvent(bpStartTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,
- "Sent notification", "BPMN", bpUrl, null);
- LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successful");
- } else {
- LOGGER.recordMetricEvent(bpStartTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError,
- "Failed to send notification", "BPMN", bpUrl, null);
- LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError,
- "Failed to send notification");
- }
-
return Response.status(204).build();
}
-} \ No newline at end of file
+}
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/TypedRequestTunables.java b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/TypedRequestTunables.java
index 6331d6aaae..4ff6dbc9a6 100644
--- a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/TypedRequestTunables.java
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/TypedRequestTunables.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.adapters.sdnc.sdncrest;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.onap.so.adapters.sdnc.impl.Constants;
-import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* Typed Request Tunables. Each entry is identified by a TYPE in the property name.
@@ -39,7 +42,7 @@ import org.onap.so.logger.MsoLogger;
*/
public class TypedRequestTunables {
- private static final MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA, TypedRequestTunables.class);
+ private static final Logger logger = LoggerFactory.getLogger(TypedRequestTunables.class);
private String reqId;
private String myUrlSuffix;
@@ -82,7 +85,7 @@ public class TypedRequestTunables {
*/
public void setServiceKey(String service, String operation) {
key = Constants.REQUEST_TUNABLES + ".service." + service + "." + operation;
- LOGGER.debug("Generated " + getClass().getSimpleName() + " key: " + key);
+ logger.debug("Generated {} key: {}", getClass().getSimpleName(), key);
}
/**
diff --git a/adapters/mso-sdnc-adapter/src/test/java/org/onap/so/adapters/sdnc/FileUtil.java b/adapters/mso-sdnc-adapter/src/test/java/org/onap/so/adapters/sdnc/FileUtil.java
index f2fba5900f..d72775399f 100644
--- a/adapters/mso-sdnc-adapter/src/test/java/org/onap/so/adapters/sdnc/FileUtil.java
+++ b/adapters/mso-sdnc-adapter/src/test/java/org/onap/so/adapters/sdnc/FileUtil.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,7 +22,8 @@
package org.onap.so.adapters.sdnc;
-import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.io.InputStream;
@@ -30,7 +33,7 @@ import java.io.InputStream;
*/
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.
@@ -53,7 +56,7 @@ public class FileUtil {
return "";
}
} catch (IOException e) {
- LOGGER.debug("Exception:", e);
+ logger.debug("Exception:", e);
return "";
}
}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/NSResourceInputParameter.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/NSResourceInputParameter.java
index ce5637baa3..5d9b7ce558 100644
--- a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/NSResourceInputParameter.java
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/NSResourceInputParameter.java
@@ -4,6 +4,7 @@
* ================================================================================
* Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (C) 2018 CMCC 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.
@@ -26,10 +27,10 @@ import java.io.ByteArrayOutputStream;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.Marshaller;
-import org.onap.so.logger.MsoLogger;
-
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* NS Create Input Parameter For VFC Adapter<br>
@@ -40,7 +41,7 @@ import com.fasterxml.jackson.databind.SerializationFeature;
*/
public class NSResourceInputParameter {
- private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA, NSResourceInputParameter.class);
+ private static final Logger logger = LoggerFactory.getLogger(NSResourceInputParameter.class);
private NsOperationKey nsOperationKey;
@@ -114,7 +115,7 @@ public class NSResourceInputParameter {
mapper.enable(SerializationFeature.WRAP_ROOT_VALUE);
jsonString = mapper.writeValueAsString(this);
} catch (Exception e) {
- LOGGER.debug("Exception:", e);
+ logger.debug("Exception:", e);
}
return jsonString;
}
@@ -128,7 +129,7 @@ public class NSResourceInputParameter {
marshaller.marshal(this, bs);
return bs.toString();
} catch (Exception e) {
- LOGGER.debug("Exception:", e);
+ logger.debug("Exception:", e);
return "";
}
}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/rest/HealthCheckHandler.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/rest/HealthCheckHandler.java
index c39a165338..52fd8fb103 100644
--- a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/rest/HealthCheckHandler.java
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/rest/HealthCheckHandler.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 Huawei Technologies Co., Ltd. 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,8 +29,8 @@ import javax.ws.rs.QueryParam;
import javax.ws.rs.core.Response;
import org.apache.http.HttpStatus;
-import org.onap.so.logger.MsoLogger;
-import org.onap.so.utils.UUIDChecker;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
/**
@@ -44,7 +46,7 @@ import org.springframework.stereotype.Component;
@Component
public class HealthCheckHandler {
- private static MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA, HealthCheckHandler.class);
+ private static Logger logger = LoggerFactory.getLogger(HealthCheckHandler.class);
private static final String CHECK_HTML = "<!DOCTYPE html><html><head><meta charset=\"ISO-8859-1\"><title>Health Check</title></head><body>Application ready</body></html>";
@@ -57,8 +59,6 @@ public class HealthCheckHandler {
@Path("/healthcheck")
@Produces("text/html")
public Response healthcheck(@QueryParam("requestId") String requestId) {
- MsoLogger.setServiceName("Healthcheck");
- UUIDChecker.verifyOldUUID(requestId, msoLogger);
return HEALTH_CHECK_RESPONSE;
}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/rest/VfcAdapterRest.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/rest/VfcAdapterRest.java
index 0f0a14c8f5..db613ea988 100644
--- a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/rest/VfcAdapterRest.java
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/rest/VfcAdapterRest.java
@@ -5,6 +5,7 @@
* Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
* ================================================================================
* Modifications Copyright (C) 2018 IBM.
+ * 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.
@@ -36,7 +37,8 @@ import org.onap.so.adapters.vfc.model.NsOperationKey;
import org.onap.so.adapters.vfc.model.RestfulResponse;
import org.onap.so.adapters.vfc.util.JsonUtil;
import org.onap.so.adapters.vfc.util.ValidateUtil;
-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;
@@ -52,7 +54,7 @@ import org.springframework.stereotype.Component;
@Path("/v1/vfcadapter")
public class VfcAdapterRest {
- private static final MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA, VfcAdapterRest.class);
+ private static final Logger logger = LoggerFactory.getLogger(VfcAdapterRest.class);
private static final String REQUEST_DEBUG_MSG="body from request is {}";
private static final String APPLICATION_EXCEPTION="ApplicationException: ";
@Autowired
@@ -76,12 +78,12 @@ public class VfcAdapterRest {
public Response createNfvoNs(String data) {
try {
ValidateUtil.assertObjectNotNull(data);
- LOGGER.debug(REQUEST_DEBUG_MSG + data);
+ logger.debug(REQUEST_DEBUG_MSG + data);
NSResourceInputParameter nsInput = JsonUtil.unMarshal(data, NSResourceInputParameter.class);
RestfulResponse rsp = driverMgr.createNs(nsInput);
return buildResponse(rsp);
} catch(ApplicationException e) {
- LOGGER.debug(APPLICATION_EXCEPTION, e);
+ logger.debug(APPLICATION_EXCEPTION, e);
return e.buildErrorResponse();
}
}
@@ -102,12 +104,12 @@ public class VfcAdapterRest {
try {
ValidateUtil.assertObjectNotNull(data);
- LOGGER.debug(REQUEST_DEBUG_MSG + data);
+ logger.debug(REQUEST_DEBUG_MSG + data);
NsOperationKey nsOperationKey = JsonUtil.unMarshal(data, NsOperationKey.class);
RestfulResponse rsp = driverMgr.deleteNs(nsOperationKey, nsInstanceId);
return buildResponse(rsp);
} catch(ApplicationException e) {
- LOGGER.debug(APPLICATION_EXCEPTION, e);
+ logger.debug(APPLICATION_EXCEPTION, e);
return e.buildErrorResponse();
}
}
@@ -127,12 +129,12 @@ public class VfcAdapterRest {
public Response queryNfvoJobStatus(String data, @PathParam("jobId") String jobId) {
try {
ValidateUtil.assertObjectNotNull(data);
- LOGGER.debug(REQUEST_DEBUG_MSG + data);
+ logger.debug(REQUEST_DEBUG_MSG + data);
NsOperationKey nsOperationKey = JsonUtil.unMarshal(data, NsOperationKey.class);
RestfulResponse rsp = driverMgr.getNsProgress(nsOperationKey, jobId);
return buildResponse(rsp);
} catch(ApplicationException e) {
- LOGGER.debug(APPLICATION_EXCEPTION, e);
+ logger.debug(APPLICATION_EXCEPTION, e);
return e.buildErrorResponse();
}
}
@@ -152,12 +154,12 @@ public class VfcAdapterRest {
public Response instantiateNfvoNs(String data, @PathParam("nsInstanceId") String nsInstanceId) {
try {
ValidateUtil.assertObjectNotNull(data);
- LOGGER.debug(REQUEST_DEBUG_MSG + data);
+ logger.debug(REQUEST_DEBUG_MSG + data);
NSResourceInputParameter nsInput = JsonUtil.unMarshal(data, NSResourceInputParameter.class);
RestfulResponse rsp = driverMgr.instantiateNs(nsInstanceId, nsInput);
return buildResponse(rsp);
} catch(ApplicationException e) {
- LOGGER.debug(APPLICATION_EXCEPTION, e);
+ logger.debug(APPLICATION_EXCEPTION, e);
return e.buildErrorResponse();
}
}
@@ -177,12 +179,12 @@ public class VfcAdapterRest {
public Response terminateNfvoNs(String data, @PathParam("nsInstanceId") String nsInstanceId) {
try {
ValidateUtil.assertObjectNotNull(data);
- LOGGER.debug(REQUEST_DEBUG_MSG + data);
+ logger.debug(REQUEST_DEBUG_MSG + data);
NsOperationKey nsOperationKey = JsonUtil.unMarshal(data, NsOperationKey.class);
RestfulResponse rsp = driverMgr.terminateNs(nsOperationKey, nsInstanceId);
return buildResponse(rsp);
} catch(ApplicationException e) {
- LOGGER.debug(APPLICATION_EXCEPTION, e);
+ logger.debug(APPLICATION_EXCEPTION, e);
return e.buildErrorResponse();
}
}
@@ -201,16 +203,16 @@ public class VfcAdapterRest {
@Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
public Response scaleNfvoNs(String data, @PathParam("nsInstanceId") String nsInstanceId) {
- try {
- ValidateUtil.assertObjectNotNull(data);
- LOGGER.debug("Scale Ns Request Received.Body from request is {}" + data);
- NSResourceInputParameter nsInput = JsonUtil.unMarshal(data, NSResourceInputParameter.class);
- RestfulResponse rsp = driverMgr.scaleNs(nsInstanceId, nsInput);
- return buildResponse(rsp);
- } catch(ApplicationException e) {
- LOGGER.debug(APPLICATION_EXCEPTION, e);
- return e.buildErrorResponse();
- }
+ try {
+ ValidateUtil.assertObjectNotNull(data);
+ logger.debug("Scale Ns Request Received.Body from request is {}" + data);
+ NSResourceInputParameter nsInput = JsonUtil.unMarshal(data, NSResourceInputParameter.class);
+ RestfulResponse rsp = driverMgr.scaleNs(nsInstanceId, nsInput);
+ return buildResponse(rsp);
+ } catch (ApplicationException e) {
+ logger.debug(APPLICATION_EXCEPTION, e);
+ return e.buildErrorResponse();
+ }
}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/util/JsonUtil.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/util/JsonUtil.java
index 64032e25f5..66ed6953a2 100644
--- a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/util/JsonUtil.java
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/util/JsonUtil.java
@@ -5,6 +5,7 @@
* Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
* ================================================================================
* Modifications Copyright (C) 2018 IBM.
+ * 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.
@@ -33,6 +34,8 @@ import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* Interface for json analyzing.<br/>
@@ -47,7 +50,7 @@ public class JsonUtil {
/**
* Log service
*/
- private static final MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA, JsonUtil.class);
+ private static final Logger logger = LoggerFactory.getLogger(JsonUtil.class);
/**
* Mapper.
@@ -83,7 +86,7 @@ public class JsonUtil {
try {
return MAPPER.readValue(jsonstr, type);
} catch (IOException e) {
- LOGGER.error(MessageEnum.RA_NS_EXC, "", "", MsoLogger.ErrorCode.BusinessProcesssError,
+ logger.error("{} {} {}", MessageEnum.RA_NS_EXC.toString(), MsoLogger.ErrorCode.BusinessProcesssError.getValue(),
UNMARSHAL_FAIL_MSG, e);
throw new ApplicationException(HttpCode.BAD_REQUEST, UNMARSHAL_FAIL_MSG);
}
@@ -101,7 +104,7 @@ public class JsonUtil {
try {
return MAPPER.readValue(jsonstr, type);
} catch (IOException e) {
- LOGGER.error(MessageEnum.RA_NS_EXC, "", "", MsoLogger.ErrorCode.BusinessProcesssError,
+ logger.error("{} {} {}", MessageEnum.RA_NS_EXC.toString(), MsoLogger.ErrorCode.BusinessProcesssError.getValue(),
UNMARSHAL_FAIL_MSG, e);
throw new ApplicationException(HttpCode.BAD_REQUEST, UNMARSHAL_FAIL_MSG);
}
@@ -118,7 +121,7 @@ public class JsonUtil {
try {
return MAPPER.writeValueAsString(srcObj);
} catch (IOException e) {
- LOGGER.error(MessageEnum.RA_NS_EXC, "", "", MsoLogger.ErrorCode.BusinessProcesssError,
+ logger.error("{} {} {}", MessageEnum.RA_NS_EXC.toString(), MsoLogger.ErrorCode.BusinessProcesssError.getValue(),
"fail to marshal json", e);
throw new ApplicationException(HttpCode.BAD_REQUEST, "srcObj marshal failed!");
}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/util/RestfulUtil.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/util/RestfulUtil.java
index bb7fa70bda..9a23861bf6 100644
--- a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/util/RestfulUtil.java
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/util/RestfulUtil.java
@@ -6,6 +6,7 @@
* Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
* ================================================================================
* Modifications Copyright (C) 2018.
+ * 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.
@@ -44,6 +45,8 @@ import org.apache.http.util.EntityUtils;
import org.onap.so.adapters.vfc.model.RestfulResponse;
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.core.env.Environment;
import org.springframework.stereotype.Component;
@@ -63,7 +66,7 @@ public class RestfulUtil {
/**
* Log service
*/
- private static final MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA, RestfulUtil.class);
+ private static final Logger logger = LoggerFactory.getLogger(RestfulUtil.class);
private static final int DEFAULT_TIME_OUT = 60000;
@@ -88,7 +91,7 @@ public class RestfulUtil {
Integer msbPort = env.getProperty("mso.msb-port", Integer.class, DEFAULT_MSB_PORT);
String msbEndpoint = UriBuilder.fromPath("").host(msbIp).port(msbPort).scheme("http").build().toString();
- LOGGER.debug("msbEndpoint in vfc adapter: " + msbEndpoint);
+ logger.debug("msbEndpoint in vfc adapter: {}", msbEndpoint);
return msbEndpoint;
}
@@ -99,7 +102,7 @@ public class RestfulUtil {
public RestfulResponse send(String url, String methodType, String content) {
String msbUrl = getMsbHost() + url;
- LOGGER.debug("Begin to sent message " + methodType +": " + msbUrl);
+ logger.debug("Begin to sent message {}: {}", methodType, msbUrl);
HttpRequestBase method = null;
HttpResponse httpResponse = null;
@@ -132,14 +135,6 @@ public class RestfulUtil {
method = httpDelete;
}
- // now VFC have no auth
- // String userCredentials =
- // SDNCAdapterProperties.getEncryptedProperty(Constants.SDNC_AUTH_PROP,
- // Constants.DEFAULT_SDNC_AUTH, Constants.ENCRYPTION_KEY);
- // String authorization = "Basic " +
- // DatatypeConverter.printBase64Binary(userCredentials.getBytes());
- // method.setHeader("Authorization", authorization);
-
httpResponse = client.execute(method);
String responseContent = null;
@@ -150,7 +145,7 @@ public class RestfulUtil {
int statusCode = httpResponse.getStatusLine().getStatusCode();
String statusMessage = httpResponse.getStatusLine().getReasonPhrase();
- LOGGER.debug("VFC Response: " + statusCode + " " + statusMessage
+ logger.debug("VFC Response: {} {}", statusCode, statusMessage
+ (responseContent == null ? "" : System.lineSeparator() + responseContent));
if(httpResponse.getStatusLine().getStatusCode() >= 300) {
@@ -164,7 +159,7 @@ public class RestfulUtil {
if(null != method) {
method.reset();
} else {
- LOGGER.debug("method is NULL:");
+ logger.debug("method is NULL:");
}
method = null;
@@ -185,7 +180,7 @@ public class RestfulUtil {
try {
EntityUtils.consume(httpResponse.getEntity());
} catch(Exception e) {
- LOGGER.debug("Exception :", e);
+ logger.debug("Exception :", e);
}
}
@@ -193,18 +188,20 @@ public class RestfulUtil {
try {
method.reset();
} catch(Exception e) {
- LOGGER.debug("Exception :", e);
+ logger.debug("Exception :", e);
}
}
}
}
private static void logError(String errMsg, Throwable t) {
- LOGGER.error(MessageEnum.RA_NS_EXC, VFC_ADAPTER, "", MsoLogger.ErrorCode.AvailabilityError, errMsg, t);
+ logger.error("{} {} {} {}", MessageEnum.RA_NS_EXC.toString(), VFC_ADAPTER,
+ MsoLogger.ErrorCode.AvailabilityError.getValue(), errMsg, t);
}
private static void logError(String errMsg) {
- LOGGER.error(MessageEnum.RA_NS_EXC, VFC_ADAPTER, "", MsoLogger.ErrorCode.AvailabilityError, errMsg);
+ logger.error("{} {} {} {}", MessageEnum.RA_NS_EXC.toString(), VFC_ADAPTER,
+ MsoLogger.ErrorCode.AvailabilityError.toString(), errMsg);
}
private static RestfulResponse createResponse(int statusCode, String content) {
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 d7a9ff1cf7..7632831111 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
@@ -139,7 +139,7 @@ public class GeneralTopologyObjectMapper {
vfModuleInformation.setFromPreload(requestContext.getRequestParameters().getUsePreload());
}
else {
- vfModuleInformation.setFromPreload(null);
+ vfModuleInformation.setFromPreload(false);
}
return vfModuleInformation;
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 c039e308f8..bf2cd347c0 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
@@ -361,7 +361,7 @@ public class GeneralTopologyObjectMapperTest extends TestDataSetup {
assertNull(gcRequestInput.getOnapModelInformation());
assertEquals(vfModule.getVfModuleId(),gcRequestInput.getVfModuleId());
assertNotNull(gcRequestInput.getVfModuleId());
- assertNull(gcRequestInput.getFromPreload());
+ assertFalse(gcRequestInput.getFromPreload());
}
@Test
@@ -385,7 +385,7 @@ public class GeneralTopologyObjectMapperTest extends TestDataSetup {
assertNull(gcRequestInput.getOnapModelInformation());
assertEquals(vfModule.getVfModuleId(),gcRequestInput.getVfModuleId());
assertNotNull(gcRequestInput.getVfModuleId());
- assertNull(gcRequestInput.getFromPreload());
+ assertFalse(gcRequestInput.getFromPreload());
}
@Test
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/genericResourceApiVfModuleOperationInformationUnassign.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/genericResourceApiVfModuleOperationInformationUnassign.json
index f06d72a806..cecb4c1dc7 100644
--- a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/genericResourceApiVfModuleOperationInformationUnassign.json
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/genericResourceApiVfModuleOperationInformationUnassign.json
@@ -22,7 +22,7 @@
},
"vf-module-information" : {
"vf-module-id" : "testVfModuleId",
- "from-preload": null
+ "from-preload": false
},
"vnf-information" : {
"vnf-id" : "testVnfId",
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/RequestParametersValidation.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/RequestParametersValidation.java
index 0b438a1b17..edb92ef68b 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/RequestParametersValidation.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/RequestParametersValidation.java
@@ -21,8 +21,6 @@
package org.onap.so.apihandlerinfra.validation;
-import java.util.Map;
-
import org.onap.so.apihandlerinfra.Action;
import org.onap.so.apihandlerinfra.Actions;
import org.onap.so.exceptions.ValidationException;
@@ -75,7 +73,7 @@ public class RequestParametersValidation implements ValidationRule{
if(action == Action.createInstance || action == Action.updateInstance){
if(requestParameters.isUsePreload() == null){
if(reqVersion >= 4){
- if (requestParameters.getALaCarte() == false) {
+ if (requestParameters.getALaCarte() == null || requestParameters.getALaCarte() == false) {
requestParameters.setUsePreload(false);
}
else {
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/validation/RequestParametersValidationTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/validation/RequestParametersValidationTest.java
index 3fc5a16d9d..2813ef7b70 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/validation/RequestParametersValidationTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/validation/RequestParametersValidationTest.java
@@ -55,6 +55,21 @@ public class RequestParametersValidationTest extends BaseTest{
}
@Test
+ public void testVfModuleWithNoALaCarte() throws IOException, ValidationException {
+ String requestJson = new String(Files.readAllBytes(Paths.get("src/test/resources/MsoRequestTest/RequestParameters/VfModuleRequestParametersNoALaCarte.json")));
+ ObjectMapper mapper = new ObjectMapper();
+ ServiceInstancesRequest sir = mapper.readValue(requestJson, ServiceInstancesRequest.class);
+ ValidationInformation info = new ValidationInformation(sir, new HashMap<String, String>(), Action.createInstance,
+ 6, false, sir.getRequestDetails().getRequestParameters());
+ info.setRequestScope("vfModule");
+ sir.setServiceInstanceId("0fd90c0c-0e3a-46e2-abb5-4c4820d5985b");
+ RequestParametersValidation validation = new RequestParametersValidation();
+ validation.validate(info);
+
+ assertFalse(info.getReqParameters().getUsePreload());
+ }
+
+ @Test
public void testVfModuleWithTrueALaCarte() throws IOException, ValidationException {
String requestJson = new String(Files.readAllBytes(Paths.get("src/test/resources/MsoRequestTest/RequestParameters/VfModuleRequestParametersIsALaCarte.json")));
ObjectMapper mapper = new ObjectMapper();
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/VfModuleRequestParametersNoALaCarte.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/VfModuleRequestParametersNoALaCarte.json
new file mode 100644
index 0000000000..304065f930
--- /dev/null
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/VfModuleRequestParametersNoALaCarte.json
@@ -0,0 +1,55 @@
+{
+ "requestDetails": {
+ "modelInfo": {
+ "modelType": "vfModule",
+ "modelName": "InframsoVsamp10a2..vSAMP10a_addon_2..module-1",
+ "modelVersionId": "dcd3d939-67cd-438c-a55f-48073811f83f",
+ "modelInvariantId": "b42d49f3-6429-4c2e-a73c-29bef87ca1b9",
+ "modelVersion": "1",
+ "modelCustomizationId": "3bec51f8-b410-40f5-b470-25d31f7210dc"
+ },
+ "cloudConfiguration": {
+ "cloudOwner": "CloudOwner",
+ "lcpCloudRegionId": "mtn6",
+ "tenantId": "0422ffb57ba042c0800a29dc85ca70f8"
+ },
+ "requestInfo": {
+ "instanceName": "InfraMSO-vSAMP10a_6.0-VF-Module_1-1902-est01-GR_API-101",
+ "source": "VID",
+ "suppressRollback": false,
+ "requestorId": "bs7527"
+ },
+ "relatedInstanceList": [
+ {
+ "relatedInstance": {
+ "instanceId": "43075e6e-4d95-4bca-b9e5-712d0a14fbc2",
+ "modelInfo": {
+ "modelType": "service",
+ "modelName": "InfraMSO_vSAMP10a_Service",
+ "modelVersionId": "8f6fba78-8eab-4149-8be1-491ef7f63cf7",
+ "modelInvariantId": "653030db-85e2-4bd1-8c61-3764ebf5860a",
+ "modelVersion": "6.0"
+ }
+ }
+ },
+ {
+ "relatedInstance": {
+ "instanceId": "7c1ff5bc-fb41-48a7-b997-f9fdb3ab4a77",
+ "modelInfo": {
+ "modelType": "vnf",
+ "modelName": "InfraMSO_vSAMP10a-2",
+ "modelVersionId": "cb79c25f-b30d-4d95-afb5-97be4021f3db",
+ "modelInvariantId": "e93d3a7a-446d-486b-ae48-d474a9156064",
+ "modelVersion": "1.0",
+ "modelCustomizationId": "034226ae-879a-46b5-855c-d02babcb6cb6",
+ "modelCustomizationName": "InfraMSO_vSAMP10a-2 0"
+ }
+ }
+ }
+ ],
+ "requestParameters": {
+ "testApi": "GR_API",
+ "userParams": []
+ }
+ }
+}