diff options
author | liamfallon <liam.fallon@est.tech> | 2021-01-04 13:47:42 +0000 |
---|---|---|
committer | liamfallon <liam.fallon@est.tech> | 2021-01-04 16:19:42 +0000 |
commit | f4a86b5bc37350c15c62544cea5e22ce7b6f931b (patch) | |
tree | e3ee53a4459a7d690918613399565951014ed71f /applications/monitoring/src | |
parent | e15fe6da7b38df5e6003006acc8f166653685d85 (diff) |
Changed identifiers to concept identifiers
The policy models tosca classes ToscaPolicyIdentifier and
ToscaPolicyIdentifierOptVersion can be used to identify any TOSCA
concept, not just TOSCA policies so they are renamed to
ToscaConceptIdentifier and ToscaCinceptIdentifierOptVersion
respectively.
The class ToscaPolicyTypeIdentifier is redundant and is replaced by
ToscaConceptIdentifier.
Issue-ID: POLICY-2900
Change-Id: Id614bbed34ed8897e7e882b70147b98ffe90bf57
Signed-off-by: liamfallon <liam.fallon@est.tech>
Diffstat (limited to 'applications/monitoring/src')
2 files changed, 9 insertions, 7 deletions
diff --git a/applications/monitoring/src/main/java/org/onap/policy/xacml/pdp/application/monitoring/MonitoringPdpApplication.java b/applications/monitoring/src/main/java/org/onap/policy/xacml/pdp/application/monitoring/MonitoringPdpApplication.java index a3456aea..17a9e743 100644 --- a/applications/monitoring/src/main/java/org/onap/policy/xacml/pdp/application/monitoring/MonitoringPdpApplication.java +++ b/applications/monitoring/src/main/java/org/onap/policy/xacml/pdp/application/monitoring/MonitoringPdpApplication.java @@ -3,6 +3,7 @@ * ONAP * ================================================================================ * Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2021 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,7 +30,7 @@ import java.util.Map.Entry; import org.apache.commons.lang3.tuple.Pair; import org.onap.policy.models.decisions.concepts.DecisionRequest; import org.onap.policy.models.decisions.concepts.DecisionResponse; -import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyTypeIdentifier; +import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier; import org.onap.policy.pdp.xacml.application.common.ToscaPolicyTranslator; import org.onap.policy.pdp.xacml.application.common.std.StdCombinedPolicyResultsTranslator; import org.onap.policy.pdp.xacml.application.common.std.StdXacmlApplicationServiceProvider; @@ -66,11 +67,11 @@ public class MonitoringPdpApplication extends StdXacmlApplicationServiceProvider // // By default this supports just Monitoring policy types // - supportedPolicyTypes.add(new ToscaPolicyTypeIdentifier(ONAP_MONITORING_BASE_POLICY_TYPE, VERSION_100)); + supportedPolicyTypes.add(new ToscaConceptIdentifier(ONAP_MONITORING_BASE_POLICY_TYPE, VERSION_100)); } @Override - public boolean canSupportPolicyType(ToscaPolicyTypeIdentifier policyTypeId) { + public boolean canSupportPolicyType(ToscaConceptIdentifier policyTypeId) { // // For Monitoring, we will attempt to support all versions // of the policy type. Since we are only packaging a decision diff --git a/applications/monitoring/src/test/java/org/onap/policy/xacml/pdp/application/monitoring/MonitoringPdpApplicationTest.java b/applications/monitoring/src/test/java/org/onap/policy/xacml/pdp/application/monitoring/MonitoringPdpApplicationTest.java index 04895b8b..1c2967de 100644 --- a/applications/monitoring/src/test/java/org/onap/policy/xacml/pdp/application/monitoring/MonitoringPdpApplicationTest.java +++ b/applications/monitoring/src/test/java/org/onap/policy/xacml/pdp/application/monitoring/MonitoringPdpApplicationTest.java @@ -3,6 +3,7 @@ * ONAP * ================================================================================ * Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2021 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -46,8 +47,8 @@ import org.onap.policy.common.utils.coder.StandardCoder; import org.onap.policy.common.utils.resources.TextFileUtils; import org.onap.policy.models.decisions.concepts.DecisionRequest; import org.onap.policy.models.decisions.concepts.DecisionResponse; +import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier; import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy; -import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyTypeIdentifier; import org.onap.policy.pdp.xacml.application.common.XacmlApplicationException; import org.onap.policy.pdp.xacml.application.common.XacmlApplicationServiceProvider; import org.onap.policy.pdp.xacml.application.common.XacmlPolicyUtils; @@ -143,12 +144,12 @@ public class MonitoringPdpApplicationTest { // can support the correct policy types. // assertThat(service.canSupportPolicyType( - new ToscaPolicyTypeIdentifier("onap.policies.monitoring.tcagen2", "1.0.0"))).isTrue(); + new ToscaConceptIdentifier("onap.policies.monitoring.tcagen2", "1.0.0"))).isTrue(); assertThat(service.canSupportPolicyType( - new ToscaPolicyTypeIdentifier( + new ToscaConceptIdentifier( "onap.policies.monitoring.foobar", "1.0.1"))).isTrue(); assertThat(service.canSupportPolicyType( - new ToscaPolicyTypeIdentifier("onap.foobar", "1.0.0"))).isFalse(); + new ToscaConceptIdentifier("onap.foobar", "1.0.0"))).isFalse(); // // Ensure it supports decisions // |