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>
"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
"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
"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
-- -----------------------------------------------------\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
-- -----------------------------------------------------\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
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
// 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
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
@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
@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
@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
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
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
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
\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
-- -----------------------------------------------------\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
-- -----------------------------------------------------\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
@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);
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);
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
# 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
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
}\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