diff options
author | Muthuramalingam, Brinda Santh(bs2796) <bs2796@att.com> | 2018-09-07 19:20:59 +0000 |
---|---|---|
committer | Muthuramalingam, Brinda Santh(bs2796) <bs2796@att.com> | 2018-09-07 19:20:59 +0000 |
commit | 83808703f4c1379c331f71d670b5610e2ca395b0 (patch) | |
tree | 9d49aa5dd48a3d2d261d8899ae2bdf5bdd666e8f /ms/controllerblueprints/modules/service/src/main | |
parent | 76a5c64401739c8e3eb0d4e03465c89910424ce7 (diff) |
Controller Blueprints Microservice
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>
Diffstat (limited to 'ms/controllerblueprints/modules/service/src/main')
6 files changed, 16 insertions, 85 deletions
diff --git a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/DataBaseInitService.java b/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/DataBaseInitService.java index c6d80cfb..cfcf93d2 100644 --- a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/DataBaseInitService.java +++ b/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/DataBaseInitService.java @@ -157,30 +157,28 @@ public class DataBaseInitService { fileName = file.getFilename();
log.trace("Loading : {}", fileName);
String definitionContent = getResourceContent(file);
- ResourceDefinition dictionaryDefinition =
+ ResourceDefinition resourceDefinition =
JacksonUtils.readValue(definitionContent, ResourceDefinition.class);
- if (dictionaryDefinition != null) {
- Preconditions.checkNotNull(dictionaryDefinition.getProperty(), "Failed to get Property Definition");
+ if (resourceDefinition != null) {
+ Preconditions.checkNotNull(resourceDefinition.getProperty(), "Failed to get Property Definition");
ResourceDictionary resourceDictionary = new ResourceDictionary();
- resourceDictionary.setResourcePath(dictionaryDefinition.getResourcePath());
- resourceDictionary.setName(dictionaryDefinition.getName());
- resourceDictionary.setDefinition(dictionaryDefinition);
-
- resourceDictionary.setResourceType(dictionaryDefinition.getResourceType());
- resourceDictionary.setDescription(dictionaryDefinition.getProperty().getDescription());
- resourceDictionary.setDataType(dictionaryDefinition.getProperty().getType());
- if(dictionaryDefinition.getProperty().getEntrySchema() != null){
- resourceDictionary.setEntrySchema(dictionaryDefinition.getProperty().getEntrySchema().getType());
+ resourceDictionary.setName(resourceDefinition.getName());
+ resourceDictionary.setDefinition(resourceDefinition);
+
+ Preconditions.checkNotNull(resourceDefinition.getProperty(), "Property field is missing");
+ resourceDictionary.setDescription(resourceDefinition.getProperty().getDescription());
+ resourceDictionary.setDataType(resourceDefinition.getProperty().getType());
+ if(resourceDefinition.getProperty().getEntrySchema() != null){
+ resourceDictionary.setEntrySchema(resourceDefinition.getProperty().getEntrySchema().getType());
}
- resourceDictionary.setUpdatedBy(dictionaryDefinition.getUpdatedBy());
- if (StringUtils.isBlank(dictionaryDefinition.getTags())) {
+ resourceDictionary.setUpdatedBy(resourceDefinition.getUpdatedBy());
+ if (StringUtils.isBlank(resourceDefinition.getTags())) {
resourceDictionary.setTags(
- dictionaryDefinition.getName() + ", " + dictionaryDefinition.getUpdatedBy()
- + ", " + dictionaryDefinition.getResourceType() + ", "
- + dictionaryDefinition.getUpdatedBy());
+ resourceDefinition.getName() + ", " + resourceDefinition.getUpdatedBy()
+ + ", " + resourceDefinition.getUpdatedBy());
} else {
- resourceDictionary.setTags(dictionaryDefinition.getTags());
+ resourceDictionary.setTags(resourceDefinition.getTags());
}
resourceDictionaryService.saveResourceDictionary(resourceDictionary);
diff --git a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/ResourceDictionaryService.java b/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/ResourceDictionaryService.java index 70e43d69..62aa0e29 100644 --- a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/ResourceDictionaryService.java +++ b/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/ResourceDictionaryService.java @@ -112,8 +112,6 @@ public class ResourceDictionaryService { // Validate the Resource Definitions
resourceDictionaryValidationService.validate(resourceDefinition);
- resourceDictionary.setResourceType(resourceDefinition.getResourceType());
- resourceDictionary.setResourcePath(resourceDefinition.getResourcePath());
resourceDictionary.setTags(resourceDefinition.getTags());
resourceDefinition.setUpdatedBy(resourceDictionary.getUpdatedBy());
// Set the Property Definitions
@@ -134,8 +132,6 @@ public class ResourceDictionaryService { dbResourceDictionary.setName(resourceDictionary.getName());
dbResourceDictionary.setDefinition(resourceDictionary.getDefinition());
dbResourceDictionary.setDescription(resourceDictionary.getDescription());
- dbResourceDictionary.setResourceType(resourceDictionary.getResourceType());
- dbResourceDictionary.setResourcePath(resourceDictionary.getResourcePath());
dbResourceDictionary.setTags(resourceDictionary.getTags());
dbResourceDictionary.setUpdatedBy(resourceDictionary.getUpdatedBy());
dbResourceDictionary.setDataType(resourceDictionary.getDataType());
diff --git a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/domain/ResourceDictionary.java b/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/domain/ResourceDictionary.java index 7af9972a..42c8e83b 100644 --- a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/domain/ResourceDictionary.java +++ b/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/domain/ResourceDictionary.java @@ -43,14 +43,6 @@ public class ResourceDictionary implements Serializable { @ApiModelProperty(required=true)
private String name;
- @Column(name = "resource_path", nullable = false)
- @ApiModelProperty(required=true)
- private String resourcePath;
-
- @Column(name = "resource_type", nullable = false)
- @ApiModelProperty(required=true)
- private String resourceType;
-
@Column(name = "data_type", nullable = false)
@ApiModelProperty(required=true)
private String dataType;
@@ -59,14 +51,6 @@ public class ResourceDictionary implements Serializable { private String entrySchema;
@Lob
- @Column(name = "valid_values")
- private String validValues;
-
- @Lob
- @Column(name = "sample_value")
- private String sampleValue;
-
- @Lob
@Convert(converter = JpaResourceDefinitionConverter.class)
@Column(name = "definition", nullable = false)
@ApiModelProperty(required=true)
@@ -95,11 +79,8 @@ public class ResourceDictionary implements Serializable { @Override
public String toString() {
String buffer = "[" + ", name = " + name +
- ", resourcePath = " + resourcePath +
- ", resourceType = " + resourceType +
", dataType = " + dataType +
", entrySchema = " + entrySchema +
- ", validValues = " + validValues +
", definition =" + definition +
", description = " + description +
", updatedBy = " + updatedBy +
@@ -109,14 +90,6 @@ public class ResourceDictionary implements Serializable { return buffer;
}
- public String getResourcePath() {
- return resourcePath;
- }
-
- public void setResourcePath(String resourcePath) {
- this.resourcePath = resourcePath;
- }
-
public String getName() {
return name;
}
@@ -125,14 +98,6 @@ public class ResourceDictionary implements Serializable { this.name = name;
}
- public String getResourceType() {
- return resourceType;
- }
-
- public void setResourceType(String resourceType) {
- this.resourceType = resourceType;
- }
-
public String getDataType() {
return dataType;
}
@@ -149,22 +114,6 @@ public class ResourceDictionary implements Serializable { this.entrySchema = entrySchema;
}
- public String getValidValues() {
- return validValues;
- }
-
- public void setValidValues(String validValues) {
- this.validValues = validValues;
- }
-
- public String getSampleValue() {
- return sampleValue;
- }
-
- public void setSampleValue(String sampleValue) {
- this.sampleValue = sampleValue;
- }
-
public ResourceDefinition getDefinition() {
return definition;
}
diff --git a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/validator/ResourceDictionaryValidator.java b/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/validator/ResourceDictionaryValidator.java index 1c2a7337..57330d90 100644 --- a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/validator/ResourceDictionaryValidator.java +++ b/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/validator/ResourceDictionaryValidator.java @@ -45,10 +45,6 @@ public class ResourceDictionaryValidator { Preconditions.checkArgument( StringUtils.isNotBlank(resourceDictionary.getName()),
"DataDictionary Alias Name Information is missing.");
- Preconditions.checkArgument( StringUtils.isNotBlank(resourceDictionary.getResourcePath()),
- "DataDictionary Resource Name Information is missing.");
- Preconditions.checkArgument( StringUtils.isNotBlank(resourceDictionary.getResourceType()),
- "DataDictionary Resource Type Information is missing.");
Preconditions.checkNotNull( resourceDictionary.getDefinition(),
"DataDictionary Definition Information is missing.");
Preconditions.checkArgument( StringUtils.isNotBlank(resourceDictionary.getDescription()),
diff --git a/ms/controllerblueprints/modules/service/src/main/resources/sql/schema-local.sql b/ms/controllerblueprints/modules/service/src/main/resources/sql/schema-local.sql index 1ba9c365..47e0cce7 100644 --- a/ms/controllerblueprints/modules/service/src/main/resources/sql/schema-local.sql +++ b/ms/controllerblueprints/modules/service/src/main/resources/sql/schema-local.sql @@ -71,12 +71,8 @@ CREATE TABLE IF NOT EXISTS sdnctl.MODEL_TYPE ( -- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS sdnctl.RESOURCE_DICTIONARY (
name VARCHAR(100) NOT NULL,
- resource_path VARCHAR(500) NOT NULL,
- resource_type VARCHAR(100) NOT NULL,
data_type VARCHAR(100) NOT NULL,
entry_schema VARCHAR(100) NULL DEFAULT NULL,
- valid_values LONGTEXT NULL DEFAULT NULL,
- sample_value LONGTEXT NULL DEFAULT NULL,
definition LONGTEXT NOT NULL,
description LONGTEXT NOT NULL,
tags LONGTEXT NOT NULL,
diff --git a/ms/controllerblueprints/modules/service/src/main/resources/sql/schema.sql b/ms/controllerblueprints/modules/service/src/main/resources/sql/schema.sql index b884cf34..9c38bec0 100644 --- a/ms/controllerblueprints/modules/service/src/main/resources/sql/schema.sql +++ b/ms/controllerblueprints/modules/service/src/main/resources/sql/schema.sql @@ -66,12 +66,8 @@ CREATE TABLE IF NOT EXISTS configurator.MODEL_TYPE ( -- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS configurator.RESOURCE_DICTIONARY (
name VARCHAR(100) NOT NULL,
- resource_path VARCHAR(500) NOT NULL,
- resource_type VARCHAR(100) NOT NULL,
data_type VARCHAR(100) NOT NULL,
entry_schema VARCHAR(100) NULL DEFAULT NULL,
- valid_values LONGTEXT NULL DEFAULT NULL,
- sample_value LONGTEXT NULL DEFAULT NULL,
definition LONGTEXT NOT NULL,
description LONGTEXT NOT NULL,
tags LONGTEXT NOT NULL,
|