summaryrefslogtreecommitdiffstats
path: root/models-tosca/src/main
diff options
context:
space:
mode:
authorPamela Dragosh <pdragosh@research.att.com>2020-03-06 15:58:15 +0000
committerGerrit Code Review <gerrit@onap.org>2020-03-06 15:58:15 +0000
commit3f48197acf151c5f2b2b8b4e7bd366c2371619a0 (patch)
tree514c22e1d61cbd6dc1268dde8899018cb8a42234 /models-tosca/src/main
parentaedb286b0683e9ac24c5160e9d47f596a243697f (diff)
parent172b8dcd3a772c03ec1d233cfd6602d901c61b99 (diff)
Merge "TOSCA Compliant Guard Policies"
Diffstat (limited to 'models-tosca/src/main')
-rw-r--r--models-tosca/src/main/java/org/onap/policy/models/tosca/legacy/concepts/LegacyGuardPolicyContent.java112
-rw-r--r--models-tosca/src/main/java/org/onap/policy/models/tosca/legacy/concepts/LegacyGuardPolicyInput.java46
-rw-r--r--models-tosca/src/main/java/org/onap/policy/models/tosca/legacy/concepts/LegacyGuardPolicyOutput.java38
-rw-r--r--models-tosca/src/main/java/org/onap/policy/models/tosca/legacy/mapping/LegacyGuardPolicyMapper.java165
-rw-r--r--models-tosca/src/main/java/org/onap/policy/models/tosca/legacy/mapping/LegacyOperationalPolicyMapper.java2
-rw-r--r--models-tosca/src/main/java/org/onap/policy/models/tosca/legacy/provider/LegacyProvider.java97
-rw-r--r--models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaServiceTemplate.java2
7 files changed, 2 insertions, 460 deletions
diff --git a/models-tosca/src/main/java/org/onap/policy/models/tosca/legacy/concepts/LegacyGuardPolicyContent.java b/models-tosca/src/main/java/org/onap/policy/models/tosca/legacy/concepts/LegacyGuardPolicyContent.java
deleted file mode 100644
index 91ff150fc..000000000
--- a/models-tosca/src/main/java/org/onap/policy/models/tosca/legacy/concepts/LegacyGuardPolicyContent.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.policy.models.tosca.legacy.concepts;
-
-import java.lang.reflect.Field;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.ws.rs.core.Response;
-
-import lombok.Data;
-
-import org.onap.policy.common.utils.coder.StandardCoder;
-import org.onap.policy.models.base.PfModelRuntimeException;
-import org.onap.policy.models.tosca.legacy.mapping.LegacyGuardPolicyMapper;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Content object of a Legacy Guard Policy.
- *
- * @author Liam Fallon (liam.fallon@est.tech)
- */
-@Data
-public class LegacyGuardPolicyContent {
- private static final Logger LOGGER = LoggerFactory.getLogger(LegacyGuardPolicyMapper.class);
-
- private String actor;
- private String recipe;
- private String targets;
- private String clname;
- private String limit;
- private String timeWindow;
- private String timeUnits;
- private String min;
- private String max;
- private String guardActiveStart;
- private String guardActiveEnd;
-
- /**
- * Get contents as a property map.
- *
- * @return the contents as a map.
- */
- public Map<String, String> getAsPropertyMap() {
- final Map<String, String> propertyMap = new HashMap<>();
-
- final StandardCoder coder = new StandardCoder();
-
- try {
- for (Field field : this.getClass().getDeclaredFields()) {
- if (field.get(this) != null && field.getType().equals(String.class)) {
- propertyMap.put(field.getName(), coder.encode(field.get(this)));
- }
- }
- } catch (Exception exc) {
- String errorMessage = "could not convert content to a property map";
- LOGGER.warn(errorMessage, exc);
- throw new PfModelRuntimeException(Response.Status.BAD_REQUEST, errorMessage, exc);
-
- }
-
- return propertyMap;
- }
-
- /**
- * Set the contents from a property map.
- *
- * @param propertyMap the incoming property map
- */
- public void setContent(final Map<String, String> propertyMap) {
- final StandardCoder coder = new StandardCoder();
-
- try {
- // @formatter:off
- setActor( coder.decode(propertyMap.get("actor"), String.class));
- setClname( coder.decode(propertyMap.get("clname"), String.class));
- setGuardActiveEnd( coder.decode(propertyMap.get("guardActiveEnd"), String.class));
- setGuardActiveStart(coder.decode(propertyMap.get("guardActiveStart"), String.class));
- setLimit( coder.decode(propertyMap.get("limit"), String.class));
- setMax( coder.decode(propertyMap.get("max"), String.class));
- setMin( coder.decode(propertyMap.get("min"), String.class));
- setRecipe( coder.decode(propertyMap.get("recipe"), String.class));
- setTargets( coder.decode(propertyMap.get("targets"), String.class));
- setTimeUnits( coder.decode(propertyMap.get("timeUnits"), String.class));
- setTimeWindow( coder.decode(propertyMap.get("timeWindow"), String.class));
- // @formatter:on
- } catch (Exception exc) {
- String errorMessage = "could not convert content to a property map";
- LOGGER.warn(errorMessage, exc);
- throw new PfModelRuntimeException(Response.Status.BAD_REQUEST, errorMessage, exc);
- }
- }
-}
diff --git a/models-tosca/src/main/java/org/onap/policy/models/tosca/legacy/concepts/LegacyGuardPolicyInput.java b/models-tosca/src/main/java/org/onap/policy/models/tosca/legacy/concepts/LegacyGuardPolicyInput.java
deleted file mode 100644
index 819fcba75..000000000
--- a/models-tosca/src/main/java/org/onap/policy/models/tosca/legacy/concepts/LegacyGuardPolicyInput.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
- * Modifications Copyright (C) 2019 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.policy.models.tosca.legacy.concepts;
-
-import com.google.gson.annotations.SerializedName;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-
-/**
- * Definition of a legacy guard policy stored as a TOSCA policy.
- *
- * @author Liam Fallon (liam.fallon@est.tech)
- */
-@Data
-public class LegacyGuardPolicyInput {
-
- @ApiModelProperty(name = "policy-id")
- @SerializedName("policy-id")
- private String policyId;
-
- @ApiModelProperty(name = "policy-version")
- @SerializedName("policy-version")
- private String policyVersion;
-
- private LegacyGuardPolicyContent content;
-
-}
diff --git a/models-tosca/src/main/java/org/onap/policy/models/tosca/legacy/concepts/LegacyGuardPolicyOutput.java b/models-tosca/src/main/java/org/onap/policy/models/tosca/legacy/concepts/LegacyGuardPolicyOutput.java
deleted file mode 100644
index 2fe3d88e4..000000000
--- a/models-tosca/src/main/java/org/onap/policy/models/tosca/legacy/concepts/LegacyGuardPolicyOutput.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.policy.models.tosca.legacy.concepts;
-
-import java.util.Map;
-
-import lombok.Data;
-
-/**
- * Body of a legacy guard policy output.
- *
- * @author Liam Fallon (liam.fallon@est.tech)
- */
-@Data
-public class LegacyGuardPolicyOutput {
- private String type;
- private String version;
- private Map<String, Object> metadata;
- private Map<String, LegacyGuardPolicyContent> properties;
-}
diff --git a/models-tosca/src/main/java/org/onap/policy/models/tosca/legacy/mapping/LegacyGuardPolicyMapper.java b/models-tosca/src/main/java/org/onap/policy/models/tosca/legacy/mapping/LegacyGuardPolicyMapper.java
deleted file mode 100644
index b7ebdcec3..000000000
--- a/models-tosca/src/main/java/org/onap/policy/models/tosca/legacy/mapping/LegacyGuardPolicyMapper.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * Copyright (C) 2019-2020 Nordix Foundation.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.policy.models.tosca.legacy.mapping;
-
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import javax.ws.rs.core.Response;
-
-import org.onap.policy.models.base.PfConceptKey;
-import org.onap.policy.models.base.PfModelRuntimeException;
-import org.onap.policy.models.tosca.legacy.concepts.LegacyGuardPolicyContent;
-import org.onap.policy.models.tosca.legacy.concepts.LegacyGuardPolicyInput;
-import org.onap.policy.models.tosca.legacy.concepts.LegacyGuardPolicyOutput;
-import org.onap.policy.models.tosca.simple.concepts.JpaToscaPolicies;
-import org.onap.policy.models.tosca.simple.concepts.JpaToscaPolicy;
-import org.onap.policy.models.tosca.simple.concepts.JpaToscaServiceTemplate;
-import org.onap.policy.models.tosca.simple.concepts.JpaToscaTopologyTemplate;
-import org.onap.policy.models.tosca.simple.mapping.JpaToscaServiceTemplateMapper;
-import org.onap.policy.models.tosca.utils.ToscaUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * This class maps a legacy guard policy to and from a TOSCA service template.
- *
- * @author Liam Fallon (liam.fallon@est.tech)
- */
-public class LegacyGuardPolicyMapper
- implements JpaToscaServiceTemplateMapper<LegacyGuardPolicyInput, Map<String, LegacyGuardPolicyOutput>> {
- private static final Logger LOGGER = LoggerFactory.getLogger(LegacyGuardPolicyMapper.class);
-
- // Tag for metadata fields
- private static final String POLICY_ID = "policy-id";
- private static final String POLICY_VERSION = "policy-version";
-
- private static final Map<String, PfConceptKey> GUARD_POLICY_TYPE_MAP = new LinkedHashMap<>();
-
- static {
- GUARD_POLICY_TYPE_MAP.put("guard.frequency.",
- new PfConceptKey("onap.policies.controlloop.guard.FrequencyLimiter:1.0.0"));
- GUARD_POLICY_TYPE_MAP.put("guard.minmax.", new PfConceptKey("onap.policies.controlloop.guard.MinMax:1.0.0"));
- GUARD_POLICY_TYPE_MAP.put("guard.blacklist.",
- new PfConceptKey("onap.policies.controlloop.guard.Blacklist:1.0.0"));
- }
-
- @Override
- public JpaToscaServiceTemplate toToscaServiceTemplate(final LegacyGuardPolicyInput legacyGuardPolicyInput) {
- PfConceptKey guardPolicyType = getGuardPolicyType(legacyGuardPolicyInput);
- if (guardPolicyType == null) {
- String errorMessage =
- "policy type for guard policy \"" + legacyGuardPolicyInput.getPolicyId() + "\" unknown";
- LOGGER.warn(errorMessage);
- throw new PfModelRuntimeException(Response.Status.BAD_REQUEST, errorMessage);
- }
-
- String version = legacyGuardPolicyInput.getPolicyVersion();
- if (version != null) {
- version = version + ".0.0";
- } else {
- version = guardPolicyType.getVersion();
- }
-
- PfConceptKey policyKey = new PfConceptKey(legacyGuardPolicyInput.getPolicyId(), version);
-
- final JpaToscaPolicy toscaPolicy = new JpaToscaPolicy(policyKey);
- toscaPolicy.setType(guardPolicyType);
- toscaPolicy.setProperties(legacyGuardPolicyInput.getContent().getAsPropertyMap());
-
- final Map<String, String> metadata = new LinkedHashMap<>();
- metadata.put(POLICY_ID, toscaPolicy.getKey().getName());
- metadata.put(POLICY_VERSION, Integer.toString(toscaPolicy.getKey().getMajorVersion()));
- toscaPolicy.setMetadata(metadata);
-
- final JpaToscaServiceTemplate serviceTemplate = new JpaToscaServiceTemplate();
- serviceTemplate.setToscaDefinitionsVersion("tosca_simple_yaml_1_0_0");
-
- serviceTemplate.setTopologyTemplate(new JpaToscaTopologyTemplate());
-
- serviceTemplate.getTopologyTemplate().setPolicies(new JpaToscaPolicies());
- serviceTemplate.getTopologyTemplate().getPolicies().getConceptMap().put(policyKey, toscaPolicy);
-
- return serviceTemplate;
- }
-
- @Override
- public Map<String, LegacyGuardPolicyOutput>
- fromToscaServiceTemplate(final JpaToscaServiceTemplate serviceTemplate) {
- ToscaUtils.assertPoliciesExist(serviceTemplate);
-
- final Map<String, LegacyGuardPolicyOutput> legacyGuardPolicyOutputMap = new LinkedHashMap<>();
-
- for (JpaToscaPolicy toscaPolicy : serviceTemplate.getTopologyTemplate().getPolicies().getConceptMap()
- .values()) {
-
- final LegacyGuardPolicyOutput legacyGuardPolicyOutput = new LegacyGuardPolicyOutput();
- legacyGuardPolicyOutput.setType(toscaPolicy.getType().getName());
- legacyGuardPolicyOutput.setVersion(toscaPolicy.getKey().getVersion());
-
- if (toscaPolicy.getMetadata() == null) {
- String errorMessage = "no metadata defined on TOSCA policy";
- LOGGER.warn(errorMessage);
- throw new PfModelRuntimeException(Response.Status.BAD_REQUEST, errorMessage);
- }
-
- final Map<String, Object> metadata = new LinkedHashMap<>(toscaPolicy.getMetadata());
-
- // if version exists, convert it to int
- metadata.computeIfPresent(POLICY_VERSION, (key, val) -> Integer.parseInt(val.toString()));
-
- legacyGuardPolicyOutput.setMetadata(metadata);
-
- if (toscaPolicy.getProperties() == null) {
- String errorMessage = "no properties defined on TOSCA policy";
- LOGGER.warn(errorMessage);
- throw new PfModelRuntimeException(Response.Status.BAD_REQUEST, errorMessage);
- }
-
- final LegacyGuardPolicyContent content = new LegacyGuardPolicyContent();
- content.setContent(toscaPolicy.getProperties());
-
- final Map<String, LegacyGuardPolicyContent> propertiesMap = new LinkedHashMap<>();
- propertiesMap.put("content", content);
- legacyGuardPolicyOutput.setProperties(propertiesMap);
-
- legacyGuardPolicyOutputMap.put(toscaPolicy.getKey().getName(), legacyGuardPolicyOutput);
- }
-
- return legacyGuardPolicyOutputMap;
- }
-
- private PfConceptKey getGuardPolicyType(final LegacyGuardPolicyInput legacyGuardPolicyInput) {
- final String policyId = legacyGuardPolicyInput.getPolicyId();
- if (policyId == null) {
- return null;
- }
-
- for (Entry<String, PfConceptKey> guardPolicyTypeEntry : GUARD_POLICY_TYPE_MAP.entrySet()) {
- if (policyId.startsWith(guardPolicyTypeEntry.getKey())) {
- return guardPolicyTypeEntry.getValue();
- }
- }
-
- return null;
- }
-}
diff --git a/models-tosca/src/main/java/org/onap/policy/models/tosca/legacy/mapping/LegacyOperationalPolicyMapper.java b/models-tosca/src/main/java/org/onap/policy/models/tosca/legacy/mapping/LegacyOperationalPolicyMapper.java
index 41792aeb9..de1bc12d7 100644
--- a/models-tosca/src/main/java/org/onap/policy/models/tosca/legacy/mapping/LegacyOperationalPolicyMapper.java
+++ b/models-tosca/src/main/java/org/onap/policy/models/tosca/legacy/mapping/LegacyOperationalPolicyMapper.java
@@ -71,7 +71,7 @@ public class LegacyOperationalPolicyMapper
toscaPolicy.getProperties().put(CONTENT_PROPERTY, legacyOperationalPolicy.getContent());
final JpaToscaServiceTemplate serviceTemplate = new JpaToscaServiceTemplate();
- serviceTemplate.setToscaDefinitionsVersion("tosca_simple_yaml_1_0_0");
+ serviceTemplate.setToscaDefinitionsVersion("tosca_simple_yaml_1_1_0");
serviceTemplate.setTopologyTemplate(new JpaToscaTopologyTemplate());
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 dc8affc77..314c7728d 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
@@ -22,7 +22,6 @@
package org.onap.policy.models.tosca.legacy.provider;
import java.util.List;
-import java.util.Map;
import javax.ws.rs.core.Response;
@@ -32,10 +31,7 @@ import org.onap.policy.models.base.PfConceptKey;
import org.onap.policy.models.base.PfModelException;
import org.onap.policy.models.base.PfModelRuntimeException;
import org.onap.policy.models.dao.PfDao;
-import org.onap.policy.models.tosca.legacy.concepts.LegacyGuardPolicyInput;
-import org.onap.policy.models.tosca.legacy.concepts.LegacyGuardPolicyOutput;
import org.onap.policy.models.tosca.legacy.concepts.LegacyOperationalPolicy;
-import org.onap.policy.models.tosca.legacy.mapping.LegacyGuardPolicyMapper;
import org.onap.policy.models.tosca.legacy.mapping.LegacyOperationalPolicyMapper;
import org.onap.policy.models.tosca.simple.concepts.JpaToscaPolicies;
import org.onap.policy.models.tosca.simple.concepts.JpaToscaPolicy;
@@ -152,99 +148,6 @@ public class LegacyProvider {
}
/**
- * Get legacy guard policy.
- *
- * @param dao the DAO to use to access the database
- * @param policyId ID of the policy.
- * @param policyVersion version of the policy.
- * @return the policies found
- * @throws PfModelException on errors getting policies
- */
- public Map<String, LegacyGuardPolicyOutput> getGuardPolicy(@NonNull final PfDao dao, @NonNull final String policyId,
- final String policyVersion) throws PfModelException {
-
- LOGGER.debug("->getGuardPolicy: policyId={}, policyVersion={}", policyId, policyVersion);
-
- Map<String, LegacyGuardPolicyOutput> legacyGuardPolicyMap =
- new LegacyGuardPolicyMapper().fromToscaServiceTemplate(getLegacyPolicy(dao, policyId, policyVersion));
-
- LOGGER.debug("<-getGuardPolicy: policyId={}, policyVersion={}, legacyGuardPolicyMap={}", policyId,
- policyVersion, legacyGuardPolicyMap);
- return legacyGuardPolicyMap;
- }
-
- /**
- * Create legacy guard policy.
- *
- * @param dao the DAO to use to access the database
- * @param legacyGuardPolicy the definition of the policy to be created.
- * @return the created policy
- * @throws PfModelException on errors creating policies
- */
- public Map<String, LegacyGuardPolicyOutput> createGuardPolicy(@NonNull final PfDao dao,
- @NonNull final LegacyGuardPolicyInput legacyGuardPolicy) throws PfModelException {
-
- LOGGER.debug("->createGuardPolicy: legacyGuardPolicy={}", legacyGuardPolicy);
-
- JpaToscaServiceTemplate incomingServiceTemplate =
- new LegacyGuardPolicyMapper().toToscaServiceTemplate(legacyGuardPolicy);
- JpaToscaServiceTemplate outgoingingServiceTemplate =
- new SimpleToscaProvider().createPolicies(dao, incomingServiceTemplate);
-
- Map<String, LegacyGuardPolicyOutput> createdLegacyGuardPolicyMap =
- new LegacyGuardPolicyMapper().fromToscaServiceTemplate(outgoingingServiceTemplate);
-
- LOGGER.debug("<-createGuardPolicy: createdLegacyGuardPolicyMap={}", createdLegacyGuardPolicyMap);
- return createdLegacyGuardPolicyMap;
- }
-
- /**
- * Update legacy guard policy.
- *
- * @param dao the DAO to use to access the database
- * @param legacyGuardPolicy the definition of the policy to be updated
- * @return the updated policy
- * @throws PfModelException on errors updating policies
- */
- public Map<String, LegacyGuardPolicyOutput> updateGuardPolicy(@NonNull final PfDao dao,
- @NonNull final LegacyGuardPolicyInput legacyGuardPolicy) throws PfModelException {
-
- LOGGER.debug("->updateGuardPolicy: legacyGuardPolicy={}", legacyGuardPolicy);
-
- JpaToscaServiceTemplate incomingServiceTemplate =
- new LegacyGuardPolicyMapper().toToscaServiceTemplate(legacyGuardPolicy);
- JpaToscaServiceTemplate outgoingingServiceTemplate =
- new SimpleToscaProvider().updatePolicies(dao, incomingServiceTemplate);
-
- Map<String, LegacyGuardPolicyOutput> updatedLegacyGuardPolicyMap =
- new LegacyGuardPolicyMapper().fromToscaServiceTemplate(outgoingingServiceTemplate);
-
- LOGGER.debug("<-updateGuardPolicy: updatedLegacyGuardPolicyMap={}", updatedLegacyGuardPolicyMap);
- return updatedLegacyGuardPolicyMap;
- }
-
- /**
- * Delete legacy guard policy.
- *
- * @param dao the DAO to use to access the database
- * @param policyId ID of the policy.
- * @param policyVersion version of the policy.
- * @return the deleted policy
- * @throws PfModelException on errors deleting policies
- */
- public Map<String, LegacyGuardPolicyOutput> deleteGuardPolicy(@NonNull final PfDao dao,
- @NonNull final String policyId, @NonNull final String policyVersion) throws PfModelException {
-
- LOGGER.debug("->deleteGuardPolicy: policyId={}, policyVersion={}", policyId, policyVersion);
- Map<String, LegacyGuardPolicyOutput> legacyGuardPolicyMap = new LegacyGuardPolicyMapper()
- .fromToscaServiceTemplate(deleteLegacyPolicy(dao, policyId, policyVersion));
-
- LOGGER.debug("<-deleteGuardPolicy: policyId={}, policyVersion={}, legacyGuardPolicyMap={}", policyId,
- policyVersion, legacyGuardPolicyMap);
- return legacyGuardPolicyMap;
- }
-
- /**
* Get the JPA Policy for a policy ID and version.
*
* @param dao The DAO to search
diff --git a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaServiceTemplate.java b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaServiceTemplate.java
index aa4f231c0..e2e27f0e2 100644
--- a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaServiceTemplate.java
+++ b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaServiceTemplate.java
@@ -73,7 +73,7 @@ public class JpaToscaServiceTemplate extends JpaToscaEntityType<ToscaServiceTemp
implements PfAuthorative<ToscaServiceTemplate> {
private static final long serialVersionUID = 8084846046148349401L;
- public static final String DEFAULT_TOSCA_DEFINTIONS_VERISON = "tosca_simple_yaml_1_0_0";
+ public static final String DEFAULT_TOSCA_DEFINTIONS_VERISON = "tosca_simple_yaml_1_1_0";
public static final String DEFAULT_NAME = "ToscaServiceTemplateSimple";
public static final String DEFAULT_VERSION = "1.0.0";