aboutsummaryrefslogtreecommitdiffstats
path: root/ms
diff options
context:
space:
mode:
authorMuthuramalingam, Brinda Santh(bs2796) <bs2796@att.com>2018-08-17 19:45:00 +0000
committerMuthuramalingam, Brinda Santh(bs2796) <bs2796@att.com>2018-08-20 01:18:24 +0000
commita3c9519d6aa7eb8e1f450a7d041047f2c0a5cc07 (patch)
tree8681e2b23e7eabfd2c0034c6b74b48ac17631d65 /ms
parentc9cb1ad84cc84566f85eef8f8c6351a94b2d7340 (diff)
Controller Blueprints Microservice
Restcontroller Swagger Implementation with Embeded jar for Controller Bluprints MS Change-Id: I0c0a33f0e29dad0d4aa703e3e381068b510e57d4 Issue-ID: CCSDK-468 Signed-off-by: Muthuramalingam, Brinda Santh(bs2796) <bs2796@att.com>
Diffstat (limited to 'ms')
-rw-r--r--ms/controllerblueprints/.gitignore1
-rw-r--r--ms/controllerblueprints/application/etc/logback.xml36
-rw-r--r--ms/controllerblueprints/application/opt/app/onap/config/application.properties35
-rw-r--r--ms/controllerblueprints/application/pom.xml5
-rw-r--r--ms/controllerblueprints/application/src/assembly/distribution.xml8
-rw-r--r--ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/apps/controllerblueprints/ControllerBluprintsApplication.java8
-rw-r--r--ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/apps/controllerblueprints/ControllerBluprintsFilterConfiguration.java37
-rw-r--r--ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/apps/controllerblueprints/CorsConfig.java22
-rw-r--r--ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/apps/controllerblueprints/JerseyConfiguration.java102
-rw-r--r--ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/apps/controllerblueprints/SwaggerConfig.java70
-rw-r--r--ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/apps/controllerblueprints/WebConfig.java37
-rw-r--r--ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/apps/controllerblueprints/WebMvcConfiguration.java37
-rw-r--r--ms/controllerblueprints/application/src/test/java/org/onap/ccsdk/apps/controllerblueprints/ControllerBluprintsApplicationTest.java3
-rw-r--r--ms/controllerblueprints/application/src/test/resources/application.properties45
-rw-r--r--ms/controllerblueprints/application/src/test/resources/logback.xml (renamed from ms/controllerblueprints/application/opt/app/onap/config/logback.xml)2
-rw-r--r--ms/controllerblueprints/modules/core/pom.xml58
-rw-r--r--ms/controllerblueprints/modules/resource-dict/pom.xml7
-rw-r--r--ms/controllerblueprints/modules/service/pom.xml24
-rw-r--r--ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/common/ServiceExceptionMapper.java42
-rw-r--r--ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/common/SwaggerGenerator.java24
-rw-r--r--ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ConfigModelRest.java232
-rw-r--r--ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ConfigModelRestImpl.java116
-rw-r--r--ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ModelTypeRest.java147
-rw-r--r--ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ModelTypeRestImpl.java87
-rw-r--r--ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ResourceDictionaryRest.java152
-rw-r--r--ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ResourceDictionaryRestImpl.java91
-rw-r--r--ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ServiceTemplateRest.java160
-rw-r--r--ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ServiceTemplateRestImpl.java94
-rw-r--r--ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/JerseyConfiguration.java69
-rw-r--r--ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/TestConfiguration.java36
-rw-r--r--ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ConfigModelRestTest.java4
-rw-r--r--ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ModelTypeRestTest.java3
-rw-r--r--ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ResourceDictionaryRestTest.java3
-rw-r--r--ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ServiceTemplateRestTest.java3
-rw-r--r--ms/controllerblueprints/parent/pom.xml122
35 files changed, 545 insertions, 1377 deletions
diff --git a/ms/controllerblueprints/.gitignore b/ms/controllerblueprints/.gitignore
index b808e8430..644e3b492 100644
--- a/ms/controllerblueprints/.gitignore
+++ b/ms/controllerblueprints/.gitignore
@@ -7,6 +7,7 @@
**/target-ide/*
**/target/*
**/logs/*
+**/debug-logs/*
**/tokens/*
# Added for Intellij IDEA IDE
diff --git a/ms/controllerblueprints/application/etc/logback.xml b/ms/controllerblueprints/application/etc/logback.xml
new file mode 100644
index 000000000..44e9a8a11
--- /dev/null
+++ b/ms/controllerblueprints/application/etc/logback.xml
@@ -0,0 +1,36 @@
+<!--
+ ~ Copyright © 2017-2018 AT&T Intellectual Property.
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<configuration>
+ <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+ <!-- encoders are assigned the type
+ ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
+ <encoder>
+ <pattern>%d{HH:mm:ss.SSS} %-5level %logger{100} - %msg%n</pattern>
+ </encoder>
+ </appender>
+
+
+ <logger name="org.springframework" level="info"/>
+ <logger name="org.springframework.web" level="info"/>
+ <logger name="org.hibernate" level="error"/>
+ <logger name="org.onap.ccsdk.apps" level="info"/>
+
+ <root level="warn">
+ <appender-ref ref="STDOUT"/>
+ </root>
+
+</configuration>
diff --git a/ms/controllerblueprints/application/opt/app/onap/config/application.properties b/ms/controllerblueprints/application/opt/app/onap/config/application.properties
index 202017de7..9fa8e04cf 100644
--- a/ms/controllerblueprints/application/opt/app/onap/config/application.properties
+++ b/ms/controllerblueprints/application/opt/app/onap/config/application.properties
@@ -14,43 +14,8 @@
# limitations under the License.
#
-info.build.artifact=@project.artifactId@
-info.build.name=@project.name@
-info.build.description=@project.description@
-info.build.version=@project.version@
-info.build.groupId=@project.groupId@
-logging.level.root=info
-
-server.contextPath=/
-server.servlet-path=/
-spring.jersey.application-path=/api/controller-blueprints/v1
-server.routingPath=/api
-
-mots.application.acronym=MOTS_ID
-platform.identifier=AJSC7_JERSEY
-#spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration
-
#logging.pattern.console=%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(%5p) %clr($ threadId: {PID:- }){magenta} %clr(---){faint} %clr([ hostname: %X{hostname} serviceName: %X{serviceName} version: %X{version} transactionId: %X{transactionId} requestTimeStamp: %X{requestTimestamp} responseTimeStamp: %X{responseTimestamp} duration: %X{duration}]){yellow} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n%wex
-#The max number of active threads in this pool
-server.tomcat.max-threads=200
-#The minimum number of threads always kept alive
-server.tomcat.min-Spare-Threads=25
-#The number of milliseconds before an idle thread shutsdown, unless the number of active threads are less or equal to minSpareThreads
-server.tomcat.max-idle-time=60000
-
-#for changing the tomcat port...
-#server.port=8081
-
-#Servlet context parameters
-server.context_parameters.p-name=value #context parameter with p-name as key and value as value.
-
-# make this true for AAF authentication and place cadi.properties into etc folder
-aaf.enabled=false
-
-# set to true to enable version proxy
-#ivp.enabled=false
-
logging.level.org.springframework.web=INFO
logging.level.org.hibernate.SQL=warn
logging.level.org.hibernate.type.descriptor.sql=debug
diff --git a/ms/controllerblueprints/application/pom.xml b/ms/controllerblueprints/application/pom.xml
index 18d9a9037..19fd9c72d 100644
--- a/ms/controllerblueprints/application/pom.xml
+++ b/ms/controllerblueprints/application/pom.xml
@@ -70,11 +70,6 @@
<optional>true</optional>
</dependency>
<dependency>
- <groupId>com.h2database</groupId>
- <artifactId>h2</artifactId>
- <scope>runtime</scope>
- </dependency>
- <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
diff --git a/ms/controllerblueprints/application/src/assembly/distribution.xml b/ms/controllerblueprints/application/src/assembly/distribution.xml
index adfb52d10..c58c20d78 100644
--- a/ms/controllerblueprints/application/src/assembly/distribution.xml
+++ b/ms/controllerblueprints/application/src/assembly/distribution.xml
@@ -27,14 +27,6 @@
<dependencySet>
<outputDirectory>/opt/app/onap/lib</outputDirectory>
<excludes>
- <exclude>org.slf4j:slf4j-log4j12</exclude>
- <exclude>javax.servlet:servlet-api</exclude>
- <exclude>javax.servlet:javax.servlet-api</exclude>
- <exclude>j2ee:j2ee</exclude>
- <exclude>log4j:log4j</exclude>
- <exclude>com.sun:j2ee</exclude>
- <exclude>log4j:apache-log4j-extras</exclude>
- <exclude>org.slf4j:slf4j-simple</exclude>
</excludes>
</dependencySet>
</dependencySets>
diff --git a/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/apps/controllerblueprints/ControllerBluprintsApplication.java b/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/apps/controllerblueprints/ControllerBluprintsApplication.java
index 96d82e7e4..447e1966d 100644
--- a/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/apps/controllerblueprints/ControllerBluprintsApplication.java
+++ b/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/apps/controllerblueprints/ControllerBluprintsApplication.java
@@ -16,22 +16,26 @@
package org.onap.ccsdk.apps.controllerblueprints;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
+import org.springframework.web.reactive.config.EnableWebFlux;
/**
- *
- *
* @author Brinda Santh
*/
@SpringBootApplication
+@EnableWebFlux
@ComponentScan(basePackages = {"org.onap.ccsdk.apps.controllerblueprints"})
@EnableAutoConfiguration
public class ControllerBluprintsApplication {
+ private static EELFLogger log = EELFManager.getInstance().getLogger(ControllerBluprintsApplication.class);
public static void main(String[] args) {
+ log.info("****** Starting Controller Bluprints Application **************");
SpringApplication.run(ControllerBluprintsApplication.class, args);
}
diff --git a/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/apps/controllerblueprints/ControllerBluprintsFilterConfiguration.java b/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/apps/controllerblueprints/ControllerBluprintsFilterConfiguration.java
deleted file mode 100644
index 6f4bfc988..000000000
--- a/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/apps/controllerblueprints/ControllerBluprintsFilterConfiguration.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright © 2017-2018 AT&T Intellectual Property.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.onap.ccsdk.apps.controllerblueprints;
-
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.context.annotation.Configuration;
-/**
- *
- *
- * @author Brinda Santh
- */
-@Configuration
-public class ControllerBluprintsFilterConfiguration {
- private static Logger log = LoggerFactory.getLogger(JerseyConfiguration.class);
-
- @Value("${server.routingPath:#{null}}")
- private String routingPath;
-
-
-}
diff --git a/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/apps/controllerblueprints/CorsConfig.java b/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/apps/controllerblueprints/CorsConfig.java
index 0d9ab1623..5d682ed50 100644
--- a/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/apps/controllerblueprints/CorsConfig.java
+++ b/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/apps/controllerblueprints/CorsConfig.java
@@ -1,17 +1,17 @@
/*
- * Copyright © 2017-2018 AT&T Intellectual Property.
+ * Copyright © 2017-2018 AT&T Intellectual Property.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package org.onap.ccsdk.apps.controllerblueprints;
@@ -29,7 +29,7 @@ import org.springframework.web.filter.CorsFilter;
* @author Brinda Santh
* @version 1.0
*/
-@Configuration
+//@Configuration
public class CorsConfig {
/**
* This is a CORS Implementation for different Orgin GUI to access.
diff --git a/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/apps/controllerblueprints/JerseyConfiguration.java b/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/apps/controllerblueprints/JerseyConfiguration.java
deleted file mode 100644
index a3b0faf0c..000000000
--- a/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/apps/controllerblueprints/JerseyConfiguration.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright © 2017-2018 AT&T Intellectual Property.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.onap.ccsdk.apps.controllerblueprints;
-
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.databind.DeserializationFeature;
-import com.fasterxml.jackson.databind.MapperFeature;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.SerializationFeature;
-import io.swagger.jaxrs.config.BeanConfig;
-import io.swagger.jaxrs.listing.ApiListingResource;
-import io.swagger.jaxrs.listing.SwaggerSerializers;
-import org.glassfish.jersey.server.ResourceConfig;
-import org.glassfish.jersey.servlet.ServletProperties;
-import org.onap.ccsdk.apps.controllerblueprints.service.common.ServiceExceptionMapper;
-import org.onap.ccsdk.apps.controllerblueprints.service.rs.ConfigModelRestImpl;
-import org.onap.ccsdk.apps.controllerblueprints.service.rs.ModelTypeRestImpl;
-import org.onap.ccsdk.apps.controllerblueprints.service.rs.ResourceDictionaryRestImpl;
-import org.onap.ccsdk.apps.controllerblueprints.service.rs.ServiceTemplateRestImpl;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Primary;
-import org.springframework.stereotype.Component;
-
-import javax.ws.rs.core.MediaType;
-
-/**
- *
- *
- * @author Brinda Santh
- */
-@Component
-public class JerseyConfiguration extends ResourceConfig {
- private static Logger log = LoggerFactory.getLogger(JerseyConfiguration.class);
- /**
- *
- */
- @Autowired
- public JerseyConfiguration() {
- register(ConfigModelRestImpl.class);
- register(ModelTypeRestImpl.class);
- register(ResourceDictionaryRestImpl.class);
- register(ServiceTemplateRestImpl.class);
- register(ServiceExceptionMapper.class);
- property(ServletProperties.FILTER_FORWARD_ON_404, true);
- configureSwagger();
- }
-
- /**
- *
- * @return ObjectMapper
- */
- @Bean
- @Primary
- public ObjectMapper objectMapper() {
- ObjectMapper objectMapper = new ObjectMapper();
- objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
- objectMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
- objectMapper.enable(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES);
- objectMapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING);
- objectMapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING);
- return objectMapper;
- }
-
- /**
- *
- */
- private void configureSwagger() {
- register(ApiListingResource.class);
- register(SwaggerSerializers.class);
- BeanConfig beanConfig = new BeanConfig();
- beanConfig.setVersion("1.0.0");
- beanConfig.setSchemes(new String[]{"http", "https"});
- beanConfig.setBasePath("/api/controller-blueprints/v1");
- beanConfig.setTitle("Controller Blueprints API");
- beanConfig.setDescription("Controller BluePrints API");
- beanConfig.getSwagger().addConsumes(MediaType.APPLICATION_JSON);
- beanConfig.getSwagger().addProduces(MediaType.APPLICATION_JSON);
- beanConfig.setResourcePackage("org.onap.ccsdk.apps.controllerblueprints");
- beanConfig.setPrettyPrint(true);
- beanConfig.setScan(true);
- }
-
-
-} \ No newline at end of file
diff --git a/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/apps/controllerblueprints/SwaggerConfig.java b/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/apps/controllerblueprints/SwaggerConfig.java
new file mode 100644
index 000000000..5970bafde
--- /dev/null
+++ b/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/apps/controllerblueprints/SwaggerConfig.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright © 2017-2018 AT&T Intellectual Property.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onap.ccsdk.apps.controllerblueprints;
+
+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;
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * SwaggerConfig
+ *
+ * @author Brinda Santh 8/13/2018
+ */
+@Configuration
+@EnableSwagger2
+public class SwaggerConfig {
+ private static final Set<String> DEFAULT_PRODUCES_AND_CONSUMES =
+ new HashSet<String>(Arrays.asList("application/json",
+ "application/xml"));
+ private static Logger log = LoggerFactory.getLogger(SwaggerConfig.class);
+
+ @Bean
+ public Docket api() {
+ return new Docket(DocumentationType.SWAGGER_2)
+ .select()
+ .apis(RequestHandlerSelectors.any())
+ .paths(PathSelectors.any())
+ .build()
+ .apiInfo(apiInfo());
+ }
+
+ private ApiInfo apiInfo() {
+ return new ApiInfo(
+ "Controller Blueprints API",
+ "Controller blueprints API for VNF Self Service.",
+ "1.0.0",
+ "Terms of service",
+ new Contact("Brinda Santh", "www.onap.com", "brindasanth@onap.com"),
+ "Apache 2.0", "http://www.apache.org/licenses/LICENSE-2.0", Collections.emptyList());
+ }
+
+
+}
diff --git a/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/apps/controllerblueprints/WebConfig.java b/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/apps/controllerblueprints/WebConfig.java
new file mode 100644
index 000000000..1eba97cdc
--- /dev/null
+++ b/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/apps/controllerblueprints/WebConfig.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright © 2017-2018 AT&T Intellectual Property.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onap.ccsdk.apps.controllerblueprints;
+
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.reactive.config.ResourceHandlerRegistry;
+import org.springframework.web.reactive.config.WebFluxConfigurationSupport;
+
+/**
+ * WebConfig
+ *
+ * @author Brinda Santh 8/13/2018
+ */
+@Configuration
+public class WebConfig extends WebFluxConfigurationSupport {
+ public void addResourceHandlers(ResourceHandlerRegistry registry) {
+ registry.addResourceHandler("swagger-ui.html")
+ .addResourceLocations("classpath:/META-INF/resources/");
+
+ registry.addResourceHandler("/webjars/**")
+ .addResourceLocations("classpath:/META-INF/resources/webjars/");
+ }
+}
diff --git a/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/apps/controllerblueprints/WebMvcConfiguration.java b/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/apps/controllerblueprints/WebMvcConfiguration.java
deleted file mode 100644
index a690c056c..000000000
--- a/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/apps/controllerblueprints/WebMvcConfiguration.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright © 2017-2018 AT&T Intellectual Property.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.onap.ccsdk.apps.controllerblueprints;
-
-import org.springframework.context.annotation.Configuration;
-import org.springframework.web.servlet.config.annotation.EnableWebMvc;
-import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
-import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
-
-/**
- *
- * WebMvcConfiguration WebMvcConfiguration
- * @author Brinda Santh
- */
-@Configuration
-@EnableWebMvc
-public class WebMvcConfiguration extends WebMvcConfigurerAdapter {
- @Override
- public void addResourceHandlers(ResourceHandlerRegistry registry) {
- registry.addResourceHandler("/swagger-ui/**").addResourceLocations("classpath:/swagger-ui/dist/");
- }
-
-}
diff --git a/ms/controllerblueprints/application/src/test/java/org/onap/ccsdk/apps/controllerblueprints/ControllerBluprintsApplicationTest.java b/ms/controllerblueprints/application/src/test/java/org/onap/ccsdk/apps/controllerblueprints/ControllerBluprintsApplicationTest.java
index 4bdbde008..95639bd32 100644
--- a/ms/controllerblueprints/application/src/test/java/org/onap/ccsdk/apps/controllerblueprints/ControllerBluprintsApplicationTest.java
+++ b/ms/controllerblueprints/application/src/test/java/org/onap/ccsdk/apps/controllerblueprints/ControllerBluprintsApplicationTest.java
@@ -46,9 +46,8 @@ public class ControllerBluprintsApplicationTest {
@Test
public void testConfigModel() {
-
ResponseEntity<String> entity = this.restTemplate
- .getForEntity("/api/controller-blueprints/v1/service/configmodel/1", String.class);
+ .getForEntity("/api/v1/config-model/1", String.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
}
}
diff --git a/ms/controllerblueprints/application/src/test/resources/application.properties b/ms/controllerblueprints/application/src/test/resources/application.properties
index c6057e563..55ffeaf16 100644
--- a/ms/controllerblueprints/application/src/test/resources/application.properties
+++ b/ms/controllerblueprints/application/src/test/resources/application.properties
@@ -14,51 +14,6 @@
# limitations under the License.
#
-info.build.artifact=@project.artifactId@
-info.build.name=@project.name@
-info.build.description=@project.description@
-info.build.version=@project.version@
-info.build.groupId=@project.groupId@
-logging.level.root=info
-
-server.contextPath=/
-server.servlet-path=/
-spring.jersey.application-path=/api/controller-blueprints/v1
-server.routingPath=/api
-
-mots.application.acronym=MOTS_ID
-platform.identifier=AJSC7_JERSEY
-#spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration
-
-#logging.pattern.console=%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(%5p) %clr($ threadId: {PID:- }){magenta} %clr(---){faint} %clr([ hostname: %X{hostname} serviceName: %X{serviceName} version: %X{version} transactionId: %X{transactionId} requestTimeStamp: %X{requestTimestamp} responseTimeStamp: %X{responseTimestamp} duration: %X{duration}]){yellow} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n%wex
-
-#The max number of active threads in this pool
-server.tomcat.max-threads=200
-#The minimum number of threads always kept alive
-server.tomcat.min-Spare-Threads=25
-#The number of milliseconds before an idle thread shutsdown, unless the number of active threads are less or equal to minSpareThreads
-server.tomcat.max-idle-time=60000
-
-#for changing the tomcat port...
-#server.port=8081
-
-#Servlet context parameters
-server.context_parameters.p-name=value #context parameter with p-name as key and value as value.
-
-# make this true for AAF authentication and place cadi.properties into etc folder
-aaf.enabled=false
-
-# set to true to enable version proxy
-#ivp.enabled=false
-
-logging.level.org.springframework.web=INFO
-logging.level.org.hibernate.SQL=warn
-logging.level.org.hibernate.type.descriptor.sql=debug
-
-spring.jpa.properties.hibernate.show_sql=true
-spring.jpa.properties.hibernate.use_sql_comments=true
-spring.jpa.properties.hibernate.format_sql=true
-
#Load Blueprints
# blueprints.load.initial-data may be overridden by ENV variables
blueprints.load.initial-data=true
diff --git a/ms/controllerblueprints/application/opt/app/onap/config/logback.xml b/ms/controllerblueprints/application/src/test/resources/logback.xml
index cdd20c8b1..b9b97dc89 100644
--- a/ms/controllerblueprints/application/opt/app/onap/config/logback.xml
+++ b/ms/controllerblueprints/application/src/test/resources/logback.xml
@@ -26,7 +26,7 @@
<logger name="org.springframework" level="info"/>
<logger name="org.springframework.web" level="debug"/>
- <logger name="org.hibernate" level="error"/>
+ <logger name="org.hibernate" level="info"/>
<logger name="org.onap.ccsdk.apps.controllerblueprints" level="info"/>
<root level="warn">
diff --git a/ms/controllerblueprints/modules/core/pom.xml b/ms/controllerblueprints/modules/core/pom.xml
index 0e88dd293..fc7581c8c 100644
--- a/ms/controllerblueprints/modules/core/pom.xml
+++ b/ms/controllerblueprints/modules/core/pom.xml
@@ -30,30 +30,6 @@
<dependencies>
<dependency>
- <groupId>org.jetbrains.kotlin</groupId>
- <artifactId>kotlin-stdlib</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jetbrains.kotlin</groupId>
- <artifactId>kotlin-reflect</artifactId>
- </dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.module</groupId>
- <artifactId>jackson-module-kotlin</artifactId>
- </dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-databind</artifactId>
- </dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-annotations</artifactId>
- </dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-core</artifactId>
- </dependency>
- <dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-xml</artifactId>
</dependency>
@@ -66,43 +42,9 @@
<artifactId>jackson-module-jsonSchema</artifactId>
</dependency>
<dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-lang3</artifactId>
- </dependency>
- <dependency>
- <groupId>commons-collections</groupId>
- <artifactId>commons-collections</artifactId>
- </dependency>
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- </dependency>
- <dependency>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- </dependency>
- <dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
</dependency>
- <dependency>
- <groupId>com.jayway.jsonpath</groupId>
- <artifactId>json-path</artifactId>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.jetbrains.kotlin</groupId>
- <artifactId>kotlin-test</artifactId>
- <scope>test</scope>
- </dependency>
-<!-- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-simple</artifactId>
- </dependency>-->
</dependencies>
</project>
diff --git a/ms/controllerblueprints/modules/resource-dict/pom.xml b/ms/controllerblueprints/modules/resource-dict/pom.xml
index a0d1be611..337f5512f 100644
--- a/ms/controllerblueprints/modules/resource-dict/pom.xml
+++ b/ms/controllerblueprints/modules/resource-dict/pom.xml
@@ -33,13 +33,6 @@
<groupId>org.onap.ccsdk.apps</groupId>
<artifactId>controllerblueprints-core</artifactId>
</dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
-
-
</dependencies>
diff --git a/ms/controllerblueprints/modules/service/pom.xml b/ms/controllerblueprints/modules/service/pom.xml
index 17738bf4b..b4b798e6e 100644
--- a/ms/controllerblueprints/modules/service/pom.xml
+++ b/ms/controllerblueprints/modules/service/pom.xml
@@ -37,36 +37,16 @@
<artifactId>controllerblueprints-resource-dict</artifactId>
</dependency>
<dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-lang3</artifactId>
- </dependency>
- <dependency>
- <groupId>commons-collections</groupId>
- <artifactId>commons-collections</artifactId>
- </dependency>
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- </dependency>
- <dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity</artifactId>
</dependency>
<dependency>
- <groupId>io.swagger</groupId>
- <artifactId>swagger-jersey2-jaxrs</artifactId>
- </dependency>
- <dependency>
- <groupId>org.json</groupId>
- <artifactId>json</artifactId>
- </dependency>
- <dependency>
<groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-web</artifactId>
+ <artifactId>spring-boot-starter-webflux</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-jersey</artifactId>
+ <artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
diff --git a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/common/ServiceExceptionMapper.java b/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/common/ServiceExceptionMapper.java
deleted file mode 100644
index f223dccb2..000000000
--- a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/common/ServiceExceptionMapper.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright © 2017-2018 AT&T Intellectual Property.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.onap.ccsdk.apps.controllerblueprints.service.common;
-
-import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintException;
-
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.ext.ExceptionMapper;
-import javax.ws.rs.ext.Provider;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-
-@Provider
-public class ServiceExceptionMapper implements ExceptionMapper<BluePrintException> {
-
- @Override
- public Response toResponse(BluePrintException ex) {
- ErrorMessage errorMessage = new ErrorMessage();
- errorMessage.setCode(ex.getCode());
- errorMessage.setMessage(ex.getMessage());
- StringWriter errorStackTrace = new StringWriter();
- ex.printStackTrace(new PrintWriter(errorStackTrace));
- errorMessage.setDeveloperMessage(ex.toString());
- return Response.status(500).entity(errorMessage).type(MediaType.APPLICATION_JSON).build();
- }
-
-} \ No newline at end of file
diff --git a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/common/SwaggerGenerator.java b/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/common/SwaggerGenerator.java
index e90807633..81f7d7018 100644
--- a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/common/SwaggerGenerator.java
+++ b/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/common/SwaggerGenerator.java
@@ -1,17 +1,17 @@
/*
- * Copyright © 2017-2018 AT&T Intellectual Property.
+ * Copyright © 2017-2018 AT&T Intellectual Property.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package org.onap.ccsdk.apps.controllerblueprints.service.common;
@@ -20,7 +20,6 @@ import io.swagger.models.*;
import io.swagger.models.parameters.BodyParameter;
import io.swagger.models.parameters.Parameter;
import io.swagger.models.properties.*;
-import io.swagger.util.Json;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang3.BooleanUtils;
import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintConstants;
@@ -63,8 +62,7 @@ public class SwaggerGenerator {
swagger.setDefinitions(getDefinition());
- swaggerContent = Json.pretty(swagger);
- return swaggerContent;
+ return swagger.toString();
}
private Info getInfo() {
diff --git a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ConfigModelRest.java b/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ConfigModelRest.java
index 86c89bf90..94324a808 100644
--- a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ConfigModelRest.java
+++ b/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ConfigModelRest.java
@@ -16,164 +16,112 @@
package org.onap.ccsdk.apps.controllerblueprints.service.rs;
-import io.swagger.annotations.*;
import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintException;
-import org.onap.ccsdk.apps.controllerblueprints.core.data.ServiceTemplate;
+import org.onap.ccsdk.apps.controllerblueprints.service.ConfigModelService;
import org.onap.ccsdk.apps.controllerblueprints.service.domain.ConfigModel;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.stereotype.Component;
+import org.springframework.stereotype.Service;
+import org.springframework.web.bind.annotation.*;
-import javax.ws.rs.*;
-import javax.ws.rs.core.MediaType;
import java.util.List;
/**
- * ConfigModelRest.java Purpose: Rest service controller for ConfigModelRest Management
- *
- * @author Brinda Santh
- * @version 1.0
+ * {@inheritDoc}
*/
-@Api
-@Path("/service")
-@Produces({MediaType.APPLICATION_JSON})
-public interface ConfigModelRest {
+@RestController
+@RequestMapping("/api/v1/config-model")
+public class ConfigModelRest {
- /**
- * This is a getConfigModel rest service
- *
- * @param id
- * @return ConfigModel
- * @throws BluePrintException
- */
- @GET
- @Path("/configmodel/{id}")
- @Consumes({MediaType.APPLICATION_JSON})
- @Produces({MediaType.APPLICATION_JSON})
- @ApiOperation(value = "Provides Rest service to Search Service Template", response = ConfigModel.class)
- @ApiResponses(value = {@ApiResponse(code = 404, message = "Service not available"),
- @ApiResponse(code = 500, message = "Unexpected Runtime error")})
- @RequestMapping(value = "/configmodel/{id}", method = RequestMethod.GET)
- @ResponseBody ConfigModel getConfigModel(@ApiParam(required = true) @PathParam("id") Long id)
- throws BluePrintException;
-
+ private ConfigModelService configModelService;
/**
- * This is a saveConfigModel rest service
- *
- * @param configModel
- * @return ConfigModel
- * @throws BluePrintException
+ * This is a ConfigModelRest constructor.
+ *
+ * @param configModelService Config Model Service
*/
- @POST
- @Path("/configmodel")
- @Consumes({MediaType.APPLICATION_JSON})
- @Produces({MediaType.APPLICATION_JSON})
- @ApiOperation(value = "Provides Rest service to get Model Type by Tags", response = ServiceTemplate.class)
- @ApiResponses(value = {@ApiResponse(code = 404, message = "Service not available"),
- @ApiResponse(code = 500, message = "Unexpected Runtime error")})
- ConfigModel saveConfigModel(@ApiParam(required = true) ConfigModel configModel)
- throws BluePrintException;
+ public ConfigModelRest(ConfigModelService configModelService) {
+ this.configModelService = configModelService;
- /**
- * This is a deleteConfigModel rest service
- *
- * @param id
- * @throws BluePrintException
- */
- @DELETE
- @Path("/configmodel/{id}")
- @Consumes({MediaType.APPLICATION_JSON})
- @Produces({MediaType.APPLICATION_JSON})
- @ApiOperation(value = "Provides Rest service to delete ConfigModel.")
- @ApiResponses(value = {@ApiResponse(code = 404, message = "Service not available"),
- @ApiResponse(code = 500, message = "Unexpected Runtime error")})
- void deleteConfigModel(@ApiParam(required = true) @PathParam("id") Long id) throws BluePrintException;
+ }
- /**
- * This is a getInitialConfigModel rest service
- *
- * @param name
- * @return ConfigModel
- * @throws BluePrintException
- */
- @GET
- @Path("/configmodelinitial/{name}")
- @Consumes({MediaType.APPLICATION_JSON})
- @Produces({MediaType.APPLICATION_JSON})
- @ApiOperation(value = "Provides Rest service to create default Service Template", response = ConfigModel.class)
- @ApiResponses(value = {@ApiResponse(code = 404, message = "Service not available"),
- @ApiResponse(code = 500, message = "Unexpected Runtime error")})
- ConfigModel getInitialConfigModel(@ApiParam(required = true) @PathParam("name") String name)
- throws BluePrintException;
+ @GetMapping(path = "/initial/{name}")
+ public @ResponseBody
+ ConfigModel getInitialConfigModel(@PathVariable(value = "name") String name) throws BluePrintException {
+ try {
+ return this.configModelService.getInitialConfigModel(name);
+ } catch (Exception e) {
+ throw new BluePrintException(2000, e.getMessage(), e);
+ }
+ }
- /**
- * This is a getCloneConfigModel rest service
- *
- * @param id
- * @return ConfigModel
- * @throws BluePrintException
- */
- @GET
- @Path("/configmodelclone/{id}")
- @Consumes({MediaType.APPLICATION_JSON})
- @Produces({MediaType.APPLICATION_JSON})
- @ApiOperation(value = "Provides Rest service to create default Service Template", response = ConfigModel.class)
- @ApiResponses(value = {@ApiResponse(code = 404, message = "Service not available"),
- @ApiResponse(code = 500, message = "Unexpected Runtime error")})
- ConfigModel getCloneConfigModel(@ApiParam(required = true) @PathParam("id") Long id)
- throws BluePrintException;
+ @PostMapping(path = "/")
+ public @ResponseBody
+ ConfigModel saveConfigModel(@RequestBody ConfigModel configModel) throws BluePrintException {
+ try {
+ return this.configModelService.saveConfigModel(configModel);
+ } catch (Exception e) {
+ throw new BluePrintException(2200, e.getMessage(), e);
+ }
+ }
- /**
- * This is a publishConfigModel rest service
- *
- * @param id
- * @return ServiceTemplate
- * @throws BluePrintException
- */
- @GET
- @Path("/configmodelpublish/{id}")
- @Consumes({MediaType.APPLICATION_JSON})
- @Produces({MediaType.APPLICATION_JSON})
- @ApiOperation(value = "Provides Rest service to get Model Type by Tags", response = ConfigModel.class)
- @ApiResponses(value = {@ApiResponse(code = 404, message = "Service not available"),
- @ApiResponse(code = 500, message = "Unexpected Runtime error")})
- ConfigModel publishConfigModel(@ApiParam(required = true) @PathParam("id") Long id)
- throws BluePrintException;
+ @DeleteMapping(path = "/{id}")
+ public void deleteConfigModel(@PathVariable(value = "id") Long id) throws BluePrintException {
+ try {
+ this.configModelService.deleteConfigModel(id);
+ } catch (Exception e) {
+ throw new BluePrintException(4000, e.getMessage(), e);
+ }
+ }
- /**
- * This is a getConfigModelByNameAndVersion rest service
- *
- * @param name
- * @param version
- * @return ConfigModel
- * @throws BluePrintException
- */
- @GET
- @Path("/configmodelbyname/{name}/version/{version}")
- @Consumes({MediaType.APPLICATION_JSON})
- @Produces({MediaType.APPLICATION_JSON})
- @ApiOperation(value = "Provides Rest service to Search Service Template", response = ConfigModel.class)
- @ApiResponses(value = {@ApiResponse(code = 404, message = "Service not available"),
- @ApiResponse(code = 500, message = "Unexpected Runtime error")})
- ConfigModel getConfigModelByNameAndVersion(@ApiParam(required = true) @PathParam("name") String name,
- @ApiParam(required = true) @PathParam("version") String version) throws BluePrintException;
+ @GetMapping(path = "/publish/{id}")
+ public @ResponseBody
+ ConfigModel publishConfigModel(@PathVariable(value = "id") Long id) throws BluePrintException {
+ try {
+ return this.configModelService.publishConfigModel(id);
+ } catch (Exception e) {
+ throw new BluePrintException(2500, e.getMessage(), e);
+ }
+ }
- /**
- * This is a searchServiceModels rest service
- *
- * @param tags
- * @return List<ConfigModel>
- * @throws BluePrintException
- */
- @GET
- @Path("/configmodelsearch/{tags}")
- @Consumes({MediaType.APPLICATION_JSON})
- @Produces({MediaType.APPLICATION_JSON})
- @ApiOperation(value = "Provides Rest service to Search Service Template", response = ConfigModel.class)
- @ApiResponses(value = {@ApiResponse(code = 404, message = "Service not available"),
- @ApiResponse(code = 500, message = "Unexpected Runtime error")})
- List<ConfigModel> searchConfigModels(@ApiParam(required = true) @PathParam("tags") String tags)
- throws BluePrintException;
+ @GetMapping(path = "/{id}")
+ public @ResponseBody
+ ConfigModel getConfigModel(@PathVariable(value = "id") Long id) throws BluePrintException {
+ try {
+ return this.configModelService.getConfigModel(id);
+ } catch (Exception e) {
+ throw new BluePrintException(2001, e.getMessage(), e);
+ }
+ }
+
+ @GetMapping(path = "/by-name/{name}/version/{version}")
+ public @ResponseBody
+ ConfigModel getConfigModelByNameAndVersion(@PathVariable(value = "name") String name,
+ @PathVariable(value = "version") String version) throws BluePrintException {
+ try {
+ return this.configModelService.getConfigModelByNameAndVersion(name, version);
+ } catch (Exception e) {
+ throw new BluePrintException(2002, e.getMessage(), e);
+ }
+ }
+
+ @GetMapping(path = "/search/{tags}")
+ public @ResponseBody
+ List<ConfigModel> searchConfigModels(@PathVariable(value = "tags") String tags) throws BluePrintException {
+ try {
+ return this.configModelService.searchConfigModels(tags);
+ } catch (Exception e) {
+ throw new BluePrintException(2003, e.getMessage(), e);
+ }
+ }
+
+ @GetMapping(path = "/clone/{id}")
+ public @ResponseBody
+ ConfigModel getCloneConfigModel(@PathVariable(value = "id") Long id) throws BluePrintException {
+ try {
+ return this.configModelService.getCloneConfigModel(id);
+ } catch (Exception e) {
+ throw new BluePrintException(2004, e.getMessage(), e);
+ }
+ }
}
diff --git a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ConfigModelRestImpl.java b/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ConfigModelRestImpl.java
deleted file mode 100644
index a9abcd5ff..000000000
--- a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ConfigModelRestImpl.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Copyright © 2017-2018 AT&T Intellectual Property.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.onap.ccsdk.apps.controllerblueprints.service.rs;
-
-import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintException;
-import org.onap.ccsdk.apps.controllerblueprints.service.ConfigModelService;
-import org.onap.ccsdk.apps.controllerblueprints.service.domain.ConfigModel;
-import org.springframework.stereotype.Service;
-
-import java.util.List;
-
-/**
- * {@inheritDoc}
- */
-@Service
-public class ConfigModelRestImpl implements ConfigModelRest {
-
- private ConfigModelService configModelService;
-
- /**
- * This is a ConfigModelRestImpl constructor.
- *
- * @param configModelService Config Model Service
- */
- public ConfigModelRestImpl(ConfigModelService configModelService) {
- this.configModelService = configModelService;
-
- }
-
- @Override
- public ConfigModel getInitialConfigModel(String name) throws BluePrintException {
- try {
- return this.configModelService.getInitialConfigModel(name);
- } catch (Exception e) {
- throw new BluePrintException(2000, e.getMessage(), e);
- }
- }
-
- @Override
- public ConfigModel saveConfigModel(ConfigModel configModel) throws BluePrintException {
- try {
- return this.configModelService.saveConfigModel(configModel);
- } catch (Exception e) {
- throw new BluePrintException(2200, e.getMessage(), e);
- }
- }
-
- @Override
- public void deleteConfigModel(Long id) throws BluePrintException {
- try {
- this.configModelService.deleteConfigModel(id);
- } catch (Exception e) {
- throw new BluePrintException(4000, e.getMessage(), e);
- }
- }
-
- @Override
- public ConfigModel publishConfigModel(Long id) throws BluePrintException {
- try {
- return this.configModelService.publishConfigModel(id);
- } catch (Exception e) {
- throw new BluePrintException(2500, e.getMessage(), e);
- }
- }
-
- @Override
- public ConfigModel getConfigModel(Long id) throws BluePrintException {
- try {
- return this.configModelService.getConfigModel(id);
- } catch (Exception e) {
- throw new BluePrintException(2001, e.getMessage(), e);
- }
- }
-
- @Override
- public ConfigModel getConfigModelByNameAndVersion(String name, String version) throws BluePrintException {
- try {
- return this.configModelService.getConfigModelByNameAndVersion(name, version);
- } catch (Exception e) {
- throw new BluePrintException(2002, e.getMessage(), e);
- }
- }
-
- @Override
- public List<ConfigModel> searchConfigModels(String tags) throws BluePrintException {
- try {
- return this.configModelService.searchConfigModels(tags);
- } catch (Exception e) {
- throw new BluePrintException(2003, e.getMessage(), e);
- }
- }
-
- @Override
- public ConfigModel getCloneConfigModel(Long id) throws BluePrintException {
- try {
- return this.configModelService.getCloneConfigModel(id);
- } catch (Exception e) {
- throw new BluePrintException(2004, e.getMessage(), e);
- }
- }
-
-}
diff --git a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ModelTypeRest.java b/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ModelTypeRest.java
index 59b730309..2fa64316f 100644
--- a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ModelTypeRest.java
+++ b/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ModelTypeRest.java
@@ -16,110 +16,77 @@
package org.onap.ccsdk.apps.controllerblueprints.service.rs;
-import io.swagger.annotations.*;
import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintException;
+import org.onap.ccsdk.apps.controllerblueprints.service.ModelTypeService;
import org.onap.ccsdk.apps.controllerblueprints.service.domain.ModelType;
+import org.springframework.stereotype.Component;
+import org.springframework.stereotype.Service;
+import org.springframework.web.bind.annotation.*;
-import javax.ws.rs.*;
-import javax.ws.rs.core.MediaType;
import java.util.List;
/**
- * ModelTypeRest.java Purpose: Rest service controller for Artifact Handling
- *
- * @author Brinda Santh
- * @version 1.0
+ * {@inheritDoc}
*/
-@Api
-@Path("/service")
-@Produces({MediaType.APPLICATION_JSON})
-public interface ModelTypeRest {
+@RestController
+@RequestMapping("/api/v1/model-type")
+public class ModelTypeRest {
- /**
- * This is a getModelTypeByName rest service
- *
- * @param name
- * @return ModelType
- * @throws BluePrintException
- */
- @GET
- @Path("/modeltype/{name}")
- @Consumes({MediaType.APPLICATION_JSON})
- @Produces({MediaType.APPLICATION_JSON})
- @ApiOperation(value = "Provides Rest service to get Model Type by id", response = ModelType.class)
- @ApiResponses(value = {@ApiResponse(code = 404, message = "Service not available"),
- @ApiResponse(code = 500, message = "Unexpected Runtime error")})
- ModelType getModelTypeByName(@ApiParam(required = true) @PathParam("name") String name)
- throws BluePrintException;
+ private ModelTypeService modelTypeService;
/**
- * This is a saveModelType rest service
- *
- * @param modelType
- * @return ModelType
- * @throws BluePrintException
+ * This is a ModelTypeResourceImpl, used to save and get the model types stored in database
+ *
+ * @param modelTypeService Model Type Service
*/
+ public ModelTypeRest(ModelTypeService modelTypeService) {
+ this.modelTypeService = modelTypeService;
+ }
- @POST
- @Path("/modeltype")
- @Consumes({MediaType.APPLICATION_JSON})
- @Produces({MediaType.APPLICATION_JSON})
- @ApiOperation(value = "Provides Rest service to Save Model Type", response = ModelType.class)
- @ApiResponses(value = {@ApiResponse(code = 404, message = "Service not available"),
- @ApiResponse(code = 500, message = "Unexpected Runtime error")})
- ModelType saveModelType(@ApiParam(required = true) ModelType modelType) throws BluePrintException;
+ @GetMapping(path = "/{name}")
+ public ModelType getModelTypeByName(@PathVariable(value = "name") String name) throws BluePrintException {
+ try {
+ return modelTypeService.getModelTypeByName(name);
+ } catch (Exception e) {
+ throw new BluePrintException(1000, e.getMessage(), e);
+ }
+ }
- /**
- * This is a deleteModelType rest service
- *
- * @param name
- * @throws BluePrintException
- */
- @DELETE
- @Path("/modeltype/{name}")
- @Consumes({MediaType.APPLICATION_JSON})
- @Produces({MediaType.APPLICATION_JSON})
- @ApiOperation(value = "Provides Rest service to delete Model Type")
- @ApiResponses(value = {@ApiResponse(code = 404, message = "Service not available"),
- @ApiResponse(code = 500, message = "Unexpected Runtime error")})
- void deleteModelTypeByName(@ApiParam(required = true) @PathParam("name") String name)
- throws BluePrintException;
+ @GetMapping(path = "/search/{tags}")
+ public List<ModelType> searchModelTypes(@PathVariable(value = "tags") String tags) throws BluePrintException {
+ try {
+ return modelTypeService.searchModelTypes(tags);
+ } catch (Exception e) {
+ throw new BluePrintException(1001, e.getMessage(), e);
+ }
+ }
- /**
- * This is a searchModelType rest service
- *
- * @param tags
- * @return List<ModelType>
- * @throws BluePrintException
- */
- @GET
- @Path("/modeltypesearch/{tags}")
- @Consumes({MediaType.APPLICATION_JSON})
- @Produces({MediaType.APPLICATION_JSON})
- @ApiOperation(value = "Provides Rest service to get Model Type by tags", response = ModelType.class,
- responseContainer = "List")
- @ApiResponses(value = {@ApiResponse(code = 404, message = "Service not available"),
- @ApiResponse(code = 500, message = "Unexpected Runtime error")})
- List<ModelType> searchModelTypes(@ApiParam(required = true) @PathParam("tags") String tags)
- throws BluePrintException;
+ @GetMapping(path = "/by-definition/{definitionType}")
+ public @ResponseBody
+ List<ModelType> getModelTypeByDefinitionType(@PathVariable(value = "definitionType") String definitionType) throws BluePrintException {
+ try {
+ return modelTypeService.getModelTypeByDefinitionType(definitionType);
+ } catch (Exception e) {
+ throw new BluePrintException(1002, e.getMessage(), e);
+ }
+ }
- /**
- * This is a getModelTypeByDefinitionType rest service
- *
- * @param definitionType
- * @return List<ModelType>
- * @throws BluePrintException
- */
- @GET
- @Path("/modeltypebydefinition/{definitionType}")
- @Consumes({MediaType.APPLICATION_JSON})
- @Produces({MediaType.APPLICATION_JSON})
- @ApiOperation(value = "Provides Rest service to get Model Type by tags", response = ModelType.class,
- responseContainer = "List")
- @ApiResponses(value = {@ApiResponse(code = 404, message = "Service not available"),
- @ApiResponse(code = 500, message = "Unexpected Runtime error")})
- List<ModelType> getModelTypeByDefinitionType(
- @ApiParam(required = true) @PathParam("definitionType") String definitionType)
- throws BluePrintException;
+ @PostMapping(path = "/")
+ public @ResponseBody
+ ModelType saveModelType(@RequestBody ModelType modelType) throws BluePrintException {
+ try {
+ return modelTypeService.saveModel(modelType);
+ } catch (Exception e) {
+ throw new BluePrintException(1100, e.getMessage(), e);
+ }
+ }
+ @DeleteMapping(path = "/{name}")
+ public void deleteModelTypeByName(@PathVariable(value = "name") String name) throws BluePrintException {
+ try {
+ modelTypeService.deleteByModelName(name);
+ } catch (Exception e) {
+ throw new BluePrintException(1400, e.getMessage(), e);
+ }
+ }
}
diff --git a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ModelTypeRestImpl.java b/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ModelTypeRestImpl.java
deleted file mode 100644
index 6fbc69699..000000000
--- a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ModelTypeRestImpl.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright © 2017-2018 AT&T Intellectual Property.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.onap.ccsdk.apps.controllerblueprints.service.rs;
-
-import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintException;
-import org.onap.ccsdk.apps.controllerblueprints.service.ModelTypeService;
-import org.onap.ccsdk.apps.controllerblueprints.service.domain.ModelType;
-import org.springframework.stereotype.Service;
-
-import java.util.List;
-
-/**
- * {@inheritDoc}
- */
-@Service
-public class ModelTypeRestImpl implements ModelTypeRest {
-
- private ModelTypeService modelTypeService;
-
- /**
- * This is a ModelTypeResourceImpl, used to save and get the model types stored in database
- *
- * @param modelTypeService Model Type Service
- */
- public ModelTypeRestImpl(ModelTypeService modelTypeService) {
- this.modelTypeService = modelTypeService;
- }
-
- @Override
- public ModelType getModelTypeByName(String modelName) throws BluePrintException {
- try {
- return modelTypeService.getModelTypeByName(modelName);
- } catch (Exception e) {
- throw new BluePrintException(1000, e.getMessage(), e);
- }
- }
-
- @Override
- public List<ModelType> searchModelTypes(String tags) throws BluePrintException {
- try {
- return modelTypeService.searchModelTypes(tags);
- } catch (Exception e) {
- throw new BluePrintException(1001, e.getMessage(), e);
- }
- }
-
- @Override
- public List<ModelType> getModelTypeByDefinitionType(String definitionType) throws BluePrintException {
- try {
- return modelTypeService.getModelTypeByDefinitionType(definitionType);
- } catch (Exception e) {
- throw new BluePrintException(1002, e.getMessage(), e);
- }
- }
-
- @Override
- public ModelType saveModelType(ModelType modelType) throws BluePrintException {
- try {
- return modelTypeService.saveModel(modelType);
- } catch (Exception e) {
- throw new BluePrintException(1100, e.getMessage(), e);
- }
- }
-
- @Override
- public void deleteModelTypeByName(String name) throws BluePrintException {
- try {
- modelTypeService.deleteByModelName(name);
- } catch (Exception e) {
- throw new BluePrintException(1400, e.getMessage(), e);
- }
- }
-}
diff --git a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ResourceDictionaryRest.java b/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ResourceDictionaryRest.java
index 5bc983363..dfb06bba5 100644
--- a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ResourceDictionaryRest.java
+++ b/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ResourceDictionaryRest.java
@@ -16,111 +16,83 @@
package org.onap.ccsdk.apps.controllerblueprints.service.rs;
-import io.swagger.annotations.*;
import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintException;
+import org.onap.ccsdk.apps.controllerblueprints.service.ResourceDictionaryService;
import org.onap.ccsdk.apps.controllerblueprints.service.domain.ResourceDictionary;
+import org.springframework.stereotype.Component;
+import org.springframework.stereotype.Service;
+import org.springframework.web.bind.annotation.*;
-import javax.ws.rs.*;
-import javax.ws.rs.core.MediaType;
import java.util.List;
/**
- * ResourceDictionaryRest.java Purpose: Rest service controller for Artifact Handling
- *
- * @author Brinda Santh
- * @version 1.0
+ * {@inheritDoc}
*/
-@Api
-@Path("/service")
-@Produces({MediaType.APPLICATION_JSON})
+@RestController
+@RequestMapping(value = "/api/v1/dictionary")
+public class ResourceDictionaryRest {
-public interface ResourceDictionaryRest {
- /**
- * This is a getDataDictionaryByPath rest service
- *
- * @param name
- * @return ResourceDictionary
- * @throws BluePrintException
- */
- @GET
- @Path("/dictionary/{name}")
- @Consumes({MediaType.APPLICATION_JSON})
- @Produces({MediaType.APPLICATION_JSON})
- @ApiOperation(value = "Provides Rest service to get Resource dictionary", response = ResourceDictionary.class)
- @ApiResponses(value = {@ApiResponse(code = 404, message = "Service not available"),
- @ApiResponse(code = 500, message = "Unexpected Runtime error")})
- ResourceDictionary getResourceDictionaryByName(@ApiParam(required = true) @PathParam("name") String name)
- throws BluePrintException;
+ private ResourceDictionaryService resourceDictionaryService;
/**
- * This is a saveDataDictionary rest service
- *
- * @param resourceMapping
- * @return ResourceDictionary
- * @throws BluePrintException
+ * This is a DataDictionaryRestImpl, used to save and get the Resource Mapping stored in database
+ *
+ * @param dataDictionaryService Data Dictionary Service
*/
+ public ResourceDictionaryRest(ResourceDictionaryService dataDictionaryService) {
+ this.resourceDictionaryService = dataDictionaryService;
+ }
- @POST
- @Path("/dictionary")
- @Consumes({MediaType.APPLICATION_JSON})
- @Produces({MediaType.APPLICATION_JSON})
- @ApiOperation(value = "Provides Rest service to Save Resource dictionary Type", response = ResourceDictionary.class)
- @ApiResponses(value = {@ApiResponse(code = 404, message = "Service not available"),
- @ApiResponse(code = 500, message = "Unexpected Runtime error")})
- ResourceDictionary saveResourceDictionary(@ApiParam(required = true) ResourceDictionary resourceMapping)
- throws BluePrintException;
+ @PostMapping(path = "/")
+ public @ResponseBody
+ ResourceDictionary saveResourceDictionary(@RequestBody ResourceDictionary dataDictionary)
+ throws BluePrintException {
+ try {
+ return resourceDictionaryService.saveResourceDictionary(dataDictionary);
+ } catch (Exception e) {
+ throw new BluePrintException(4100, e.getMessage(), e);
+ }
+ }
- /**
- * This is a deleteDataDictionaryByName rest service
- *
- * @param name
- * @throws BluePrintException
- */
- @DELETE
- @Path("/dictionary/{name}")
- @Consumes({MediaType.APPLICATION_JSON})
- @Produces({MediaType.APPLICATION_JSON})
- @ApiOperation(value = "Provides Rest service to delete ResourceDictionary Type")
- @ApiResponses(value = {@ApiResponse(code = 404, message = "Service not available"),
- @ApiResponse(code = 500, message = "Unexpected Runtime error")})
- void deleteResourceDictionaryByName(@ApiParam(required = true) @PathParam("name") String name)
- throws BluePrintException;
+ @DeleteMapping(path = "/{name}")
+ public void deleteResourceDictionaryByName(@PathVariable(value = "name") String name) throws BluePrintException {
+ try {
+ resourceDictionaryService.deleteResourceDictionary(name);
+ } catch (Exception e) {
+ throw new BluePrintException(4400, e.getMessage(), e);
+ }
+ }
- /**
- * This is a searchResourceDictionaryByTags rest service
- *
- * @param tags
- * @return ResourceDictionary
- * @throws BluePrintException
- */
- @GET
- @Path("/dictionarysearch/{tags}")
- @Consumes({MediaType.APPLICATION_JSON})
- @Produces({MediaType.APPLICATION_JSON})
- @ApiOperation(value = "Provides Rest service to search Resource dictionary by tags",
- response = ResourceDictionary.class, responseContainer = "List")
- @ApiResponses(value = {@ApiResponse(code = 404, message = "Service not available"),
- @ApiResponse(code = 500, message = "Unexpected Runtime error")})
- List<ResourceDictionary> searchResourceDictionaryByTags(
- @ApiParam(required = true) @PathParam("tags") String tags) throws BluePrintException;
+ @GetMapping(path = "/{name}")
+ public @ResponseBody
+ ResourceDictionary getResourceDictionaryByName(@PathVariable(value = "name") String name) throws BluePrintException {
+ try {
+ return resourceDictionaryService.getResourceDictionaryByName(name);
+ } catch (Exception e) {
+ throw new BluePrintException(4001, e.getMessage(), e);
+ }
+ }
- /**
- * This is a searchResourceDictionaryByNames rest service
- *
- * @param names
- * @return List<ResourceDictionary>
- * @throws BluePrintException
- */
- @POST
- @Path("/dictionarybynames")
- @Consumes({MediaType.APPLICATION_JSON})
- @Produces({MediaType.APPLICATION_JSON})
- @ApiOperation(value = "Provides Rest service to get ResourceDictionary Type by names",
- response = ResourceDictionary.class, responseContainer = "List")
- @ApiResponses(value = {@ApiResponse(code = 404, message = "Service not available"),
- @ApiResponse(code = 500, message = "Unexpected Runtime error")})
- List<ResourceDictionary> searchResourceDictionaryByNames(@ApiParam(required = true) List<String> names)
- throws BluePrintException;
+ @PostMapping(path = "/by-names")
+ public @ResponseBody
+ List<ResourceDictionary> searchResourceDictionaryByNames(@RequestBody List<String> names)
+ throws BluePrintException {
+ try {
+ return resourceDictionaryService.searchResourceDictionaryByNames(names);
+ } catch (Exception e) {
+ throw new BluePrintException(4002, e.getMessage(), e);
+ }
+ }
+
+ @GetMapping(path = "/search/{tags}")
+ public @ResponseBody
+ List<ResourceDictionary> searchResourceDictionaryByTags(@PathVariable(value = "tags") String tags) throws BluePrintException {
+ try {
+ return resourceDictionaryService.searchResourceDictionaryByTags(tags);
+ } catch (Exception e) {
+ throw new BluePrintException(4003, e.getMessage(), e);
+ }
+ }
}
diff --git a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ResourceDictionaryRestImpl.java b/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ResourceDictionaryRestImpl.java
deleted file mode 100644
index e3448424d..000000000
--- a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ResourceDictionaryRestImpl.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright © 2017-2018 AT&T Intellectual Property.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.onap.ccsdk.apps.controllerblueprints.service.rs;
-
-import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintException;
-import org.onap.ccsdk.apps.controllerblueprints.service.ResourceDictionaryService;
-import org.onap.ccsdk.apps.controllerblueprints.service.domain.ResourceDictionary;
-import org.springframework.stereotype.Service;
-
-import java.util.List;
-
-/**
- * {@inheritDoc}
- */
-@Service
-public class ResourceDictionaryRestImpl implements ResourceDictionaryRest {
-
-
- private ResourceDictionaryService resourceDictionaryService;
-
- /**
- * This is a DataDictionaryRestImpl, used to save and get the Resource Mapping stored in database
- *
- * @param dataDictionaryService Data Dictionary Service
- */
- public ResourceDictionaryRestImpl(ResourceDictionaryService dataDictionaryService) {
- this.resourceDictionaryService = dataDictionaryService;
- }
-
- @Override
- public ResourceDictionary saveResourceDictionary(ResourceDictionary dataDictionary)
- throws BluePrintException {
- try {
- return resourceDictionaryService.saveResourceDictionary(dataDictionary);
- } catch (Exception e) {
- throw new BluePrintException(4100, e.getMessage(), e);
- }
- }
-
- @Override
- public void deleteResourceDictionaryByName(String name) throws BluePrintException {
- try {
- resourceDictionaryService.deleteResourceDictionary(name);
- } catch (Exception e) {
- throw new BluePrintException(4400, e.getMessage(), e);
- }
- }
-
- @Override
- public ResourceDictionary getResourceDictionaryByName(String resourcePath) throws BluePrintException {
- try {
- return resourceDictionaryService.getResourceDictionaryByName(resourcePath);
- } catch (Exception e) {
- throw new BluePrintException(4001, e.getMessage(), e);
- }
- }
-
- @Override
- public List<ResourceDictionary> searchResourceDictionaryByNames(List<String> names)
- throws BluePrintException {
- try {
- return resourceDictionaryService.searchResourceDictionaryByNames(names);
- } catch (Exception e) {
- throw new BluePrintException(4002, e.getMessage(), e);
- }
- }
-
- @Override
- public List<ResourceDictionary> searchResourceDictionaryByTags(String tags) throws BluePrintException {
- try {
- return resourceDictionaryService.searchResourceDictionaryByTags(tags);
- } catch (Exception e) {
- throw new BluePrintException(4003, e.getMessage(), e);
- }
- }
-
-}
diff --git a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ServiceTemplateRest.java b/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ServiceTemplateRest.java
index fcb8f3119..d8ea1941b 100644
--- a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ServiceTemplateRest.java
+++ b/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ServiceTemplateRest.java
@@ -16,119 +16,87 @@
package org.onap.ccsdk.apps.controllerblueprints.service.rs;
-import io.swagger.annotations.*;
+
import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintException;
import org.onap.ccsdk.apps.controllerblueprints.core.data.ServiceTemplate;
import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignment;
+import org.onap.ccsdk.apps.controllerblueprints.service.ServiceTemplateService;
import org.onap.ccsdk.apps.controllerblueprints.service.domain.ConfigModelContent;
import org.onap.ccsdk.apps.controllerblueprints.service.model.AutoMapResponse;
+import org.springframework.stereotype.Component;
+import org.springframework.stereotype.Service;
+import org.springframework.web.bind.annotation.*;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
import java.util.List;
-
/**
- * ServiceTemplateRest.java Purpose: ServiceTemplateRest interface
- *
- * @author Brinda Santh
- * @version 1.0
+ * {@inheritDoc}
*/
+@RestController
+@RequestMapping(value = "/api/v1/service-template")
+public class ServiceTemplateRest {
-@Api
-@Path("/service")
-@Produces({MediaType.APPLICATION_JSON})
-public interface ServiceTemplateRest {
+ private ServiceTemplateService serviceTemplateService;
/**
- * This is a enrichServiceTemplate rest service
- *
- * @param serviceTemplate
- * @return ServiceTemplate
- * @throws BluePrintException
+ * This is a ServiceTemplateRest constructor
+ *
+ * @param serviceTemplateService Service Template Service
*/
- @POST
- @Path("/servicetemplate/enrich")
- @Consumes({MediaType.APPLICATION_JSON})
- @Produces({MediaType.APPLICATION_JSON})
- @ApiOperation(value = "Provides Rest service to enrich service template", response = ServiceTemplate.class)
- @ApiResponses(value = {@ApiResponse(code = 404, message = "Service not available"),
- @ApiResponse(code = 500, message = "Unexpected Runtime error")})
- ServiceTemplate enrichServiceTemplate(@ApiParam(required = true) ServiceTemplate serviceTemplate)
- throws BluePrintException;
+ public ServiceTemplateRest(ServiceTemplateService serviceTemplateService) {
+ this.serviceTemplateService = serviceTemplateService;
+ }
- /**
- * This is a validateServiceTemplate rest service
- *
- * @param serviceTemplate
- * @return ServiceTemplate
- * @throws BluePrintException
- */
- @POST
- @Path("/servicetemplate/validate")
- @Consumes({MediaType.APPLICATION_JSON})
- @Produces({MediaType.APPLICATION_JSON})
- @ApiOperation(value = "Provides Rest service to validate service template", response = ServiceTemplate.class)
- @ApiResponses(value = {@ApiResponse(code = 404, message = "Service not available"),
- @ApiResponse(code = 500, message = "Unexpected Runtime error")})
- ServiceTemplate validateServiceTemplate(@ApiParam(required = true) ServiceTemplate serviceTemplate)
- throws BluePrintException;
+ @PostMapping(path = "/enrich")
+ public @ResponseBody
+ ServiceTemplate enrichServiceTemplate(@RequestBody ServiceTemplate serviceTemplate) throws BluePrintException {
+ try {
+ return serviceTemplateService.enrichServiceTemplate(serviceTemplate);
+ } catch (Exception e) {
+ throw new BluePrintException(3500, e.getMessage(), e);
+ }
+ }
- /**
- * This is a generateResourceAssignments rest service
- *
- * @param templateContent
- * @return List<ResourceAssignment>
- * @throws BluePrintException
- */
- @POST
- @Path("/resourceassignment/generate")
- @Consumes({MediaType.APPLICATION_JSON})
- @Produces({MediaType.APPLICATION_JSON})
- @ApiOperation(value = "Provides Rest service to auto map for the Resource Mapping",
- response = ResourceAssignment.class, responseContainer = "List")
- @ApiResponses(value = {@ApiResponse(code = 404, message = "Service not available"),
- @ApiResponse(code = 500, message = "Unexpected Runtime error")})
- List<ResourceAssignment> generateResourceAssignments(
- @ApiParam(required = true) ConfigModelContent templateContent) throws BluePrintException;
+ @PostMapping(path = "/validate")
+ public @ResponseBody
+ ServiceTemplate validateServiceTemplate(@RequestBody ServiceTemplate serviceTemplate) throws BluePrintException {
+ try {
+ return serviceTemplateService.validateServiceTemplate(serviceTemplate);
+ } catch (Exception e) {
+ throw new BluePrintException(3501, e.getMessage(), e);
+ }
+ }
- /**
- * This is a autoMap rest service
- *
- * @param resourceAssignments
- * @return AutoMapResponse
- * @throws BluePrintException
- */
- @POST
- @Path("/resourceassignment/automap")
- @Consumes({MediaType.APPLICATION_JSON})
- @Produces({MediaType.APPLICATION_JSON})
- @ApiOperation(value = "Provides Rest service to auto map for the Resource assignments",
- response = AutoMapResponse.class)
- @ApiResponses(value = {@ApiResponse(code = 404, message = "Service not available"),
- @ApiResponse(code = 500, message = "Unexpected Runtime error")})
- AutoMapResponse autoMap(@ApiParam(required = true) List<ResourceAssignment> resourceAssignments)
- throws BluePrintException;
+ @PostMapping(path = "/resource-assignment/auto-map")
+ public @ResponseBody
+ AutoMapResponse autoMap(@RequestBody List<ResourceAssignment> resourceAssignments) throws BluePrintException {
+ try {
+ return serviceTemplateService.autoMap(resourceAssignments);
+ } catch (Exception e) {
+ throw new BluePrintException(3502, e.getMessage(), e);
+ }
+ }
- /**
- * This is a validateResourceAssignments rest service
- *
- * @param resourceAssignments
- * @return List<ResourceAssignment>
- * @throws BluePrintException
- */
- @POST
- @Path("/resourceassignment/validate")
- @Consumes({MediaType.APPLICATION_JSON})
- @Produces({MediaType.APPLICATION_JSON})
- @ApiOperation(value = "Provides Rest service to validate Resource assignments", response = ResourceAssignment.class,
- responseContainer = "List")
- @ApiResponses(value = {@ApiResponse(code = 404, message = "Service not available"),
- @ApiResponse(code = 500, message = "Unexpected Runtime error")})
- List<ResourceAssignment> validateResourceAssignments(
- @ApiParam(required = true) List<ResourceAssignment> resourceAssignments) throws BluePrintException;
+ @PostMapping(path = "/resource-assignment/validate")
+ public @ResponseBody
+ List<ResourceAssignment> validateResourceAssignments(@RequestBody List<ResourceAssignment> resourceAssignments)
+ throws BluePrintException {
+ try {
+ return serviceTemplateService.validateResourceAssignments(resourceAssignments);
+ } catch (Exception e) {
+ throw new BluePrintException(3503, e.getMessage(), e);
+ }
+ }
+
+ @PostMapping(path = "/resource-assignment/generate")
+ public @ResponseBody
+ List<ResourceAssignment> generateResourceAssignments(@RequestBody ConfigModelContent templateContent)
+ throws BluePrintException {
+ try {
+ return serviceTemplateService.generateResourceAssignments(templateContent);
+ } catch (Exception e) {
+ throw new BluePrintException(3504, e.getMessage(), e);
+ }
+ }
}
diff --git a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ServiceTemplateRestImpl.java b/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ServiceTemplateRestImpl.java
deleted file mode 100644
index 6c49d5c65..000000000
--- a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ServiceTemplateRestImpl.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Copyright © 2017-2018 AT&T Intellectual Property.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.onap.ccsdk.apps.controllerblueprints.service.rs;
-
-
-import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintException;
-import org.onap.ccsdk.apps.controllerblueprints.core.data.ServiceTemplate;
-import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignment;
-import org.onap.ccsdk.apps.controllerblueprints.service.ServiceTemplateService;
-import org.onap.ccsdk.apps.controllerblueprints.service.domain.ConfigModelContent;
-import org.onap.ccsdk.apps.controllerblueprints.service.model.AutoMapResponse;
-import org.springframework.stereotype.Service;
-
-import java.util.List;
-
-/**
- * {@inheritDoc}
- */
-@Service
-public class ServiceTemplateRestImpl implements ServiceTemplateRest {
-
- private ServiceTemplateService serviceTemplateService;
-
- /**
- * This is a ServiceTemplateRestImpl constructor
- *
- * @param serviceTemplateService Service Template Service
- */
- public ServiceTemplateRestImpl(ServiceTemplateService serviceTemplateService) {
- this.serviceTemplateService = serviceTemplateService;
- }
-
- @Override
- public ServiceTemplate enrichServiceTemplate(ServiceTemplate serviceTemplate) throws BluePrintException {
- try {
- return serviceTemplateService.enrichServiceTemplate(serviceTemplate);
- } catch (Exception e) {
- throw new BluePrintException(3500, e.getMessage(), e);
- }
- }
-
- @Override
- public ServiceTemplate validateServiceTemplate(ServiceTemplate serviceTemplate) throws BluePrintException {
- try {
- return serviceTemplateService.validateServiceTemplate(serviceTemplate);
- } catch (Exception e) {
- throw new BluePrintException(3501, e.getMessage(), e);
- }
- }
-
- @Override
- public AutoMapResponse autoMap(List<ResourceAssignment> resourceAssignments) throws BluePrintException {
- try {
- return serviceTemplateService.autoMap(resourceAssignments);
- } catch (Exception e) {
- throw new BluePrintException(3502, e.getMessage(), e);
- }
- }
-
- @Override
- public List<ResourceAssignment> validateResourceAssignments(List<ResourceAssignment> resourceAssignments)
- throws BluePrintException {
- try {
- return serviceTemplateService.validateResourceAssignments(resourceAssignments);
- } catch (Exception e) {
- throw new BluePrintException(3503, e.getMessage(), e);
- }
- }
-
- @Override
- public List<ResourceAssignment> generateResourceAssignments(ConfigModelContent templateContent)
- throws BluePrintException {
- try {
- return serviceTemplateService.generateResourceAssignments(templateContent);
- } catch (Exception e) {
- throw new BluePrintException(3504, e.getMessage(), e);
- }
- }
-
-}
diff --git a/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/JerseyConfiguration.java b/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/JerseyConfiguration.java
deleted file mode 100644
index f5535eb12..000000000
--- a/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/JerseyConfiguration.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright © 2017-2018 AT&T Intellectual Property.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.onap.ccsdk.apps.controllerblueprints;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.databind.DeserializationFeature;
-import com.fasterxml.jackson.databind.MapperFeature;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.SerializationFeature;
-import org.glassfish.jersey.logging.LoggingFeature;
-import org.glassfish.jersey.server.ResourceConfig;
-import org.glassfish.jersey.servlet.ServletProperties;
-import org.onap.ccsdk.apps.controllerblueprints.service.common.ServiceExceptionMapper;
-import org.onap.ccsdk.apps.controllerblueprints.service.rs.ConfigModelRestImpl;
-import org.onap.ccsdk.apps.controllerblueprints.service.rs.ModelTypeRestImpl;
-import org.onap.ccsdk.apps.controllerblueprints.service.rs.ResourceDictionaryRestImpl;
-import org.onap.ccsdk.apps.controllerblueprints.service.rs.ServiceTemplateRestImpl;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Primary;
-import org.springframework.stereotype.Component;
-
-import java.util.logging.Logger;
-
-
-@Component
-public class JerseyConfiguration extends ResourceConfig {
- private static final Logger log = Logger.getLogger(JerseyConfiguration.class.getName());
-
- @Bean
- @Primary
- public ObjectMapper objectMapper() {
- ObjectMapper objectMapper = new ObjectMapper();
- objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
- objectMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
- objectMapper.enable(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES);
- objectMapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING);
- objectMapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING);
- return objectMapper;
- }
-
- @Autowired
- public JerseyConfiguration() {
- register(ConfigModelRestImpl.class);
- register(ModelTypeRestImpl.class);
- register(ResourceDictionaryRestImpl.class);
- register(ServiceTemplateRestImpl.class);
- // Exception Mapping
- register(ServiceExceptionMapper.class);
- property(ServletProperties.FILTER_FORWARD_ON_404, true);
- register(new LoggingFeature(log));
- }
-
-
-} \ No newline at end of file
diff --git a/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/TestConfiguration.java b/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/TestConfiguration.java
deleted file mode 100644
index ea259c9c9..000000000
--- a/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/TestConfiguration.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright © 2017-2018 AT&T Intellectual Property.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.onap.ccsdk.apps.controllerblueprints;
-
-import org.springframework.context.annotation.Bean;
-
-import java.util.ArrayList;
-
-//@Configuration
-public class TestConfiguration {
-
- @Bean("jaxrsProviders")
- public ArrayList<Object> provider() {
- return new ArrayList<Object>();
- }
-
- @Bean("jaxrsServices")
- public ArrayList<Object> service() {
- return new ArrayList<Object>();
- }
-
-}
diff --git a/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ConfigModelRestTest.java b/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ConfigModelRestTest.java
index 5b10a7e86..a4a787b08 100644
--- a/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ConfigModelRestTest.java
+++ b/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ConfigModelRestTest.java
@@ -20,7 +20,6 @@ import org.junit.*;
import org.junit.runner.RunWith;
import org.junit.runners.MethodSorters;
import org.onap.ccsdk.apps.controllerblueprints.TestApplication;
-import org.onap.ccsdk.apps.controllerblueprints.TestConfiguration;
import org.onap.ccsdk.apps.controllerblueprints.service.domain.ConfigModel;
import org.onap.ccsdk.apps.controllerblueprints.service.utils.ConfigModelUtils;
import org.slf4j.Logger;
@@ -35,7 +34,7 @@ import java.util.List;
@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
-@ContextConfiguration(classes = {TestApplication.class, TestConfiguration.class})
+@ContextConfiguration(classes = {TestApplication.class})
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class ConfigModelRestTest {
@@ -68,7 +67,6 @@ public class ConfigModelRestTest {
ConfigModel configModel = configModelRest.getInitialConfigModel(name);
Assert.assertNotNull("Failed to get Initial Config Model , Return object is Null", configModel);
Assert.assertNotNull("Failed to get Service Template Content ", configModel.getConfigModelContents());
-
}
diff --git a/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ModelTypeRestTest.java b/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ModelTypeRestTest.java
index d33349c53..d328b3eac 100644
--- a/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ModelTypeRestTest.java
+++ b/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ModelTypeRestTest.java
@@ -21,7 +21,6 @@ import org.junit.*;
import org.junit.runner.RunWith;
import org.junit.runners.MethodSorters;
import org.onap.ccsdk.apps.controllerblueprints.TestApplication;
-import org.onap.ccsdk.apps.controllerblueprints.TestConfiguration;
import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintConstants;
import org.onap.ccsdk.apps.controllerblueprints.service.domain.ModelType;
import org.slf4j.Logger;
@@ -38,7 +37,7 @@ import java.util.List;
@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
-@ContextConfiguration(classes = {TestApplication.class, TestConfiguration.class})
+@ContextConfiguration(classes = {TestApplication.class})
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class ModelTypeRestTest {
private static Logger log = LoggerFactory.getLogger(ModelTypeRestTest.class);
diff --git a/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ResourceDictionaryRestTest.java b/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ResourceDictionaryRestTest.java
index 71dff338b..afe9b426f 100644
--- a/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ResourceDictionaryRestTest.java
+++ b/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ResourceDictionaryRestTest.java
@@ -24,7 +24,6 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.MethodSorters;
import org.onap.ccsdk.apps.controllerblueprints.TestApplication;
-import org.onap.ccsdk.apps.controllerblueprints.TestConfiguration;
import org.onap.ccsdk.apps.controllerblueprints.service.domain.ResourceDictionary;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -41,7 +40,7 @@ import java.util.List;
@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
-@ContextConfiguration(classes = {TestApplication.class, TestConfiguration.class})
+@ContextConfiguration(classes = {TestApplication.class})
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class ResourceDictionaryRestTest {
diff --git a/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ServiceTemplateRestTest.java b/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ServiceTemplateRestTest.java
index f81dd4165..fdc68e4e5 100644
--- a/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ServiceTemplateRestTest.java
+++ b/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ServiceTemplateRestTest.java
@@ -24,7 +24,6 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.MethodSorters;
import org.onap.ccsdk.apps.controllerblueprints.TestApplication;
-import org.onap.ccsdk.apps.controllerblueprints.TestConfiguration;
import org.onap.ccsdk.apps.controllerblueprints.core.ConfigModelConstant;
import org.onap.ccsdk.apps.controllerblueprints.core.data.ServiceTemplate;
import org.onap.ccsdk.apps.controllerblueprints.core.utils.JacksonUtils;
@@ -46,7 +45,7 @@ import java.util.List;
@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
-@ContextConfiguration(classes = {TestApplication.class, TestConfiguration.class})
+@ContextConfiguration(classes = {TestApplication.class})
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class ServiceTemplateRestTest {
diff --git a/ms/controllerblueprints/parent/pom.xml b/ms/controllerblueprints/parent/pom.xml
index 0b19186d5..f8977d1f3 100644
--- a/ms/controllerblueprints/parent/pom.xml
+++ b/ms/controllerblueprints/parent/pom.xml
@@ -27,17 +27,19 @@
<packaging>pom</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
- <kotlin.version>1.2.51</kotlin.version>
- <ajsc.version>200.4.2-RELEASE</ajsc.version>
- <common.version>2.4.2-RELEASE</common.version>
- <cadi.aaf.version>1.4.2</cadi.aaf.version>
- <spring.boot.version>1.5.7.RELEASE</spring.boot.version>
- <sdnc.config.version>20.0.1-SNAPSHOT</sdnc.config.version>
+ <java.version>1.8</java.version>
+ <spring.boot.version>2.0.4.RELEASE</spring.boot.version>
+ <kotlin.version>1.2.60</kotlin.version>
+ <eelf.version>1.0.0</eelf.version>
+ <springfox.swagger2.version>2.9.2</springfox.swagger2.version>
+ <h2database.version>1.4.197</h2database.version>
</properties>
<dependencyManagement>
<dependencies>
+ <!-- Spring boot -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
@@ -47,6 +49,24 @@
</dependency>
<dependency>
+ <groupId>com.att.eelf</groupId>
+ <artifactId>eelf-core</artifactId>
+ <version>${eelf.version}</version>
+ </dependency>
+
+ <!--Swagger Dependencies -->
+ <dependency>
+ <groupId>io.springfox</groupId>
+ <artifactId>springfox-swagger2</artifactId>
+ <version>${springfox.swagger2.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>io.springfox</groupId>
+ <artifactId>springfox-swagger-ui</artifactId>
+ <version>${springfox.swagger2.version}</version>
+ </dependency>
+
+ <dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.2.1</version>
@@ -67,32 +87,11 @@
<version>1.7</version>
</dependency>
<dependency>
- <groupId>org.json</groupId>
- <artifactId>json</artifactId>
- <version>20180130</version>
- </dependency>
- <dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>25.1-jre</version>
</dependency>
- <dependency>
- <groupId>io.swagger</groupId>
- <artifactId>swagger-jersey2-jaxrs</artifactId>
- <version>1.5.20</version>
- <exclusions>
- <exclusion>
- <groupId>org.glassfish.jersey.containers</groupId>
- <artifactId>*</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.glassfish.jersey.core</groupId>
- <artifactId>*</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
<!-- Kotlin Dependencies -->
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
@@ -105,9 +104,17 @@
<version>${kotlin.version}</version>
</dependency>
<dependency>
- <groupId>com.fasterxml.jackson.module</groupId>
- <artifactId>jackson-module-kotlin</artifactId>
- <version>2.9.6</version>
+ <groupId>org.jetbrains.kotlin</groupId>
+ <artifactId>kotlin-stdlib-jdk8</artifactId>
+ <version>${kotlin.version}</version>
+ </dependency>
+
+
+ <!-- Database -->
+ <dependency>
+ <groupId>com.h2database</groupId>
+ <artifactId>h2</artifactId>
+ <version>${h2database.version}</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
@@ -135,9 +142,64 @@
<dependencies>
<dependency>
+ <groupId>com.att.eelf</groupId>
+ <artifactId>eelf-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ <version>3.2.1</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ <version>3.2.2</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>2.6</version>
+ </dependency>
+ <dependency>
+ <groupId>com.jayway.jsonpath</groupId>
+ <artifactId>json-path</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.springfox</groupId>
+ <artifactId>springfox-swagger2</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.springfox</groupId>
+ <artifactId>springfox-swagger-ui</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.jetbrains.kotlin</groupId>
+ <artifactId>kotlin-stdlib-jdk8</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.module</groupId>
+ <artifactId>jackson-module-kotlin</artifactId>
+ </dependency>
+ <!-- test -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jetbrains.kotlin</groupId>
+ <artifactId>kotlin-test</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>io.projectreactor</groupId>
+ <artifactId>reactor-test</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>