summaryrefslogtreecommitdiffstats
path: root/dcae-analytics/dcae-analytics-tca-web/src
diff options
context:
space:
mode:
authorKai <lukai@chinamobile.com>2020-02-22 15:54:23 +0800
committerLUKAI <lukai@chinamobile.com>2020-02-25 03:17:03 +0000
commit8ff4faad57fceb3c62ad04da0cf9b6bae5f6bc4f (patch)
tree320ade2d13390ca5ff6537c06a554eb95b362e6a /dcae-analytics/dcae-analytics-tca-web/src
parentef75d53326ad27f4bfe21e341e43a4c916ea9fbc (diff)
fix debug log1.0.0
Issue-ID: DCAEGEN2-2077 Signed-off-by: Kai Lu <lukai@chinamobile.com> Change-Id: Ice1b21ae478a6311f6202cac48ba10dc1b859bc3
Diffstat (limited to 'dcae-analytics/dcae-analytics-tca-web/src')
-rw-r--r--dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/aai/TcaAaiEnrichmentServiceImpl.java56
-rw-r--r--dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/abatement/mongo/MongoAbatementEntity.java2
-rw-r--r--dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/abatement/simple/SimpleAbatementEntity.java2
-rw-r--r--dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/controller/TcaRestController.java8
-rw-r--r--dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/domain/TcaPolicyWrapper.java2
-rw-r--r--dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/integration/TcaAlertTransformer.java5
-rw-r--r--dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/integration/TcaPublisherResponseHandler.java2
-rw-r--r--dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/service/TcaProcessingServiceImpl.java2
-rw-r--r--dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/util/TcaUtils.java92
-rw-r--r--dcae-analytics/dcae-analytics-tca-web/src/main/resources/logback.xml2
-rw-r--r--dcae-analytics/dcae-analytics-tca-web/src/test/java/org/onap/dcae/analytics/tca/web/service/TcaProcessingServiceImplTest.java6
11 files changed, 46 insertions, 133 deletions
diff --git a/dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/aai/TcaAaiEnrichmentServiceImpl.java b/dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/aai/TcaAaiEnrichmentServiceImpl.java
index d38bd23..ccaacba 100644
--- a/dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/aai/TcaAaiEnrichmentServiceImpl.java
+++ b/dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/aai/TcaAaiEnrichmentServiceImpl.java
@@ -21,8 +21,6 @@ package org.onap.dcae.analytics.tca.web.aai;
import static org.onap.dcae.analytics.tca.model.util.json.TcaModelJsonConversion.TCA_OBJECT_MAPPER;
-import com.fasterxml.jackson.databind.JsonNode;
-
import java.io.IOException;
import java.net.URI;
import java.util.Collections;
@@ -34,11 +32,14 @@ import org.onap.dcae.analytics.model.AnalyticsHttpConstants;
import org.onap.dcae.analytics.model.TcaModelConstants;
import org.onap.dcae.analytics.tca.core.service.TcaAaiEnrichmentService;
import org.onap.dcae.analytics.tca.core.service.TcaExecutionContext;
+import org.onap.dcae.analytics.tca.core.util.LogSpec;
import org.onap.dcae.analytics.tca.model.facade.Aai;
import org.onap.dcae.analytics.tca.model.facade.TcaAlert;
import org.onap.dcae.analytics.tca.web.TcaAppProperties;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.onap.dcae.utils.eelf.logger.api.log.EELFLogFactory;
+import org.onap.dcae.utils.eelf.logger.api.log.EELFLogger;
+import org.onap.dcae.utils.eelf.logger.api.spec.DebugLogSpec;
+import org.onap.dcae.utils.eelf.logger.api.spec.ErrorLogSpec;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
@@ -47,12 +48,14 @@ import org.springframework.util.StringUtils;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.util.UriComponentsBuilder;
+import com.fasterxml.jackson.databind.JsonNode;
+
/**
* @author Rajiv Singla
*/
public class TcaAaiEnrichmentServiceImpl implements TcaAaiEnrichmentService {
- private static final Logger logger = LoggerFactory.getLogger(TcaAaiEnrichmentServiceImpl.class);
+ private static final EELFLogger logger = EELFLogFactory.getLogger(TcaAaiEnrichmentServiceImpl.class);
private final TcaAppProperties tcaAppProperties;
private final RestTemplate aaiRestTemplate;
@@ -100,7 +103,7 @@ public class TcaAaiEnrichmentServiceImpl implements TcaAaiEnrichmentService {
// get resource link
final String resourceLink =
- getVMResourceLink(getAAIRestAPIResponse(aaiRestTemplate, nodeQueryUri, requestId, transactionId));
+ getVMResourceLink(requestId, getAAIRestAPIResponse(aaiRestTemplate, nodeQueryUri, requestId, transactionId));
if (resourceLink == null) {
return;
}
@@ -115,7 +118,7 @@ public class TcaAaiEnrichmentServiceImpl implements TcaAaiEnrichmentService {
getAAIRestAPIResponse(aaiRestTemplate, vServerEnrichmentUri, requestId, transactionId);
// do aai enrichment
- enrichAAI(vServerEnrichmentDetails, tcaAlert, TcaModelConstants.AAI_VSERVER_KEY_PREFIX);
+ enrichAAI(requestId, vServerEnrichmentDetails, tcaAlert, TcaModelConstants.AAI_VSERVER_KEY_PREFIX);
}
private static void doAaiVnfEnrichment(final TcaExecutionContext tcaExecutionContext,
@@ -138,7 +141,7 @@ public class TcaAaiEnrichmentServiceImpl implements TcaAaiEnrichmentService {
final String aaiResponse = getAAIRestAPIResponse(aaiRestTemplate, genericVnfUri, requestId, transactionId);
// do AAI enrichment
- enrichAAI(aaiResponse, tcaAlert, TcaModelConstants.AAI_VNF_KEY_PREFIX);
+ enrichAAI(requestId, aaiResponse, tcaAlert, TcaModelConstants.AAI_VNF_KEY_PREFIX);
}
@@ -162,7 +165,9 @@ public class TcaAaiEnrichmentServiceImpl implements TcaAaiEnrichmentService {
final HttpEntity<String> httpEntity = new HttpEntity<>(headers);
aaiResponseEntity = aaiRestTemplate.exchange(aaiUri, HttpMethod.GET, httpEntity, String.class);
} catch (Exception e) {
- logger.debug("Request id: " + requestId + ". Unable to get A&AI enrichment details", e);
+ final ErrorLogSpec errorLogSpec = LogSpec.createErrorLogSpec(requestId);
+ logger.errorLog().error("Request id: " + requestId + ". Unable to get A&AI enrichment details",
+ errorLogSpec, e.toString());
}
if (aaiResponseEntity != null && aaiResponseEntity.getStatusCode().is2xxSuccessful()) {
@@ -182,17 +187,20 @@ public class TcaAaiEnrichmentServiceImpl implements TcaAaiEnrichmentService {
*
* @return true if A&AI enrichment completed successfully
*/
- private static boolean enrichAAI(final String aaiEnrichmentDetails, final TcaAlert tcaAlert,
+ private static boolean enrichAAI(final String requestId, final String aaiEnrichmentDetails, final TcaAlert tcaAlert,
final String keyPrefix) {
final Aai preEnrichmentAAI = tcaAlert.getAai();
+ final ErrorLogSpec errorLogSpec = LogSpec.createErrorLogSpec(requestId);
+ final DebugLogSpec debugLogSpec = LogSpec.createDebugLogSpec(requestId);
+
if (aaiEnrichmentDetails == null) {
- logger.warn("Request id: {}. No A&AI Enrichment possible. A&AI Enrichment details are absent.",
- tcaAlert.getRequestId());
+ logger.errorLog().error("Request id: {}. No A&AI Enrichment possible. A&AI Enrichment details are absent.",
+ errorLogSpec, tcaAlert.getRequestId());
return false;
}
- final Aai enrichedAAI = getNewEnrichedAAI(aaiEnrichmentDetails);
+ final Aai enrichedAAI = getNewEnrichedAAI(requestId, aaiEnrichmentDetails);
if (enrichedAAI != null) {
final Set<Map.Entry<String, Object>> enrichedAAIEntrySet =
@@ -205,11 +213,12 @@ public class TcaAaiEnrichmentServiceImpl implements TcaAaiEnrichmentService {
keyPrefix + enrichedAAIEntry.getKey(), enrichedAAIEntry.getValue());
}
- logger.debug("Request id: {}. A&AI Enrichment was completed successfully.", tcaAlert.getRequestId());
+ logger.debugLog().debug("Request id: {}. A&AI Enrichment was completed successfully.",
+ debugLogSpec, tcaAlert.getRequestId());
return true;
} else {
- logger.warn("Request id: {}. No A&AI Enrichment possible. Skipped - Invalid A&AI Response.",
- tcaAlert.getRequestId());
+ logger.errorLog().error("Request id: {}. No A&AI Enrichment possible. Skipped - Invalid A&AI Response.",
+ errorLogSpec, tcaAlert.getRequestId());
return false;
}
@@ -222,7 +231,7 @@ public class TcaAaiEnrichmentServiceImpl implements TcaAaiEnrichmentService {
*
* @return new A&AI with only top level A&AI Enrichment details
*/
- private static Aai getNewEnrichedAAI(final String aaiEnrichmentDetails) {
+ private static Aai getNewEnrichedAAI(final String requestId, final String aaiEnrichmentDetails) {
try {
final JsonNode rootNode = TCA_OBJECT_MAPPER.readTree(aaiEnrichmentDetails);
final Iterator<Map.Entry<String, JsonNode>> fieldsIterator = rootNode.fields();
@@ -236,8 +245,10 @@ public class TcaAaiEnrichmentServiceImpl implements TcaAaiEnrichmentService {
}
return TCA_OBJECT_MAPPER.treeToValue(rootNode, Aai.class);
} catch (IOException e) {
- logger.error(
- "Failed to Parse AAI Enrichment Details from JSON: {}, Exception: {}.", aaiEnrichmentDetails, e);
+ final ErrorLogSpec errorLogSpec = LogSpec.createErrorLogSpec(requestId);
+ logger.errorLog().error(
+ "Failed to Parse AAI Enrichment Details from JSON: {}, Exception: {}.",
+ errorLogSpec, aaiEnrichmentDetails, e.toString());
}
return null;
}
@@ -249,7 +260,7 @@ public class TcaAaiEnrichmentServiceImpl implements TcaAaiEnrichmentService {
*
* @return object resource link String
*/
- private static String getVMResourceLink(final String vmAAIResourceLinkDetails) {
+ private static String getVMResourceLink(final String requestId, final String vmAAIResourceLinkDetails) {
if (StringUtils.hasText(vmAAIResourceLinkDetails)) {
try {
final JsonNode jsonNode = TCA_OBJECT_MAPPER.readTree(vmAAIResourceLinkDetails);
@@ -258,8 +269,9 @@ public class TcaAaiEnrichmentServiceImpl implements TcaAaiEnrichmentService {
return resourceLinkJsonNode.asText();
}
} catch (IOException e) {
- logger.error("Unable to determine VM Object link inside AAI Resource Link Response JSON: {}",
- vmAAIResourceLinkDetails, e);
+ final ErrorLogSpec errorLogSpec = LogSpec.createErrorLogSpec(requestId);
+ logger.errorLog().error("Unable to determine VM Object link inside AAI Resource Link Response JSON: {}",
+ errorLogSpec, vmAAIResourceLinkDetails, e.toString());
}
}
return null;
diff --git a/dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/abatement/mongo/MongoAbatementEntity.java b/dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/abatement/mongo/MongoAbatementEntity.java
index 0cc1fcf..82c32ec 100644
--- a/dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/abatement/mongo/MongoAbatementEntity.java
+++ b/dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/abatement/mongo/MongoAbatementEntity.java
@@ -37,8 +37,6 @@ import org.springframework.data.mongodb.core.mapping.Document;
@Document(collection = "tca_abatement")
public class MongoAbatementEntity implements TcaAbatementEntity, TcaModel {
- private static final long serialVersionUID = 1L;
-
@Id
private String lookupKey;
private String requestId;
diff --git a/dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/abatement/simple/SimpleAbatementEntity.java b/dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/abatement/simple/SimpleAbatementEntity.java
index 42e3759..e1880ac 100644
--- a/dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/abatement/simple/SimpleAbatementEntity.java
+++ b/dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/abatement/simple/SimpleAbatementEntity.java
@@ -32,8 +32,6 @@ import org.onap.dcae.analytics.tca.model.TcaModel;
@Data
public class SimpleAbatementEntity implements TcaAbatementEntity, TcaModel {
- private static final long serialVersionUID = 1L;
-
protected String lookupKey;
protected String requestId;
protected boolean isAbatementAlertSent;
diff --git a/dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/controller/TcaRestController.java b/dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/controller/TcaRestController.java
index eb9eb13..0d34f90 100644
--- a/dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/controller/TcaRestController.java
+++ b/dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/controller/TcaRestController.java
@@ -19,9 +19,6 @@
package org.onap.dcae.analytics.tca.web.controller;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-
import java.time.format.DateTimeFormatter;
import java.util.List;
import java.util.stream.Collectors;
@@ -30,12 +27,12 @@ import org.onap.dcae.analytics.model.TcaModelConstants;
import org.onap.dcae.analytics.model.common.ConfigSource;
import org.onap.dcae.analytics.tca.core.service.TcaExecutionContext;
import org.onap.dcae.analytics.tca.core.service.TcaResultContext;
+import org.onap.dcae.analytics.tca.core.util.TcaUtils;
import org.onap.dcae.analytics.tca.model.policy.TcaPolicy;
import org.onap.dcae.analytics.tca.model.restapi.TcaExecutionRequest;
import org.onap.dcae.analytics.tca.model.restapi.TcaExecutionResponse;
import org.onap.dcae.analytics.tca.web.domain.TcaPolicyWrapper;
import org.onap.dcae.analytics.tca.web.service.TcaProcessingService;
-import org.onap.dcae.analytics.tca.web.util.TcaUtils;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
@@ -44,6 +41,9 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+
/**
* @author Rajiv Singla
*/
diff --git a/dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/domain/TcaPolicyWrapper.java b/dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/domain/TcaPolicyWrapper.java
index c54d27c..fcfc3fe 100644
--- a/dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/domain/TcaPolicyWrapper.java
+++ b/dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/domain/TcaPolicyWrapper.java
@@ -25,10 +25,10 @@ import java.time.ZonedDateTime;
import java.util.concurrent.atomic.AtomicInteger;
import org.onap.dcae.analytics.model.common.ConfigSource;
+import org.onap.dcae.analytics.tca.core.exception.AnalyticsParsingException;
import org.onap.dcae.analytics.tca.model.policy.TcaPolicy;
import org.onap.dcae.analytics.tca.model.policy.TcaPolicyModel;
import org.onap.dcae.analytics.tca.web.TcaAppProperties;
-import org.onap.dcae.analytics.web.exception.AnalyticsParsingException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/integration/TcaAlertTransformer.java b/dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/integration/TcaAlertTransformer.java
index 59acd2d..9bade85 100644
--- a/dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/integration/TcaAlertTransformer.java
+++ b/dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/integration/TcaAlertTransformer.java
@@ -29,9 +29,9 @@ import org.onap.dcae.analytics.model.AnalyticsHttpConstants;
import org.onap.dcae.analytics.model.TcaModelConstants;
import org.onap.dcae.analytics.model.ecomplogger.AnalyticsErrorType;
import org.onap.dcae.analytics.tca.core.service.TcaExecutionContext;
+import org.onap.dcae.analytics.tca.core.util.TcaUtils;
import org.onap.dcae.analytics.tca.model.facade.TcaAlert;
import org.onap.dcae.analytics.tca.web.TcaAppProperties;
-import org.onap.dcae.analytics.tca.web.util.TcaUtils;
import org.onap.dcae.analytics.web.util.AnalyticsHttpUtils;
import org.onap.dcae.utils.eelf.logger.api.info.ErrorLogInfo;
import org.onap.dcae.utils.eelf.logger.api.info.ResponseLogInfo;
@@ -150,10 +150,11 @@ public class TcaAlertTransformer extends AbstractTransformer {
final AuditLogSpecImpl auditLogSpec = new AuditLogSpecImpl(requestIdLogInfo, TcaUtils.TCA_SERVICE_LOG_INFO,
requestTimingLogInfo, responseLogInfo);
logger.auditLog().info("Request Id: {}, Transaction Id: {}, " +
- "Message counts - Received: {}, Errors: {}, Terminated Early: {}, Abated: {}, Alerts: {}",
+ "Message counts - Received: {}, Errors: {}, Terminated Early: {}, Abated: {}, Alerts: {}, Alerts size: {}",
auditLogSpec, requestId, transactionId,
Integer.toString(tcaExecutionContexts.size()), Integer.toString(errorExecutionContexts.size()),
Integer.toString(earlyTerminationExecutionContexts.size()),
+ tcaAlerts.toString(),
Integer.toString(abatedExecutionContexts.size()), Integer.toString(tcaAlerts.size()));
}
}
diff --git a/dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/integration/TcaPublisherResponseHandler.java b/dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/integration/TcaPublisherResponseHandler.java
index 0e81a28..7cd542c 100644
--- a/dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/integration/TcaPublisherResponseHandler.java
+++ b/dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/integration/TcaPublisherResponseHandler.java
@@ -27,8 +27,8 @@ import java.util.Date;
import java.util.Map;
import org.onap.dcae.analytics.model.ecomplogger.AnalyticsErrorType;
+import org.onap.dcae.analytics.tca.core.util.TcaUtils;
import org.onap.dcae.analytics.tca.web.TcaAppProperties;
-import org.onap.dcae.analytics.tca.web.util.TcaUtils;
import org.onap.dcae.analytics.web.util.AnalyticsHttpUtils;
import org.onap.dcae.utils.eelf.logger.api.info.ResponseLogInfo;
import org.onap.dcae.utils.eelf.logger.api.log.EELFLogFactory;
diff --git a/dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/service/TcaProcessingServiceImpl.java b/dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/service/TcaProcessingServiceImpl.java
index 3bb742a..f5aec0b 100644
--- a/dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/service/TcaProcessingServiceImpl.java
+++ b/dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/service/TcaProcessingServiceImpl.java
@@ -34,9 +34,9 @@ import org.onap.dcae.analytics.tca.core.service.GenericTcaResultContext;
import org.onap.dcae.analytics.tca.core.service.TcaAaiEnrichmentContext;
import org.onap.dcae.analytics.tca.core.service.TcaAbatementContext;
import org.onap.dcae.analytics.tca.core.service.TcaExecutionContext;
+import org.onap.dcae.analytics.tca.core.util.TcaUtils;
import org.onap.dcae.analytics.tca.core.util.function.calculation.TcaCalculator;
import org.onap.dcae.analytics.tca.model.policy.TcaPolicy;
-import org.onap.dcae.analytics.tca.web.util.TcaUtils;
/**
* @author Rajiv Singla
diff --git a/dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/util/TcaUtils.java b/dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/util/TcaUtils.java
deleted file mode 100644
index 6744cee..0000000
--- a/dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/util/TcaUtils.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * ================================================================================
- * Copyright (c) 2018 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.dcae.analytics.tca.web.util;
-
-import static org.onap.dcae.analytics.tca.model.util.json.TcaModelJsonConversion.TCA_OBJECT_MAPPER;
-
-import com.fasterxml.jackson.core.JsonProcessingException;
-
-import java.util.Collections;
-import java.util.List;
-import java.util.Optional;
-import java.util.stream.Collectors;
-
-import org.onap.dcae.analytics.model.TcaModelConstants;
-import org.onap.dcae.analytics.model.cef.EventListener;
-import org.onap.dcae.analytics.tca.model.policy.TcaPolicy;
-import org.onap.dcae.analytics.web.exception.AnalyticsParsingException;
-import org.onap.dcae.utils.eelf.logger.model.info.ServiceLogInfoImpl;
-
-/**
- * @author Rajiv Singla
- */
-public abstract class TcaUtils {
-
- /**
- * TCA Service Log Info for ECOMP Logging
- */
- public static final ServiceLogInfoImpl TCA_SERVICE_LOG_INFO =
- new ServiceLogInfoImpl(TcaModelConstants.TCA_SERVICE_NAME, System.getProperty("user.name"), "");
-
- /**
- * Creates a deep copy of Tca Policy
- *
- * @param tcaPolicy source tca policy object
- *
- * @return deep copy of provided tca policy
- */
- public static TcaPolicy getTcaPolicyDeepCopy(final TcaPolicy tcaPolicy) {
- if (tcaPolicy != null) {
- try {
- return TCA_OBJECT_MAPPER.treeToValue(TCA_OBJECT_MAPPER.valueToTree(tcaPolicy), TcaPolicy.class);
- } catch (JsonProcessingException e) {
- throw new AnalyticsParsingException("Unable to create deep copy of TCA Policy: " + tcaPolicy, e);
- }
- } else {
- final String errorMessage = "Invalid application state. TCA Policy must not be null";
- throw new AnalyticsParsingException(errorMessage, new IllegalStateException(errorMessage));
- }
- }
-
-
- /**
- * Converts given event Listeners to list of CEF Message String
- *
- * @param eventListeners event listeners object
- *
- * @return cef messages as string
- */
- public static List<String> getCefMessagesFromEventListeners(final List<EventListener> eventListeners) {
- if (!Optional.ofNullable(eventListeners).isPresent()) {
- return Collections.emptyList();
- }
- return eventListeners.stream().map(eventListener -> {
- try {
- return TCA_OBJECT_MAPPER.writeValueAsString(eventListener);
- } catch (JsonProcessingException e) {
- throw new AnalyticsParsingException("Unable to parse EventLister to String: " + eventListener, e);
- }
- }).collect(Collectors.toList());
- }
-
- private TcaUtils() {
- // private constructor
- }
-}
diff --git a/dcae-analytics/dcae-analytics-tca-web/src/main/resources/logback.xml b/dcae-analytics/dcae-analytics-tca-web/src/main/resources/logback.xml
index 5430f0b..63625a5 100644
--- a/dcae-analytics/dcae-analytics-tca-web/src/main/resources/logback.xml
+++ b/dcae-analytics/dcae-analytics-tca-web/src/main/resources/logback.xml
@@ -37,7 +37,7 @@
<logger name="com.jayway" level="INFO"/>
<logger name="org.springframework.retry" level="INFO"/>
- <logger name="org.onap.dcae.analytics" level="INFO"/>
+ <logger name="org.onap.dcae.analytics" level="DEBUG"/>
<root level="DEBUG">
<!-- required appenders -->
diff --git a/dcae-analytics/dcae-analytics-tca-web/src/test/java/org/onap/dcae/analytics/tca/web/service/TcaProcessingServiceImplTest.java b/dcae-analytics/dcae-analytics-tca-web/src/test/java/org/onap/dcae/analytics/tca/web/service/TcaProcessingServiceImplTest.java
index 426ae46..9347d53 100644
--- a/dcae-analytics/dcae-analytics-tca-web/src/test/java/org/onap/dcae/analytics/tca/web/service/TcaProcessingServiceImplTest.java
+++ b/dcae-analytics/dcae-analytics-tca-web/src/test/java/org/onap/dcae/analytics/tca/web/service/TcaProcessingServiceImplTest.java
@@ -25,16 +25,12 @@ import java.util.Arrays;
import java.util.List;
import org.junit.jupiter.api.Test;
+import org.onap.dcae.analytics.tca.core.exception.AnalyticsParsingException;
import org.onap.dcae.analytics.tca.core.service.TcaAaiEnrichmentContext;
import org.onap.dcae.analytics.tca.core.service.TcaAbatementContext;
import org.onap.dcae.analytics.tca.core.service.TcaExecutionContext;
import org.onap.dcae.analytics.tca.model.facade.TcaAlert;
import org.onap.dcae.analytics.tca.model.policy.TcaPolicy;
-import org.onap.dcae.analytics.tca.web.TcaAppProperties;
-import org.onap.dcae.analytics.tca.web.domain.TcaPolicyWrapper;
-import org.onap.dcae.analytics.web.exception.AnalyticsParsingException;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.core.env.Environment;
import com.fasterxml.jackson.databind.ObjectMapper;