From c56c4a5e36d97cb22c97d9acc29d057760b0ec0f Mon Sep 17 00:00:00 2001 From: malar Date: Thu, 28 Jul 2022 09:52:22 +0000 Subject: Support 7.2.1 VES in TCAGEN2 - Includes modifications for processing Tca Policy as a List to support both v5 and v7 policies Issue-ID: DCAEGEN2-2976 Signed-off-by: Malarvizhi Paramasivam Change-Id: I29f56048d825710d268e4588f4b5779d5fdb6020 --- .../dcae/analytics/tca/model/policy/MetricsPerEventName.java | 6 ++++-- .../analytics/tca/model/util/json/TcaModelJsonConversion.java | 10 ++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) (limited to 'dcae-analytics/dcae-analytics-tca-model/src/main') diff --git a/dcae-analytics/dcae-analytics-tca-model/src/main/java/org/onap/dcae/analytics/tca/model/policy/MetricsPerEventName.java b/dcae-analytics/dcae-analytics-tca-model/src/main/java/org/onap/dcae/analytics/tca/model/policy/MetricsPerEventName.java index 024202a..8db9723 100644 --- a/dcae-analytics/dcae-analytics-tca-model/src/main/java/org/onap/dcae/analytics/tca/model/policy/MetricsPerEventName.java +++ b/dcae-analytics/dcae-analytics-tca-model/src/main/java/org/onap/dcae/analytics/tca/model/policy/MetricsPerEventName.java @@ -1,6 +1,7 @@ /* - * ================================================================================ + * ===========LICENSE_START======================================================== * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. + * Copyright (c) 2022 Wipro Limited 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. @@ -65,6 +66,7 @@ public class MetricsPerEventName extends BaseTcaPolicyModel { * Policy Thresholds */ private List thresholds; - + + public MetricsPerEventName() { } } diff --git a/dcae-analytics/dcae-analytics-tca-model/src/main/java/org/onap/dcae/analytics/tca/model/util/json/TcaModelJsonConversion.java b/dcae-analytics/dcae-analytics-tca-model/src/main/java/org/onap/dcae/analytics/tca/model/util/json/TcaModelJsonConversion.java index aaec970..df14b32 100644 --- a/dcae-analytics/dcae-analytics-tca-model/src/main/java/org/onap/dcae/analytics/tca/model/util/json/TcaModelJsonConversion.java +++ b/dcae-analytics/dcae-analytics-tca-model/src/main/java/org/onap/dcae/analytics/tca/model/util/json/TcaModelJsonConversion.java @@ -1,6 +1,7 @@ /* - * ================================================================================ + * ===========LICENSE_START======================================================== * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. + * Copyright (c) 2022 Wipro Limited 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. @@ -24,6 +25,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import java.util.Optional; import java.util.function.Function; +import java.util.List; import org.onap.dcae.analytics.model.util.function.JsonToJavaObjectBiFunction; import org.onap.dcae.analytics.tca.model.facade.TcaAlert; @@ -38,7 +40,7 @@ public abstract class TcaModelJsonConversion { public static final ObjectMapper TCA_OBJECT_MAPPER = new TcaObjectMapperSupplier().get(); // Type reference to convert tca policy string to tca policy object - private static final TypeReference TCA_POLICY_TYPE_REF = new TypeReference() { + private static final TypeReference> TCA_POLICY_TYPE_REF = new TypeReference>() { }; // Type reference to convert tca alert string to tca alert @@ -46,8 +48,8 @@ public abstract class TcaModelJsonConversion { }; // Tca Policy JSON conversion function - public static final Function> TCA_POLICY_JSON_FUNCTION = new - JsonToJavaObjectBiFunction(TCA_OBJECT_MAPPER).curry(TCA_POLICY_TYPE_REF); + public static final Function>> TCA_POLICY_JSON_FUNCTION = new + JsonToJavaObjectBiFunction>(TCA_OBJECT_MAPPER).curry(TCA_POLICY_TYPE_REF); // Tca Alert JSON conversion function public static final Function> TCA_ALERT_JSON_FUNCTION = new -- cgit 1.2.3-korg