Changed identifiers to concept identifiers 69/116569/1
authorliamfallon <liam.fallon@est.tech>
Mon, 4 Jan 2021 13:47:42 +0000 (13:47 +0000)
committerliamfallon <liam.fallon@est.tech>
Mon, 4 Jan 2021 16:19:42 +0000 (16:19 +0000)
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>
21 files changed:
applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/PolicyApiCaller.java
applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/XacmlApplicationServiceProvider.java
applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/matchable/MatchablePolicyType.java
applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/std/StdMatchableTranslator.java
applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/std/StdXacmlApplicationServiceProvider.java
applications/common/src/test/java/org/onap/policy/pdp/xacml/application/common/PolicyApiCallerTest.java
applications/guard/src/main/java/org/onap/policy/xacml/pdp/application/guard/GuardPdpApplication.java
applications/guard/src/test/java/org/onap/policy/xacml/pdp/application/guard/GuardPdpApplicationTest.java
applications/match/src/main/java/org/onap/policy/xacml/pdp/application/match/MatchPdpApplication.java
applications/match/src/test/java/org/onap/policy/xacml/pdp/application/match/MatchPdpApplicationTest.java
applications/monitoring/src/main/java/org/onap/policy/xacml/pdp/application/monitoring/MonitoringPdpApplication.java
applications/monitoring/src/test/java/org/onap/policy/xacml/pdp/application/monitoring/MonitoringPdpApplicationTest.java
applications/naming/src/main/java/org/onap/policy/xacml/pdp/application/naming/NamingPdpApplication.java
applications/naming/src/test/java/org/onap/policy/xacml/pdp/application/naming/NamingPdpApplicationTest.java
applications/native/src/main/java/org/onap/policy/xacml/pdp/application/nativ/NativePdpApplication.java
applications/native/src/test/java/org/onap/policy/xacml/pdp/application/nativ/NativePdpApplicationTest.java
applications/optimization/src/main/java/org/onap/policy/xacml/pdp/application/optimization/OptimizationPdpApplication.java
applications/optimization/src/test/java/org/onap/policy/xacml/pdp/application/optimization/OptimizationPdpApplicationTest.java
main/src/main/java/org/onap/policy/pdpx/main/rest/XacmlPdpApplicationManager.java
main/src/test/java/org/onap/policy/pdpx/main/XacmlStateTest.java
tutorials/tutorial-xacml-application/src/main/java/org/onap/policy/tutorial/tutorial/TutorialApplication.java

index 44593e1..7d360da 100644 (file)
@@ -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.
@@ -27,7 +28,7 @@ import org.onap.policy.common.endpoints.http.client.HttpClient;
 import org.onap.policy.common.endpoints.http.client.HttpClientConfigException;
 import org.onap.policy.common.endpoints.http.client.HttpClientFactoryInstance;
 import org.onap.policy.common.endpoints.parameters.RestServerParameters;
-import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyTypeIdentifier;
+import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaServiceTemplate;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -73,7 +74,7 @@ public class PolicyApiCaller {
      * @return the desired policy type
      * @throws PolicyApiException if an error occurs
      */
-    public ToscaServiceTemplate getPolicyType(ToscaPolicyTypeIdentifier type) throws PolicyApiException {
+    public ToscaServiceTemplate getPolicyType(ToscaConceptIdentifier type) throws PolicyApiException {
 
         try {
             Response resp = httpClient
index edd33c0..d80572a 100644 (file)
@@ -2,6 +2,7 @@
  * ONAP
  * ================================================================================
  * 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.
@@ -29,8 +30,8 @@ import org.apache.commons.lang3.tuple.Pair;
 import org.onap.policy.common.endpoints.parameters.RestServerParameters;
 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;
 
 /**
  * This interface is how the XACML REST controller can communicate
@@ -73,7 +74,7 @@ public interface XacmlApplicationServiceProvider {
      *
      * @return List of Strings (eg. "onap.policy.foo.bar")
      */
-    List<ToscaPolicyTypeIdentifier>     supportedPolicyTypes();
+    List<ToscaConceptIdentifier>     supportedPolicyTypes();
 
     /**
      * Asks whether the application can support the incoming
@@ -82,7 +83,7 @@ public interface XacmlApplicationServiceProvider {
      * @param toscaPolicyId Identifier for policy type
      * @return true if supported
      */
-    boolean          canSupportPolicyType(ToscaPolicyTypeIdentifier toscaPolicyId);
+    boolean          canSupportPolicyType(ToscaConceptIdentifier toscaPolicyId);
 
     /**
      * Load a Tosca Policy.
index e3174dd..c0cbb77 100644 (file)
@@ -3,7 +3,7 @@
  * ONAP
  * ================================================================================
  * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2020 Nordix Foundation.
+ * Modifications Copyright (C) 2020-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,8 +29,8 @@ import java.util.Map.Entry;
 import java.util.function.Function;
 import lombok.Getter;
 import lombok.NonNull;
+import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaDataType;
-import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyIdentifier;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyType;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaProperty;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaSchemaDefinition;
@@ -69,11 +69,11 @@ public class MatchablePolicyType {
             );
     //@formatter:on
 
-    ToscaPolicyIdentifier policyId;
+    ToscaConceptIdentifier policyId;
     Map<String, MatchableProperty> matchables = new HashMap<>();
 
     public MatchablePolicyType(@NonNull ToscaPolicyType policyType, @NonNull MatchableCallback callback) {
-        this.policyId = new ToscaPolicyIdentifier(policyType.getName(), policyType.getVersion());
+        this.policyId = new ToscaConceptIdentifier(policyType.getName(), policyType.getVersion());
         scanPolicyType(policyType, callback);
     }
 
index 1a5e9dd..329a21c 100644 (file)
@@ -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.
@@ -56,10 +57,10 @@ import org.onap.policy.common.utils.coder.StandardCoder;
 import org.onap.policy.common.utils.coder.StandardYamlCoder;
 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.ToscaDataType;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyType;
-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.OnapObligation;
@@ -87,8 +88,8 @@ public class StdMatchableTranslator  extends StdBaseTranslator implements Matcha
     private static final Logger LOGGER = LoggerFactory.getLogger(StdMatchableTranslator.class);
     private static final StandardYamlCoder standardYamlCoder = new StandardYamlCoder();
 
-    private final Map<ToscaPolicyTypeIdentifier, ToscaServiceTemplate> matchablePolicyTypes = new HashMap<>();
-    private final Map<ToscaPolicyTypeIdentifier, MatchablePolicyType> matchableCache = new HashMap<>();
+    private final Map<ToscaConceptIdentifier, ToscaServiceTemplate> matchablePolicyTypes = new HashMap<>();
+    private final Map<ToscaConceptIdentifier, MatchablePolicyType> matchableCache = new HashMap<>();
 
     @Setter
     private RestServerParameters apiRestParameters;
@@ -324,7 +325,7 @@ public class StdMatchableTranslator  extends StdBaseTranslator implements Matcha
 
     @Override
     public ToscaPolicyType retrievePolicyType(String derivedFrom) {
-        ToscaServiceTemplate template = this.findPolicyType(new ToscaPolicyTypeIdentifier(derivedFrom, "1.0.0"));
+        ToscaServiceTemplate template = this.findPolicyType(new ToscaConceptIdentifier(derivedFrom, "1.0.0"));
         if (template == null) {
             LOGGER.error("Could not retrieve Policy Type {}", derivedFrom);
             return null;
@@ -469,14 +470,14 @@ public class StdMatchableTranslator  extends StdBaseTranslator implements Matcha
     }
 
     /**
-     * findPolicyType - given the ToscaPolicyTypeIdentifier, finds it in memory, or
+     * findPolicyType - given the ToscaConceptIdentifier, finds it in memory, or
      * then tries to find it either locally on disk or pull it from the Policy
      * Lifecycle API the given TOSCA Policy Type.
      *
-     * @param policyTypeId ToscaPolicyTypeIdentifier to find
+     * @param policyTypeId ToscaConceptIdentifier to find
      * @return ToscaPolicyType object. Can be null if failure.
      */
-    private ToscaServiceTemplate findPolicyType(ToscaPolicyTypeIdentifier policyTypeId) {
+    private ToscaServiceTemplate findPolicyType(ToscaConceptIdentifier policyTypeId) {
         //
         // Is it loaded in memory?
         //
@@ -500,14 +501,14 @@ public class StdMatchableTranslator  extends StdBaseTranslator implements Matcha
     }
 
     /**
-     * loadPolicyType - Tries to load the given ToscaPolicyTypeIdentifier from local
+     * loadPolicyType - Tries to load the given ToscaConceptIdentifier from local
      * storage. If it does not exist, will then attempt to pull from Policy Lifecycle
      * API.
      *
-     * @param policyTypeId ToscaPolicyTypeIdentifier input
+     * @param policyTypeId ToscaConceptIdentifier input
      * @return ToscaPolicyType object. Null if failure.
      */
-    private ToscaServiceTemplate loadPolicyType(ToscaPolicyTypeIdentifier policyTypeId) {
+    private ToscaServiceTemplate loadPolicyType(ToscaConceptIdentifier policyTypeId) {
         //
         // Construct what the file name should be
         //
@@ -559,14 +560,14 @@ public class StdMatchableTranslator  extends StdBaseTranslator implements Matcha
     }
 
     /**
-     * pullPolicyType - pulls the given ToscaPolicyTypeIdentifier from the Policy Lifecycle API.
+     * pullPolicyType - pulls the given ToscaConceptIdentifier from the Policy Lifecycle API.
      * If successful, will store it locally given the policyTypePath.
      *
-     * @param policyTypeId ToscaPolicyTypeIdentifier
+     * @param policyTypeId ToscaConceptIdentifier
      * @param policyTypePath Path object to store locally
      * @return ToscaPolicyType object. Null if failure.
      */
-    private synchronized ToscaServiceTemplate pullPolicyType(ToscaPolicyTypeIdentifier policyTypeId,
+    private synchronized ToscaServiceTemplate pullPolicyType(ToscaConceptIdentifier policyTypeId,
             Path policyTypePath) {
         //
         // This is what we return
@@ -600,10 +601,10 @@ public class StdMatchableTranslator  extends StdBaseTranslator implements Matcha
      * constructLocalFilePath - common method to ensure the name of the local file for the
      * policy type is the same.
      *
-     * @param policyTypeId ToscaPolicyTypeIdentifier
+     * @param policyTypeId ToscaConceptIdentifier
      * @return Path object
      */
-    private Path constructLocalFilePath(ToscaPolicyTypeIdentifier policyTypeId) {
+    private Path constructLocalFilePath(ToscaConceptIdentifier policyTypeId) {
         return Paths.get(this.pathForData.toAbsolutePath().toString(), policyTypeId.getName() + "-"
                 + policyTypeId.getVersion() + ".yaml");
     }
index 28b861d..fcfbf53 100644 (file)
@@ -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.
@@ -43,8 +44,8 @@ import org.apache.commons.lang3.tuple.Pair;
 import org.onap.policy.common.endpoints.parameters.RestServerParameters;
 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.ToscaPolicyConversionException;
 import org.onap.policy.pdp.xacml.application.common.ToscaPolicyTranslator;
 import org.onap.policy.pdp.xacml.application.common.XacmlApplicationException;
@@ -59,7 +60,7 @@ public abstract class StdXacmlApplicationServiceProvider implements XacmlApplica
 
     protected String applicationName = "Please Override";
     protected List<String> actions = Collections.emptyList();
-    protected List<ToscaPolicyTypeIdentifier> supportedPolicyTypes = new ArrayList<>();
+    protected List<ToscaConceptIdentifier> supportedPolicyTypes = new ArrayList<>();
 
     private Path pathForData = null;
     @Getter
@@ -110,12 +111,12 @@ public abstract class StdXacmlApplicationServiceProvider implements XacmlApplica
     }
 
     @Override
-    public List<ToscaPolicyTypeIdentifier> supportedPolicyTypes() {
+    public List<ToscaConceptIdentifier> supportedPolicyTypes() {
         return supportedPolicyTypes;
     }
 
     @Override
-    public boolean canSupportPolicyType(ToscaPolicyTypeIdentifier policyTypeId) {
+    public boolean canSupportPolicyType(ToscaConceptIdentifier policyTypeId) {
         throw new UnsupportedOperationException("Please override and implement canSupportPolicyType");
     }
 
index 6e7ec7c..31cb481 100644 (file)
@@ -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.
@@ -50,8 +51,8 @@ import org.onap.policy.common.endpoints.parameters.RestServerParameters;
 import org.onap.policy.common.endpoints.properties.PolicyEndPointProperties;
 import org.onap.policy.common.gson.GsonMessageBodyHandler;
 import org.onap.policy.common.utils.network.NetworkUtil;
+import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyType;
-import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyTypeIdentifier;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -138,22 +139,22 @@ public class PolicyApiCallerTest {
     @Test
     public void testGetPolicyType() throws Exception {
 
-        assertNotNull(api.getPolicyType(new ToscaPolicyTypeIdentifier(MY_TYPE, MY_VERSION)));
+        assertNotNull(api.getPolicyType(new ToscaConceptIdentifier(MY_TYPE, MY_VERSION)));
 
-        assertThatThrownBy(() -> api.getPolicyType(new ToscaPolicyTypeIdentifier(INVALID_TYPE, MY_VERSION)))
+        assertThatThrownBy(() -> api.getPolicyType(new ToscaConceptIdentifier(INVALID_TYPE, MY_VERSION)))
                         .isInstanceOf(PolicyApiException.class);
 
-        assertThatThrownBy(() -> api.getPolicyType(new ToscaPolicyTypeIdentifier(UNKNOWN_TYPE, MY_VERSION)))
+        assertThatThrownBy(() -> api.getPolicyType(new ToscaConceptIdentifier(UNKNOWN_TYPE, MY_VERSION)))
                         .isInstanceOf(NotFoundException.class);
 
-        assertThatThrownBy(() -> api.getPolicyType(new ToscaPolicyTypeIdentifier(NOT_A_TYPE, MY_VERSION)))
+        assertThatThrownBy(() -> api.getPolicyType(new ToscaConceptIdentifier(NOT_A_TYPE, MY_VERSION)))
                         .isInstanceOf(PolicyApiException.class);
 
         // connect to a port that has no server
         when(clientParams.getPort()).thenReturn(NetworkUtil.allocPort());
         api = new PolicyApiCaller(clientParams);
 
-        assertThatThrownBy(() -> api.getPolicyType(new ToscaPolicyTypeIdentifier(MY_TYPE, MY_VERSION)))
+        assertThatThrownBy(() -> api.getPolicyType(new ToscaConceptIdentifier(MY_TYPE, MY_VERSION)))
                         .isInstanceOf(PolicyApiException.class);
     }
 
index bb1b758..1832945 100644 (file)
@@ -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.
@@ -23,7 +24,7 @@
 package org.onap.policy.xacml.pdp.application.guard;
 
 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;
 import org.slf4j.Logger;
@@ -52,30 +53,30 @@ public class GuardPdpApplication extends StdXacmlApplicationServiceProvider {
         applicationName = "guard";
         actions = Arrays.asList("guard");
 
-        this.supportedPolicyTypes.add(new ToscaPolicyTypeIdentifier(
+        this.supportedPolicyTypes.add(new ToscaConceptIdentifier(
                 GuardTranslator.POLICYTYPE_FREQUENCY,
                 STRING_VERSION100));
-        this.supportedPolicyTypes.add(new ToscaPolicyTypeIdentifier(
+        this.supportedPolicyTypes.add(new ToscaConceptIdentifier(
                 GuardTranslator.POLICYTYPE_MINMAX,
                 STRING_VERSION100));
-        this.supportedPolicyTypes.add(new ToscaPolicyTypeIdentifier(
+        this.supportedPolicyTypes.add(new ToscaConceptIdentifier(
                 GuardTranslator.POLICYTYPE_BLACKLIST,
                 STRING_VERSION100));
-        this.supportedPolicyTypes.add(new ToscaPolicyTypeIdentifier(
+        this.supportedPolicyTypes.add(new ToscaConceptIdentifier(
                 GuardTranslator.POLICYTYPE_FILTER,
                 STRING_VERSION100));
-        this.supportedPolicyTypes.add(new ToscaPolicyTypeIdentifier(
+        this.supportedPolicyTypes.add(new ToscaConceptIdentifier(
                 "onap.policies.controlloop.guard.coordination.FirstBlocksSecond",
                 STRING_VERSION100));
     }
 
     @Override
-    public boolean canSupportPolicyType(ToscaPolicyTypeIdentifier policyTypeId) {
+    public boolean canSupportPolicyType(ToscaConceptIdentifier policyTypeId) {
         //
         // For the time being, restrict this if the version isn't known.
         // Could be too difficult to support changing of versions dynamically.
         //
-        for (ToscaPolicyTypeIdentifier supported : this.supportedPolicyTypes) {
+        for (ToscaConceptIdentifier supported : this.supportedPolicyTypes) {
             if (policyTypeId.equals(supported)) {
                 return true;
             }
index 08495a7..3b1b1c6 100644 (file)
@@ -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.
@@ -55,8 +56,8 @@ import org.onap.policy.common.utils.resources.TextFileUtils;
 import org.onap.policy.guard.OperationsHistory;
 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;
@@ -219,26 +220,26 @@ public class GuardPdpApplicationTest {
         assertThat(service.supportedPolicyTypes()).isNotEmpty();
         assertThat(service.supportedPolicyTypes().size()).isEqualTo(5);
         assertThat(service.canSupportPolicyType(
-                new ToscaPolicyTypeIdentifier("onap.policies.controlloop.guard.common.FrequencyLimiter", "1.0.0")))
+                new ToscaConceptIdentifier("onap.policies.controlloop.guard.common.FrequencyLimiter", "1.0.0")))
                         .isTrue();
         assertThat(service.canSupportPolicyType(
-                new ToscaPolicyTypeIdentifier("onap.policies.controlloop.guard.common.FrequencyLimiter", "1.0.1")))
+                new ToscaConceptIdentifier("onap.policies.controlloop.guard.common.FrequencyLimiter", "1.0.1")))
                         .isFalse();
         assertThat(service.canSupportPolicyType(
-                new ToscaPolicyTypeIdentifier("onap.policies.controlloop.guard.common.MinMax", "1.0.0"))).isTrue();
+                new ToscaConceptIdentifier("onap.policies.controlloop.guard.common.MinMax", "1.0.0"))).isTrue();
         assertThat(service.canSupportPolicyType(
-                new ToscaPolicyTypeIdentifier("onap.policies.controlloop.guard.common.MinMax", "1.0.1"))).isFalse();
+                new ToscaConceptIdentifier("onap.policies.controlloop.guard.common.MinMax", "1.0.1"))).isFalse();
         assertThat(service.canSupportPolicyType(
-                new ToscaPolicyTypeIdentifier("onap.policies.controlloop.guard.common.Blacklist", "1.0.0"))).isTrue();
+                new ToscaConceptIdentifier("onap.policies.controlloop.guard.common.Blacklist", "1.0.0"))).isTrue();
         assertThat(service.canSupportPolicyType(
-                new ToscaPolicyTypeIdentifier("onap.policies.controlloop.guard.common.Blacklist", "1.0.1"))).isFalse();
-        assertThat(service.canSupportPolicyType(new ToscaPolicyTypeIdentifier(
+                new ToscaConceptIdentifier("onap.policies.controlloop.guard.common.Blacklist", "1.0.1"))).isFalse();
+        assertThat(service.canSupportPolicyType(new ToscaConceptIdentifier(
                 "onap.policies.controlloop.guard.coordination.FirstBlocksSecond", "1.0.0"))).isTrue();
-        assertThat(service.canSupportPolicyType(new ToscaPolicyTypeIdentifier(
+        assertThat(service.canSupportPolicyType(new ToscaConceptIdentifier(
                 "onap.policies.controlloop.guard.coordination.FirstBlocksSecond", "1.0.1"))).isFalse();
-        assertThat(service.canSupportPolicyType(new ToscaPolicyTypeIdentifier("onap.foo", "1.0.1"))).isFalse();
+        assertThat(service.canSupportPolicyType(new ToscaConceptIdentifier("onap.foo", "1.0.1"))).isFalse();
         assertThat(service.canSupportPolicyType(
-                new ToscaPolicyTypeIdentifier("onap.policies.controlloop.guard.common.Filter", "1.0.0"))).isTrue();
+                new ToscaConceptIdentifier("onap.policies.controlloop.guard.common.Filter", "1.0.0"))).isTrue();
     }
 
     @Test
index 62466b9..444c481 100644 (file)
@@ -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.match;
 import java.nio.file.Path;
 import java.util.Arrays;
 import org.onap.policy.common.endpoints.parameters.RestServerParameters;
-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.XacmlApplicationException;
 import org.onap.policy.pdp.xacml.application.common.std.StdMatchableTranslator;
@@ -36,7 +37,7 @@ public class MatchPdpApplication extends StdXacmlApplicationServiceProvider {
     public static final String ONAP_MATCH_BASE_POLICY_TYPE = "onap.policies.Match";
     public static final String ONAP_MATCH_DERIVED_POLICY_TYPE = "onap.policies.match.";
 
-    private static final ToscaPolicyTypeIdentifier supportedPolicy = new ToscaPolicyTypeIdentifier(
+    private static final ToscaConceptIdentifier supportedPolicy = new ToscaConceptIdentifier(
             ONAP_MATCH_BASE_POLICY_TYPE, "1.0.0");
 
     private StdMatchableTranslator translator = new StdMatchableTranslator();
@@ -68,7 +69,7 @@ public class MatchPdpApplication extends StdXacmlApplicationServiceProvider {
     }
 
     @Override
-    public boolean canSupportPolicyType(ToscaPolicyTypeIdentifier policyTypeId) {
+    public boolean canSupportPolicyType(ToscaConceptIdentifier policyTypeId) {
         return policyTypeId.getName().startsWith(ONAP_MATCH_DERIVED_POLICY_TYPE);
     }
 
index 23b3d6e..a8b1399 100644 (file)
@@ -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.
@@ -50,7 +51,7 @@ import org.onap.policy.common.utils.resources.ResourceUtils;
 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.ToscaPolicyTypeIdentifier;
+import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
 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;
@@ -154,9 +155,9 @@ public class MatchPdpApplicationTest {
         // Ensure it has the supported policy types and
         // can support the correct policy types.
         //
-        assertThat(service.canSupportPolicyType(new ToscaPolicyTypeIdentifier(
+        assertThat(service.canSupportPolicyType(new ToscaConceptIdentifier(
                 "onap.policies.match.Test", "1.0.0"))).isTrue();
-        assertThat(service.canSupportPolicyType(new ToscaPolicyTypeIdentifier(
+        assertThat(service.canSupportPolicyType(new ToscaConceptIdentifier(
                 "onap.foobar", "1.0.0"))).isFalse();
     }
 
index a3456ae..17a9e74 100644 (file)
@@ -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
index 04895b8..1c2967d 100644 (file)
@@ -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
         //
index fe781a9..92dab81 100644 (file)
@@ -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.
 package org.onap.policy.xacml.pdp.application.naming;
 
 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.StdCombinedPolicyResultsTranslator;
 import org.onap.policy.pdp.xacml.application.common.std.StdXacmlApplicationServiceProvider;
 
 public class NamingPdpApplication extends StdXacmlApplicationServiceProvider {
 
-    private static final ToscaPolicyTypeIdentifier namingPolicyType = new ToscaPolicyTypeIdentifier(
+    private static final ToscaConceptIdentifier namingPolicyType = new ToscaConceptIdentifier(
             "onap.policies.Naming", "1.0.0");
 
     private StdCombinedPolicyResultsTranslator translator = new StdCombinedPolicyResultsTranslator();
@@ -47,7 +48,7 @@ public class NamingPdpApplication extends StdXacmlApplicationServiceProvider {
     }
 
     @Override
-    public boolean canSupportPolicyType(ToscaPolicyTypeIdentifier policyTypeId) {
+    public boolean canSupportPolicyType(ToscaConceptIdentifier policyTypeId) {
         return namingPolicyType.equals(policyTypeId);
     }
 
index 85b182c..98385ca 100644 (file)
@@ -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.
@@ -54,7 +55,7 @@ import org.onap.policy.common.utils.resources.ResourceUtils;
 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.ToscaPolicyTypeIdentifier;
+import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
 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;
@@ -160,9 +161,9 @@ public class NamingPdpApplicationTest {
         // Ensure it has the supported policy types and
         // can support the correct policy types.
         //
-        assertThat(service.canSupportPolicyType(new ToscaPolicyTypeIdentifier(
+        assertThat(service.canSupportPolicyType(new ToscaConceptIdentifier(
                 "onap.policies.Naming", "1.0.0"))).isTrue();
-        assertThat(service.canSupportPolicyType(new ToscaPolicyTypeIdentifier(
+        assertThat(service.canSupportPolicyType(new ToscaConceptIdentifier(
                 "onap.foobar", "1.0.0"))).isFalse();
     }
 
index f8248f1..cfe1a71 100644 (file)
@@ -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);
     }
 
index f434e80..9a0ebc0 100644 (file)
@@ -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
+}
index 1cc94ed..8b0442b 100644 (file)
@@ -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.
@@ -36,7 +37,7 @@ import org.apache.commons.lang3.tuple.Pair;
 import org.onap.policy.common.endpoints.parameters.RestServerParameters;
 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.ToscaDictionary;
 import org.onap.policy.pdp.xacml.application.common.ToscaPolicyTranslator;
 import org.onap.policy.pdp.xacml.application.common.XacmlApplicationException;
@@ -74,15 +75,15 @@ public class OptimizationPdpApplication extends StdXacmlApplicationServiceProvid
         applicationName = "optimization";
         actions = Arrays.asList("optimize");
 
-        this.supportedPolicyTypes.add(new ToscaPolicyTypeIdentifier(POLICYTYPE_AFFINITY, STRING_VERSION100));
-        this.supportedPolicyTypes.add(new ToscaPolicyTypeIdentifier(POLICYTYPE_DISTANCE, STRING_VERSION100));
-        this.supportedPolicyTypes.add(new ToscaPolicyTypeIdentifier(POLICYTYPE_HPA, STRING_VERSION100));
-        this.supportedPolicyTypes.add(new ToscaPolicyTypeIdentifier(POLICYTYPE_OPTIMIZATION, STRING_VERSION100));
-        this.supportedPolicyTypes.add(new ToscaPolicyTypeIdentifier(POLICYTYPE_PCI, STRING_VERSION100));
-        this.supportedPolicyTypes.add(new ToscaPolicyTypeIdentifier(POLICYTYPE_QUERY, STRING_VERSION100));
-        this.supportedPolicyTypes.add(new ToscaPolicyTypeIdentifier(POLICYTYPE_SUBSCRIBER, STRING_VERSION100));
-        this.supportedPolicyTypes.add(new ToscaPolicyTypeIdentifier(POLICYTYPE_VIMFIT, STRING_VERSION100));
-        this.supportedPolicyTypes.add(new ToscaPolicyTypeIdentifier(POLICYTYPE_VNF, STRING_VERSION100));
+        this.supportedPolicyTypes.add(new ToscaConceptIdentifier(POLICYTYPE_AFFINITY, STRING_VERSION100));
+        this.supportedPolicyTypes.add(new ToscaConceptIdentifier(POLICYTYPE_DISTANCE, STRING_VERSION100));
+        this.supportedPolicyTypes.add(new ToscaConceptIdentifier(POLICYTYPE_HPA, STRING_VERSION100));
+        this.supportedPolicyTypes.add(new ToscaConceptIdentifier(POLICYTYPE_OPTIMIZATION, STRING_VERSION100));
+        this.supportedPolicyTypes.add(new ToscaConceptIdentifier(POLICYTYPE_PCI, STRING_VERSION100));
+        this.supportedPolicyTypes.add(new ToscaConceptIdentifier(POLICYTYPE_QUERY, STRING_VERSION100));
+        this.supportedPolicyTypes.add(new ToscaConceptIdentifier(POLICYTYPE_SUBSCRIBER, STRING_VERSION100));
+        this.supportedPolicyTypes.add(new ToscaConceptIdentifier(POLICYTYPE_VIMFIT, STRING_VERSION100));
+        this.supportedPolicyTypes.add(new ToscaConceptIdentifier(POLICYTYPE_VNF, STRING_VERSION100));
     }
 
     @Override
@@ -101,12 +102,12 @@ public class OptimizationPdpApplication extends StdXacmlApplicationServiceProvid
     }
 
     @Override
-    public boolean canSupportPolicyType(ToscaPolicyTypeIdentifier policyTypeId) {
+    public boolean canSupportPolicyType(ToscaConceptIdentifier policyTypeId) {
         //
         // For the time being, restrict this if the version isn't known.
         // Could be too difficult to support changing of versions dynamically.
         //
-        for (ToscaPolicyTypeIdentifier supported : this.supportedPolicyTypes) {
+        for (ToscaConceptIdentifier supported : this.supportedPolicyTypes) {
             if (policyTypeId.equals(supported)) {
                 LOGGER.info("optimization can support {}", supported);
                 return true;
index 1a1e756..44de7f0 100644 (file)
@@ -3,7 +3,7 @@
  * ONAP
  * ================================================================================
  * Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
  Modifications Copyright (C) 2019-2020 Nordix Foundation.
* Modifications Copyright (C) 2019-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.
@@ -56,8 +56,8 @@ import org.onap.policy.common.utils.resources.ResourceUtils;
 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.models.tosca.authorative.concepts.ToscaServiceTemplate;
 import org.onap.policy.models.tosca.simple.concepts.JpaToscaServiceTemplate;
 import org.onap.policy.pdp.xacml.application.common.XacmlApplicationException;
@@ -183,13 +183,13 @@ public class OptimizationPdpApplicationTest {
         // Ensure it has the supported policy types and
         // can support the correct policy types.
         //
-        assertThat(service.canSupportPolicyType(new ToscaPolicyTypeIdentifier(
+        assertThat(service.canSupportPolicyType(new ToscaConceptIdentifier(
                 "onap.policies.optimization.resource.AffinityPolicy", "1.0.0"))).isTrue();
-        assertThat(service.canSupportPolicyType(new ToscaPolicyTypeIdentifier(
+        assertThat(service.canSupportPolicyType(new ToscaConceptIdentifier(
                 "onap.policies.optimization.service.SubscriberPolicy", "1.0.0"))).isTrue();
-        assertThat(service.canSupportPolicyType(new ToscaPolicyTypeIdentifier(
+        assertThat(service.canSupportPolicyType(new ToscaConceptIdentifier(
                 "onap.policies.optimization.service.CustomUseCase", "1.0.0"))).isTrue();
-        assertThat(service.canSupportPolicyType(new ToscaPolicyTypeIdentifier(
+        assertThat(service.canSupportPolicyType(new ToscaConceptIdentifier(
                 "onap.foobar", "1.0.0"))).isFalse();
     }
 
index 66f965f..7c46ef3 100644 (file)
@@ -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;
     }
 
index 185f538..8fb7664 100644 (file)
@@ -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));
 
index 3c76494..5d486c4 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  * 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.
@@ -20,14 +21,14 @@ package org.onap.policy.tutorial.tutorial;
 
 import java.util.Arrays;
 import java.util.List;
-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;
 
 public class TutorialApplication extends StdXacmlApplicationServiceProvider {
 
-    private final ToscaPolicyTypeIdentifier supportedPolicyType =
-            new ToscaPolicyTypeIdentifier("onap.policies.Authorization", "1.0.0");
+    private final ToscaConceptIdentifier supportedPolicyType =
+            new ToscaConceptIdentifier("onap.policies.Authorization", "1.0.0");
     private final TutorialTranslator translator = new TutorialTranslator();
 
     @Override
@@ -41,12 +42,12 @@ public class TutorialApplication extends StdXacmlApplicationServiceProvider {
     }
 
     @Override
-    public synchronized List<ToscaPolicyTypeIdentifier> supportedPolicyTypes() {
+    public synchronized List<ToscaConceptIdentifier> supportedPolicyTypes() {
         return Arrays.asList(supportedPolicyType);
     }
 
     @Override
-    public boolean canSupportPolicyType(ToscaPolicyTypeIdentifier policyTypeId) {
+    public boolean canSupportPolicyType(ToscaConceptIdentifier policyTypeId) {
         return supportedPolicyType.equals(policyTypeId);
     }