diff options
author | malar <malarvizhi.44@wipro.com> | 2022-07-28 09:52:22 +0000 |
---|---|---|
committer | malar <malarvizhi.44@wipro.com> | 2022-08-05 06:53:10 +0000 |
commit | c56c4a5e36d97cb22c97d9acc29d057760b0ec0f (patch) | |
tree | eb9bd65d207ccf7763c06f9c26d14ee816f79f69 /dcae-analytics/dcae-analytics-tca-model/src/main | |
parent | ebaab76841e7c7cfee0143e6c40c6e1ae3204309 (diff) |
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 <malarvizhi.44@wipro.com>
Change-Id: I29f56048d825710d268e4588f4b5779d5fdb6020
Diffstat (limited to 'dcae-analytics/dcae-analytics-tca-model/src/main')
2 files changed, 10 insertions, 6 deletions
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<Threshold> 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<TcaPolicy> TCA_POLICY_TYPE_REF = new TypeReference<TcaPolicy>() { + private static final TypeReference<List<TcaPolicy>> TCA_POLICY_TYPE_REF = new TypeReference<List<TcaPolicy>>() { }; // 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<String, Optional<TcaPolicy>> TCA_POLICY_JSON_FUNCTION = new - JsonToJavaObjectBiFunction<TcaPolicy>(TCA_OBJECT_MAPPER).curry(TCA_POLICY_TYPE_REF); + public static final Function<String, Optional<List<TcaPolicy>>> TCA_POLICY_JSON_FUNCTION = new + JsonToJavaObjectBiFunction<List<TcaPolicy>>(TCA_OBJECT_MAPPER).curry(TCA_POLICY_TYPE_REF); // Tca Alert JSON conversion function public static final Function<String, Optional<TcaAlert>> TCA_ALERT_JSON_FUNCTION = new |