summaryrefslogtreecommitdiffstats
path: root/ms/controllerblueprints/modules/service/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'ms/controllerblueprints/modules/service/src/main')
-rw-r--r--ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/DataBaseInitService.java34
-rw-r--r--ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/ResourceDictionaryService.java4
-rw-r--r--ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/domain/ResourceDictionary.java51
-rw-r--r--ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/validator/ResourceDictionaryValidator.java4
-rw-r--r--ms/controllerblueprints/modules/service/src/main/resources/sql/schema-local.sql4
-rw-r--r--ms/controllerblueprints/modules/service/src/main/resources/sql/schema.sql4
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,