Controller Blueprints Microservice
authorMuthuramalingam, Brinda Santh(bs2796) <bs2796@att.com>
Fri, 7 Sep 2018 19:20:59 +0000 (19:20 +0000)
committerMuthuramalingam, Brinda Santh(bs2796) <bs2796@att.com>
Fri, 7 Sep 2018 19:20:59 +0000 (19:20 +0000)
Remove Resource Dictionary resource_type, resource_path, sample_values and valid_values parameters.

Change-Id: I7ec899e30aaef64130f35eb754a79f9dfc54f71f
Issue-ID: CCSDK-488
Signed-off-by: Muthuramalingam, Brinda Santh(bs2796) <bs2796@att.com>
15 files changed:
ms/controllerblueprints/application/load/resource_dictionary/db-source.json [moved from ms/controllerblueprints/modules/service/load/resource_dictionary/db-source.json with 86% similarity]
ms/controllerblueprints/application/load/resource_dictionary/input-source.json [moved from ms/controllerblueprints/modules/service/load/resource_dictionary/input-source.json with 78% similarity]
ms/controllerblueprints/application/load/resource_dictionary/v4-ip-type.json [moved from ms/controllerblueprints/modules/service/load/resource_dictionary/v4-ip-type.json with 79% similarity]
ms/controllerblueprints/application/src/main/resources/sql/schema-local.sql
ms/controllerblueprints/application/src/main/resources/sql/schema.sql
ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/DataBaseInitService.java
ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/ResourceDictionaryService.java
ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/domain/ResourceDictionary.java
ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/validator/ResourceDictionaryValidator.java
ms/controllerblueprints/modules/service/src/main/resources/sql/schema-local.sql
ms/controllerblueprints/modules/service/src/main/resources/sql/schema.sql
ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/repository/ResourceDictionaryReactRepositoryTest.java
ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ResourceDictionaryRestTest.java
ms/controllerblueprints/modules/service/src/test/resources/application.properties
ms/controllerblueprints/modules/service/src/test/resources/resourcedictionary/default_definition.json

@@ -4,8 +4,6 @@
     "description": "name of the ",\r
     "type": "string"\r
   },\r
-  "resource-type": "ONAP",\r
-  "resource-path": "vnf/bundle-id",\r
   "updated-by": "brindasanth@onap.com",\r
   "tags": "db-source, brindasanth@onap.com",\r
   "sources": {\r
@@ -4,8 +4,6 @@
                "description": "name of the ",\r
                "type": "string"\r
        },\r
-       "resource-path": "action-name",\r
-       "resource-type": "ONAP",\r
        "updated-by": "brindasanth@onap.com",\r
        "tags": "action-name, brindasanth",\r
        "sources": {\r
@@ -4,8 +4,6 @@
     "description": "name of the ",\r
     "type": "string"\r
   },\r
-  "resource-path": "vnf/v4-ip-type",\r
-  "resource-type": "ONAP",\r
   "updated-by": "brindasanth@onap.com",\r
   "tags": "v4-ip-type, source-input, brindasanth",\r
   "sources": {\r
index 1ba9c36..47e0cce 100644 (file)
@@ -71,12 +71,8 @@ CREATE TABLE IF NOT EXISTS sdnctl.MODEL_TYPE (
 -- -----------------------------------------------------\r
 CREATE TABLE IF NOT EXISTS sdnctl.RESOURCE_DICTIONARY (\r
   name                         VARCHAR(100) NOT NULL,\r
-  resource_path        VARCHAR(500) NOT NULL,  \r
-  resource_type        VARCHAR(100) NOT NULL,\r
   data_type            VARCHAR(100) NOT NULL,\r
   entry_schema                 VARCHAR(100) NULL DEFAULT NULL,\r
-  valid_values                 LONGTEXT NULL DEFAULT NULL,\r
-  sample_value                 LONGTEXT NULL DEFAULT NULL,\r
   definition           LONGTEXT NOT NULL,\r
   description          LONGTEXT NOT NULL,\r
   tags                         LONGTEXT NOT NULL,  \r
index b884cf3..9c38bec 100644 (file)
@@ -66,12 +66,8 @@ CREATE TABLE IF NOT EXISTS configurator.MODEL_TYPE (
 -- -----------------------------------------------------\r
 CREATE TABLE IF NOT EXISTS configurator.RESOURCE_DICTIONARY (\r
   name                         VARCHAR(100) NOT NULL,\r
-  resource_path        VARCHAR(500) NOT NULL,  \r
-  resource_type        VARCHAR(100) NOT NULL,\r
   data_type            VARCHAR(100) NOT NULL,\r
   entry_schema                 VARCHAR(100) NULL DEFAULT NULL,\r
-  valid_values                 LONGTEXT NULL DEFAULT NULL,\r
-  sample_value                 LONGTEXT NULL DEFAULT NULL,\r
   definition           LONGTEXT NOT NULL,\r
   description          LONGTEXT NOT NULL,\r
   tags                         LONGTEXT NOT NULL,  \r
index c6d80cf..cfcf93d 100644 (file)
@@ -157,30 +157,28 @@ public class DataBaseInitService {
                         fileName = file.getFilename();\r
                         log.trace("Loading : {}", fileName);\r
                         String definitionContent = getResourceContent(file);\r
-                        ResourceDefinition dictionaryDefinition =\r
+                        ResourceDefinition resourceDefinition =\r
                                 JacksonUtils.readValue(definitionContent, ResourceDefinition.class);\r
-                        if (dictionaryDefinition != null) {\r
-                            Preconditions.checkNotNull(dictionaryDefinition.getProperty(), "Failed to get Property Definition");\r
+                        if (resourceDefinition != null) {\r
+                            Preconditions.checkNotNull(resourceDefinition.getProperty(), "Failed to get Property Definition");\r
                             ResourceDictionary resourceDictionary = new ResourceDictionary();\r
-                            resourceDictionary.setResourcePath(dictionaryDefinition.getResourcePath());\r
-                            resourceDictionary.setName(dictionaryDefinition.getName());\r
-                            resourceDictionary.setDefinition(dictionaryDefinition);\r
-\r
-                            resourceDictionary.setResourceType(dictionaryDefinition.getResourceType());\r
-                            resourceDictionary.setDescription(dictionaryDefinition.getProperty().getDescription());\r
-                            resourceDictionary.setDataType(dictionaryDefinition.getProperty().getType());\r
-                            if(dictionaryDefinition.getProperty().getEntrySchema() != null){\r
-                                resourceDictionary.setEntrySchema(dictionaryDefinition.getProperty().getEntrySchema().getType());\r
+                            resourceDictionary.setName(resourceDefinition.getName());\r
+                            resourceDictionary.setDefinition(resourceDefinition);\r
+\r
+                            Preconditions.checkNotNull(resourceDefinition.getProperty(), "Property field is missing");\r
+                            resourceDictionary.setDescription(resourceDefinition.getProperty().getDescription());\r
+                            resourceDictionary.setDataType(resourceDefinition.getProperty().getType());\r
+                            if(resourceDefinition.getProperty().getEntrySchema() != null){\r
+                                resourceDictionary.setEntrySchema(resourceDefinition.getProperty().getEntrySchema().getType());\r
                             }\r
-                            resourceDictionary.setUpdatedBy(dictionaryDefinition.getUpdatedBy());\r
-                            if (StringUtils.isBlank(dictionaryDefinition.getTags())) {\r
+                            resourceDictionary.setUpdatedBy(resourceDefinition.getUpdatedBy());\r
+                            if (StringUtils.isBlank(resourceDefinition.getTags())) {\r
                                 resourceDictionary.setTags(\r
-                                        dictionaryDefinition.getName() + ", " + dictionaryDefinition.getUpdatedBy()\r
-                                                + ", " + dictionaryDefinition.getResourceType() + ", "\r
-                                                + dictionaryDefinition.getUpdatedBy());\r
+                                        resourceDefinition.getName() + ", " + resourceDefinition.getUpdatedBy()\r
+                                                + ", " + resourceDefinition.getUpdatedBy());\r
 \r
                             } else {\r
-                                resourceDictionary.setTags(dictionaryDefinition.getTags());\r
+                                resourceDictionary.setTags(resourceDefinition.getTags());\r
                             }\r
                             resourceDictionaryService.saveResourceDictionary(resourceDictionary);\r
 \r
index 70e43d6..62aa0e2 100644 (file)
@@ -112,8 +112,6 @@ public class ResourceDictionaryService {
         // Validate the Resource Definitions\r
         resourceDictionaryValidationService.validate(resourceDefinition);\r
 \r
-        resourceDictionary.setResourceType(resourceDefinition.getResourceType());\r
-        resourceDictionary.setResourcePath(resourceDefinition.getResourcePath());\r
         resourceDictionary.setTags(resourceDefinition.getTags());\r
         resourceDefinition.setUpdatedBy(resourceDictionary.getUpdatedBy());\r
         // Set the Property Definitions\r
@@ -134,8 +132,6 @@ public class ResourceDictionaryService {
             dbResourceDictionary.setName(resourceDictionary.getName());\r
             dbResourceDictionary.setDefinition(resourceDictionary.getDefinition());\r
             dbResourceDictionary.setDescription(resourceDictionary.getDescription());\r
-            dbResourceDictionary.setResourceType(resourceDictionary.getResourceType());\r
-            dbResourceDictionary.setResourcePath(resourceDictionary.getResourcePath());\r
             dbResourceDictionary.setTags(resourceDictionary.getTags());\r
             dbResourceDictionary.setUpdatedBy(resourceDictionary.getUpdatedBy());\r
             dbResourceDictionary.setDataType(resourceDictionary.getDataType());\r
index 7af9972..42c8e83 100644 (file)
@@ -43,14 +43,6 @@ public class ResourceDictionary implements Serializable {
     @ApiModelProperty(required=true)\r
     private String name;\r
 \r
-    @Column(name = "resource_path", nullable = false)\r
-    @ApiModelProperty(required=true)\r
-    private String resourcePath;\r
-\r
-    @Column(name = "resource_type", nullable = false)\r
-    @ApiModelProperty(required=true)\r
-    private String resourceType;\r
-\r
     @Column(name = "data_type", nullable = false)\r
     @ApiModelProperty(required=true)\r
     private String dataType;\r
@@ -58,14 +50,6 @@ public class ResourceDictionary implements Serializable {
     @Column(name = "entry_schema")\r
     private String entrySchema;\r
 \r
-    @Lob\r
-    @Column(name = "valid_values")\r
-    private String validValues;\r
-\r
-    @Lob\r
-    @Column(name = "sample_value")\r
-    private String sampleValue;\r
-\r
     @Lob\r
     @Convert(converter  = JpaResourceDefinitionConverter.class)\r
     @Column(name = "definition", nullable = false)\r
@@ -95,11 +79,8 @@ public class ResourceDictionary implements Serializable {
     @Override\r
     public String toString() {\r
         String buffer = "[" + ", name = " + name +\r
-                ", resourcePath = " + resourcePath +\r
-                ", resourceType = " + resourceType +\r
                 ", dataType = " + dataType +\r
                 ", entrySchema = " + entrySchema +\r
-                ", validValues = " + validValues +\r
                 ", definition =" + definition +\r
                 ", description = " + description +\r
                 ", updatedBy = " + updatedBy +\r
@@ -109,14 +90,6 @@ public class ResourceDictionary implements Serializable {
         return buffer;\r
     }\r
 \r
-    public String getResourcePath() {\r
-        return resourcePath;\r
-    }\r
-\r
-    public void setResourcePath(String resourcePath) {\r
-        this.resourcePath = resourcePath;\r
-    }\r
-\r
     public String getName() {\r
         return name;\r
     }\r
@@ -125,14 +98,6 @@ public class ResourceDictionary implements Serializable {
         this.name = name;\r
     }\r
 \r
-    public String getResourceType() {\r
-        return resourceType;\r
-    }\r
-\r
-    public void setResourceType(String resourceType) {\r
-        this.resourceType = resourceType;\r
-    }\r
-\r
     public String getDataType() {\r
         return dataType;\r
     }\r
@@ -149,22 +114,6 @@ public class ResourceDictionary implements Serializable {
         this.entrySchema = entrySchema;\r
     }\r
 \r
-    public String getValidValues() {\r
-        return validValues;\r
-    }\r
-\r
-    public void setValidValues(String validValues) {\r
-        this.validValues = validValues;\r
-    }\r
-\r
-    public String getSampleValue() {\r
-        return sampleValue;\r
-    }\r
-\r
-    public void setSampleValue(String sampleValue) {\r
-        this.sampleValue = sampleValue;\r
-    }\r
-\r
     public ResourceDefinition getDefinition() {\r
         return definition;\r
     }\r
index 1c2a733..57330d9 100644 (file)
@@ -45,10 +45,6 @@ public class ResourceDictionaryValidator {
 \r
         Preconditions.checkArgument( StringUtils.isNotBlank(resourceDictionary.getName()),\r
                 "DataDictionary Alias Name Information is missing.");\r
-        Preconditions.checkArgument( StringUtils.isNotBlank(resourceDictionary.getResourcePath()),\r
-                "DataDictionary Resource Name Information is missing.");\r
-        Preconditions.checkArgument( StringUtils.isNotBlank(resourceDictionary.getResourceType()),\r
-                "DataDictionary Resource Type Information is missing.");\r
         Preconditions.checkNotNull( resourceDictionary.getDefinition(),\r
                 "DataDictionary Definition Information is missing.");\r
         Preconditions.checkArgument( StringUtils.isNotBlank(resourceDictionary.getDescription()),\r
index 1ba9c36..47e0cce 100644 (file)
@@ -71,12 +71,8 @@ CREATE TABLE IF NOT EXISTS sdnctl.MODEL_TYPE (
 -- -----------------------------------------------------\r
 CREATE TABLE IF NOT EXISTS sdnctl.RESOURCE_DICTIONARY (\r
   name                         VARCHAR(100) NOT NULL,\r
-  resource_path        VARCHAR(500) NOT NULL,  \r
-  resource_type        VARCHAR(100) NOT NULL,\r
   data_type            VARCHAR(100) NOT NULL,\r
   entry_schema                 VARCHAR(100) NULL DEFAULT NULL,\r
-  valid_values                 LONGTEXT NULL DEFAULT NULL,\r
-  sample_value                 LONGTEXT NULL DEFAULT NULL,\r
   definition           LONGTEXT NOT NULL,\r
   description          LONGTEXT NOT NULL,\r
   tags                         LONGTEXT NOT NULL,  \r
index b884cf3..9c38bec 100644 (file)
@@ -66,12 +66,8 @@ CREATE TABLE IF NOT EXISTS configurator.MODEL_TYPE (
 -- -----------------------------------------------------\r
 CREATE TABLE IF NOT EXISTS configurator.RESOURCE_DICTIONARY (\r
   name                         VARCHAR(100) NOT NULL,\r
-  resource_path        VARCHAR(500) NOT NULL,  \r
-  resource_type        VARCHAR(100) NOT NULL,\r
   data_type            VARCHAR(100) NOT NULL,\r
   entry_schema                 VARCHAR(100) NULL DEFAULT NULL,\r
-  valid_values                 LONGTEXT NULL DEFAULT NULL,\r
-  sample_value                 LONGTEXT NULL DEFAULT NULL,\r
   definition           LONGTEXT NOT NULL,\r
   description          LONGTEXT NOT NULL,\r
   tags                         LONGTEXT NOT NULL,  \r
index 1e740ec..7034b7e 100644 (file)
@@ -51,7 +51,7 @@ public class ResourceDictionaryReactRepositoryTest {
 
     @Before
     public void init() {
-        ResourceDefinition resourceDefinition = JacksonUtils.readValueFromFile("load/resource_dictionary/db-source" +
+        ResourceDefinition resourceDefinition = JacksonUtils.readValueFromFile("./../../application/load/resource_dictionary/db-source" +
                 ".json", ResourceDefinition.class);
 
         ResourceDictionary resourceDictionary = transformResourceDictionary(resourceDefinition);
@@ -84,8 +84,6 @@ public class ResourceDictionaryReactRepositoryTest {
         resourceDictionary.setName(resourceDefinition.getName());
         resourceDictionary.setDataType(resourceDefinition.getProperty().getType());
         resourceDictionary.setDescription(resourceDefinition.getProperty().getDescription());
-        resourceDictionary.setResourcePath(resourceDefinition.getResourcePath());
-        resourceDictionary.setResourceType(resourceDefinition.getResourceType());
         resourceDictionary.setTags(resourceDefinition.getTags());
         resourceDictionary.setUpdatedBy(resourceDefinition.getUpdatedBy());
         resourceDictionary.setDefinition(resourceDefinition);
index 8234695..5955ae1 100644 (file)
@@ -58,11 +58,8 @@ public class ResourceDictionaryRestTest {
                 Charset.defaultCharset());\r
 \r
         ResourceDictionary dataDictionary = new ResourceDictionary();\r
-        dataDictionary.setResourcePath("test/vnf/ipaddress");\r
         dataDictionary.setName("test-name");\r
         dataDictionary.setDefinition(JacksonUtils.readValue(definition, ResourceDefinition.class));\r
-        dataDictionary.setValidValues("127.0.0.1");\r
-        dataDictionary.setResourceType("ONAP");\r
         dataDictionary.setDataType("string");\r
         dataDictionary.setDescription("Sample Resource Mapping");\r
         dataDictionary.setTags("test, ipaddress");\r
index b17663e..429588b 100644 (file)
 # 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=true
-
-# set to true to enable version proxy
-#ivp.enabled=false
-
 spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS = false
 
 
@@ -68,5 +27,5 @@ blueprints.load.initial-data=true
 load.dataTypePath=./../../application/load/model_type/data_type
 load.nodeTypePath=./../../application/load/model_type/node_type
 load.artifactTypePath=./../../application/load/model_type/artifact_type
-load.resourceDictionaryPath=load/resource_dictionary
+load.resourceDictionaryPath=./../../application/load/resource_dictionary
 load.blueprintsPath=./../../application/load/blueprints
\ No newline at end of file
index 198823b..334fb24 100644 (file)
@@ -8,8 +8,6 @@
     }\r
   },\r
   "updated-by": "Brinda Santh (bs2796)",\r
-  "resource-type": "ONAP",\r
-  "resource-path": "/v4-aggregat-list",\r
   "tags": "ipaddress",\r
   "sources": {\r
     "input": {\r