Java 17 Upgrade 05/136005/1
authoradheli.tavares <adheli.tavares@est.tech>
Thu, 27 Jul 2023 09:12:59 +0000 (10:12 +0100)
committeradheli.tavares <adheli.tavares@est.tech>
Fri, 22 Sep 2023 11:58:53 +0000 (12:58 +0100)
Issue-ID: POLICY-4669
Change-Id: I0157ae0ea7151658308c7e6d429098f16824c190
Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
205 files changed:
models-base/pom.xml
models-base/src/main/java/org/onap/policy/models/base/PfConcept.java
models-base/src/main/java/org/onap/policy/models/base/PfConceptContainer.java
models-base/src/main/java/org/onap/policy/models/base/PfConceptKey.java
models-base/src/main/java/org/onap/policy/models/base/PfKey.java
models-base/src/main/java/org/onap/policy/models/base/PfKeyImpl.java
models-base/src/main/java/org/onap/policy/models/base/PfKeyUse.java
models-base/src/main/java/org/onap/policy/models/base/PfModel.java
models-base/src/main/java/org/onap/policy/models/base/PfModelException.java
models-base/src/main/java/org/onap/policy/models/base/PfModelRuntimeException.java
models-base/src/main/java/org/onap/policy/models/base/PfModelService.java
models-base/src/main/java/org/onap/policy/models/base/PfReferenceKey.java
models-base/src/main/java/org/onap/policy/models/base/PfReferenceTimestampKey.java
models-base/src/main/java/org/onap/policy/models/base/PfSearchableKey.java
models-base/src/main/java/org/onap/policy/models/base/PfTimestampKey.java
models-base/src/main/java/org/onap/policy/models/base/PfUtils.java
models-base/src/main/java/org/onap/policy/models/base/PfValidator.java
models-base/src/test/java/org/onap/policy/models/base/ExceptionsTest.java
models-base/src/test/java/org/onap/policy/models/base/PfConceptContainerTest.java
models-base/src/test/java/org/onap/policy/models/base/PfModelExceptionInfoTest.java
models-base/src/test/java/org/onap/policy/models/base/PfValidatorTest.java
models-base/src/test/java/org/onap/policy/models/base/testconcepts/DummyPfConcept.java
models-base/src/test/java/org/onap/policy/models/base/testconcepts/DummyPfConceptKeySub.java
models-base/src/test/java/org/onap/policy/models/base/testconcepts/DummyPfConceptSub.java
models-base/src/test/java/org/onap/policy/models/base/testconcepts/DummyPfKey.java
models-dao/pom.xml
models-dao/src/main/java/org/onap/policy/models/dao/PfDaoFactory.java
models-dao/src/main/java/org/onap/policy/models/dao/PfFilter.java
models-dao/src/main/java/org/onap/policy/models/dao/converters/CDataConditioner.java
models-dao/src/main/java/org/onap/policy/models/dao/converters/Uuid2String.java
models-dao/src/main/java/org/onap/policy/models/dao/impl/DefaultPfDao.java
models-dao/src/main/java/org/onap/policy/models/dao/impl/ProxyDao.java
models-dao/src/test/java/org/onap/policy/models/dao/DummyConceptEntity.java
models-dao/src/test/java/org/onap/policy/models/dao/DummyReferenceEntity.java
models-dao/src/test/java/org/onap/policy/models/dao/DummyReferenceTimestampEntity.java
models-dao/src/test/java/org/onap/policy/models/dao/DummyTimestampEntity.java
models-decisions/pom.xml
models-decisions/src/main/java/org/onap/policy/models/decisions/concepts/DecisionException.java
models-errors/pom.xml
models-errors/src/main/java/org/onap/policy/models/errors/concepts/ErrorResponse.java
models-errors/src/test/java/org/onap/policy/models/errors/concepts/ErrorResponseTest.java
models-examples/pom.xml
models-interactions/model-actors/actor.a1p/pom.xml
models-interactions/model-actors/actor.aai/pom.xml
models-interactions/model-actors/actor.aai/src/main/java/org/onap/policy/controlloop/actor/aai/AaiCustomQueryOperation.java
models-interactions/model-actors/actor.aai/src/main/java/org/onap/policy/controlloop/actor/aai/AaiGetOperation.java
models-interactions/model-actors/actor.aai/src/main/java/org/onap/policy/controlloop/actor/aai/AaiGetPnfOperation.java
models-interactions/model-actors/actor.aai/src/main/java/org/onap/policy/controlloop/actor/aai/AaiGetTenantOperation.java
models-interactions/model-actors/actor.aai/src/main/java/org/onap/policy/controlloop/actor/aai/AaiUtil.java
models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiCustomQueryOperationTest.java
models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiGetOperationTest.java
models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiGetPnfOperationTest.java
models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiGetTenantOperationTest.java
models-interactions/model-actors/actor.appc/pom.xml
models-interactions/model-actors/actor.appclcm/pom.xml
models-interactions/model-actors/actor.cds/pom.xml
models-interactions/model-actors/actor.sdnc/pom.xml
models-interactions/model-actors/actor.sdnc/src/main/java/org/onap/policy/controlloop/actor/sdnc/SdncOperation.java
models-interactions/model-actors/actor.sdnc/src/test/java/org/onap/policy/controlloop/actor/sdnc/BasicSdncOperation.java
models-interactions/model-actors/actor.sdnr/pom.xml
models-interactions/model-actors/actor.so/pom.xml
models-interactions/model-actors/actor.so/src/main/java/org/onap/policy/controlloop/actor/so/ModifyCll.java
models-interactions/model-actors/actor.so/src/main/java/org/onap/policy/controlloop/actor/so/ModifyNssi.java
models-interactions/model-actors/actor.so/src/main/java/org/onap/policy/controlloop/actor/so/RestManagerResponse.java
models-interactions/model-actors/actor.so/src/main/java/org/onap/policy/controlloop/actor/so/SoOperation.java
models-interactions/model-actors/actor.so/src/main/java/org/onap/policy/controlloop/actor/so/VfModuleCreate.java
models-interactions/model-actors/actor.so/src/main/java/org/onap/policy/controlloop/actor/so/VfModuleDelete.java
models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/RestManagerResponseTest.java
models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/VfModuleDeleteTest.java
models-interactions/model-actors/actor.test/pom.xml
models-interactions/model-actors/actor.test/src/main/java/org/onap/policy/controlloop/actor/test/BasicHttpOperation.java
models-interactions/model-actors/actor.test/src/test/java/org/onap/policy/controlloop/actor/test/BasicHttpOperationTest.java
models-interactions/model-actors/actor.vfc/pom.xml
models-interactions/model-actors/actor.vfc/src/main/java/org/onap/policy/controlloop/actor/vfc/Restart.java
models-interactions/model-actors/actor.vfc/src/main/java/org/onap/policy/controlloop/actor/vfc/VfcOperation.java
models-interactions/model-actors/actor.xacml/pom.xml
models-interactions/model-actors/actor.xacml/src/main/java/org/onap/policy/controlloop/actor/xacml/ConfigureOperation.java
models-interactions/model-actors/actor.xacml/src/main/java/org/onap/policy/controlloop/actor/xacml/DecisionOperation.java
models-interactions/model-actors/actor.xacml/src/main/java/org/onap/policy/controlloop/actor/xacml/GuardOperation.java
models-interactions/model-actors/actorServiceProvider/pom.xml
models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/HttpActor.java
models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/HttpOperation.java
models-interactions/model-actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/impl/HttpOperationTest.java
models-interactions/model-actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/impl/HttpPollingOperationTest.java
models-interactions/model-actors/pom.xml
models-interactions/model-impl/aai/pom.xml
models-interactions/model-impl/appc/pom.xml
models-interactions/model-impl/appclcm/pom.xml
models-interactions/model-impl/cds/pom.xml
models-interactions/model-impl/events/pom.xml
models-interactions/model-impl/guard/pom.xml
models-interactions/model-impl/guard/src/main/java/org/onap/policy/guard/OperationsHistory.java
models-interactions/model-impl/pom.xml
models-interactions/model-impl/rest/pom.xml
models-interactions/model-impl/rest/src/main/java/org/onap/policy/rest/RestManager.java
models-interactions/model-impl/rest/src/test/java/org/onap/policy/rest/RestTest.java
models-interactions/model-impl/sdnc/pom.xml
models-interactions/model-impl/sdnr/pom.xml
models-interactions/model-impl/so/pom.xml
models-interactions/model-impl/vfc/pom.xml
models-interactions/model-simulators/pom.xml
models-interactions/model-simulators/src/main/java/org/onap/policy/simulators/AaiSimulatorJaxRs.java
models-interactions/model-simulators/src/main/java/org/onap/policy/simulators/SdncSimulatorJaxRs.java
models-interactions/model-simulators/src/main/java/org/onap/policy/simulators/SimulatorRuntimeException.java
models-interactions/model-simulators/src/main/java/org/onap/policy/simulators/SoSimulatorJaxRs.java
models-interactions/model-simulators/src/main/java/org/onap/policy/simulators/Util.java
models-interactions/model-simulators/src/main/java/org/onap/policy/simulators/VfcSimulatorJaxRs.java
models-interactions/model-simulators/src/main/java/org/onap/policy/simulators/XacmlSimulatorJaxRs.java
models-interactions/model-simulators/src/test/java/org/onap/policy/simulators/AaiSimulatorTest.java
models-interactions/model-simulators/src/test/java/org/onap/policy/simulators/CdsSimulatorTest.java
models-interactions/model-simulators/src/test/java/org/onap/policy/simulators/DmaapSimulatorTest.java
models-interactions/model-simulators/src/test/java/org/onap/policy/simulators/SoSimulatorTest.java
models-interactions/model-simulators/src/test/java/org/onap/policy/simulators/VfcSimulatorTest.java
models-interactions/model-simulators/src/test/java/org/onap/policy/simulators/XacmlSimulatorTest.java
models-interactions/pom.xml
models-pap/pom.xml
models-pap/src/main/java/org/onap/policy/models/pap/persistence/concepts/JpaPolicyAudit.java
models-pdp/pom.xml
models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/PdpEngineWorkerStatistics.java
models-pdp/src/main/java/org/onap/policy/models/pdp/persistence/concepts/JpaPdp.java
models-pdp/src/main/java/org/onap/policy/models/pdp/persistence/concepts/JpaPdpGroup.java
models-pdp/src/main/java/org/onap/policy/models/pdp/persistence/concepts/JpaPdpPolicyStatus.java
models-pdp/src/main/java/org/onap/policy/models/pdp/persistence/concepts/JpaPdpSubGroup.java
models-pdp/src/main/java/org/onap/policy/models/pdp/persistence/provider/PdpProvider.java
models-provider/pom.xml
models-provider/src/main/java/org/onap/policy/models/provider/PolicyModelsProviderFactory.java
models-provider/src/main/java/org/onap/policy/models/provider/impl/AbstractModelsProvider.java
models-provider/src/main/java/org/onap/policy/models/provider/impl/AbstractPolicyModelsProvider.java
models-provider/src/main/java/org/onap/policy/models/provider/impl/DatabasePolicyModelsProviderImpl.java
models-provider/src/main/java/org/onap/policy/models/provider/impl/ModelsProvider.java
models-provider/src/test/java/org/onap/policy/models/provider/impl/DummyBadProviderImpl.java
models-provider/src/test/java/org/onap/policy/models/provider/impl/DummyPolicyModelsProviderImpl.java
models-sim/models-sim-dmaap/pom.xml
models-sim/models-sim-dmaap/src/main/java/org/onap/policy/models/sim/dmaap/provider/DmaapSimProvider.java
models-sim/models-sim-dmaap/src/main/java/org/onap/policy/models/sim/dmaap/rest/BaseRestControllerV1.java
models-sim/models-sim-dmaap/src/main/java/org/onap/policy/models/sim/dmaap/rest/CambriaMessageBodyHandler.java
models-sim/models-sim-dmaap/src/main/java/org/onap/policy/models/sim/dmaap/rest/DmaapSimRestControllerV1.java
models-sim/models-sim-dmaap/src/main/java/org/onap/policy/models/sim/dmaap/rest/TextMessageBodyHandler.java
models-sim/models-sim-dmaap/src/test/java/org/onap/policy/models/sim/dmaap/provider/DmaapSimProviderTest.java
models-sim/models-sim-dmaap/src/test/java/org/onap/policy/models/sim/dmaap/rest/BaseRestControllerV1Test.java
models-sim/models-sim-dmaap/src/test/java/org/onap/policy/models/sim/dmaap/rest/CambriaMessageBodyHandlerTest.java
models-sim/models-sim-dmaap/src/test/java/org/onap/policy/models/sim/dmaap/rest/DmaapSimRestControllerV1Test.java
models-sim/models-sim-dmaap/src/test/java/org/onap/policy/models/sim/dmaap/rest/TextMessageBodyHandlerTest.java
models-sim/packages/models-simulator-docker/pom.xml
models-sim/packages/models-simulator-docker/src/main/docker/Dockerfile
models-sim/packages/models-simulator-tarball/pom.xml
models-sim/packages/pom.xml
models-sim/policy-models-sim-pdp/pom.xml
models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/PdpSimulatorActivator.java
models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/PdpSimulatorMain.java
models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/comm/PdpStatusPublisher.java
models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/handler/PdpMessageHandler.java
models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/handler/PdpStateChangeMessageHandler.java
models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/handler/PdpUpdateMessageHandler.java
models-sim/policy-models-sim-pdp/src/main/package/docker/Dockerfile
models-sim/policy-models-simulators/pom.xml
models-sim/policy-models-simulators/src/test/java/org/onap/policy/models/simulators/MainTest.java
models-sim/pom.xml
models-tosca/pom.xml
models-tosca/src/main/java/org/onap/policy/models/tosca/authorative/concepts/ToscaEntity.java
models-tosca/src/main/java/org/onap/policy/models/tosca/authorative/provider/AuthorativeToscaProvider.java
models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaCapabilityAssignment.java
models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaCapabilityAssignments.java
models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaCapabilityType.java
models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaCapabilityTypes.java
models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaConstraintInRange.java
models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaConstraintLogical.java
models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaConstraintValidValues.java
models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaDataType.java
models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaDataTypes.java
models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaEntityType.java
models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaEventFilter.java
models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaModel.java
models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaNodeTemplate.java
models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaNodeTemplates.java
models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaNodeType.java
models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaNodeTypes.java
models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaParameter.java
models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaPolicies.java
models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaPolicy.java
models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaPolicyType.java
models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaPolicyTypes.java
models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaProperty.java
models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaRelationshipType.java
models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaRelationshipTypes.java
models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaRequirement.java
models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaRequirements.java
models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaSchemaDefinition.java
models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaServiceTemplate.java
models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaServiceTemplates.java
models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaTimeInterval.java
models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaTopologyTemplate.java
models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaTrigger.java
models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaWithToscaProperties.java
models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaWithTypeAndStringProperties.java
models-tosca/src/main/java/org/onap/policy/models/tosca/simple/provider/SimpleToscaProvider.java
models-tosca/src/main/java/org/onap/policy/models/tosca/simple/provider/SimpleToscaServiceTemplateProvider.java
models-tosca/src/main/java/org/onap/policy/models/tosca/utils/ToscaServiceTemplateUtils.java
models-tosca/src/main/java/org/onap/policy/models/tosca/utils/ToscaUtils.java
models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaConstraintLogicalTest.java
models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaConstraintTest.java
models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaPropertyTest.java
models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaServiceTemplateTest.java
pom.xml
version.properties

index 5f84d92..ad90d20 100644 (file)
@@ -1,6 +1,6 @@
 <!--
   ============LICENSE_START=======================================================
-   Copyright (C) 2019,2023 Nordix Foundation.
+   Copyright (C) 2019, 2023 Nordix Foundation.
    Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
   ================================================================================
   Licensed under the Apache License, Version 2.0 (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 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>
         <groupId>org.onap.policy.models</groupId>
         <artifactId>policy-models</artifactId>
-        <version>3.0.0-SNAPSHOT</version>
+        <version>3.0.1-SNAPSHOT</version>
     </parent>
 
     <artifactId>policy-models-base</artifactId>
             <groupId>org.apache.commons</groupId>
             <artifactId>commons-lang3</artifactId>
         </dependency>
-        <dependency>
-            <groupId>org.mockito</groupId>
-            <artifactId>mockito-core</artifactId>
-            <scope>test</scope>
-        </dependency>
     </dependencies>
 </project>
index 8afcaa1..c8be88d 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019 Nordix Foundation.
+ *  Copyright (C) 2019, 2023 Nordix Foundation.
  *  Modifications Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -21,6 +21,7 @@
 
 package org.onap.policy.models.base;
 
+import java.io.Serial;
 import java.io.Serializable;
 import java.util.List;
 import lombok.AccessLevel;
@@ -29,11 +30,12 @@ import lombok.NonNull;
 
 /**
  * This class is the base class for all Policy Framework concept classes. It enforces implementation of abstract methods
- * and interfaces on all concepts that are sub-classes of this class.
+ * and interfaces on all concepts that are subclasses of this class.
  */
 
 @NoArgsConstructor(access = AccessLevel.PROTECTED)
 public abstract class PfConcept extends Validated implements Serializable, Comparable<PfConcept> {
+    @Serial
     private static final long serialVersionUID = -7434939557282697490L;
 
     /**
index 5f38a39..395a42c 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019-2020 Nordix Foundation.
+ *  Copyright (C) 2019-2020, 2023 Nordix Foundation.
  *  Modifications Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
  *  Modifications Copyright (C) 2022 Bell Canada. All rights reserved.
  * ================================================================================
 package org.onap.policy.models.base;
 
 import com.google.re2j.Pattern;
+import jakarta.persistence.CascadeType;
+import jakarta.persistence.EmbeddedId;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.JoinTable;
+import jakarta.persistence.ManyToMany;
+import jakarta.persistence.MappedSuperclass;
+import jakarta.persistence.Table;
+import jakarta.ws.rs.core.Response;
+import java.io.Serial;
 import java.lang.reflect.ParameterizedType;
 import java.util.ArrayList;
 import java.util.LinkedHashMap;
@@ -34,14 +43,6 @@ import java.util.Set;
 import java.util.TreeMap;
 import java.util.TreeSet;
 import java.util.function.Function;
-import javax.persistence.CascadeType;
-import javax.persistence.EmbeddedId;
-import javax.persistence.JoinColumn;
-import javax.persistence.JoinTable;
-import javax.persistence.ManyToMany;
-import javax.persistence.MappedSuperclass;
-import javax.persistence.Table;
-import javax.ws.rs.core.Response;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.NonNull;
@@ -61,7 +62,7 @@ import org.onap.policy.models.base.validation.annotations.VerifyKey;
  * Each concept entry is checked to ensure that its key and value are not null and that the key matches the key in the
  * map value. Each concept entry is then validated individually.
  *
- * @param C the concept being contained
+ * @param <C> the concept being contained
  */
 //@formatter:on
 @MappedSuperclass
@@ -70,7 +71,8 @@ import org.onap.policy.models.base.validation.annotations.VerifyKey;
 @EqualsAndHashCode(callSuper = false)
 
 public class PfConceptContainer<C extends PfConcept, A extends PfNameVersion> extends PfConcept
-        implements PfConceptGetter<C>, PfAuthorative<List<Map<String, A>>> {
+    implements PfConceptGetter<C>, PfAuthorative<List<Map<String, A>>> {
+    @Serial
     private static final long serialVersionUID = -324211738823208318L;
 
     private static final String VALUE_FIELD = "value";
@@ -115,9 +117,9 @@ public class PfConceptContainer<C extends PfConcept, A extends PfNameVersion> ex
     }
 
     /**
-     * This Constructor creates an concept container with all of its fields defined.
+     * This Constructor creates a concept container with all of its fields defined.
      *
-     * @param key the concept container key
+     * @param key        the concept container key
      * @param conceptMap the concepts to be stored in the concept container
      */
     public PfConceptContainer(@NonNull final PfConceptKey key, @NonNull final Map<PfConceptKey, C> conceptMap) {
@@ -200,9 +202,9 @@ public class PfConceptContainer<C extends PfConcept, A extends PfNameVersion> ex
                 }
 
                 incomingConceptEntry.getValue().setName(findConceptField(conceptKey, conceptKey.getName(),
-                        incomingConceptEntry.getValue(), PfNameVersion::getDefinedName));
+                    incomingConceptEntry.getValue(), PfNameVersion::getDefinedName));
                 incomingConceptEntry.getValue().setVersion(findConceptField(conceptKey, conceptKey.getVersion(),
-                        incomingConceptEntry.getValue(), PfNameVersion::getDefinedVersion));
+                    incomingConceptEntry.getValue(), PfNameVersion::getDefinedVersion));
 
                 var jpaConcept = getConceptNewInstance();
                 // This cast allows us to call the fromAuthorative method
@@ -219,7 +221,7 @@ public class PfConceptContainer<C extends PfConcept, A extends PfNameVersion> ex
 
         if (conceptMap.isEmpty()) {
             throw new PfModelRuntimeException(Response.Status.BAD_REQUEST,
-                    "An incoming list of concepts must have at least one entry");
+                "An incoming list of concepts must have at least one entry");
         }
     }
 
@@ -286,10 +288,7 @@ public class PfConceptContainer<C extends PfConcept, A extends PfNameVersion> ex
     }
 
     @Override
-    public int compareTo(final PfConcept otherConcept) {
-        if (otherConcept == null) {
-            return -1;
-        }
+    public int compareTo(@NonNull final PfConcept otherConcept) {
         if (this == otherConcept) {
             return 0;
         }
@@ -297,8 +296,7 @@ public class PfConceptContainer<C extends PfConcept, A extends PfNameVersion> ex
             return getClass().getName().compareTo(otherConcept.getClass().getName());
         }
 
-        @SuppressWarnings("unchecked")
-        final PfConceptContainer<C, A> other = (PfConceptContainer<C, A>) otherConcept;
+        @SuppressWarnings("unchecked") final PfConceptContainer<C, A> other = (PfConceptContainer<C, A>) otherConcept;
         int retVal = key.compareTo(other.key);
         if (retVal != 0) {
             return retVal;
@@ -310,7 +308,7 @@ public class PfConceptContainer<C extends PfConcept, A extends PfNameVersion> ex
     /**
      * Get all the concepts that match the given name and version.
      *
-     * @param conceptKeyName the name of the concept, if null, return all names
+     * @param conceptKeyName    the name of the concept, if null, return all names
      * @param conceptKeyVersion the version of the concept, if null, return all versions
      * @return conceptKeyVersion
      */
@@ -374,16 +372,17 @@ public class PfConceptContainer<C extends PfConcept, A extends PfNameVersion> ex
     private C getConceptNewInstance() {
         try {
             String conceptClassName =
-                    ((ParameterizedType) getClass().getGenericSuperclass()).getActualTypeArguments()[0].getTypeName();
+                ((ParameterizedType) getClass().getGenericSuperclass()).getActualTypeArguments()[0].getTypeName();
             return (C) Class.forName(conceptClassName).getDeclaredConstructor().newInstance();
         } catch (Exception ex) {
             throw new PfModelRuntimeException(Response.Status.INTERNAL_SERVER_ERROR,
-                    "failed to instantiate instance of container concept class", ex);
+                "failed to instantiate instance of container concept class", ex);
         }
     }
 
     private String findConceptField(final PfConceptKey conceptKey, final String keyFieldValue,
-            final PfNameVersion concept, final Function<PfNameVersion, String> fieldGetterFunction) {
+                                    final PfNameVersion concept,
+                                    final Function<PfNameVersion, String> fieldGetterFunction) {
 
         String conceptField = fieldGetterFunction.apply(concept);
 
@@ -391,7 +390,7 @@ public class PfConceptContainer<C extends PfConcept, A extends PfNameVersion> ex
             return keyFieldValue;
         } else {
             throw new PfModelRuntimeException(Response.Status.BAD_REQUEST, "Key " + conceptKey.getId() + " field "
-                    + keyFieldValue + " does not match the value " + conceptField + " in the concept field");
+                + keyFieldValue + " does not match the value " + conceptField + " in the concept field");
         }
     }
 }
\ No newline at end of file
index 98b6781..cda2bbf 100644 (file)
@@ -21,8 +21,9 @@
 
 package org.onap.policy.models.base;
 
-import javax.persistence.Column;
-import javax.persistence.Embeddable;
+import jakarta.persistence.Column;
+import jakarta.persistence.Embeddable;
+import java.io.Serial;
 import lombok.EqualsAndHashCode;
 import lombok.Getter;
 import lombok.NonNull;
@@ -31,7 +32,7 @@ import org.onap.policy.common.parameters.annotations.Pattern;
 import org.onap.policy.common.utils.validation.Assertions;
 
 /**
- * An concept key uniquely identifies every first order entity in the system. Every first order concept in the system
+ * A concept key uniquely identifies every first order entity in the system. Every first order concept in the system
  * must have an {@link PfConceptKey} to identify it. Concepts that are wholly contained in another concept are
  * identified using a {@link PfReferenceKey} key.
  *
@@ -43,6 +44,7 @@ import org.onap.policy.common.utils.validation.Assertions;
 @EqualsAndHashCode(callSuper = false)
 @ToString
 public class PfConceptKey extends PfKeyImpl {
+    @Serial
     private static final long serialVersionUID = 8932717618579392561L;
 
     @Column(name = NAME_TOKEN, length = 120)
@@ -72,7 +74,7 @@ public class PfConceptKey extends PfKeyImpl {
     /**
      * Constructor to create a key with the specified name and version.
      *
-     * @param name the key name
+     * @param name    the key name
      * @param version the key version
      */
     public PfConceptKey(final String name, final String version) {
@@ -101,7 +103,7 @@ public class PfConceptKey extends PfKeyImpl {
      *
      * @return a null concept key
      */
-    public static final PfConceptKey getNullKey() {
+    public static PfConceptKey getNullKey() {
         return new PfConceptKey(PfKey.NULL_KEY_NAME, PfKey.NULL_KEY_VERSION);
     }
 }
index 9495988..8ff171e 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019 Nordix Foundation.
+ *  Copyright (C) 2019, 2023 Nordix Foundation.
  *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -21,6 +21,7 @@
 
 package org.onap.policy.models.base;
 
+import java.io.Serial;
 import lombok.AccessLevel;
 import lombok.NoArgsConstructor;
 import lombok.NonNull;
@@ -31,6 +32,7 @@ import lombok.NonNull;
  */
 @NoArgsConstructor(access = AccessLevel.PROTECTED)
 public abstract class PfKey extends PfConcept {
+    @Serial
     private static final long serialVersionUID = 6281159885962014041L;
 
     /** Regular expression to specify the structure of key names. */
index 3309fe9..105e6f7 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019-2020 Nordix Foundation.
+ *  Copyright (C) 2019-2020, 2023 Nordix Foundation.
  *  Modifications Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -21,6 +21,7 @@
 
 package org.onap.policy.models.base;
 
+import java.io.Serial;
 import java.util.ArrayList;
 import java.util.List;
 import lombok.Getter;
@@ -34,6 +35,7 @@ import org.onap.policy.common.utils.validation.Assertions;
 @Getter
 @ToString
 public abstract class PfKeyImpl extends PfKey {
+    @Serial
     private static final long serialVersionUID = 8932717618579392561L;
 
     public static final String NAME_TOKEN = "name";
@@ -134,10 +136,9 @@ public abstract class PfKeyImpl extends PfKey {
 
     @Override
     public PfKey.Compatibility getCompatibility(@NonNull final PfKey otherKey) {
-        if (!(otherKey instanceof PfKeyImpl)) {
+        if (!(otherKey instanceof PfKeyImpl otherConceptKey)) {
             return Compatibility.DIFFERENT;
         }
-        final PfKeyImpl otherConceptKey = (PfKeyImpl) otherKey;
 
         if (this.equals(otherConceptKey)) {
             return Compatibility.IDENTICAL;
@@ -164,10 +165,9 @@ public abstract class PfKeyImpl extends PfKey {
 
     @Override
     public boolean isCompatible(@NonNull final PfKey otherKey) {
-        if (!(otherKey instanceof PfKeyImpl)) {
+        if (!(otherKey instanceof PfKeyImpl otherConceptKey)) {
             return false;
         }
-        final PfKeyImpl otherConceptKey = (PfKeyImpl) otherKey;
 
         final var compatibility = this.getCompatibility(otherConceptKey);
 
@@ -193,17 +193,17 @@ public abstract class PfKeyImpl extends PfKey {
 
         // There must always be at least one element in each version
         if (!thisVersionArray[0].equals(otherVersionArray[0])) {
-            return Integer.valueOf(thisVersionArray[0]) > Integer.valueOf(otherVersionArray[0]);
+            return Integer.parseInt(thisVersionArray[0]) > Integer.parseInt(otherVersionArray[0]);
         }
 
         if (thisVersionArray.length >= 2 && otherVersionArray.length >= 2
             && !thisVersionArray[1].equals(otherVersionArray[1])) {
-            return Integer.valueOf(thisVersionArray[1]) > Integer.valueOf(otherVersionArray[1]);
+            return Integer.parseInt(thisVersionArray[1]) > Integer.parseInt(otherVersionArray[1]);
         }
 
         if (thisVersionArray.length >= 3 && otherVersionArray.length >= 3
             && !thisVersionArray[2].equals(otherVersionArray[2])) {
-            return Integer.valueOf(thisVersionArray[2]) > Integer.valueOf(otherVersionArray[2]);
+            return Integer.parseInt(thisVersionArray[2]) > Integer.parseInt(otherVersionArray[2]);
         }
 
         return false;
index b753bb1..f9141cc 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019 Nordix Foundation.
+ *  Copyright (C) 2019, 2023 Nordix Foundation.
  *  Modifications Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -21,6 +21,7 @@
 
 package org.onap.policy.models.base;
 
+import java.io.Serial;
 import java.util.List;
 import lombok.EqualsAndHashCode;
 import lombok.Getter;
@@ -41,6 +42,7 @@ import org.onap.policy.models.base.validation.annotations.VerifyKey;
 @EqualsAndHashCode(callSuper = false)
 @ToString
 public class PfKeyUse extends PfKey {
+    @Serial
     private static final long serialVersionUID = 2007147220109881705L;
 
     @VerifyKey
@@ -139,7 +141,7 @@ public class PfKeyUse extends PfKey {
     }
 
     @Override
-    public int compareTo(final PfConcept otherObj) {
+    public int compareTo(@NonNull final PfConcept otherObj) {
         Assertions.argumentNotNull(otherObj, "comparison object may not be null");
 
         if (this == otherObj) {
index e7b79ca..1caa632 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019 Nordix Foundation.
+ *  Copyright (C) 2019, 2023 Nordix Foundation.
  *  Modifications Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
  *  Modifications Copyright (C) 2022 Bell Canada. All rights reserved.
  * ================================================================================
 
 package org.onap.policy.models.base;
 
+import jakarta.persistence.EmbeddedId;
+import jakarta.persistence.MappedSuperclass;
+import java.io.Serial;
 import java.util.List;
 import java.util.Set;
 import java.util.TreeSet;
-import javax.persistence.EmbeddedId;
-import javax.persistence.MappedSuperclass;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.NonNull;
@@ -41,12 +42,12 @@ import org.onap.policy.models.base.validation.annotations.VerifyKey;
  * from this model so all models must have a key and have key information.
  *
  * <p>Validation checks that the model key is valid. It goes on to check for null keys and checks
- * each key for uniqueness in the model. A check is carried out to ensure that an {@link PfKeyInfo}
+ * each key for uniqueness in the model. A check is carried out to ensure that an {@link PfKey}
  * instance exists for every {@link PfConceptKey} key. For each {@link PfReferenceKey} instance, a
- * check is made that its parent and local name are nut null and that a {@link PfKeyInfo} entry
+ * check is made that its parent and local name are not null and that a {@link PfKey} entry
  * exists for its parent. Then a check is made that each used {@link PfConceptKey} and
  * {@link PfReferenceKey} usage references a key that exists. Finally, a check is made to ensure
- * that an {@link PfConceptKey} instance exists for every {@link PfKeyInfo} instance.
+ * that an {@link PfConceptKey} instance exists for every {@link PfKey} instance.
  *
  * @param <C> the type of concept on which the interface is applied.
  */
@@ -57,6 +58,7 @@ import org.onap.policy.models.base.validation.annotations.VerifyKey;
 public abstract class PfModel extends PfConcept {
     private static final String KEYS_TOKEN = "keys";
 
+    @Serial
     private static final long serialVersionUID = -771659065637205430L;
 
     @EmbeddedId
@@ -146,13 +148,13 @@ public abstract class PfModel extends PfConcept {
     /**
      * Check for consistent usage of an artifact key in the model.
      *
-     * @param artifactKey The artifact key to check
+     * @param artifactKey    The artifact key to check
      * @param artifactKeySet The set of artifact keys encountered so far, this key is appended to
-     *        the set
-     * @param result where to add the results
+     *                       the set
+     * @param result         where to add the results
      */
     private void validateArtifactKeyInModel(final PfConceptKey artifactKey,
-            final Set<PfConceptKey> artifactKeySet, final BeanValidationResult result) {
+                                            final Set<PfConceptKey> artifactKeySet, final BeanValidationResult result) {
 
         validateKeyNotNull(result, KEYS_TOKEN, artifactKey);
 
@@ -161,7 +163,7 @@ public abstract class PfModel extends PfConcept {
         // Null key name start check
         if (artifactKey.getName().toUpperCase().startsWith(PfKey.NULL_KEY_NAME)) {
             addResult(result2, "name of " + artifactKey.getId(), artifactKey.getName(),
-                            "starts with keyword " + PfKey.NULL_KEY_NAME);
+                "starts with keyword " + PfKey.NULL_KEY_NAME);
         }
 
         // Unique key check
@@ -175,13 +177,14 @@ public abstract class PfModel extends PfConcept {
     /**
      * Check for consistent usage of a reference key in the model.
      *
-     * @param referenceKey The reference key to check
+     * @param referenceKey    The reference key to check
      * @param referenceKeySet The set of reference keys encountered so far, this key is appended to
-     *        the set
-     * @param result where to add the results
+     *                        the set
+     * @param result          where to add the results
      */
     private void validateReferenceKeyInModel(final PfReferenceKey referenceKey,
-            final Set<PfReferenceKey> referenceKeySet, final BeanValidationResult result) {
+                                             final Set<PfReferenceKey> referenceKeySet,
+                                             final BeanValidationResult result) {
         // Null key check
         if (referenceKey.isNullKey()) {
             addResult(result, KEYS_TOKEN, referenceKey, IS_A_NULL_KEY);
@@ -192,7 +195,7 @@ public abstract class PfModel extends PfConcept {
         // Null parent key check
         if (referenceKey.getParentConceptKey().isNullKey()) {
             addResult(result2, "parent key of " + referenceKey.getId(), referenceKey.getParentConceptKey().getId(),
-                            IS_A_NULL_KEY);
+                IS_A_NULL_KEY);
         }
 
         // Null local name check
@@ -203,7 +206,7 @@ public abstract class PfModel extends PfConcept {
         // Null key name start check
         if (referenceKey.getParentConceptKey().getName().toUpperCase().startsWith(PfKey.NULL_KEY_NAME)) {
             addResult(result2, "parent name of " + referenceKey.getId(), referenceKey.getParentConceptKey().getName(),
-                            "starts with keyword " + PfKey.NULL_KEY_NAME);
+                "starts with keyword " + PfKey.NULL_KEY_NAME);
         }
 
         // Unique key check
@@ -217,15 +220,15 @@ public abstract class PfModel extends PfConcept {
     /**
      * Check for consistent usage of cross-key references in the model.
      *
-     * @param usedKeySet The set of all keys used in the model
-     * @param artifactKeySet The set of artifact keys encountered so far, this key is appended to
-     *        the set
+     * @param usedKeySet      The set of all keys used in the model
+     * @param artifactKeySet  The set of artifact keys encountered so far, this key is appended to
+     *                        the set
      * @param referenceKeySet The set of reference keys encountered so far, this key is appended to
-     *        the set
-     * @param result where to add the results
+     *                        the set
+     * @param result          where to add the results
      */
     private void validateKeyUses(final Set<PfKeyUse> usedKeySet, final Set<PfConceptKey> artifactKeySet,
-            final Set<PfReferenceKey> referenceKeySet, final BeanValidationResult result) {
+                                 final Set<PfReferenceKey> referenceKeySet, final BeanValidationResult result) {
         // Check all key uses
         for (final PfKeyUse usedKey : usedKeySet) {
             if (usedKey.getKey() instanceof PfConceptKey) {
index c25fd17..9ffac08 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019 Nordix Foundation.
+ *  Copyright (C) 2019, 2023 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,7 +20,8 @@
 
 package org.onap.policy.models.base;
 
-import javax.ws.rs.core.Response;
+import jakarta.ws.rs.core.Response;
+import java.io.Serial;
 import lombok.Getter;
 import lombok.ToString;
 import org.onap.policy.models.errors.concepts.ErrorResponse;
@@ -28,11 +29,12 @@ import org.onap.policy.models.errors.concepts.ErrorResponseInfo;
 import org.onap.policy.models.errors.concepts.ErrorResponseUtils;
 
 /**
- * This class is a base exception from which all model exceptions are sub classes.
+ * This class is a base exception from which all model exceptions are subclasses.
  */
 @Getter
 @ToString
 public class PfModelException extends Exception implements ErrorResponseInfo {
+    @Serial
     private static final long serialVersionUID = -8507246953751956974L;
 
     // The error response of the exception
@@ -45,7 +47,7 @@ public class PfModelException extends Exception implements ErrorResponseInfo {
      * Instantiates a new model exception.
      *
      * @param statusCode the return code for the exception
-     * @param message the message on the exception
+     * @param message    the message on the exception
      */
     public PfModelException(final Response.Status statusCode, final String message) {
         this(statusCode, message, null);
@@ -55,8 +57,8 @@ public class PfModelException extends Exception implements ErrorResponseInfo {
      * Instantiates a new model exception.
      *
      * @param statusCode the return code for the exception
-     * @param message the message on the exception
-     * @param object the object that the exception was thrown on
+     * @param message    the message on the exception
+     * @param object     the object that the exception was thrown on
      */
     public PfModelException(final Response.Status statusCode, final String message, final Object object) {
         super(message);
@@ -69,8 +71,8 @@ public class PfModelException extends Exception implements ErrorResponseInfo {
      * Instantiates a new model exception.
      *
      * @param statusCode the return code for the exception
-     * @param message the message on the exception
-     * @param exception the exception that caused this exception
+     * @param message    the message on the exception
+     * @param exception  the exception that caused this exception
      */
     public PfModelException(final Response.Status statusCode, final String message, final Exception exception) {
         this(statusCode, message, exception, null);
@@ -80,12 +82,12 @@ public class PfModelException extends Exception implements ErrorResponseInfo {
      * Instantiates a new exception.
      *
      * @param statusCode the return code for the exception
-     * @param message the message on the exception
-     * @param exception the exception that caused this exception
-     * @param object the object that the exception was thrown on
+     * @param message    the message on the exception
+     * @param exception  the exception that caused this exception
+     * @param object     the object that the exception was thrown on
      */
     public PfModelException(final Response.Status statusCode, final String message, final Exception exception,
-            final Object object) {
+                            final Object object) {
         super(message, exception);
         errorResponse.setResponseCode(statusCode);
         ErrorResponseUtils.getExceptionMessages(errorResponse, this);
index cd0562f..44e9db9 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- * Copyright (C) 2019, 2021 Nordix Foundation.
+ * Copyright (C) 2019, 2021, 2023 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,7 +20,8 @@
 
 package org.onap.policy.models.base;
 
-import javax.ws.rs.core.Response;
+import jakarta.ws.rs.core.Response;
+import java.io.Serial;
 import lombok.Getter;
 import lombok.ToString;
 import org.onap.policy.models.errors.concepts.ErrorResponse;
@@ -28,11 +29,12 @@ import org.onap.policy.models.errors.concepts.ErrorResponseInfo;
 import org.onap.policy.models.errors.concepts.ErrorResponseUtils;
 
 /**
- * This class is a base model run time exception from which all model run time exceptions are sub classes.
+ * This class is a base model run time exception from which all model run time exceptions are subclasses.
  */
 @Getter
 @ToString
 public class PfModelRuntimeException extends RuntimeException implements ErrorResponseInfo {
+    @Serial
     private static final long serialVersionUID = -8507246953751956974L;
 
     // The error response of the exception
@@ -45,7 +47,7 @@ public class PfModelRuntimeException extends RuntimeException implements ErrorRe
      * Instantiates a new model runtime exception.
      *
      * @param statusCode the return code for the exception
-     * @param message the message on the exception
+     * @param message    the message on the exception
      */
     public PfModelRuntimeException(final Response.Status statusCode, final String message) {
         this(statusCode, message, null);
@@ -55,8 +57,8 @@ public class PfModelRuntimeException extends RuntimeException implements ErrorRe
      * Instantiates a new model runtime exception.
      *
      * @param statusCode the return code for the exception
-     * @param message the message on the exception
-     * @param object the object that the exception was thrown on
+     * @param message    the message on the exception
+     * @param object     the object that the exception was thrown on
      */
     public PfModelRuntimeException(final Response.Status statusCode, final String message, final Object object) {
         super(message);
@@ -69,8 +71,8 @@ public class PfModelRuntimeException extends RuntimeException implements ErrorRe
      * Instantiates a new model runtime exception.
      *
      * @param statusCode the return code for the exception
-     * @param message the message on the exception
-     * @param exception the exception that caused this model exception
+     * @param message    the message on the exception
+     * @param exception  the exception that caused this model exception
      */
     public PfModelRuntimeException(final Response.Status statusCode, final String message, final Exception exception) {
         this(statusCode, message, exception, null);
@@ -92,12 +94,12 @@ public class PfModelRuntimeException extends RuntimeException implements ErrorRe
      * Instantiates a new model runtime exception.
      *
      * @param statusCode the return code for the exception
-     * @param message the message on the exception
-     * @param exception the exception that caused this model exception
-     * @param object the object that the exception was thrown on
+     * @param message    the message on the exception
+     * @param exception  the exception that caused this model exception
+     * @param object     the object that the exception was thrown on
      */
     public PfModelRuntimeException(final Response.Status statusCode, final String message, final Exception exception,
-            final Object object) {
+                                   final Object object) {
         super(message, exception);
         this.object = object;
         errorResponse.setResponseCode(statusCode);
index 860288b..94a7c0e 100644 (file)
@@ -21,9 +21,9 @@
 
 package org.onap.policy.models.base;
 
+import jakarta.ws.rs.core.Response;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
-import javax.ws.rs.core.Response;
 import lombok.AccessLevel;
 import lombok.NoArgsConstructor;
 import lombok.NonNull;
@@ -42,14 +42,14 @@ import lombok.NonNull;
 @NoArgsConstructor(access = AccessLevel.PRIVATE)
 public final class PfModelService {
     // The map holding the models
-    private static Map<String, PfConcept> modelMap = new ConcurrentHashMap<>();
+    private static final Map<String, PfConcept> modelMap = new ConcurrentHashMap<>();
 
     /**
      * Register a model with the model service.
      *
-     * @param <M> the generic type
+     * @param <M>      the generic type
      * @param modelKey the key of the model, used to index the model
-     * @param model The model
+     * @param model    The model
      */
     public static <M extends PfConcept> void registerModel(@NonNull final String modelKey, @NonNull final M model) {
         modelMap.put(modelKey, model);
@@ -67,7 +67,7 @@ public final class PfModelService {
     /**
      * Get a model from the model service.
      *
-     * @param <M> the generic type
+     * @param <M>      the generic type
      * @param modelKey the key of the model, used to index the model
      * @return The model
      */
@@ -77,7 +77,7 @@ public final class PfModelService {
 
         if (model == null) {
             throw new PfModelRuntimeException(Response.Status.INTERNAL_SERVER_ERROR,
-                    "Model for name " + modelKey + " not found in model service");
+                "Model for name " + modelKey + " not found in model service");
         }
 
         return model;
index acbebf9..246f8f0 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019,2021 Nordix Foundation.
+ *  Copyright (C) 2019, 2021, 2023 Nordix Foundation.
  *  Modifications Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
 
 package org.onap.policy.models.base;
 
+import jakarta.persistence.Column;
+import jakarta.persistence.Embeddable;
+import java.io.Serial;
 import java.util.ArrayList;
 import java.util.List;
-import javax.persistence.Column;
-import javax.persistence.Embeddable;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.NonNull;
@@ -58,14 +59,19 @@ public class PfReferenceKey extends PfKey {
     private static final String PARENT_LOCAL_NAME = "parentLocalName";
     private static final String LOCAL_NAME = "localName";
 
+    @Serial
     private static final long serialVersionUID = 8932717618579392561L;
 
-    /** Regular expression to specify the structure of local names in reference keys. */
+    /**
+     * Regular expression to specify the structure of local names in reference keys.
+     */
     public static final String LOCAL_NAME_REGEXP = "[A-Za-z0-9\\-_\\.]+|^$";
 
-    /** Regular expression to specify the structure of IDs in reference keys. */
+    /**
+     * Regular expression to specify the structure of IDs in reference keys.
+     */
     public static final String REFERENCE_KEY_ID_REGEXP =
-                    "[A-Za-z0-9\\-_]+:[0-9].[0-9].[0-9]:[A-Za-z0-9\\-_]+:[A-Za-z0-9\\-_]+";
+        "[A-Za-z0-9\\-_]+:[0-9].[0-9].[0-9]:[A-Za-z0-9\\-_]+:[A-Za-z0-9\\-_]+";
 
     private static final int PARENT_NAME_FIELD = 0;
     private static final int PARENT_VERSION_FIELD = 1;
@@ -102,19 +108,17 @@ public class PfReferenceKey extends PfKey {
     /**
      * The Copy Constructor creates a key by copying another key.
      *
-     * @param referenceKey
-     *        the reference key to copy from
+     * @param referenceKey the reference key to copy from
      */
     public PfReferenceKey(final PfReferenceKey referenceKey) {
         this(referenceKey.getParentKeyName(), referenceKey.getParentKeyVersion(), referenceKey.getParentLocalName(),
-                        referenceKey.getLocalName());
+            referenceKey.getLocalName());
     }
 
     /**
      * Constructor to create a null reference key for the specified parent concept key.
      *
-     * @param pfConceptKey
-     *        the parent concept key of this reference key
+     * @param pfConceptKey the parent concept key of this reference key
      */
     public PfReferenceKey(final PfConceptKey pfConceptKey) {
         this(pfConceptKey.getName(), pfConceptKey.getVersion(), NULL_KEY_NAME, NULL_KEY_NAME);
@@ -123,10 +127,8 @@ public class PfReferenceKey extends PfKey {
     /**
      * Constructor to create a reference key for the given parent concept key with the given local name.
      *
-     * @param pfConceptKey
-     *        the parent concept key of this reference key
-     * @param localName
-     *        the local name of this reference key
+     * @param pfConceptKey the parent concept key of this reference key
+     * @param localName    the local name of this reference key
      */
     public PfReferenceKey(final PfConceptKey pfConceptKey, final String localName) {
         this(pfConceptKey, NULL_KEY_NAME, localName);
@@ -135,10 +137,8 @@ public class PfReferenceKey extends PfKey {
     /**
      * Constructor to create a reference key for the given parent reference key with the given local name.
      *
-     * @param parentReferenceKey
-     *        the parent reference key of this reference key
-     * @param localName
-     *        the local name of this reference key
+     * @param parentReferenceKey the parent reference key of this reference key
+     * @param localName          the local name of this reference key
      */
     public PfReferenceKey(final PfReferenceKey parentReferenceKey, final String localName) {
         this(parentReferenceKey.getParentConceptKey(), parentReferenceKey.getLocalName(), localName);
@@ -148,12 +148,9 @@ public class PfReferenceKey extends PfKey {
      * Constructor to create a reference key for the given parent reference key (specified by the parent reference key's
      * concept key and local name) with the given local name.
      *
-     * @param pfConceptKey
-     *        the concept key of the parent reference key of this reference key
-     * @param parentLocalName
-     *        the local name of the parent reference key of this reference key
-     * @param localName
-     *        the local name of this reference key
+     * @param pfConceptKey    the concept key of the parent reference key of this reference key
+     * @param parentLocalName the local name of the parent reference key of this reference key
+     * @param localName       the local name of this reference key
      */
     public PfReferenceKey(final PfConceptKey pfConceptKey, final String parentLocalName, final String localName) {
         this(pfConceptKey.getName(), pfConceptKey.getVersion(), parentLocalName, localName);
@@ -163,12 +160,9 @@ public class PfReferenceKey extends PfKey {
      * Constructor to create a reference key for the given parent concept key (specified by the parent concept key's
      * name and version) with the given local name.
      *
-     * @param parentKeyName
-     *        the name of the parent concept key of this reference key
-     * @param parentKeyVersion
-     *        the version of the parent concept key of this reference key
-     * @param localName
-     *        the local name of this reference key
+     * @param parentKeyName    the name of the parent concept key of this reference key
+     * @param parentKeyVersion the version of the parent concept key of this reference key
+     * @param localName        the local name of this reference key
      */
     public PfReferenceKey(final String parentKeyName, final String parentKeyVersion, final String localName) {
         this(parentKeyName, parentKeyVersion, NULL_KEY_NAME, localName);
@@ -178,31 +172,26 @@ public class PfReferenceKey extends PfKey {
      * Constructor to create a reference key for the given parent key (specified by the parent key's name, version nad
      * local name) with the given local name.
      *
-     * @param parentKeyName
-     *        the parent key name of this reference key
-     * @param parentKeyVersion
-     *        the parent key version of this reference key
-     * @param parentLocalName
-     *        the parent local name of this reference key
-     * @param localName
-     *        the local name of this reference key
+     * @param parentKeyName    the parent key name of this reference key
+     * @param parentKeyVersion the parent key version of this reference key
+     * @param parentLocalName  the parent local name of this reference key
+     * @param localName        the local name of this reference key
      */
     public PfReferenceKey(final String parentKeyName, final String parentKeyVersion, final String parentLocalName,
-                    final String localName) {
+                          final String localName) {
         super();
         this.parentKeyName = Assertions.validateStringParameter(PARENT_KEY_NAME, parentKeyName, NAME_REGEXP);
         this.parentKeyVersion = Assertions.validateStringParameter(PARENT_KEY_VERSION, parentKeyVersion,
-                        VERSION_REGEXP);
+            VERSION_REGEXP);
         this.parentLocalName = Assertions.validateStringParameter(PARENT_LOCAL_NAME, parentLocalName,
-                        LOCAL_NAME_REGEXP);
+            LOCAL_NAME_REGEXP);
         this.localName = Assertions.validateStringParameter(LOCAL_NAME, localName, LOCAL_NAME_REGEXP);
     }
 
     /**
      * Constructor to create a key from the specified key ID.
      *
-     * @param id
-     *        the key ID in a format that respects the KEY_ID_REGEXP
+     * @param id the key ID in a format that respects the KEY_ID_REGEXP
      */
     public PfReferenceKey(final String id) {
         final var conditionedId = Assertions.validateStringParameter("id", id, REFERENCE_KEY_ID_REGEXP);
@@ -215,13 +204,13 @@ public class PfReferenceKey extends PfKey {
 
         // Initiate the new key
         parentKeyName = Assertions.validateStringParameter(PARENT_KEY_NAME, nameVersionNameArray[PARENT_NAME_FIELD],
-                        NAME_REGEXP);
+            NAME_REGEXP);
         parentKeyVersion = Assertions.validateStringParameter(PARENT_KEY_VERSION,
-                        nameVersionNameArray[PARENT_VERSION_FIELD], VERSION_REGEXP);
+            nameVersionNameArray[PARENT_VERSION_FIELD], VERSION_REGEXP);
         parentLocalName = Assertions.validateStringParameter(PARENT_LOCAL_NAME,
-                        nameVersionNameArray[PARENT_LOCAL_NAME_FIELD], LOCAL_NAME_REGEXP);
+            nameVersionNameArray[PARENT_LOCAL_NAME_FIELD], LOCAL_NAME_REGEXP);
         localName = Assertions.validateStringParameter(LOCAL_NAME, nameVersionNameArray[LOCAL_NAME_FIELD],
-                        LOCAL_NAME_REGEXP);
+            LOCAL_NAME_REGEXP);
     }
 
     /**
@@ -231,7 +220,7 @@ public class PfReferenceKey extends PfKey {
      */
     public static PfReferenceKey getNullKey() {
         return new PfReferenceKey(PfKey.NULL_KEY_NAME, PfKey.NULL_KEY_VERSION, PfKey.NULL_KEY_NAME,
-                        PfKey.NULL_KEY_NAME);
+            PfKey.NULL_KEY_NAME);
     }
 
     @Override
@@ -279,8 +268,7 @@ public class PfReferenceKey extends PfKey {
     /**
      * Sets the parent concept key of this reference key.
      *
-     * @param parentKey
-     *        the parent concept key of this reference key
+     * @param parentKey the parent concept key of this reference key
      */
     public void setParentConceptKey(final PfConceptKey parentKey) {
         Assertions.argumentNotNull(parentKey, "parentKey may not be null");
@@ -293,8 +281,7 @@ public class PfReferenceKey extends PfKey {
     /**
      * Sets the parent reference key of this reference key.
      *
-     * @param parentKey
-     *        the parent reference key of this reference key
+     * @param parentKey the parent reference key of this reference key
      */
     public void setParentReferenceKey(final PfReferenceKey parentKey) {
         Assertions.argumentNotNull(parentKey, "parentKey may not be null");
@@ -305,21 +292,19 @@ public class PfReferenceKey extends PfKey {
     }
 
     @Override
-    public PfKey.Compatibility getCompatibility(final PfKey otherKey) {
-        if (!(otherKey instanceof PfReferenceKey)) {
+    public PfKey.Compatibility getCompatibility(@NonNull final PfKey otherKey) {
+        if (!(otherKey instanceof PfReferenceKey otherReferenceKey)) {
             return Compatibility.DIFFERENT;
         }
-        final PfReferenceKey otherReferenceKey = (PfReferenceKey) otherKey;
 
         return this.getParentConceptKey().getCompatibility(otherReferenceKey.getParentConceptKey());
     }
 
     @Override
     public boolean isCompatible(@NonNull final PfKey otherKey) {
-        if (!(otherKey instanceof PfReferenceKey)) {
+        if (!(otherKey instanceof PfReferenceKey otherReferenceKey)) {
             return false;
         }
-        final PfReferenceKey otherReferenceKey = (PfReferenceKey) otherKey;
 
         return this.getParentConceptKey().isCompatible(otherReferenceKey.getParentConceptKey());
     }
@@ -358,7 +343,7 @@ public class PfReferenceKey extends PfKey {
     }
 
     @Override
-    public int compareTo(final PfConcept otherObj) {
+    public int compareTo(@NonNull final PfConcept otherObj) {
         Assertions.argumentNotNull(otherObj, "comparison object may not be null");
 
         if (this == otherObj) {
index 8be1126..c7838d8 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- * Copyright (C) 2021 Nordix Foundation.
+ * Copyright (C) 2021, 2023 Nordix Foundation.
  * Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
 
 package org.onap.policy.models.base;
 
+import jakarta.persistence.Column;
+import jakarta.persistence.Embeddable;
+import jakarta.persistence.Embedded;
+import jakarta.persistence.Temporal;
+import jakarta.persistence.TemporalType;
+import java.io.Serial;
 import java.time.Instant;
 import java.util.Collections;
 import java.util.Date;
 import java.util.List;
-import javax.persistence.Column;
-import javax.persistence.Embeddable;
-import javax.persistence.Embedded;
-import javax.persistence.Temporal;
-import javax.persistence.TemporalType;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.NonNull;
@@ -46,6 +47,7 @@ import org.onap.policy.common.utils.validation.Assertions;
 @Data
 @EqualsAndHashCode(callSuper = false)
 public class PfReferenceTimestampKey extends PfKey {
+    @Serial
     private static final long serialVersionUID = 1130918285832617215L;
 
     private static final String TIMESTAMP_TOKEN = "timeStamp";
@@ -298,10 +300,9 @@ public class PfReferenceTimestampKey extends PfKey {
 
     @Override
     public boolean isCompatible(@NonNull PfKey otherKey) {
-        if (!(otherKey instanceof PfReferenceTimestampKey)) {
+        if (!(otherKey instanceof PfReferenceTimestampKey otherReferenceKey)) {
             return false;
         }
-        final PfReferenceTimestampKey otherReferenceKey = (PfReferenceTimestampKey) otherKey;
 
         return this.getReferenceKey().getParentConceptKey().isCompatible(otherReferenceKey.getReferenceKey()
             .getParentConceptKey());
index 902d198..2296953 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019 Nordix Foundation.
+ *  Copyright (C) 2019, 2023 Nordix Foundation.
  *  Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -21,8 +21,9 @@
 
 package org.onap.policy.models.base;
 
-import javax.persistence.Column;
-import javax.persistence.Embeddable;
+import jakarta.persistence.Column;
+import jakarta.persistence.Embeddable;
+import java.io.Serial;
 import lombok.EqualsAndHashCode;
 import lombok.Getter;
 import lombok.NonNull;
@@ -37,6 +38,7 @@ import org.onap.policy.common.utils.validation.Assertions;
 @Getter
 @EqualsAndHashCode(callSuper = false)
 public class PfSearchableKey extends PfKeyImpl {
+    @Serial
     private static final long serialVersionUID = 8932717618579392561L;
 
     /** Regular expression to specify the structure of key names. */
@@ -98,7 +100,7 @@ public class PfSearchableKey extends PfKeyImpl {
      *
      * @return a null key
      */
-    public static final PfSearchableKey getNullKey() {
+    public static PfSearchableKey getNullKey() {
         return new PfSearchableKey(PfKey.NULL_KEY_NAME, PfKey.NULL_KEY_VERSION);
     }
 
index 1f5dc65..ea12889 100644 (file)
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * ONAP Policy Model
  * ================================================================================
- * Copyright (C) 2019-2021 Nordix Foundation.
+ * Copyright (C) 2019-2021, 2023 Nordix Foundation.
  * Modifications Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
 
 package org.onap.policy.models.base;
 
+import jakarta.persistence.Column;
+import jakarta.persistence.Embeddable;
+import jakarta.persistence.Temporal;
+import jakarta.persistence.TemporalType;
+import java.io.Serial;
 import java.time.Instant;
 import java.util.Date;
-import javax.persistence.Column;
-import javax.persistence.Embeddable;
-import javax.persistence.Temporal;
-import javax.persistence.TemporalType;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.NonNull;
@@ -39,6 +40,7 @@ import org.onap.policy.common.utils.validation.Assertions;
 @Data
 @EqualsAndHashCode(callSuper = false)
 public class PfTimestampKey extends PfKeyImpl {
+    @Serial
     private static final long serialVersionUID = -8410208962541783805L;
 
     private static final String TIMESTAMP_TOKEN = "timeStamp";
@@ -77,12 +79,12 @@ public class PfTimestampKey extends PfKeyImpl {
     /**
      * Constructor to create a key with the specified name and version.
      *
-     * @param name the key name
+     * @param name    the key name
      * @param version the key version
      * @param instant the time stamp of key
      */
     public PfTimestampKey(@NonNull final String name, @NonNull final String version,
-            @NonNull final Instant instant) {
+                          @NonNull final Instant instant) {
         super(name, version);
         this.timeStamp = Date.from(instant);
     }
@@ -107,7 +109,7 @@ public class PfTimestampKey extends PfKeyImpl {
      *
      * @return a null key
      */
-    public static final PfTimestampKey getNullKey() {
+    public static PfTimestampKey getNullKey() {
         return new PfTimestampKey(PfKey.NULL_KEY_NAME, PfKey.NULL_KEY_VERSION, Instant.EPOCH);
     }
 
index 6f93010..51054ee 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019-2021 Nordix Foundation.
+ *  Copyright (C) 2019-2021, 2023 Nordix Foundation.
  *  Modifications Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -21,6 +21,7 @@
 
 package org.onap.policy.models.base;
 
+import jakarta.ws.rs.core.Response;
 import java.lang.reflect.InvocationTargetException;
 import java.util.Collection;
 import java.util.LinkedHashMap;
@@ -29,7 +30,6 @@ import java.util.Map;
 import java.util.Map.Entry;
 import java.util.function.Function;
 import java.util.stream.Collectors;
-import javax.ws.rs.core.Response;
 import lombok.AccessLevel;
 import lombok.NoArgsConstructor;
 import org.apache.commons.collections4.CollectionUtils;
@@ -46,7 +46,7 @@ public final class PfUtils {
     /**
      * Compare two objects using their equals methods, nulls are allowed.
      *
-     * @param leftObject the first object
+     * @param leftObject  the first object
      * @param rightObject the second object
      * @return a measure of the comparison
      */
@@ -73,7 +73,7 @@ public final class PfUtils {
     /**
      * Compare two collections of the same type, nulls are allowed.
      *
-     * @param leftCollection the first collection
+     * @param leftCollection  the first collection
      * @param rightCollection the second collection
      * @return a measure of the comparison
      */
@@ -89,7 +89,7 @@ public final class PfUtils {
     /**
      * Compare two maps of the same type, nulls are allowed.
      *
-     * @param leftMap the first map
+     * @param leftMap  the first map
      * @param rightMap the second map
      * @return a measure of the comparison
      */
@@ -102,12 +102,12 @@ public final class PfUtils {
     }
 
     /**
-     * Convenience method to apply a mapping function to all of the elements of a list, generating a new list.
+     * Convenience method to apply a mapping function to all the elements of a list, generating a new list.
      *
-     * @param source list whose elements are to be mapped, or {@code null}
-     * @param mapFunc mapping function
+     * @param source       list whose elements are to be mapped, or {@code null}
+     * @param mapFunc      mapping function
      * @param defaultValue value to be returned if source is {@code null}
-     * @return a new list, containing mappings of all of the items in the original list
+     * @return a new list, containing mappings of all the items in the original list
      */
     public static <T, R> List<R> mapList(List<T> source, Function<T, R> mapFunc, List<R> defaultValue) {
         if (source == null) {
@@ -118,27 +118,26 @@ public final class PfUtils {
     }
 
     /**
-     * Convenience method to apply a mapping function to all of the elements of a list, generating a new list.
+     * Convenience method to apply a mapping function to all the elements of a list, generating a new list.
      *
-     * @param source list whose elements are to be mapped, or {@code null}
+     * @param source  list whose elements are to be mapped, or {@code null}
      * @param mapFunc mapping function
-     * @return a new list, containing mappings of all of the items in the original list, or {@code null} if the source
-     *         is {@code null}
+     * @return a new list, containing mappings of all the items in the original list, or {@code null} if the source
+     *      is {@code null}
      */
     public static <T, R> List<R> mapList(List<T> source, Function<T, R> mapFunc) {
         return mapList(source, mapFunc, null);
     }
 
     /**
-     * Convenience method to apply a mapping function to all of the values of a map, generating a new map.
+     * Convenience method to apply a mapping function to all the values of a map, generating a new map.
      *
-     * @param source map whose values are to be mapped, or {@code null}
-     * @param mapFunc mapping function
+     * @param source       map whose values are to be mapped, or {@code null}
+     * @param mapFunc      mapping function
      * @param defaultValue value to be returned if source is {@code null}
-     * @return a new map, containing mappings of all of the items in the original map
+     * @return a new map, containing mappings of all the items in the original map
      */
-    public static <K, T, R> Map<K, R> mapMap(Map<K, T> source, Function<T, R> mapFunc,
-            Map<K, R> defaultValue) {
+    public static <K, T, R> Map<K, R> mapMap(Map<K, T> source, Function<T, R> mapFunc, Map<K, R> defaultValue) {
         if (source == null) {
             return defaultValue;
         }
@@ -152,12 +151,12 @@ public final class PfUtils {
     }
 
     /**
-     * Convenience method to apply a mapping function to all of the values of a map, generating a new map.
+     * Convenience method to apply a mapping function to all the values of a map, generating a new map.
      *
-     * @param source map whose values are to be mapped, or {@code null}
+     * @param source  map whose values are to be mapped, or {@code null}
      * @param mapFunc mapping function
-     * @return a new map, containing mappings of all of the items in the original map, or {@code null} if the source is
-     *         {@code null}
+     * @return a new map, containing mappings of all the items in the original map, or {@code null} if the source is
+     *      {@code null}
      */
     public static <K, T, R> Map<K, R> mapMap(Map<K, T> source, Function<T, R> mapFunc) {
         return mapMap(source, mapFunc, null);
@@ -176,15 +175,14 @@ public final class PfUtils {
         }
 
         try {
-            @SuppressWarnings("unchecked")
-            Class<? extends T> clazz = (Class<? extends T>) source.getClass();
+            @SuppressWarnings("unchecked") Class<? extends T> clazz = (Class<? extends T>) source.getClass();
 
             return clazz.getConstructor(clazz).newInstance(source);
 
         } catch (InstantiationException | IllegalAccessException | InvocationTargetException | NoSuchMethodException
-                | RuntimeException e) {
+                 | RuntimeException e) {
             throw new PfModelRuntimeException(Response.Status.INTERNAL_SERVER_ERROR,
-                    "error copying concept key class: " + source.getClass().getName(), e);
+                "error copying concept key class: " + source.getClass().getName(), e);
         }
     }
 }
index db7b9d6..c2eb2b6 100644 (file)
@@ -3,6 +3,7 @@
  * ONAP
  * ================================================================================
  * Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -48,11 +49,10 @@ public class PfValidator extends BeanValidator {
      * @return {@code true} if the next check should be performed, {@code false} otherwise
      */
     public boolean verPfMin(BeanValidationResult result, String fieldName, PfMin annot, Object value) {
-        if (!(value instanceof Number)) {
+        if (!(value instanceof Number num)) {
             return true;
         }
 
-        Number num = (Number) value;
         if (num.longValue() == annot.allowed()) {
             // this value is always allowed
             return true;
@@ -93,11 +93,10 @@ public class PfValidator extends BeanValidator {
      * @return {@code true} if the next check should be performed, {@code false} otherwise
      */
     public boolean verKey(BeanValidationResult result, String fieldName, VerifyKey annot, Object value) {
-        if (!(value instanceof PfKey)) {
+        if (!(value instanceof PfKey pfkey)) {
             return true;
         }
 
-        var pfkey = (PfKey) value;
         if (annot.keyNotNull() && pfkey.isNullKey()) {
             result.addResult(fieldName, xlate(pfkey), ValidationStatus.INVALID, Validated.IS_A_NULL_KEY);
             return false;
@@ -107,14 +106,12 @@ public class PfValidator extends BeanValidator {
             verCascade(result, fieldName, value);
         }
 
-        if (!(pfkey instanceof PfKeyImpl)) {
+        if (!(pfkey instanceof PfKeyImpl keyimpl)) {
             return true;
         }
 
         var result2 = new BeanValidationResult(fieldName, value);
 
-        PfKeyImpl keyimpl = (PfKeyImpl) pfkey;
-
         if (annot.nameNotNull() && keyimpl.isNullName()) {
             result2.addResult("name", pfkey.getName(), ValidationStatus.INVALID, Validated.IS_NULL);
         }
index 52d17e7..b92aed4 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- * Copyright (C) 2019, 2021 Nordix Foundation.
+ * Copyright (C) 2019, 2021, 2023 Nordix Foundation.
  * Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -24,9 +24,9 @@ package org.onap.policy.models.base;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 
+import jakarta.ws.rs.core.Response;
+import jakarta.ws.rs.core.Response.Status;
 import java.io.IOException;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.Response.Status;
 import org.junit.Test;
 import org.onap.policy.models.errors.concepts.ErrorResponse;
 
@@ -44,7 +44,7 @@ public class ExceptionsTest {
 
         String key = "A String";
         PfModelException ae =
-                new PfModelException(Response.Status.OK, MESSAGE, new IOException("IO exception message"), key);
+            new PfModelException(Response.Status.OK, MESSAGE, new IOException("IO exception message"), key);
         ErrorResponse errorResponse = ae.getErrorResponse();
         assertEquals("Message\nIO exception message", String.join("\n", errorResponse.getErrorDetails()));
         assertEquals(key, ae.getObject());
@@ -56,10 +56,10 @@ public class ExceptionsTest {
 
         String rkey = "A String";
         PfModelRuntimeException re = new PfModelRuntimeException(Response.Status.OK, "Runtime Message",
-                new IOException("IO runtime exception message"), rkey);
+            new IOException("IO runtime exception message"), rkey);
         errorResponse = re.getErrorResponse();
         assertEquals("Runtime Message\nIO runtime exception message",
-                String.join("\n", errorResponse.getErrorDetails()));
+            String.join("\n", errorResponse.getErrorDetails()));
         assertEquals(key, re.getObject());
 
         PfModelRuntimeException pfre = new PfModelRuntimeException(ae);
index f5c6e3a..c526b23 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019-2021 Nordix Foundation.
+ *  Copyright (C) 2019-2021, 2023 Nordix Foundation.
  *  Modifications Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -65,18 +65,18 @@ public class PfConceptContainerTest {
         container = new DummyPfConceptContainer(new PfConceptKey());
         assertNotNull(container);
 
-        container = new DummyPfConceptContainer(new PfConceptKey(), new TreeMap<PfConceptKey, DummyPfConcept>());
+        container = new DummyPfConceptContainer(new PfConceptKey(), new TreeMap<>());
         assertNotNull(container);
 
-        assertThatThrownBy(() -> new PfConceptContainer((PfConceptKey) null, null)).hasMessageMatching(KEY_IS_NULL);
+        assertThatThrownBy(() -> new PfConceptContainer(null, null)).hasMessageMatching(KEY_IS_NULL);
 
-        assertThatThrownBy(() -> new DummyPfConceptContainer((PfConceptKey) null, null))
+        assertThatThrownBy(() -> new DummyPfConceptContainer(null, null))
             .hasMessageMatching(KEY_IS_NULL);
 
         assertThatThrownBy(() -> new DummyPfConceptContainer(new PfConceptKey(), null))
             .hasMessageMatching("^conceptMap is marked .*on.*ull but is null$");
 
-        assertThatThrownBy(() -> new DummyPfConceptContainer(null, new TreeMap<PfConceptKey, DummyPfConcept>()))
+        assertThatThrownBy(() -> new DummyPfConceptContainer(null, new TreeMap<>()))
             .hasMessageMatching(KEY_IS_NULL);
     }
 
@@ -117,8 +117,8 @@ public class PfConceptContainerTest {
 
         assertThatThrownBy(() -> new DummyPfConceptContainer((DummyPfConceptContainer) null))
             .isInstanceOf(NullPointerException.class);
+        assertThatThrownBy(() -> container.compareTo(null)).isInstanceOf(NullPointerException.class);
 
-        assertNotEquals(0, container.compareTo(null));
         assertEquals(0, container.compareTo(container));
         assertNotEquals(0, container.compareTo(conceptKey));
 
@@ -271,7 +271,7 @@ public class PfConceptContainerTest {
     }
 
     @Test(expected = NullPointerException.class)
-    public void testnullKey() {
+    public void testNullKey() {
         PfConceptKey nullKey = null;
         new DummyPfConceptContainer(nullKey);
     }
index 5cebf1e..8b62020 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019-2020 Nordix Foundation.
+ *  Copyright (C) 2019-2020, 2023 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,7 +24,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 
-import javax.ws.rs.core.Response;
+import jakarta.ws.rs.core.Response;
 import org.junit.Test;
 import org.onap.policy.models.errors.concepts.ErrorResponseInfo;
 
index 812916e..ed8c138 100644 (file)
@@ -3,6 +3,7 @@
  * ONAP
  * ================================================================================
  * Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 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,8 +25,9 @@ import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 
+import jakarta.validation.Valid;
+import java.io.Serial;
 import java.util.concurrent.atomic.AtomicBoolean;
-import javax.validation.Valid;
 import lombok.Getter;
 import lombok.NonNull;
 import org.junit.Before;
@@ -123,13 +125,13 @@ public class PfValidatorTest {
         // null key
         data.key = new PfConceptKey();
         assertThat(validator.validateTop("", data).getResult())
-                        .contains(KEY_FIELD, "NULL:0.0.0", Validated.IS_A_NULL_KEY).doesNotContain("name", "version");
+            .contains(KEY_FIELD, "NULL:0.0.0", Validated.IS_A_NULL_KEY).doesNotContain("name", "version");
 
         // invalid version - should invoke verCascade() which will invoke key.validate()
         data.key = new StandardCoder().decode("{'name':'abc', 'version':'xyzzy'}".replace('\'', '"'),
-                        PfConceptKey.class);
+            PfConceptKey.class);
         assertThat(validator.validateTop("", data).getResult())
-                        .contains(KEY_FIELD, "version", "xyzzy", "regular expression").doesNotContain("name");
+            .contains(KEY_FIELD, "version", "xyzzy", "regular expression").doesNotContain("name");
 
         // not a PfKeyImpl - should not check individual fields
         PfKey pfkey = mock(PfKey.class);
@@ -142,18 +144,18 @@ public class PfValidatorTest {
         // null name
         data.key = new PfConceptKey(PfKey.NULL_KEY_NAME, "2.3.4");
         assertThat(validator.validateTop("", data).getResult()).contains(KEY_FIELD, "name", "null")
-                        .doesNotContain("version", "2.3.4");
+            .doesNotContain("version", "2.3.4");
 
         // null version
         data.key = new PfConceptKey(STRING_VALUE, PfKey.NULL_KEY_VERSION);
         assertThat(validator.validateTop("", data).getResult()).contains(KEY_FIELD, "version", "null")
-                        .doesNotContain("name", STRING_VALUE);
+            .doesNotContain("name", STRING_VALUE);
 
         // null name, invalid version - should get two messages
         data.key = new StandardCoder().decode("{'name':'NULL', 'version':'xyzzy'}".replace('\'', '"'),
-                        PfConceptKey.class);
+            PfConceptKey.class);
         assertThat(validator.validateTop("", data).getResult()).contains(KEY_FIELD, "name", "null", "version", "xyzzy",
-                        "regular expression");
+            "regular expression");
 
         /*
          * Tests with all flags set to "false" (i.e., no validations).
@@ -165,6 +167,7 @@ public class PfValidatorTest {
         AtomicBoolean called = new AtomicBoolean();
 
         data2.key = new PfConceptKey() {
+            @Serial
             private static final long serialVersionUID = 1L;
 
             @Override
index 548c262..25a6cb7 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019 Nordix Foundation.
+ *  Copyright (C) 2019, 2023 Nordix Foundation.
  *  Modifications Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -21,8 +21,9 @@
 
 package org.onap.policy.models.base.testconcepts;
 
+import jakarta.persistence.EmbeddedId;
+import java.io.Serial;
 import java.util.List;
-import javax.persistence.EmbeddedId;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.NonNull;
@@ -38,6 +39,7 @@ import org.onap.policy.models.base.validation.annotations.VerifyKey;
 @Data
 @EqualsAndHashCode(callSuper = false)
 public class DummyPfConcept extends PfConcept implements PfAuthorative<DummyAuthorativeConcept> {
+    @Serial
     private static final long serialVersionUID = 1L;
 
     @EmbeddedId
index 8352697..b204895 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019 Nordix Foundation.
+ *  Copyright (C) 2019, 2023 Nordix Foundation.
  *  Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -21,7 +21,7 @@
 
 package org.onap.policy.models.base.testconcepts;
 
-import javax.ws.rs.core.Response;
+import jakarta.ws.rs.core.Response;
 import lombok.NonNull;
 import org.onap.policy.models.base.PfConceptKey;
 import org.onap.policy.models.base.PfModelRuntimeException;
index 2c3fd18..089773d 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019 Nordix Foundation.
+ *  Copyright (C) 2019, 2023 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.models.base.testconcepts;
 
-import javax.ws.rs.core.Response;
+import jakarta.ws.rs.core.Response;
+import java.io.Serial;
 import lombok.NonNull;
 import org.onap.policy.models.base.PfConceptKey;
 import org.onap.policy.models.base.PfModelRuntimeException;
 
 public class DummyPfConceptSub extends DummyPfConcept {
+    @Serial
     private static final long serialVersionUID = 1L;
 
     /**
index 015d1a9..594528b 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019 Nordix Foundation.
+ *  Copyright (C) 2019, 2023 Nordix Foundation.
  *  Modifications Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -21,7 +21,7 @@
 
 package org.onap.policy.models.base.testconcepts;
 
-import java.util.Arrays;
+import java.io.Serial;
 import java.util.List;
 import lombok.NonNull;
 import org.onap.policy.common.parameters.BeanValidationResult;
@@ -29,6 +29,7 @@ import org.onap.policy.models.base.PfConcept;
 import org.onap.policy.models.base.PfKey;
 
 public class DummyPfKey extends PfKey {
+    @Serial
     private static final long serialVersionUID = 1L;
 
     public DummyPfKey() {
@@ -40,7 +41,7 @@ public class DummyPfKey extends PfKey {
     }
 
     @Override
-    public int compareTo(PfConcept arg0) {
+    public int compareTo(@NonNull PfConcept arg0) {
         return 0;
     }
 
@@ -55,12 +56,12 @@ public class DummyPfKey extends PfKey {
     }
 
     @Override
-    public Compatibility getCompatibility(PfKey otherKey) {
+    public Compatibility getCompatibility(@NonNull PfKey otherKey) {
         return null;
     }
 
     @Override
-    public boolean isCompatible(PfKey otherKey) {
+    public boolean isCompatible(@NonNull PfKey otherKey) {
         return false;
     }
 
@@ -71,7 +72,7 @@ public class DummyPfKey extends PfKey {
 
     @Override
     public List<PfKey> getKeys() {
-        return Arrays.asList(getKey());
+        return List.of(getKey());
     }
 
     @Override
index e301eaf..8529540 100644 (file)
   ============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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+         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">
     <modelVersion>4.0.0</modelVersion>
     <parent>
         <groupId>org.onap.policy.models</groupId>
         <artifactId>policy-models</artifactId>
-        <version>3.0.0-SNAPSHOT</version>
+        <version>3.0.1-SNAPSHOT</version>
     </parent>
 
     <artifactId>policy-models-dao</artifactId>
     <name>${project.artifactId}</name>
-    <description>[${project.parent.artifactId}] module provides common DAO (Data Access Object) model handling for the ONAP Policy Framework</description>
+    <description>[${project.parent.artifactId}] module provides common DAO (Data Access Object) model handling for the
+        ONAP Policy Framework
+    </description>
 
     <dependencies>
         <dependency>
index 177a7f3..a4f0985 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019 Nordix Foundation.
+ *  Copyright (C) 2019, 2023 Nordix Foundation.
  *  Modifications Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -21,8 +21,8 @@
 
 package org.onap.policy.models.dao;
 
+import jakarta.ws.rs.core.Response;
 import java.lang.reflect.InvocationTargetException;
-import javax.ws.rs.core.Response;
 import org.onap.policy.common.utils.validation.Assertions;
 import org.onap.policy.models.base.PfModelException;
 import org.slf4j.Logger;
@@ -50,7 +50,7 @@ public class PfDaoFactory {
                 "Parameter \"daoParameters\" may not be null");
 
         // Get the class for the DAO using reflection
-        Object pfDaoObject = null;
+        Object pfDaoObject;
         try {
             pfDaoObject = Class.forName(daoParameters.getPluginClass()).getDeclaredConstructor().newInstance();
         } catch (InstantiationException | IllegalAccessException | ClassNotFoundException | IllegalArgumentException
index 7afe243..bba494d 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2021 Nordix Foundation.
+ *  Copyright (C) 2021, 2023 Nordix Foundation.
  *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -21,9 +21,9 @@
 
 package org.onap.policy.models.dao;
 
+import jakarta.persistence.TypedQuery;
 import java.sql.Timestamp;
 import java.util.Map;
-import javax.persistence.TypedQuery;
 import lombok.Data;
 import org.onap.policy.models.base.PfConcept;
 
index 4a3a4da..f36ef58 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019 Nordix Foundation.
+ *  Copyright (C) 2019, 2023 Nordix Foundation.
  *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -22,9 +22,9 @@
 package org.onap.policy.models.dao.converters;
 
 import com.google.re2j.Pattern;
-import javax.persistence.AttributeConverter;
-import javax.persistence.Converter;
-import javax.xml.bind.annotation.adapters.XmlAdapter;
+import jakarta.persistence.AttributeConverter;
+import jakarta.persistence.Converter;
+import jakarta.xml.bind.annotation.adapters.XmlAdapter;
 
 /**
  * The Class CDataConditioner converts a CDATA String to and from database format by removing spaces
@@ -62,7 +62,7 @@ public class CDataConditioner extends XmlAdapter<String, String> implements Attr
      * @param in the in
      * @return the string
      */
-    public static final String clean(final String in) {
+    public static String clean(final String in) {
         if (in == null) {
             return null;
         } else {
index 965a71c..9f589de 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019 Nordix Foundation.
+ *  Copyright (C) 2019, 2023 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.models.dao.converters;
 
+import jakarta.persistence.AttributeConverter;
+import jakarta.persistence.Converter;
+import jakarta.xml.bind.annotation.adapters.XmlAdapter;
 import java.util.UUID;
-import javax.persistence.AttributeConverter;
-import javax.persistence.Converter;
-import javax.xml.bind.annotation.adapters.XmlAdapter;
 
 /**
  * The Class UuidConverter converts a UUID to and from database format.
index 13a4eea..c4b2598 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019-2021,2023 Nordix Foundation.
+ *  Copyright (C) 2019-2021, 2023 Nordix Foundation.
  *  Modifications Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
  *  Modifications Copyright (C) 2022 Bell Canada. All rights reserved.
  * ================================================================================
 
 package org.onap.policy.models.dao.impl;
 
+import jakarta.persistence.EntityManager;
+import jakarta.persistence.EntityManagerFactory;
+import jakarta.persistence.Persistence;
+import jakarta.persistence.TypedQuery;
+import jakarta.ws.rs.core.Response;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
-import javax.persistence.EntityManager;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.Persistence;
-import javax.persistence.TypedQuery;
-import javax.ws.rs.core.Response;
 import org.apache.commons.lang3.StringUtils;
 import org.onap.policy.models.base.PfConcept;
 import org.onap.policy.models.base.PfConceptKey;
@@ -49,7 +49,7 @@ import org.slf4j.LoggerFactory;
 
 /**
  * The Class DefaultPfDao is an JPA implementation of the {@link PfDao} class for Policy Framework concepts
- * ({@link PfConcept}). It uses the default JPA implementation in the javax {@link Persistence} class.
+ * ({@link PfConcept}). It uses the default JPA implementation in the jakarta {@link Persistence} class.
  */
 public class DefaultPfDao implements PfDao {
     private static final Logger LOGGER = LoggerFactory.getLogger(DefaultPfDao.class);
@@ -156,13 +156,10 @@ public class DefaultPfDao implements PfDao {
         if (obj == null) {
             return;
         }
-        final var mg = getEntityManager();
-        try {
+        try (var mg = getEntityManager()) {
             mg.getTransaction().begin();
             mg.merge(obj);
             mg.getTransaction().commit();
-        } finally {
-            mg.close();
         }
     }
 
@@ -171,13 +168,10 @@ public class DefaultPfDao implements PfDao {
         if (obj == null) {
             return;
         }
-        final var mg = getEntityManager();
-        try {
+        try (var mg = getEntityManager()) {
             mg.getTransaction().begin();
             mg.remove(mg.contains(obj) ? obj : mg.merge(obj));
             mg.getTransaction().commit();
-        } finally {
-            mg.close();
         }
     }
 
@@ -186,8 +180,7 @@ public class DefaultPfDao implements PfDao {
         if (key == null) {
             return;
         }
-        final var mg = getEntityManager();
-        try {
+        try (var mg = getEntityManager()) {
             // @formatter:off
             mg.getTransaction().begin();
             mg.createQuery(setQueryTable(DELETE_BY_CONCEPT_KEY, someClass))
@@ -196,8 +189,6 @@ public class DefaultPfDao implements PfDao {
                 .executeUpdate();
             mg.getTransaction().commit();
             // @formatter:on
-        } finally {
-            mg.close();
         }
     }
 
@@ -206,8 +197,7 @@ public class DefaultPfDao implements PfDao {
         if (key == null) {
             return;
         }
-        final var mg = getEntityManager();
-        try {
+        try (var mg = getEntityManager()) {
             // @formatter:off
             mg.getTransaction().begin();
             mg.createQuery(setQueryTable(DELETE_BY_REFERENCE_KEY, someClass))
@@ -217,8 +207,6 @@ public class DefaultPfDao implements PfDao {
                 .executeUpdate();
             mg.getTransaction().commit();
             // @formatter:on
-        } finally {
-            mg.close();
         }
     }
 
@@ -227,8 +215,7 @@ public class DefaultPfDao implements PfDao {
         if (key == null) {
             return;
         }
-        final var mg = getEntityManager();
-        try {
+        try (var mg = getEntityManager()) {
             // @formatter:off
             mg.getTransaction().begin();
             mg.createQuery(setQueryTable(DELETE_BY_TIMESTAMP_KEY, someClass))
@@ -238,8 +225,6 @@ public class DefaultPfDao implements PfDao {
                     .executeUpdate();
             mg.getTransaction().commit();
             // @formatter:on
-        } finally {
-            mg.close();
         }
     }
 
@@ -248,15 +233,12 @@ public class DefaultPfDao implements PfDao {
         if (objs == null || objs.isEmpty()) {
             return;
         }
-        final var mg = getEntityManager();
-        try {
+        try (var mg = getEntityManager()) {
             mg.getTransaction().begin();
             for (final T t : objs) {
                 mg.merge(t);
             }
             mg.getTransaction().commit();
-        } finally {
-            mg.close();
         }
     }
 
@@ -265,15 +247,12 @@ public class DefaultPfDao implements PfDao {
         if (objs == null || objs.isEmpty()) {
             return;
         }
-        final var mg = getEntityManager();
-        try {
+        try (var mg = getEntityManager()) {
             mg.getTransaction().begin();
             for (final T t : objs) {
                 mg.remove(mg.contains(t) ? t : mg.merge(t));
             }
             mg.getTransaction().commit();
-        } finally {
-            mg.close();
         }
     }
 
@@ -283,8 +262,7 @@ public class DefaultPfDao implements PfDao {
             return 0;
         }
         var deletedCount = 0;
-        final var mg = getEntityManager();
-        try {
+        try (var mg = getEntityManager()) {
             // @formatter:off
             mg.getTransaction().begin();
             for (final PfConceptKey key : keys) {
@@ -295,21 +273,18 @@ public class DefaultPfDao implements PfDao {
             }
             mg.getTransaction().commit();
             // @formatter:on
-        } finally {
-            mg.close();
         }
         return deletedCount;
     }
 
     @Override
     public <T extends PfConcept> int deleteByReferenceKey(final Class<T> someClass,
-        final Collection<PfReferenceKey> keys) {
+                                                          final Collection<PfReferenceKey> keys) {
         if (keys == null || keys.isEmpty()) {
             return 0;
         }
         var deletedCount = 0;
-        final var mg = getEntityManager();
-        try {
+        try (var mg = getEntityManager()) {
             // @formatter:off
             mg.getTransaction().begin();
             for (final PfReferenceKey key : keys) {
@@ -321,27 +296,22 @@ public class DefaultPfDao implements PfDao {
             }
             mg.getTransaction().commit();
             // @formatter:on
-        } finally {
-            mg.close();
         }
         return deletedCount;
     }
 
     @Override
     public <T extends PfConcept> void deleteAll(final Class<T> someClass) {
-        final var mg = getEntityManager();
-        try {
+        try (var mg = getEntityManager()) {
             mg.getTransaction().begin();
             mg.createQuery(setQueryTable(DELETE_FROM_TABLE, someClass)).executeUpdate();
             mg.getTransaction().commit();
-        } finally {
-            mg.close();
         }
     }
 
     @Override
     public <T extends PfConcept> List<T> getFiltered(final Class<T> someClass, final String name,
-        final String version) {
+                                                     final String version) {
         if (name == null) {
             return getAll(someClass);
         }
@@ -357,9 +327,8 @@ public class DefaultPfDao implements PfDao {
 
     @Override
     public <T extends PfConcept> List<T> getFiltered(final Class<T> someClass, PfFilterParametersIntfc filterParams) {
-        final var mg = getEntityManager();
 
-        try {
+        try (var mg = getEntityManager()) {
             PfFilter filter = new PfFilterFactory().createFilter(someClass);
             var filterQueryString = SELECT_FROM_TABLE
                 + filter.genWhereClause(filterParams)
@@ -370,8 +339,6 @@ public class DefaultPfDao implements PfDao {
 
             LOGGER.debug("filterQueryString is  \"{}\"", filterQueryString);
             return query.getResultList();
-        } finally {
-            mg.close();
         }
     }
 
@@ -399,15 +366,12 @@ public class DefaultPfDao implements PfDao {
         if (someClass == null) {
             return null;
         }
-        final var mg = getEntityManager();
-        try {
+        try (var mg = getEntityManager()) {
             final var t = mg.find(someClass, key);
             if (t != null) {
                 mg.refresh(t);
             }
             return checkAndReturn(someClass, t);
-        } finally {
-            mg.close();
         }
     }
 
@@ -416,11 +380,8 @@ public class DefaultPfDao implements PfDao {
         if (someClass == null) {
             return Collections.emptyList();
         }
-        final var mg = getEntityManager();
-        try {
+        try (var mg = getEntityManager()) {
             return mg.createQuery(setQueryTable(SELECT_FROM_TABLE, someClass), someClass).getResultList();
-        } finally {
-            mg.close();
         }
     }
 
@@ -429,16 +390,13 @@ public class DefaultPfDao implements PfDao {
         if (someClass == null) {
             return Collections.emptyList();
         }
-        final var mg = getEntityManager();
-        try {
+        try (var mg = getEntityManager()) {
             // @formatter:off
             return mg.createQuery(setQueryTable(SELECT_ALL_FOR_PARENT, someClass), someClass)
                     .setParameter(PARENT_NAME,    parentKey.getName())
                     .setParameter(PARENT_VERSION, parentKey.getVersion())
                     .getResultList();
             // @formatter:on
-        } finally {
-            mg.close();
         }
     }
 
@@ -448,8 +406,7 @@ public class DefaultPfDao implements PfDao {
         if (someClass == null) {
             return Collections.emptyList();
         }
-        final var mg = getEntityManager();
-        try {
+        try (var mg = getEntityManager()) {
             String query = setQueryTable(SELECT_FROM_TABLE, someClass);
 
             if (StringUtils.isNotBlank(orderBy)) {
@@ -458,8 +415,6 @@ public class DefaultPfDao implements PfDao {
 
             return mg.createQuery(query, someClass).setMaxResults(numRecords)
                 .getResultList();
-        } finally {
-            mg.close();
         }
     }
 
@@ -468,15 +423,12 @@ public class DefaultPfDao implements PfDao {
         if (someClass == null || parentKeyName == null) {
             return Collections.emptyList();
         }
-        final var mg = getEntityManager();
-        try {
+        try (var mg = getEntityManager()) {
             // @formatter:off
             return mg.createQuery(setQueryTable(SELECT_ALL_VERSIONS_FOR_PARENT, someClass), someClass)
                     .setParameter(PARENT_NAME, parentKeyName)
                     .getResultList();
             // @formatter:on
-        } finally {
-            mg.close();
         }
     }
 
@@ -485,15 +437,12 @@ public class DefaultPfDao implements PfDao {
         if (someClass == null || conceptName == null) {
             return Collections.emptyList();
         }
-        final var mg = getEntityManager();
-        try {
+        try (var mg = getEntityManager()) {
             // @formatter:off
             return mg.createQuery(setQueryTable(SELECT_ALL_VERSIONS, someClass), someClass)
                     .setParameter(NAME, conceptName)
                     .getResultList();
             // @formatter:on
-        } finally {
-            mg.close();
         }
     }
 
@@ -502,17 +451,14 @@ public class DefaultPfDao implements PfDao {
         if (someClass == null || key == null) {
             return null;
         }
-        final var mg = getEntityManager();
         List<T> ret;
-        try {
+        try (var mg = getEntityManager()) {
             // @formatter:off
             ret = mg.createQuery(setQueryTable(SELECT_BY_CONCEPT_KEY, someClass), someClass)
                     .setParameter(NAME,    key.getName())
                     .setParameter(VERSION, key.getVersion())
                     .getResultList();
             // @formatter:on
-        } finally {
-            mg.close();
         }
 
         return getSingleResult(someClass, key.getId(), ret);
@@ -523,9 +469,8 @@ public class DefaultPfDao implements PfDao {
         if (someClass == null || key == null) {
             return null;
         }
-        final var mg = getEntityManager();
         List<T> ret;
-        try {
+        try (var mg = getEntityManager()) {
             // @formatter:off
             ret = mg.createQuery(setQueryTable(SELECT_BY_REFERENCE_KEY, someClass), someClass)
                     .setParameter(PARENT_NAME,    key.getParentKeyName())
@@ -533,8 +478,6 @@ public class DefaultPfDao implements PfDao {
                     .setParameter(LOCAL_NAME,     key.getLocalName())
                     .getResultList();
             // @formatter:on
-        } finally {
-            mg.close();
         }
 
         return getSingleResult(someClass, key.getId(), ret);
@@ -542,15 +485,12 @@ public class DefaultPfDao implements PfDao {
 
     @Override
     public <T extends PfConcept> T update(final T obj) {
-        final var mg = getEntityManager();
         T ret;
-        try {
+        try (var mg = getEntityManager()) {
             mg.getTransaction().begin();
             ret = mg.merge(obj);
             mg.flush();
             mg.getTransaction().commit();
-        } finally {
-            mg.close();
         }
         return ret;
     }
@@ -560,17 +500,14 @@ public class DefaultPfDao implements PfDao {
         if (someClass == null) {
             return 0;
         }
-        final var mg = getEntityManager();
-        long size = 0;
-        try {
+        long size;
+        try (var mg = getEntityManager()) {
             /*
              * The invoking code only passes well-known classes into this method, thus
              * disabling the sonar about SQL injection.
              */
             size = mg.createQuery("SELECT COUNT(c) FROM " + someClass.getSimpleName() + " c", Long.class) // NOSONAR
                 .getSingleResult();
-        } finally {
-            mg.close();
         }
         return size;
     }
@@ -579,7 +516,7 @@ public class DefaultPfDao implements PfDao {
      * Add the table to a query string.
      *
      * @param queryString the query string
-     * @param tableClass the class name of the table
+     * @param tableClass  the class name of the table
      * @return the updated query string
      */
     private <T extends PfConcept> String setQueryTable(final String queryString, final Class<T> tableClass) {
@@ -589,13 +526,13 @@ public class DefaultPfDao implements PfDao {
     /**
      * Check that a query returned one and only one entry and return that entry.
      *
-     * @param someClass the class being searched for
+     * @param someClass    the class being searched for
      * @param searchFilter the search filter
-     * @param resultList the result list returned by the query
+     * @param resultList   the result list returned by the query
      * @return the single unique result
      */
     private <T extends PfConcept> T getSingleResult(final Class<T> someClass, final String searchFilter,
-        List<T> resultList) {
+                                                    List<T> resultList) {
         if (resultList == null || resultList.isEmpty()) {
             return null;
         }
@@ -609,8 +546,8 @@ public class DefaultPfDao implements PfDao {
     /**
      * check the result get from database and return the object.
      *
-     * @param <T> the type of the object to get, a subclass of {@link PfConcept}
-     * @param someClass the class of the object to get, a subclass of {@link PfConcept}
+     * @param <T>        the type of the object to get, a subclass of {@link PfConcept}
+     * @param someClass  the class of the object to get, a subclass of {@link PfConcept}
      * @param objToCheck the object that was retrieved from the database
      * @return the checked object or null
      */
index d0681e1..cdf2a98 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2021 Nordix Foundation.
+ *  Copyright (C) 2021, 2023 Nordix Foundation.
  *  Modifications Copyright (C) 2022 Bell Canada. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
 
 package org.onap.policy.models.dao.impl;
 
+import jakarta.persistence.EntityManager;
+import jakarta.persistence.Persistence;
+import jakarta.persistence.TypedQuery;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
-import javax.persistence.EntityManager;
-import javax.persistence.Persistence;
-import javax.persistence.TypedQuery;
 import lombok.RequiredArgsConstructor;
 import org.apache.commons.lang3.StringUtils;
 import org.onap.policy.models.base.PfConcept;
@@ -46,7 +46,7 @@ import org.slf4j.LoggerFactory;
 
 /**
  * The Class ProxyDao is an JPA implementation of the {@link ProxyDao} class for Policy Framework concepts
- * ({@link PfConcept}). It uses the default JPA implementation in the javax {@link Persistence} class.
+ * ({@link PfConcept}). It uses the default JPA implementation in the jakarta {@link Persistence} class.
  */
 @RequiredArgsConstructor
 public class ProxyDao implements PfDao {
index 4ef3eb9..cae8cff 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019 Nordix Foundation.
+ *  Copyright (C) 2019, 2023 Nordix Foundation.
  *  Modifications Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
 
 package org.onap.policy.models.dao;
 
+import jakarta.persistence.Column;
+import jakarta.persistence.EmbeddedId;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Table;
+import java.io.Serial;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.UUID;
-import javax.persistence.Column;
-import javax.persistence.EmbeddedId;
-import javax.persistence.Entity;
-import javax.persistence.Table;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.NonNull;
@@ -42,6 +43,7 @@ import org.onap.policy.models.base.PfKey;
 @Data
 @EqualsAndHashCode(callSuper = false)
 public class DummyConceptEntity extends PfConcept {
+    @Serial
     private static final long serialVersionUID = -2962570563281067894L;
 
     @EmbeddedId()
index abd9e53..ae22527 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019 Nordix Foundation.
+ *  Copyright (C) 2019, 2023 Nordix Foundation.
  *  Modifications Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
 
 package org.onap.policy.models.dao;
 
+import jakarta.persistence.Column;
+import jakarta.persistence.EmbeddedId;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Table;
+import java.io.Serial;
 import java.util.ArrayList;
 import java.util.List;
-import javax.persistence.Column;
-import javax.persistence.EmbeddedId;
-import javax.persistence.Entity;
-import javax.persistence.Table;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.NonNull;
@@ -41,6 +42,7 @@ import org.onap.policy.models.base.PfReferenceKey;
 @Data
 @EqualsAndHashCode(callSuper = false)
 public class DummyReferenceEntity extends PfConcept {
+    @Serial
     private static final long serialVersionUID = -2962570563281067894L;
 
     @EmbeddedId()
index b498344..8b01875 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2021 Nordix Foundation.
+ *  Copyright (C) 2021, 2023 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.models.dao;
 
+import jakarta.persistence.Column;
+import jakarta.persistence.EmbeddedId;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Table;
+import java.io.Serial;
 import java.util.ArrayList;
 import java.util.List;
-import javax.persistence.Column;
-import javax.persistence.EmbeddedId;
-import javax.persistence.Entity;
-import javax.persistence.Table;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.NonNull;
@@ -39,6 +40,7 @@ import org.onap.policy.models.base.PfReferenceTimestampKey;
 @Data
 @EqualsAndHashCode(callSuper = false)
 public class DummyReferenceTimestampEntity extends PfConcept {
+    @Serial
     private static final long serialVersionUID = -2962570563281067895L;
 
     @EmbeddedId()
index 37b18c1..76ac7f7 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2020 Nordix Foundation.
+ *  Copyright (C) 2020, 2023 Nordix Foundation.
  *  Modifications Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
 
 package org.onap.policy.models.dao;
 
+import jakarta.persistence.Column;
+import jakarta.persistence.EmbeddedId;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Table;
+import java.io.Serial;
 import java.util.ArrayList;
 import java.util.List;
-import javax.persistence.Column;
-import javax.persistence.EmbeddedId;
-import javax.persistence.Entity;
-import javax.persistence.Table;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.NonNull;
@@ -40,6 +41,7 @@ import org.onap.policy.models.base.PfTimestampKey;
 @Data
 @EqualsAndHashCode(callSuper = false)
 public class DummyTimestampEntity extends PfConcept {
+    @Serial
     private static final long serialVersionUID = -2962570563281067895L;
 
     @EmbeddedId()
index 7eec5fb..62a3f39 100644 (file)
 -->
 
 <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>
         <groupId>org.onap.policy.models</groupId>
         <artifactId>policy-models</artifactId>
-        <version>3.0.0-SNAPSHOT</version>
+        <version>3.0.1-SNAPSHOT</version>
     </parent>
 
     <artifactId>policy-models-decisions</artifactId>
index f5be10b..f324fa5 100644 (file)
@@ -3,6 +3,7 @@
  * ONAP Policy Decision Models
  * ================================================================================
  * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 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,7 +21,8 @@
 
 package org.onap.policy.models.decisions.concepts;
 
-import javax.ws.rs.core.Response;
+import jakarta.ws.rs.core.Response;
+import java.io.Serial;
 import lombok.Getter;
 import lombok.ToString;
 import org.onap.policy.models.errors.concepts.ErrorResponse;
@@ -30,6 +32,7 @@ import org.onap.policy.models.errors.concepts.ErrorResponseUtils;
 @Getter
 @ToString
 public class DecisionException extends RuntimeException implements ErrorResponseInfo {
+    @Serial
     private static final long serialVersionUID = -1255351537691201052L;
     private final ErrorResponse errorResponse = new ErrorResponse();
 
index 3d951c0..cff4e0c 100644 (file)
@@ -1,6 +1,6 @@
 <!--
   ============LICENSE_START=======================================================
-   Copyright (C) 2019 Nordix Foundation.
+   Copyright (C) 2019, 2023 Nordix Foundation.
    Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
   ================================================================================
   Licensed under the Apache License, Version 2.0 (the "License");
 -->
 
 <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>
         <groupId>org.onap.policy.models</groupId>
         <artifactId>policy-models</artifactId>
-        <version>3.0.0-SNAPSHOT</version>
+        <version>3.0.1-SNAPSHOT</version>
     </parent>
 
     <artifactId>policy-models-errors</artifactId>
             <artifactId>gson</artifactId>
             <version>${policy.common.version}</version>
         </dependency>
-        <dependency>
-            <groupId>com.openpojo</groupId>
-            <artifactId>openpojo</artifactId>
-            <scope>test</scope>
-        </dependency>
     </dependencies>
 </project>
index 1f1fc0e..b06037e 100644 (file)
@@ -3,6 +3,7 @@
  * ONAP Policy Decision Models
  * ================================================================================
  * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 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.models.errors.concepts;
 
 import com.google.gson.annotations.SerializedName;
+import jakarta.ws.rs.core.Response;
+import java.io.Serial;
 import java.io.Serializable;
 import java.util.List;
-import javax.ws.rs.core.Response;
 import lombok.Data;
 
 /**
@@ -31,19 +33,19 @@ import lombok.Data;
  * response from API calls in the Policy Framework.
  *
  * @author pameladragosh
- *
  */
 @Data
 public class ErrorResponse implements Serializable {
+    @Serial
     private static final long serialVersionUID = 6760066094588944729L;
 
     @SerializedName("code")
-    private Response.Status  responseCode;
+    private Response.Status responseCode;
     @SerializedName("error")
-    private String  errorMessage;
+    private String errorMessage;
     @SerializedName("details")
-    private List<String>    errorDetails;
+    private List<String> errorDetails;
     @SerializedName("warnings")
-    private List<String>    warningDetails;
+    private List<String> warningDetails;
 
 }
index 1373cce..0be37f4 100644 (file)
@@ -3,6 +3,7 @@
  * ONAP Policy Decision Models
  * ================================================================================
  * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 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.models.errors.concepts;
 import static org.assertj.core.api.Assertions.assertThatCode;
 import static org.junit.Assert.assertEquals;
 
-import java.util.Arrays;
-import javax.ws.rs.core.Response;
+import jakarta.ws.rs.core.Response;
+import java.util.List;
 import org.junit.Test;
 import org.onap.policy.common.utils.coder.StandardCoder;
 import org.slf4j.Logger;
@@ -42,9 +43,9 @@ public class ErrorResponseTest {
             error.setResponseCode(Response.Status.NOT_ACCEPTABLE);
             error.setErrorMessage("Missing metadata section");
 
-            error.setErrorDetails(Arrays.asList("You must have a metadata section with policy-id value"));
+            error.setErrorDetails(List.of("You must have a metadata section with policy-id value"));
 
-            error.setWarningDetails(Arrays.asList("Please make sure topology template field is included."));
+            error.setWarningDetails(List.of("Please make sure topology template field is included."));
 
             StandardCoder coder = new StandardCoder();
             String jsonOutput = coder.encode(error);
index 668530d..ce400b9 100644 (file)
   ============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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+         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">
     <modelVersion>4.0.0</modelVersion>
     <parent>
         <groupId>org.onap.policy.models</groupId>
         <artifactId>policy-models</artifactId>
-        <version>3.0.0-SNAPSHOT</version>
+        <version>3.0.1-SNAPSHOT</version>
     </parent>
 
     <artifactId>policy-models-examples</artifactId>
@@ -33,7 +33,7 @@
     <description>Various examples of policy type and policy models in various formats</description>
 
     <properties>
-        <!-- There is no code in this sub-module, only holds interfaces. So skip sonar. -->
+        <!-- There is no code in this submodule, only holds interfaces. So skip sonar. -->
         <sonar.skip>true</sonar.skip>
     </properties>
 </project>
index 7b891c3..60eb3e3 100644 (file)
@@ -2,7 +2,7 @@
 <!--
   ============LICENSE_START=======================================================
   Copyright (C) 2018 Wipro Limited Intellectual Property. All rights reserved.
-  Modifications Copyright (C) 2019-2020,2023 Nordix Foundation.
+  Modifications Copyright (C) 2019-2020, 2023 Nordix Foundation.
   Modifications Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
   ================================================================================
   Licensed under the Apache License, Version 2.0 (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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+         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">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
         <artifactId>model-actors</artifactId>
-        <version>3.0.0-SNAPSHOT</version>
+        <version>3.0.1-SNAPSHOT</version>
     </parent>
 
     <artifactId>actor.a1p</artifactId>
             <artifactId>gson</artifactId>
             <scope>test</scope>
         </dependency>
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <scope>test</scope>
-        </dependency>
         <dependency>
             <groupId>org.onap.policy.models.policy-models-interactions</groupId>
             <artifactId>simulators</artifactId>
             <version>${project.version}</version>
             <scope>test</scope>
         </dependency>
-        <dependency>
-            <groupId>org.mockito</groupId>
-            <artifactId>mockito-core</artifactId>
-            <scope>test</scope>
-        </dependency>
     </dependencies>
 </project>
index f2f9ba8..3d395f7 100644 (file)
@@ -2,7 +2,7 @@
 <!--
   ============LICENSE_START=======================================================
   Copyright (C) 2018 Huawei Intellectual Property. All rights reserved.
-  Modifications Copyright (C) 2019-2020,2023 Nordix Foundation.
+  Modifications Copyright (C) 2019-2020, 2023 Nordix Foundation.
   Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
   ================================================================================
   Licensed under the Apache License, Version 2.0 (the "License");
   -->
 
 <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">
+         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">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
         <artifactId>model-actors</artifactId>
-        <version>3.0.0-SNAPSHOT</version>
+        <version>3.0.1-SNAPSHOT</version>
     </parent>
 
     <artifactId>actor.aai</artifactId>
             <version>${policy.common.version}</version>
             <scope>provided</scope>
         </dependency>
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <scope>test</scope>
-        </dependency>
         <dependency>
             <groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
             <artifactId>actor.test</artifactId>
             <version>${project.version}</version>
             <scope>test</scope>
         </dependency>
-        <dependency>
-            <groupId>org.mockito</groupId>
-            <artifactId>mockito-core</artifactId>
-            <scope>test</scope>
-        </dependency>
     </dependencies>
 </project>
index ca3a55c..0f9e2a1 100644 (file)
@@ -3,6 +3,7 @@
  * ONAP
  * ================================================================================
  * Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 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.controlloop.actor.aai;
 
+import jakarta.ws.rs.client.Entity;
+import jakarta.ws.rs.client.Invocation.Builder;
+import jakarta.ws.rs.client.WebTarget;
+import jakarta.ws.rs.core.MediaType;
+import jakarta.ws.rs.core.Response;
 import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.concurrent.CompletableFuture;
-import javax.ws.rs.client.Entity;
-import javax.ws.rs.client.Invocation.Builder;
-import javax.ws.rs.client.WebTarget;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
 import org.onap.policy.aai.AaiCqResponse;
 import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
 import org.onap.policy.common.endpoints.utils.NetLoggerUtil.EventType;
index a077223..275f716 100644 (file)
@@ -3,6 +3,7 @@
  * ONAP
  * ================================================================================
  * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 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.controlloop.actor.aai;
 
+import jakarta.ws.rs.client.Invocation.Builder;
+import jakarta.ws.rs.client.WebTarget;
 import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
-import javax.ws.rs.client.Invocation.Builder;
-import javax.ws.rs.client.WebTarget;
 import org.onap.policy.common.utils.coder.StandardCoderObject;
 import org.onap.policy.controlloop.actorserviceprovider.OperationProperties;
 import org.onap.policy.controlloop.actorserviceprovider.impl.HttpOperation;
index 839fe13..519b142 100644 (file)
@@ -3,6 +3,7 @@
  * ONAP
  * ================================================================================
  * Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 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.controlloop.actor.aai;
 
+import jakarta.ws.rs.client.Invocation.Builder;
+import jakarta.ws.rs.client.WebTarget;
 import java.net.URLEncoder;
 import java.nio.charset.StandardCharsets;
 import java.util.Map;
 import java.util.concurrent.CompletableFuture;
-import javax.ws.rs.client.Invocation.Builder;
-import javax.ws.rs.client.WebTarget;
 import org.onap.policy.aai.AaiConstants;
 import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
 import org.onap.policy.common.endpoints.utils.NetLoggerUtil.EventType;
index 4f09dcb..b51004f 100644 (file)
@@ -3,6 +3,7 @@
  * ONAP
  * ================================================================================
  * Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 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.controlloop.actor.aai;
 
+import jakarta.ws.rs.client.Invocation.Builder;
+import jakarta.ws.rs.client.WebTarget;
 import java.util.Map;
 import java.util.concurrent.CompletableFuture;
-import javax.ws.rs.client.Invocation.Builder;
-import javax.ws.rs.client.WebTarget;
 import org.onap.policy.aai.AaiConstants;
 import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
 import org.onap.policy.common.endpoints.utils.NetLoggerUtil.EventType;
index 1d0ccc3..3dbad9a 100644 (file)
@@ -3,6 +3,7 @@
  * ONAP
  * ================================================================================
  * Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 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.controlloop.actor.aai;
 
+import jakarta.ws.rs.core.MediaType;
 import java.util.HashMap;
 import java.util.Map;
-import javax.ws.rs.core.MediaType;
 import lombok.AccessLevel;
 import lombok.NoArgsConstructor;
 import org.onap.policy.controlloop.actorserviceprovider.parameters.ControlLoopOperationParams;
index dd6d0ec..45db6b3 100644 (file)
@@ -31,6 +31,7 @@ import static org.mockito.Mockito.lenient;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
+import jakarta.ws.rs.client.InvocationCallback;
 import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
@@ -38,7 +39,6 @@ import java.util.TreeMap;
 import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.TimeoutException;
-import javax.ws.rs.client.InvocationCallback;
 import org.junit.AfterClass;
 import org.junit.Before;
 import org.junit.BeforeClass;
index 9b283fe..e76dfbd 100644 (file)
@@ -29,9 +29,9 @@ import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
+import jakarta.ws.rs.client.Invocation.Builder;
+import jakarta.ws.rs.client.WebTarget;
 import java.util.Map;
-import javax.ws.rs.client.Invocation.Builder;
-import javax.ws.rs.client.WebTarget;
 import org.junit.AfterClass;
 import org.junit.Before;
 import org.junit.BeforeClass;
index ad5bd5e..c306e00 100644 (file)
@@ -29,10 +29,10 @@ import static org.junit.Assert.assertTrue;
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.when;
 
+import jakarta.ws.rs.client.InvocationCallback;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.CompletableFuture;
-import javax.ws.rs.client.InvocationCallback;
 import org.junit.AfterClass;
 import org.junit.Before;
 import org.junit.BeforeClass;
index 765ed49..13b8e05 100644 (file)
@@ -29,10 +29,10 @@ import static org.junit.Assert.assertTrue;
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.when;
 
+import jakarta.ws.rs.client.InvocationCallback;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.CompletableFuture;
-import javax.ws.rs.client.InvocationCallback;
 import org.junit.AfterClass;
 import org.junit.Before;
 import org.junit.BeforeClass;
index cfefc61..252a7d9 100644 (file)
@@ -2,7 +2,7 @@
 <!--
   ============LICENSE_START=======================================================
   Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved.
-  Modifications Copyright (C) 2019,2023 Nordix Foundation.
+  Modifications Copyright (C) 2019, 2023 Nordix Foundation.
   ================================================================================
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   -->
 
 <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">
+         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">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
         <artifactId>model-actors</artifactId>
-        <version>3.0.0-SNAPSHOT</version>
+        <version>3.0.1-SNAPSHOT</version>
     </parent>
 
     <artifactId>actor.appc</artifactId>
             <artifactId>gson</artifactId>
             <scope>test</scope>
         </dependency>
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <scope>test</scope>
-        </dependency>
         <dependency>
             <groupId>org.onap.policy.models.policy-models-interactions</groupId>
             <artifactId>simulators</artifactId>
             <version>${project.version}</version>
             <scope>test</scope>
         </dependency>
-        <dependency>
-            <groupId>org.mockito</groupId>
-            <artifactId>mockito-core</artifactId>
-            <scope>test</scope>
-        </dependency>
     </dependencies>
 </project>
index c551079..bc64357 100644 (file)
@@ -2,7 +2,7 @@
 <!--
   ============LICENSE_START=======================================================
   Copyright (C) 2017-2018, 2020 AT&T Intellectual Property. All rights reserved.
-  Modifications Copyright (C) 2019,2023 Nordix Foundation.
+  Modifications Copyright (C) 2019, 2023 Nordix Foundation.
   ================================================================================
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with 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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<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">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
         <artifactId>model-actors</artifactId>
-        <version>3.0.0-SNAPSHOT</version>
+        <version>3.0.1-SNAPSHOT</version>
     </parent>
 
     <artifactId>actor.appclcm</artifactId>
             <version>${project.version}</version>
             <scope>test</scope>
         </dependency>
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.mockito</groupId>
-            <artifactId>mockito-core</artifactId>
-            <scope>test</scope>
-        </dependency>
     </dependencies>
 </project>
index 11219c1..70decae 100644 (file)
@@ -2,6 +2,7 @@
   ============LICENSE_START=======================================================
   Copyright (C) 2019 Bell Canada. All rights reserved.
   Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
+  Modifications Copyright (C) 2023 Nordix Foundation.
   ================================================================================
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   -->
 
 <project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
-    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>
         <groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
         <artifactId>model-actors</artifactId>
-        <version>3.0.0-SNAPSHOT</version>
+        <version>3.0.1-SNAPSHOT</version>
     </parent>
     <artifactId>actor.cds</artifactId>
     <dependencies>
             <version>${project.version}</version>
             <scope>test</scope>
         </dependency>
-        <dependency>
-            <groupId>org.mockito</groupId>
-            <artifactId>mockito-all</artifactId>
-            <scope>test</scope>
-        </dependency>
     </dependencies>
 </project>
index 3f4ad21..d1698d4 100644 (file)
@@ -2,7 +2,7 @@
 <!--
   ============LICENSE_START=======================================================
   Copyright (C) 2018 Huawei Intellectual Property. All rights reserved.
-  Modifications Copyright (C) 2019-2020,2023 Nordix Foundation.
+  Modifications Copyright (C) 2019-2020, 2023 Nordix Foundation.
   Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
   ================================================================================
   Licensed under the Apache License, Version 2.0 (the "License");
   -->
 
 <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">
+         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">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
         <artifactId>model-actors</artifactId>
-        <version>3.0.0-SNAPSHOT</version>
+        <version>3.0.1-SNAPSHOT</version>
     </parent>
 
     <artifactId>actor.sdnc</artifactId>
             <version>${policy.common.version}</version>
             <scope>provided</scope>
         </dependency>
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <scope>test</scope>
-        </dependency>
         <dependency>
             <groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
             <artifactId>actor.test</artifactId>
             <version>${project.version}</version>
             <scope>test</scope>
         </dependency>
-        <dependency>
-            <groupId>org.mockito</groupId>
-            <artifactId>mockito-core</artifactId>
-            <scope>test</scope>
-        </dependency>
     </dependencies>
 </project>
index f3d6f1d..20e8cd1 100644 (file)
@@ -3,6 +3,7 @@
  * ONAP
  * ================================================================================
  * Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 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.controlloop.actor.sdnc;
 
+import jakarta.ws.rs.client.Entity;
+import jakarta.ws.rs.core.MediaType;
+import jakarta.ws.rs.core.Response;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.CompletableFuture;
-import javax.ws.rs.client.Entity;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
 import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
 import org.onap.policy.common.endpoints.utils.NetLoggerUtil.EventType;
 import org.onap.policy.controlloop.actorserviceprovider.OperationOutcome;
index f4b6141..a88bb02 100644 (file)
@@ -76,7 +76,8 @@ public abstract class BasicSdncOperation extends BasicHttpOperation {
      * Starts the simulator.
      */
     protected static void initBeforeClass() throws Exception {
-        Util.buildSdncSim();
+        var testServer = Util.buildSdncSim();
+        assertNotNull(testServer);
 
         BusTopicParams clientParams = BusTopicParams.builder().clientName(MY_CLIENT).basePath("restconf/operations/")
                         .hostname("localhost").managed(true).port(Util.SDNCSIM_SERVER_PORT).build();
index 3501a87..7af7c2a 100644 (file)
@@ -2,7 +2,7 @@
 <!--
   ============LICENSE_START=======================================================
   Copyright (C) 2018 Wipro Limited Intellectual Property. All rights reserved.
-  Modifications Copyright (C) 2019-2020,2023 Nordix Foundation.
+  Modifications Copyright (C) 2019-2020, 2023 Nordix Foundation.
   Modifications Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
   ================================================================================
   Licensed under the Apache License, Version 2.0 (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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+         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">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
         <artifactId>model-actors</artifactId>
-        <version>3.0.0-SNAPSHOT</version>
+        <version>3.0.1-SNAPSHOT</version>
     </parent>
 
     <artifactId>actor.sdnr</artifactId>
             <artifactId>gson</artifactId>
             <scope>test</scope>
         </dependency>
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <scope>test</scope>
-        </dependency>
         <dependency>
             <groupId>org.onap.policy.models.policy-models-interactions</groupId>
             <artifactId>simulators</artifactId>
             <version>${project.version}</version>
             <scope>test</scope>
         </dependency>
-        <dependency>
-            <groupId>org.mockito</groupId>
-            <artifactId>mockito-core</artifactId>
-            <scope>test</scope>
-        </dependency>
     </dependencies>
 </project>
index 41ae20c..b6a9549 100644 (file)
@@ -2,7 +2,7 @@
 <!--
   ============LICENSE_START=======================================================
   Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved.
-  Modifications Copyright (C) 2019,2023 Nordix Foundation.
+  Modifications Copyright (C) 2019, 2023 Nordix Foundation.
   ================================================================================
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   -->
 
 <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">
+         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">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
         <artifactId>model-actors</artifactId>
-        <version>3.0.0-SNAPSHOT</version>
+        <version>3.0.1-SNAPSHOT</version>
     </parent>
 
     <artifactId>actor.so</artifactId>
             <version>${policy.common.version}</version>
             <scope>provided</scope>
         </dependency>
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <scope>test</scope>
-        </dependency>
         <dependency>
             <groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
             <artifactId>actor.test</artifactId>
             <version>${project.version}</version>
             <scope>test</scope>
         </dependency>
-        <dependency>
-            <groupId>org.mockito</groupId>
-            <artifactId>mockito-core</artifactId>
-            <scope>test</scope>
-        </dependency>
     </dependencies>
 </project>
index 48e20e3..8b56dee 100644 (file)
@@ -3,6 +3,7 @@
  * ONAP
  * ================================================================================
  * Copyright (C) 2022 CTC, Inc. and others. All rights reserved.
+ * Modifications Copyright (C) 2023 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.controlloop.actor.so;
 
+import jakarta.ws.rs.client.Entity;
+import jakarta.ws.rs.core.MediaType;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.CompletableFuture;
-import javax.ws.rs.client.Entity;
-import javax.ws.rs.core.MediaType;
 import org.onap.policy.common.endpoints.event.comm.Topic;
 import org.onap.policy.common.endpoints.utils.NetLoggerUtil;
 import org.onap.policy.common.utils.coder.CoderException;
index 5386d96..ff315a9 100644 (file)
@@ -4,6 +4,7 @@
  * ================================================================================
  * Copyright (C) 2020 Wipro Limited.
  * Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 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.controlloop.actor.so;
 
+import jakarta.ws.rs.client.Entity;
+import jakarta.ws.rs.core.MediaType;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.CompletableFuture;
-import javax.ws.rs.client.Entity;
-import javax.ws.rs.core.MediaType;
 import org.onap.policy.common.endpoints.event.comm.Topic;
 import org.onap.policy.common.endpoints.utils.NetLoggerUtil;
 import org.onap.policy.common.utils.coder.CoderException;
index 12f526f..129305d 100644 (file)
@@ -3,6 +3,7 @@
  * ONAP
  * ================================================================================
  * Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 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.controlloop.actor.so;
 
+import jakarta.ws.rs.core.EntityTag;
+import jakarta.ws.rs.core.GenericType;
+import jakarta.ws.rs.core.Link;
+import jakarta.ws.rs.core.Link.Builder;
+import jakarta.ws.rs.core.MediaType;
+import jakarta.ws.rs.core.MultivaluedMap;
+import jakarta.ws.rs.core.NewCookie;
+import jakarta.ws.rs.core.Response;
 import java.lang.annotation.Annotation;
 import java.net.URI;
 import java.util.Date;
 import java.util.Locale;
 import java.util.Map;
 import java.util.Set;
-import javax.ws.rs.core.EntityTag;
-import javax.ws.rs.core.GenericType;
-import javax.ws.rs.core.Link;
-import javax.ws.rs.core.Link.Builder;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.core.NewCookie;
-import javax.ws.rs.core.Response;
 import lombok.AllArgsConstructor;
 import lombok.Getter;
 import org.onap.policy.common.utils.coder.Coder;
index 824c434..d840457 100644 (file)
@@ -4,6 +4,7 @@
  * ================================================================================
  * Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
  * Modifications Copyright (C) 2020 Wipro Limited.
+ * Modifications Copyright (C) 2023 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,14 +24,14 @@ package org.onap.policy.controlloop.actor.so;
 
 import com.google.gson.Gson;
 import com.google.gson.GsonBuilder;
+import jakarta.ws.rs.core.MediaType;
+import jakarta.ws.rs.core.Response;
 import java.time.LocalDateTime;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Optional;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
 import org.onap.aai.domain.yang.CloudRegion;
 import org.onap.aai.domain.yang.GenericVnf;
 import org.onap.aai.domain.yang.ModelVer;
index 10c6737..a51be00 100644 (file)
@@ -4,6 +4,7 @@
  * ================================================================================
  * Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
  * Modifications Copyright (C) 2020 Wipro Limited.
+ * Modifications Copyright (C) 2023 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.controlloop.actor.so;
 
+import jakarta.ws.rs.client.Entity;
+import jakarta.ws.rs.core.MediaType;
+import jakarta.ws.rs.core.Response;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.CompletableFuture;
-import javax.ws.rs.client.Entity;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
 import org.apache.commons.lang3.tuple.Pair;
 import org.onap.aai.domain.yang.ModelVer;
 import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
index 09584b4..8076fbc 100644 (file)
@@ -4,6 +4,7 @@
  * ================================================================================
  * Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
  * Modifications Copyright (C) 2020 Wipro Limited.
+ * Modifications Copyright (C) 2023 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,6 +22,9 @@
 
 package org.onap.policy.controlloop.actor.so;
 
+import jakarta.ws.rs.client.InvocationCallback;
+import jakarta.ws.rs.core.MediaType;
+import jakarta.ws.rs.core.Response;
 import java.net.URI;
 import java.net.http.HttpRequest;
 import java.net.http.HttpRequest.BodyPublishers;
@@ -33,9 +37,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.concurrent.CompletableFuture;
-import javax.ws.rs.client.InvocationCallback;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.tuple.Pair;
 import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
index a544a62..2055adb 100644 (file)
@@ -3,6 +3,7 @@
  * ONAP
  * ================================================================================
  * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -26,7 +27,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 
-import javax.ws.rs.core.GenericType;
+import jakarta.ws.rs.core.GenericType;
 import org.junit.Before;
 import org.junit.Test;
 import org.onap.policy.common.utils.coder.Coder;
index 8c35e23..10f3f2b 100644 (file)
@@ -34,6 +34,9 @@ import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.never;
 import static org.mockito.Mockito.verify;
 
+import jakarta.ws.rs.client.InvocationCallback;
+import jakarta.ws.rs.core.MediaType;
+import jakarta.ws.rs.core.Response;
 import java.net.http.HttpHeaders;
 import java.net.http.HttpRequest;
 import java.net.http.HttpRequest.Builder;
@@ -46,9 +49,6 @@ import java.util.Map;
 import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.ForkJoinPool;
 import java.util.concurrent.TimeUnit;
-import javax.ws.rs.client.InvocationCallback;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
 import org.apache.commons.lang3.tuple.Pair;
 import org.junit.AfterClass;
 import org.junit.Before;
index 168b6dc..ab0a168 100644 (file)
   -->
 
 <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">
+         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">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
         <artifactId>model-actors</artifactId>
-        <version>3.0.0-SNAPSHOT</version>
+        <version>3.0.1-SNAPSHOT</version>
     </parent>
 
     <artifactId>actor.test</artifactId>
index 4bb75dc..54b6d4f 100644 (file)
@@ -24,15 +24,15 @@ package org.onap.policy.controlloop.actor.test;
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.lenient;
 
+import jakarta.ws.rs.client.AsyncInvoker;
+import jakarta.ws.rs.client.Entity;
+import jakarta.ws.rs.client.Invocation.Builder;
+import jakarta.ws.rs.client.InvocationCallback;
+import jakarta.ws.rs.client.WebTarget;
+import jakarta.ws.rs.core.MediaType;
+import jakarta.ws.rs.core.Response;
 import java.util.Map;
 import java.util.concurrent.CompletableFuture;
-import javax.ws.rs.client.AsyncInvoker;
-import javax.ws.rs.client.Entity;
-import javax.ws.rs.client.Invocation.Builder;
-import javax.ws.rs.client.InvocationCallback;
-import javax.ws.rs.client.WebTarget;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
 import org.mockito.ArgumentCaptor;
 import org.mockito.Captor;
 import org.mockito.Mock;
index c0351d1..2f16c42 100644 (file)
@@ -27,8 +27,8 @@ import static org.junit.Assert.assertSame;
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.when;
 
-import javax.ws.rs.client.InvocationCallback;
-import javax.ws.rs.core.Response;
+import jakarta.ws.rs.client.InvocationCallback;
+import jakarta.ws.rs.core.Response;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
index fa7e62a..7a8ffe9 100644 (file)
@@ -2,7 +2,7 @@
 <!--
   ============LICENSE_START=======================================================
   Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved.
-  Modifications Copyright (C) 2019,2023 Nordix Foundation.
+  Modifications Copyright (C) 2019, 2023 Nordix Foundation.
   ================================================================================
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   -->
 
 <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">
+         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">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
         <artifactId>model-actors</artifactId>
-        <version>3.0.0-SNAPSHOT</version>
+        <version>3.0.1-SNAPSHOT</version>
     </parent>
 
     <artifactId>actor.vfc</artifactId>
             <version>${policy.common.version}</version>
             <scope>provided</scope>
         </dependency>
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <scope>test</scope>
-        </dependency>
         <dependency>
             <groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
             <artifactId>actor.test</artifactId>
             <artifactId>mockito-core</artifactId>
             <scope>compile</scope>
         </dependency>
-        <dependency>
-            <groupId>org.assertj</groupId>
-            <artifactId>assertj-core</artifactId>
-            <scope>test</scope>
-        </dependency>
     </dependencies>
 </project>
index 7840548..76dd1db 100644 (file)
@@ -3,6 +3,7 @@
  * ONAP
  * ================================================================================
  * Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 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.controlloop.actor.vfc;
 
+import jakarta.ws.rs.client.Entity;
+import jakarta.ws.rs.core.MediaType;
 import java.util.Map;
 import java.util.concurrent.CompletableFuture;
-import javax.ws.rs.client.Entity;
-import javax.ws.rs.core.MediaType;
 import org.apache.commons.lang3.tuple.Pair;
 import org.onap.policy.controlloop.actorserviceprovider.OperationOutcome;
 import org.onap.policy.controlloop.actorserviceprovider.parameters.ControlLoopOperationParams;
index 3e64506..a1d4960 100644 (file)
@@ -3,6 +3,7 @@
  * ONAP
  * ================================================================================
  * Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 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,8 +21,8 @@
 
 package org.onap.policy.controlloop.actor.vfc;
 
+import jakarta.ws.rs.core.Response;
 import java.util.List;
-import javax.ws.rs.core.Response;
 import org.apache.commons.lang3.StringUtils;
 import org.onap.policy.controlloop.actorserviceprovider.OperationOutcome;
 import org.onap.policy.controlloop.actorserviceprovider.OperationProperties;
@@ -131,7 +132,7 @@ public abstract class VfcOperation extends HttpOperation<VfcResponse> {
 
     /**
      * Treats everything as a success, so we always go into
-     * {@link #postProcessResponse(OperationOutcome, String, Response, SoResponse)}.
+     * {@link #postProcessResponse (OperationOutcome, String, Response, SoResponse)}.
      */
     @Override
     protected boolean isSuccess(Response rawResponse, VfcResponse response) {
index 2a8c24a..4d0f0a5 100644 (file)
   -->
 
 <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">
+         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">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
         <artifactId>model-actors</artifactId>
-        <version>3.0.0-SNAPSHOT</version>
+        <version>3.0.1-SNAPSHOT</version>
     </parent>
 
     <artifactId>actor.xacml</artifactId>
             <version>${policy.common.version}</version>
             <scope>provided</scope>
         </dependency>
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <scope>test</scope>
-        </dependency>
         <dependency>
             <groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
             <artifactId>actor.test</artifactId>
index ed8e677..2d7bace 100644 (file)
@@ -3,6 +3,7 @@
  * ONAP
  * ================================================================================
  * Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 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.controlloop.actor.xacml;
 
+import jakarta.ws.rs.core.Response;
 import java.util.Collections;
 import java.util.Map;
 import java.util.concurrent.CompletableFuture;
-import javax.ws.rs.core.Response;
 import org.onap.policy.controlloop.actorserviceprovider.OperationOutcome;
 import org.onap.policy.controlloop.actorserviceprovider.OperationResult;
 import org.onap.policy.controlloop.actorserviceprovider.parameters.ControlLoopOperationParams;
index 0792dc6..a490def 100644 (file)
@@ -3,6 +3,7 @@
  * ONAP
  * ================================================================================
  * Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 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.controlloop.actor.xacml;
 
+import jakarta.ws.rs.client.Entity;
+import jakarta.ws.rs.core.MediaType;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.CompletableFuture;
-import javax.ws.rs.client.Entity;
-import javax.ws.rs.core.MediaType;
 import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
 import org.onap.policy.common.endpoints.utils.NetLoggerUtil.EventType;
 import org.onap.policy.controlloop.actorserviceprovider.CallbackManager;
index eddbd18..4136c20 100644 (file)
@@ -3,6 +3,7 @@
  * ONAP
  * ================================================================================
  * Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 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.controlloop.actor.xacml;
 
+import jakarta.ws.rs.core.Response;
 import java.util.Collections;
 import java.util.Map;
 import java.util.concurrent.CompletableFuture;
-import javax.ws.rs.core.Response;
 import org.onap.policy.controlloop.actorserviceprovider.OperationOutcome;
 import org.onap.policy.controlloop.actorserviceprovider.OperationResult;
 import org.onap.policy.controlloop.actorserviceprovider.parameters.ControlLoopOperationParams;
index 5caa142..5cd2866 100644 (file)
@@ -2,7 +2,7 @@
 <!--
   ============LICENSE_START=======================================================
   Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved.
-  Modifications Copyright (C) 2019,2023 Nordix Foundation.
+  Modifications Copyright (C) 2019, 2023 Nordix Foundation.
   ================================================================================
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   -->
 
 <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">
+         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">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
         <artifactId>model-actors</artifactId>
-        <version>3.0.0-SNAPSHOT</version>
+        <version>3.0.1-SNAPSHOT</version>
     </parent>
 
     <artifactId>actorServiceProvider</artifactId>
             <artifactId>mockito-core</artifactId>
             <scope>compile</scope>
         </dependency>
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <scope>test</scope>
-        </dependency>
     </dependencies>
 </project>
index 5a60816..2821256 100644 (file)
@@ -3,6 +3,7 @@
  * ONAP
  * ================================================================================
  * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -27,7 +28,8 @@ import org.onap.policy.controlloop.actorserviceprovider.parameters.HttpActorPara
 
 /**
  * Actor that uses HTTP, where the only additional property that an operator needs is a
- * URL. The actor's operator parameters are expected to be an {@link HttpParams}.
+ * URL. The actor's operator parameters are expected to be an
+ * {@link org.onap.policy.controlloop.actorserviceprovider.parameters.HttpParams}.
  *
  * @param <P> type of parameters
  */
index 047e3d1..1e11bce 100644 (file)
@@ -3,6 +3,7 @@
  * ONAP
  * ================================================================================
  * Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 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,6 +21,8 @@
 
 package org.onap.policy.controlloop.actorserviceprovider.impl;
 
+import jakarta.ws.rs.client.InvocationCallback;
+import jakarta.ws.rs.core.Response;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -27,8 +30,6 @@ import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
 import java.util.function.Function;
-import javax.ws.rs.client.InvocationCallback;
-import javax.ws.rs.core.Response;
 import lombok.Getter;
 import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
 import org.onap.policy.common.endpoints.http.client.HttpClient;
@@ -288,30 +289,27 @@ public abstract class HttpOperation<T> extends OperationPartial {
         HttpPollingConfig cfg = (HttpPollingConfig) config;
 
         switch (detmStatus(rawResponse, response)) {
-            case SUCCESS:
+            case SUCCESS -> {
                 logger.info("{}.{} request succeeded for {}", params.getActor(), params.getOperation(),
-                                params.getRequestId());
+                    params.getRequestId());
                 return CompletableFuture
-                                .completedFuture(setOutcome(outcome, OperationResult.SUCCESS, rawResponse, response));
-
-            case FAILURE:
+                    .completedFuture(setOutcome(outcome, OperationResult.SUCCESS, rawResponse, response));
+            }
+            case FAILURE -> {
                 logger.info("{}.{} request failed for {}", params.getActor(), params.getOperation(),
-                                params.getRequestId());
+                    params.getRequestId());
                 return CompletableFuture
-                                .completedFuture(setOutcome(outcome, OperationResult.FAILURE, rawResponse, response));
-
-            case STILL_WAITING:
-            default:
-                logger.info("{}.{} request incomplete for {}", params.getActor(), params.getOperation(),
-                                params.getRequestId());
-                break;
+                    .completedFuture(setOutcome(outcome, OperationResult.FAILURE, rawResponse, response));
+            }
+            default -> logger.info("{}.{} request incomplete for {}", params.getActor(), params.getOperation(),
+                params.getRequestId());
         }
 
         // still incomplete
 
         // see if the limit for the number of polls has been reached
         if (pollCount++ >= cfg.getMaxPolls()) {
-            logger.warn("{}: execeeded 'poll' limit {} for {}", getFullName(), cfg.getMaxPolls(),
+            logger.warn("{}: exceeded 'poll' limit {} for {}", getFullName(), cfg.getMaxPolls(),
                             params.getRequestId());
             setOutcome(outcome, OperationResult.FAILURE_TIMEOUT);
             return CompletableFuture.completedFuture(outcome);
index 553fd17..7a99a54 100644 (file)
@@ -3,6 +3,7 @@
  * ONAP
  * ================================================================================
  * Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -32,6 +33,18 @@ import static org.junit.Assert.assertTrue;
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.when;
 
+import jakarta.ws.rs.Consumes;
+import jakarta.ws.rs.DELETE;
+import jakarta.ws.rs.GET;
+import jakarta.ws.rs.POST;
+import jakarta.ws.rs.PUT;
+import jakarta.ws.rs.Path;
+import jakarta.ws.rs.Produces;
+import jakarta.ws.rs.client.Entity;
+import jakarta.ws.rs.client.InvocationCallback;
+import jakarta.ws.rs.core.MediaType;
+import jakarta.ws.rs.core.Response;
+import jakarta.ws.rs.core.Response.Status;
 import java.util.Collections;
 import java.util.Map;
 import java.util.Properties;
@@ -44,18 +57,6 @@ import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
 import java.util.concurrent.atomic.AtomicReference;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-import javax.ws.rs.client.Entity;
-import javax.ws.rs.client.InvocationCallback;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.Response.Status;
 import lombok.Getter;
 import lombok.Setter;
 import org.junit.AfterClass;
index bd44663..2f7976c 100644 (file)
@@ -3,6 +3,7 @@
  * ONAP
  * ================================================================================
  * Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -31,12 +32,12 @@ import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 
+import jakarta.ws.rs.client.InvocationCallback;
+import jakarta.ws.rs.core.Response;
 import java.util.Collections;
 import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.ForkJoinPool;
 import java.util.concurrent.TimeUnit;
-import javax.ws.rs.client.InvocationCallback;
-import javax.ws.rs.core.Response;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
index 3f26f79..84accb4 100644 (file)
   ============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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-  <packaging>pom</packaging>
+<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">
+    <modelVersion>4.0.0</modelVersion>
+    <packaging>pom</packaging>
 
-  <parent>
-    <groupId>org.onap.policy.models</groupId>
-    <artifactId>policy-models-interactions</artifactId>
-    <version>3.0.0-SNAPSHOT</version>
-  </parent>
+    <parent>
+        <groupId>org.onap.policy.models</groupId>
+        <artifactId>policy-models-interactions</artifactId>
+        <version>3.0.1-SNAPSHOT</version>
+    </parent>
 
-  <groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
-  <artifactId>model-actors</artifactId>
+    <groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
+    <artifactId>model-actors</artifactId>
 
-  <properties>
-    <jacoco.dataFile>${project.basedir}/../../../target/code-coverage/jacoco-ut.exec</jacoco.dataFile>
-  </properties>
+    <properties>
+        <jacoco.dataFile>${project.basedir}/../../../target/code-coverage/jacoco-ut.exec</jacoco.dataFile>
+    </properties>
 
-  <modules>
-    <module>actorServiceProvider</module>
-    <module>actor.test</module>
-    <module>actor.aai</module>
-    <module>actor.cds</module>
-    <module>actor.appc</module>
-    <module>actor.appclcm</module>
-    <module>actor.sdnc</module>
-    <module>actor.sdnr</module>
-    <module>actor.a1p</module>
-    <module>actor.so</module>
-    <module>actor.vfc</module>
-    <module>actor.xacml</module>
-  </modules>
-  <dependencies>
-    <dependency>
-      <groupId>com.google.guava</groupId>
-      <artifactId>guava</artifactId>
-    </dependency>
-  </dependencies>
+    <modules>
+        <module>actorServiceProvider</module>
+        <module>actor.test</module>
+        <module>actor.aai</module>
+        <module>actor.cds</module>
+        <module>actor.appc</module>
+        <module>actor.appclcm</module>
+        <module>actor.sdnc</module>
+        <module>actor.sdnr</module>
+        <module>actor.a1p</module>
+        <module>actor.so</module>
+        <module>actor.vfc</module>
+        <module>actor.xacml</module>
+    </modules>
+    <dependencies>
+        <dependency>
+            <groupId>com.google.guava</groupId>
+            <artifactId>guava</artifactId>
+        </dependency>
+    </dependencies>
 </project>
index 63b019b..cc9619a 100644 (file)
@@ -3,7 +3,7 @@
   aai
   ================================================================================
   Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved.
-  Modifications Copyright (C) 2019,2023 Nordix Foundation.
+  Modifications Copyright (C) 2019, 2023 Nordix Foundation.
   ================================================================================
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
 
 
 <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>
         <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
         <artifactId>model-impl</artifactId>
-        <version>3.0.0-SNAPSHOT</version>
+        <version>3.0.1-SNAPSHOT</version>
     </parent>
 
     <artifactId>aai</artifactId>
             <artifactId>rest</artifactId>
             <version>${project.version}</version>
         </dependency>
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.mockito</groupId>
-            <artifactId>mockito-core</artifactId>
-            <scope>test</scope>
-        </dependency>
         <dependency>
             <groupId>org.onap.policy.common</groupId>
             <artifactId>policy-endpoints</artifactId>
index aa6a64f..3d3a171 100644 (file)
@@ -3,14 +3,14 @@
   appc
   ================================================================================
   Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved.
-  Modifications Copyright (C) 2019 Nordix Foundation.
+  Modifications Copyright (C) 2019, 2023 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.
   -->
 
 
-<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">
-  <modelVersion>4.0.0</modelVersion>
+<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">
+    <modelVersion>4.0.0</modelVersion>
 
-  <parent>
-    <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
-    <artifactId>model-impl</artifactId>
-    <version>3.0.0-SNAPSHOT</version>
-  </parent>
+    <parent>
+        <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
+        <artifactId>model-impl</artifactId>
+        <version>3.0.1-SNAPSHOT</version>
+    </parent>
 
-  <artifactId>appc</artifactId>
+    <artifactId>appc</artifactId>
 
-  <dependencies>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>com.google.code.gson</groupId>
-      <artifactId>gson</artifactId>
-      <scope>provided</scope>
-    </dependency>
-  </dependencies>
-  
+    <dependencies>
+        <dependency>
+            <groupId>com.google.code.gson</groupId>
+            <artifactId>gson</artifactId>
+            <scope>provided</scope>
+        </dependency>
+    </dependencies>
 </project>
index c37b0ee..81d3aad 100644 (file)
@@ -3,7 +3,7 @@
   appclcm
   ================================================================================
   Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved.
-  Modifications Copyright (C) 2019 Nordix Foundation.
+  Modifications Copyright (C) 2019, 2023 Nordix Foundation.
   ================================================================================
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   -->
 
 
-<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">
-  <modelVersion>4.0.0</modelVersion>
-
-  <parent>
-    <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
-    <artifactId>model-impl</artifactId>
-    <version>3.0.0-SNAPSHOT</version>
-  </parent>
-
-  <artifactId>appclcm</artifactId>
-
-  <dependencies>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>com.google.code.gson</groupId>
-      <artifactId>gson</artifactId>
-      <scope>provided</scope>
-    </dependency>
-  </dependencies>
-  
+<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">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
+        <artifactId>model-impl</artifactId>
+        <version>3.0.1-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>appclcm</artifactId>
+
+    <dependencies>
+        <dependency>
+            <groupId>com.google.code.gson</groupId>
+            <artifactId>gson</artifactId>
+            <scope>provided</scope>
+        </dependency>
+    </dependencies>
+
 </project>
index 2699551..d702654 100644 (file)
@@ -3,6 +3,7 @@
   ============LICENSE_START=======================================================
   Copyright (C) 2019-2021 Bell Canada.
   Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
+  Modifications Copyright (C) 2023 Nordix Foundation.
   ================================================================================
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
 <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">
-  <modelVersion>4.0.0</modelVersion>
-  <parent>
-    <artifactId>model-impl</artifactId>
-    <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
-    <version>3.0.0-SNAPSHOT</version>
-  </parent>
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <artifactId>model-impl</artifactId>
+        <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
+        <version>3.0.1-SNAPSHOT</version>
+    </parent>
 
-  <artifactId>cds</artifactId>
-  <name>${project.artifactId}</name>
-  <description>gRPC client implementation to send process message to CDS blueprint processor gRPC endpoint.</description>
+    <artifactId>cds</artifactId>
+    <name>${project.artifactId}</name>
+    <description>gRPC client implementation to send process message to CDS blueprint processor gRPC endpoint.
+    </description>
 
-  <properties>
-    <grpc.version>1.25.0</grpc.version>
-  </properties>
+    <properties>
+        <grpc.version>1.25.0</grpc.version>
+    </properties>
 
-  <dependencies>
-    <!-- CDS dependencies -->
-    <dependency>
-      <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
-      <artifactId>blueprint-proto</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>io.grpc</groupId>
-      <artifactId>grpc-testing</artifactId>
-      <version>${grpc.version}</version>
-      <scope>test</scope>
-    </dependency>
+    <dependencies>
+        <!-- CDS dependencies -->
+        <dependency>
+            <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
+            <artifactId>blueprint-proto</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>io.grpc</groupId>
+            <artifactId>grpc-testing</artifactId>
+            <version>${grpc.version}</version>
+            <scope>test</scope>
+        </dependency>
 
-    <!-- Policy dependencies -->
-    <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>policy-endpoints</artifactId>
-        <version>${policy.common.version}</version>
-    </dependency>
-
-    <!-- junit dependencies -->
-    <dependency>
-      <groupId>org.mockito</groupId>
-      <artifactId>mockito-core</artifactId>
-      <scope>test</scope>
-    </dependency>
-  </dependencies>
+        <!-- Policy dependencies -->
+        <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>policy-endpoints</artifactId>
+            <version>${policy.common.version}</version>
+        </dependency>
+    </dependencies>
 </project>
index a7fce1e..b33f4d9 100644 (file)
@@ -3,7 +3,7 @@
   events in model-impl
   ================================================================================
   Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved.
-  Modifications Copyright (C) 2019 Nordix Foundation.
+  Modifications Copyright (C) 2019, 2023 Nordix Foundation.
   ================================================================================
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   -->
 
 
-<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">
-  <modelVersion>4.0.0</modelVersion>
+<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">
+    <modelVersion>4.0.0</modelVersion>
 
-  <parent>
-    <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
-    <artifactId>model-impl</artifactId>
-    <version>3.0.0-SNAPSHOT</version>
-  </parent>
+    <parent>
+        <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
+        <artifactId>model-impl</artifactId>
+        <version>3.0.1-SNAPSHOT</version>
+    </parent>
 
-  <artifactId>events</artifactId>
+    <artifactId>events</artifactId>
 
-  <dependencies>
-    <dependency>
-      <groupId>com.google.code.gson</groupId>
-      <artifactId>gson</artifactId>
-      <scope>provided</scope>
-    </dependency>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <scope>test</scope>
-    </dependency>
-  </dependencies>
+    <dependencies>
+        <dependency>
+            <groupId>com.google.code.gson</groupId>
+            <artifactId>gson</artifactId>
+            <scope>provided</scope>
+        </dependency>
+    </dependencies>
 </project>
index 71cbf36..018cdf5 100644 (file)
@@ -3,6 +3,7 @@
   ONAP
   ================================================================================
   Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
+  Modifications Copyright (C) 2023 Nordix Foundation.
   ================================================================================
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with 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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
 
-<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">
-  <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
+        <artifactId>model-impl</artifactId>
+        <version>3.0.1-SNAPSHOT</version>
+    </parent>
 
-  <parent>
-    <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
-    <artifactId>model-impl</artifactId>
-    <version>3.0.0-SNAPSHOT</version>
-  </parent>
-
-  <artifactId>guard</artifactId>
+    <artifactId>guard</artifactId>
 
 </project>
index aee57f1..fc36265 100644 (file)
@@ -3,7 +3,7 @@
  * ONAP
  * ================================================================================
  * Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2021,2023 Nordix Foundation.
+ * Modifications Copyright (C) 2021, 2023 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.guard;
 
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.GeneratedValue;
+import jakarta.persistence.GenerationType;
+import jakarta.persistence.Id;
+import jakarta.persistence.Index;
+import jakarta.persistence.Table;
+import jakarta.persistence.TableGenerator;
+import java.io.Serial;
 import java.io.Serializable;
 import java.util.Date;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Index;
-import javax.persistence.Table;
-import javax.persistence.TableGenerator;
 import lombok.Data;
 
 @Entity
@@ -43,6 +44,7 @@ import lombok.Data;
 @Data
 public class OperationsHistory implements Serializable {
 
+    @Serial
     private static final long serialVersionUID = -551420180714993577L;
 
     @Id
index e592682..bf5ca5e 100644 (file)
@@ -27,7 +27,7 @@
   <parent>
       <groupId>org.onap.policy.models</groupId>
       <artifactId>policy-models-interactions</artifactId>
-      <version>3.0.0-SNAPSHOT</version>
+      <version>3.0.1-SNAPSHOT</version>
   </parent>
 
   <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
index 7a9a28f..e11cc51 100644 (file)
@@ -3,7 +3,7 @@
   rest
   ================================================================================
   Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved.
-  Modifications Copyright (C) 2019 Nordix Foundation.
+  Modifications Copyright (C) 2019, 2023 Nordix Foundation.
   ================================================================================
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   -->
 
 
-<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">
-  <modelVersion>4.0.0</modelVersion>
+<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">
+    <modelVersion>4.0.0</modelVersion>
 
-  <parent>
-    <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
-    <artifactId>model-impl</artifactId>
-    <version>3.0.0-SNAPSHOT</version>
-  </parent>
+    <parent>
+        <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
+        <artifactId>model-impl</artifactId>
+        <version>3.0.1-SNAPSHOT</version>
+    </parent>
 
-  <artifactId>rest</artifactId>
+    <artifactId>rest</artifactId>
 
-  <dependencies>
-    <dependency>
-      <groupId>com.google.code.gson</groupId>
-      <artifactId>gson</artifactId>
-      <scope>provided</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.httpcomponents</groupId>
-      <artifactId>httpclient</artifactId>
-      <scope>provided</scope>
-    </dependency>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.onap.policy.common</groupId>
-      <artifactId>policy-endpoints</artifactId>
-      <version>${policy.common.version}</version>
-      <scope>test</scope>
-    </dependency>
-  </dependencies>
+    <dependencies>
+        <dependency>
+            <groupId>com.google.code.gson</groupId>
+            <artifactId>gson</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.httpcomponents.client5</groupId>
+            <artifactId>httpclient5</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.policy.common</groupId>
+            <artifactId>policy-endpoints</artifactId>
+            <version>${policy.common.version}</version>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
 </project>
index a91548f..855dc92 100644 (file)
@@ -3,7 +3,7 @@
  * rest
  * ================================================================================
  * Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019-2020 Nordix Foundation.
+ * Modifications Copyright (C) 2019-2020, 2023 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.rest;
 
+import jakarta.xml.bind.DatatypeConverter;
 import java.nio.charset.StandardCharsets;
 import java.util.Map;
 import java.util.Map.Entry;
-import javax.xml.bind.DatatypeConverter;
 import org.apache.commons.lang3.tuple.Pair;
 import org.apache.http.HttpHeaders;
 import org.apache.http.HttpResponse;
@@ -52,7 +52,7 @@ public class RestManager {
      * Perform REST PUT.
      *
      * @param url the url
-     * @param username the user name
+     * @param username the user
      * @param password the password
      * @param headers any headers
      * @param contentType what the content type is
@@ -79,7 +79,7 @@ public class RestManager {
      * Perform REST Post.
      *
      * @param url the url
-     * @param username the user name
+     * @param username the user
      * @param password the password
      * @param headers any headers
      * @param contentType what the content type is
@@ -106,7 +106,7 @@ public class RestManager {
      * Do a REST get.
      *
      * @param url URL
-     * @param username user name
+     * @param username user
      * @param password password
      * @param headers any headers to add
      * @return a Pair for the response status and the body
@@ -122,7 +122,7 @@ public class RestManager {
      * <i>Note: Many REST endpoints will return a 400 error for delete requests with a non-empty body</i>
      *
      * @param url the url
-     * @param username the user name
+     * @param username the user
      * @param password the password
      * @param headers any headers
      * @param contentType what the content type is
@@ -151,7 +151,7 @@ public class RestManager {
      * Perform REST Delete.
      *
      * @param url the url
-     * @param username the user name
+     * @param username the user
      * @param password the password
      * @param headers any headers
      * @return the response status code and the body
@@ -166,7 +166,7 @@ public class RestManager {
      * Perform REST Patch.
      *
      * @param url the url
-     * @param username the user name
+     * @param username the user
      * @param password the password
      * @param headers any headers
      * @param body body to send
@@ -224,7 +224,7 @@ public class RestManager {
      * Add header to the request.
      *
      * @param request http request to send
-     * @param username the user name
+     * @param username the user
      * @param password the password
      * @param headers any headers
      */
index e5a8874..e6c8191 100644 (file)
@@ -3,7 +3,7 @@
  * rest
  * ================================================================================
  * Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019-2020 Nordix Foundation.
+ * Modifications Copyright (C) 2019-2020, 2023 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,23 +25,23 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 
+import jakarta.ws.rs.Consumes;
+import jakarta.ws.rs.DELETE;
+import jakarta.ws.rs.DefaultValue;
+import jakarta.ws.rs.GET;
+import jakarta.ws.rs.HttpMethod;
+import jakarta.ws.rs.POST;
+import jakarta.ws.rs.PUT;
+import jakarta.ws.rs.Path;
+import jakarta.ws.rs.PathParam;
+import jakarta.ws.rs.Produces;
+import jakarta.ws.rs.QueryParam;
+import jakarta.ws.rs.core.MediaType;
 import java.lang.annotation.Documented;
 import java.lang.annotation.ElementType;
 import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
 import java.lang.annotation.Target;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.DefaultValue;
-import javax.ws.rs.GET;
-import javax.ws.rs.HttpMethod;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.MediaType;
 import org.apache.commons.lang3.tuple.Pair;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
index 11467f3..6759cff 100644 (file)
@@ -2,14 +2,14 @@
   ============LICENSE_START=======================================================
   Copyright (C) 2018 Huawei. All rights reserved.
   Modifications Copyright (C) 2018-2020 AT&T Intellectual Property. All rights reserved.
-  Modifications Copyright (C) 2019 Nordix Foundation.
+  Modifications Copyright (C) 2019, 2023 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.
   ============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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-  <modelVersion>4.0.0</modelVersion>
+<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">
+    <modelVersion>4.0.0</modelVersion>
 
-  <parent>
+    <parent>
         <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
         <artifactId>model-impl</artifactId>
-        <version>3.0.0-SNAPSHOT</version>
-  </parent>
+        <version>3.0.1-SNAPSHOT</version>
+    </parent>
 
-  <artifactId>sdnc</artifactId>
+    <artifactId>sdnc</artifactId>
 
-  <dependencies>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.mockito</groupId>
-      <artifactId>mockito-core</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>com.google.code.gson</groupId>
-      <artifactId>gson</artifactId>
-      <scope>provided</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
-      <artifactId>rest</artifactId>
-      <version>${project.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.onap.policy.common</groupId>
-      <artifactId>policy-endpoints</artifactId>
-      <version>${policy.common.version}</version>
-      <scope>provided</scope>
-    </dependency>
-  </dependencies>
+    <dependencies>
+        <dependency>
+            <groupId>com.google.code.gson</groupId>
+            <artifactId>gson</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
+            <artifactId>rest</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.policy.common</groupId>
+            <artifactId>policy-endpoints</artifactId>
+            <version>${policy.common.version}</version>
+            <scope>provided</scope>
+        </dependency>
+    </dependencies>
 </project>
index a023190..5f2c783 100644 (file)
@@ -4,14 +4,14 @@
   ================================================================================
   Copyright (C) 2018 Wipro Limited Intellectual Property. All rights reserved.
   Modifications Copyright (C) 2018-2020 AT&T Intellectual Property. All rights reserved.
-  Modifications Copyright (C) 2019 Nordix Foundation.
+  Modifications Copyright (C) 2019, 2023 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.
   -->
 
 
-<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">
-  <modelVersion>4.0.0</modelVersion>
+<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">
+    <modelVersion>4.0.0</modelVersion>
 
-  <parent>
+    <parent>
         <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
         <artifactId>model-impl</artifactId>
-        <version>3.0.0-SNAPSHOT</version>
-   </parent>
+        <version>3.0.1-SNAPSHOT</version>
+    </parent>
 
-  <artifactId>sdnr</artifactId>
+    <artifactId>sdnr</artifactId>
 
-  <dependencies>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>com.google.code.gson</groupId>
-      <artifactId>gson</artifactId>
-      <scope>provided</scope>
-    </dependency>
-  </dependencies>
+    <dependencies>
+        <dependency>
+            <groupId>com.google.code.gson</groupId>
+            <artifactId>gson</artifactId>
+            <scope>provided</scope>
+        </dependency>
+    </dependencies>
 </project>
index 49e0ca1..5830219 100644 (file)
@@ -3,7 +3,7 @@
   so
   ================================================================================
   Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved.
-  Modifications Copyright (C) 2019 Nordix Foundation.
+  Modifications Copyright (C) 2019, 2023 Nordix Foundation.
   ================================================================================
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   -->
 
 
-<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">
-  <modelVersion>4.0.0</modelVersion>
+<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">
+    <modelVersion>4.0.0</modelVersion>
 
-  <parent>
+    <parent>
         <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
         <artifactId>model-impl</artifactId>
-        <version>3.0.0-SNAPSHOT</version>
-  </parent>
+        <version>3.0.1-SNAPSHOT</version>
+    </parent>
 
-  <artifactId>so</artifactId>
+    <artifactId>so</artifactId>
 
-  <dependencies>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>com.google.code.gson</groupId>
-      <artifactId>gson</artifactId>
-      <scope>provided</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
-      <artifactId>rest</artifactId>
-      <version>${project.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.glassfish.jersey.containers</groupId>
-      <artifactId>jersey-container-grizzly2-http</artifactId>
-      <scope>test</scope>
-    </dependency>
-  </dependencies>
+    <dependencies>
+        <dependency>
+            <groupId>com.google.code.gson</groupId>
+            <artifactId>gson</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
+            <artifactId>rest</artifactId>
+            <version>${project.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.glassfish.jersey.containers</groupId>
+            <artifactId>jersey-container-grizzly2-http</artifactId>
+            <version>3.1.3</version>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
 </project>
index c1bfecd..c0beea5 100644 (file)
@@ -2,7 +2,7 @@
   ============LICENSE_START=======================================================
   Copyright (C) 2017 Intel Corp. All rights reserved.
   Modifications Copyright (C) 2018-2021 AT&T Intellectual Property. All rights reserved.
-  Modifications Copyright (C) 2019 Nordix Foundation.
+  Modifications Copyright (C) 2019, 2023 Nordix Foundation.
   ================================================================================
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with 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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-  <modelVersion>4.0.0</modelVersion>
+<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">
+    <modelVersion>4.0.0</modelVersion>
 
-  <parent>
+    <parent>
         <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
         <artifactId>model-impl</artifactId>
-        <version>3.0.0-SNAPSHOT</version>
+        <version>3.0.1-SNAPSHOT</version>
     </parent>
 
-  <artifactId>vfc</artifactId>
+    <artifactId>vfc</artifactId>
 
-  <dependencies>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.mockito</groupId>
-      <artifactId>mockito-core</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>com.google.code.gson</groupId>
-      <artifactId>gson</artifactId>
-      <scope>provided</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
-      <artifactId>rest</artifactId>
-      <version>${project.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.onap.policy.common</groupId>
-      <artifactId>policy-endpoints</artifactId>
-      <version>${policy.common.version}</version>
-      <scope>provided</scope>
-    </dependency>
-  </dependencies>
+    <dependencies>
+        <dependency>
+            <groupId>com.google.code.gson</groupId>
+            <artifactId>gson</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
+            <artifactId>rest</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.policy.common</groupId>
+            <artifactId>policy-endpoints</artifactId>
+            <version>${policy.common.version}</version>
+            <scope>provided</scope>
+        </dependency>
+    </dependencies>
 </project>
index cc25261..7687760 100644 (file)
@@ -3,7 +3,7 @@
   ONAP
   ================================================================================
   Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved.
-  Modifications Copyright (C) 2019,2023 Nordix Foundation.
+  Modifications Copyright (C) 2019, 2023 Nordix Foundation.
   ================================================================================
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   -->
 
 <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">
+         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">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.onap.policy.models</groupId>
         <artifactId>policy-models-interactions</artifactId>
-        <version>3.0.0-SNAPSHOT</version>
+        <version>3.0.1-SNAPSHOT</version>
     </parent>
 
     <groupId>org.onap.policy.models.policy-models-interactions</groupId>
             <artifactId>policy-endpoints</artifactId>
             <version>${policy.common.version}</version>
         </dependency>
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <scope>test</scope>
-        </dependency>
         <dependency>
             <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
             <artifactId>aai</artifactId>
index ea50240..146dcec 100644 (file)
@@ -3,7 +3,7 @@
  * simulators
  * ================================================================================
  * Copyright (C) 2017-2018, 2020-2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2019, 2023 Nordix Foundation.
  * Modifications Copyright (C) 2021 Bell Canada. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
 
 package org.onap.policy.simulators;
 
-import java.io.IOException;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.GET;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
+import jakarta.ws.rs.Consumes;
+import jakarta.ws.rs.GET;
+import jakarta.ws.rs.PUT;
+import jakarta.ws.rs.Path;
+import jakarta.ws.rs.PathParam;
+import jakarta.ws.rs.Produces;
+import jakarta.ws.rs.QueryParam;
+import jakarta.ws.rs.core.MediaType;
+import jakarta.ws.rs.core.Response;
 import org.onap.policy.common.utils.resources.ResourceUtils;
 import org.onap.policy.common.utils.services.Registry;
 
@@ -71,13 +70,12 @@ public class AaiSimulatorJaxRs {
      *
      * @param req the request
      * @return the response
-     * @throws IOException if a response file cannot be read
      */
     @PUT
     @Path("/{version:v16|v21}/query")
     @Consumes(MediaType.APPLICATION_JSON)
     @Produces("application/json")
-    public Response aaiPutQuery(final String req) throws IOException {
+    public Response aaiPutQuery(final String req) {
         return getResponse("AaiCqResponse", "invalid-cq");
     }
 
@@ -85,13 +83,12 @@ public class AaiSimulatorJaxRs {
      * A&AI get PNF query using pnfName.
      *
      * @return the result
-     * @throws IOException if a response file cannot be read
      */
     @GET
     @Path("/{version:v16|v21}/network/pnfs/pnf/{pnfName}")
     @Consumes(MediaType.APPLICATION_JSON)
     @Produces("application/json")
-    public Response aaiGetPnfUsingPnfName(@PathParam("pnfName") final String pnfName) throws IOException {
+    public Response aaiGetPnfUsingPnfName(@PathParam("pnfName") final String pnfName) {
         return getResponse(pnfName, INVALID_PNF_FILE_NAME);
     }
 
@@ -99,13 +96,12 @@ public class AaiSimulatorJaxRs {
      * A&AI get PNF query using pnf-id.
      *
      * @return the result
-     * @throws IOException if a response file cannot be read
      */
     @GET
     @Path("/{version:v16|v21}/network/pnfs/pnf")
     @Consumes(MediaType.APPLICATION_JSON)
     @Produces("application/json")
-    public Response aaiGetPnfUsingPnfId(@QueryParam("pnf-id") final String pnfId) throws IOException {
+    public Response aaiGetPnfUsingPnfId(@QueryParam("pnf-id") final String pnfId) {
         return getResponse(pnfId, INVALID_PNF_FILE_NAME);
     }
 
@@ -113,13 +109,12 @@ public class AaiSimulatorJaxRs {
      * A&AI get VNF query using vnf-id.
      *
      * @return the result
-     * @throws IOException if a response file cannot be read
      */
     @GET
     @Path("/{version:v16|v21}/network/generic-vnfs/generic-vnf/{vnfId}")
     @Consumes(MediaType.APPLICATION_JSON)
     @Produces("application/json")
-    public Response aaiGetVnfUsingVnfId(@PathParam("vnfId") final String vnfId) throws IOException {
+    public Response aaiGetVnfUsingVnfId(@PathParam("vnfId") final String vnfId) {
         return getResponse(vnfId, INVALID_VNF_FILE_NAME);
     }
 
@@ -127,13 +122,12 @@ public class AaiSimulatorJaxRs {
      * A&AI get VNF query using vnf-name.
      *
      * @return the result
-     * @throws IOException if a response file cannot be read
      */
     @GET
     @Path("/{version:v16|v21}/network/generic-vnfs/generic-vnf")
     @Consumes(MediaType.APPLICATION_JSON)
     @Produces("application/json")
-    public Response aaiGetVnfUsingVnfName(@QueryParam("vnf-name") final String vnfName) throws IOException {
+    public Response aaiGetVnfUsingVnfName(@QueryParam("vnf-name") final String vnfName) {
         return getResponse(vnfName, INVALID_VNF_FILE_NAME);
     }
 
index 7a28791..20e1811 100644 (file)
@@ -3,7 +3,7 @@
  * simulators
  * ================================================================================
  * Copyright (C) 2018 Huawei. All rights reserved.
- * Modifications Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2019, 2023 Nordix Foundation.
  * Modifications Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
 
 package org.onap.policy.simulators;
 
+import jakarta.ws.rs.Consumes;
+import jakarta.ws.rs.POST;
+import jakarta.ws.rs.Path;
+import jakarta.ws.rs.Produces;
+import jakarta.ws.rs.core.MediaType;
 import java.util.UUID;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
 import org.onap.policy.sdnc.SdncResponse;
 import org.onap.policy.sdnc.SdncResponseOutput;
 import org.onap.policy.sdnc.util.Serialization;
index b97e4d9..ed2b0fd 100644 (file)
@@ -3,6 +3,7 @@
  * ONAP
  * ================================================================================
  * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 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.simulators;
 
+import java.io.Serial;
+
 public class SimulatorRuntimeException extends RuntimeException {
+    @Serial
     private static final long serialVersionUID = 1L;
 
     public SimulatorRuntimeException() {
index 9575419..a1456c1 100644 (file)
@@ -3,7 +3,7 @@
  * simulators
  * ================================================================================
  * Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2019, 2023 Nordix Foundation.
  * Modifications Copyright (C) 2020 Wipro Limited.
  * Modifications Copyright (C) 2022 CTC, Inc. and others.
  * ================================================================================
 
 package org.onap.policy.simulators;
 
+import jakarta.ws.rs.Consumes;
+import jakarta.ws.rs.DELETE;
+import jakarta.ws.rs.GET;
+import jakarta.ws.rs.POST;
+import jakarta.ws.rs.PUT;
+import jakarta.ws.rs.Path;
+import jakarta.ws.rs.PathParam;
+import jakarta.ws.rs.Produces;
+import jakarta.ws.rs.core.MediaType;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.UUID;
 import java.util.concurrent.ConcurrentHashMap;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
 import lombok.Setter;
 import org.onap.policy.common.utils.resources.ResourceUtils;
 import org.onap.policy.so.SoRequest;
@@ -67,8 +67,8 @@ public class SoSimulatorJaxRs {
     /**
      * SO post query.
      *
-     * @param serviceInstanceId the service instance Id
-     * @param vnfInstanceId the VNF Id
+     * @param serviceInstanceId the service instance ID
+     * @param vnfInstanceId the VNF ID
      * @return the response
      */
     @POST
@@ -91,8 +91,8 @@ public class SoSimulatorJaxRs {
     /**
      * SO Delete.
      *
-     * @param serviceInstanceId the service instance Id
-     * @param vnfInstanceId the VNF Id
+     * @param serviceInstanceId the service instance ID
+     * @param vnfInstanceId the VNF ID
      * @return the response
      */
     @DELETE
index 155107b..bbe1a36 100644 (file)
@@ -3,7 +3,7 @@
  * simulators
  * ================================================================================
  * Copyright (C) 2017-2019, 2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2019, 2023 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -101,7 +101,7 @@ public final class Util {
 
 
     /**
-     * Build an SO simulator.
+     * Build a SO simulator.
      *
      * @return the simulator
      * @throws InterruptedException if a thread is interrupted
@@ -174,7 +174,7 @@ public final class Util {
      */
     public static HttpServletServer buildDmaapSim(String resourceName) throws InterruptedException {
         var json = ResourceUtils.getResourceAsString(resourceName);
-        DmaapSimParameterGroup params = null;
+        DmaapSimParameterGroup params;
         try {
             params = new StandardCoder().decode(json, DmaapSimParameterGroup.class);
         } catch (CoderException ce) {
index 3702fdd..7f1b6dd 100644 (file)
@@ -3,7 +3,7 @@
  * simulators
  * ================================================================================
  * Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2019, 2023 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.simulators;
 
-import javax.servlet.http.HttpServletResponse;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
+import jakarta.servlet.http.HttpServletResponse;
+import jakarta.ws.rs.Consumes;
+import jakarta.ws.rs.GET;
+import jakarta.ws.rs.POST;
+import jakarta.ws.rs.Path;
+import jakarta.ws.rs.PathParam;
+import jakarta.ws.rs.Produces;
+import jakarta.ws.rs.core.Context;
+import jakarta.ws.rs.core.MediaType;
 import org.slf4j.LoggerFactory;
 
 @Path("/api/nslcm/v1")
@@ -63,7 +63,7 @@ public class VfcSimulatorJaxRs {
     /**
      * VFC get query.
      *
-     * @param jobId tthe job id
+     * @param jobId the job id
      * @return the response
      */
     @GET
@@ -74,9 +74,9 @@ public class VfcSimulatorJaxRs {
         return "{\"jobId\" : " + jobId
                 + ",\"responseDescriptor\" : {\"progress\" : \"40\",\"status\" : \"finished\",\"statusDescription"
                 + "\" : \"OMC VMs are decommissioned in VIM\",\"errorCode\" : null,\"responseId\": 101 ,\""
-                + "responseHistoryList\": [{\"progress\" : \"40\",\"status\" : \"proccessing\",\"statusDescription"
+                + "responseHistoryList\": [{\"progress\" : \"40\",\"status\" : \"processing\",\"statusDescription"
                 + "\" : \"OMC VMs are decommissioned in VIM\",\"errorCode\" : null,\"responseId\" : \"1\"}, {\""
-                + "progress\" : \"41\",\"status\" : \"proccessing\",\"statusDescription\" : \"OMC VMs are "
+                + "progress\" : \"41\",\"status\" : \"processing\",\"statusDescription\" : \"OMC VMs are "
                 + "decommissioned in VIM\",\"errorCode\" : null,\"responseId\" : \"2\"}]}}";
     }
 
index 3696421..c19f538 100644 (file)
@@ -3,7 +3,7 @@
  * simulators
  * ================================================================================
  * Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2019, 2023 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.simulators;
 
+import jakarta.ws.rs.Consumes;
+import jakarta.ws.rs.POST;
+import jakarta.ws.rs.Path;
+import jakarta.ws.rs.Produces;
+import jakarta.ws.rs.core.MediaType;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.function.Function;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
 import org.onap.policy.common.utils.coder.Coder;
 import org.onap.policy.common.utils.coder.CoderException;
 import org.onap.policy.common.utils.coder.StandardCoder;
index d5d93e0..a730d97 100644 (file)
@@ -42,7 +42,8 @@ public class AaiSimulatorTest {
     @BeforeClass
     public static void setUpSimulator() {
         try {
-            Util.buildAaiSim();
+            var testServer = Util.buildAaiSim();
+            assertNotNull(testServer);
         } catch (final Exception e) {
             fail(e.getMessage());
         }
index 6c71940..5770769 100644 (file)
@@ -4,6 +4,7 @@
  * ================================================================================
  * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
  * Modifications Copyright (C) 2020-2021 Bell Canada. All rights reserved.
+ * Modifications Copyright (C) 2023 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -31,6 +32,7 @@ import io.grpc.netty.NettyChannelBuilder;
 import io.grpc.stub.StreamObserver;
 import java.io.IOException;
 import java.nio.charset.StandardCharsets;
+import java.util.Objects;
 import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
@@ -71,7 +73,8 @@ public class CdsSimulatorTest {
 
     @Test
     public void test() throws Exception {
-        String reqstr = IOUtils.toString(getClass().getResource("cds/cds.request.json"), StandardCharsets.UTF_8);
+        String reqstr = IOUtils.toString(Objects.requireNonNull(getClass().getResource("cds/cds.request.json")),
+            StandardCharsets.UTF_8);
         Builder builder = ExecutionServiceInput.newBuilder();
         JsonFormat.parser().ignoringUnknownFields().merge(reqstr, builder);
         ExecutionServiceInput request = builder.build();
@@ -83,7 +86,7 @@ public class CdsSimulatorTest {
 
             BluePrintProcessingServiceStub asyncStub = BluePrintProcessingServiceGrpc.newStub(channel);
 
-            StreamObserver<ExecutionServiceOutput> responseObserver = new StreamObserver<ExecutionServiceOutput>() {
+            StreamObserver<ExecutionServiceOutput> responseObserver = new StreamObserver<>() {
                 @Override
                 public void onNext(ExecutionServiceOutput output) {
                     future.complete(output);
index 197c25f..97ecfc2 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  * Copyright (C) 2019, 2022 AT&T Intellectual Property. All rights reserved.
  * Modifications Copyright (C) 2022 Bell Canada. All rights reserved.
+ * Modifications Copyright (C) 2023 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -42,7 +43,7 @@ import org.onap.policy.common.endpoints.parameters.TopicParameterGroup;
 import org.onap.policy.common.utils.coder.StandardCoder;
 
 public class DmaapSimulatorTest {
-    private static final int MAX_WAIT_SEC = 5;
+    private static final int MAX_WAIT_SEC = 10;
     private static final String TOPIC = "MY-TOPIC";
     private static final String AUTH_TOPIC = "MY-AUTH-TOPIC";
     private static final String AUTH_PORT = "3903";
index 31b7627..129f284 100644 (file)
@@ -57,7 +57,8 @@ public class SoSimulatorTest {
     @BeforeClass
     public static void setUpSimulator() {
         try {
-            Util.buildSoSim();
+            var testServer = Util.buildSoSim();
+            assertNotNull(testServer);
         } catch (final Exception e) {
             fail(e.getMessage());
         }
index dc48e75..a290f56 100644 (file)
@@ -43,7 +43,8 @@ public class VfcSimulatorTest {
     @BeforeClass
     public static void setUpSimulator() {
         try {
-            Util.buildVfcSim();
+            var testServer = Util.buildVfcSim();
+            assertNotNull(testServer);
         } catch (final Exception e) {
             fail(e.getMessage());
         }
@@ -58,7 +59,7 @@ public class VfcSimulatorTest {
     public void testPost() {
         final Pair<Integer, String> httpDetails =
                 new RestManager().post("http://localhost:6668/api/nslcm/v1/ns/1234567890/heal", "username", "password",
-                        new HashMap<String, String>(), "application/json", "Some Request Here");
+                    new HashMap<>(), "application/json", "Some Request Here");
         assertNotNull(httpDetails);
         assertEquals(202, httpDetails.getLeft().intValue());
         final VfcResponse response = Serialization.gsonPretty.fromJson(httpDetails.getRight(), VfcResponse.class);
@@ -68,7 +69,7 @@ public class VfcSimulatorTest {
     @Test
     public void testGet() {
         final Pair<Integer, String> httpDetails = new RestManager().get("http://localhost:6668/api/nslcm/v1/jobs/1234",
-                "username", "password", new HashMap<String, String>());
+                "username", "password", new HashMap<>());
         assertNotNull(httpDetails);
         final VfcResponse response = Serialization.gsonPretty.fromJson(httpDetails.getRight(), VfcResponse.class);
         assertNotNull(response);
index e188edc..417dcc9 100644 (file)
@@ -48,7 +48,8 @@ public class XacmlSimulatorTest {
     @BeforeClass
     public static void setupSimulator() {
         try {
-            org.onap.policy.simulators.Util.buildXacmlSim();
+            var testServer = Util.buildXacmlSim();
+            assertNotNull(testServer);
         } catch (Exception e) {
             fail(e.getMessage());
         }
index a62eceb..21fc140 100644 (file)
   ============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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-  <parent>
-    <groupId>org.onap.policy.models</groupId>
-    <artifactId>policy-models</artifactId>
-    <version>3.0.0-SNAPSHOT</version>
-  </parent>
-  <artifactId>policy-models-interactions</artifactId>
-  <packaging>pom</packaging>
-  <name>${project.artifactId}</name>
+<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">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.onap.policy.models</groupId>
+        <artifactId>policy-models</artifactId>
+        <version>3.0.1-SNAPSHOT</version>
+    </parent>
+    <artifactId>policy-models-interactions</artifactId>
+    <packaging>pom</packaging>
+    <name>${project.artifactId}</name>
 
-  <properties>
-    <jacoco.dataFile>${project.basedir}/../../target/code-coverage/jacoco-ut.exec</jacoco.dataFile>
-  </properties>
+    <properties>
+        <jacoco.dataFile>${project.basedir}/../../target/code-coverage/jacoco-ut.exec</jacoco.dataFile>
+    </properties>
 
-  <modules>
-      <module>model-simulators</module>
-      <module>model-impl</module>
-      <module>model-actors</module>
-  </modules>
+    <modules>
+        <module>model-simulators</module>
+        <module>model-impl</module>
+        <module>model-actors</module>
+    </modules>
 </project>
index eb30585..8138377 100644 (file)
@@ -1,6 +1,6 @@
 <!--
   ============LICENSE_START=======================================================
-   Copyright (C) 2019-2021 Nordix Foundation.
+   Copyright (C) 2019-2021, 2023 Nordix Foundation.
    Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
   ================================================================================
   Licensed under the Apache License, Version 2.0 (the "License");
 -->
 
 <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>
         <groupId>org.onap.policy.models</groupId>
         <artifactId>policy-models</artifactId>
-        <version>3.0.0-SNAPSHOT</version>
+        <version>3.0.1-SNAPSHOT</version>
     </parent>
 
     <artifactId>policy-models-pap</artifactId>
             <groupId>org.onap.policy.models</groupId>
             <artifactId>policy-models-base</artifactId>
             <version>${project.version}</version>
-        </dependency>
-         <dependency>
-             <groupId>org.onap.policy.models</groupId>
-             <artifactId>policy-models-dao</artifactId>
-             <version>${project.version}</version>
         </dependency>
         <dependency>
-            <groupId>org.assertj</groupId>
-            <artifactId>assertj-core</artifactId>
-            <scope>test</scope>
+            <groupId>org.onap.policy.models</groupId>
+            <artifactId>policy-models-dao</artifactId>
+            <version>${project.version}</version>
         </dependency>
         <dependency>
             <groupId>com.h2database</groupId>
index 4b7fde4..20af874 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2021,2023 Nordix Foundation.
+ *  Copyright (C) 2021, 2023 Nordix Foundation.
  *  Modifications Copyright (C) 2021-2022 Bell Canada. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
 
 package org.onap.policy.models.pap.persistence.concepts;
 
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.GeneratedValue;
+import jakarta.persistence.GenerationType;
+import jakarta.persistence.Id;
+import jakarta.persistence.Index;
+import jakarta.persistence.Inheritance;
+import jakarta.persistence.InheritanceType;
+import jakarta.persistence.Table;
+import jakarta.persistence.TableGenerator;
+import jakarta.persistence.Temporal;
+import jakarta.persistence.TemporalType;
+import jakarta.validation.constraints.NotNull;
+import java.io.Serial;
 import java.time.Instant;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Index;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.Table;
-import javax.persistence.TableGenerator;
-import javax.persistence.Temporal;
-import javax.persistence.TemporalType;
-import javax.validation.constraints.NotNull;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.NonNull;
@@ -70,6 +71,7 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
 @Data
 @EqualsAndHashCode(callSuper = false)
 public class JpaPolicyAudit extends PfConcept implements PfAuthorative<PolicyAudit> {
+    @Serial
     private static final long serialVersionUID = -2935734300607322191L;
 
     @Id
index 92b07be..cacbbc9 100644 (file)
@@ -25,7 +25,7 @@
     <parent>
         <groupId>org.onap.policy.models</groupId>
         <artifactId>policy-models</artifactId>
-        <version>3.0.0-SNAPSHOT</version>
+        <version>3.0.1-SNAPSHOT</version>
     </parent>
 
     <artifactId>policy-models-pdp</artifactId>
index 06f6030..402ef15 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019-2020 Nordix Foundation.
+ *  Copyright (C) 2019-2020, 2023 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,8 +20,9 @@
 
 package org.onap.policy.models.pdp.concepts;
 
+import jakarta.persistence.Embeddable;
+import java.io.Serial;
 import java.io.Serializable;
-import javax.persistence.Embeddable;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 import lombok.NonNull;
@@ -31,6 +32,7 @@ import org.onap.policy.models.pdp.enums.PdpEngineWorkerState;
 @Data
 @NoArgsConstructor
 public class PdpEngineWorkerStatistics implements Serializable {
+    @Serial
     private static final long serialVersionUID = 8262176849743624013L;
 
     private String engineId;
index 7c584f3..fd594a9 100644 (file)
@@ -3,7 +3,7 @@
  * ONAP Policy Model
  * ================================================================================
  * Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2019, 2023 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.models.pdp.persistence.concepts;
 
+import jakarta.persistence.Column;
+import jakarta.persistence.EmbeddedId;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Inheritance;
+import jakarta.persistence.InheritanceType;
+import jakarta.persistence.Table;
+import jakarta.persistence.Temporal;
+import jakarta.persistence.TemporalType;
+import java.io.Serial;
 import java.io.Serializable;
 import java.util.Date;
 import java.util.List;
-import javax.persistence.Column;
-import javax.persistence.EmbeddedId;
-import javax.persistence.Entity;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.Table;
-import javax.persistence.Temporal;
-import javax.persistence.TemporalType;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.NonNull;
@@ -61,6 +62,7 @@ import org.onap.policy.models.pdp.enums.PdpState;
 @Data
 @EqualsAndHashCode(callSuper = false)
 public class JpaPdp extends PfConcept implements PfAuthorative<Pdp>, Serializable {
+    @Serial
     private static final long serialVersionUID = -357224425637789775L;
 
     @EmbeddedId
index 07f9261..52f1456 100644 (file)
@@ -3,7 +3,7 @@
  * ONAP Policy Model
  * ================================================================================
  * Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019,2021 Nordix Foundation.
+ * Modifications Copyright (C) 2019, 2021, 2023 Nordix Foundation.
  * Modifications Copyright (C) 2022 Bell Canada. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
 
 package org.onap.policy.models.pdp.persistence.concepts;
 
+import jakarta.persistence.CascadeType;
+import jakarta.persistence.CollectionTable;
+import jakarta.persistence.Column;
+import jakarta.persistence.ElementCollection;
+import jakarta.persistence.EmbeddedId;
+import jakarta.persistence.Entity;
+import jakarta.persistence.FetchType;
+import jakarta.persistence.Inheritance;
+import jakarta.persistence.InheritanceType;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.OneToMany;
+import jakarta.persistence.Table;
+import java.io.Serial;
 import java.util.ArrayList;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
-import javax.persistence.CascadeType;
-import javax.persistence.CollectionTable;
-import javax.persistence.Column;
-import javax.persistence.ElementCollection;
-import javax.persistence.EmbeddedId;
-import javax.persistence.Entity;
-import javax.persistence.FetchType;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.JoinColumn;
-import javax.persistence.OneToMany;
-import javax.persistence.Table;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.NonNull;
@@ -70,6 +71,7 @@ import org.onap.policy.models.pdp.enums.PdpState;
 @Data
 @EqualsAndHashCode(callSuper = false)
 public class JpaPdpGroup extends PfConcept implements PfAuthorative<PdpGroup> {
+    @Serial
     private static final long serialVersionUID = -357224425637789775L;
 
     @EmbeddedId
index 88fb14a..857e38a 100644 (file)
@@ -3,6 +3,7 @@
  * ONAP
  * ================================================================================
  * Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 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.models.pdp.persistence.concepts;
 
+import jakarta.persistence.Column;
+import jakarta.persistence.EmbeddedId;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Index;
+import jakarta.persistence.Inheritance;
+import jakarta.persistence.InheritanceType;
+import jakarta.persistence.Table;
+import java.io.Serial;
 import java.util.List;
-import javax.persistence.Column;
-import javax.persistence.EmbeddedId;
-import javax.persistence.Entity;
-import javax.persistence.Index;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.Table;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.NonNull;
@@ -57,6 +59,7 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
 @Data
 @EqualsAndHashCode(callSuper = false)
 public class JpaPdpPolicyStatus extends PfConcept implements PfAuthorative<PdpPolicyStatus> {
+    @Serial
     private static final long serialVersionUID = -357224425637789775L;
 
     /**
index 1d49a9b..0d963c8 100644 (file)
@@ -3,7 +3,7 @@
  * ONAP Policy Model
  * ================================================================================
  * Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019-2021 Nordix Foundation.
+ * Modifications Copyright (C) 2019-2021, 2023 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.models.pdp.persistence.concepts;
 
+import jakarta.persistence.CascadeType;
+import jakarta.persistence.Column;
+import jakarta.persistence.ElementCollection;
+import jakarta.persistence.EmbeddedId;
+import jakarta.persistence.Entity;
+import jakarta.persistence.FetchType;
+import jakarta.persistence.Inheritance;
+import jakarta.persistence.InheritanceType;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.JoinTable;
+import jakarta.persistence.OneToMany;
+import jakarta.persistence.Table;
+import java.io.Serial;
 import java.util.ArrayList;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
-import javax.persistence.CascadeType;
-import javax.persistence.Column;
-import javax.persistence.ElementCollection;
-import javax.persistence.EmbeddedId;
-import javax.persistence.Entity;
-import javax.persistence.FetchType;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.JoinColumn;
-import javax.persistence.JoinTable;
-import javax.persistence.OneToMany;
-import javax.persistence.Table;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.NonNull;
@@ -72,6 +73,7 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
 @Data
 @EqualsAndHashCode(callSuper = false)
 public class JpaPdpSubGroup extends PfConcept implements PfAuthorative<PdpSubGroup> {
+    @Serial
     private static final long serialVersionUID = -357224425637789775L;
 
     @EmbeddedId
index 0cc0eb2..fe46328 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019 Nordix Foundation.
+ *  Copyright (C) 2019, 2023 Nordix Foundation.
  *  Modifications Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
  *  Modifications Copyright (C) 2023 Bell Canada. All rights reserved.
  * ================================================================================
 
 package org.onap.policy.models.pdp.persistence.provider;
 
+import jakarta.ws.rs.core.Response;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
-import javax.ws.rs.core.Response;
 import lombok.NonNull;
 import org.onap.policy.common.parameters.BeanValidationResult;
 import org.onap.policy.models.base.PfConceptKey;
@@ -63,9 +63,8 @@ public class PdpProvider {
      * @param dao the DAO to use to access the database
      * @param name the name of the PDP group to get, null to get all PDP groups
      * @return the PDP groups found
-     * @throws PfModelException on errors getting PDP groups
      */
-    public List<PdpGroup> getPdpGroups(@NonNull final PfDao dao, final String name) throws PfModelException {
+    public List<PdpGroup> getPdpGroups(@NonNull final PfDao dao, final String name) {
 
         return asPdpGroupList(dao.getFiltered(JpaPdpGroup.class, name, PfKey.NULL_KEY_VERSION));
     }
@@ -76,7 +75,6 @@ public class PdpProvider {
      * @param dao the DAO to use to access the database
      * @param filter the filter for the PDP groups to get
      * @return the PDP groups found
-     * @throws PfModelException on errors getting policies
      */
     public List<PdpGroup> getFilteredPdpGroups(@NonNull final PfDao dao, @NonNull final PdpGroupFilter filter) {
 
@@ -90,10 +88,8 @@ public class PdpProvider {
      * @param dao the DAO to use to access the database
      * @param pdpGroups a specification of the PDP groups to create
      * @return the PDP groups created
-     * @throws PfModelException on errors creating PDP groups
      */
-    public List<PdpGroup> createPdpGroups(@NonNull final PfDao dao, @NonNull final List<PdpGroup> pdpGroups)
-            throws PfModelException {
+    public List<PdpGroup> createPdpGroups(@NonNull final PfDao dao, @NonNull final List<PdpGroup> pdpGroups) {
 
         for (PdpGroup pdpGroup : pdpGroups) {
             var jpaPdpGroup = new JpaPdpGroup();
@@ -124,10 +120,8 @@ public class PdpProvider {
      * @param dao the DAO to use to access the database
      * @param pdpGroups a specification of the PDP groups to update
      * @return the PDP groups updated
-     * @throws PfModelException on errors updating PDP groups
      */
-    public List<PdpGroup> updatePdpGroups(@NonNull final PfDao dao, @NonNull final List<PdpGroup> pdpGroups)
-            throws PfModelException {
+    public List<PdpGroup> updatePdpGroups(@NonNull final PfDao dao, @NonNull final List<PdpGroup> pdpGroups) {
 
         for (PdpGroup pdpGroup : pdpGroups) {
             var jpaPdpGroup = new JpaPdpGroup();
@@ -159,10 +153,9 @@ public class PdpProvider {
      * @param dao the DAO to use to access the database
      * @param pdpGroupName the name of the PDP group of the PDP subgroup
      * @param pdpSubGroup the PDP subgroup to be updated
-     * @throws PfModelException on errors updating PDP subgroups
      */
     public void updatePdpSubGroup(@NonNull final PfDao dao, @NonNull final String pdpGroupName,
-            @NonNull final PdpSubGroup pdpSubGroup) throws PfModelException {
+            @NonNull final PdpSubGroup pdpSubGroup) {
 
         final var subGroupKey =
                 new PfReferenceKey(pdpGroupName, PfKey.NULL_KEY_VERSION, pdpSubGroup.getPdpType());
@@ -184,7 +177,6 @@ public class PdpProvider {
      * @param pdpGroupName the name of the PDP group of the PDP subgroup
      * @param pdpSubGroup the PDP subgroup to be updated
      * @param pdp the PDP to be updated
-     * @throws PfModelException on errors updating PDP subgroups
      */
     public void updatePdp(@NonNull final PfDao dao, @NonNull final String pdpGroupName,
             @NonNull final String pdpSubGroup, @NonNull final Pdp pdp) {
@@ -208,7 +200,6 @@ public class PdpProvider {
      * @param dao the DAO to use to access the database
      * @param name the name of the policy to get, null to get all PDP groups
      * @return the PDP group deleted
-     * @throws PfModelException on errors deleting PDP groups
      */
     public PdpGroup deletePdpGroup(@NonNull final PfDao dao, @NonNull final String name) {
 
@@ -232,11 +223,8 @@ public class PdpProvider {
      *
      * @param dao the DAO to use to access the database
      * @return the deployments found
-     * @throws PfModelException on errors getting PDP groups
      */
-    public List<PdpPolicyStatus> getAllPolicyStatus(@NonNull final PfDao dao)
-                    throws PfModelException {
-
+    public List<PdpPolicyStatus> getAllPolicyStatus(@NonNull final PfDao dao) {
         return dao.getAll(JpaPdpPolicyStatus.class).stream().map(JpaPdpPolicyStatus::toAuthorative)
                         .collect(Collectors.toList());
     }
@@ -246,11 +234,9 @@ public class PdpProvider {
      *
      * @param dao the DAO to use to access the database
      * @return the deployments found
-     * @throws PfModelException on errors getting PDP groups
      */
     public List<PdpPolicyStatus> getAllPolicyStatus(@NonNull final PfDao dao,
-                    @NonNull ToscaConceptIdentifierOptVersion policy) throws PfModelException {
-
+                    @NonNull ToscaConceptIdentifierOptVersion policy) {
         if (policy.getVersion() != null) {
             return dao.getAll(JpaPdpPolicyStatus.class, new PfConceptKey(policy.getName(), policy.getVersion()))
                             .stream().map(JpaPdpPolicyStatus::toAuthorative).collect(Collectors.toList());
@@ -268,11 +254,8 @@ public class PdpProvider {
      * @param groupName the name of the PDP group of interest, null to get results for all
      *        PDP groups
      * @return the deployments found
-     * @throws PfModelException on errors getting PDP groups
      */
-    public List<PdpPolicyStatus> getGroupPolicyStatus(@NonNull final PfDao dao, @NonNull final String groupName)
-                    throws PfModelException {
-
+    public List<PdpPolicyStatus> getGroupPolicyStatus(@NonNull final PfDao dao, @NonNull final String groupName) {
         PfFilterParameters params = PfFilterParameters.builder().filterMap(Map.of("pdpGroup", groupName)).build();
 
         return dao.getFiltered(JpaPdpPolicyStatus.class, params)
index bf62330..24d9e72 100644 (file)
@@ -1,6 +1,7 @@
 <!--
   ============LICENSE_START=======================================================
    Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
+   Modifications Copyright (C) 2023 Nordix Foundation.
   ================================================================================
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with 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 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>
         <groupId>org.onap.policy.models</groupId>
         <artifactId>policy-models</artifactId>
-        <version>3.0.0-SNAPSHOT</version>
+        <version>3.0.1-SNAPSHOT</version>
     </parent>
 
     <artifactId>policy-models-provider</artifactId>
             <artifactId>policy-models-pap</artifactId>
             <version>${project.version}</version>
         </dependency>
-
         <dependency>
             <groupId>com.h2database</groupId>
             <artifactId>h2</artifactId>
             <scope>test</scope>
         </dependency>
-
-        <dependency>
-            <groupId>org.mockito</groupId>
-            <artifactId>mockito-all</artifactId>
-            <scope>test</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>org.assertj</groupId>
-            <artifactId>assertj-core</artifactId>
-            <scope>test</scope>
-        </dependency>
-
         <dependency>
             <groupId>org.awaitility</groupId>
             <artifactId>awaitility</artifactId>
index 7cd36a5..f3ec6e5 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019 Nordix Foundation.
+ *  Copyright (C) 2019, 2023 Nordix Foundation.
  *  Modifications Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -21,7 +21,7 @@
 
 package org.onap.policy.models.provider;
 
-import javax.ws.rs.core.Response;
+import jakarta.ws.rs.core.Response;
 import lombok.NonNull;
 import org.onap.policy.models.base.PfModelException;
 import org.onap.policy.models.dao.impl.ProxyDao;
index 7f6c4e5..1926185 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2021 Nordix Foundation.
+ *  Copyright (C) 2021, 2023 Nordix Foundation.
  *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -21,8 +21,8 @@
 
 package org.onap.policy.models.provider.impl;
 
+import jakarta.ws.rs.core.Response;
 import java.io.Closeable;
-import javax.ws.rs.core.Response;
 import lombok.Getter;
 import lombok.NonNull;
 import org.onap.policy.models.base.PfModelException;
index 03c2236..c7225b0 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2021-2022 Nordix Foundation.
+ *  Copyright (C) 2021-2023 Nordix Foundation.
  *  Modifications Copyright (C) 2022 Bell Canada. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
 
 package org.onap.policy.models.provider.impl;
 
+import jakarta.ws.rs.core.Response;
 import java.util.Collection;
 import java.util.List;
 import java.util.Map;
-import javax.ws.rs.core.Response;
 import lombok.NonNull;
 import org.onap.policy.models.base.PfModelException;
 import org.onap.policy.models.base.PfModelRuntimeException;
index ed47ae0..8f4cdbc 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019-2021 Nordix Foundation.
+ *  Copyright (C) 2019-2021, 2023 Nordix Foundation.
  *  Modifications Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
  *  Modifications Copyright (C) 2020, 2022 Bell Canada. All rights reserved.
  * ================================================================================
@@ -22,7 +22,7 @@
 
 package org.onap.policy.models.provider.impl;
 
-import javax.ws.rs.core.Response;
+import jakarta.ws.rs.core.Response;
 import lombok.Getter;
 import lombok.NonNull;
 import org.onap.policy.models.base.PfModelException;
index d90847f..527f0dd 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2021,2023 Nordix Foundation.
+ *  Copyright (C) 2021, 2023 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,8 +20,8 @@
 
 package org.onap.policy.models.provider.impl;
 
+import jakarta.ws.rs.core.Response;
 import java.util.Properties;
-import javax.ws.rs.core.Response;
 import lombok.AccessLevel;
 import lombok.NoArgsConstructor;
 import org.onap.policy.models.base.PfModelException;
@@ -47,10 +47,10 @@ public final class ModelsProvider {
 
         // @formatter:off
         var jdbcProperties = new Properties();
-        jdbcProperties.setProperty("javax.persistence.jdbc.driver",   parameters.getDatabaseDriver());
-        jdbcProperties.setProperty("javax.persistence.jdbc.url",      parameters.getDatabaseUrl());
-        jdbcProperties.setProperty("javax.persistence.jdbc.user",     parameters.getDatabaseUser());
-        jdbcProperties.setProperty("javax.persistence.jdbc.password", parameters.getDatabasePassword());
+        jdbcProperties.setProperty("jakarta.persistence.jdbc.driver",   parameters.getDatabaseDriver());
+        jdbcProperties.setProperty("jakarta.persistence.jdbc.url",      parameters.getDatabaseUrl());
+        jdbcProperties.setProperty("jakarta.persistence.jdbc.user",     parameters.getDatabaseUser());
+        jdbcProperties.setProperty("jakarta.persistence.jdbc.password", parameters.getDatabasePassword());
         jdbcProperties.setProperty("hibernate.dialect",
             (parameters.getDatabaseType() == null
                 ? "org.hibernate.dialect.MariaDBDialect"
index 33deed7..a1339e4 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019-2022 Nordix Foundation.
+ *  Copyright (C) 2019-2023 Nordix Foundation.
  *  Modifications Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved.
  *  Modifications Copyright (C) 2020, 2022 Bell Canada. All rights reserved.
  * ================================================================================
 
 package org.onap.policy.models.provider.impl;
 
+import jakarta.ws.rs.core.Response;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
 import java.util.Map;
-import javax.ws.rs.core.Response;
 import lombok.NonNull;
 import org.onap.policy.models.base.PfModelException;
 import org.onap.policy.models.base.PfModelRuntimeException;
@@ -56,198 +56,182 @@ public class DummyBadProviderImpl implements PolicyModelsProvider {
     }
 
     @Override
-    public void close() throws PfModelException {
+    public void close() {
         // do nothing
     }
 
     @Override
-    public void init() throws PfModelException {
+    public void init() {
         // do nothing
     }
 
     @Override
     public List<ToscaServiceTemplate> getFilteredServiceTemplateList(
-            @NonNull ToscaEntityFilter<ToscaServiceTemplate> filter) throws PfModelException {
+            @NonNull ToscaEntityFilter<ToscaServiceTemplate> filter) {
         return null;
     }
 
     @Override
-    public ToscaServiceTemplate createServiceTemplate(@NonNull ToscaServiceTemplate serviceTemplate)
-            throws PfModelException {
+    public ToscaServiceTemplate createServiceTemplate(@NonNull ToscaServiceTemplate serviceTemplate) {
         return null;
     }
 
     @Override
-    public ToscaServiceTemplate updateServiceTemplate(@NonNull ToscaServiceTemplate serviceTemplate)
-            throws PfModelException {
+    public ToscaServiceTemplate updateServiceTemplate(@NonNull ToscaServiceTemplate serviceTemplate) {
         return null;
     }
 
     @Override
-    public ToscaServiceTemplate deleteServiceTemplate(@NonNull String name, @NonNull String version)
-            throws PfModelException {
+    public ToscaServiceTemplate deleteServiceTemplate(@NonNull String name, @NonNull String version) {
         return null;
     }
 
     @Override
-    public ToscaServiceTemplate getPolicyTypes(final String name, final String version) throws PfModelException {
+    public ToscaServiceTemplate getPolicyTypes(final String name, final String version) {
         return null;
     }
 
     @Override
-    public ToscaServiceTemplate createPolicyTypes(@NonNull ToscaServiceTemplate serviceTemplate)
-            throws PfModelException {
+    public ToscaServiceTemplate createPolicyTypes(@NonNull ToscaServiceTemplate serviceTemplate) {
         return null;
     }
 
     @Override
-    public ToscaServiceTemplate updatePolicyTypes(@NonNull ToscaServiceTemplate serviceTemplate)
-            throws PfModelException {
+    public ToscaServiceTemplate updatePolicyTypes(@NonNull ToscaServiceTemplate serviceTemplate) {
         return null;
     }
 
     @Override
-    public ToscaServiceTemplate deletePolicyType(final String name, final String version) throws PfModelException {
+    public ToscaServiceTemplate deletePolicyType(final String name, final String version) {
         return null;
     }
 
     @Override
-    public ToscaServiceTemplate getPolicies(final String name, final String version) throws PfModelException {
+    public ToscaServiceTemplate getPolicies(final String name, final String version) {
         return null;
     }
 
     @Override
-    public ToscaServiceTemplate createPolicies(@NonNull ToscaServiceTemplate serviceTemplate) throws PfModelException {
+    public ToscaServiceTemplate createPolicies(@NonNull ToscaServiceTemplate serviceTemplate) {
         return null;
     }
 
     @Override
-    public ToscaServiceTemplate updatePolicies(@NonNull ToscaServiceTemplate serviceTemplate) throws PfModelException {
+    public ToscaServiceTemplate updatePolicies(@NonNull ToscaServiceTemplate serviceTemplate) {
         return null;
     }
 
     @Override
-    public ToscaServiceTemplate deletePolicy(final String name, final String version) throws PfModelException {
+    public ToscaServiceTemplate deletePolicy(final String name, final String version) {
         return null;
     }
 
     @Override
-    public ToscaServiceTemplate createToscaNodeTemplates(@NonNull ToscaServiceTemplate serviceTemplate)
-        throws PfModelException {
+    public ToscaServiceTemplate createToscaNodeTemplates(@NonNull ToscaServiceTemplate serviceTemplate) {
         return null;
     }
 
     @Override
     public ToscaServiceTemplate updateToscaNodeTemplates(@NonNull ToscaServiceTemplate serviceTemplate)
-        throws PfModelRuntimeException, PfModelException {
+        throws PfModelRuntimeException {
         return null;
     }
 
     @Override
-    public ToscaServiceTemplate deleteToscaNodeTemplate(@NonNull String name, @NonNull String version)
-        throws PfModelException {
+    public ToscaServiceTemplate deleteToscaNodeTemplate(@NonNull String name, @NonNull String version) {
         return null;
     }
 
     @Override
     public List<Map<ToscaEntityKey, Map<String, Object>>> getNodeTemplateMetadataSets(@NonNull String name,
-                                                                                      @NonNull String version)
-        throws PfModelException {
+                                                                                      @NonNull String version) {
         return null;
     }
 
     @Override
-    public List<ToscaNodeTemplate> getToscaNodeTemplate(final String name, final String version)
-        throws PfModelException {
+    public List<ToscaNodeTemplate> getToscaNodeTemplate(final String name, final String version) {
         return null;
     }
 
     @Override
-    public List<PdpGroup> getPdpGroups(String name) throws PfModelException {
+    public List<PdpGroup> getPdpGroups(String name) {
         return Collections.emptyList();
     }
 
     @Override
-    public List<PdpGroup> createPdpGroups(@NonNull List<PdpGroup> pdpGroups) throws PfModelException {
+    public List<PdpGroup> createPdpGroups(@NonNull List<PdpGroup> pdpGroups) {
         return Collections.emptyList();
     }
 
     @Override
-    public List<PdpGroup> updatePdpGroups(@NonNull List<PdpGroup> pdpGroups) throws PfModelException {
+    public List<PdpGroup> updatePdpGroups(@NonNull List<PdpGroup> pdpGroups) {
         return Collections.emptyList();
     }
 
     @Override
-    public void updatePdp(@NonNull String pdpGroupName, @NonNull String pdpSubGroup, @NonNull Pdp pdp)
-            throws PfModelException {
+    public void updatePdp(@NonNull String pdpGroupName, @NonNull String pdpSubGroup, @NonNull Pdp pdp) {
         // do nothing
     }
 
     @Override
-    public PdpGroup deletePdpGroup(@NonNull String name) throws PfModelException {
+    public PdpGroup deletePdpGroup(@NonNull String name) {
         return null;
     }
 
     @Override
-    public List<ToscaPolicyType> getPolicyTypeList(String name, String version) throws PfModelException {
+    public List<ToscaPolicyType> getPolicyTypeList(String name, String version) {
         return Collections.emptyList();
     }
 
     @Override
-    public ToscaServiceTemplate getFilteredPolicyTypes(@NonNull ToscaEntityFilter<ToscaPolicyType> filter)
-            throws PfModelException {
+    public ToscaServiceTemplate getFilteredPolicyTypes(@NonNull ToscaEntityFilter<ToscaPolicyType> filter) {
         return null;
     }
 
     @Override
-    public List<ToscaPolicyType> getFilteredPolicyTypeList(@NonNull ToscaEntityFilter<ToscaPolicyType> filter)
-            throws PfModelException {
+    public List<ToscaPolicyType> getFilteredPolicyTypeList(@NonNull ToscaEntityFilter<ToscaPolicyType> filter) {
         return Collections.emptyList();
     }
 
     @Override
-    public List<ToscaPolicy> getPolicyList(String name, String version) throws PfModelException {
+    public List<ToscaPolicy> getPolicyList(String name, String version) {
         return Collections.emptyList();
     }
 
     @Override
-    public ToscaServiceTemplate getFilteredPolicies(@NonNull ToscaTypedEntityFilter<ToscaPolicy> filter)
-            throws PfModelException {
+    public ToscaServiceTemplate getFilteredPolicies(@NonNull ToscaTypedEntityFilter<ToscaPolicy> filter) {
         return null;
     }
 
     @Override
-    public List<ToscaPolicy> getFilteredPolicyList(@NonNull ToscaTypedEntityFilter<ToscaPolicy> filter)
-            throws PfModelException {
+    public List<ToscaPolicy> getFilteredPolicyList(@NonNull ToscaTypedEntityFilter<ToscaPolicy> filter) {
         return Collections.emptyList();
     }
 
     @Override
-    public List<PdpGroup> getFilteredPdpGroups(@NonNull PdpGroupFilter filter) throws PfModelException {
+    public List<PdpGroup> getFilteredPdpGroups(@NonNull PdpGroupFilter filter) {
         return Collections.emptyList();
     }
 
     @Override
-    public void updatePdpSubGroup(@NonNull String pdpGroupName, @NonNull PdpSubGroup pdpSubGroup)
-            throws PfModelException {
+    public void updatePdpSubGroup(@NonNull String pdpGroupName, @NonNull PdpSubGroup pdpSubGroup) {
         // do nothing
     }
 
     @Override
-    public List<PdpPolicyStatus> getAllPolicyStatus() throws PfModelException {
+    public List<PdpPolicyStatus> getAllPolicyStatus() {
         // Not implemented
         return null;
     }
 
     @Override
-    public List<PdpPolicyStatus> getAllPolicyStatus(@NonNull ToscaConceptIdentifierOptVersion policy)
-            throws PfModelException {
+    public List<PdpPolicyStatus> getAllPolicyStatus(@NonNull ToscaConceptIdentifierOptVersion policy) {
         // Not implemented
         return null;
     }
 
     @Override
-    public List<PdpPolicyStatus> getGroupPolicyStatus(@NonNull String groupName) throws PfModelException {
+    public List<PdpPolicyStatus> getGroupPolicyStatus(@NonNull String groupName) {
         // Not implemented
         return null;
     }
@@ -259,7 +243,7 @@ public class DummyBadProviderImpl implements PolicyModelsProvider {
     }
 
     @Override
-    public List<ToscaServiceTemplate> getServiceTemplateList(String name, String version) throws PfModelException {
+    public List<ToscaServiceTemplate> getServiceTemplateList(String name, String version) {
         // Not implemented
         return null;
     }
index 9a3d4f5..0808a40 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019-2022 Nordix Foundation.
+ *  Copyright (C) 2019-2023 Nordix Foundation.
  *  Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved.
  *  Modifications Copyright (C) 2020, 2022 Bell Canada. All rights reserved.
  * ================================================================================
 
 package org.onap.policy.models.provider.impl;
 
+import jakarta.ws.rs.core.Response;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
 import java.util.Map;
-import javax.ws.rs.core.Response;
 import lombok.NonNull;
 import org.onap.policy.common.utils.coder.StandardCoder;
 import org.onap.policy.common.utils.resources.ResourceUtils;
@@ -65,7 +65,7 @@ public class DummyPolicyModelsProviderImpl implements PolicyModelsProvider {
     }
 
     @Override
-    public void init() throws PfModelException {
+    public void init() {
         // Not required on the dummy provider
     }
 
@@ -76,13 +76,13 @@ public class DummyPolicyModelsProviderImpl implements PolicyModelsProvider {
 
 
     @Override
-    public List<ToscaServiceTemplate> getServiceTemplateList(String name, String version) throws PfModelException {
+    public List<ToscaServiceTemplate> getServiceTemplateList(String name, String version) {
         return new ArrayList<>();
     }
 
     @Override
     public List<ToscaServiceTemplate> getFilteredServiceTemplateList(
-            @NonNull ToscaEntityFilter<ToscaServiceTemplate> filter) throws PfModelException {
+            @NonNull ToscaEntityFilter<ToscaServiceTemplate> filter) {
         return new ArrayList<>();
     }
 
@@ -105,18 +105,17 @@ public class DummyPolicyModelsProviderImpl implements PolicyModelsProvider {
     }
 
     @Override
-    public ToscaServiceTemplate getPolicyTypes(final String name, final String version) throws PfModelException {
+    public ToscaServiceTemplate getPolicyTypes(final String name, final String version) {
         return getDummyResponse("dummyimpl/DummyToscaPolicyTypeGetResponse.json");
     }
 
     @Override
-    public List<ToscaPolicyType> getPolicyTypeList(final String name, final String version) throws PfModelException {
+    public List<ToscaPolicyType> getPolicyTypeList(final String name, final String version) {
         return new ArrayList<>();
     }
 
     @Override
-    public ToscaServiceTemplate getFilteredPolicyTypes(ToscaEntityFilter<ToscaPolicyType> filter)
-            throws PfModelException {
+    public ToscaServiceTemplate getFilteredPolicyTypes(ToscaEntityFilter<ToscaPolicyType> filter) {
         return getDummyResponse("dummyimpl/DummyToscaPolicyTypeGetResponse.json");
     }
 
@@ -126,137 +125,131 @@ public class DummyPolicyModelsProviderImpl implements PolicyModelsProvider {
     }
 
     @Override
-    public ToscaServiceTemplate createPolicyTypes(final ToscaServiceTemplate serviceTemplate) throws PfModelException {
+    public ToscaServiceTemplate createPolicyTypes(final ToscaServiceTemplate serviceTemplate) {
         return serviceTemplate;
     }
 
     @Override
-    public ToscaServiceTemplate updatePolicyTypes(final ToscaServiceTemplate serviceTemplate) throws PfModelException {
+    public ToscaServiceTemplate updatePolicyTypes(final ToscaServiceTemplate serviceTemplate) {
         return serviceTemplate;
     }
 
     @Override
-    public ToscaServiceTemplate deletePolicyType(final String name, final String version) throws PfModelException {
+    public ToscaServiceTemplate deletePolicyType(final String name, final String version) {
         return getDummyResponse("dummyimpl/DummyToscaPolicyTypeDeleteResponse.json");
     }
 
     @Override
-    public ToscaServiceTemplate getPolicies(final String name, final String version) throws PfModelException {
+    public ToscaServiceTemplate getPolicies(final String name, final String version) {
         return getDummyResponse("dummyimpl/DummyToscaPolicyGetResponse.json");
     }
 
     @Override
-    public List<ToscaPolicy> getPolicyList(final String name, final String version) throws PfModelException {
+    public List<ToscaPolicy> getPolicyList(final String name, final String version) {
         return new ArrayList<>();
     }
 
     @Override
-    public ToscaServiceTemplate getFilteredPolicies(ToscaTypedEntityFilter<ToscaPolicy> filter)
-            throws PfModelException {
+    public ToscaServiceTemplate getFilteredPolicies(ToscaTypedEntityFilter<ToscaPolicy> filter) {
         return getDummyResponse("dummyimpl/DummyToscaPolicyGetResponse.json");
     }
 
     @Override
-    public List<ToscaPolicy> getFilteredPolicyList(ToscaTypedEntityFilter<ToscaPolicy> filter) throws PfModelException {
+    public List<ToscaPolicy> getFilteredPolicyList(ToscaTypedEntityFilter<ToscaPolicy> filter) {
         return new ArrayList<>();
     }
 
     @Override
-    public ToscaServiceTemplate createPolicies(final ToscaServiceTemplate serviceTemplate) throws PfModelException {
+    public ToscaServiceTemplate createPolicies(final ToscaServiceTemplate serviceTemplate) {
         return serviceTemplate;
     }
 
     @Override
-    public ToscaServiceTemplate updatePolicies(final ToscaServiceTemplate serviceTemplate) throws PfModelException {
+    public ToscaServiceTemplate updatePolicies(final ToscaServiceTemplate serviceTemplate) {
         return serviceTemplate;
     }
 
     @Override
-    public ToscaServiceTemplate deletePolicy(final String name, final String version) throws PfModelException {
+    public ToscaServiceTemplate deletePolicy(final String name, final String version) {
         return getDummyResponse("dummyimpl/DummyToscaPolicyDeleteResponse.json");
     }
 
     @Override
-    public ToscaServiceTemplate createToscaNodeTemplates(@NonNull ToscaServiceTemplate serviceTemplate)
-        throws PfModelException {
+    public ToscaServiceTemplate createToscaNodeTemplates(@NonNull ToscaServiceTemplate serviceTemplate) {
         return getDummyNodeTemplateResponse("dummyimpl/DummyToscaNodeTemplateResponse.json");
     }
 
     @Override
     public ToscaServiceTemplate updateToscaNodeTemplates(@NonNull ToscaServiceTemplate serviceTemplate)
-        throws PfModelRuntimeException, PfModelException {
+        throws PfModelRuntimeException {
         return getDummyNodeTemplateResponse("dummyimpl/DummyToscaNodeTemplateResponse.json");
     }
 
     @Override
-    public ToscaServiceTemplate deleteToscaNodeTemplate(@NonNull String name, @NonNull String version)
-        throws PfModelException {
+    public ToscaServiceTemplate deleteToscaNodeTemplate(@NonNull String name, @NonNull String version) {
         return getDummyNodeTemplateResponse("dummyimpl/DummyToscaNodeTemplateResponse.json");
     }
 
     @Override
     public List<Map<ToscaEntityKey, Map<String, Object>>> getNodeTemplateMetadataSets(@NonNull String name,
-                                                                                      @NonNull String version)
-        throws PfModelException {
+                                                                                      @NonNull String version) {
         return new ArrayList<>();
     }
 
     @Override
-    public List<ToscaNodeTemplate> getToscaNodeTemplate(final String name, final String version)
-        throws PfModelException {
+    public List<ToscaNodeTemplate> getToscaNodeTemplate(final String name, final String version) {
         return new ArrayList<>();
     }
 
     @Override
-    public List<PdpGroup> getPdpGroups(final String name) throws PfModelException {
+    public List<PdpGroup> getPdpGroups(final String name) {
         return new ArrayList<>();
     }
 
     @Override
-    public List<PdpGroup> getFilteredPdpGroups(PdpGroupFilter filter) throws PfModelException {
+    public List<PdpGroup> getFilteredPdpGroups(PdpGroupFilter filter) {
         return new ArrayList<>();
     }
 
     @Override
-    public List<PdpGroup> createPdpGroups(final List<PdpGroup> pdpGroups) throws PfModelException {
+    public List<PdpGroup> createPdpGroups(final List<PdpGroup> pdpGroups) {
         return new ArrayList<>();
     }
 
     @Override
-    public List<PdpGroup> updatePdpGroups(final List<PdpGroup> pdpGroups) throws PfModelException {
+    public List<PdpGroup> updatePdpGroups(final List<PdpGroup> pdpGroups) {
         return new ArrayList<>();
     }
 
     @Override
-    public void updatePdpSubGroup(final String pdpGroupName, final PdpSubGroup pdpSubGroup) throws PfModelException {
+    public void updatePdpSubGroup(final String pdpGroupName, final PdpSubGroup pdpSubGroup) {
         // Not implemented
     }
 
     @Override
-    public void updatePdp(String pdpGroupName, String pdpSubGroup, Pdp pdp) throws PfModelException {
+    public void updatePdp(String pdpGroupName, String pdpSubGroup, Pdp pdp) {
         // Not implemented
     }
 
     @Override
-    public PdpGroup deletePdpGroup(final String name) throws PfModelException {
+    public PdpGroup deletePdpGroup(final String name) {
         return null;
     }
 
     @Override
-    public List<PdpPolicyStatus> getAllPolicyStatus() throws PfModelException {
+    public List<PdpPolicyStatus> getAllPolicyStatus() {
         // Not implemented
         return new ArrayList<>();
     }
 
     @Override
-    public List<PdpPolicyStatus> getAllPolicyStatus(@NonNull ToscaConceptIdentifierOptVersion policy)
-            throws PfModelException {
+    public List<PdpPolicyStatus> getAllPolicyStatus(@NonNull ToscaConceptIdentifierOptVersion policy) {
         // Not implemented
         return new ArrayList<>();
     }
 
     @Override
-    public List<PdpPolicyStatus> getGroupPolicyStatus(String groupName) throws PfModelException {
+    public List<PdpPolicyStatus> getGroupPolicyStatus(String groupName) {
         // Not implemented
         return new ArrayList<>();
     }
index 3ee3b32..2cfeadd 100644 (file)
@@ -1,6 +1,6 @@
 <!--
   ============LICENSE_START=======================================================
-   Copyright (C) 2019,2023 Nordix Foundation.
+   Copyright (C) 2019, 2023 Nordix Foundation.
    Modifications Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
   ================================================================================
   Licensed under the Apache License, Version 2.0 (the "License");
@@ -25,7 +25,7 @@
     <parent>
         <groupId>org.onap.policy.models.sim</groupId>
         <artifactId>policy-models-sim</artifactId>
-        <version>3.0.0-SNAPSHOT</version>
+        <version>3.0.1-SNAPSHOT</version>
     </parent>
 
     <artifactId>policy-models-sim-dmaap</artifactId>
     <description>A module that implements a very simple DMaaP simulator.</description>
 
     <dependencies>
-        <dependency>
-            <groupId>commons-cli</groupId>
-            <artifactId>commons-cli</artifactId>
-        </dependency>
         <dependency>
             <groupId>org.onap.policy.common</groupId>
             <artifactId>common-parameters</artifactId>
@@ -46,6 +42,7 @@
         <dependency>
             <groupId>org.onap.policy.common</groupId>
             <artifactId>utils</artifactId>
+            <version>${policy.common.version}</version>
         </dependency>
         <dependency>
             <groupId>org.onap.policy.common</groupId>
@@ -64,9 +61,8 @@
             <scope>test</scope>
         </dependency>
         <dependency>
-            <groupId>org.mockito</groupId>
-            <artifactId>mockito-core</artifactId>
-            <scope>test</scope>
+            <groupId>commons-cli</groupId>
+            <artifactId>commons-cli</artifactId>
         </dependency>
         <dependency>
             <groupId>org.springframework</groupId>
index 2119a65..afbe10f 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019 Nordix Foundation.
+ *  Copyright (C) 2019, 2023 Nordix Foundation.
  *  Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
  *  Modifications Copyright (C) 2021 Bell Canada. All rights reserved.
  * ================================================================================
@@ -22,6 +22,8 @@
 
 package org.onap.policy.models.sim.dmaap.provider;
 
+import jakarta.ws.rs.core.Response;
+import jakarta.ws.rs.core.Response.Status;
 import java.util.Collections;
 import java.util.LinkedHashMap;
 import java.util.List;
@@ -30,8 +32,6 @@ import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.Executors;
 import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.TimeUnit;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.Response.Status;
 import lombok.Getter;
 import lombok.Setter;
 import org.onap.policy.common.utils.services.ServiceManagerContainer;
index 472a898..84b610a 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019 Nordix Foundation.
+ *  Copyright (C) 2019, 2023 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.models.sim.dmaap.rest;
 
+import jakarta.ws.rs.Consumes;
+import jakarta.ws.rs.Produces;
+import jakarta.ws.rs.core.Response.ResponseBuilder;
 import java.net.HttpURLConnection;
 import java.util.UUID;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.Response.ResponseBuilder;
 
 /**
  * Version v1 common superclass to provide DMaaP endpoints for the DMaaP simulator component.
index 64ea29d..0efab16 100644 (file)
@@ -3,6 +3,7 @@
  * ONAP Policy Models
  * ================================================================================
  * Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 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.models.sim.dmaap.rest;
 
+import jakarta.ws.rs.Consumes;
+import jakarta.ws.rs.core.MediaType;
+import jakarta.ws.rs.core.MultivaluedMap;
+import jakarta.ws.rs.ext.MessageBodyReader;
+import jakarta.ws.rs.ext.Provider;
 import java.io.BufferedReader;
 import java.io.EOFException;
 import java.io.IOException;
@@ -31,11 +37,6 @@ import java.lang.reflect.Type;
 import java.nio.charset.StandardCharsets;
 import java.util.LinkedList;
 import java.util.List;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.ext.MessageBodyReader;
-import javax.ws.rs.ext.Provider;
 import org.apache.commons.io.IOUtils;
 
 /**
@@ -146,7 +147,7 @@ public class CambriaMessageBodyHandler implements MessageBodyReader<Object> {
 
             if (chr == '.') {
                 String text = bldr.toString().trim();
-                return (text.isEmpty() ? 0 : Integer.valueOf(text));
+                return (text.isEmpty() ? 0 : Integer.parseInt(text));
             }
 
             if (!Character.isDigit(chr)) {
index 17b7529..5ed04f1 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019,2021 Nordix Foundation.
+ *  Copyright (C) 2019, 2021, 2023 Nordix Foundation.
  *  Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
  *  Modifications Copyright (C) 2021 Bell Canada. All rights reserved.
  * ================================================================================
 
 package org.onap.policy.models.sim.dmaap.rest;
 
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DefaultValue;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.Response;
+import jakarta.ws.rs.Consumes;
+import jakarta.ws.rs.DefaultValue;
+import jakarta.ws.rs.GET;
+import jakarta.ws.rs.POST;
+import jakarta.ws.rs.Path;
+import jakarta.ws.rs.PathParam;
+import jakarta.ws.rs.Produces;
+import jakarta.ws.rs.QueryParam;
+import jakarta.ws.rs.core.Response;
 import org.onap.policy.models.sim.dmaap.provider.DmaapSimProvider;
 
 /**
index c72b748..6d3bd73 100644 (file)
@@ -3,6 +3,7 @@
  * ONAP Policy Models
  * ================================================================================
  * Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 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.models.sim.dmaap.rest;
 
+import jakarta.ws.rs.Consumes;
+import jakarta.ws.rs.core.MediaType;
+import jakarta.ws.rs.core.MultivaluedMap;
+import jakarta.ws.rs.ext.MessageBodyReader;
+import jakarta.ws.rs.ext.Provider;
 import java.io.BufferedReader;
 import java.io.IOException;
 import java.io.InputStream;
@@ -29,11 +35,6 @@ import java.lang.reflect.Type;
 import java.nio.charset.StandardCharsets;
 import java.util.LinkedList;
 import java.util.List;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.ext.MessageBodyReader;
-import javax.ws.rs.ext.Provider;
 
 /**
  * Provider that decodes "text/plain" messages.
index 3d72f2e..f82ef03 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  * Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -32,6 +33,8 @@ import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
+import jakarta.ws.rs.core.Response;
+import jakarta.ws.rs.core.Response.Status;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
@@ -39,8 +42,6 @@ import java.util.concurrent.BlockingQueue;
 import java.util.concurrent.LinkedBlockingQueue;
 import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.TimeUnit;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.Response.Status;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -104,7 +105,7 @@ public class DmaapSimProviderTest {
     }
 
     /**
-     * Verifies that the constructor adds all of the expected actions to the service
+     * Verifies that the constructor adds all the expected actions to the service
      * manager container.
      */
     @Test
@@ -202,7 +203,7 @@ public class DmaapSimProviderTest {
     public void testProcessDmaapMessageGet_Ex() throws InterruptedException {
         BlockingQueue<Response> respQueue = new LinkedBlockingQueue<>();
 
-        // put in a background thread so it doesn't interrupt the tester thread
+        // put in a background thread, so it doesn't interrupt the tester thread
         new Thread(() -> {
             try {
                 when(data1.read(any(), anyInt(), anyLong())).thenThrow(new InterruptedException(EXPECTED_EXCEPTION));
@@ -240,15 +241,15 @@ public class DmaapSimProviderTest {
 
     @Test
     public void testMakeTimerPool() {
-        // use a real provider so we can test the real makeTimer() method
+        // use a real provider, so we can test the real makeTimer() method
         DmaapSimProvider prov2 = new DmaapSimProvider(params);
         prov2.start();
-        assertThatCode(() -> prov2.stop()).doesNotThrowAnyException();
+        assertThatCode(prov2::stop).doesNotThrowAnyException();
     }
 
     @Test
     public void testMakeTopicData() {
-        // use a real provider so we can test the real makeTopicData() method
+        // use a real provider, so we can test the real makeTopicData() method
         DmaapSimProvider prov2 = new DmaapSimProvider(params);
         assertThatCode(() -> prov2.processDmaapMessageGet(TOPIC1, CONSUMER1, CONSUMER_ID1, 0, 0))
                         .doesNotThrowAnyException();
@@ -277,14 +278,11 @@ public class DmaapSimProviderTest {
 
         @Override
         protected TopicData makeTopicData(String topicName) {
-            switch (topicName) {
-                case TOPIC1:
-                    return data1;
-                case TOPIC2:
-                    return data2;
-                default:
-                    throw new IllegalArgumentException("unknown topic name: " + topicName);
-            }
+            return switch (topicName) {
+                case TOPIC1 -> data1;
+                case TOPIC2 -> data2;
+                default -> throw new IllegalArgumentException("unknown topic name: " + topicName);
+            };
         }
     }
 }
index 5cba783..0d24436 100644 (file)
@@ -3,6 +3,7 @@
  * ONAP PAP
  * ================================================================================
  * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 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,9 +24,9 @@ package org.onap.policy.models.sim.dmaap.rest;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 
+import jakarta.ws.rs.core.Response;
+import jakarta.ws.rs.core.Response.ResponseBuilder;
 import java.util.UUID;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.Response.ResponseBuilder;
 import org.junit.Before;
 import org.junit.Test;
 
index 5d9186c..ea2a4a5 100644 (file)
@@ -3,6 +3,7 @@
  * ONAP Policy Models
  * ================================================================================
  * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 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,13 +26,13 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
+import jakarta.ws.rs.core.MediaType;
 import java.io.ByteArrayInputStream;
 import java.io.EOFException;
 import java.io.IOException;
 import java.io.InputStream;
 import java.nio.charset.StandardCharsets;
 import java.util.List;
-import javax.ws.rs.core.MediaType;
 import org.junit.Before;
 import org.junit.Test;
 
index dd938d3..fd9397e 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
  * Modifications Copyright (C) 2021 Bell Canada. All rights reserved.
+ * Modifications Copyright (C) 2023 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -22,10 +23,10 @@ package org.onap.policy.models.sim.dmaap.rest;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.assertEquals;
 
+import jakarta.ws.rs.core.Response;
 import java.io.File;
 import java.util.Arrays;
 import java.util.Map;
-import javax.ws.rs.core.Response;
 import org.junit.Before;
 import org.junit.Test;
 import org.onap.policy.common.utils.coder.Coder;
@@ -43,7 +44,7 @@ public class DmaapSimRestControllerV1Test {
     private static final String CONSUMER = "my-consumer";
     private static final String CONSUMER_ID = "my-id";
 
-    private static Coder coder = new StandardCoder();
+    private static final Coder coder = new StandardCoder();
 
     private DmaapSimRestControllerV1 rest;
 
index 2dfbae9..50db94e 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -22,12 +23,12 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
+import jakarta.ws.rs.core.MediaType;
 import java.io.ByteArrayInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.nio.charset.StandardCharsets;
 import java.util.List;
-import javax.ws.rs.core.MediaType;
 import org.junit.Before;
 import org.junit.Test;
 
index 773158e..4a7ba73 100644 (file)
 -->
 
 <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>
         <groupId>org.onap.policy.models.sim</groupId>
         <artifactId>models-sim-packages</artifactId>
-        <version>3.0.0-SNAPSHOT</version>
+        <version>3.0.1-SNAPSHOT</version>
     </parent>
 
     <artifactId>models-simulator-docker</artifactId>
@@ -46,7 +46,7 @@
         <docker.push.registry>nexus3.onap.org:10003</docker.push.registry>
         <docker.contextDir>${project.basedir}/src/main/docker</docker.contextDir>
         <maven.build.timestamp.format>yyyyMMdd'T'HHmm</maven.build.timestamp.format>
-        <!-- There is no code in this sub-module, only holds interfaces. So skip sonar. -->
+        <!-- There is no code in this submodule, only holds interfaces. So skip sonar. -->
         <sonar.skip>true</sonar.skip>
     </properties>
 
                                         <dependencySets>
                                             <dependencySet>
                                                 <includes>
-                                                    <include>org.onap.policy.models.sim:models-simulator-tarball</include>
+                                                    <include>org.onap.policy.models.sim:models-simulator-tarball
+                                                    </include>
                                                 </includes>
                                                 <outputDirectory>/lib</outputDirectory>
                                                 <outputFileNameMapping>models-simulator.tar.gz</outputFileNameMapping>
index 724bfb3..b4d159f 100644 (file)
@@ -26,7 +26,7 @@ RUN mkdir /packages /extracted
 COPY /maven/lib/models-simulator.tar.gz /packages/
 RUN tar xvzf /packages/models-simulator.tar.gz --directory /extracted/
 
-FROM onap/policy-jre-alpine:3.0.0-SNAPSHOT
+FROM onap/policy-jre-alpine:3.0.1-SNAPSHOT
 
 LABEL maintainer="Policy Team"
 LABEL org.opencontainers.image.title="Policy Models Simulator"
index c38978e..d2a73ed 100644 (file)
 -->
 
 <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">
-  <modelVersion>4.0.0</modelVersion>
-  <parent>
-    <groupId>org.onap.policy.models.sim</groupId>
-    <artifactId>models-sim-packages</artifactId>
-    <version>3.0.0-SNAPSHOT</version>
-  </parent>
+         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">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.onap.policy.models.sim</groupId>
+        <artifactId>models-sim-packages</artifactId>
+        <version>3.0.1-SNAPSHOT</version>
+    </parent>
 
-  <artifactId>models-simulator-tarball</artifactId>
+    <artifactId>models-simulator-tarball</artifactId>
 
-  <name>${project.artifactId}</name>
-  <description>A module that runs all "simulators", including DMaaP.</description>
+    <name>${project.artifactId}</name>
+    <description>A module that runs all "simulators", including DMaaP.</description>
 
-  <properties>
-      <!-- There is no code in this sub-module, only holds interfaces. So skip sonar. -->
-      <sonar.skip>true</sonar.skip>
-  </properties>
+    <properties>
+        <!-- There is no code in this submodule, only holds interfaces. So skip sonar. -->
+        <sonar.skip>true</sonar.skip>
+    </properties>
 
-  <dependencies>
-    <dependency>
-      <groupId>org.onap.policy.models.sim</groupId>
-      <artifactId>policy-models-simulators</artifactId>
-      <version>${project.version}</version>
-    </dependency>
-  </dependencies>
+    <dependencies>
+        <dependency>
+            <groupId>org.onap.policy.models.sim</groupId>
+            <artifactId>policy-models-simulators</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
 
-  <build>
-    <resources>
-      <!-- Output the version of the service -->
-      <resource>
-        <directory>src/main/resources</directory>
-        <filtering>true</filtering>
-        <includes>
-          <include>**/version.txt</include>
-        </includes>
-      </resource>
-      <resource>
-        <directory>src/main/resources</directory>
-        <filtering>false</filtering>
-        <excludes>
-          <exclude>**/version.txt</exclude>
-        </excludes>
-      </resource>
-    </resources>
+    <build>
+        <resources>
+            <!-- Output the version of the service -->
+            <resource>
+                <directory>src/main/resources</directory>
+                <filtering>true</filtering>
+                <includes>
+                    <include>**/version.txt</include>
+                </includes>
+            </resource>
+            <resource>
+                <directory>src/main/resources</directory>
+                <filtering>false</filtering>
+                <excludes>
+                    <exclude>**/version.txt</exclude>
+                </excludes>
+            </resource>
+        </resources>
 
-    <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-assembly-plugin</artifactId>
-        <executions>
-          <execution>
-            <id>generate-complete-tar</id>
-            <phase>package</phase>
-            <goals>
-              <goal>single</goal>
-            </goals>
-            <configuration>
-              <descriptors>
-                <descriptor>src/main/assembly.xml</descriptor>
-              </descriptors>
-              <finalName>${project.artifactId}-${project.version}</finalName>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-    </plugins>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-assembly-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>generate-complete-tar</id>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>single</goal>
+                        </goals>
+                        <configuration>
+                            <descriptors>
+                                <descriptor>src/main/assembly.xml</descriptor>
+                            </descriptors>
+                            <finalName>${project.artifactId}-${project.version}</finalName>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
 
-  </build>
+    </build>
 </project>
index c0ffead..9b3e5c3 100644 (file)
 -->
 
 <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>
         <groupId>org.onap.policy.models.sim</groupId>
         <artifactId>policy-models-sim</artifactId>
-        <version>3.0.0-SNAPSHOT</version>
+        <version>3.0.1-SNAPSHOT</version>
     </parent>
 
     <artifactId>models-sim-packages</artifactId>
@@ -35,7 +35,7 @@
     <description>The module for packaging the policy-models-simulator component.</description>
 
     <properties>
-        <!-- There is no code in this sub-module, only holds interfaces. So skip sonar. -->
+        <!-- There is no code in this submodule, only holds interfaces. So skip sonar. -->
         <sonar.skip>true</sonar.skip>
     </properties>
 
index cf89b12..326a76a 100644 (file)
@@ -1,17 +1,38 @@
-<?xml version="1.0"?>
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-  <modelVersion>4.0.0</modelVersion>
-  <parent>
-    <groupId>org.onap.policy.models.sim</groupId>
-    <artifactId>policy-models-sim</artifactId>
-    <version>3.0.0-SNAPSHOT</version>
-  </parent>
-  <artifactId>policy-models-sim-pdp</artifactId>
-  <name>policy-models-sim-pdp</name>
+<!--
+  ============LICENSE_START=======================================================
+   Copyright (C) 2019 Bell Canada. All rights reserved.
+   Modifications Copyright (C) 2023 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
 
-<description>A module that implements a simulator for PDP.</description>
-      <dependencies>
+       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.
+
+  SPDX-License-Identifier: Apache-2.0
+  ============LICENSE_END=========================================================
+-->
+
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+         xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.onap.policy.models.sim</groupId>
+        <artifactId>policy-models-sim</artifactId>
+        <version>3.0.1-SNAPSHOT</version>
+    </parent>
+    <artifactId>policy-models-sim-pdp</artifactId>
+    <name>policy-models-sim-pdp</name>
+
+    <description>A module that implements a simulator for PDP.</description>
+    <dependencies>
         <dependency>
             <groupId>org.onap.policy.models</groupId>
             <artifactId>policy-models-pdp</artifactId>
             <artifactId>common-parameters</artifactId>
             <version>${policy.common.version}</version>
         </dependency>
-
-        <!--test dependencies -->
-        <dependency>
-            <groupId>org.assertj</groupId>
-            <artifactId>assertj-core</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.mockito</groupId>
-            <artifactId>mockito-core</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <scope>test</scope>
-        </dependency>
     </dependencies>
     <build>
         <resources>
index 1bc2ff7..31d5b41 100644 (file)
@@ -52,8 +52,8 @@ public class PdpSimulatorActivator {
 
     private static final Logger LOGGER = LoggerFactory.getLogger(PdpSimulatorActivator.class);
     private final PdpSimulatorParameterGroup pdpSimulatorParameterGroup;
-    private List<TopicSink> topicSinks; // topics to which pdp sends pdp status
-    private List<TopicSource> topicSources; // topics to which pdp listens to for messages from pap.
+    private final List<TopicSink> topicSinks; // topics to which pdp sends pdp status
+    private final List<TopicSource> topicSources; // topics to which pdp listens to for messages from pap.
     private static final String[] MSG_TYPE_NAMES = { "messageName" };
 
     /*
@@ -70,7 +70,7 @@ public class PdpSimulatorActivator {
     /**
      * Used to manage the services.
      */
-    private ServiceManager manager;
+    private final ServiceManager manager;
 
 
     @Getter
index 1441ba3..88d1b26 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019-2021 Nordix Foundation.
+ *  Copyright (C) 2019-2021, 2023 Nordix Foundation.
  *  Modifications Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -132,7 +132,7 @@ public class PdpSimulatorMain {
                     activator.terminate();
                 }
             } catch (final PdpSimulatorException e) {
-                LOGGER.warn("error occured during shut down of the pdp simulator service", e);
+                LOGGER.warn("error occurred during shut down of the pdp simulator service", e);
             }
         }
     }
index 6be59b1..69b25dd 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019 Nordix Foundation.
+ *  Copyright (C) 2019, 2023 Nordix Foundation.
  *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -41,10 +41,10 @@ public class PdpStatusPublisher extends TimerTask {
 
     private static final Logger LOGGER = LoggerFactory.getLogger(PdpStatusPublisher.class);
 
-    private TopicSinkClient topicSinkClient;
-    private Timer timer;
+    private final TopicSinkClient topicSinkClient;
+    private final Timer timer;
     @Getter
-    private long interval;
+    private final long interval;
 
     /**
      * Constructor for instantiating PdpStatusPublisher.
index ae028dd..ad1a32d 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019-2021 Nordix Foundation.
+ *  Copyright (C) 2019-2021, 2023 Nordix Foundation.
  *  Modifications Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -101,8 +101,8 @@ public class PdpMessageHandler {
      *
      * @return PdpResponseDetails
      */
-    public PdpResponseDetails createPdpResonseDetails(final String requestId, final PdpResponseStatus status,
-            final String responseMessage) {
+    public PdpResponseDetails createPdpResponseDetails(final String requestId, final PdpResponseStatus status,
+                                                       final String responseMessage) {
         final var pdpResponseDetails = new PdpResponseDetails();
         pdpResponseDetails.setResponseTo(requestId);
         pdpResponseDetails.setResponseStatus(status);
index 4f9804f..23df912 100644 (file)
@@ -81,16 +81,16 @@ public class PdpStateChangeMessageHandler {
             final PdpStatus pdpStatusContext, final PdpMessageHandler pdpMessageHandler) {
         PdpResponseDetails pdpResponseDetails = null;
         if (pdpStatusContext.getState().equals(PdpState.ACTIVE)) {
-            pdpResponseDetails = pdpMessageHandler.createPdpResonseDetails(pdpStateChangeMsg.getRequestId(),
+            pdpResponseDetails = pdpMessageHandler.createPdpResponseDetails(pdpStateChangeMsg.getRequestId(),
                     PdpResponseStatus.SUCCESS, "Pdp already in active state");
         } else {
             final List<ToscaPolicy> policies = Registry.get(PdpSimulatorConstants.REG_PDP_TOSCA_POLICY_LIST);
             if (policies.isEmpty()) {
                 pdpStatusContext.setState(PdpState.ACTIVE);
-                pdpResponseDetails = pdpMessageHandler.createPdpResonseDetails(pdpStateChangeMsg.getRequestId(),
+                pdpResponseDetails = pdpMessageHandler.createPdpResponseDetails(pdpStateChangeMsg.getRequestId(),
                         PdpResponseStatus.SUCCESS, "State changed to active. No policies found.");
             } else {
-                pdpResponseDetails = pdpMessageHandler.createPdpResonseDetails(pdpStateChangeMsg.getRequestId(),
+                pdpResponseDetails = pdpMessageHandler.createPdpResponseDetails(pdpStateChangeMsg.getRequestId(),
                         PdpResponseStatus.SUCCESS, "Pdp started. State changed to active.");
                 pdpStatusContext.setState(PdpState.ACTIVE);
             }
@@ -110,10 +110,10 @@ public class PdpStateChangeMessageHandler {
             final PdpStatus pdpStatusContext, final PdpMessageHandler pdpMessageHandler) {
         PdpResponseDetails pdpResponseDetails = null;
         if (pdpStatusContext.getState().equals(PdpState.PASSIVE)) {
-            pdpResponseDetails = pdpMessageHandler.createPdpResonseDetails(pdpStateChangeMsg.getRequestId(),
+            pdpResponseDetails = pdpMessageHandler.createPdpResponseDetails(pdpStateChangeMsg.getRequestId(),
                     PdpResponseStatus.SUCCESS, "Pdp already in passive state");
         } else {
-            pdpResponseDetails = pdpMessageHandler.createPdpResonseDetails(pdpStateChangeMsg.getRequestId(),
+            pdpResponseDetails = pdpMessageHandler.createPdpResponseDetails(pdpStateChangeMsg.getRequestId(),
                     PdpResponseStatus.SUCCESS, "Pdp state changed from Active to Passive.");
             pdpStatusContext.setState(PdpState.PASSIVE);
         }
index a90f74f..60f7c14 100644 (file)
@@ -56,7 +56,7 @@ public class PdpUpdateMessageHandler {
             final var pdpStatusPublisher =
                             Registry.get(PdpSimulatorConstants.REG_PDP_STATUS_PUBLISHER, PdpStatusPublisher.class);
             if (checkIfAlreadyHandled(pdpUpdateMsg, pdpStatusContext)) {
-                pdpResponseDetails = pdpMessageHandler.createPdpResonseDetails(pdpUpdateMsg.getRequestId(),
+                pdpResponseDetails = pdpMessageHandler.createPdpResponseDetails(pdpUpdateMsg.getRequestId(),
                         PdpResponseStatus.SUCCESS, "Pdp already updated");
             } else {
                 if (null != pdpUpdateMsg.getPdpHeartbeatIntervalMs() && pdpUpdateMsg.getPdpHeartbeatIntervalMs() > 0
@@ -74,12 +74,12 @@ public class PdpUpdateMessageHandler {
                         .collect(Collectors.toList()));
                 if (pdpStatusContext.getState().equals(PdpState.ACTIVE)
                         && !pdpUpdateMsg.getPoliciesToBeDeployed().isEmpty()) {
-                    pdpResponseDetails = pdpMessageHandler.createPdpResonseDetails(pdpUpdateMsg.getRequestId(),
+                    pdpResponseDetails = pdpMessageHandler.createPdpResponseDetails(pdpUpdateMsg.getRequestId(),
                             PdpResponseStatus.SUCCESS, "Pdp engine started and policies are running.");
                 }
                 Registry.registerOrReplace(PdpSimulatorConstants.REG_PDP_TOSCA_POLICY_LIST, policies);
                 if (null == pdpResponseDetails) {
-                    pdpResponseDetails = pdpMessageHandler.createPdpResonseDetails(pdpUpdateMsg.getRequestId(),
+                    pdpResponseDetails = pdpMessageHandler.createPdpResponseDetails(pdpUpdateMsg.getRequestId(),
                             PdpResponseStatus.SUCCESS, "Pdp update successful.");
                 }
             }
index d1a68ae..d13fe8e 100644 (file)
@@ -23,7 +23,7 @@
 # Docker file to build an image that runs the PDP simulator on Java 8 in alpine
 #
 
-FROM onap/policy-jre-alpine:3.0.0-SNAPSHOT
+FROM onap/policy-jre-alpine:3.0.1-SNAPSHOT
 
 LABEL maintainer="Policy Team"
 
index a3895ee..d8b8739 100644 (file)
 -->
 
 <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">
+         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">
     <modelVersion>4.0.0</modelVersion>
     <parent>
         <groupId>org.onap.policy.models.sim</groupId>
         <artifactId>policy-models-sim</artifactId>
-        <version>3.0.0-SNAPSHOT</version>
+        <version>3.0.1-SNAPSHOT</version>
     </parent>
 
     <artifactId>policy-models-simulators</artifactId>
             <artifactId>simulators</artifactId>
             <version>${project.version}</version>
         </dependency>
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.mockito</groupId>
-            <artifactId>mockito-core</artifactId>
-            <scope>test</scope>
-        </dependency>
     </dependencies>
 </project>
index e1517f3..6326b70 100644 (file)
@@ -3,6 +3,7 @@
  * ONAP
  * ================================================================================
  * Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -30,6 +31,7 @@ import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 
+import jakarta.ws.rs.core.Response;
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.util.HashMap;
@@ -39,7 +41,6 @@ import java.util.Map.Entry;
 import java.util.Properties;
 import java.util.concurrent.LinkedBlockingQueue;
 import java.util.concurrent.TimeUnit;
-import javax.ws.rs.core.Response;
 import org.junit.After;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
index b5da2b1..98a6a37 100644 (file)
   ============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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-  <parent>
-    <groupId>org.onap.policy.models</groupId>
-    <artifactId>policy-models</artifactId>
-    <version>3.0.0-SNAPSHOT</version>
-  </parent>
+<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">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.onap.policy.models</groupId>
+        <artifactId>policy-models</artifactId>
+        <version>3.0.1-SNAPSHOT</version>
+    </parent>
 
-  <groupId>org.onap.policy.models.sim</groupId>
-  <artifactId>policy-models-sim</artifactId>
-  <packaging>pom</packaging>
-  <name>${project.artifactId}</name>
+    <groupId>org.onap.policy.models.sim</groupId>
+    <artifactId>policy-models-sim</artifactId>
+    <packaging>pom</packaging>
+    <name>${project.artifactId}</name>
 
-  <properties>
-    <jacoco.dataFile>${project.basedir}/../../target/code-coverage/jacoco-ut.exec</jacoco.dataFile>
-  </properties>
+    <properties>
+        <jacoco.dataFile>${project.basedir}/../../target/code-coverage/jacoco-ut.exec</jacoco.dataFile>
+    </properties>
 
-  <modules>
-      <module>models-sim-dmaap</module>
-      <module>policy-models-sim-pdp</module>
-      <module>policy-models-simulators</module>
-      <module>packages</module>
-  </modules>
+    <modules>
+        <module>models-sim-dmaap</module>
+        <module>policy-models-sim-pdp</module>
+        <module>policy-models-simulators</module>
+        <module>packages</module>
+    </modules>
 </project>
index 07406fc..cc37115 100644 (file)
   ============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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+         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">
     <modelVersion>4.0.0</modelVersion>
     <parent>
         <groupId>org.onap.policy.models</groupId>
         <artifactId>policy-models</artifactId>
-        <version>3.0.0-SNAPSHOT</version>
+        <version>3.0.1-SNAPSHOT</version>
     </parent>
 
     <artifactId>policy-models-tosca</artifactId>
index 24c74cb..d5c098a 100644 (file)
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * ONAP Policy Model
  * ================================================================================
- * Copyright (C) 2019-2022 Nordix Foundation.
+ * Copyright (C) 2019-2023 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.models.tosca.authorative.concepts;
 
 import com.google.gson.annotations.SerializedName;
+import jakarta.ws.rs.core.Response;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
-import javax.ws.rs.core.Response;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 import lombok.NonNull;
index b3284d9..3597156 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019-2022 Nordix Foundation.
+ *  Copyright (C) 2019-2023 Nordix Foundation.
  *  Modifications Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
 
 package org.onap.policy.models.tosca.authorative.provider;
 
+import jakarta.ws.rs.core.Response;
+import jakarta.ws.rs.core.Response.Status;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 import java.util.Map;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.Response.Status;
 import lombok.NonNull;
 import org.apache.commons.collections4.CollectionUtils;
 import org.onap.policy.models.base.PfConceptKey;
@@ -678,9 +678,7 @@ public class AuthorativeToscaProvider {
     private <T> List<T> asConceptList(final List<Map<String, T>> listOfMaps) {
         List<T> returnList = new ArrayList<>();
         for (Map<String, T> conceptMap : listOfMaps) {
-            for (T concept : conceptMap.values()) {
-                returnList.add(concept);
-            }
+            returnList.addAll(conceptMap.values());
         }
 
         return returnList;
index 3e0ec28..7fb741d 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- * Copyright (C) 2020-2021 Nordix Foundation.
+ * Copyright (C) 2020-2021, 2023 Nordix Foundation.
  * Modifications Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
 
 package org.onap.policy.models.tosca.simple.concepts;
 
+import jakarta.persistence.ElementCollection;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Inheritance;
+import jakarta.persistence.InheritanceType;
+import jakarta.persistence.Lob;
+import jakarta.persistence.Table;
+import java.io.Serial;
 import java.util.ArrayList;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
-import javax.persistence.ElementCollection;
-import javax.persistence.Entity;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.Lob;
-import javax.persistence.Table;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.NonNull;
@@ -52,6 +53,7 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaCapabilityAssignme
 @EqualsAndHashCode(callSuper = false)
 public class JpaToscaCapabilityAssignment extends JpaToscaWithTypeAndStringProperties<ToscaCapabilityAssignment> {
 
+    @Serial
     private static final long serialVersionUID = 1675770231921107988L;
 
     private static final String AUTHORATIVE_UNBOUNDED_LITERAL = "UNBOUNDED";
index 18e77bb..bc53101 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2020 Nordix Foundation.
+ *  Copyright (C) 2020, 2023 Nordix Foundation.
  *  Modifications Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
 
 package org.onap.policy.models.tosca.simple.concepts;
 
+import jakarta.persistence.Entity;
+import jakarta.persistence.Inheritance;
+import jakarta.persistence.InheritanceType;
+import jakarta.persistence.Table;
+import java.io.Serial;
 import java.util.List;
 import java.util.Map;
 import java.util.TreeMap;
-import javax.persistence.Entity;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.Table;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.NonNull;
@@ -55,6 +56,7 @@ public class JpaToscaCapabilityAssignments
                 implements PfAuthorative<List<Map<String, ToscaCapabilityAssignment>>> {
     public static final String DEFAULT_NAME = "ToscaCapabilityAssignmentsSimple";
     public static final String DEFAULT_VERSION = "1.0.0";
+    @Serial
     private static final long serialVersionUID = -7526648702327776101L;
 
     /**
@@ -76,7 +78,7 @@ public class JpaToscaCapabilityAssignments
     }
 
     /**
-     * This Constructor creates an concept container with all of its fields defined.
+     * This Constructor creates a concept container with all of its fields defined.
      *
      * @param key the concept container key
      * @param conceptMap the concepts to be stored in the concept container
index 4118c4d..96d176f 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- * Copyright (C) 2020 Nordix Foundation.
+ * Copyright (C) 2020, 2023 Nordix Foundation.
  * Modifications Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
 
 package org.onap.policy.models.tosca.simple.concepts;
 
-import javax.persistence.Entity;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.Table;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Inheritance;
+import jakarta.persistence.InheritanceType;
+import jakarta.persistence.Table;
+import java.io.Serial;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.NoArgsConstructor;
@@ -44,6 +45,7 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaCapabilityType;
 @EqualsAndHashCode(callSuper = true)
 @NoArgsConstructor
 public class JpaToscaCapabilityType extends JpaToscaWithToscaProperties<ToscaCapabilityType> {
+    @Serial
     private static final long serialVersionUID = -563659852901842616L;
 
     /**
index e1feaed..e23d45a 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2020 Nordix Foundation.
+ *  Copyright (C) 2020, 2023 Nordix Foundation.
  *  Modifications Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
 
 package org.onap.policy.models.tosca.simple.concepts;
 
+import jakarta.persistence.Entity;
+import jakarta.persistence.Inheritance;
+import jakarta.persistence.InheritanceType;
+import jakarta.persistence.Table;
+import java.io.Serial;
 import java.util.List;
 import java.util.Map;
 import java.util.TreeMap;
-import javax.persistence.Entity;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.Table;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.NonNull;
@@ -50,6 +51,7 @@ import org.onap.policy.models.tosca.utils.ToscaUtils;
 public class JpaToscaCapabilityTypes extends PfConceptContainer<JpaToscaCapabilityType, ToscaCapabilityType> {
     public static final String DEFAULT_NAME = "ToscaCapabilityTypesSimple";
     public static final String DEFAULT_VERSION = "1.0.0";
+    @Serial
     private static final long serialVersionUID = -4157979965271220098L;
 
     /**
@@ -71,7 +73,7 @@ public class JpaToscaCapabilityTypes extends PfConceptContainer<JpaToscaCapabili
     }
 
     /**
-     * This Constructor creates an concept container with all of its fields defined.
+     * This Constructor creates a concept container with all of its fields defined.
      *
      * @param key        the concept container key
      * @param conceptMap the concepts to be stored in the concept container
index 14e9db5..ea4810f 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2021 Nordix Foundation.
+ *  Copyright (C) 2021, 2023 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.models.tosca.simple.concepts;
 
+import jakarta.persistence.ElementCollection;
+import java.io.Serial;
 import java.util.ArrayList;
 import java.util.List;
-import javax.persistence.ElementCollection;
 import lombok.EqualsAndHashCode;
 import lombok.Getter;
 import lombok.NonNull;
@@ -36,6 +37,7 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaConstraint;
 @EqualsAndHashCode(callSuper = false)
 @ToString
 public class JpaToscaConstraintInRange extends JpaToscaConstraint {
+    @Serial
     private static final long serialVersionUID = -5060193250508635456L;
 
     @ElementCollection
@@ -81,10 +83,7 @@ public class JpaToscaConstraintInRange extends JpaToscaConstraint {
     }
 
     @Override
-    public int compareTo(JpaToscaConstraint otherConstraint) {
-        if (otherConstraint == null) {
-            return -1;
-        }
+    public int compareTo(@NonNull JpaToscaConstraint otherConstraint) {
         if (this == otherConstraint) {
             return 0;
         }
index e8d16a7..5d4577d 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019 Nordix Foundation.
+ *  Copyright (C) 2019, 2023 Nordix Foundation.
  *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -21,7 +21,8 @@
 
 package org.onap.policy.models.tosca.simple.concepts;
 
-import javax.persistence.Column;
+import jakarta.persistence.Column;
+import java.io.Serial;
 import lombok.EqualsAndHashCode;
 import lombok.Getter;
 import lombok.NonNull;
@@ -35,6 +36,7 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaConstraint;
 @EqualsAndHashCode(callSuper = false)
 @ToString
 public class JpaToscaConstraintLogical extends JpaToscaConstraint {
+    @Serial
     private static final long serialVersionUID = -2730203215911880756L;
 
     @Column
@@ -78,28 +80,14 @@ public class JpaToscaConstraintLogical extends JpaToscaConstraint {
         }
 
         switch (operation) {
-            case EQ:
-                toscaConstraint.setEqual(compareTo);
-                break;
-
-            case GT:
-                toscaConstraint.setGreaterThan(compareTo);
-                break;
-
-            case GE:
-                toscaConstraint.setGreaterOrEqual(compareTo);
-                break;
-
-            case LT:
-                toscaConstraint.setLessThan(compareTo);
-                break;
-
-            case LE:
-                toscaConstraint.setLessOrEqual(compareTo);
-                break;
-
-            default:
-                // Can't happen
+            case EQ -> toscaConstraint.setEqual(compareTo);
+            case GT -> toscaConstraint.setGreaterThan(compareTo);
+            case GE -> toscaConstraint.setGreaterOrEqual(compareTo);
+            case LT -> toscaConstraint.setLessThan(compareTo);
+            case LE -> toscaConstraint.setLessOrEqual(compareTo);
+            default -> {
+                return null;
+            }
         }
 
         return toscaConstraint;
@@ -128,10 +116,7 @@ public class JpaToscaConstraintLogical extends JpaToscaConstraint {
     }
 
     @Override
-    public int compareTo(JpaToscaConstraint otherConstraint) {
-        if (otherConstraint == null) {
-            return -1;
-        }
+    public int compareTo(@NonNull JpaToscaConstraint otherConstraint) {
         if (this == otherConstraint) {
             return 0;
         }
index b5c2d10..1f4785f 100644 (file)
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved.
- *  Modifications Copyright (C) 2019-2020 Nordix Foundation.
+ *  Modifications Copyright (C) 2019-2020, 2023 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.models.tosca.simple.concepts;
 
+import jakarta.persistence.ElementCollection;
+import java.io.Serial;
 import java.util.ArrayList;
 import java.util.List;
-import javax.persistence.ElementCollection;
 import lombok.EqualsAndHashCode;
 import lombok.Getter;
 import lombok.NonNull;
@@ -39,6 +40,7 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaConstraint;
 @EqualsAndHashCode(callSuper = false)
 @ToString
 public class JpaToscaConstraintValidValues extends JpaToscaConstraint {
+    @Serial
     private static final long serialVersionUID = -5060193250508635456L;
 
     @ElementCollection
@@ -84,10 +86,7 @@ public class JpaToscaConstraintValidValues extends JpaToscaConstraint {
     }
 
     @Override
-    public int compareTo(JpaToscaConstraint otherConstraint) {
-        if (otherConstraint == null) {
-            return -1;
-        }
+    public int compareTo(@NonNull JpaToscaConstraint otherConstraint) {
         if (this == otherConstraint) {
             return 0;
         }
index c086c53..107fb3a 100644 (file)
@@ -3,7 +3,7 @@
  * ONAP Policy Model
  * ================================================================================
  * Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019-2020 Nordix Foundation.
+ * Modifications Copyright (C) 2019-2020, 2023 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.models.tosca.simple.concepts;
 
+import jakarta.persistence.ElementCollection;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Inheritance;
+import jakarta.persistence.InheritanceType;
+import jakarta.persistence.Table;
+import java.io.Serial;
 import java.util.ArrayList;
 import java.util.List;
-import javax.persistence.ElementCollection;
-import javax.persistence.Entity;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.Table;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.NoArgsConstructor;
@@ -54,6 +55,7 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaDataType;
 @EqualsAndHashCode(callSuper = true)
 @NoArgsConstructor
 public class JpaToscaDataType extends JpaToscaWithToscaProperties<ToscaDataType> {
+    @Serial
     private static final long serialVersionUID = -3922690413436539164L;
 
     @ElementCollection
index faa1ce1..2142f16 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019-2020 Nordix Foundation.
+ *  Copyright (C) 2019-2020, 2023 Nordix Foundation.
  *  Modifications Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
 
 package org.onap.policy.models.tosca.simple.concepts;
 
+import jakarta.persistence.Entity;
+import jakarta.persistence.Inheritance;
+import jakarta.persistence.InheritanceType;
+import jakarta.persistence.Table;
+import java.io.Serial;
 import java.util.List;
 import java.util.Map;
 import java.util.TreeMap;
-import javax.persistence.Entity;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.Table;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
+import lombok.NonNull;
 import lombok.ToString;
 import org.onap.policy.common.parameters.BeanValidationResult;
 import org.onap.policy.models.base.PfConceptContainer;
@@ -49,6 +51,7 @@ import org.onap.policy.models.tosca.utils.ToscaUtils;
 @ToString(callSuper = true)
 @EqualsAndHashCode(callSuper = true)
 public class JpaToscaDataTypes extends PfConceptContainer<JpaToscaDataType, ToscaDataType> {
+    @Serial
     private static final long serialVersionUID = 2941102271022190348L;
 
     public static final String DEFAULT_NAME = "ToscaDataTypesSimple";
@@ -73,7 +76,7 @@ public class JpaToscaDataTypes extends PfConceptContainer<JpaToscaDataType, Tosc
     }
 
     /**
-     * This Constructor creates an concept container with all of its fields defined.
+     * This Constructor creates a concept container with all of its fields defined.
      *
      * @param key the concept container key
      * @param conceptMap the concepts to be stored in the concept container
@@ -102,7 +105,7 @@ public class JpaToscaDataTypes extends PfConceptContainer<JpaToscaDataType, Tosc
     }
 
     @Override
-    public BeanValidationResult validate(String fieldName) {
+    public BeanValidationResult validate(@NonNull String fieldName) {
         BeanValidationResult result = super.validate(fieldName);
 
         for (JpaToscaDataType dataType : this.getConceptMap().values()) {
index b9acde2..e23ac42 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019-2020,2022-2023 Nordix Foundation.
+ *  Copyright (C) 2019-2020, 2022-2023 Nordix Foundation.
  *  Modifications Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
 
 package org.onap.policy.models.tosca.simple.concepts;
 
+import jakarta.persistence.AttributeOverride;
+import jakarta.persistence.Column;
+import jakarta.persistence.ElementCollection;
+import jakarta.persistence.EmbeddedId;
+import jakarta.persistence.Lob;
+import jakarta.persistence.MappedSuperclass;
+import jakarta.ws.rs.core.Response;
+import java.io.Serial;
 import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.TreeMap;
-import javax.persistence.AttributeOverride;
-import javax.persistence.AttributeOverrides;
-import javax.persistence.Column;
-import javax.persistence.ElementCollection;
-import javax.persistence.EmbeddedId;
-import javax.persistence.Lob;
-import javax.persistence.MappedSuperclass;
-import javax.ws.rs.core.Response;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.NonNull;
@@ -57,6 +57,7 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaEntity;
 @Data
 @EqualsAndHashCode(callSuper = false)
 public class JpaToscaEntityType<T extends ToscaEntity> extends PfConcept implements PfAuthorative<T> {
+    @Serial
     private static final long serialVersionUID = -1330661834220739393L;
 
     private static final StandardCoder STANDARD_CODER = new StandardCoder();
@@ -68,10 +69,8 @@ public class JpaToscaEntityType<T extends ToscaEntity> extends PfConcept impleme
 
     // @formatter:off
     @Column
-    @AttributeOverrides({
-        @AttributeOverride(name = "name", column = @Column(name = "derived_from_name")),
-        @AttributeOverride(name = "version", column = @Column(name = "derived_from_version"))
-    })
+    @AttributeOverride(name = "name", column = @Column(name = "derived_from_name"))
+    @AttributeOverride(name = "version", column = @Column(name = "derived_from_version"))
     @VerifyKey
     private PfConceptKey derivedFrom;
 
index e879a13..f817904 100644 (file)
@@ -3,7 +3,7 @@
  * ONAP Policy Model
  * ================================================================================
  * Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019-2020 Nordix Foundation.
+ * Modifications Copyright (C) 2019-2020, 2023 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.models.tosca.simple.concepts;
 
+import jakarta.persistence.Column;
+import jakarta.persistence.EmbeddedId;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Inheritance;
+import jakarta.persistence.InheritanceType;
+import jakarta.persistence.Table;
+import java.io.Serial;
 import java.util.List;
-import javax.persistence.Column;
-import javax.persistence.EmbeddedId;
-import javax.persistence.Entity;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.Table;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.NonNull;
@@ -54,6 +55,7 @@ import org.onap.policy.models.base.validation.annotations.VerifyKey;
 @Data
 @EqualsAndHashCode(callSuper = false)
 public class JpaToscaEventFilter extends PfConcept {
+    @Serial
     private static final long serialVersionUID = 8769020537228210247L;
 
     @EmbeddedId
index 5f72e2b..76434f5 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019-2020,2023 Nordix Foundation.
+ *  Copyright (C) 2019-2020, 2023 Nordix Foundation.
  *  Modifications Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
  *  Modifications Copyright (C) 2022 Bell Canada. All rights reserved.
  * ================================================================================
 
 package org.onap.policy.models.tosca.simple.concepts;
 
+import jakarta.persistence.CascadeType;
+import jakarta.persistence.Entity;
+import jakarta.persistence.FetchType;
+import jakarta.persistence.Inheritance;
+import jakarta.persistence.InheritanceType;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.JoinColumns;
+import jakarta.persistence.OneToOne;
+import jakarta.persistence.Table;
 import java.util.List;
-import javax.persistence.CascadeType;
-import javax.persistence.Entity;
-import javax.persistence.FetchType;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.JoinColumn;
-import javax.persistence.JoinColumns;
-import javax.persistence.OneToOne;
-import javax.persistence.Table;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.NonNull;
@@ -44,7 +44,7 @@ import org.onap.policy.models.base.PfModelService;
 
 /**
  * A container class for a TOSCA model with multiple service templates. This class is a container class that allows a
- * model with many service templates to be constructed that contains a well formed overall TOSCA model.
+ * model with many service templates to be constructed that contains a well-formed overall TOSCA model.
  *
  * <p>Validation runs {@link JpaToscaModel} validation on the model and all its sub concepts.
  */
@@ -58,10 +58,8 @@ public class JpaToscaModel extends PfModel {
     private static final long serialVersionUID = 8800599637708309945L;
 
     @OneToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL, orphanRemoval = true)
-    @JoinColumns({
-        @JoinColumn(name = "serviceTemplatesName", referencedColumnName = "name"),
-        @JoinColumn(name = "serviceTemplatesVersion", referencedColumnName = "version")
-    })
+    @JoinColumn(name = "serviceTemplatesName", referencedColumnName = "name")
+    @JoinColumn(name = "serviceTemplatesVersion", referencedColumnName = "version")
     @Valid
     private JpaToscaServiceTemplates serviceTemplates;
 
index 0a5f0c6..0148fed 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- * Copyright (C) 2020-2021,2023 Nordix Foundation.
+ * Copyright (C) 2020-2021, 2023 Nordix Foundation.
  * Modifications Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
 
 package org.onap.policy.models.tosca.simple.concepts;
 
+import jakarta.persistence.CascadeType;
+import jakarta.persistence.Entity;
+import jakarta.persistence.FetchType;
+import jakarta.persistence.Inheritance;
+import jakarta.persistence.InheritanceType;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.OneToOne;
+import jakarta.persistence.Table;
+import jakarta.ws.rs.core.Response;
+import java.io.Serial;
 import java.util.Collections;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
-import javax.persistence.CascadeType;
-import javax.persistence.Entity;
-import javax.persistence.FetchType;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.JoinColumn;
-import javax.persistence.JoinColumns;
-import javax.persistence.OneToOne;
-import javax.persistence.Table;
-import javax.ws.rs.core.Response;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.NonNull;
@@ -58,24 +58,21 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaNodeTemplate;
 @Data
 @EqualsAndHashCode(callSuper = false)
 public class JpaToscaNodeTemplate extends JpaToscaWithTypeAndStringProperties<ToscaNodeTemplate> {
+    @Serial
     private static final long serialVersionUID = 1675770231921107988L;
 
     private static final StandardCoder STANDARD_CODER = new StandardCoder();
 
     // formatter:off
     @OneToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL, orphanRemoval = true)
-    @JoinColumns({
-        @JoinColumn(name = "requirementsName", referencedColumnName = "name"),
-        @JoinColumn(name = "requirementsVersion", referencedColumnName = "version")
-    })
+    @JoinColumn(name = "requirementsName", referencedColumnName = "name")
+    @JoinColumn(name = "requirementsVersion", referencedColumnName = "version")
     @Valid
     private JpaToscaRequirements requirements;
 
     @OneToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL, orphanRemoval = true)
-    @JoinColumns({
-        @JoinColumn(name = "capabilitiesName", referencedColumnName = "name"),
-        @JoinColumn(name = "capabilitiesVersion", referencedColumnName = "version")
-    })
+    @JoinColumn(name = "capabilitiesName", referencedColumnName = "name")
+    @JoinColumn(name = "capabilitiesVersion", referencedColumnName = "version")
     @Valid
     private JpaToscaCapabilityAssignments capabilities;
     // @formatter:on
index 6cc7a1f..0a14e43 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2020 Nordix Foundation.
+ *  Copyright (C) 2020, 2023 Nordix Foundation.
  *  Modifications Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
 
 package org.onap.policy.models.tosca.simple.concepts;
 
+import jakarta.persistence.Entity;
+import jakarta.persistence.Inheritance;
+import jakarta.persistence.InheritanceType;
+import jakarta.persistence.Table;
+import java.io.Serial;
 import java.util.List;
 import java.util.Map;
 import java.util.TreeMap;
-import javax.persistence.Entity;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.Table;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
+import lombok.NonNull;
 import lombok.ToString;
 import org.onap.policy.common.parameters.BeanValidationResult;
 import org.onap.policy.models.base.PfConceptContainer;
@@ -49,6 +51,7 @@ import org.onap.policy.models.tosca.utils.ToscaUtils;
 public class JpaToscaNodeTemplates extends PfConceptContainer<JpaToscaNodeTemplate, ToscaNodeTemplate> {
     public static final String DEFAULT_NAME = "ToscaNodeTemplatesSimple";
     public static final String DEFAULT_VERSION = "1.0.0";
+    @Serial
     private static final long serialVersionUID = -4157979965271220098L;
 
     /**
@@ -70,7 +73,7 @@ public class JpaToscaNodeTemplates extends PfConceptContainer<JpaToscaNodeTempla
     }
 
     /**
-     * This Constructor creates an concept container with all of its fields defined.
+     * This Constructor creates a concept container with all of its fields defined.
      *
      * @param key        the concept container key
      * @param conceptMap the concepts to be stored in the concept container
@@ -99,7 +102,7 @@ public class JpaToscaNodeTemplates extends PfConceptContainer<JpaToscaNodeTempla
     }
 
     @Override
-    public BeanValidationResult validate(String fieldName) {
+    public BeanValidationResult validate(@NonNull String fieldName) {
         BeanValidationResult result = super.validate(fieldName);
 
         // Check that all ancestors of this node template exist
index f295acc..a7342d2 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- * Copyright (C) 2020,2023 Nordix Foundation.
+ * Copyright (C) 2020, 2023 Nordix Foundation.
  * Modifications Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
 
 package org.onap.policy.models.tosca.simple.concepts;
 
+import jakarta.persistence.CascadeType;
+import jakarta.persistence.Entity;
+import jakarta.persistence.FetchType;
+import jakarta.persistence.Inheritance;
+import jakarta.persistence.InheritanceType;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.OneToOne;
+import jakarta.persistence.Table;
+import java.io.Serial;
 import java.util.List;
-import javax.persistence.CascadeType;
-import javax.persistence.Entity;
-import javax.persistence.FetchType;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.JoinColumn;
-import javax.persistence.JoinColumns;
-import javax.persistence.OneToOne;
-import javax.persistence.Table;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.NoArgsConstructor;
@@ -54,15 +54,14 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaNodeType;
 @EqualsAndHashCode(callSuper = true)
 @NoArgsConstructor
 public class JpaToscaNodeType extends JpaToscaWithToscaProperties<ToscaNodeType> {
+    @Serial
     private static final long serialVersionUID = -563659852901842616L;
 
 
     // formatter:off
     @OneToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL, orphanRemoval = true)
-    @JoinColumns({
-        @JoinColumn(name = "requirementsName", referencedColumnName = "name"),
-        @JoinColumn(name = "requirementsVersion", referencedColumnName = "version")
-    })
+    @JoinColumn(name = "requirementsName", referencedColumnName = "name")
+    @JoinColumn(name = "requirementsVersion", referencedColumnName = "version")
     // @formatter:on
     @Valid
     private JpaToscaRequirements requirements;
index b1fe40b..2a4b22e 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2020 Nordix Foundation.
+ *  Copyright (C) 2020, 2023 Nordix Foundation.
  *  Modifications Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
 
 package org.onap.policy.models.tosca.simple.concepts;
 
+import jakarta.persistence.Entity;
+import jakarta.persistence.Inheritance;
+import jakarta.persistence.InheritanceType;
+import jakarta.persistence.Table;
+import java.io.Serial;
 import java.util.List;
 import java.util.Map;
 import java.util.TreeMap;
-import javax.persistence.Entity;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.Table;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
+import lombok.NonNull;
 import lombok.ToString;
 import org.onap.policy.common.parameters.BeanValidationResult;
 import org.onap.policy.models.base.PfConceptContainer;
@@ -49,6 +51,7 @@ import org.onap.policy.models.tosca.utils.ToscaUtils;
 public class JpaToscaNodeTypes extends PfConceptContainer<JpaToscaNodeType, ToscaNodeType> {
     public static final String DEFAULT_NAME = "ToscaNodeTypesSimple";
     public static final String DEFAULT_VERSION = "1.0.0";
+    @Serial
     private static final long serialVersionUID = -4157979965271220098L;
 
     /**
@@ -70,7 +73,7 @@ public class JpaToscaNodeTypes extends PfConceptContainer<JpaToscaNodeType, Tosc
     }
 
     /**
-     * This Constructor creates an concept container with all of its fields defined.
+     * This Constructor creates a concept container with all of its fields defined.
      *
      * @param key        the concept container key
      * @param conceptMap the concepts to be stored in the concept container
@@ -99,7 +102,7 @@ public class JpaToscaNodeTypes extends PfConceptContainer<JpaToscaNodeType, Tosc
     }
 
     @Override
-    public BeanValidationResult validate(String fieldName) {
+    public BeanValidationResult validate(@NonNull String fieldName) {
         BeanValidationResult result = super.validate(fieldName);
 
         // Check that all ancestors of this policy type exist
index 552d9c1..dfa8240 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- * Copyright (C) 2020 Nordix Foundation.
+ * Copyright (C) 2020, 2023 Nordix Foundation.
  * Modifications Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
  * Modifications Copyright (C) 2022 Bell Canada. All rights reserved.
  * ================================================================================
@@ -22,9 +22,9 @@
 
 package org.onap.policy.models.tosca.simple.concepts;
 
+import jakarta.persistence.Column;
+import jakarta.persistence.EmbeddedId;
 import java.util.List;
-import javax.persistence.Column;
-import javax.persistence.EmbeddedId;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.NonNull;
index 7c1022c..caf9995 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019-2020 Nordix Foundation.
+ *  Copyright (C) 2019-2020, 2023 Nordix Foundation.
  *  Modifications Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
 
 package org.onap.policy.models.tosca.simple.concepts;
 
+import jakarta.persistence.Entity;
+import jakarta.persistence.Inheritance;
+import jakarta.persistence.InheritanceType;
+import jakarta.persistence.Table;
+import java.io.Serial;
 import java.util.List;
 import java.util.Map;
 import java.util.TreeMap;
-import javax.persistence.Entity;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.Table;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
+import lombok.NonNull;
 import lombok.ToString;
 import org.onap.policy.common.parameters.BeanValidationResult;
 import org.onap.policy.models.base.PfAuthorative;
@@ -51,6 +53,7 @@ import org.onap.policy.models.tosca.utils.ToscaUtils;
 @EqualsAndHashCode(callSuper = true)
 public class JpaToscaPolicies extends PfConceptContainer<JpaToscaPolicy, ToscaPolicy>
         implements PfAuthorative<List<Map<String, ToscaPolicy>>> {
+    @Serial
     private static final long serialVersionUID = -7526648702327776101L;
 
     public static final String DEFAULT_NAME = "ToscaPoliciesSimple";
@@ -104,7 +107,7 @@ public class JpaToscaPolicies extends PfConceptContainer<JpaToscaPolicy, ToscaPo
     }
 
     @Override
-    public BeanValidationResult validate(String fieldName) {
+    public BeanValidationResult validate(@NonNull String fieldName) {
         BeanValidationResult result = super.validate(fieldName);
 
         for (JpaToscaPolicy policy : this.getConceptMap().values()) {
index 92e0fae..eb573ca 100644 (file)
@@ -3,7 +3,7 @@
  * ONAP Policy Model
  * ================================================================================
  * Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019-2021 Nordix Foundation.
+ * Modifications Copyright (C) 2019-2021, 2023 Nordix Foundation.
  * Modifications Copyright (C) 2022 Bell Canada. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
 
 package org.onap.policy.models.tosca.simple.concepts;
 
+import jakarta.persistence.CollectionTable;
+import jakarta.persistence.ElementCollection;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Inheritance;
+import jakarta.persistence.InheritanceType;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.Table;
+import jakarta.ws.rs.core.Response;
+import java.io.Serial;
 import java.util.LinkedHashMap;
 import java.util.List;
-import javax.persistence.CollectionTable;
-import javax.persistence.ElementCollection;
-import javax.persistence.Entity;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.JoinColumn;
-import javax.persistence.Table;
-import javax.ws.rs.core.Response;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.NonNull;
@@ -61,6 +62,7 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy;
 @Data
 @EqualsAndHashCode(callSuper = true)
 public class JpaToscaPolicy extends JpaToscaWithTypeAndStringProperties<ToscaPolicy> {
+    @Serial
     private static final long serialVersionUID = 3265174757061982805L;
     private static final String METADATA_METADATA_SET_NAME_TAG = "metadataSetName";
     private static final String METADATA_METADATA_SET_VERSION_TAG = "metadataSetVersion";
@@ -200,7 +202,7 @@ public class JpaToscaPolicy extends JpaToscaWithTypeAndStringProperties<ToscaPol
     }
 
     @Override
-    public BeanValidationResult validate(String fieldName) {
+    public BeanValidationResult validate(@NonNull String fieldName) {
         BeanValidationResult result = super.validate(fieldName);
 
         validateKeyVersionNotNull(result, "key", getKey());
index dfdf7ed..14502c6 100644 (file)
@@ -3,7 +3,7 @@
  * ONAP Policy Model
  * ================================================================================
  * Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019-2020 Nordix Foundation.
+ * Modifications Copyright (C) 2019-2020, 2023 Nordix Foundation.
  * Modifications Copyright (C) 2022 Bell Canada. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
 
 package org.onap.policy.models.tosca.simple.concepts;
 
+import jakarta.persistence.CollectionTable;
+import jakarta.persistence.ElementCollection;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Inheritance;
+import jakarta.persistence.InheritanceType;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.Lob;
+import jakarta.persistence.Table;
+import java.io.Serial;
 import java.util.List;
-import javax.persistence.CollectionTable;
-import javax.persistence.ElementCollection;
-import javax.persistence.Entity;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.JoinColumn;
-import javax.persistence.Lob;
-import javax.persistence.Table;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.NoArgsConstructor;
@@ -60,6 +61,7 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyType;
 @EqualsAndHashCode(callSuper = true)
 @NoArgsConstructor
 public class JpaToscaPolicyType extends JpaToscaWithToscaProperties<ToscaPolicyType> {
+    @Serial
     private static final long serialVersionUID = -563659852901842616L;
 
     @ElementCollection
index c20cada..f053a5b 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019-2020 Nordix Foundation.
+ *  Copyright (C) 2019-2020, 2023 Nordix Foundation.
  *  Modifications Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
 
 package org.onap.policy.models.tosca.simple.concepts;
 
+import jakarta.persistence.Entity;
+import jakarta.persistence.Inheritance;
+import jakarta.persistence.InheritanceType;
+import jakarta.persistence.Table;
+import java.io.Serial;
 import java.util.List;
 import java.util.Map;
 import java.util.TreeMap;
-import javax.persistence.Entity;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.Table;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
+import lombok.NonNull;
 import lombok.ToString;
 import org.onap.policy.common.parameters.BeanValidationResult;
 import org.onap.policy.models.base.PfConceptContainer;
@@ -49,6 +51,7 @@ import org.onap.policy.models.tosca.utils.ToscaUtils;
 @ToString(callSuper = true)
 @EqualsAndHashCode(callSuper = true)
 public class JpaToscaPolicyTypes extends PfConceptContainer<JpaToscaPolicyType, ToscaPolicyType> {
+    @Serial
     private static final long serialVersionUID = -4157979965271220098L;
 
     public static final String DEFAULT_NAME = "ToscaPolicyTypesSimple";
@@ -73,7 +76,7 @@ public class JpaToscaPolicyTypes extends PfConceptContainer<JpaToscaPolicyType,
     }
 
     /**
-     * This Constructor creates an concept container with all of its fields defined.
+     * This Constructor creates a concept container with all of its fields defined.
      *
      * @param key the concept container key
      * @param conceptMap the concepts to be stored in the concept container
@@ -102,7 +105,7 @@ public class JpaToscaPolicyTypes extends PfConceptContainer<JpaToscaPolicyType,
     }
 
     @Override
-    public BeanValidationResult validate(String fieldName) {
+    public BeanValidationResult validate(@NonNull String fieldName) {
         BeanValidationResult result = super.validate(fieldName);
 
         // Check that all ancestors of this policy type exist
index 73b9fab..0ef8ffb 100644 (file)
@@ -3,7 +3,7 @@
  * ONAP Policy Model
  * ================================================================================
  * Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019-2021 Nordix Foundation.
+ * Modifications Copyright (C) 2019-2021, 2023 Nordix Foundation.
  * Modifications Copyright (C) 2022 Bell Canada. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
 
 package org.onap.policy.models.tosca.simple.concepts;
 
+import jakarta.persistence.Column;
+import jakarta.persistence.ElementCollection;
+import jakarta.persistence.EmbeddedId;
+import java.io.Serial;
 import java.util.ArrayList;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
-import javax.persistence.Column;
-import javax.persistence.ElementCollection;
-import javax.persistence.EmbeddedId;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.NonNull;
@@ -58,6 +59,7 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaProperty.Status;
 @Data
 @EqualsAndHashCode(callSuper = false)
 public class JpaToscaProperty extends PfConcept implements PfAuthorative<ToscaProperty> {
+    @Serial
     private static final long serialVersionUID = 1675770231921107988L;
 
     @EmbeddedId
@@ -243,10 +245,7 @@ public class JpaToscaProperty extends PfConcept implements PfAuthorative<ToscaPr
     }
 
     @Override
-    public int compareTo(final PfConcept otherConcept) {
-        if (otherConcept == null) {
-            return -1;
-        }
+    public int compareTo(@NonNull final PfConcept otherConcept) {
         if (this == otherConcept) {
             return 0;
         }
index 1182111..f542192 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- * Copyright (C) 2020 Nordix Foundation.
+ * Copyright (C) 2020, 2023 Nordix Foundation.
  * Modifications Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
 
 package org.onap.policy.models.tosca.simple.concepts;
 
-import javax.persistence.Entity;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.Table;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Inheritance;
+import jakarta.persistence.InheritanceType;
+import jakarta.persistence.Table;
+import java.io.Serial;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.NoArgsConstructor;
@@ -44,6 +45,7 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaRelationshipType;
 @EqualsAndHashCode(callSuper = true)
 @NoArgsConstructor
 public class JpaToscaRelationshipType extends JpaToscaWithToscaProperties<ToscaRelationshipType> {
+    @Serial
     private static final long serialVersionUID = -563659852901842616L;
 
     /**
index eed351d..ab37c4e 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2020 Nordix Foundation.
+ *  Copyright (C) 2020, 2023 Nordix Foundation.
  *  Modifications Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
 
 package org.onap.policy.models.tosca.simple.concepts;
 
+import jakarta.persistence.Entity;
+import jakarta.persistence.Inheritance;
+import jakarta.persistence.InheritanceType;
+import jakarta.persistence.Table;
+import java.io.Serial;
 import java.util.List;
 import java.util.Map;
 import java.util.TreeMap;
-import javax.persistence.Entity;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.Table;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
+import lombok.NonNull;
 import lombok.ToString;
 import org.onap.policy.common.parameters.BeanValidationResult;
 import org.onap.policy.models.base.PfConceptContainer;
@@ -49,6 +51,7 @@ import org.onap.policy.models.tosca.utils.ToscaUtils;
 public class JpaToscaRelationshipTypes extends PfConceptContainer<JpaToscaRelationshipType, ToscaRelationshipType> {
     public static final String DEFAULT_NAME = "ToscaRelationshipTypesSimple";
     public static final String DEFAULT_VERSION = "1.0.0";
+    @Serial
     private static final long serialVersionUID = -4157979965271220098L;
 
     /**
@@ -70,7 +73,7 @@ public class JpaToscaRelationshipTypes extends PfConceptContainer<JpaToscaRelati
     }
 
     /**
-     * This Constructor creates an concept container with all of its fields defined.
+     * This Constructor creates a concept container with all of its fields defined.
      *
      * @param key        the concept container key
      * @param conceptMap the concepts to be stored in the concept container
@@ -100,7 +103,7 @@ public class JpaToscaRelationshipTypes extends PfConceptContainer<JpaToscaRelati
     }
 
     @Override
-    public BeanValidationResult validate(String fieldName) {
+    public BeanValidationResult validate(@NonNull String fieldName) {
         BeanValidationResult result = super.validate(fieldName);
 
         // Check that all ancestors of this policy type exist
index f2cf14c..18d9d00 100644 (file)
@@ -3,7 +3,7 @@
  * ONAP Requirement Model
  * ================================================================================
  * Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019-2021 Nordix Foundation.
+ * Modifications Copyright (C) 2019-2021, 2023 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.models.tosca.simple.concepts;
 
+import jakarta.persistence.Column;
+import jakarta.persistence.ElementCollection;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Inheritance;
+import jakarta.persistence.InheritanceType;
+import jakarta.persistence.Table;
+import java.io.Serial;
 import java.util.ArrayList;
 import java.util.List;
-import javax.persistence.Column;
-import javax.persistence.ElementCollection;
-import javax.persistence.Entity;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.Table;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.NonNull;
@@ -55,6 +56,7 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaRequirement;
 @EqualsAndHashCode(callSuper = true)
 public class JpaToscaRequirement extends JpaToscaWithTypeAndStringProperties<ToscaRequirement> {
 
+    @Serial
     private static final long serialVersionUID = 2785481541573683089L;
     private static final String AUTHORATIVE_UNBOUNDED_LITERAL = "UNBOUNDED";
     private static final Integer JPA_UNBOUNDED_VALUE = -1;
index 283c161..52087b2 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2020 Nordix Foundation.
+ *  Copyright (C) 2020, 2023 Nordix Foundation.
  *  Modifications Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
 
 package org.onap.policy.models.tosca.simple.concepts;
 
+import jakarta.persistence.Entity;
+import jakarta.persistence.Inheritance;
+import jakarta.persistence.InheritanceType;
+import jakarta.persistence.Table;
+import java.io.Serial;
 import java.util.List;
 import java.util.Map;
 import java.util.TreeMap;
-import javax.persistence.Entity;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.Table;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
+import lombok.NonNull;
 import lombok.ToString;
 import org.onap.policy.common.parameters.BeanValidationResult;
 import org.onap.policy.models.base.PfAuthorative;
@@ -51,6 +53,7 @@ import org.onap.policy.models.tosca.utils.ToscaUtils;
 @EqualsAndHashCode(callSuper = true)
 public class JpaToscaRequirements extends PfConceptContainer<JpaToscaRequirement, ToscaRequirement>
         implements PfAuthorative<List<Map<String, ToscaRequirement>>> {
+    @Serial
     private static final long serialVersionUID = -7526648702327776101L;
 
     public static final String DEFAULT_NAME = "ToscaRequirementsSimple";
@@ -75,7 +78,7 @@ public class JpaToscaRequirements extends PfConceptContainer<JpaToscaRequirement
     }
 
     /**
-     * This Constructor creates an concept container with all of its fields defined.
+     * This Constructor creates a concept container with all of its fields defined.
      *
      * @param key the concept container key
      * @param conceptMap the concepts to be stored in the concept container
@@ -104,7 +107,7 @@ public class JpaToscaRequirements extends PfConceptContainer<JpaToscaRequirement
     }
 
     @Override
-    public BeanValidationResult validate(String fieldName) {
+    public BeanValidationResult validate(@NonNull String fieldName) {
         BeanValidationResult result = super.validate(fieldName);
 
         for (JpaToscaRequirement requirement : this.getConceptMap().values()) {
index 75941b2..b417165 100644 (file)
@@ -3,7 +3,7 @@
  * ONAP Policy Model
  * ================================================================================
  * Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019-2020 Nordix Foundation.
+ * Modifications Copyright (C) 2019-2020, 2023 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.models.tosca.simple.concepts;
 
+import jakarta.persistence.Column;
+import jakarta.persistence.ElementCollection;
+import java.io.Serial;
 import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.List;
-import javax.persistence.Column;
-import javax.persistence.ElementCollection;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.NoArgsConstructor;
@@ -58,6 +59,7 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaSchemaDefinition;
 public class JpaToscaSchemaDefinition extends Validated
         implements PfAuthorative<ToscaSchemaDefinition>, Serializable, Comparable<JpaToscaSchemaDefinition> {
 
+    @Serial
     private static final long serialVersionUID = 3645882081163287058L;
 
     @Column
@@ -180,10 +182,8 @@ public class JpaToscaSchemaDefinition extends Validated
         copy.setDescription(description);
 
         if (constraints != null) {
-            final List<JpaToscaConstraint> newConstraints = new ArrayList<>();
-            for (final JpaToscaConstraint constraint : constraints) {
-                newConstraints.add(constraint); // Constraints are immutable
-            }
+            // Constraints are immutable
+            final List<JpaToscaConstraint> newConstraints = new ArrayList<>(constraints);
             copy.setConstraints(newConstraints);
         }
 
index 109f1f0..8f878c8 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019-2021,2023 Nordix Foundation.
+ *  Copyright (C) 2019-2021, 2023 Nordix Foundation.
  *  Modifications Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
 package org.onap.policy.models.tosca.simple.concepts;
 
 import com.google.gson.annotations.SerializedName;
+import jakarta.persistence.CascadeType;
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.FetchType;
+import jakarta.persistence.Inheritance;
+import jakarta.persistence.InheritanceType;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.OneToOne;
+import jakarta.persistence.Table;
+import java.io.Serial;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
-import javax.persistence.CascadeType;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.FetchType;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.JoinColumn;
-import javax.persistence.JoinColumns;
-import javax.persistence.OneToOne;
-import javax.persistence.Table;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.NonNull;
@@ -64,10 +64,11 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaServiceTemplate;
 @Data
 @EqualsAndHashCode(callSuper = true)
 public class JpaToscaServiceTemplate extends JpaToscaEntityType<ToscaServiceTemplate>
-        implements PfAuthorative<ToscaServiceTemplate> {
+    implements PfAuthorative<ToscaServiceTemplate> {
+    @Serial
     private static final long serialVersionUID = 8084846046148349401L;
 
-    public static final String DEFAULT_TOSCA_DEFINTIONS_VERISON = "tosca_simple_yaml_1_1_0";
+    public static final String DEFAULT_TOSCA_DEFINITIONS_VERSION = "tosca_simple_yaml_1_1_0";
     public static final String DEFAULT_NAME = "ToscaServiceTemplateSimple";
     public static final String DEFAULT_VERSION = "1.0.0";
 
@@ -79,57 +80,45 @@ public class JpaToscaServiceTemplate extends JpaToscaEntityType<ToscaServiceTemp
     private String toscaDefinitionsVersion;
 
     @OneToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL, orphanRemoval = true)
-    @JoinColumns({
-        @JoinColumn(name = "dataTypesName",    referencedColumnName = "name"),
-        @JoinColumn(name = "dataTypesVersion", referencedColumnName = "version")
-    })
+    @JoinColumn(name = "dataTypesName",    referencedColumnName = "name")
+    @JoinColumn(name = "dataTypesVersion", referencedColumnName = "version")
     @SerializedName("data_types")
     @Valid
     private JpaToscaDataTypes dataTypes;
 
     @OneToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL, orphanRemoval = true)
-    @JoinColumns({
-        @JoinColumn(name = "capabilityTypesName",    referencedColumnName = "name"),
-        @JoinColumn(name = "capabilityTypesVersion", referencedColumnName = "version")
-    })
+    @JoinColumn(name = "capabilityTypesName",    referencedColumnName = "name")
+    @JoinColumn(name = "capabilityTypesVersion", referencedColumnName = "version")
     @SerializedName("capability_types")
     @Valid
     private JpaToscaCapabilityTypes capabilityTypes;
 
     @OneToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL, orphanRemoval = true)
-    @JoinColumns({
-        @JoinColumn(name = "relationshipTypesName",    referencedColumnName = "name"),
-        @JoinColumn(name = "relationshipTypesVersion", referencedColumnName = "version")
-    })
+    @JoinColumn(name = "relationshipTypesName",    referencedColumnName = "name")
+    @JoinColumn(name = "relationshipTypesVersion", referencedColumnName = "version")
     @SerializedName("relationship_types")
     @Valid
     private JpaToscaRelationshipTypes relationshipTypes;
 
     @OneToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL, orphanRemoval = true)
-    @JoinColumns({
-        @JoinColumn(name = "nodeTypesName",    referencedColumnName = "name"),
-        @JoinColumn(name = "nodeTypesVersion", referencedColumnName = "version")
-    })
+    @JoinColumn(name = "nodeTypesName",    referencedColumnName = "name")
+    @JoinColumn(name = "nodeTypesVersion", referencedColumnName = "version")
     @SerializedName("node_types")
     @Valid
     private JpaToscaNodeTypes nodeTypes;
 
     @OneToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL, orphanRemoval = true)
-    @JoinColumns({
-        @JoinColumn(name = "policyTypesName",    referencedColumnName = "name"),
-        @JoinColumn(name = "policyTypesVersion", referencedColumnName = "version")
-    })
+    @JoinColumn(name = "policyTypesName",    referencedColumnName = "name")
+    @JoinColumn(name = "policyTypesVersion", referencedColumnName = "version")
     @SerializedName("policy_types")
     @Valid
     private JpaToscaPolicyTypes policyTypes;
 
     @OneToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL, orphanRemoval = true)
-    @JoinColumns({
-        @JoinColumn(name = "topologyTemplateParentKeyName",    referencedColumnName = "parentKeyName"),
-        @JoinColumn(name = "topologyTemplateParentKeyVersion", referencedColumnName = "parentKeyVersion"),
-        @JoinColumn(name = "topologyTemplateParentLocalName",  referencedColumnName = "parentLocalName"),
-        @JoinColumn(name = "topologyTemplateLocalName",        referencedColumnName = "localName")
-    })
+    @JoinColumn(name = "topologyTemplateParentKeyName",    referencedColumnName = "parentKeyName")
+    @JoinColumn(name = "topologyTemplateParentKeyVersion", referencedColumnName = "parentKeyVersion")
+    @JoinColumn(name = "topologyTemplateParentLocalName",  referencedColumnName = "parentLocalName")
+    @JoinColumn(name = "topologyTemplateLocalName",        referencedColumnName = "localName")
     @SerializedName("topology_template")
     @Valid
     private JpaToscaTopologyTemplate topologyTemplate;
@@ -148,13 +137,13 @@ public class JpaToscaServiceTemplate extends JpaToscaEntityType<ToscaServiceTemp
      * @param key the key
      */
     public JpaToscaServiceTemplate(@NonNull final PfConceptKey key) {
-        this(key, DEFAULT_TOSCA_DEFINTIONS_VERISON);
+        this(key, DEFAULT_TOSCA_DEFINITIONS_VERSION);
     }
 
     /**
      * The full constructor creates a {@link JpaToscaServiceTemplate} object with all mandatory parameters.
      *
-     * @param key the key
+     * @param key                     the key
      * @param toscaDefinitionsVersion the TOSCA version string
      */
     public JpaToscaServiceTemplate(@NonNull final PfConceptKey key, @NonNull final String toscaDefinitionsVersion) {
@@ -172,15 +161,15 @@ public class JpaToscaServiceTemplate extends JpaToscaEntityType<ToscaServiceTemp
         this.toscaDefinitionsVersion = copyConcept.toscaDefinitionsVersion;
         this.dataTypes = (copyConcept.dataTypes != null ? new JpaToscaDataTypes(copyConcept.dataTypes) : null);
         this.capabilityTypes =
-                (copyConcept.capabilityTypes != null ? new JpaToscaCapabilityTypes(copyConcept.capabilityTypes) : null);
+            (copyConcept.capabilityTypes != null ? new JpaToscaCapabilityTypes(copyConcept.capabilityTypes) : null);
         this.relationshipTypes =
-                (copyConcept.relationshipTypes != null ? new JpaToscaRelationshipTypes(copyConcept.relationshipTypes)
-                        : null);
+            (copyConcept.relationshipTypes != null ? new JpaToscaRelationshipTypes(copyConcept.relationshipTypes)
+                : null);
         this.nodeTypes = (copyConcept.nodeTypes != null ? new JpaToscaNodeTypes(copyConcept.nodeTypes) : null);
         this.policyTypes = (copyConcept.policyTypes != null ? new JpaToscaPolicyTypes(copyConcept.policyTypes) : null);
         this.topologyTemplate =
-                (copyConcept.topologyTemplate != null ? new JpaToscaTopologyTemplate(copyConcept.topologyTemplate)
-                        : null);
+            (copyConcept.topologyTemplate != null ? new JpaToscaTopologyTemplate(copyConcept.topologyTemplate)
+                : null);
     }
 
     /**
@@ -231,8 +220,8 @@ public class JpaToscaServiceTemplate extends JpaToscaEntityType<ToscaServiceTemp
     /**
      * Takes a list of maps and flattens it into a single map.
      *
-     * @param list list to be be flattened
-     * @return a map containing all of the elements from the list of maps
+     * @param list list to be flattened
+     * @return a map containing all the elements from the list of maps
      */
     private <V> Map<String, V> flattenMap(List<Map<String, V>> list) {
         Map<String, V> result = new LinkedHashMap<>();
@@ -353,7 +342,7 @@ public class JpaToscaServiceTemplate extends JpaToscaEntityType<ToscaServiceTemp
     public BeanValidationResult validate(String fieldName) {
         BeanValidationResult result = super.validate(fieldName);
 
-        // No point in validating cross references if the structure of the individual parts are not valid
+        // No point in validating cross-references if the structure of the individual parts are not valid
         if (!result.isValid()) {
             return result;
         }
@@ -452,10 +441,10 @@ public class JpaToscaServiceTemplate extends JpaToscaEntityType<ToscaServiceTemp
      * Validate that the referenced data types exist for a collection of data type keys.
      *
      * @param dataTypeKeyCollection the data type key collection
-     * @param result where the results are added
+     * @param result                where the results are added
      */
     private void validateReferencedDataTypesExists(final Collection<PfConceptKey> dataTypeKeyCollection,
-            final BeanValidationResult result) {
+                                                   final BeanValidationResult result) {
         for (PfConceptKey dataTypeKey : dataTypeKeyCollection) {
             if (dataTypes == null || dataTypes.get(dataTypeKey) == null) {
                 addResult(result, "data type", dataTypeKey.getId(), NOT_FOUND);
@@ -470,13 +459,13 @@ public class JpaToscaServiceTemplate extends JpaToscaEntityType<ToscaServiceTemp
      */
     private void validatePolicyTypesInPolicies(BeanValidationResult result) {
         if (topologyTemplate == null || topologyTemplate.getPolicies() == null
-                || topologyTemplate.getPolicies().getConceptMap().isEmpty()) {
+            || topologyTemplate.getPolicies().getConceptMap().isEmpty()) {
             return;
         }
 
         if (policyTypes == null || policyTypes.getConceptMap().isEmpty()) {
             addResult(result, "policyTypes", policyTypes,
-                    "no policy types are defined on the service template for the policies in the topology template");
+                "no policy types are defined on the service template for the policies in the topology template");
             return;
         }
 
index 4f9fa43..318ca1d 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019 Nordix Foundation.
+ *  Copyright (C) 2019, 2023 Nordix Foundation.
  *  Modifications Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
 
 package org.onap.policy.models.tosca.simple.concepts;
 
+import jakarta.persistence.Entity;
+import jakarta.persistence.Inheritance;
+import jakarta.persistence.InheritanceType;
+import jakarta.persistence.Table;
 import java.util.List;
 import java.util.Map;
 import java.util.TreeMap;
-import javax.persistence.Entity;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.Table;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import org.onap.policy.models.base.PfConceptContainer;
index 819b7d8..e54f119 100644 (file)
@@ -3,7 +3,7 @@
  * ONAP Policy Model
  * ================================================================================
  * Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019-2021 Nordix Foundation.
+ * Modifications Copyright (C) 2019-2021, 2023 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.models.tosca.simple.concepts;
 
 import com.google.gson.annotations.SerializedName;
+import jakarta.persistence.EmbeddedId;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Inheritance;
+import jakarta.persistence.InheritanceType;
+import jakarta.persistence.Table;
+import java.io.Serial;
 import java.sql.Timestamp;
 import java.time.Instant;
 import java.util.List;
-import javax.persistence.EmbeddedId;
-import javax.persistence.Entity;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.Table;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.NonNull;
@@ -56,6 +57,7 @@ import org.onap.policy.models.base.validation.annotations.VerifyKey;
 @Data
 @EqualsAndHashCode(callSuper = false)
 public class JpaToscaTimeInterval extends PfConcept {
+    @Serial
     private static final long serialVersionUID = 9151467029611969980L;
 
     @EmbeddedId
index 629e14a..30152df 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019-2020,2023 Nordix Foundation.
+ *  Copyright (C) 2019-2020, 2023 Nordix Foundation.
  *  Modifications Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
 package org.onap.policy.models.tosca.simple.concepts;
 
 import com.google.gson.annotations.SerializedName;
+import jakarta.persistence.CascadeType;
+import jakarta.persistence.Column;
+import jakarta.persistence.ElementCollection;
+import jakarta.persistence.EmbeddedId;
+import jakarta.persistence.Entity;
+import jakarta.persistence.FetchType;
+import jakarta.persistence.Inheritance;
+import jakarta.persistence.InheritanceType;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.JoinColumns;
+import jakarta.persistence.Lob;
+import jakarta.persistence.OneToOne;
+import jakarta.persistence.Table;
+import java.io.Serial;
 import java.util.Collections;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
-import javax.persistence.CascadeType;
-import javax.persistence.Column;
-import javax.persistence.ElementCollection;
-import javax.persistence.EmbeddedId;
-import javax.persistence.Entity;
-import javax.persistence.FetchType;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.JoinColumn;
-import javax.persistence.JoinColumns;
-import javax.persistence.Lob;
-import javax.persistence.OneToOne;
-import javax.persistence.Table;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.NonNull;
@@ -68,6 +69,7 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaTopologyTemplate;
 @Data
 @EqualsAndHashCode(callSuper = false)
 public class JpaToscaTopologyTemplate extends PfConcept implements PfAuthorative<ToscaTopologyTemplate> {
+    @Serial
     private static final long serialVersionUID = 8969698734673232603L;
 
     public static final String DEFAULT_LOCAL_NAME = "ToscaTopologyTemplateSimple";
@@ -81,27 +83,20 @@ public class JpaToscaTopologyTemplate extends PfConcept implements PfAuthorative
     @NotBlank
     private String description;
 
-    // @formatter:off
     @ElementCollection
     @Lob
     private Map<@NotNull String, @NotNull @Valid JpaToscaParameter> inputs;
 
     @OneToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL, orphanRemoval = true)
-    @JoinColumns({
-        @JoinColumn(name = "nodeTemplatesName", referencedColumnName = "name"),
-        @JoinColumn(name = "nodeTemplatessVersion", referencedColumnName = "version")
-    })
+    @JoinColumn(name = "nodeTemplatesName", referencedColumnName = "name")
+    @JoinColumn(name = "nodeTemplatessVersion", referencedColumnName = "version")
     @SerializedName("data_types")
     @Valid
     private JpaToscaNodeTemplates nodeTemplates;
 
     @OneToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL, orphanRemoval = true)
-    @JoinColumns({
-        @JoinColumn(name = "policyName",    referencedColumnName = "name"),
-        @JoinColumn(name = "policyVersion", referencedColumnName = "version")
-
-    })
-    // @formatter:on
+    @JoinColumn(name = "policyName", referencedColumnName = "name")
+    @JoinColumn(name = "policyVersion", referencedColumnName = "version")
     @Valid
     private JpaToscaPolicies policies;
 
@@ -110,7 +105,7 @@ public class JpaToscaTopologyTemplate extends PfConcept implements PfAuthorative
      */
     public JpaToscaTopologyTemplate() {
         this(new PfReferenceKey(JpaToscaServiceTemplate.DEFAULT_NAME, JpaToscaServiceTemplate.DEFAULT_VERSION,
-                DEFAULT_LOCAL_NAME));
+            DEFAULT_LOCAL_NAME));
     }
 
     /**
@@ -133,7 +128,7 @@ public class JpaToscaTopologyTemplate extends PfConcept implements PfAuthorative
         this.description = copyConcept.description;
         this.inputs = PfUtils.mapMap(copyConcept.inputs, JpaToscaParameter::new);
         this.nodeTemplates =
-                (copyConcept.nodeTemplates != null ? new JpaToscaNodeTemplates(copyConcept.nodeTemplates) : null);
+            (copyConcept.nodeTemplates != null ? new JpaToscaNodeTemplates(copyConcept.nodeTemplates) : null);
         this.policies = (copyConcept.policies != null ? new JpaToscaPolicies(copyConcept.policies) : null);
     }
 
index 1e13b22..2b017ee 100644 (file)
@@ -3,7 +3,7 @@
  * ONAP Policy Model
  * ================================================================================
  * Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019-2021 Nordix Foundation.
+ * Modifications Copyright (C) 2019-2021, 2023 Nordix Foundation.
  * Modifications Copyright (C) 2022 Bell Canada. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
 package org.onap.policy.models.tosca.simple.concepts;
 
 import com.google.gson.annotations.SerializedName;
+import jakarta.persistence.Column;
+import jakarta.persistence.EmbeddedId;
 import java.time.Duration;
 import java.util.List;
-import javax.persistence.Column;
-import javax.persistence.EmbeddedId;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.NonNull;
index 5102875..3411943 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  * Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2023 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.models.tosca.simple.concepts;
 
+import jakarta.persistence.ElementCollection;
+import jakarta.persistence.Lob;
+import jakarta.persistence.MappedSuperclass;
+import java.io.Serial;
 import java.util.Collection;
 import java.util.LinkedHashMap;
 import java.util.LinkedHashSet;
@@ -27,9 +32,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Set;
-import javax.persistence.ElementCollection;
-import javax.persistence.Lob;
-import javax.persistence.MappedSuperclass;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.NonNull;
@@ -56,6 +58,7 @@ import org.onap.policy.models.tosca.utils.ToscaUtils;
 @EqualsAndHashCode(callSuper = true)
 public abstract class JpaToscaWithToscaProperties<T extends ToscaWithToscaProperties> extends JpaToscaEntityType<T>
                 implements PfAuthorative<T> {
+    @Serial
     private static final long serialVersionUID = -563659852901842616L;
 
     @ElementCollection
index cb0ff4e..d2dd0e8 100644 (file)
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  * Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2021,2023 Nordix Foundation.
+ * Modifications Copyright (C) 2021, 2023 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.models.tosca.simple.concepts;
 
+import jakarta.persistence.AttributeOverride;
+import jakarta.persistence.Column;
+import jakarta.persistence.ElementCollection;
+import jakarta.persistence.Lob;
+import jakarta.persistence.MappedSuperclass;
+import jakarta.ws.rs.core.Response;
+import java.io.Serial;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
-import javax.persistence.AttributeOverride;
-import javax.persistence.AttributeOverrides;
-import javax.persistence.Column;
-import javax.persistence.ElementCollection;
-import javax.persistence.Lob;
-import javax.persistence.MappedSuperclass;
-import javax.ws.rs.core.Response;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.NonNull;
@@ -54,13 +54,12 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaWithTypeAndObjectP
 public abstract class JpaToscaWithTypeAndStringProperties<T extends ToscaWithTypeAndObjectProperties>
         extends JpaToscaEntityType<T> implements PfAuthorative<T> {
 
+    @Serial
     private static final long serialVersionUID = 2785481541573683089L;
 
     @Column
-    @AttributeOverrides ({
-        @AttributeOverride(name = "name", column = @Column(name = "type_name")),
-        @AttributeOverride(name = "version", column = @Column(name = "type_version"))
-    })
+    @AttributeOverride(name = "name", column = @Column(name = "type_name"))
+    @AttributeOverride(name = "version", column = @Column(name = "type_version"))
     @VerifyKey
     @NotNull
     private PfConceptKey type;
index e2f61c4..486dc9f 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019-2020,2022 Nordix Foundation.
+ *  Copyright (C) 2019-2020, 2022-2023 Nordix Foundation.
  *  Modifications Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
 
 package org.onap.policy.models.tosca.simple.provider;
 
+import jakarta.ws.rs.core.Response;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
 import java.util.Map;
 import java.util.Optional;
-import javax.ws.rs.core.Response;
 import lombok.NonNull;
 import org.apache.commons.collections4.CollectionUtils;
 import org.onap.policy.common.parameters.BeanValidationResult;
@@ -492,7 +492,7 @@ public class SimpleToscaProvider {
         deletedServiceTemplate.setPolicyTypes(new JpaToscaPolicyTypes());
         deletedServiceTemplate.getPolicyTypes().getConceptMap().put(policyTypeKey, policyType4Deletion);
 
-        LOGGER.debug("<-deletePolicyType: key={}, serviceTempalate={}", policyTypeKey, deletedServiceTemplate);
+        LOGGER.debug("<-deletePolicyType: key={}, serviceTemplate={}", policyTypeKey, deletedServiceTemplate);
         return deletedServiceTemplate;
     }
 
index b0b7863..40f09e3 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2020 Nordix Foundation.
+ *  Copyright (C) 2020, 2023 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,7 +20,7 @@
 
 package org.onap.policy.models.tosca.simple.provider;
 
-import javax.ws.rs.core.Response.Status;
+import jakarta.ws.rs.core.Response.Status;
 import lombok.NonNull;
 import org.onap.policy.models.base.PfConceptKey;
 import org.onap.policy.models.base.PfModelException;
index 6f4b299..1f6056f 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- * Copyright (C) 2020,2022 Nordix Foundation.
+ * Copyright (C) 2020, 2022-2023 Nordix Foundation.
  * Modifications Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -21,8 +21,8 @@
 
 package org.onap.policy.models.tosca.utils;
 
+import jakarta.ws.rs.core.Response;
 import java.util.Map.Entry;
-import javax.ws.rs.core.Response;
 import lombok.AccessLevel;
 import lombok.NoArgsConstructor;
 import lombok.NonNull;
index be0d41d..f4c22fc 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019-2022 Nordix Foundation.
+ *  Copyright (C) 2019-2023 Nordix Foundation.
  *  Modifications Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
 
 package org.onap.policy.models.tosca.utils;
 
+import jakarta.ws.rs.core.Response;
 import java.util.Collection;
 import java.util.HashSet;
 import java.util.Set;
 import java.util.function.Function;
-import javax.ws.rs.core.Response;
 import lombok.AccessLevel;
 import lombok.NoArgsConstructor;
 import lombok.NonNull;
index 53b42ca..2fdd29c 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019 Nordix Foundation.
+ *  Copyright (C) 2019, 2023 Nordix Foundation.
  *  Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -21,6 +21,7 @@
 
 package org.onap.policy.models.tosca.simple.concepts;
 
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotEquals;
 import static org.junit.Assert.assertNull;
@@ -69,7 +70,7 @@ public class JpaToscaConstraintLogicalTest {
         JpaToscaConstraintLogical jc5 = new JpaToscaConstraintLogical(c5);
         assertNull(jc5.toAuthorative());
 
-        assertEquals(-1, jc0.compareTo(null));
+        assertThatThrownBy(() -> jc0.compareTo(null)).isInstanceOf(NullPointerException.class);
         assertEquals(0, jc0.compareTo(jc0));
         assertNotEquals(0, jc0.compareTo(new JpaToscaConstraintValidValues(new ArrayList<>())));
         assertEquals(-2, jc0.compareTo(jc1));
index 6c39737..02e3fda 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019-2021 Nordix Foundation.
+ *  Copyright (C) 2019-2021, 2023 Nordix Foundation.
  *  Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -68,7 +68,7 @@ public class JpaToscaConstraintTest {
         validValues.add("hello");
         validValues.add("goodbye");
         JpaToscaConstraintValidValues cvv0 = new JpaToscaConstraintValidValues(validValues);
-        assertEquals(-1, cvv0.compareTo(null));
+        assertThatThrownBy(() -> cvv0.compareTo(null)).isInstanceOf(NullPointerException.class);
         assertEquals(0, cvv0.compareTo(cvv0));
         assertNotEquals(0, cvv0.compareTo(new JpaToscaConstraintLogical(JpaToscaConstraintOperation.EQ, CONSTRAINT)));
         JpaToscaConstraintValidValues cvv1 = new JpaToscaConstraintValidValues(validValues);
@@ -81,7 +81,7 @@ public class JpaToscaConstraintTest {
         rangeValues.add("hello");
         rangeValues.add("goodbye");
         JpaToscaConstraintInRange cir0 = new JpaToscaConstraintInRange(rangeValues);
-        assertEquals(-1, cir0.compareTo(null));
+        assertThatThrownBy(() -> cir0.compareTo(null)).isInstanceOf(NullPointerException.class);
         assertEquals(0, cir0.compareTo(cir0));
         assertNotEquals(0, cir0.compareTo(new JpaToscaConstraintLogical(JpaToscaConstraintOperation.EQ, CONSTRAINT)));
         JpaToscaConstraintInRange cir1 = new JpaToscaConstraintInRange(rangeValues);
index 685266a..ffa2124 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019-2021 Nordix Foundation.
+ *  Copyright (C) 2019-2021, 2023 Nordix Foundation.
  *  Modifications Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -113,7 +113,7 @@ public class JpaToscaPropertyTest {
         assertEquals(tp, tdtClone1);
         assertEquals(0, tp.compareTo(tdtClone1));
 
-        assertEquals(-1, tp.compareTo(null));
+        assertThatThrownBy(() -> tp.compareTo(null)).isInstanceOf(NullPointerException.class);
         assertEquals(0, tp.compareTo(tp));
         assertNotEquals(0, tp.compareTo(tp.getKey()));
     }
index 9a91a95..6296788 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019-2021 Nordix Foundation.
+ *  Copyright (C) 2019-2021, 2023 Nordix Foundation.
  *  Modifications Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -96,39 +96,7 @@ public class JpaToscaServiceTemplateTest {
         tst.setTopologyTemplate(ttt);
         assertEquals(ttt, tst.getTopologyTemplate());
 
-        JpaToscaServiceTemplate tttClone0 = new JpaToscaServiceTemplate(tst);
-        assertEquals(tst, tttClone0);
-        assertEquals(0, tst.compareTo(tttClone0));
-
-        JpaToscaServiceTemplate tttClone1 = new JpaToscaServiceTemplate(tst);
-        assertEquals(tst, tttClone1);
-        assertEquals(0, tst.compareTo(tttClone1));
-
-        assertEquals(-1, tst.compareTo(null));
-        assertEquals(0, tst.compareTo(tst));
-        assertNotEquals(0, tst.compareTo(tst.getKey()));
-
-        PfConceptKey otherDtKey = new PfConceptKey("otherDt", VERSION_001);
-        JpaToscaServiceTemplate otherDt = new JpaToscaServiceTemplate(otherDtKey);
-
-        assertNotEquals(0, tst.compareTo(otherDt));
-        otherDt.setKey(tstKey);
-        assertNotEquals(0, tst.compareTo(otherDt));
-        otherDt.setToscaDefinitionsVersion("Tosca Version");
-        assertNotEquals(0, tst.compareTo(otherDt));
-        otherDt.setDataTypes(dataTypes);
-        assertNotEquals(0, tst.compareTo(otherDt));
-        otherDt.setPolicyTypes(policyTypes);
-        assertNotEquals(0, tst.compareTo(otherDt));
-        otherDt.setTopologyTemplate(ttt);
-        assertEquals(0, tst.compareTo(otherDt));
-
-        assertEquals(6, tst.getKeys().size());
-        assertEquals(1, new JpaToscaServiceTemplate().getKeys().size());
-
-        new JpaToscaServiceTemplate().clean();
-        tst.clean();
-        assertEquals(tttClone0, tst);
+        assertCloneAndCopies(tstKey, tst, dataTypes, policyTypes, ttt);
 
         assertTrue(new JpaToscaServiceTemplate().validate("").isValid());
         assertTrue(tst.validate("").isValid());
@@ -146,7 +114,7 @@ public class JpaToscaServiceTemplateTest {
         BeanValidationResult result = tst.validate("");
         assertThat(result.getResult()).contains("tosca_definitions_version").contains(Validated.IS_NULL);
 
-        tst.setToscaDefinitionsVersion(JpaToscaServiceTemplate.DEFAULT_TOSCA_DEFINTIONS_VERISON);
+        tst.setToscaDefinitionsVersion(JpaToscaServiceTemplate.DEFAULT_TOSCA_DEFINITIONS_VERSION);
         tst.setDataTypes(null);
         result = tst.validate("");
         assertTrue(result.isValid());
@@ -160,6 +128,19 @@ public class JpaToscaServiceTemplateTest {
         JpaToscaProperty prop0 = new JpaToscaProperty(new PfReferenceKey(pt0.getKey(), "prop0"));
         prop0.setType(dt0.getKey());
 
+        assertDataTypesAndToscaTopology(tst, pt0, dt0, prop0);
+
+        tst.setPolicyTypes(null);
+        result = tst.validate("");
+        assertTrue(result.isValid());
+
+        assertNoPolicyType(tst, policyTypes, pt0, dt0);
+
+    }
+
+    private static void assertDataTypesAndToscaTopology(JpaToscaServiceTemplate tst, JpaToscaPolicyType pt0,
+                                                        JpaToscaDataType dt0, JpaToscaProperty prop0) {
+        BeanValidationResult result;
         pt0.setProperties(new LinkedHashMap<>());
         pt0.getProperties().put(prop0.getKey().getLocalName(), prop0);
         result = tst.validate("");
@@ -191,11 +172,49 @@ public class JpaToscaServiceTemplateTest {
         tst.getTopologyTemplate().setPolicies(new JpaToscaPolicies());
         result = tst.validate("");
         assertTrue(result.isValid());
+    }
 
-        tst.setPolicyTypes(null);
-        result = tst.validate("");
-        assertTrue(result.isValid());
+    private static void assertCloneAndCopies(PfConceptKey tstKey, JpaToscaServiceTemplate tst,
+                                             JpaToscaDataTypes dataTypes, JpaToscaPolicyTypes policyTypes,
+                                             JpaToscaTopologyTemplate ttt) {
+        JpaToscaServiceTemplate tttClone0 = new JpaToscaServiceTemplate(tst);
+        assertEquals(tst, tttClone0);
+        assertEquals(0, tst.compareTo(tttClone0));
+
+        JpaToscaServiceTemplate tttClone1 = new JpaToscaServiceTemplate(tst);
+        assertEquals(tst, tttClone1);
+        assertEquals(0, tst.compareTo(tttClone1));
+
+        assertEquals(-1, tst.compareTo(null));
+        assertEquals(0, tst.compareTo(tst));
+        assertNotEquals(0, tst.compareTo(tst.getKey()));
+
+        PfConceptKey otherDtKey = new PfConceptKey("otherDt", VERSION_001);
+        JpaToscaServiceTemplate otherDt = new JpaToscaServiceTemplate(otherDtKey);
+
+        assertNotEquals(0, tst.compareTo(otherDt));
+        otherDt.setKey(tstKey);
+        assertNotEquals(0, tst.compareTo(otherDt));
+        otherDt.setToscaDefinitionsVersion("Tosca Version");
+        assertNotEquals(0, tst.compareTo(otherDt));
+        otherDt.setDataTypes(dataTypes);
+        assertNotEquals(0, tst.compareTo(otherDt));
+        otherDt.setPolicyTypes(policyTypes);
+        assertNotEquals(0, tst.compareTo(otherDt));
+        otherDt.setTopologyTemplate(ttt);
+        assertEquals(0, tst.compareTo(otherDt));
+
+        assertEquals(6, tst.getKeys().size());
+        assertEquals(1, new JpaToscaServiceTemplate().getKeys().size());
+
+        new JpaToscaServiceTemplate().clean();
+        tst.clean();
+        assertEquals(tttClone0, tst);
+    }
 
+    private static void assertNoPolicyType(JpaToscaServiceTemplate tst, JpaToscaPolicyTypes policyTypes,
+                                           JpaToscaPolicyType pt0, JpaToscaDataType dt0) {
+        BeanValidationResult result;
         JpaToscaPolicy pol0 = new JpaToscaPolicy(new PfConceptKey("pol0:0.0.1"));
         tst.getTopologyTemplate().getPolicies().getConceptMap().put(pol0.getKey(), pol0);
         result = tst.validate("");
@@ -239,6 +258,5 @@ public class JpaToscaServiceTemplateTest {
         assertFalse(result.isValid());
         assertThat(result.getResult()).contains(
                 "no policy types are defined on the service template for the policies in the topology template");
-
     }
 }
diff --git a/pom.xml b/pom.xml
index 38d4bd4..d163e52 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -2,7 +2,7 @@
 <!--
   ============LICENSE_START=======================================================
    Copyright (C) 2018 Ericsson. All rights reserved.
-   Copyright (C) 2019-2020,2022-2023 Nordix Foundation.
+   Copyright (C) 2019-2020, 2022-2023 Nordix Foundation.
    Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
    Modifications Copyright (C) 2020 Bell Canada.
   ================================================================================
   ============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 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>
         <groupId>org.onap.policy.parent</groupId>
         <artifactId>integration</artifactId>
-        <version>4.0.0-SNAPSHOT</version>
+        <version>4.0.1-SNAPSHOT</version>
         <relativePath />
     </parent>
 
     <groupId>org.onap.policy.models</groupId>
     <artifactId>policy-models</artifactId>
-    <version>3.0.0-SNAPSHOT</version>
+    <version>3.0.1-SNAPSHOT</version>
 
     <packaging>pom</packaging>
     <name>policy-models</name>
     <description>This repo holds model code agnostic to PDP engines</description>
 
     <properties>
-        <policy.common.version>2.0.0-SNAPSHOT</policy.common.version>
+        <policy.common.version>2.0.1-SNAPSHOT</policy.common.version>
     </properties>
 
     <modules>
         <dependency>
             <groupId>org.onap.policy.common</groupId>
             <artifactId>utils</artifactId>
+            <version>${policy.common.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.slf4j</groupId>
             <artifactId>slf4j-api</artifactId>
         </dependency>
-
         <dependency>
             <groupId>ch.qos.logback</groupId>
             <artifactId>logback-core</artifactId>
             <artifactId>snakeyaml</artifactId>
         </dependency>
 
-        <dependency>
-            <groupId>javax.ws.rs</groupId>
-            <artifactId>javax.ws.rs-api</artifactId>
-        </dependency>
-
         <dependency>
             <groupId>org.mariadb.jdbc</groupId>
             <artifactId>mariadb-java-client</artifactId>
         </dependency>
 
         <dependency>
-            <groupId>org.hibernate.javax.persistence</groupId>
-            <artifactId>hibernate-jpa-2.1-api</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.hibernate</groupId>
-            <artifactId>hibernate-entitymanager</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <scope>test</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>org.assertj</groupId>
-            <artifactId>assertj-core</artifactId>
-            <scope>test</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>org.onap.policy.common</groupId>
-            <artifactId>utils-test</artifactId>
-            <version>${policy.common.version}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>com.openpojo</groupId>
-            <artifactId>openpojo</artifactId>
-            <scope>test</scope>
+            <groupId>jakarta.ws.rs</groupId>
+            <artifactId>jakarta.ws.rs-api</artifactId>
         </dependency>
 
         <dependency>
             <groupId>org.glassfish.jersey.inject</groupId>
             <artifactId>jersey-hk2</artifactId>
+            <version>${version.jersey}</version>
         </dependency>
         <dependency>
             <groupId>org.eclipse.jetty</groupId>
         <dependency>
             <groupId>org.eclipse.jetty</groupId>
             <artifactId>jetty-servlet</artifactId>
+            <version>${version.jetty}</version>
         </dependency>
         <dependency>
             <groupId>org.glassfish.jersey.containers</groupId>
             <version>${version.jersey}</version>
         </dependency>
         <dependency>
-            <groupId>org.apache.httpcomponents</groupId>
-            <artifactId>httpclient</artifactId>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.mockito</groupId>
+            <artifactId>mockito-core</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.assertj</groupId>
+            <artifactId>assertj-core</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.openpojo</groupId>
+            <artifactId>openpojo</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.httpcomponents.client5</groupId>
+            <artifactId>httpclient5</artifactId>
         </dependency>
         <dependency>
             <groupId>org.apache.commons</groupId>
index 4ba0a9a..3288dcd 100644 (file)
@@ -4,7 +4,7 @@
 
 minor=3
 minor=0
-patch=0
+patch=1
 
 base_version=${major}.${minor}.${patch}