aboutsummaryrefslogtreecommitdiffstats
path: root/models-tosca
diff options
context:
space:
mode:
authorChenfei Gao <cgao@research.att.com>2020-01-09 14:04:05 -0500
committerChenfei Gao <cgao@research.att.com>2020-01-10 09:08:06 -0500
commit3078d33fa62ae86f3d645a1469165c55a5c1efd4 (patch)
treeffd13671ddf365caf7d65b86901bad01cdd991ad /models-tosca
parenta3771d2efbf906cc4bf58683d4b2f40637d63ced (diff)
Added new policy examples to support integration of new version validation feature
Issue-ID: POLICY-2316 Change-Id: Ifcb6739c7dd6c5796067a4b9e2f3eef960e1ace4 Signed-off-by: Chenfei Gao <cgao@research.att.com>
Diffstat (limited to 'models-tosca')
-rw-r--r--models-tosca/src/main/java/org/onap/policy/models/tosca/legacy/provider/LegacyProvider.java12
1 files changed, 1 insertions, 11 deletions
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 =