aboutsummaryrefslogtreecommitdiffstats
path: root/applications/native
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@est.tech>2021-01-04 13:47:42 +0000
committerliamfallon <liam.fallon@est.tech>2021-01-04 16:19:42 +0000
commitf4a86b5bc37350c15c62544cea5e22ce7b6f931b (patch)
treee3ee53a4459a7d690918613399565951014ed71f /applications/native
parente15fe6da7b38df5e6003006acc8f166653685d85 (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/native')
-rw-r--r--applications/native/src/main/java/org/onap/policy/xacml/pdp/application/nativ/NativePdpApplication.java7
-rw-r--r--applications/native/src/test/java/org/onap/policy/xacml/pdp/application/nativ/NativePdpApplicationTest.java9
2 files changed, 9 insertions, 7 deletions
diff --git a/applications/native/src/main/java/org/onap/policy/xacml/pdp/application/nativ/NativePdpApplication.java b/applications/native/src/main/java/org/onap/policy/xacml/pdp/application/nativ/NativePdpApplication.java
index f8248f1c..cfe1a710 100644
--- a/applications/native/src/main/java/org/onap/policy/xacml/pdp/application/nativ/NativePdpApplication.java
+++ b/applications/native/src/main/java/org/onap/policy/xacml/pdp/application/nativ/NativePdpApplication.java
@@ -3,6 +3,7 @@
* ONAP
* ================================================================================
* Copyright (C) 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.
@@ -25,7 +26,7 @@ package org.onap.policy.xacml.pdp.application.nativ;
import com.att.research.xacml.api.Request;
import com.att.research.xacml.api.Response;
import java.util.Arrays;
-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.StdXacmlApplicationServiceProvider;
@@ -37,7 +38,7 @@ import org.onap.policy.pdp.xacml.application.common.std.StdXacmlApplicationServi
*/
public class NativePdpApplication extends StdXacmlApplicationServiceProvider {
- private static final ToscaPolicyTypeIdentifier nativePolicyType = new ToscaPolicyTypeIdentifier(
+ private static final ToscaConceptIdentifier nativePolicyType = new ToscaConceptIdentifier(
"onap.policies.native.Xacml", "1.0.0");
private NativePdpApplicationTranslator translator = new NativePdpApplicationTranslator();
@@ -53,7 +54,7 @@ public class NativePdpApplication extends StdXacmlApplicationServiceProvider {
}
@Override
- public boolean canSupportPolicyType(ToscaPolicyTypeIdentifier policyTypeId) {
+ public boolean canSupportPolicyType(ToscaConceptIdentifier policyTypeId) {
return nativePolicyType.equals(policyTypeId);
}
diff --git a/applications/native/src/test/java/org/onap/policy/xacml/pdp/application/nativ/NativePdpApplicationTest.java b/applications/native/src/test/java/org/onap/policy/xacml/pdp/application/nativ/NativePdpApplicationTest.java
index f434e80f..9a0ebc01 100644
--- a/applications/native/src/test/java/org/onap/policy/xacml/pdp/application/nativ/NativePdpApplicationTest.java
+++ b/applications/native/src/test/java/org/onap/policy/xacml/pdp/application/nativ/NativePdpApplicationTest.java
@@ -3,6 +3,7 @@
* ONAP
* ================================================================================
* Copyright (C) 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.
@@ -42,8 +43,8 @@ import org.onap.policy.common.endpoints.parameters.RestServerParameters;
import org.onap.policy.common.utils.coder.StandardYamlCoder;
import org.onap.policy.common.utils.resources.ResourceUtils;
import org.onap.policy.common.utils.resources.TextFileUtils;
+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.models.tosca.authorative.concepts.ToscaServiceTemplate;
import org.onap.policy.models.tosca.simple.concepts.JpaToscaServiceTemplate;
import org.onap.policy.pdp.xacml.application.common.ToscaPolicyConversionException;
@@ -130,9 +131,9 @@ public class NativePdpApplicationTest {
assertThat(translator.convertResponse(null)).isNull();
NativePdpApplication application = new NativePdpApplication();
- assertThat(application.canSupportPolicyType(new ToscaPolicyTypeIdentifier(
+ assertThat(application.canSupportPolicyType(new ToscaConceptIdentifier(
"onap.policies.native.Xacml", "1.0.0"))).isTrue();
- assertThat(application.canSupportPolicyType(new ToscaPolicyTypeIdentifier(
+ assertThat(application.canSupportPolicyType(new ToscaConceptIdentifier(
"onap.policies.native.SomethingElse", "1.0.0"))).isFalse();
assertThat(application.actionDecisionsSupported()).contains("native");
}
@@ -223,4 +224,4 @@ public class NativePdpApplicationTest {
assertThat(decision).hasToString(expected);
LOGGER.info("Xacml response we received {}", DOMResponse.toString(response));
}
-} \ No newline at end of file
+}