Fix references and organize dependencies in xacml-pdp after 51/139351/2
authoradheli.tavares <adheli.tavares@est.tech>
Wed, 6 Nov 2024 11:46:41 +0000 (11:46 +0000)
committeradheli.tavares <adheli.tavares@est.tech>
Thu, 7 Nov 2024 11:33:37 +0000 (11:33 +0000)
splitting policy-endpoints and message-bus

Issue-ID: POLICY-5131
Change-Id: I6181f763f140589f681beb602c56b4290e3fab1a
Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
39 files changed:
applications/common/pom.xml
applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/operationshistory/GetOperationOutcomePip.java
applications/common/src/test/java/org/onap/policy/pdp/xacml/application/common/PolicyApiCallerTest.java
applications/common/src/test/java/org/onap/policy/pdp/xacml/application/common/std/StdMatchableTranslatorTest.java
applications/guard/pom.xml
applications/match/pom.xml
applications/monitoring/pom.xml
applications/naming/pom.xml
applications/native/pom.xml
applications/native/src/main/java/org/onap/policy/xacml/pdp/application/nativ/NativePdpApplicationTranslator.java
applications/optimization/pom.xml
main/pom.xml
main/src/main/java/org/onap/policy/pdpx/main/comm/XacmlPdpHearbeatPublisher.java
main/src/main/java/org/onap/policy/pdpx/main/comm/XacmlPdpPapRegistration.java
main/src/main/java/org/onap/policy/pdpx/main/comm/XacmlPdpUpdatePublisher.java
main/src/main/java/org/onap/policy/pdpx/main/comm/listeners/XacmlPdpStateChangeListener.java
main/src/main/java/org/onap/policy/pdpx/main/comm/listeners/XacmlPdpUpdateListener.java
main/src/main/java/org/onap/policy/pdpx/main/parameters/XacmlPdpParameterGroup.java
main/src/main/java/org/onap/policy/pdpx/main/parameters/XacmlPdpParameterHandler.java
main/src/main/java/org/onap/policy/pdpx/main/rest/provider/HealthCheckProvider.java
main/src/main/java/org/onap/policy/pdpx/main/startstop/XacmlPdpActivator.java
main/src/main/java/org/onap/policy/pdpx/main/startstop/XacmlPdpRestServer.java
main/src/test/java/org/onap/policy/pdpx/main/CommonRest.java
main/src/test/java/org/onap/policy/pdpx/main/comm/XacmlPdpHeartbeatPublisherTest.java [moved from main/src/test/java/org/onap/policy/pdpx/main/comm/XacmlPdpHearbeatPublisherTest.java with 97% similarity]
main/src/test/java/org/onap/policy/pdpx/main/comm/XacmlPdpPapRegistrationTest.java
main/src/test/java/org/onap/policy/pdpx/main/comm/XacmlPdpUpdatePublisherTest.java
main/src/test/java/org/onap/policy/pdpx/main/comm/listeners/XacmlPdpStateChangeListenerTest.java
main/src/test/java/org/onap/policy/pdpx/main/comm/listeners/XacmlPdpUpdateListenerTest.java
main/src/test/java/org/onap/policy/pdpx/main/parameters/CommonTestData.java
main/src/test/java/org/onap/policy/pdpx/main/parameters/TestXacmlPdpParameterGroup.java
main/src/test/java/org/onap/policy/pdpx/main/rest/TestAbbreviateDecisionResults.java
main/src/test/java/org/onap/policy/pdpx/main/rest/TestDecision.java
main/src/test/java/org/onap/policy/pdpx/main/rest/TestXacmlPdpRestServer.java
pom.xml
tutorials/tutorial-enforcement/pom.xml
tutorials/tutorial-enforcement/src/main/java/org/onap/policy/tutorial/policyenforcement/App.java
tutorials/tutorial-xacml-application/pom.xml
tutorials/tutorial-xacml-application/src/main/java/org/onap/policy/tutorial/tutorial/TutorialTranslator.java
xacml-test/pom.xml

index c925491..3b5d31c 100644 (file)
 
     <dependencies>
         <dependency>
-            <groupId>org.mockito</groupId>
-            <artifactId>mockito-core</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>jakarta.xml.bind</groupId>
-            <artifactId>jakarta.xml.bind-api</artifactId>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.glassfish.jaxb</groupId>
-            <artifactId>jaxb-runtime</artifactId>
+            <groupId>org.onap.policy.common</groupId>
+            <artifactId>capabilities</artifactId>
+            <version>${policy.common.version}</version>
         </dependency>
         <dependency>
-            <groupId>com.h2database</groupId>
-            <artifactId>h2</artifactId>
-            <scope>test</scope>
+            <groupId>org.onap.policy.common</groupId>
+            <artifactId>common-parameters</artifactId>
+            <version>${policy.common.version}</version>
         </dependency>
         <dependency>
-            <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
-            <artifactId>guard</artifactId>
-            <version>${policy.models.version}</version>
+            <groupId>org.onap.policy.common</groupId>
+            <artifactId>gson</artifactId>
+            <version>${policy.common.version}</version>
         </dependency>
         <dependency>
             <groupId>org.onap.policy.common</groupId>
             <version>${policy.common.version}</version>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>org.onap.policy.models</groupId>
+            <artifactId>policy-models-tosca</artifactId>
+            <version>${policy.models.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.policy.models</groupId>
+            <artifactId>policy-models-decisions</artifactId>
+            <version>${policy.models.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
+            <artifactId>guard</artifactId>
+            <version>${policy.models.version}</version>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.policy.models</groupId>
+            <artifactId>policy-models-examples</artifactId>
+            <version>${policy.models.version}</version>
+            <scope>runtime</scope>
+        </dependency>
         <dependency>
             <groupId>com.att.research.xacml</groupId>
             <artifactId>xacml-pdp</artifactId>
-            <version>4.0.0</version>
+        </dependency>
+        <dependency>
+            <groupId>com.att.research.xacml</groupId>
+            <artifactId>xacml</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.google.code.gson</groupId>
+            <artifactId>gson</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.google.guava</groupId>
+            <artifactId>guava</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>jakarta.persistence</groupId>
+            <artifactId>jakarta.persistence-api</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>jakarta.ws.rs</groupId>
+            <artifactId>jakarta.ws.rs-api</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>jakarta.xml.bind</groupId>
+            <artifactId>jakarta.xml.bind-api</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.glassfish.jaxb</groupId>
+            <artifactId>jaxb-runtime</artifactId>
+            <scope>runtime</scope>
         </dependency>
         <dependency>
             <groupId>org.hibernate.orm</groupId>
             <artifactId>hibernate-core</artifactId>
+            <scope>runtime</scope>
         </dependency>
         <dependency>
             <groupId>org.glassfish.jersey.inject</groupId>
             <artifactId>jersey-hk2</artifactId>
+            <scope>runtime</scope>
         </dependency>
         <dependency>
-            <groupId>org.onap.policy.models</groupId>
-            <artifactId>policy-models-examples</artifactId>
-            <version>${policy.models.version}</version>
+            <groupId>com.h2database</groupId>
+            <artifactId>h2</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.mockito</groupId>
+            <artifactId>mockito-core</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.mockito</groupId>
+            <artifactId>mockito-junit-jupiter</artifactId>
+            <scope>test</scope>
         </dependency>
     </dependencies>
 </project>
index ee80641..d25abec 100644 (file)
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  * Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2023 Nordix Foundation.
+ * Modifications Copyright (C) 2023-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.
@@ -37,7 +37,7 @@ import org.slf4j.LoggerFactory;
 
 public class GetOperationOutcomePip extends StdOnapPip {
     public static final String ISSUER_NAME = "get-operation-outcome";
-    private static Logger logger = LoggerFactory.getLogger(GetOperationOutcomePip.class);
+    private static final Logger logger = LoggerFactory.getLogger(GetOperationOutcomePip.class);
 
     public GetOperationOutcomePip() {
         super();
index a5a7b7c..7350c87 100644 (file)
@@ -46,9 +46,9 @@ import org.onap.policy.common.endpoints.http.client.HttpClient;
 import org.onap.policy.common.endpoints.http.client.HttpClientFactoryInstance;
 import org.onap.policy.common.endpoints.http.server.HttpServletServer;
 import org.onap.policy.common.endpoints.http.server.HttpServletServerFactoryInstance;
-import org.onap.policy.common.endpoints.parameters.RestClientParameters;
 import org.onap.policy.common.endpoints.properties.PolicyEndPointProperties;
 import org.onap.policy.common.gson.GsonMessageBodyHandler;
+import org.onap.policy.common.parameters.rest.RestClientParameters;
 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;
index 54c3a1b..a0a6611 100644 (file)
@@ -62,9 +62,9 @@ import org.onap.policy.common.endpoints.http.client.HttpClient;
 import org.onap.policy.common.endpoints.http.client.HttpClientFactoryInstance;
 import org.onap.policy.common.endpoints.http.server.HttpServletServer;
 import org.onap.policy.common.endpoints.http.server.HttpServletServerFactoryInstance;
-import org.onap.policy.common.endpoints.parameters.RestClientParameters;
 import org.onap.policy.common.endpoints.properties.PolicyEndPointProperties;
 import org.onap.policy.common.gson.GsonMessageBodyHandler;
+import org.onap.policy.common.parameters.rest.RestClientParameters;
 import org.onap.policy.common.utils.coder.CoderException;
 import org.onap.policy.common.utils.coder.StandardYamlCoder;
 import org.onap.policy.common.utils.network.NetworkUtil;
index 1b3ba52..64bdb35 100644 (file)
@@ -3,14 +3,14 @@
   ONAP Policy Engine - XACML PDP
   ================================================================================
   Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
-  Modifications Copyright (C) 2023 Nordix Foundation.
+  Modifications Copyright (C) 2023-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.
   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.
             <artifactId>common</artifactId>
             <version>${project.version}</version>
         </dependency>
-        <dependency>
-            <groupId>com.h2database</groupId>
-            <artifactId>h2</artifactId>
-            <scope>test</scope>
-        </dependency>
         <dependency>
             <groupId>org.onap.policy.xacml-pdp</groupId>
             <artifactId>xacml-test</artifactId>
             <version>${project.version}</version>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>org.onap.policy.common</groupId>
+            <artifactId>common-parameters</artifactId>
+            <version>${policy.common.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.policy.common</groupId>
+            <artifactId>policy-endpoints</artifactId>
+            <version>${policy.common.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.policy.common</groupId>
+            <artifactId>utils</artifactId>
+            <version>${policy.common.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
+            <artifactId>guard</artifactId>
+            <version>${policy.models.version}</version>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.policy.models</groupId>
+            <artifactId>policy-models-tosca</artifactId>
+            <version>${policy.models.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.policy.models</groupId>
+            <artifactId>policy-models-decisions</artifactId>
+            <version>${policy.models.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.att.research.xacml</groupId>
+            <artifactId>xacml</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.google.code.gson</groupId>
+            <artifactId>gson</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>commons-io</groupId>
+            <artifactId>commons-io</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>jakarta.persistence</groupId>
+            <artifactId>jakarta.persistence-api</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>jakarta.xml.bind</groupId>
+            <artifactId>jakarta.xml.bind-api</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.h2database</groupId>
+            <artifactId>h2</artifactId>
+            <scope>test</scope>
+        </dependency>
     </dependencies>
 
 </project>
index 5c8d40e..0ee90ad 100644 (file)
             <version>${project.version}</version>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>org.onap.policy.common</groupId>
+            <artifactId>policy-endpoints</artifactId>
+            <version>${policy.common.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.policy.common</groupId>
+            <artifactId>utils</artifactId>
+            <version>${policy.common.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.policy.models</groupId>
+            <artifactId>policy-models-decisions</artifactId>
+            <version>${policy.models.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.policy.models</groupId>
+            <artifactId>policy-models-tosca</artifactId>
+            <version>${policy.models.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.att.research.xacml</groupId>
+            <artifactId>xacml</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <scope>provided</scope>
+        </dependency>
     </dependencies>
 
 </project>
index beedf1b..cfdb589 100644 (file)
             <version>${project.version}</version>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>org.onap.policy.common</groupId>
+            <artifactId>policy-endpoints</artifactId>
+            <version>${policy.common.version}</version>
+            <scope>provided</scope>
+        </dependency>
         <dependency>
             <groupId>org.onap.policy.common</groupId>
             <artifactId>utils</artifactId>
             <version>${policy.common.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.policy.models</groupId>
+            <artifactId>policy-models-tosca</artifactId>
+            <version>${policy.models.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.policy.models</groupId>
+            <artifactId>policy-models-decisions</artifactId>
+            <version>${policy.models.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.att.research.xacml</groupId>
+            <artifactId>xacml</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
         </dependency>
     </dependencies>
 
index 61fdd2d..a267d95 100644 (file)
             <version>${project.version}</version>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>org.onap.policy.common</groupId>
+            <artifactId>policy-endpoints</artifactId>
+            <version>${policy.common.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.policy.common</groupId>
+            <artifactId>utils</artifactId>
+            <version>${policy.common.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.policy.models</groupId>
+            <artifactId>policy-models-decisions</artifactId>
+            <version>${policy.models.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.policy.models</groupId>
+            <artifactId>policy-models-tosca</artifactId>
+            <version>${policy.models.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.att.research.xacml</groupId>
+            <artifactId>xacml</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <scope>provided</scope>
+        </dependency>
     </dependencies>
 
 </project>
index fa586d6..b24c091 100644 (file)
@@ -1,3 +1,24 @@
+<!--
+  ============LICENSE_START=======================================================
+  ONAP Policy Engine - XACML PDP
+  ================================================================================
+  Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
+  Modifications Copyright (C) 2023-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.
+  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=========================================================
+  -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
             <version>${project.version}</version>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>org.onap.policy.common</groupId>
+            <artifactId>common-parameters</artifactId>
+            <version>${policy.common.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.policy.common</groupId>
+            <artifactId>policy-endpoints</artifactId>
+            <version>${policy.common.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.policy.common</groupId>
+            <artifactId>utils</artifactId>
+            <version>${policy.common.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.policy.models</groupId>
+            <artifactId>policy-models-decisions</artifactId>
+            <version>${policy.models.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.policy.models</groupId>
+            <artifactId>policy-models-tosca</artifactId>
+            <version>${policy.models.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.att.research.xacml</groupId>
+            <artifactId>xacml</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>jakarta.xml.bind</groupId>
+            <artifactId>jakarta.xml.bind-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <scope>provided</scope>
+        </dependency>
     </dependencies>
 
 </project>
index 5e87f22..a7ad434 100644 (file)
@@ -3,7 +3,7 @@
  * ONAP
  * ================================================================================
  * Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2020 Nordix Foundation.
+ * Modifications Copyright (C) 2020, 2024 Nordix Foundation.
  * Modifications Copyright (C) 2024 Deutsche Telekom AG.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -73,7 +73,6 @@ import org.slf4j.LoggerFactory;
  * This class implements one translator that interprets TOSCA policy and decision API request/response payload.
  *
  * @author Chenfei Gao (cgao@research.att.com)
- *
  */
 @NoArgsConstructor
 public class NativePdpApplicationTranslator implements ToscaPolicyTranslator {
@@ -134,7 +133,7 @@ public class NativePdpApplicationTranslator implements ToscaPolicyTranslator {
     protected String getNativeXacmlPolicy(ToscaPolicy toscaPolicy) throws ToscaPolicyConversionException {
 
         var nativeDefinition = ToscaPolicyTranslatorUtils.decodeProperties(toscaPolicy.getProperties(),
-                NativeDefinition.class);
+            NativeDefinition.class);
 
         LOGGER.debug("Base64 encoded native xacml policy {}", nativeDefinition.getPolicy());
         return nativeDefinition.getPolicy();
@@ -167,13 +166,13 @@ public class NativePdpApplicationTranslator implements ToscaPolicyTranslator {
         policySetType.setVersion(String.valueOf(toscaPolicy.getMetadata().get("policy-version")));
         policySetType.setDescription(String.valueOf(toscaPolicy.getMetadata().get(DESCRIPTION)));
         policySetType.setTarget(setPolicySetTarget(toscaPolicy.getMetadata().get("action")));
-        for (Map<String, Object> type: (List<Map<String, Object>>) toscaPolicy.getProperties().get("policies")) {
+        for (Map<String, Object> type : (List<Map<String, Object>>) toscaPolicy.getProperties().get("policies")) {
             ToscaPolicy policy = new ToscaPolicy();
             policy.setMetadata((Map<String, Object>) type.get("metadata"));
             policy.setProperties((Map<String, Object>) type.get("properties"));
             ObjectFactory objectFactory = new ObjectFactory();
             policySetType.getPolicySetOrPolicyOrPolicySetIdReference()
-                    .add(objectFactory.createPolicy(convertPolicyXacml(policy)));
+                .add(objectFactory.createPolicy(convertPolicyXacml(policy)));
         }
         return policySetType;
     }
@@ -228,7 +227,7 @@ public class NativePdpApplicationTranslator implements ToscaPolicyTranslator {
         Map<String, Object> properties = toscaPolicy.getProperties();
         if (properties.get("combiningAlgo") != null) {
             policyType.setRuleCombiningAlgId(validateFilterPropertyFunction((String)
-                    properties.get("combiningAlgo")).stringValue());
+                properties.get("combiningAlgo")).stringValue());
         } else {
             policyType.setRuleCombiningAlgId(XACML3.ID_RULE_FIRST_APPLICABLE.stringValue());
         }
@@ -240,7 +239,7 @@ public class NativePdpApplicationTranslator implements ToscaPolicyTranslator {
     }
 
     private void setAdviceExpression(RuleType ruleType, Map<String, Object> rule)
-            throws ToscaPolicyConversionException {
+        throws ToscaPolicyConversionException {
         String decision = (String) rule.get("decision");
         if ("Deny".equalsIgnoreCase(decision)) {
             ruleType.setEffect(EffectType.DENY);
@@ -275,20 +274,20 @@ public class NativePdpApplicationTranslator implements ToscaPolicyTranslator {
                     String datatype = getDatatype(operator);
                     matchType.setMatchId(validateFilterPropertyFunction(operator).stringValue());
                     var valueType = setAttributeValueType(match.get(VALUE),
-                            validateFilterPropertyFunction(datatype).stringValue());
+                        validateFilterPropertyFunction(datatype).stringValue());
                     matchType.setAttributeValue(valueType);
                     String attribute = "";
                     String category = "";
                     if (((String) match.get("key")).contains("action")) {
                         attribute = validateFilterPropertyFunction((String) match
-                                .get("key")).stringValue();
+                            .get("key")).stringValue();
                         category = XACML3.ID_ATTRIBUTE_CATEGORY_ACTION.stringValue();
                     } else {
                         attribute = (String) match.get("key");
                         category = XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE.stringValue();
                     }
                     var designator = setAttributeDesignatorType(attribute, category,
-                            validateFilterPropertyFunction(datatype).stringValue(), false);
+                        validateFilterPropertyFunction(datatype).stringValue(), false);
                     matchType.setAttributeDesignator(designator);
                     listMatch.add(matchType);
                 }
@@ -310,8 +309,8 @@ public class NativePdpApplicationTranslator implements ToscaPolicyTranslator {
         var valueType = setAttributeValueType(value, XACML3.ID_DATATYPE_STRING.stringValue());
         matchType.setAttributeValue(valueType);
         var designator = setAttributeDesignatorType(XACML3.ID_ACTION_ACTION_ID.stringValue(),
-                XACML3.ID_ATTRIBUTE_CATEGORY_ACTION.stringValue(),
-                XACML3.ID_DATATYPE_STRING.stringValue(), false);
+            XACML3.ID_ATTRIBUTE_CATEGORY_ACTION.stringValue(),
+            XACML3.ID_DATATYPE_STRING.stringValue(), false);
         matchType.setAttributeDesignator(designator);
         var anyOfType = new AnyOfType();
         anyOfType.getAllOf().add(ToscaPolicyTranslatorUtils.buildAllOf(matchType));
@@ -369,7 +368,7 @@ public class NativePdpApplicationTranslator implements ToscaPolicyTranslator {
                     keyList.add(setApply((Map<String, Object>) ((Map<?, ?>) keyObject).get(APPLY)));
                 } else {
                     throw new ToscaPolicyConversionException(
-                            "Invalid key entry, object does not contain list, function or apply");
+                        "Invalid key entry, object does not contain list, function or apply");
                 }
             } else {
                 setAttributes(keyObject, keyList, datatype, factory);
@@ -379,37 +378,36 @@ public class NativePdpApplicationTranslator implements ToscaPolicyTranslator {
 
     private void setAttributeAndDesignator(List<Object> keyList, ApplyType apply, ObjectFactory factory) {
         keyList.stream()
-                .sorted((firstKey, secondKey) -> {
-                    if (firstKey instanceof AttributeValueType) {
-                        return -1;
-                    } else if (firstKey instanceof ApplyType) {
-                        return 1;
-                    }
-                    return 0;
-                })
-                .forEach(key -> {
-                    if (key instanceof AttributeValueType) {
-                        apply.getExpression().add(factory.createAttributeValue((AttributeValueType) key));
-                    }
-                    if (key instanceof ApplyType) {
-                        apply.getExpression().add(factory.createApply((ApplyType) key));
-                    }
-                });
+            .sorted((firstKey, secondKey) -> {
+                if (firstKey instanceof AttributeValueType) {
+                    return -1;
+                } else if (firstKey instanceof ApplyType) {
+                    return 1;
+                }
+                return 0;
+            })
+            .forEach(key -> {
+                if (key instanceof AttributeValueType) {
+                    apply.getExpression().add(factory.createAttributeValue((AttributeValueType) key));
+                }
+                if (key instanceof ApplyType) {
+                    apply.getExpression().add(factory.createApply((ApplyType) key));
+                }
+            });
     }
 
     private void setAttributes(Object key, List<Object> keyList, String datatype, ObjectFactory factory)
-            throws ToscaPolicyConversionException {
+        throws ToscaPolicyConversionException {
         try {
-            if (key instanceof String) {
-                String value = (String) key;
+            if (key instanceof String value) {
                 if (value.startsWith("'") && value.endsWith("'")) {
                     AttributeValueType attributeValue = setAttributeValueType(value.substring(1, value.length() - 1),
-                            validateFilterPropertyFunction(datatype).stringValue());
+                        validateFilterPropertyFunction(datatype).stringValue());
                     keyList.add(attributeValue);
                 } else {
                     var keyDesignator = setAttributeDesignatorType(value,
-                            XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE.stringValue(),
-                            validateFilterPropertyFunction(datatype).stringValue(), false);
+                        XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE.stringValue(),
+                        validateFilterPropertyFunction(datatype).stringValue(), false);
                     ApplyType keyApply = new ApplyType();
                     keyApply.setFunctionId(validateFilterPropertyFunction(datatype + ONE_AND_ONLY).stringValue());
                     keyApply.getExpression().add(factory.createAttributeDesignator(keyDesignator));
@@ -417,7 +415,7 @@ public class NativePdpApplicationTranslator implements ToscaPolicyTranslator {
                 }
             } else {
                 AttributeValueType attributeValue = setAttributeValueType(key,
-                        validateFilterPropertyFunction(datatype).stringValue());
+                    validateFilterPropertyFunction(datatype).stringValue());
                 keyList.add(attributeValue);
             }
         } catch (NullPointerException ex) {
@@ -426,34 +424,33 @@ public class NativePdpApplicationTranslator implements ToscaPolicyTranslator {
     }
 
     private void setBagApply(ApplyType apply, List<Object> list, String datatype, ObjectFactory factory)
-            throws ToscaPolicyConversionException {
+        throws ToscaPolicyConversionException {
         try {
             var bagApply = new ApplyType();
             bagApply.setFunctionId(validateFilterPropertyFunction(datatype + "-bag").stringValue());
             for (Object attribute : list) {
                 if (attribute instanceof String && !(((String) attribute).startsWith("'")
-                        && ((String) attribute).endsWith("'"))) {
+                    && ((String) attribute).endsWith("'"))) {
                     var applyDesignator = new ApplyType();
                     applyDesignator.setFunctionId(
-                            validateFilterPropertyFunction(datatype + ONE_AND_ONLY).stringValue());
+                        validateFilterPropertyFunction(datatype + ONE_AND_ONLY).stringValue());
                     var designator = setAttributeDesignatorType((String) attribute,
-                            XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE.stringValue(),
-                            validateFilterPropertyFunction(datatype).stringValue(), false);
+                        XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE.stringValue(),
+                        validateFilterPropertyFunction(datatype).stringValue(), false);
                     applyDesignator.getExpression().add(factory.createAttributeDesignator(designator));
                     bagApply.getExpression().add(factory.createApply(applyDesignator));
                 }
             }
             for (Object attribute : list) {
-                if (attribute instanceof String) {
-                    String value = (String) attribute;
+                if (attribute instanceof String value) {
                     if (value.startsWith("'") && value.endsWith("'")) {
                         var attributeValue = setAttributeValueType(value.substring(1, value.length() - 1),
-                                validateFilterPropertyFunction(datatype).stringValue());
+                            validateFilterPropertyFunction(datatype).stringValue());
                         bagApply.getExpression().add(factory.createAttributeValue(attributeValue));
                     }
                 } else {
                     var attributeValue = setAttributeValueType(attribute,
-                            validateFilterPropertyFunction(datatype).stringValue());
+                        validateFilterPropertyFunction(datatype).stringValue());
                     bagApply.getExpression().add(factory.createAttributeValue(attributeValue));
                 }
             }
@@ -464,7 +461,7 @@ public class NativePdpApplicationTranslator implements ToscaPolicyTranslator {
     }
 
     private void setFunctionType(ApplyType apply, String function, ObjectFactory factory)
-            throws ToscaPolicyConversionException {
+        throws ToscaPolicyConversionException {
         try {
             var functionType = new FunctionType();
             functionType.setFunctionId(validateFilterPropertyFunction(function).stringValue());
@@ -483,12 +480,12 @@ public class NativePdpApplicationTranslator implements ToscaPolicyTranslator {
                 apply.getExpression().add(factory.createApply(compareApply));
             } else if (compareWith.get(VALUE) != null) {
                 var attributeValue = setAttributeValueType(compareWith.get(VALUE),
-                        validateFilterPropertyFunction(datatype).stringValue());
+                    validateFilterPropertyFunction(datatype).stringValue());
                 apply.getExpression().add(factory.createAttributeValue(attributeValue));
             } else if (compareWith.get("key") != null) {
                 var keyDesignator = setAttributeDesignatorType((String) compareWith.get("key"),
-                        XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE.stringValue(),
-                        validateFilterPropertyFunction(datatype).stringValue(), false);
+                    XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE.stringValue(),
+                    validateFilterPropertyFunction(datatype).stringValue(), false);
                 var keyApply = new ApplyType();
                 keyApply.setFunctionId(validateFilterPropertyFunction(datatype + ONE_AND_ONLY).stringValue());
                 keyApply.getExpression().add(factory.createAttributeDesignator(keyDesignator));
@@ -502,7 +499,7 @@ public class NativePdpApplicationTranslator implements ToscaPolicyTranslator {
     }
 
     private AdviceExpressionsType setAdvice(Map<String, Object> advice, String decision)
-            throws ToscaPolicyConversionException {
+        throws ToscaPolicyConversionException {
         var adviceExpressions = new AdviceExpressionsType();
         try {
             var adviceExpression = new AdviceExpressionType();
@@ -554,8 +551,8 @@ public class NativePdpApplicationTranslator implements ToscaPolicyTranslator {
                 return DOUBLE;
             }
             List<String> datatypes = Arrays.asList("string", "boolean", "integer", DOUBLE, "time", "date", "dateTime",
-                    "dayTimeDuration", "yearMonthDuration", "anyURI", "hexBinary", "rfc822Name", "base64Binary",
-                    "x500Name", "ipAddress", "dnsName");
+                "dayTimeDuration", "yearMonthDuration", "anyURI", "hexBinary", "rfc822Name", "base64Binary",
+                "x500Name", "ipAddress", "dnsName");
             if (datatypes.stream().anyMatch(operator::contains)) {
                 return operator.split("-")[0];
             }
@@ -590,7 +587,7 @@ public class NativePdpApplicationTranslator implements ToscaPolicyTranslator {
         identifierMap.put("datetime-add-yearmonthduration", XACML3.ID_FUNCTION_DATETIME_ADD_YEARMONTHDURATION);
         identifierMap.put("datetime-subtract-daytimeturation", XACML3.ID_FUNCTION_DATETIME_SUBTRACT_DAYTIMEDURATION);
         identifierMap.put("datetime-subtract-yearmonthduration",
-                XACML3.ID_FUNCTION_DATETIME_SUBTRACT_YEARMONTHDURATION);
+            XACML3.ID_FUNCTION_DATETIME_SUBTRACT_YEARMONTHDURATION);
         identifierMap.put("date-add-yearmonthduration", XACML3.ID_FUNCTION_DATE_ADD_YEARMONTHDURATION);
         identifierMap.put("date-subtract-yearmonthduration", XACML3.ID_FUNCTION_DATE_SUBTRACT_YEARMONTHDURATION);
         identifierMap.put("time-greater-than", XACML3.ID_FUNCTION_TIME_GREATER_THAN);
@@ -777,19 +774,19 @@ public class NativePdpApplicationTranslator implements ToscaPolicyTranslator {
         identifierMap.put("hexbinary-set-equals", XACML3.ID_FUNCTION_HEXBINARY_SET_EQUALS);
         identifierMap.put("base64binary-intersection", XACML3.ID_FUNCTION_BASE64BINARY_INTERSECTION);
         identifierMap.put("base64binary-at-least-one-member-of",
-                XACML3.ID_FUNCTION_BASE64BINARY_AT_LEAST_ONE_MEMBER_OF);
+            XACML3.ID_FUNCTION_BASE64BINARY_AT_LEAST_ONE_MEMBER_OF);
         identifierMap.put("base64binary-union", XACML3.ID_FUNCTION_BASE64BINARY_UNION);
         identifierMap.put("base64binary-subset", XACML3.ID_FUNCTION_BASE64BINARY_SUBSET);
         identifierMap.put("base64binary-set-equals", XACML3.ID_FUNCTION_BASE64BINARY_SET_EQUALS);
         identifierMap.put("daytimeduration-intersection", XACML3.ID_FUNCTION_DAYTIMEDURATION_INTERSECTION);
         identifierMap.put("daytimeduration-at-least-one-member-of",
-                XACML3.ID_FUNCTION_DAYTIMEDURATION_AT_LEAST_ONE_MEMBER_OF);
+            XACML3.ID_FUNCTION_DAYTIMEDURATION_AT_LEAST_ONE_MEMBER_OF);
         identifierMap.put("daytimeduration-union", XACML3.ID_FUNCTION_DAYTIMEDURATION_UNION);
         identifierMap.put("daytimeduration-subset", XACML3.ID_FUNCTION_DAYTIMEDURATION_SUBSET);
         identifierMap.put("daytimeduration-set-equals", XACML3.ID_FUNCTION_DAYTIMEDURATION_SET_EQUALS);
         identifierMap.put("yearmonthduration-intersection", XACML3.ID_FUNCTION_YEARMONTHDURATION_INTERSECTION);
         identifierMap.put("yearmonthduration-at-least-one-member-of",
-                XACML3.ID_FUNCTION_YEARMONTHDURATION_AT_LEAST_ONE_MEMBER_OF);
+            XACML3.ID_FUNCTION_YEARMONTHDURATION_AT_LEAST_ONE_MEMBER_OF);
         identifierMap.put("yearmonthduration-union", XACML3.ID_FUNCTION_YEARMONTHDURATION_UNION);
         identifierMap.put("yearmonthduration-subset", XACML3.ID_FUNCTION_YEARMONTHDURATION_SUBSET);
         identifierMap.put("yearmonthduration-set-equals", XACML3.ID_FUNCTION_YEARMONTHDURATION_SET_EQUALS);
index cfb7d93..690ea7e 100644 (file)
@@ -8,9 +8,9 @@
   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.
             <version>${project.version}</version>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>org.onap.policy.common</groupId>
+            <artifactId>policy-endpoints</artifactId>
+            <version>${policy.common.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.policy.common</groupId>
+            <artifactId>utils</artifactId>
+            <version>${policy.common.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.policy.models</groupId>
+            <artifactId>policy-models-decisions</artifactId>
+            <version>${policy.models.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.policy.models</groupId>
+            <artifactId>policy-models-tosca</artifactId>
+            <version>${policy.models.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.att.research.xacml</groupId>
+            <artifactId>xacml</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.google.guava</groupId>
+            <artifactId>guava</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>jakarta.xml.bind</groupId>
+            <artifactId>jakarta.xml.bind-api</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <scope>provided</scope>
+        </dependency>
     </dependencies>
 
 </project>
index f6b0595..b454f31 100644 (file)
     </properties>
 
     <dependencies>
-        <dependency>
-            <groupId>org.onap.policy.common</groupId>
-            <artifactId>capabilities</artifactId>
-            <version>${policy.common.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.onap.policy.common</groupId>
-            <artifactId>policy-endpoints</artifactId>
-            <version>${policy.common.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>commons-cli</groupId>
-            <artifactId>commons-cli</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>com.google.code.gson</groupId>
-            <artifactId>gson</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.onap.policy.common</groupId>
-            <artifactId>common-parameters</artifactId>
-            <version>${policy.common.version}</version>
-        </dependency>
         <dependency>
             <groupId>org.onap.policy.xacml-pdp.applications</groupId>
             <artifactId>common</artifactId>
             <version>${project.version}</version>
         </dependency>
-        <dependency>
-            <groupId>org.onap.policy.common</groupId>
-            <artifactId>utils-test</artifactId>
-            <version>${policy.common.version}</version>
-            <scope>test</scope>
-        </dependency>
         <dependency>
             <groupId>org.onap.policy.xacml-pdp.applications</groupId>
             <artifactId>xacml-monitoring</artifactId>
             <version>${project.version}</version>
+            <scope>runtime</scope>
         </dependency>
         <dependency>
             <groupId>org.onap.policy.xacml-pdp.applications</groupId>
             <artifactId>xacml-guard</artifactId>
             <version>${project.version}</version>
+            <scope>runtime</scope>
         </dependency>
         <dependency>
             <groupId>org.onap.policy.xacml-pdp.applications</groupId>
             <artifactId>xacml-match</artifactId>
             <version>${project.version}</version>
         </dependency>
+        <dependency>
+            <groupId>org.onap.policy.common</groupId>
+            <artifactId>capabilities</artifactId>
+            <version>${policy.common.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.policy.common</groupId>
+            <artifactId>common-parameters</artifactId>
+            <version>${policy.common.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.policy.common</groupId>
+            <artifactId>gson</artifactId>
+            <version>${policy.common.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.policy.common</groupId>
+            <artifactId>message-bus</artifactId>
+            <version>${policy.common.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.policy.common</groupId>
+            <artifactId>policy-endpoints</artifactId>
+            <version>${policy.common.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.policy.common</groupId>
+            <artifactId>utils</artifactId>
+            <version>${policy.common.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.policy.models</groupId>
+            <artifactId>policy-models-base</artifactId>
+            <version>${policy.models.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.policy.models</groupId>
+            <artifactId>policy-models-errors</artifactId>
+            <version>${policy.models.version}</version>
+        </dependency>
         <dependency>
             <groupId>org.onap.policy.models</groupId>
             <artifactId>policy-models-pdp</artifactId>
             <version>${policy.models.version}</version>
         </dependency>
+        <dependency>
+            <groupId>org.onap.policy.models</groupId>
+            <artifactId>policy-models-tosca</artifactId>
+            <version>${policy.models.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.policy.models</groupId>
+            <artifactId>policy-models-decisions</artifactId>
+            <version>${policy.models.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-cli</groupId>
+            <artifactId>commons-cli</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.google.code.gson</groupId>
+            <artifactId>gson</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.att.research.xacml</groupId>
+            <artifactId>xacml</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>io.prometheus</groupId>
+            <artifactId>simpleclient</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>jakarta.validation</groupId>
+            <artifactId>jakarta.validation-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>jakarta.ws.rs</groupId>
+            <artifactId>jakarta.ws.rs-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.eclipse.jetty.toolchain</groupId>
+            <artifactId>jetty-jakarta-servlet-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.glassfish.jersey.core</groupId>
+            <artifactId>jersey-client</artifactId>
+        </dependency>
         <dependency>
             <groupId>io.prometheus</groupId>
             <artifactId>simpleclient_logback</artifactId>
             <artifactId>kafka-clients</artifactId>
             <scope>runtime</scope>
         </dependency>
+        <dependency>
+            <groupId>io.swagger.core.v3</groupId>
+            <artifactId>swagger-annotations</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.glassfish.jersey.media</groupId>
+            <artifactId>jersey-media-json-jackson</artifactId>
+            <version>${version.jersey}</version>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.policy.common</groupId>
+            <artifactId>utils-test</artifactId>
+            <version>${policy.common.version}</version>
+            <scope>test</scope>
+        </dependency>
         <dependency>
             <groupId>org.onap.policy.xacml-pdp</groupId>
             <artifactId>xacml-test</artifactId>
             <scope>test</scope>
         </dependency>
         <dependency>
-            <groupId>org.springframework</groupId>
-            <artifactId>spring-test</artifactId>
+            <groupId>org.mockito</groupId>
+            <artifactId>mockito-core</artifactId>
             <scope>test</scope>
         </dependency>
-        <!-- Swagger v3 annotations -->
-        <dependency>
-            <groupId>io.swagger.core.v3</groupId>
-            <artifactId>swagger-annotations</artifactId>
-        </dependency>
         <dependency>
-            <groupId>org.bouncycastle</groupId>
-            <artifactId>bcpkix-fips</artifactId>
+            <groupId>org.mockito</groupId>
+            <artifactId>mockito-junit-jupiter</artifactId>
+            <scope>test</scope>
         </dependency>
         <dependency>
-            <groupId>org.glassfish.jersey.media</groupId>
-            <artifactId>jersey-media-json-jackson</artifactId>
-            <version>${version.jersey}</version>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-test</artifactId>
+            <scope>test</scope>
         </dependency>
     </dependencies>
 
                             <generateModels>false</generateModels>
                             <generateSupportingFiles>false</generateSupportingFiles>
                             <importMappings>
-                                HealthCheckReport=org.onap.policy.common.endpoints.report.HealthCheckReport,
+                                HealthCheckReport=org.onap.policy.common.utils.report.HealthCheckReport,
                                 DecisionException=org.onap.policy.models.decisions.concepts.DecisionException,
                                 DecisionRequest=org.onap.policy.models.decisions.concepts.DecisionRequest,
                                 DecisionResponse=org.onap.policy.models.decisions.concepts.DecisionResponse,
index 8c1f792..ddd372f 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  * Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 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.
@@ -25,7 +26,7 @@ import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.ScheduledFuture;
 import java.util.concurrent.TimeUnit;
 import lombok.Getter;
-import org.onap.policy.common.endpoints.event.comm.client.BidirectionalTopicClient;
+import org.onap.policy.common.message.bus.event.client.BidirectionalTopicClient;
 import org.onap.policy.common.utils.coder.Coder;
 import org.onap.policy.common.utils.coder.CoderException;
 import org.onap.policy.common.utils.coder.StandardCoder;
@@ -69,7 +70,7 @@ public class XacmlPdpHearbeatPublisher implements Runnable {
      * @param state tracks the state of this PDP
      */
     public XacmlPdpHearbeatPublisher(BidirectionalTopicClient topicChecker, long probeHeartbeatTopicMs,
-                    XacmlState state) {
+                                     XacmlState state) {
         LOGGER.info("heartbeat topic probe {}ms", probeHeartbeatTopicMs);
         this.topicChecker = topicChecker;
         this.probeHeartbeatTopicMs = probeHeartbeatTopicMs;
index d477ed0..abfc637 100644 (file)
@@ -3,6 +3,7 @@
  * ONAP
  * ================================================================================
  * Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 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.
@@ -23,8 +24,8 @@
 package org.onap.policy.pdpx.main.comm;
 
 import lombok.AllArgsConstructor;
-import org.onap.policy.common.endpoints.event.comm.client.TopicSinkClient;
-import org.onap.policy.common.endpoints.event.comm.client.TopicSinkClientException;
+import org.onap.policy.common.message.bus.event.client.TopicSinkClient;
+import org.onap.policy.common.message.bus.event.client.TopicSinkClientException;
 import org.onap.policy.models.pdp.concepts.PdpStatus;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -37,6 +38,7 @@ public class XacmlPdpPapRegistration {
 
     /**
      * Sends PDP register and unregister message to the PAP.
+     *
      * @param status of the PDP
      * @throws TopicSinkClientException if the topic sink does not exist
      */
index b6801d8..08879d4 100644 (file)
@@ -28,7 +28,7 @@ import java.util.Map;
 import java.util.Optional;
 import java.util.stream.Collectors;
 import lombok.AllArgsConstructor;
-import org.onap.policy.common.endpoints.event.comm.client.TopicSinkClient;
+import org.onap.policy.common.message.bus.event.client.TopicSinkClient;
 import org.onap.policy.models.pdp.concepts.PdpStatus;
 import org.onap.policy.models.pdp.concepts.PdpUpdate;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
@@ -63,12 +63,12 @@ public class XacmlPdpUpdatePublisher {
         // incoming data
         Map<ToscaConceptIdentifier, ToscaPolicy> toBeDeployedPolicies = policyToMap(message.getPoliciesToBeDeployed());
         List<ToscaConceptIdentifier> toBeUndeployedIds =
-                        Optional.ofNullable(message.getPoliciesToBeUndeployed()).orElse(Collections.emptyList());
+            Optional.ofNullable(message.getPoliciesToBeUndeployed()).orElse(Collections.emptyList());
 
         var stats = XacmlPdpStatisticsManager.getCurrent();
 
         // Undeploy policies
-        for (ToscaConceptIdentifier policyId: toBeUndeployedIds) {
+        for (ToscaConceptIdentifier policyId : toBeUndeployedIds) {
             ToscaPolicy policy = deployedPolicies.get(policyId);
             if (policy == null) {
                 LOGGER.warn("attempt to undeploy policy that has not been previously deployed: {}", policyId);
index 98f6d0e..a676a04 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 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.
 
 package org.onap.policy.pdpx.main.comm.listeners;
 
-import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
-import org.onap.policy.common.endpoints.event.comm.client.TopicSinkClient;
-import org.onap.policy.common.endpoints.event.comm.client.TopicSinkClientException;
 import org.onap.policy.common.endpoints.listeners.ScoListener;
+import org.onap.policy.common.message.bus.event.Topic.CommInfrastructure;
+import org.onap.policy.common.message.bus.event.client.TopicSinkClient;
+import org.onap.policy.common.message.bus.event.client.TopicSinkClientException;
 import org.onap.policy.common.utils.coder.StandardCoderObject;
 import org.onap.policy.models.pdp.concepts.PdpStateChange;
 import org.onap.policy.models.pdp.concepts.PdpStatus;
@@ -43,7 +44,7 @@ public class XacmlPdpStateChangeListener extends ScoListener<PdpStateChange> {
      * Constructs the object.
      *
      * @param client used to send back response after receiving state change message
-     * @param state tracks the state of this PDP
+     * @param state  tracks the state of this PDP
      */
     public XacmlPdpStateChangeListener(TopicSinkClient client, XacmlState state) {
         super(PdpStateChange.class);
index 1e275c1..8efc2bc 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 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.
@@ -20,9 +21,9 @@
 
 package org.onap.policy.pdpx.main.comm.listeners;
 
-import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
-import org.onap.policy.common.endpoints.event.comm.client.TopicSinkClient;
 import org.onap.policy.common.endpoints.listeners.ScoListener;
+import org.onap.policy.common.message.bus.event.Topic.CommInfrastructure;
+import org.onap.policy.common.message.bus.event.client.TopicSinkClient;
 import org.onap.policy.common.utils.coder.StandardCoderObject;
 import org.onap.policy.models.pdp.concepts.PdpUpdate;
 import org.onap.policy.pdpx.main.XacmlState;
@@ -45,13 +46,13 @@ public class XacmlPdpUpdateListener extends ScoListener<PdpUpdate> {
     /**
      * Constructs the object.
      *
-     * @param client used to send back response after receiving state change message
-     * @param state tracks the state of this PDP
-     * @param heartbeat heart beat publisher
+     * @param client     used to send back response after receiving state change message
+     * @param state      tracks the state of this PDP
+     * @param heartbeat  heart beat publisher
      * @param appManager application manager
      */
     public XacmlPdpUpdateListener(TopicSinkClient client, XacmlState state, XacmlPdpHearbeatPublisher heartbeat,
-                    XacmlPdpApplicationManager appManager) {
+                                  XacmlPdpApplicationManager appManager) {
         super(PdpUpdate.class);
         this.state = state;
         this.heartbeat = heartbeat;
@@ -79,7 +80,7 @@ public class XacmlPdpUpdateListener extends ScoListener<PdpUpdate> {
 
     // these may be overridden by junit tests
     protected XacmlPdpUpdatePublisher makePublisher(TopicSinkClient client, XacmlState state,
-                    XacmlPdpApplicationManager appManager) {
+                                                    XacmlPdpApplicationManager appManager) {
 
         return new XacmlPdpUpdatePublisher(client, state, appManager);
     }
index a9332e9..424b596 100644 (file)
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  * Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019 Nordix Foundation.
+ * Modifications 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.
@@ -24,9 +24,6 @@ package org.onap.policy.pdpx.main.parameters;
 import lombok.Getter;
 import lombok.NoArgsConstructor;
 import org.apache.commons.lang3.StringUtils;
-import org.onap.policy.common.endpoints.parameters.RestClientParameters;
-import org.onap.policy.common.endpoints.parameters.RestServerParameters;
-import org.onap.policy.common.endpoints.parameters.TopicParameterGroup;
 import org.onap.policy.common.parameters.BeanValidationResult;
 import org.onap.policy.common.parameters.ParameterGroupImpl;
 import org.onap.policy.common.parameters.ValidationStatus;
@@ -34,11 +31,13 @@ import org.onap.policy.common.parameters.annotations.Min;
 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.RestClientParameters;
+import org.onap.policy.common.parameters.rest.RestServerParameters;
+import org.onap.policy.common.parameters.topic.TopicParameterGroup;
 import org.onap.policy.models.base.Validated;
 
 /**
  * Class to hold all parameters needed for xacml pdp component.
- *
  */
 @Getter
 @NotNull
@@ -68,12 +67,14 @@ public class XacmlPdpParameterGroup extends ParameterGroupImpl {
     /**
      * Create the xacml pdp parameter group.
      *
-     * @param name the parameter group name
+     * @param name     the parameter group name
      * @param pdpGroup the pdp group name
      */
     public XacmlPdpParameterGroup(final String name, final String pdpGroup, final String pdpType,
-            final RestServerParameters restServerParameters, final RestClientParameters policyApiParameters,
-            final TopicParameterGroup topicParameterGroup, final XacmlApplicationParameters applicationParameters) {
+                                  final RestServerParameters restServerParameters,
+                                  final RestClientParameters policyApiParameters,
+                                  final TopicParameterGroup topicParameterGroup,
+                                  final XacmlApplicationParameters applicationParameters) {
         super(name);
         this.pdpGroup = pdpGroup;
         this.pdpType = pdpType;
index 649a642..69f566b 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  * Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 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 +22,8 @@
 package org.onap.policy.pdpx.main.parameters;
 
 import java.io.File;
-import org.onap.policy.common.endpoints.parameters.RestClientParameters;
 import org.onap.policy.common.parameters.ValidationResult;
+import org.onap.policy.common.parameters.rest.RestClientParameters;
 import org.onap.policy.common.utils.coder.Coder;
 import org.onap.policy.common.utils.coder.StandardCoder;
 import org.onap.policy.pdpx.main.PolicyXacmlPdpException;
@@ -31,7 +32,6 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 
-
 /**
  * This class handles reading, parsing and validating of policy xacml pdp parameters from JSON
  * files.
@@ -48,16 +48,16 @@ public class XacmlPdpParameterHandler {
      * @throws PolicyXacmlPdpException on parameter exceptions
      */
     public XacmlPdpParameterGroup getParameters(final XacmlPdpCommandLineArguments arguments)
-            throws PolicyXacmlPdpException {
+        throws PolicyXacmlPdpException {
         XacmlPdpParameterGroup xacmlPdpParameterGroup = null;
 
         try {
             // Read the parameters from JSON
             xacmlPdpParameterGroup = CODER.decode(new File(arguments.getFullConfigurationFilePath()),
-                    XacmlPdpParameterGroup.class);
+                XacmlPdpParameterGroup.class);
         } catch (final Exception e) {
             final String errorMessage = "error reading parameters from \"" + arguments.getConfigurationFilePath()
-                    + "\"\n" + "(" + e.getClass().getSimpleName() + "):" + e.getMessage();
+                + "\"\n" + "(" + e.getClass().getSimpleName() + "):" + e.getMessage();
             LOGGER.error(errorMessage);
             throw new PolicyXacmlPdpException(errorMessage, e);
         }
@@ -77,7 +77,7 @@ public class XacmlPdpParameterHandler {
         final ValidationResult validationResult = xacmlPdpParameterGroup.validate();
         if (!validationResult.isValid()) {
             String returnMessage =
-                    "validation error(s) on parameters from \"" + arguments.getConfigurationFilePath() + "\"\n";
+                "validation error(s) on parameters from \"" + arguments.getConfigurationFilePath() + "\"\n";
             returnMessage += validationResult.getResult();
 
             LOGGER.error(returnMessage);
index 01c4997..8480637 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  * Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 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.
 
 package org.onap.policy.pdpx.main.rest.provider;
 
-import org.onap.policy.common.endpoints.report.HealthCheckReport;
+import org.onap.policy.common.utils.report.HealthCheckReport;
 import org.onap.policy.pdpx.main.XacmlState;
 import org.onap.policy.pdpx.main.startstop.XacmlPdpActivator;
 
 /**
  * Class to fetch health check of xacml pdp service.
- *
  */
 public class HealthCheckProvider {
 
index d62b6f4..ed944a7 100644 (file)
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  * Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2023 Nordix Foundation.
+ * Modifications Copyright (C) 2023-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.
@@ -24,16 +24,16 @@ package org.onap.policy.pdpx.main.startstop;
 import java.util.List;
 import lombok.Getter;
 import lombok.Setter;
-import org.onap.policy.common.endpoints.event.comm.TopicEndpointManager;
-import org.onap.policy.common.endpoints.event.comm.client.BidirectionalTopicClient;
-import org.onap.policy.common.endpoints.event.comm.client.BidirectionalTopicClientException;
-import org.onap.policy.common.endpoints.event.comm.client.TopicSinkClient;
 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.listeners.MessageTypeDispatcher;
-import org.onap.policy.common.endpoints.parameters.RestClientParameters;
+import org.onap.policy.common.message.bus.event.TopicEndpointManager;
+import org.onap.policy.common.message.bus.event.client.BidirectionalTopicClient;
+import org.onap.policy.common.message.bus.event.client.BidirectionalTopicClientException;
+import org.onap.policy.common.message.bus.event.client.TopicSinkClient;
 import org.onap.policy.common.parameters.ParameterService;
+import org.onap.policy.common.parameters.rest.RestClientParameters;
 import org.onap.policy.common.utils.services.ServiceManagerContainer;
 import org.onap.policy.models.pdp.concepts.PdpStatus;
 import org.onap.policy.models.pdp.enums.PdpMessageType;
@@ -101,7 +101,7 @@ public class XacmlPdpActivator extends ServiceManagerContainer {
             HttpClient apiClient = HttpClientFactoryInstance.getClientFactory().build(apiClientParams);
 
             var appmgr = new XacmlPdpApplicationManager(xacmlPdpParameterGroup.getApplicationParameters(),
-                                            apiClient);
+                apiClient);
             XacmlPdpApplicationManager.setCurrent(appmgr);
 
             var stats = new XacmlPdpStatisticsManager();
@@ -118,21 +118,21 @@ public class XacmlPdpActivator extends ServiceManagerContainer {
             sinkClient = new TopicSinkClient(topicClient.getSink());
 
             heartbeat = new XacmlPdpHearbeatPublisher(topicClient,
-                            xacmlPdpParameterGroup.getProbeHeartbeatTopicSec() * 1000, state);
+                xacmlPdpParameterGroup.getProbeHeartbeatTopicSec() * 1000, state);
 
             /*
              * since the dispatcher isn't registered with the topic yet, we can go ahead
              * and register the listeners with it.
              */
             msgDispatcher.register(PdpMessageType.PDP_STATE_CHANGE.name(),
-                            new XacmlPdpStateChangeListener(sinkClient, state));
+                new XacmlPdpStateChangeListener(sinkClient, state));
             msgDispatcher.register(PdpMessageType.PDP_UPDATE.name(),
-                            new XacmlPdpUpdateListener(sinkClient, state, heartbeat, appmgr));
+                new XacmlPdpUpdateListener(sinkClient, state, heartbeat, appmgr));
 
             XacmlPdpServiceFilter.disableApi();
 
             restServer = new XacmlPdpRestServer(xacmlPdpParameterGroup.getRestServerParameters(),
-                                List.of(XacmlPdpServiceFilter.class), List.of(XacmlPdpRestController.class));
+                List.of(XacmlPdpServiceFilter.class), List.of(XacmlPdpRestController.class));
 
         } catch (RuntimeException | HttpClientConfigException | BidirectionalTopicClientException e) {
             throw new PolicyXacmlPdpRuntimeException(e.getMessage(), e);
index 33cf893..1717c5c 100644 (file)
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  * Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2023 Nordix Foundation.
+ * Modifications Copyright (C) 2023-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.
@@ -28,9 +28,9 @@ import org.onap.policy.common.endpoints.http.server.JsonExceptionMapper;
 import org.onap.policy.common.endpoints.http.server.RestServer;
 import org.onap.policy.common.endpoints.http.server.YamlExceptionMapper;
 import org.onap.policy.common.endpoints.http.server.YamlMessageBodyHandler;
-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.parameters.rest.RestServerParameters;
 import org.onap.policy.pdpx.main.rest.serialization.XacmlJsonExceptionMapper;
 import org.onap.policy.pdpx.main.rest.serialization.XacmlJsonMessageBodyHandler;
 import org.onap.policy.pdpx.main.rest.serialization.XacmlXmlExceptionMapper;
index d2baff2..24c3d23 100644 (file)
@@ -30,10 +30,10 @@ import jakarta.ws.rs.client.WebTarget;
 import jakarta.ws.rs.core.MediaType;
 import java.io.File;
 import java.io.IOException;
-import java.nio.charset.StandardCharsets;
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.security.SecureRandom;
+import java.util.Objects;
 import java.util.concurrent.atomic.AtomicBoolean;
 import javax.net.ssl.SSLContext;
 import org.glassfish.jersey.client.authentication.HttpAuthenticationFeature;
@@ -90,7 +90,7 @@ public class CommonRest {
     static {
         try {
             File file = new File(ResourceUtils.getFilePath4Resource("parameters/XacmlPdpConfigParameters_Std.json"));
-            STD_CONFIG = new String(Files.readAllBytes(file.toPath()), StandardCharsets.UTF_8);
+            STD_CONFIG = Files.readString(file.toPath());
 
             file = new File(file.getParentFile(), "Test_XacmlPdpConfigParameters.json");
             file.deleteOnExit();
@@ -165,16 +165,14 @@ public class CommonRest {
      * Writes a JSON config file, substituting an allocated port number for occurrences of
      * "${port}".
      *
-     * @return the allocated server port
      * @throws IOException if the config file cannot be created
      */
-    public static int writeJsonConfig() throws IOException {
+    public static void writeJsonConfig() throws IOException {
         port = NetworkUtil.allocPort();
 
         String config = STD_CONFIG.replace("${port}", String.valueOf(port));
-        Files.write(CONFIG_PATH, config.getBytes(StandardCharsets.UTF_8));
+        Files.writeString(CONFIG_PATH, config);
 
-        return port;
     }
 
     /**
@@ -191,7 +189,7 @@ public class CommonRest {
 
         // always trust the host name
         final ClientBuilder clientBuilder =
-                        ClientBuilder.newBuilder().sslContext(sc).hostnameVerifier((host, session) -> true);
+            ClientBuilder.newBuilder().sslContext(sc).hostnameVerifier((host, session) -> true);
 
         final Client client = clientBuilder.build();
         final HttpAuthenticationFeature feature = HttpAuthenticationFeature.basic("healthcheck", "zb!XztG34");
@@ -216,7 +214,8 @@ public class CommonRest {
      */
     private void markActivator(boolean newAlive) {
         Object manager = ReflectionTestUtils.getField(XacmlPdpActivator.getCurrent(), "serviceManager");
-        AtomicBoolean running = (AtomicBoolean) ReflectionTestUtils.getField(manager, "running");
-        running.set(newAlive);
+        AtomicBoolean running = (AtomicBoolean) ReflectionTestUtils
+            .getField(Objects.requireNonNull(manager), "running");
+        Objects.requireNonNull(running).set(newAlive);
     }
 }
@@ -43,14 +43,14 @@ import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.ExtendWith;
 import org.mockito.Mock;
 import org.mockito.junit.jupiter.MockitoExtension;
-import org.onap.policy.common.endpoints.event.comm.TopicSink;
-import org.onap.policy.common.endpoints.event.comm.client.BidirectionalTopicClient;
+import org.onap.policy.common.message.bus.event.TopicSink;
+import org.onap.policy.common.message.bus.event.client.BidirectionalTopicClient;
 import org.onap.policy.common.utils.coder.CoderException;
 import org.onap.policy.models.pdp.concepts.PdpStatus;
 import org.onap.policy.pdpx.main.XacmlState;
 
 @ExtendWith(MockitoExtension.class)
-class XacmlPdpHearbeatPublisherTest {
+class XacmlPdpHeartbeatPublisherTest {
 
     private static final long INTERVAL1 = 1000L;
     private static final long INTERVAL2 = 2000L;
index 3d3ed86..1293420 100644 (file)
@@ -29,7 +29,7 @@ import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.ExtendWith;
 import org.mockito.Mock;
 import org.mockito.junit.jupiter.MockitoExtension;
-import org.onap.policy.common.endpoints.event.comm.client.TopicSinkClient;
+import org.onap.policy.common.message.bus.event.client.TopicSinkClient;
 import org.onap.policy.models.pdp.concepts.PdpStatus;
 
 @ExtendWith(MockitoExtension.class)
index 0a10eb7..914654b 100644 (file)
@@ -36,7 +36,7 @@ import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.ExtendWith;
 import org.mockito.Mock;
 import org.mockito.junit.jupiter.MockitoExtension;
-import org.onap.policy.common.endpoints.event.comm.client.TopicSinkClient;
+import org.onap.policy.common.message.bus.event.client.TopicSinkClient;
 import org.onap.policy.models.pdp.concepts.PdpStatus;
 import org.onap.policy.models.pdp.concepts.PdpUpdate;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
index f646ef2..8d802be 100644 (file)
@@ -31,8 +31,8 @@ import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.ExtendWith;
 import org.mockito.Mock;
 import org.mockito.junit.jupiter.MockitoExtension;
-import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
-import org.onap.policy.common.endpoints.event.comm.client.TopicSinkClient;
+import org.onap.policy.common.message.bus.event.Topic.CommInfrastructure;
+import org.onap.policy.common.message.bus.event.client.TopicSinkClient;
 import org.onap.policy.models.pdp.concepts.PdpStateChange;
 import org.onap.policy.models.pdp.concepts.PdpStatus;
 import org.onap.policy.pdpx.main.XacmlState;
index 7d23b74..afb8b1a 100644 (file)
@@ -33,8 +33,8 @@ import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.ExtendWith;
 import org.mockito.Mock;
 import org.mockito.junit.jupiter.MockitoExtension;
-import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
-import org.onap.policy.common.endpoints.event.comm.client.TopicSinkClient;
+import org.onap.policy.common.message.bus.event.Topic.CommInfrastructure;
+import org.onap.policy.common.message.bus.event.client.TopicSinkClient;
 import org.onap.policy.models.pdp.concepts.PdpUpdate;
 import org.onap.policy.pdpx.main.XacmlState;
 import org.onap.policy.pdpx.main.comm.XacmlPdpHearbeatPublisher;
index ef338cd..17f08b3 100644 (file)
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  * Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019, 2023 Nordix Foundation.
+ * Modifications Copyright (C) 2019, 2023-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.
@@ -24,14 +24,13 @@ package org.onap.policy.pdpx.main.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.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;
 
 /**
  * Class to hold/create all parameters for test cases.
- *
  */
 public class CommonTestData {
 
@@ -114,7 +113,7 @@ public class CommonTestData {
      * Converts the contents of a map to a parameter class.
      *
      * @param source property map
-     * @param clazz class of object to be created from the map
+     * @param clazz  class of object to be created from the map
      * @return a new object represented by the map
      */
     public <T> T toObject(final Map<String, Object> source, final Class<T> clazz) {
@@ -165,13 +164,13 @@ public class CommonTestData {
     /**
      * Returns a property map for a XacmlApplicationParameters map for test cases.
      *
-     * @param isEmpty boolean value to represent that object created should be empty or not
-     * @param tempPath Application Path string
+     * @param isEmpty    boolean value to represent that object created should be empty or not
+     * @param tempPath   Application Path string
      * @param exclusions An optional list of application classnames for exclusion
      * @return a property map suitable for constructing an object
      */
     public Map<String, Object> getXacmlapplicationParametersMap(boolean isEmpty, String tempPath,
-            String... exclusions) {
+                                                                String... exclusions) {
         final Map<String, Object> map = new TreeMap<>();
         if (!isEmpty) {
             map.put("applicationPath", tempPath);
index 614f9be..ff1c600 100644 (file)
@@ -33,10 +33,10 @@ import java.nio.file.Path;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.io.TempDir;
-import org.onap.policy.common.endpoints.parameters.RestClientParameters;
-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.RestClientParameters;
+import org.onap.policy.common.parameters.rest.RestServerParameters;
+import org.onap.policy.common.parameters.topic.TopicParameterGroup;
 
 /**
  * Class to perform unit test of XacmlPdpParameterGroup.
index 5bfc437..0894cca 100644 (file)
@@ -42,15 +42,16 @@ import java.util.HashMap;
 import java.util.Map;
 import java.util.Properties;
 import java.util.ServiceLoader;
+import java.util.stream.Stream;
 import org.junit.jupiter.api.AfterAll;
 import org.junit.jupiter.api.BeforeAll;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.io.TempDir;
 import org.onap.policy.common.endpoints.http.client.HttpClient;
 import org.onap.policy.common.endpoints.http.client.internal.JerseyClient;
-import org.onap.policy.common.endpoints.parameters.RestClientParameters;
-import org.onap.policy.common.endpoints.parameters.RestServerParameters;
-import org.onap.policy.common.endpoints.parameters.TopicParameterGroup;
+import org.onap.policy.common.parameters.rest.RestClientParameters;
+import org.onap.policy.common.parameters.rest.RestServerParameters;
+import org.onap.policy.common.parameters.topic.TopicParameterGroup;
 import org.onap.policy.common.utils.coder.StandardCoder;
 import org.onap.policy.common.utils.network.NetworkUtil;
 import org.onap.policy.models.decisions.concepts.DecisionRequest;
@@ -79,7 +80,6 @@ class TestAbbreviateDecisionResults {
     private static final CommonTestData testData = new CommonTestData();
 
     private static final Properties properties = new Properties();
-    private static File propertiesFile;
     private static XacmlApplicationServiceProvider service;
 
     @TempDir
@@ -99,7 +99,10 @@ class TestAbbreviateDecisionResults {
         //
         Path src = Paths.get("src/test/resources/apps");
         File apps = appsFolder.resolve("apps").toFile();
-        Files.walk(src).forEach(source -> copy(source, apps.toPath().resolve(src.relativize(source))));
+
+        try (Stream<Path> sources = Files.walk(src)) {
+            sources.forEach(source -> copy(source, apps.toPath().resolve(src.relativize(source))));
+        }
 
         // Start the Monitoring Application
         startXacmlApplicationService(apps);
@@ -243,13 +246,14 @@ class TestAbbreviateDecisionResults {
         throws XacmlApplicationException, IOException {
         LOGGER.info("****** Starting Xacml Application Service ******");
         //
-        // Setup our temporary folder
+        // Set up our temporary folder
         //
         XacmlPolicyUtils.FileCreator myCreator = (String filename) -> {
-            new File(apps, "monitoring/" + filename).delete();
+            var deleted = new File(apps, "monitoring/" + filename).delete();
+            LOGGER.info("was file deleted? {}", deleted);
             return appsFolder.resolve("apps/monitoring/" + filename).toFile();
         };
-        propertiesFile = XacmlPolicyUtils.copyXacmlPropertiesContents(
+        File propertiesFile = XacmlPolicyUtils.copyXacmlPropertiesContents(
             "../applications/monitoring/src/test/resources/xacml.properties", properties, myCreator);
         //
         // Load XacmlApplicationServiceProvider service
index 9e2c989..82d5c9f 100644 (file)
@@ -39,6 +39,7 @@ import java.nio.file.StandardCopyOption;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.stream.Stream;
 import org.junit.jupiter.api.AfterAll;
 import org.junit.jupiter.api.BeforeAll;
 import org.junit.jupiter.api.Test;
@@ -46,9 +47,9 @@ import org.junit.jupiter.api.io.TempDir;
 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.RestClientParameters;
-import org.onap.policy.common.endpoints.parameters.RestServerParameters;
-import org.onap.policy.common.endpoints.parameters.TopicParameterGroup;
+import org.onap.policy.common.parameters.rest.RestClientParameters;
+import org.onap.policy.common.parameters.rest.RestServerParameters;
+import org.onap.policy.common.parameters.topic.TopicParameterGroup;
 import org.onap.policy.common.utils.network.NetworkUtil;
 import org.onap.policy.common.utils.resources.ResourceUtils;
 import org.onap.policy.models.decisions.concepts.DecisionRequest;
@@ -95,9 +96,10 @@ class TestDecision {
         //
         Path src = Paths.get("src/test/resources/apps");
         File apps = appsFolder.resolve("apps").toFile();
-        Files.walk(src).forEach(source -> {
-            copy(source, apps.toPath().resolve(src.relativize(source)));
-        });
+
+        try (Stream<Path> sources = Files.walk(src)) {
+            sources.forEach(source -> copy(source, apps.toPath().resolve(src.relativize(source))));
+        }
         //
         // Get the parameters file correct.
         //
index 6be2e7a..2b1e4f0 100644 (file)
@@ -27,7 +27,7 @@ import jakarta.ws.rs.client.Invocation;
 import java.util.HashMap;
 import java.util.Map;
 import org.junit.jupiter.api.Test;
-import org.onap.policy.common.endpoints.report.HealthCheckReport;
+import org.onap.policy.common.utils.report.HealthCheckReport;
 import org.onap.policy.pdpx.main.CommonRest;
 import org.onap.policy.pdpx.main.XacmlState;
 import org.onap.policy.pdpx.main.rest.model.StatisticsReport;
diff --git a/pom.xml b/pom.xml
index 8c8194c..67ef329 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -44,6 +44,7 @@
         <policy.common.version>3.0.1-SNAPSHOT</policy.common.version>
         <policy.models.version>4.0.1-SNAPSHOT</policy.models.version>
         <jacoco.dataFile>${project.basedir}/target/code-coverage/jacoco-ut.exec</jacoco.dataFile>
+        <xacml.version>4.0.0</xacml.version>
     </properties>
 
     <modules>
         <module>tutorials</module>
     </modules>
 
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>com.att.research.xacml</groupId>
+                <artifactId>xacml-pdp</artifactId>
+                <version>${xacml.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>com.att.research.xacml</groupId>
+                <artifactId>xacml</artifactId>
+                <version>${xacml.version}</version>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+
     <dependencies>
         <dependency>
             <groupId>org.junit.jupiter</groupId>
         <dependency>
             <groupId>org.assertj</groupId>
             <artifactId>assertj-core</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.mockito</groupId>
-            <artifactId>mockito-junit-jupiter</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-ext</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-api</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>ch.qos.logback</groupId>
-            <artifactId>logback-core</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>ch.qos.logback</groupId>
-            <artifactId>logback-classic</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.yaml</groupId>
-            <artifactId>snakeyaml</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.projectlombok</groupId>
-            <artifactId>lombok</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.json</groupId>
-            <artifactId>json</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.onap.policy.models</groupId>
-            <artifactId>policy-models-decisions</artifactId>
-            <version>${policy.models.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.onap.policy.models</groupId>
-            <artifactId>policy-models-tosca</artifactId>
-            <version>${policy.models.version}</version>
         </dependency>
     </dependencies>
 
index fa24f25..ca690bd 100644 (file)
@@ -4,7 +4,7 @@
   ================================================================================
   Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
   Modifications Copyright (C) 2020 Bell Canada.
-  Modifications Copyright (C) 2023 Nordix Foundation.
+  Modifications Copyright (C) 2023-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,7 +21,7 @@
   -->
 
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
             <artifactId>policy-models-pap</artifactId>
             <version>${policy.models.version}</version>
         </dependency>
+        <dependency>
+            <groupId>org.onap.policy.models</groupId>
+            <artifactId>policy-models-decisions</artifactId>
+            <version>${policy.models.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.policy.common</groupId>
+            <artifactId>common-parameters</artifactId>
+            <version>${policy.common.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.policy.common</groupId>
+            <artifactId>message-bus</artifactId>
+            <version>${policy.common.version}</version>
+        </dependency>
         <dependency>
             <groupId>org.onap.policy.common</groupId>
             <artifactId>policy-endpoints</artifactId>
             <version>${policy.common.version}</version>
         </dependency>
+        <dependency>
+            <groupId>org.onap.policy.common</groupId>
+            <artifactId>utils</artifactId>
+            <version>${policy.common.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>jakarta.ws.rs</groupId>
+            <artifactId>jakarta.ws.rs-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+        </dependency>
     </dependencies>
+
     <build>
         <plugins>
             <plugin>
index 0697e82..1db5b36 100644 (file)
@@ -27,15 +27,15 @@ import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Scanner;
-import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
-import org.onap.policy.common.endpoints.event.comm.TopicEndpointManager;
-import org.onap.policy.common.endpoints.event.comm.TopicListener;
-import org.onap.policy.common.endpoints.event.comm.bus.internal.BusTopicParams;
 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.TopicParameterGroup;
-import org.onap.policy.common.endpoints.parameters.TopicParameters;
+import org.onap.policy.common.message.bus.event.Topic.CommInfrastructure;
+import org.onap.policy.common.message.bus.event.TopicEndpointManager;
+import org.onap.policy.common.message.bus.event.TopicListener;
+import org.onap.policy.common.parameters.topic.BusTopicParams;
+import org.onap.policy.common.parameters.topic.TopicParameterGroup;
+import org.onap.policy.common.parameters.topic.TopicParameters;
 import org.onap.policy.common.utils.coder.CoderException;
 import org.onap.policy.common.utils.coder.StandardCoder;
 import org.onap.policy.models.decisions.concepts.DecisionRequest;
index bf5f939..0a1d06b 100644 (file)
@@ -3,7 +3,7 @@
   ONAP Policy Engine - XACML Application Tutorial
   ================================================================================
   Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
-  Modifications Copyright (C) 2022-2023 Nordix Foundation.
+  Modifications Copyright (C) 2022-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.
             <version>${project.version}</version>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>org.onap.policy.common</groupId>
+            <artifactId>policy-endpoints</artifactId>
+            <version>${policy.common.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.policy.common</groupId>
+            <artifactId>utils</artifactId>
+            <version>${policy.common.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.policy.models</groupId>
+            <artifactId>policy-models-tosca</artifactId>
+            <version>${policy.models.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.policy.models</groupId>
+            <artifactId>policy-models-decisions</artifactId>
+            <version>${policy.models.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.att.research.xacml</groupId>
+            <artifactId>xacml</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <scope>provided</scope>
+        </dependency>
     </dependencies>
 
     <profiles>
index 2f8fb85..082a82d 100644 (file)
@@ -43,7 +43,6 @@ import org.onap.policy.models.decisions.concepts.DecisionRequest;
 import org.onap.policy.models.decisions.concepts.DecisionResponse;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy;
 import org.onap.policy.pdp.xacml.application.common.ToscaDictionary;
-import org.onap.policy.pdp.xacml.application.common.ToscaPolicyConversionException;
 import org.onap.policy.pdp.xacml.application.common.ToscaPolicyTranslatorUtils;
 import org.onap.policy.pdp.xacml.application.common.std.StdBaseTranslator;
 
index f2131df..638deaa 100644 (file)
@@ -3,7 +3,7 @@
   ONAP
   ================================================================================
   Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
-  Modifications Copyright (C) 2023 Nordix Foundation.
+  Modifications Copyright (C) 2023-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.
             <groupId>org.onap.policy.common</groupId>
             <artifactId>utils</artifactId>
             <version>${policy.common.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.policy.models</groupId>
+            <artifactId>policy-models-tosca</artifactId>
+            <version>${policy.models.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <scope>provided</scope>
         </dependency>
     </dependencies>
 </project>