Support A1 PMS Actor for SON use case 12/132012/2
authorjhh <jorge.hernandez-herrero@att.com>
Fri, 4 Nov 2022 16:53:50 +0000 (11:53 -0500)
committerjhh <jorge.hernandez-herrero@att.com>
Fri, 4 Nov 2022 17:00:26 +0000 (12:00 -0500)
Issue-ID: POLICY-4444
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Change-Id: I1811b79513616aab813b6d97823d6c1d2bbbee47
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
controlloop/common/controller-usecases/pom.xml
controlloop/common/controller-usecases/src/test/resources/config/event-manager.properties
controlloop/common/controller-usecases/src/test/resources/config/usecases-controller.properties
controlloop/common/eventmanager/pom.xml
controlloop/common/feature-controlloop-management/pom.xml
controlloop/common/feature-controlloop-management/src/main/feature/config/A1-P-RSP-topic.properties [new file with mode: 0644]
controlloop/common/feature-controlloop-management/src/main/feature/config/A1-P-topic.properties [new file with mode: 0644]
controlloop/common/feature-controlloop-management/src/main/feature/config/event-manager.properties
controlloop/common/rules-test/src/main/java/org/onap/policy/controlloop/common/rules/test/BaseTest.java
controlloop/common/rules-test/src/main/resources/vsonh/v5G.son.A1.sdnr.success.json

index c9e52b7..e063b09 100644 (file)
@@ -3,7 +3,7 @@
   ============LICENSE_START=======================================================
   ONAP
   ================================================================================
-  Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
+  Copyright (C) 2020-2022 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.
             <version>${policy.models.version}</version>
             <scope>provided</scope>
         </dependency>
+        <dependency>
+            <groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
+            <artifactId>actor.a1p</artifactId>
+            <version>${policy.models.version}</version>
+            <scope>provided</scope>
+        </dependency>
         <dependency>
             <groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
             <artifactId>actor.so</artifactId>
index 076d607..5ec8c57 100644 (file)
@@ -2,7 +2,7 @@
 # ============LICENSE_START======================================================
 # ONAP
 # ===============================================================================
-# Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
+# Copyright (C) 2020-2022 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.
@@ -69,6 +69,10 @@ actor.service.SDNR.sinkTopic=SDNR-CL
 actor.service.SDNR.sourceTopic=SDNR-CL-RSP
 actor.service.SDNR.operations.any.placeholder=
 
+actor.service.A1P.sinkTopic=A1-P
+actor.service.A1P.sourceTopic=A1-P-RSP
+actor.service.A1P.operations.any.placeholder=
+
 actor.service.SO.clientName=SO
 actor.service.SO.pollPath=orchestrationRequests/v5/
 actor.service.SO.maxPolls=20
index f90b1d1..dd1d35f 100644 (file)
@@ -2,7 +2,7 @@
 # ============LICENSE_START=======================================================
 # ONAP
 # ================================================================================
-# Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
+# Copyright (C) 2020,2022 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.
@@ -24,7 +24,7 @@ rules.groupId=org.onap.policy.controlloop
 rules.artifactId=usecases
 rules.version=1.1.0
 
-noop.source.topics=DCAE_TOPIC,APPC-CL,APPC-LCM-WRITE,SDNR-CL-RSP,POLICY-CL-MGT,APPC-LCM-READ
+noop.source.topics=DCAE_TOPIC,APPC-CL,APPC-LCM-WRITE,SDNR-CL-RSP,POLICY-CL-MGT,APPC-LCM-READ,A1-P-RSP
 
 noop.source.topics.DCAE_TOPIC.events=\
     org.onap.policy.controlloop.CanonicalOnset,org.onap.policy.controlloop.CanonicalAbated
@@ -47,13 +47,17 @@ noop.source.topics.SDNR-CL-RSP.events=org.onap.policy.sdnr.PciResponseWrapper
 noop.source.topics.SDNR-CL-RSP.events.org.onap.policy.sdnr.PciResponseWrapper.filter=[?($.type == 'response')]
 noop.source.topics.SDNR-CL-RSP.events.custom.gson=org.onap.policy.sdnr.util.Serialization,gson
 
+noop.source.topics.A1-P-RSP.events=org.onap.policy.sdnr.PciResponseWrapper
+noop.source.topics.A1-P-RSP.events.org.onap.policy.sdnr.PciResponseWrapper.filter=[?($.type == 'response')]
+noop.source.topics.A1-P-RSP.events.custom.gson=org.onap.policy.sdnr.util.Serialization,gson
+
 noop.source.topics.POLICY-CL-MGT.events=org.onap.policy.controlloop.VirtualControlLoopNotification
 noop.source.topics.POLICY-CL-MGT.events.custom.gson=org.onap.policy.controlloop.util.Serialization,gsonPretty
 
 noop.source.topics.APPC-LCM-READ.events=org.onap.policy.appclcm.AppcLcmDmaapWrapper
 noop.source.topics.APPC-LCM-READ.events.custom.gson=org.onap.policy.appclcm.util.Serialization,gson
 
-noop.sink.topics=APPC-CL,APPC-LCM-READ,POLICY-CL-MGT,SDNR-CL,DCAE_CL_RSP
+noop.sink.topics=APPC-CL,APPC-LCM-READ,POLICY-CL-MGT,SDNR-CL,DCAE_CL_RSP,A1-P
 
 noop.sink.topics.POLICY-CL-MGT.events=org.onap.policy.controlloop.VirtualControlLoopNotification
 noop.sink.topics.POLICY-CL-MGT.events.custom.gson=org.onap.policy.controlloop.util.Serialization,gsonPretty
index c2ae3e5..f5be004 100644 (file)
@@ -2,7 +2,7 @@
   ============LICENSE_START=======================================================
   eventmanager
   ================================================================================
-  Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved.
+  Copyright (C) 2017-2022 AT&T Intellectual Property. All rights reserved.
   Modifications Copyright (C) 2019 Nordix Foundation.
   Modifications Copyright (C) 2019-2020 Bell Canada.
   ================================================================================
             <version>${policy.models.version}</version>
             <scope>provided</scope>
         </dependency>
+        <dependency>
+            <groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
+            <artifactId>actor.a1p</artifactId>
+            <version>${policy.models.version}</version>
+            <scope>provided</scope>
+        </dependency>
         <dependency>
             <groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
             <artifactId>actor.appc</artifactId>
index 3c48b48..460921d 100644 (file)
                 </exclusion>
             </exclusions>
         </dependency>
+        <dependency>
+            <groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
+            <artifactId>actor.a1p</artifactId>
+            <version>${policy.models.version}</version>
+            <exclusions>
+                <exclusion>
+                    <artifactId>guava</artifactId>
+                    <groupId>com.google.guava</groupId>
+                </exclusion>
+            </exclusions>
+        </dependency>
         <dependency>
             <groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
             <artifactId>actor.so</artifactId>
diff --git a/controlloop/common/feature-controlloop-management/src/main/feature/config/A1-P-RSP-topic.properties b/controlloop/common/feature-controlloop-management/src/main/feature/config/A1-P-RSP-topic.properties
new file mode 100644 (file)
index 0000000..adf2b23
--- /dev/null
@@ -0,0 +1,21 @@
+# ============LICENSE_START=======================================================
+# ONAP
+# ================================================================================
+# Copyright (C) 2022 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.
+# ============LICENSE_END=========================================================
+
+dmaap.source.topics=A1-P-RSP
+dmaap.source.topics.A1-P-RSP.servers=${envd:DMAAP_SERVERS}
+dmaap.source.topics.A1-P-RSP.https=${envd:DMAAP_HTTPS:true}
diff --git a/controlloop/common/feature-controlloop-management/src/main/feature/config/A1-P-topic.properties b/controlloop/common/feature-controlloop-management/src/main/feature/config/A1-P-topic.properties
new file mode 100644 (file)
index 0000000..646d5a0
--- /dev/null
@@ -0,0 +1,23 @@
+# ============LICENSE_START=======================================================
+# ONAP
+# ================================================================================
+# Copyright (C) 2022 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.
+# ============LICENSE_END=========================================================
+
+dmaap.sink.topics=A1-P
+
+dmaap.sink.topics.A1-P.servers=${envd:DMAAP_SERVERS}
+dmaap.sink.topics.A1-P.https=${envd:DMAAP_HTTPS:true}
+
index 097d4fd..de3537a 100644 (file)
@@ -2,7 +2,7 @@
 # ============LICENSE_START======================================================
 # ONAP
 # ===============================================================================
-# Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
+# Copyright (C) 2020-2022 AT&T Intellectual Property. All rights reserved.
 # Modifications Copyright (C) 2022 CTC, Inc. and others.
 # ===============================================================================
 # Licensed under the Apache License, Version 2.0 (the "License");
@@ -71,6 +71,10 @@ actor.service.SDNR.sinkTopic=SDNR-CL
 actor.service.SDNR.sourceTopic=SDNR-CL-RSP
 actor.service.SDNR.operations.any.placeholder=
 
+actor.service.A1P.sinkTopic=A1-P
+actor.service.A1P.sourceTopic=A1-P-RSP
+actor.service.A1P.operations.any.placeholder=
+
 actor.service.SO.clientName=SO
 actor.service.SO.pollPath=orchestrationRequests/v5/
 actor.service.SO.maxPolls=20
index 2b81fda..d2fe57f 100644 (file)
@@ -72,6 +72,8 @@ public abstract class BaseTest {
     protected static final String APPC_CL_TOPIC = "APPC-CL";
     protected static final String SDNR_CL_TOPIC = "SDNR-CL";
     protected static final String SDNR_CL_RSP_TOPIC = "SDNR-CL-RSP";
+    protected static final String A1P_CL_TOPIC = "A1-P";
+    protected static final String A1P_CL_RSP_TOPIC = "A1-P-RSP";
 
     /*
      * Constants for each test case.
@@ -129,7 +131,7 @@ public abstract class BaseTest {
     private static final String V5G_SON_A1_TOSCA_POLICY = "policies/v5gSonA1.policy.operational.input.tosca.json";
     private static final String V5G_SON_A1_ONSET = "vsonh/v5G.son.A1.onset.json";
     private static final String V5G_SON_A1_SDNR_SUCCESS = "vsonh/v5G.son.A1.sdnr.success.json";
-    private static final String MODIFY_A1_POLICY_OPERATION = "ModifyA1Policy";
+    private static final String PUT_A1_POLICY_OPERATION = "PutA1Policy";
     /*
      * Coders used to decode requests and responses.
      */
@@ -367,7 +369,8 @@ public abstract class BaseTest {
      */
     @Test
     public void testVpciSunnyDayCompliant() {
-        sdnrSunnyDay(VPCI_TOSCA_COMPLIANT_POLICY, VPCI_ONSET, VPCI_SDNR_SUCCESS, SDNR_MODIFY_CONFIG_OP);
+        sdnrSunnyDay(VPCI_TOSCA_COMPLIANT_POLICY, VPCI_ONSET, VPCI_SDNR_SUCCESS,
+            SDNR_MODIFY_CONFIG_OP, SDNR_CL_TOPIC, SDNR_CL_RSP_TOPIC);
     }
 
     // VSONH
@@ -377,7 +380,8 @@ public abstract class BaseTest {
      */
     @Test
     public void testVsonhSunnyDayCompliant() {
-        sdnrSunnyDay(VSONH_TOSCA_COMPLIANT_POLICY, VSONH_ONSET, VSONH_SDNR_SUCCESS, SNDR_MODIFY_CONFIG_ANR_OP);
+        sdnrSunnyDay(VSONH_TOSCA_COMPLIANT_POLICY, VSONH_ONSET, VSONH_SDNR_SUCCESS,
+            SNDR_MODIFY_CONFIG_ANR_OP, SDNR_CL_TOPIC, SDNR_CL_RSP_TOPIC);
     }
 
     /**
@@ -385,7 +389,8 @@ public abstract class BaseTest {
      */
     @Test
     public void test5gSonO1SunnyDayCompliant() {
-        sdnrSunnyDay(V5G_SON_O1_TOSCA_POLICY, V5G_SON_O1_ONSET, V5G_SON_O1_SDNR_SUCCESS, MODIFY_O1_CONFIG_OPERATION);
+        sdnrSunnyDay(V5G_SON_O1_TOSCA_POLICY, V5G_SON_O1_ONSET, V5G_SON_O1_SDNR_SUCCESS,
+            MODIFY_O1_CONFIG_OPERATION, SDNR_CL_TOPIC, SDNR_CL_RSP_TOPIC);
     }
 
     /**
@@ -393,7 +398,8 @@ public abstract class BaseTest {
      */
     @Test
     public void test5gSonA1SunnyDayCompliant() {
-        sdnrSunnyDay(V5G_SON_A1_TOSCA_POLICY, V5G_SON_A1_ONSET, V5G_SON_A1_SDNR_SUCCESS, MODIFY_A1_POLICY_OPERATION);
+        sdnrSunnyDay(V5G_SON_A1_TOSCA_POLICY, V5G_SON_A1_ONSET, V5G_SON_A1_SDNR_SUCCESS,
+            PUT_A1_POLICY_OPERATION, A1P_CL_TOPIC, A1P_CL_RSP_TOPIC);
     }
 
     /**
@@ -572,9 +578,11 @@ public abstract class BaseTest {
      * @param onsetFile file containing the ONSET to be injected
      * @param operation expected SDNR operation request
      */
-    protected void sdnrSunnyDay(String policyFile, String onsetFile, String successFile, String operation) {
+    protected void sdnrSunnyDay(String policyFile, String onsetFile,
+                                String successFile, String operation,
+                                String requestTopic, String responseTopic) {
         policyClMgt = createNoficationTopicListener();
-        sdnrClSink = topics.createListener(SDNR_CL_TOPIC, PciMessage.class, SDNR_CODER);
+        sdnrClSink = topics.createListener(requestTopic, PciMessage.class, SDNR_CODER);
 
         policy = checkPolicy(policyFile);
 
@@ -592,7 +600,7 @@ public abstract class BaseTest {
         /*
          * Inject response.
          */
-        topics.inject(SDNR_CL_RSP_TOPIC, successFile, pcireq.getBody().getInput().getCommonHeader().getSubRequestId());
+        topics.inject(responseTopic, successFile, pcireq.getBody().getInput().getCommonHeader().getSubRequestId());
 
         /* --- Operation Completed --- */
 
index 12cfbc6..186241f 100644 (file)
@@ -17,7 +17,7 @@
         }
     },
     "version": "1.0",
-    "rpc-name": "ModifyA1Policy",
+    "rpc-name": "puta1policy",
     "correlation-id": "82feb01e-4f3e-40e2-b8df-683adabae893",
     "type": "response"
 }