aboutsummaryrefslogtreecommitdiffstats
path: root/main/src
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 /main/src
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 'main/src')
-rw-r--r--main/src/main/java/org/onap/policy/pdpx/main/rest/XacmlPdpApplicationManager.java10
-rw-r--r--main/src/test/java/org/onap/policy/pdpx/main/XacmlStateTest.java11
2 files changed, 11 insertions, 10 deletions
diff --git a/main/src/main/java/org/onap/policy/pdpx/main/rest/XacmlPdpApplicationManager.java b/main/src/main/java/org/onap/policy/pdpx/main/rest/XacmlPdpApplicationManager.java
index 66f965ff..7c46ef38 100644
--- a/main/src/main/java/org/onap/policy/pdpx/main/rest/XacmlPdpApplicationManager.java
+++ b/main/src/main/java/org/onap/policy/pdpx/main/rest/XacmlPdpApplicationManager.java
@@ -1,6 +1,7 @@
/*-
* ============LICENSE_START=======================================================
* 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.
@@ -34,9 +35,8 @@ import lombok.Getter;
import lombok.Setter;
import org.onap.policy.common.endpoints.parameters.RestServerParameters;
import org.onap.policy.models.decisions.concepts.DecisionRequest;
+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.ToscaPolicyIdentifier;
-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.slf4j.Logger;
@@ -51,7 +51,7 @@ public class XacmlPdpApplicationManager {
private ServiceLoader<XacmlApplicationServiceProvider> applicationLoader;
private Map<String, XacmlApplicationServiceProvider> providerActionMap = new HashMap<>();
- private List<ToscaPolicyTypeIdentifier> toscaPolicyTypeIdents = new ArrayList<>();
+ private List<ToscaConceptIdentifier> toscaPolicyTypeIdents = new ArrayList<>();
private Map<ToscaPolicy, XacmlApplicationServiceProvider> mapLoadedPolicies = new HashMap<>();
@@ -136,14 +136,14 @@ public class XacmlPdpApplicationManager {
*
* @return list of ToscaPolicyIdentifier
*/
- public List<ToscaPolicyIdentifier> getToscaPolicyIdentifiers() {
+ public List<ToscaConceptIdentifier> getToscaPolicyIdentifiers() {
//
// converting map to return List of ToscaPolicyIdentiers
//
return mapLoadedPolicies.keySet().stream().map(ToscaPolicy::getIdentifier).collect(Collectors.toList());
}
- public List<ToscaPolicyTypeIdentifier> getToscaPolicyTypeIdents() {
+ public List<ToscaConceptIdentifier> getToscaPolicyTypeIdents() {
return toscaPolicyTypeIdents;
}
diff --git a/main/src/test/java/org/onap/policy/pdpx/main/XacmlStateTest.java b/main/src/test/java/org/onap/policy/pdpx/main/XacmlStateTest.java
index 185f538e..8fb7664e 100644
--- a/main/src/test/java/org/onap/policy/pdpx/main/XacmlStateTest.java
+++ b/main/src/test/java/org/onap/policy/pdpx/main/XacmlStateTest.java
@@ -1,6 +1,7 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019 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,7 +43,7 @@ import org.onap.policy.models.pdp.concepts.PdpUpdate;
import org.onap.policy.models.pdp.enums.PdpHealthStatus;
import org.onap.policy.models.pdp.enums.PdpResponseStatus;
import org.onap.policy.models.pdp.enums.PdpState;
-import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyTypeIdentifier;
+import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
import org.onap.policy.pdpx.main.rest.XacmlPdpApplicationManager;
import org.onap.policy.pdpx.main.startstop.XacmlPdpActivator;
@@ -58,8 +59,8 @@ public class XacmlStateTest {
@Mock
private XacmlPdpActivator act;
- private ToscaPolicyTypeIdentifier ident1;
- private ToscaPolicyTypeIdentifier ident2;
+ private ToscaConceptIdentifier ident1;
+ private ToscaConceptIdentifier ident2;
private String hostName;
@@ -74,8 +75,8 @@ public class XacmlStateTest {
hostName = NetworkUtil.getHostname();
- ident1 = new ToscaPolicyTypeIdentifier("nameA", "typeA");
- ident2 = new ToscaPolicyTypeIdentifier("nameB", "typeB");
+ ident1 = new ToscaConceptIdentifier("nameA", "typeA");
+ ident2 = new ToscaConceptIdentifier("nameB", "typeB");
when(appmgr.getToscaPolicyTypeIdents()).thenReturn(Arrays.asList(ident1, ident2));