From a7f3568a39c7d12859a55e0c76c452e0d3f1938b Mon Sep 17 00:00:00 2001 From: mpriyank Date: Wed, 28 Feb 2024 14:10:54 +0000 Subject: Revert Spring Boot Uplift - reverting back to spring 3.1.2 - manual changes to revert as other apps not fully ready for the delivery Issue-ID: CPS-2133 Change-Id: I670b67916fa4a5d4e5bced6548b7fcd5ee12e855 Signed-off-by: mpriyank --- cps-application/pom.xml | 12 ++++++++++ cps-application/src/main/resources/application.yml | 2 +- cps-dependencies/pom.xml | 26 +++++++++++++++++++--- .../cps-ncmp-rest-stub-service/pom.xml | 8 +++++++ cps-ncmp-rest/lombok.config | 3 +-- .../rest/controller/NetworkCmProxyController.java | 3 --- cps-ncmp-service/lombok.config | 3 +-- .../api/impl/NetworkCmProxyDataServiceImpl.java | 3 --- .../embeddedcache/TrustLevelCacheConfig.java | 8 ++----- .../api/impl/inventory/CmHandleQueriesImpl.java | 6 ----- .../api/impl/trustlevel/TrustLevelManager.java | 6 ----- .../dmiavailability/DmiPluginWatchDog.java | 5 ----- cps-parent/pom.xml | 2 +- cps-ri/pom.xml | 2 +- .../spi/impl/CpsModulePersistenceServiceImpl.java | 5 ++--- cps-service/pom.xml | 5 +++++ .../dmi-plugin-demo-and-csit-stub-app/pom.xml | 10 +++++++++ .../stub/controller/DmiRestStubController.java | 4 ++-- 18 files changed, 69 insertions(+), 44 deletions(-) diff --git a/cps-application/pom.xml b/cps-application/pom.xml index 871b92980b..fd43da44f8 100644 --- a/cps-application/pom.xml +++ b/cps-application/pom.xml @@ -69,6 +69,18 @@ org.springdoc springdoc-openapi-starter-webmvc-ui + + org.eclipse.jetty + jetty-server + + + org.eclipse.jetty + jetty-http + + + jakarta.servlet + jakarta.servlet-api + io.micrometer micrometer-registry-prometheus diff --git a/cps-application/src/main/resources/application.yml b/cps-application/src/main/resources/application.yml index 207341ccde..9f03fc2708 100644 --- a/cps-application/src/main/resources/application.yml +++ b/cps-application/src/main/resources/application.yml @@ -64,7 +64,7 @@ spring: liquibase: change-log: classpath:changelog/changelog-master.yaml - label-filter: ${LIQUIBASE_LABELS} + labels: ${LIQUIBASE_LABELS} servlet: multipart: diff --git a/cps-dependencies/pom.xml b/cps-dependencies/pom.xml index e1e7caa9eb..032b7ec264 100644 --- a/cps-dependencies/pom.xml +++ b/cps-dependencies/pom.xml @@ -85,7 +85,7 @@ org.springframework.boot spring-boot-dependencies - 3.2.2 + 3.1.2 pom import @@ -96,6 +96,11 @@ pom import + + org.springframework + spring-test + 6.0.11 + io.springfox springfox-boot-starter @@ -167,8 +172,8 @@ io.hypersistence - hypersistence-utils-hibernate-63 - 3.7.3 + hypersistence-utils-hibernate-60 + 3.5.0 io.micrometer @@ -210,6 +215,16 @@ groovy ${groovy.version} + + org.eclipse.jetty + jetty-server + ${jetty-version} + + + org.eclipse.jetty + jetty-http + ${jetty-version} + org.codehaus.janino janino @@ -225,6 +240,11 @@ annotations 22.0.0 + + org.junit.jupiter + junit-jupiter-api + 5.10.0 + org.liquibase liquibase-core diff --git a/cps-ncmp-rest-stub/cps-ncmp-rest-stub-service/pom.xml b/cps-ncmp-rest-stub/cps-ncmp-rest-stub-service/pom.xml index 480c28e79f..a21f96138f 100644 --- a/cps-ncmp-rest-stub/cps-ncmp-rest-stub-service/pom.xml +++ b/cps-ncmp-rest-stub/cps-ncmp-rest-stub-service/pom.xml @@ -46,6 +46,14 @@ org.onap.cps cps-ncmp-rest + + org.eclipse.jetty + jetty-server + + + jakarta.servlet + jakarta.servlet-api + org.spockframework diff --git a/cps-ncmp-rest/lombok.config b/cps-ncmp-rest/lombok.config index e4122df33c..041897443e 100644 --- a/cps-ncmp-rest/lombok.config +++ b/cps-ncmp-rest/lombok.config @@ -17,5 +17,4 @@ # ============LICENSE_END========================================================= config.stopBubbling = true -lombok.addLombokGeneratedAnnotation = true -lombok.copyableAnnotations += org.springframework.beans.factory.annotation.Qualifier +lombok.addLombokGeneratedAnnotation = true \ No newline at end of file diff --git a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java index 73bd8d72b0..6ec24448d7 100755 --- a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java +++ b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java @@ -39,7 +39,6 @@ import java.util.stream.Collectors; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.onap.cps.ncmp.api.NetworkCmProxyDataService; -import org.onap.cps.ncmp.api.impl.config.embeddedcache.TrustLevelCacheConfig; import org.onap.cps.ncmp.api.impl.exception.InvalidDatastoreException; import org.onap.cps.ncmp.api.impl.inventory.CompositeState; import org.onap.cps.ncmp.api.impl.operations.DatastoreType; @@ -63,7 +62,6 @@ import org.onap.cps.ncmp.rest.model.RestOutputCmHandlePublicProperties; import org.onap.cps.ncmp.rest.util.DeprecationHelper; import org.onap.cps.spi.model.ModuleDefinition; import org.onap.cps.utils.JsonObjectMapper; -import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.util.StringUtils; @@ -85,7 +83,6 @@ public class NetworkCmProxyController implements NetworkCmProxyApi { private final NcmpCachedResourceRequestHandler ncmpCachedResourceRequestHandler; private final NcmpPassthroughResourceRequestHandler ncmpPassthroughResourceRequestHandler; private final DataOperationRequestMapper dataOperationRequestMapper; - @Qualifier(TrustLevelCacheConfig.TRUST_LEVEL_PER_CM_HANDLE_BEAN_NAME) private final Map trustLevelPerCmHandle; /** diff --git a/cps-ncmp-service/lombok.config b/cps-ncmp-service/lombok.config index 6776ef0f51..359519ca70 100644 --- a/cps-ncmp-service/lombok.config +++ b/cps-ncmp-service/lombok.config @@ -17,5 +17,4 @@ # ============LICENSE_END========================================================= config.stopBubbling = true -lombok.addLombokGeneratedAnnotation = true -lombok.copyableAnnotations += org.springframework.beans.factory.annotation.Qualifier +lombok.addLombokGeneratedAnnotation = true \ No newline at end of file diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImpl.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImpl.java index ab83486bd7..08afde49a1 100755 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImpl.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImpl.java @@ -51,7 +51,6 @@ import org.apache.commons.lang3.StringUtils; import org.onap.cps.api.CpsDataService; import org.onap.cps.ncmp.api.NetworkCmProxyCmHandleQueryService; import org.onap.cps.ncmp.api.NetworkCmProxyDataService; -import org.onap.cps.ncmp.api.impl.config.embeddedcache.TrustLevelCacheConfig; import org.onap.cps.ncmp.api.impl.events.lcm.LcmEventsCmHandleStateHandler; import org.onap.cps.ncmp.api.impl.inventory.CmHandleQueries; import org.onap.cps.ncmp.api.impl.inventory.CmHandleState; @@ -85,7 +84,6 @@ import org.onap.cps.spi.exceptions.DataValidationException; import org.onap.cps.spi.model.ModuleDefinition; import org.onap.cps.spi.model.ModuleReference; import org.onap.cps.utils.JsonObjectMapper; -import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Service; @@ -104,7 +102,6 @@ public class NetworkCmProxyDataServiceImpl implements NetworkCmProxyDataService private final LcmEventsCmHandleStateHandler lcmEventsCmHandleStateHandler; private final CpsDataService cpsDataService; private final IMap moduleSyncStartedOnCmHandles; - @Qualifier(TrustLevelCacheConfig.TRUST_LEVEL_PER_DMI_PLUGIN_BEAN_NAME) private final Map trustLevelPerDmiPlugin; private final TrustLevelManager trustLevelManager; private final AlternateIdChecker alternateIdChecker; diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/config/embeddedcache/TrustLevelCacheConfig.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/config/embeddedcache/TrustLevelCacheConfig.java index f12cc9c822..171db52998 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/config/embeddedcache/TrustLevelCacheConfig.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/config/embeddedcache/TrustLevelCacheConfig.java @@ -30,10 +30,6 @@ import org.springframework.context.annotation.Configuration; @Configuration public class TrustLevelCacheConfig extends HazelcastCacheConfig { - public static final String TRUST_LEVEL_PER_DMI_PLUGIN_BEAN_NAME = "trustLevelPerDmiPlugin"; - - public static final String TRUST_LEVEL_PER_CM_HANDLE_BEAN_NAME = "trustLevelPerCmHandle"; - private static final MapConfig trustLevelPerCmHandleCacheConfig = createMapConfig("trustLevelPerCmHandleCacheConfig"); @@ -45,7 +41,7 @@ public class TrustLevelCacheConfig extends HazelcastCacheConfig { * * @return configured map of cm handle name as keys to trust-level for values. */ - @Bean(TRUST_LEVEL_PER_CM_HANDLE_BEAN_NAME) + @Bean public Map trustLevelPerCmHandle() { return createHazelcastInstance("hazelcastInstanceTrustLevelPerCmHandleMap", trustLevelPerCmHandleCacheConfig).getMap("trustLevelPerCmHandle"); @@ -56,7 +52,7 @@ public class TrustLevelCacheConfig extends HazelcastCacheConfig { * * @return configured map of dmi-plugin name as keys to trust-level for values. */ - @Bean(TRUST_LEVEL_PER_DMI_PLUGIN_BEAN_NAME) + @Bean public Map trustLevelPerDmiPlugin() { return createHazelcastInstance("hazelcastInstanceTrustLevelPerDmiPluginMap", trustLevelPerDmiPluginCacheConfig).getMap("trustLevelPerDmiPlugin"); diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/inventory/CmHandleQueriesImpl.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/inventory/CmHandleQueriesImpl.java index a43da294c1..2d7ad698c5 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/inventory/CmHandleQueriesImpl.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/inventory/CmHandleQueriesImpl.java @@ -34,14 +34,12 @@ import java.util.List; import java.util.Map; import java.util.stream.Collectors; import lombok.RequiredArgsConstructor; -import org.onap.cps.ncmp.api.impl.config.embeddedcache.TrustLevelCacheConfig; import org.onap.cps.ncmp.api.impl.inventory.enums.PropertyType; import org.onap.cps.ncmp.api.impl.trustlevel.TrustLevel; import org.onap.cps.spi.CpsDataPersistenceService; import org.onap.cps.spi.FetchDescendantsOption; import org.onap.cps.spi.model.DataNode; import org.onap.cps.spi.utils.CpsValidator; -import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Component; @RequiredArgsConstructor @@ -51,11 +49,7 @@ public class CmHandleQueriesImpl implements CmHandleQueries { private static final String DESCENDANT_PATH = "//"; private static final String ANCESTOR_CM_HANDLES = "/ancestor::cm-handles"; private final CpsDataPersistenceService cpsDataPersistenceService; - - @Qualifier(TrustLevelCacheConfig.TRUST_LEVEL_PER_DMI_PLUGIN_BEAN_NAME) private final Map trustLevelPerDmiPlugin; - - @Qualifier(TrustLevelCacheConfig.TRUST_LEVEL_PER_CM_HANDLE_BEAN_NAME) private final Map trustLevelPerCmHandle; private final CpsValidator cpsValidator; diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/trustlevel/TrustLevelManager.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/trustlevel/TrustLevelManager.java index 4c606a9c01..82c7204028 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/trustlevel/TrustLevelManager.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/trustlevel/TrustLevelManager.java @@ -24,12 +24,10 @@ import java.util.Collection; import java.util.Map; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.onap.cps.ncmp.api.impl.config.embeddedcache.TrustLevelCacheConfig; import org.onap.cps.ncmp.api.impl.events.avc.ncmptoclient.AvcEventPublisher; import org.onap.cps.ncmp.api.impl.inventory.InventoryPersistence; import org.onap.cps.ncmp.api.impl.operations.RequiredDmiService; import org.onap.cps.ncmp.api.impl.yangmodels.YangModelCmHandle; -import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Service; @Slf4j @@ -37,12 +35,8 @@ import org.springframework.stereotype.Service; @RequiredArgsConstructor public class TrustLevelManager { - @Qualifier(TrustLevelCacheConfig.TRUST_LEVEL_PER_CM_HANDLE_BEAN_NAME) private final Map trustLevelPerCmHandle; - - @Qualifier(TrustLevelCacheConfig.TRUST_LEVEL_PER_DMI_PLUGIN_BEAN_NAME) private final Map trustLevelPerDmiPlugin; - private final InventoryPersistence inventoryPersistence; private final AvcEventPublisher avcEventPublisher; private static final String AVC_CHANGED_ATTRIBUTE_NAME = "trustLevel"; diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/trustlevel/dmiavailability/DmiPluginWatchDog.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/trustlevel/dmiavailability/DmiPluginWatchDog.java index 78eaf3e6bf..72dc295bf3 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/trustlevel/dmiavailability/DmiPluginWatchDog.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/trustlevel/dmiavailability/DmiPluginWatchDog.java @@ -26,10 +26,8 @@ import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.onap.cps.ncmp.api.NetworkCmProxyDataService; import org.onap.cps.ncmp.api.impl.client.DmiRestClient; -import org.onap.cps.ncmp.api.impl.config.embeddedcache.TrustLevelCacheConfig; import org.onap.cps.ncmp.api.impl.trustlevel.TrustLevel; import org.onap.cps.ncmp.api.impl.trustlevel.TrustLevelManager; -import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Service; @@ -40,10 +38,7 @@ public class DmiPluginWatchDog { private final DmiRestClient dmiRestClient; private final NetworkCmProxyDataService networkCmProxyDataService; - private final TrustLevelManager trustLevelManager; - - @Qualifier(TrustLevelCacheConfig.TRUST_LEVEL_PER_DMI_PLUGIN_BEAN_NAME) private final Map trustLevelPerDmiPlugin; /** diff --git a/cps-parent/pom.xml b/cps-parent/pom.xml index 5c49cbeeeb..40cd186703 100644 --- a/cps-parent/pom.xml +++ b/cps-parent/pom.xml @@ -118,7 +118,7 @@ org.springframework.boot spring-boot-maven-plugin - 3.2.2 + 3.1.2 diff --git a/cps-ri/pom.xml b/cps-ri/pom.xml index bd99be153d..b0f3220bc4 100644 --- a/cps-ri/pom.xml +++ b/cps-ri/pom.xml @@ -71,7 +71,7 @@ io.hypersistence - hypersistence-utils-hibernate-63 + hypersistence-utils-hibernate-60 org.projectlombok diff --git a/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsModulePersistenceServiceImpl.java b/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsModulePersistenceServiceImpl.java index b449a789b0..b0f9a2da52 100755 --- a/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsModulePersistenceServiceImpl.java +++ b/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsModulePersistenceServiceImpl.java @@ -69,7 +69,6 @@ import org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource; import org.opendaylight.yangtools.yang.parser.api.YangSyntaxErrorException; import org.opendaylight.yangtools.yang.parser.rfc7950.repo.YangModelDependencyInfo; import org.springframework.dao.DataIntegrityViolationException; -import org.springframework.retry.RetryContext; import org.springframework.retry.annotation.Backoff; import org.springframework.retry.annotation.Retryable; import org.springframework.retry.support.RetrySynchronizationManager; @@ -278,8 +277,8 @@ public class CpsModulePersistenceServiceImpl implements CpsModulePersistenceServ dataIntegrityViolationException, newYangResourceEntities); convertedException.ifPresent( e -> { - final RetryContext context = RetrySynchronizationManager.getContext(); - int retryCount = context == null ? 0 : context.getRetryCount(); + int retryCount = RetrySynchronizationManager.getContext() == null ? 0 + : RetrySynchronizationManager.getContext().getRetryCount(); log.warn("Cannot persist duplicated yang resource. System will attempt this method " + "up to 5 times. Current retry count : {}", ++retryCount, e); }); diff --git a/cps-service/pom.xml b/cps-service/pom.xml index fdc8177e44..0da2b3ab81 100644 --- a/cps-service/pom.xml +++ b/cps-service/pom.xml @@ -141,6 +141,11 @@ cloudevents-spring + + org.springframework + spring-test + test + org.codehaus.groovy groovy diff --git a/dmi-plugin-demo-and-csit-stub/dmi-plugin-demo-and-csit-stub-app/pom.xml b/dmi-plugin-demo-and-csit-stub/dmi-plugin-demo-and-csit-stub-app/pom.xml index fffce8d05d..0637c30a91 100644 --- a/dmi-plugin-demo-and-csit-stub/dmi-plugin-demo-and-csit-stub-app/pom.xml +++ b/dmi-plugin-demo-and-csit-stub/dmi-plugin-demo-and-csit-stub-app/pom.xml @@ -103,5 +103,15 @@ dmi-plugin-demo-and-csit-stub-service ${project.version} + + org.eclipse.jetty + jetty-server + 11.0.16 + + + jakarta.servlet + jakarta.servlet-api + 6.0.0 + \ No newline at end of file diff --git a/dmi-plugin-demo-and-csit-stub/dmi-plugin-demo-and-csit-stub-service/src/main/java/org/onap/cps/ncmp/dmi/rest/stub/controller/DmiRestStubController.java b/dmi-plugin-demo-and-csit-stub/dmi-plugin-demo-and-csit-stub-service/src/main/java/org/onap/cps/ncmp/dmi/rest/stub/controller/DmiRestStubController.java index 1819dcc47b..9d5e383b1c 100644 --- a/dmi-plugin-demo-and-csit-stub/dmi-plugin-demo-and-csit-stub-service/src/main/java/org/onap/cps/ncmp/dmi/rest/stub/controller/DmiRestStubController.java +++ b/dmi-plugin-demo-and-csit-stub/dmi-plugin-demo-and-csit-stub-service/src/main/java/org/onap/cps/ncmp/dmi/rest/stub/controller/DmiRestStubController.java @@ -89,7 +89,7 @@ public class DmiRestStubController { * @return ResponseEntity response entity having module response as json string. */ @PostMapping("/v1/ch/{cmHandleId}/modules") - public ResponseEntity getModuleReferences(@PathVariable("cmHandleId") final String cmHandleId, + public ResponseEntity getModuleReferences(@PathVariable final String cmHandleId, @RequestBody final Object moduleReferencesRequest) { delay(moduleReferencesDelayMs); final String moduleResponseContent = getModuleResourceResponse(cmHandleId, @@ -108,7 +108,7 @@ public class DmiRestStubController { */ @PostMapping("/v1/ch/{cmHandleId}/moduleResources") public ResponseEntity retrieveModuleResources( - @PathVariable("cmHandleId") final String cmHandleId, + @PathVariable final String cmHandleId, @RequestBody final Object moduleResourcesReadRequest) { delay(moduleResourcesDelayMs); final String moduleResourcesResponseContent = getModuleResourceResponse(cmHandleId, -- cgit 1.2.3-korg