diff options
author | lapentafd <francesco.lapenta@est.tech> | 2023-02-13 13:59:45 +0000 |
---|---|---|
committer | Francesco Davide Lapenta <francesco.lapenta@est.tech> | 2023-02-13 14:04:58 +0000 |
commit | 44dd8296a49937e347f6c2304bcaa09e3a67e3cc (patch) | |
tree | c8009f1a989ee9bb01c1b0a73f103474ed27c316 /controlloop/common/feature-controlloop-trans/src/main/java | |
parent | 70ddcbe8e34eda99a7e6e9f383cc78a0d6f0cbd2 (diff) |
Clean Annotations drools-applications
Added swagger extracted documentation in openapi.yaml
Issue-ID: POLICY-3465
Change-Id: Icb30dea789559b0de379ce0e5d8da3e8d9a5dac5
Signed-off-by: lapentafd <francesco.lapenta@est.tech>
Diffstat (limited to 'controlloop/common/feature-controlloop-trans/src/main/java')
-rw-r--r-- | controlloop/common/feature-controlloop-trans/src/main/java/org/onap/policy/drools/server/restful/RestTransactionTracker.java | 33 |
1 files changed, 13 insertions, 20 deletions
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 3521e9f55..be4f1b69f 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 @@ -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. @@ -20,9 +21,6 @@ package org.onap.policy.drools.server.restful; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; import java.util.UUID; import javax.ws.rs.Consumes; import javax.ws.rs.GET; @@ -43,16 +41,15 @@ import org.onap.policy.drools.apps.controlloop.feature.trans.ControlLoopMetricsM @Path("/policy/pdp/engine/controllers/transactions") @Produces({MediaType.APPLICATION_JSON, YamlMessageBodyHandler.APPLICATION_YAML}) @Consumes({MediaType.APPLICATION_JSON, YamlMessageBodyHandler.APPLICATION_YAML}) -@Api -public class RestTransactionTracker { +public class RestTransactionTracker implements PolicyApi { /** * GET transactions. */ + @Override @GET @Path("inprogress") - @ApiOperation(value = "Retrieve in-progress transactions", responseContainer = "List") public Response transactions() { return Response.status(Response.Status.OK) .entity(ControlLoopMetricsManager.getManager().getTransactions()).build(); @@ -62,11 +59,10 @@ public class RestTransactionTracker { * GET one transaction. */ + @Override @GET @Path("inprogress/{transactionId}") - @ApiOperation(value = "Retrieve an in-progress transaction", response = VirtualControlLoopNotification.class) - public Response transactionId( - @ApiParam(value = "UUID", required = true) @PathParam("transactionId") String transactionId) { + public Response transactionId(@PathParam("transactionId") String transactionId) { VirtualControlLoopNotification notification = ControlLoopMetricsManager.getManager().getTransaction(UUID.fromString(transactionId)); return Response.status((notification != null) ? Response.Status.OK : Response.Status.NOT_FOUND) @@ -77,11 +73,10 @@ public class RestTransactionTracker { * Resets the cache with a new cache size. */ + @Override @PUT @Path("cacheSize/{cacheSize}") - @ApiOperation(value = "Sets the cache size", response = Integer.class) - public Response cacheSize( - @ApiParam(value = "cache size", required = true) @PathParam("cacheSize") int cacheSize) { + public Response cacheSize1(@PathParam("cacheSize") int cacheSize) { ControlLoopMetricsManager.getManager().resetCache(cacheSize, ControlLoopMetricsManager.getManager().getTransactionTimeout()); return Response.status(Response.Status.OK) @@ -92,9 +87,9 @@ public class RestTransactionTracker { * GET the cache size. */ + @Override @GET @Path("cacheSize") - @ApiOperation(value = "Gets the cache size", response = Integer.class) public Response cacheSize() { return Response.status(Response.Status.OK) .entity(ControlLoopMetricsManager.getManager().getCacheSize()).build(); @@ -103,12 +98,10 @@ public class RestTransactionTracker { /** * Resets the cache with a new transaction timeout in seconds. */ - + @Override @PUT @Path("timeout/{timeoutSecs}") - @ApiOperation(value = "Sets the timeout in seconds", response = Integer.class) - public Response timeout( - @ApiParam(value = "timeout", required = true) @PathParam("timeoutSecs") long timeoutSecs) { + public Response timeout(@PathParam("timeoutSecs") long timeoutSecs) { ControlLoopMetricsManager.getManager().resetCache( ControlLoopMetricsManager.getManager().getCacheSize(), timeoutSecs); return Response.status(Response.Status.OK) @@ -118,12 +111,12 @@ public class RestTransactionTracker { /** * GET the cache timeout. */ - + @Override @GET @Path("timeout") - @ApiOperation(value = "Gets the cache timeout", response = Long.class) - public Response timeout() { + public Response timeout1() { return Response.status(Response.Status.OK) .entity(ControlLoopMetricsManager.getManager().getTransactionTimeout()).build(); } + } |