diff options
author | FrancescoFioraEst <francesco.fiora@est.tech> | 2023-08-30 14:57:10 +0100 |
---|---|---|
committer | FrancescoFioraEst <francesco.fiora@est.tech> | 2023-09-01 13:36:40 +0100 |
commit | b2d624d4655fa4b4e0cebbf7e41dc96b38fa0df5 (patch) | |
tree | b978965fb8469ae9499d1e3d6d2e18c53aa71a37 /controlloop/common/feature-controlloop-trans | |
parent | d7d54fef032a2ba3118232506a7ed37f24eb4131 (diff) |
Upgrade Java 17 in policy-drools-apps
Issue-ID: POLICY-4816
Change-Id: I456cacfd700fd4613e2b752d9766788858e0c67b
Signed-off-by: FrancescoFioraEst <francesco.fiora@est.tech>
Diffstat (limited to 'controlloop/common/feature-controlloop-trans')
4 files changed, 24 insertions, 26 deletions
diff --git a/controlloop/common/feature-controlloop-trans/pom.xml b/controlloop/common/feature-controlloop-trans/pom.xml index e86084a3d..1f8a37aa1 100644 --- a/controlloop/common/feature-controlloop-trans/pom.xml +++ b/controlloop/common/feature-controlloop-trans/pom.xml @@ -26,7 +26,7 @@ <parent> <groupId>org.onap.policy.drools-applications.controlloop.common</groupId> <artifactId>drools-applications-common</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.1-SNAPSHOT</version> </parent> <artifactId>feature-controlloop-trans</artifactId> @@ -84,6 +84,7 @@ <plugin> <groupId>io.swagger.codegen.v3</groupId> <artifactId>swagger-codegen-maven-plugin</artifactId> + <version>3.0.46</version> <executions> <execution> <id>code-gen</id> @@ -100,7 +101,7 @@ <generateSupportingFiles>false</generateSupportingFiles> <sortParamsByRequiredFlag>false</sortParamsByRequiredFlag> <importMappings> - Response=javax.ws.rs.core.Response + Response=jakarta.ws.rs.core.Response </importMappings> <typeMappings> <typeMapping>Integer=int</typeMapping> @@ -111,6 +112,7 @@ <sourceFolder>src/gen/java</sourceFolder> <dateLibrary>java11</dateLibrary> <interfaceOnly>true</interfaceOnly> + <jakarta>true</jakarta> </configOptions> </configuration> </execution> diff --git a/controlloop/common/feature-controlloop-trans/src/main/java/org/onap/policy/drools/apps/controlloop/feature/trans/CacheBasedControlLoopMetricsManager.java b/controlloop/common/feature-controlloop-trans/src/main/java/org/onap/policy/drools/apps/controlloop/feature/trans/CacheBasedControlLoopMetricsManager.java index 66a975024..93f204df3 100644 --- a/controlloop/common/feature-controlloop-trans/src/main/java/org/onap/policy/drools/apps/controlloop/feature/trans/CacheBasedControlLoopMetricsManager.java +++ b/controlloop/common/feature-controlloop-trans/src/main/java/org/onap/policy/drools/apps/controlloop/feature/trans/CacheBasedControlLoopMetricsManager.java @@ -3,6 +3,7 @@ * ONAP * ================================================================================ * Copyright (C) 2019-2022 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. @@ -166,16 +167,10 @@ class CacheBasedControlLoopMetricsManager implements ControlLoopMetrics { setNotificationValues(controller, notification); switch (notification.getNotification()) { - case REJECTED: - case FINAL_FAILURE: - case FINAL_SUCCESS: - case FINAL_OPENLOOP: + case REJECTED, FINAL_FAILURE, FINAL_SUCCESS, FINAL_OPENLOOP: endTransaction(controller, notification); break; - case ACTIVE: - case OPERATION: - case OPERATION_SUCCESS: - case OPERATION_FAILURE: + case ACTIVE, OPERATION, OPERATION_SUCCESS, OPERATION_FAILURE: /* any other value is an in progress transaction */ inProgressTransaction(notification); break; @@ -358,14 +353,14 @@ class CacheBasedControlLoopMetricsManager implements ControlLoopMetrics { .setEndTime(notification.getNotificationTime().toInstant()); switch (notification.getNotification()) { - case FINAL_OPENLOOP: - /* fall through */ - case FINAL_SUCCESS: + case FINAL_OPENLOOP, + /* fall through */ + FINAL_SUCCESS: trans.setStatusCode(true); break; - case FINAL_FAILURE: - /* fall through */ - case REJECTED: + case FINAL_FAILURE, + /* fall through */ + REJECTED: trans.setStatusCode(false); break; default: diff --git a/controlloop/common/feature-controlloop-trans/src/main/java/org/onap/policy/drools/server/restful/RestTransactionTracker.java b/controlloop/common/feature-controlloop-trans/src/main/java/org/onap/policy/drools/server/restful/RestTransactionTracker.java index be4f1b69f..d6d8d1aec 100644 --- a/controlloop/common/feature-controlloop-trans/src/main/java/org/onap/policy/drools/server/restful/RestTransactionTracker.java +++ b/controlloop/common/feature-controlloop-trans/src/main/java/org/onap/policy/drools/server/restful/RestTransactionTracker.java @@ -21,15 +21,15 @@ package org.onap.policy.drools.server.restful; +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.core.MediaType; +import jakarta.ws.rs.core.Response; import java.util.UUID; -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.core.MediaType; -import javax.ws.rs.core.Response; import org.onap.policy.common.endpoints.http.server.YamlMessageBodyHandler; import org.onap.policy.controlloop.VirtualControlLoopNotification; import org.onap.policy.drools.apps.controlloop.feature.trans.ControlLoopMetricsManager; diff --git a/controlloop/common/feature-controlloop-trans/src/test/java/org/onap/policy/drools/server/restful/RestTransactionTrackerTest.java b/controlloop/common/feature-controlloop-trans/src/test/java/org/onap/policy/drools/server/restful/RestTransactionTrackerTest.java index 02842da65..7fed8f312 100644 --- a/controlloop/common/feature-controlloop-trans/src/test/java/org/onap/policy/drools/server/restful/RestTransactionTrackerTest.java +++ b/controlloop/common/feature-controlloop-trans/src/test/java/org/onap/policy/drools/server/restful/RestTransactionTrackerTest.java @@ -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. @@ -25,10 +26,10 @@ import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; +import jakarta.ws.rs.client.Entity; +import jakarta.ws.rs.core.Response; import java.util.Collections; import java.util.List; -import javax.ws.rs.client.Entity; -import javax.ws.rs.core.Response; import org.jetbrains.annotations.NotNull; import org.junit.AfterClass; import org.junit.BeforeClass; |