diff options
Diffstat (limited to 'prh-app-server/src/main/java')
6 files changed, 40 insertions, 0 deletions
diff --git a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/SchedulerConfig.java b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/SchedulerConfig.java index 2eb2903d..f792c0ae 100644 --- a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/SchedulerConfig.java +++ b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/SchedulerConfig.java @@ -53,6 +53,11 @@ public class SchedulerConfig extends PrhAppConfig { this.scheduledTask = scheduledTask; } + /** + * Function which have to stop tasks execution. + * + * @return response entity about status of cancellation operation + */ @ApiOperation(value = "Get response on stopping task execution") public synchronized Mono<ResponseEntity<String>> getResponseFromCancellationOfTasks() { scheduledFutureList.forEach(x -> x.cancel(false)); @@ -62,6 +67,11 @@ public class SchedulerConfig extends PrhAppConfig { ); } + /** + * Function for starting scheduling PRH workflow. + * + * @return status of operation execution: true - started, false - not started + */ @PostConstruct @ApiOperation(value = "Start task if possible") public synchronized boolean tryToStartTask() { diff --git a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/SwaggerConfig.java b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/SwaggerConfig.java index b28fb407..10bf2755 100644 --- a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/SwaggerConfig.java +++ b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/SwaggerConfig.java @@ -48,6 +48,10 @@ public class SwaggerConfig extends WebMvcConfigurationSupport { private static final String SWAGGER_UI = "swagger-ui.html"; private static final String WEBJARS = "/webjars/**"; + /** + * Swagger configuration function for hosting it next to spring http website. + * @return Docket + */ @Bean public Docket api() { return new Docket(DocumentationType.SWAGGER_2) diff --git a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/TomcatHttpConfig.java b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/TomcatHttpConfig.java index 27227251..d9b4ac52 100644 --- a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/TomcatHttpConfig.java +++ b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/TomcatHttpConfig.java @@ -32,6 +32,11 @@ import org.springframework.context.annotation.Configuration; @Configuration public class TomcatHttpConfig { + /** + * Class for setting up hosting PRH on http/https. + * + * @return ServletWebServerFactory + */ @Bean public ServletWebServerFactory servletContainer() { TomcatServletWebServerFactory tomcat = new TomcatServletWebServerFactory(); diff --git a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/controllers/HeartbeatController.java b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/controllers/HeartbeatController.java index ae5f2277..0135ef76 100644 --- a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/controllers/HeartbeatController.java +++ b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/controllers/HeartbeatController.java @@ -42,6 +42,11 @@ public class HeartbeatController { private final Logger logger = LoggerFactory.getLogger(this.getClass()); + /** + * Endpoint for checking that PRH is alive. + * + * @return HTTP Status Code + */ @RequestMapping(value = "heartbeat", method = RequestMethod.GET) @ApiOperation(value = "Returns liveness of PRH service") @ApiResponses(value = { diff --git a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/service/DmaapConsumerJsonParser.java b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/service/DmaapConsumerJsonParser.java index 255a7eb1..e46c97a5 100644 --- a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/service/DmaapConsumerJsonParser.java +++ b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/service/DmaapConsumerJsonParser.java @@ -44,6 +44,12 @@ public class DmaapConsumerJsonParser { private static final String PNF_VENDOR_NAME = "pnfVendorName"; private static final String PNF_SERIAL_NUMBER = "pnfSerialNumber"; + /** + * Extract info from string and create @see {@link org.onap.dcaegen2.services.prh.model.ConsumerDmaapModel}. + * + * @param monoMessage - results from DMaaP + * @return reactive DMaaPModel + */ public Mono<ConsumerDmaapModel> getJsonObject(Mono<String> monoMessage) { return monoMessage .flatMap(this::getJsonParserMessage) diff --git a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/ScheduledTasks.java b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/ScheduledTasks.java index 26b9e6e7..e00a606d 100644 --- a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/ScheduledTasks.java +++ b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/ScheduledTasks.java @@ -44,6 +44,13 @@ public class ScheduledTasks { private final DmaapPublisherTask dmaapProducerTask; private final AaiProducerTask aaiProducerTask; + /** + * Constructor for tasks registration in PRHWorkflow. + * + * @param dmaapConsumerTask - fist task + * @param dmaapPublisherTask - third task + * @param aaiPublisherTask - second task + */ @Autowired public ScheduledTasks(DmaapConsumerTask dmaapConsumerTask, DmaapPublisherTask dmaapPublisherTask, AaiProducerTask aaiPublisherTask) { @@ -52,6 +59,9 @@ public class ScheduledTasks { this.aaiProducerTask = aaiPublisherTask; } + /** + * Main function for scheduling prhWorkflow. + */ public void scheduleMainPrhEventTask() { logger.trace("Execution of tasks was registered"); |