From 3078d33fa62ae86f3d645a1469165c55a5c1efd4 Mon Sep 17 00:00:00 2001 From: Chenfei Gao Date: Thu, 9 Jan 2020 14:04:05 -0500 Subject: Added new policy examples to support integration of new version validation feature Issue-ID: POLICY-2316 Change-Id: Ifcb6739c7dd6c5796067a4b9e2f3eef960e1ace4 Signed-off-by: Chenfei Gao --- .../policy/models/tosca/legacy/provider/LegacyProvider.java | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'models-tosca') diff --git a/models-tosca/src/main/java/org/onap/policy/models/tosca/legacy/provider/LegacyProvider.java b/models-tosca/src/main/java/org/onap/policy/models/tosca/legacy/provider/LegacyProvider.java index 9124a2983..f5335fe79 100644 --- a/models-tosca/src/main/java/org/onap/policy/models/tosca/legacy/provider/LegacyProvider.java +++ b/models-tosca/src/main/java/org/onap/policy/models/tosca/legacy/provider/LegacyProvider.java @@ -1,6 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2019 Nordix Foundation. + * Copyright (C) 2020 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. @@ -52,7 +53,6 @@ import org.slf4j.LoggerFactory; public class LegacyProvider { private static final Logger LOGGER = LoggerFactory.getLogger(LegacyProvider.class); - private static final String FIRST_POLICY_VERSION = "1"; private static final String LEGACY_MINOR_PATCH_SUFFIX = ".0.0"; // Recurring constants @@ -93,16 +93,6 @@ public class LegacyProvider { LOGGER.debug("->createOperationalPolicy: legacyOperationalPolicy={}", legacyOperationalPolicy); - // We need to find the latest policy and update the major version, if there is no policy with this ID, then - // we set it to the first version - JpaToscaPolicy newestPolicy = getLatestPolicy(dao, legacyOperationalPolicy.getPolicyId()); - - if (newestPolicy == null) { - legacyOperationalPolicy.setPolicyVersion(FIRST_POLICY_VERSION); - } else { - legacyOperationalPolicy.setPolicyVersion(Integer.toString(newestPolicy.getKey().getMajorVersion() + 1)); - } - JpaToscaServiceTemplate incomingServiceTemplate = new LegacyOperationalPolicyMapper().toToscaServiceTemplate(legacyOperationalPolicy); JpaToscaServiceTemplate outgoingingServiceTemplate = -- cgit 1.2.3-korg