summaryrefslogtreecommitdiffstats
path: root/models-tosca/src
diff options
context:
space:
mode:
authorLiam Fallon <liam.fallon@est.tech>2020-01-10 15:37:41 +0000
committerGerrit Code Review <gerrit@onap.org>2020-01-10 15:37:41 +0000
commitf2915eac328de8b66663a13338ab0671b7912f85 (patch)
tree78f16b4baa22d6cda33e36a4e3cd14e131ae5b77 /models-tosca/src
parent52aec22c445d55f6640c30f7a5bf9b5024f743df (diff)
parent3078d33fa62ae86f3d645a1469165c55a5c1efd4 (diff)
Merge "Added new policy examples to support integration of new version validation feature"
Diffstat (limited to 'models-tosca/src')
-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 =