Fix references and organize dependencies in policy-apex-pdp after 49/139349/1
authoradheli.tavares <adheli.tavares@est.tech>
Mon, 4 Nov 2024 10:38:21 +0000 (10:38 +0000)
committeradheli.tavares <adheli.tavares@est.tech>
Mon, 4 Nov 2024 11:18:14 +0000 (11:18 +0000)
splitting policy-endpoints and message-bus in policy-common

Issue-ID: POLICY-5131
Change-Id: Ief788abbff9d001302a9ee1960f17d9d168a0e79
Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
15 files changed:
plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/main/java/org/onap/policy/apex/plugins/event/carrier/restclient/ApexRestClientProducer.java
plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/main/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/ApexRestRequestorConsumer.java
services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/ApexStarterActivator.java
services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/comm/PdpStateChangeListener.java
services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/comm/PdpStatusPublisher.java
services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/comm/PdpUpdateListener.java
services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/handler/PdpStateChangeMessageHandler.java
services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/handler/PdpUpdateMessageHandler.java
services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/parameters/ApexStarterParameterGroup.java
services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/rest/HealthCheckProvider.java
services/services-onappf/src/test/java/org/onap/policy/apex/services/onappf/comm/TestPdpStateChangeListener.java
services/services-onappf/src/test/java/org/onap/policy/apex/services/onappf/comm/TestPdpUpdateListener.java
services/services-onappf/src/test/java/org/onap/policy/apex/services/onappf/parameters/CommonTestData.java
services/services-onappf/src/test/java/org/onap/policy/apex/services/onappf/parameters/TestApexStarterParameterGroup.java
services/services-onappf/src/test/java/org/onap/policy/apex/services/onappf/rest/TestHealthCheckRestControllerV1.java

index 177dfdf..2c2642c 100644 (file)
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
- *  Modifications Copyright (C) 2019-2021, 2023 Nordix Foundation.
+ *  Modifications Copyright (C) 2019-2021, 2023-2024 Nordix Foundation.
  *  Modifications Copyright (C) 2021 Bell Canada. All rights reserved.
  *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
@@ -38,9 +38,9 @@ import org.onap.policy.apex.service.engine.event.ApexEventRuntimeException;
 import org.onap.policy.apex.service.engine.event.ApexPluginsEventProducer;
 import org.onap.policy.apex.service.parameters.carriertechnology.RestPluginCarrierTechnologyParameters;
 import org.onap.policy.apex.service.parameters.eventhandler.EventHandlerParameters;
-import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
-import org.onap.policy.common.endpoints.utils.NetLoggerUtil;
-import org.onap.policy.common.endpoints.utils.NetLoggerUtil.EventType;
+import org.onap.policy.common.message.bus.event.Topic.CommInfrastructure;
+import org.onap.policy.common.message.bus.utils.NetLoggerUtil;
+import org.onap.policy.common.message.bus.utils.NetLoggerUtil.EventType;
 
 /**
  * Concrete implementation of an Apex event producer that sends events using REST.
index 2aec19d..b97b03c 100644 (file)
@@ -51,9 +51,9 @@ import org.onap.policy.apex.service.engine.event.ApexPluginsEventConsumer;
 import org.onap.policy.apex.service.parameters.carriertechnology.RestPluginCarrierTechnologyParameters.HttpMethod;
 import org.onap.policy.apex.service.parameters.eventhandler.EventHandlerParameters;
 import org.onap.policy.apex.service.parameters.eventhandler.EventHandlerPeeredMode;
-import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
-import org.onap.policy.common.endpoints.utils.NetLoggerUtil;
-import org.onap.policy.common.endpoints.utils.NetLoggerUtil.EventType;
+import org.onap.policy.common.message.bus.event.Topic.CommInfrastructure;
+import org.onap.policy.common.message.bus.utils.NetLoggerUtil;
+import org.onap.policy.common.message.bus.utils.NetLoggerUtil.EventType;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
index de26285..bffc635 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019-2021, 2023 Nordix Foundation.
+ *  Copyright (C) 2019-2021, 2023-2024 Nordix Foundation.
  *  Modifications Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved.
  *  Modifications Copyright (C) 2021 Bell Canada. All rights reserved.
  * ================================================================================
@@ -33,11 +33,11 @@ import org.onap.policy.apex.services.onappf.exception.ApexStarterRunTimeExceptio
 import org.onap.policy.apex.services.onappf.handler.PdpMessageHandler;
 import org.onap.policy.apex.services.onappf.parameters.ApexStarterParameterGroup;
 import org.onap.policy.apex.services.onappf.rest.HealthCheckRestControllerV1;
-import org.onap.policy.common.endpoints.event.comm.TopicEndpointManager;
-import org.onap.policy.common.endpoints.event.comm.TopicSink;
-import org.onap.policy.common.endpoints.event.comm.TopicSource;
 import org.onap.policy.common.endpoints.http.server.RestServer;
 import org.onap.policy.common.endpoints.listeners.MessageTypeDispatcher;
+import org.onap.policy.common.message.bus.event.TopicEndpointManager;
+import org.onap.policy.common.message.bus.event.TopicSink;
+import org.onap.policy.common.message.bus.event.TopicSource;
 import org.onap.policy.common.utils.network.NetworkUtil;
 import org.onap.policy.common.utils.services.Registry;
 import org.onap.policy.common.utils.services.ServiceManager;
index 4047490..4338868 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019 Nordix Foundation.
+ *  Copyright (C) 2019, 2024 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -21,8 +21,8 @@
 package org.onap.policy.apex.services.onappf.comm;
 
 import org.onap.policy.apex.services.onappf.handler.PdpStateChangeMessageHandler;
-import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
 import org.onap.policy.common.endpoints.listeners.ScoListener;
+import org.onap.policy.common.message.bus.event.Topic.CommInfrastructure;
 import org.onap.policy.common.utils.coder.StandardCoderObject;
 import org.onap.policy.models.pdp.concepts.PdpStateChange;
 import org.slf4j.Logger;
index 499a028..c374817 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019 Nordix Foundation.
+ *  Copyright (C) 2019, 2024 Nordix Foundation.
  *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -26,8 +26,8 @@ import java.util.Timer;
 import java.util.TimerTask;
 import lombok.Getter;
 import org.onap.policy.apex.services.onappf.handler.PdpMessageHandler;
-import org.onap.policy.common.endpoints.event.comm.TopicSink;
-import org.onap.policy.common.endpoints.event.comm.client.TopicSinkClient;
+import org.onap.policy.common.message.bus.event.TopicSink;
+import org.onap.policy.common.message.bus.event.client.TopicSinkClient;
 import org.onap.policy.models.pdp.concepts.PdpStatus;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
index 5633d60..7012e4c 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019 Nordix Foundation.
+ *  Copyright (C) 2019, 2024 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -21,8 +21,8 @@
 package org.onap.policy.apex.services.onappf.comm;
 
 import org.onap.policy.apex.services.onappf.handler.PdpUpdateMessageHandler;
-import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
 import org.onap.policy.common.endpoints.listeners.ScoListener;
+import org.onap.policy.common.message.bus.event.Topic.CommInfrastructure;
 import org.onap.policy.common.utils.coder.StandardCoderObject;
 import org.onap.policy.models.pdp.concepts.PdpUpdate;
 import org.slf4j.Logger;
index 4d3de32..e70d39b 100644 (file)
@@ -25,7 +25,6 @@ package org.onap.policy.apex.services.onappf.handler;
 import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.List;
-import java.util.stream.Collectors;
 import org.onap.policy.apex.service.engine.main.ApexPolicyStatisticsManager;
 import org.onap.policy.apex.services.onappf.ApexStarterConstants;
 import org.onap.policy.apex.services.onappf.comm.PdpStatusPublisher;
index f6567f0..89aba1e 100644 (file)
@@ -32,7 +32,7 @@ import org.onap.policy.apex.service.engine.main.ApexPolicyStatisticsManager;
 import org.onap.policy.apex.services.onappf.ApexStarterConstants;
 import org.onap.policy.apex.services.onappf.comm.PdpStatusPublisher;
 import org.onap.policy.apex.services.onappf.exception.ApexStarterException;
-import org.onap.policy.common.endpoints.event.comm.TopicSink;
+import org.onap.policy.common.message.bus.event.TopicSink;
 import org.onap.policy.common.utils.services.Registry;
 import org.onap.policy.models.pdp.concepts.PdpResponseDetails;
 import org.onap.policy.models.pdp.concepts.PdpStatus;
@@ -64,15 +64,15 @@ public class PdpUpdateMessageHandler {
         final var pdpStatusContext = Registry.get(ApexStarterConstants.REG_PDP_STATUS_OBJECT, PdpStatus.class);
         PdpResponseDetails pdpResponseDetails = null;
         if (pdpUpdateMsg.appliesTo(pdpStatusContext.getName(), pdpStatusContext.getPdpGroup(),
-                pdpStatusContext.getPdpSubgroup())) {
+            pdpStatusContext.getPdpSubgroup())) {
             if (checkIfAlreadyHandled(pdpUpdateMsg, pdpStatusContext)) {
                 pdpResponseDetails = pdpMessageHandler.createPdpResponseDetails(pdpUpdateMsg.getRequestId(),
-                        PdpResponseStatus.SUCCESS, "Pdp already updated");
+                    PdpResponseStatus.SUCCESS, "Pdp already updated");
             } else {
                 pdpResponseDetails = handlePdpUpdate(pdpUpdateMsg, pdpMessageHandler, pdpStatusContext);
             }
             final var pdpStatusPublisherTemp =
-                    Registry.get(ApexStarterConstants.REG_PDP_STATUS_PUBLISHER, PdpStatusPublisher.class);
+                Registry.get(ApexStarterConstants.REG_PDP_STATUS_PUBLISHER, PdpStatusPublisher.class);
             final var pdpStatus = pdpMessageHandler.createPdpStatusFromContext();
             pdpStatus.setResponse(pdpResponseDetails);
             pdpStatus.setDescription("Pdp status response message for PdpUpdate");
@@ -83,39 +83,39 @@ public class PdpUpdateMessageHandler {
     /**
      * Method to do pdp update.
      *
-     * @param pdpUpdateMsg the pdp update message
+     * @param pdpUpdateMsg      the pdp update message
      * @param pdpMessageHandler the message handler
-     * @param pdpStatusContext the pdp status in memory
+     * @param pdpStatusContext  the pdp status in memory
      * @return pdpResponseDetails the pdp response
      */
     private PdpResponseDetails handlePdpUpdate(final PdpUpdate pdpUpdateMsg, final PdpMessageHandler pdpMessageHandler,
-        final PdpStatus pdpStatusContext) {
+                                               final PdpStatus pdpStatusContext) {
         PdpResponseDetails pdpResponseDetails = null;
         final var pdpStatusPublisher =
-                        Registry.get(ApexStarterConstants.REG_PDP_STATUS_PUBLISHER, PdpStatusPublisher.class);
+            Registry.get(ApexStarterConstants.REG_PDP_STATUS_PUBLISHER, PdpStatusPublisher.class);
         if (null != pdpUpdateMsg.getPdpHeartbeatIntervalMs() && pdpUpdateMsg.getPdpHeartbeatIntervalMs() > 0
-                && pdpStatusPublisher.getInterval() != pdpUpdateMsg.getPdpHeartbeatIntervalMs()) {
+            && pdpStatusPublisher.getInterval() != pdpUpdateMsg.getPdpHeartbeatIntervalMs()) {
             updateInterval(pdpUpdateMsg.getPdpHeartbeatIntervalMs());
         }
         pdpStatusContext.setPdpGroup(pdpUpdateMsg.getPdpGroup());
         pdpStatusContext.setPdpSubgroup(pdpUpdateMsg.getPdpSubgroup());
         @SuppressWarnings("unchecked")
         List<ToscaPolicy> policies = Registry.getOrDefault(ApexStarterConstants.REG_APEX_TOSCA_POLICY_LIST,
-                List.class, new ArrayList<>());
+            List.class, new ArrayList<>());
         policies.addAll(pdpUpdateMsg.getPoliciesToBeDeployed());
         policies.removeIf(policy -> pdpUpdateMsg.getPoliciesToBeUndeployed().contains(policy.getIdentifier()));
         Set<ToscaConceptIdentifier> policiesInDeployment = policies.stream().map(ToscaPolicy::getIdentifier)
-                .collect(Collectors.toSet());
+            .collect(Collectors.toSet());
         policiesInDeployment.removeAll(pdpUpdateMsg.getPoliciesToBeUndeployed());
         pdpStatusContext.setPolicies(new ArrayList<>(policiesInDeployment));
         Registry.registerOrReplace(ApexStarterConstants.REG_APEX_TOSCA_POLICY_LIST,
-                policies);
+            policies);
         if (pdpStatusContext.getState().equals(PdpState.ACTIVE)) {
             pdpResponseDetails = startOrStopApexEngineBasedOnPolicies(pdpUpdateMsg, pdpMessageHandler);
 
             var apexEngineHandler =
                 Registry.getOrDefault(ApexStarterConstants.REG_APEX_ENGINE_HANDLER, ApexEngineHandler.class, null);
-            // in hearbeat while in active state, only the policies which are running should be there.
+            // in heartbeat while in active state, only the policies which are running should be there.
             // if some policy fails, that shouldn't go in the heartbeat.
             // If no policies are running, then the policy list in the heartbeat can be empty
             if (null != apexEngineHandler && apexEngineHandler.isApexEngineRunning()) {
@@ -129,7 +129,7 @@ public class PdpUpdateMessageHandler {
         }
         if (null == pdpResponseDetails) {
             pdpResponseDetails = pdpMessageHandler.createPdpResponseDetails(pdpUpdateMsg.getRequestId(),
-                    PdpResponseStatus.SUCCESS, "Pdp update successful.");
+                PdpResponseStatus.SUCCESS, "Pdp update successful.");
         }
         return pdpResponseDetails;
     }
@@ -137,14 +137,14 @@ public class PdpUpdateMessageHandler {
     /**
      * Method to start or stop apex engine based on the list of policies received from pap. When current state is
      * active, if PAP sends PdpUpdate with empty policies list, stop apex engine, or, if there is a change in policies,
-     * stop the current running policies and the deploy the new ones.
+     * stop the current running policies and then deploy the new ones.
      *
-     * @param pdpUpdateMsg the pdp update message from pap
+     * @param pdpUpdateMsg      the pdp update message from pap
      * @param pdpMessageHandler pdp message handler
      * @return pdpResponseDetails the pdp response
      */
     private PdpResponseDetails startOrStopApexEngineBasedOnPolicies(final PdpUpdate pdpUpdateMsg,
-            final PdpMessageHandler pdpMessageHandler) {
+                                                                    final PdpMessageHandler pdpMessageHandler) {
         PdpResponseDetails pdpResponseDetails = null;
         ApexEngineHandler apexEngineHandler = null;
         try {
@@ -163,7 +163,8 @@ public class PdpUpdateMessageHandler {
     }
 
     private PdpResponseDetails stopApexEngineBasedOnPolicies(final PdpUpdate pdpUpdateMsg,
-        final PdpMessageHandler pdpMessageHandler, ApexEngineHandler apexEngineHandler) {
+                                                             final PdpMessageHandler pdpMessageHandler,
+                                                             ApexEngineHandler apexEngineHandler) {
         PdpResponseDetails pdpResponseDetails = null;
         if (null != apexEngineHandler && apexEngineHandler.isApexEngineRunning()) {
             List<ToscaConceptIdentifier> runningPolicies = apexEngineHandler.getRunningPolicies();
@@ -175,7 +176,7 @@ public class PdpUpdateMessageHandler {
             } catch (final ApexStarterException e) {
                 LOGGER.error("Pdp update failed as the policies couldn't be undeployed.", e);
                 pdpResponseDetails = pdpMessageHandler.createPdpResponseDetails(pdpUpdateMsg.getRequestId(),
-                        PdpResponseStatus.FAIL, "Pdp update failed as the policies couldn't be undeployed.");
+                    PdpResponseStatus.FAIL, "Pdp update failed as the policies couldn't be undeployed.");
             }
             updateDeploymentCounts(runningPolicies, pdpUpdateMsg);
         }
@@ -183,7 +184,8 @@ public class PdpUpdateMessageHandler {
     }
 
     private PdpResponseDetails startApexEngineBasedOnPolicies(final PdpUpdate pdpUpdateMsg,
-        final PdpMessageHandler pdpMessageHandler, ApexEngineHandler apexEngineHandler) {
+                                                              final PdpMessageHandler pdpMessageHandler,
+                                                              ApexEngineHandler apexEngineHandler) {
         PdpResponseDetails pdpResponseDetails = null;
         List<ToscaConceptIdentifier> runningPolicies = new ArrayList<>();
         try {
@@ -206,14 +208,15 @@ public class PdpUpdateMessageHandler {
         } catch (final ApexStarterException e) {
             LOGGER.error("Apex engine service running failed. ", e);
             pdpResponseDetails = pdpMessageHandler.createPdpResponseDetails(pdpUpdateMsg.getRequestId(),
-                    PdpResponseStatus.FAIL, "Apex engine service running failed. " + e.getMessage());
+                PdpResponseStatus.FAIL, "Apex engine service running failed. " + e.getMessage());
         }
         updateDeploymentCounts(runningPolicies, pdpUpdateMsg);
         return pdpResponseDetails;
     }
 
     private PdpResponseDetails populateResponseForEngineInitiation(final PdpUpdate pdpUpdateMsg,
-        final PdpMessageHandler pdpMessageHandler, ApexEngineHandler apexEngineHandler) {
+                                                                   final PdpMessageHandler pdpMessageHandler,
+                                                                   ApexEngineHandler apexEngineHandler) {
         PdpResponseDetails pdpResponseDetails;
         Set<ToscaConceptIdentifier> runningPolicies = new HashSet<>(apexEngineHandler.getRunningPolicies());
         List<ToscaConceptIdentifier> policiesToBeDeployed =
@@ -252,7 +255,7 @@ public class PdpUpdateMessageHandler {
     /**
      * Method checks if the Pdp update message is already handled by checking the values in the context.
      *
-     * @param pdpUpdateMsg pdp update message received from pap
+     * @param pdpUpdateMsg     pdp update message received from pap
      * @param pdpStatusContext values saved in context memory
      * @return boolean flag which tells if the information is same or not
      */
@@ -263,7 +266,7 @@ public class PdpUpdateMessageHandler {
             && pdpStatusContext.getPdpSubgroup().equals(pdpUpdateMsg.getPdpSubgroup())
             && null != pdpStatusContext.getPolicies()
             && pdpStatusContext.getPolicies()
-                .containsAll(new PdpMessageHandler().getToscaPolicyIdentifiers(pdpUpdateMsg.getPoliciesToBeDeployed()))
+            .containsAll(new PdpMessageHandler().getToscaPolicyIdentifiers(pdpUpdateMsg.getPoliciesToBeDeployed()))
             && !containsAny(new HashSet<>(pdpStatusContext.getPolicies()), pdpUpdateMsg.getPoliciesToBeUndeployed());
     }
 
@@ -274,32 +277,33 @@ public class PdpUpdateMessageHandler {
      */
     public void updateInterval(final long interval) {
         final var pdpStatusPublisher =
-                        Registry.get(ApexStarterConstants.REG_PDP_STATUS_PUBLISHER, PdpStatusPublisher.class);
+            Registry.get(ApexStarterConstants.REG_PDP_STATUS_PUBLISHER, PdpStatusPublisher.class);
         pdpStatusPublisher.terminate();
         final List<TopicSink> topicSinks = Registry.get(ApexStarterConstants.REG_APEX_PDP_TOPIC_SINKS);
         Registry.registerOrReplace(ApexStarterConstants.REG_PDP_STATUS_PUBLISHER,
-                new PdpStatusPublisher(topicSinks, interval));
+            new PdpStatusPublisher(topicSinks, interval));
     }
 
     /**
      * Checks if one list contains any element of another.
      *
-     * @param listToCheckWith list to check contents of
+     * @param listToCheckWith    list to check contents of
      * @param listToCheckAgainst list to check against other list for similarities
      * @return boolean flag which tells if lists share same elements or not
      */
     private boolean containsAny(Set<ToscaConceptIdentifier> listToCheckWith,
-            List<ToscaConceptIdentifier> listToCheckAgainst) {
+                                List<ToscaConceptIdentifier> listToCheckAgainst) {
         return listToCheckAgainst.stream().anyMatch(listToCheckWith::contains);
     }
 
     /**
      * Update count values for deployment actions (deploy and undeploy) when applicable.
+     *
      * @param runningPolicies the policies running in apex engine
-     * @param pdpUpdateMsg the pdp update message from pap
+     * @param pdpUpdateMsg    the pdp update message from pap
      */
     private void updateDeploymentCounts(final List<ToscaConceptIdentifier> runningPolicies,
-        final PdpUpdate pdpUpdateMsg) {
+                                        final PdpUpdate pdpUpdateMsg) {
         final var statisticsManager = ApexPolicyStatisticsManager.getInstanceFromRegistry();
         if (statisticsManager != null && runningPolicies != null) {
             if (pdpUpdateMsg.getPoliciesToBeDeployed() != null && !pdpUpdateMsg.getPoliciesToBeDeployed().isEmpty()) {
@@ -310,7 +314,7 @@ public class PdpUpdateMessageHandler {
                 policiesSuccessfullyDeployed.retainAll(runningPolicies);
                 policiesSuccessfullyDeployed.forEach(policy -> statisticsManager.updatePolicyDeployCounter(true));
 
-                var policiesFailedToDeploy =  new ArrayList<>(policiesToDeploy);
+                var policiesFailedToDeploy = new ArrayList<>(policiesToDeploy);
                 policiesFailedToDeploy.removeIf(runningPolicies::contains);
                 policiesFailedToDeploy.forEach(policy -> statisticsManager.updatePolicyDeployCounter(false));
             }
@@ -321,7 +325,7 @@ public class PdpUpdateMessageHandler {
                 policiesFailedToUndeploy.retainAll(runningPolicies);
                 policiesFailedToUndeploy.forEach(policy -> statisticsManager.updatePolicyUndeployCounter(false));
 
-                var policiesSuccessfullyUndeployed =  new ArrayList<>(policiesToUndeploy);
+                var policiesSuccessfullyUndeployed = new ArrayList<>(policiesToUndeploy);
                 policiesSuccessfullyUndeployed.removeIf(runningPolicies::contains);
                 policiesSuccessfullyUndeployed.forEach(policy -> statisticsManager.updatePolicyUndeployCounter(true));
             }
index f752348..4fc5d4a 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019 Nordix Foundation.
+ *  Copyright (C) 2019, 2024 Nordix Foundation.
  *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
 package org.onap.policy.apex.services.onappf.parameters;
 
 import lombok.Getter;
-import org.onap.policy.common.endpoints.parameters.RestServerParameters;
-import org.onap.policy.common.endpoints.parameters.TopicParameterGroup;
 import org.onap.policy.common.parameters.ParameterGroupImpl;
 import org.onap.policy.common.parameters.annotations.NotBlank;
 import org.onap.policy.common.parameters.annotations.NotNull;
 import org.onap.policy.common.parameters.annotations.Valid;
+import org.onap.policy.common.parameters.rest.RestServerParameters;
+import org.onap.policy.common.parameters.topic.TopicParameterGroup;
 
 /**
  * Class to hold all parameters needed for apex starter component.
index b6962e9..f99f394 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019 Nordix Foundation.
+ *  Copyright (C) 2019, 2024 Nordix Foundation.
  *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -23,7 +23,7 @@ package org.onap.policy.apex.services.onappf.rest;
 
 import org.onap.policy.apex.services.onappf.ApexStarterActivator;
 import org.onap.policy.apex.services.onappf.ApexStarterConstants;
-import org.onap.policy.common.endpoints.report.HealthCheckReport;
+import org.onap.policy.common.utils.report.HealthCheckReport;
 import org.onap.policy.common.utils.services.Registry;
 
 /**
index 7bff646..3957598 100644 (file)
@@ -44,7 +44,7 @@ import org.onap.policy.apex.services.onappf.exception.ApexStarterException;
 import org.onap.policy.apex.services.onappf.handler.ApexEngineHandler;
 import org.onap.policy.apex.services.onappf.parameters.ApexStarterParameterGroup;
 import org.onap.policy.apex.services.onappf.parameters.ApexStarterParameterHandler;
-import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
+import org.onap.policy.common.message.bus.event.Topic.CommInfrastructure;
 import org.onap.policy.common.utils.cmd.CommandLineException;
 import org.onap.policy.common.utils.coder.CoderException;
 import org.onap.policy.common.utils.services.Registry;
index f0eb4ff..da11bb7 100644 (file)
@@ -45,7 +45,7 @@ import org.onap.policy.apex.services.onappf.handler.ApexEngineHandler;
 import org.onap.policy.apex.services.onappf.handler.PdpMessageHandler;
 import org.onap.policy.apex.services.onappf.parameters.ApexStarterParameterGroup;
 import org.onap.policy.apex.services.onappf.parameters.ApexStarterParameterHandler;
-import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
+import org.onap.policy.common.message.bus.event.Topic.CommInfrastructure;
 import org.onap.policy.common.utils.cmd.CommandLineException;
 import org.onap.policy.common.utils.coder.CoderException;
 import org.onap.policy.common.utils.services.Registry;
index 099663a..cdfb76c 100644 (file)
@@ -23,8 +23,8 @@ package org.onap.policy.apex.services.onappf.parameters;
 import java.util.List;
 import java.util.Map;
 import java.util.TreeMap;
-import org.onap.policy.common.endpoints.parameters.TopicParameters;
 import org.onap.policy.common.parameters.ParameterGroup;
+import org.onap.policy.common.parameters.topic.TopicParameters;
 import org.onap.policy.common.utils.coder.Coder;
 import org.onap.policy.common.utils.coder.CoderException;
 import org.onap.policy.common.utils.coder.StandardCoder;
index bd063d0..c1e5daa 100644 (file)
@@ -29,9 +29,9 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.Map;
 import org.junit.jupiter.api.Test;
-import org.onap.policy.common.endpoints.parameters.RestServerParameters;
-import org.onap.policy.common.endpoints.parameters.TopicParameterGroup;
 import org.onap.policy.common.parameters.ValidationResult;
+import org.onap.policy.common.parameters.rest.RestServerParameters;
+import org.onap.policy.common.parameters.topic.TopicParameterGroup;
 
 /**
  * Class to perform unit test of {@link ApexStarterParameterGroup}.
index 2484155..3364efa 100644 (file)
@@ -28,7 +28,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
 import jakarta.ws.rs.client.Invocation;
 import jakarta.ws.rs.client.SyncInvoker;
 import org.junit.jupiter.api.Test;
-import org.onap.policy.common.endpoints.report.HealthCheckReport;
+import org.onap.policy.common.utils.report.HealthCheckReport;
 
 /**
  * Class to perform unit test of {@link HealthCheckRestControllerV1}.