From 43aeebfba2e83b5a10b1988074f15e677db23f9d Mon Sep 17 00:00:00 2001 From: "Muthuramalingam, Brinda Santh(bs2796)" Date: Sat, 1 Dec 2018 19:54:07 -0500 Subject: Enable Webflux Service. Change-Id: I99bacee9b63aa788bb368dec60981bf19ea759c4 Issue-ID: CCSDK-781 Signed-off-by: Muthuramalingam, Brinda Santh(bs2796) --- ms/blueprintsprocessor/application/pom.xml | 4 ---- .../ccsdk/apps/blueprintsprocessor/SwaggerConfig.java | 8 ++++---- .../onap/ccsdk/apps/blueprintsprocessor/WebConfig.java | 9 +++++++++ .../core/api/data/BlueprintProcessorData.kt | 5 +++++ ms/blueprintsprocessor/parent/pom.xml | 15 +++++++++++++-- 5 files changed, 31 insertions(+), 10 deletions(-) diff --git a/ms/blueprintsprocessor/application/pom.xml b/ms/blueprintsprocessor/application/pom.xml index 086a9883d..4e652d50a 100644 --- a/ms/blueprintsprocessor/application/pom.xml +++ b/ms/blueprintsprocessor/application/pom.xml @@ -36,10 +36,6 @@ spring-boot-devtools runtime - - org.springframework.boot - spring-boot-starter-web - org.onap.ccsdk.apps.blueprintsprocessor diff --git a/ms/blueprintsprocessor/application/src/main/java/org/onap/ccsdk/apps/blueprintsprocessor/SwaggerConfig.java b/ms/blueprintsprocessor/application/src/main/java/org/onap/ccsdk/apps/blueprintsprocessor/SwaggerConfig.java index fc1007f76..98be9aa7d 100644 --- a/ms/blueprintsprocessor/application/src/main/java/org/onap/ccsdk/apps/blueprintsprocessor/SwaggerConfig.java +++ b/ms/blueprintsprocessor/application/src/main/java/org/onap/ccsdk/apps/blueprintsprocessor/SwaggerConfig.java @@ -20,14 +20,12 @@ package org.onap.ccsdk.apps.blueprintsprocessor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; import springfox.documentation.builders.PathSelectors; import springfox.documentation.builders.RequestHandlerSelectors; import springfox.documentation.service.ApiInfo; import springfox.documentation.service.Contact; import springfox.documentation.spi.DocumentationType; import springfox.documentation.spring.web.plugins.Docket; -import springfox.documentation.swagger2.annotations.EnableSwagger2; import java.util.Arrays; import java.util.Collections; @@ -39,8 +37,10 @@ import java.util.Set; * * @author Brinda Santh 8/13/2018 */ -@Configuration -@EnableSwagger2 +//@Configuration +//@EnableSwagger2 +@SuppressWarnings("unused") +@Deprecated public class SwaggerConfig { private static final Set DEFAULT_PRODUCES_AND_CONSUMES = new HashSet<>(Arrays.asList("application/json", diff --git a/ms/blueprintsprocessor/application/src/main/java/org/onap/ccsdk/apps/blueprintsprocessor/WebConfig.java b/ms/blueprintsprocessor/application/src/main/java/org/onap/ccsdk/apps/blueprintsprocessor/WebConfig.java index 3742f5604..796a2d794 100644 --- a/ms/blueprintsprocessor/application/src/main/java/org/onap/ccsdk/apps/blueprintsprocessor/WebConfig.java +++ b/ms/blueprintsprocessor/application/src/main/java/org/onap/ccsdk/apps/blueprintsprocessor/WebConfig.java @@ -35,4 +35,13 @@ public class WebConfig extends WebFluxConfigurationSupport { registry.addResourceHandler("/webjars/**") .addResourceLocations("classpath:/META-INF/resources/webjars/"); } + + @Override + public void addCorsMappings(CorsRegistry corsRegistry) { + corsRegistry.addMapping("/**") + .allowedOrigins("*") + .allowedMethods("*") + .allowedHeaders("DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range") + .maxAge(3600); + } } diff --git a/ms/blueprintsprocessor/modules/commons/core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/api/data/BlueprintProcessorData.kt b/ms/blueprintsprocessor/modules/commons/core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/api/data/BlueprintProcessorData.kt index adce865a3..427063e4b 100644 --- a/ms/blueprintsprocessor/modules/commons/core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/api/data/BlueprintProcessorData.kt +++ b/ms/blueprintsprocessor/modules/commons/core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/api/data/BlueprintProcessorData.kt @@ -108,6 +108,11 @@ open class Flags { open class Status { @get:ApiModelProperty(required = true) var code: Int = 200 + @get:ApiModelProperty(required = true) + var eventType: String = "EVENT-ACTION-RESPONSE" + @get:ApiModelProperty(required = true, example = "2012-04-23T18:25:43.511Z") + @get:JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'") + var timestamp: Date = Date() @get:ApiModelProperty(required = false) var errorMessage: String? = null @get:ApiModelProperty(required = true) diff --git a/ms/blueprintsprocessor/parent/pom.xml b/ms/blueprintsprocessor/parent/pom.xml index ba8e92114..3ad3fef3e 100644 --- a/ms/blueprintsprocessor/parent/pom.xml +++ b/ms/blueprintsprocessor/parent/pom.xml @@ -30,8 +30,8 @@ Blueprints Processor Parent Blueprints Processor Parent - 2.0.6.RELEASE - 5.0.10.RELEASE + 2.1.1.RELEASE + 5.1.3.RELEASE 1.3.10 1.3.10 1.0.1 @@ -96,6 +96,11 @@ + + io.grpc + grpc-core + ${grpc.version} + io.grpc grpc-netty @@ -273,6 +278,12 @@ ${kotlin.version} test + + io.grpc + grpc-testing + ${grpc.version} + test + -- cgit 1.2.3-korg