From bd1744d82d6e8d817d81f5ef607a8169c7c7591f Mon Sep 17 00:00:00 2001 From: Ram Krishna Verma Date: Wed, 6 Jan 2021 14:13:45 -0500 Subject: Changed identifiers to concept identifiers The class ToscaPolicyIdentifierOptVersion is replaced by ToscaConceptIdentifierOptVersion in policy/models. Made the corresponding changes in policy/distribution. Issue-ID: POLICY-2900 Change-Id: I10fb99ecd4f52a811cde49fbc9e35ae2eb28596a Signed-off-by: Ram Krishna Verma --- .../forwarding/lifecycle/api/LifecycleApiPolicyForwarder.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/plugins/forwarding-plugins/src/main/java/org/onap/policy/distribution/forwarding/lifecycle/api/LifecycleApiPolicyForwarder.java b/plugins/forwarding-plugins/src/main/java/org/onap/policy/distribution/forwarding/lifecycle/api/LifecycleApiPolicyForwarder.java index 1f580388..242573cc 100644 --- a/plugins/forwarding-plugins/src/main/java/org/onap/policy/distribution/forwarding/lifecycle/api/LifecycleApiPolicyForwarder.java +++ b/plugins/forwarding-plugins/src/main/java/org/onap/policy/distribution/forwarding/lifecycle/api/LifecycleApiPolicyForwarder.java @@ -2,6 +2,7 @@ * ============LICENSE_START======================================================= * Copyright (C) 2019 Nordix Foundation. * Modifications Copyright (C) 2020 AT&T Inc. + * Modifications Copyright (C) 2021 Bell Canada. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,9 +41,9 @@ import org.onap.policy.common.parameters.ParameterService; import org.onap.policy.distribution.forwarding.PolicyForwarder; import org.onap.policy.distribution.forwarding.PolicyForwardingException; import org.onap.policy.models.pap.concepts.PdpDeployPolicies; +import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifierOptVersion; import org.onap.policy.models.tosca.authorative.concepts.ToscaEntity; import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy; -import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyIdentifierOptVersion; import org.onap.policy.models.tosca.authorative.concepts.ToscaServiceTemplate; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -124,13 +125,13 @@ public class LifecycleApiPolicyForwarder implements PolicyForwarder { private Response deployPolicy(final ToscaServiceTemplate toscaServiceTemplate) throws PolicyForwardingException { final PdpDeployPolicies pdpPolicies = new PdpDeployPolicies(); - final List policyIdentifierList = new ArrayList<>(); + final List policyIdentifierList = new ArrayList<>(); for (final Map policyMap : toscaServiceTemplate.getToscaTopologyTemplate().getPolicies()) { final String policyId = policyMap.entrySet().iterator().next().getValue().getMetadata().get("policy-id"); final String policyVersion = policyMap.entrySet().iterator().next().getValue().getMetadata().get("policy-version"); - final ToscaPolicyIdentifierOptVersion toscaPolicyIdentifier = - new ToscaPolicyIdentifierOptVersion(policyId, policyVersion); + final ToscaConceptIdentifierOptVersion toscaPolicyIdentifier = + new ToscaConceptIdentifierOptVersion(policyId, policyVersion); policyIdentifierList.add(toscaPolicyIdentifier); } pdpPolicies.setPolicies(policyIdentifierList); -- cgit 1.2.3-korg