aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-model
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-model')
-rw-r--r--catalog-model/src/main/java/org/openecomp/sdc/be/model/AttributeDefinition.java47
-rw-r--r--catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/NodeTypeOperation.java5
-rw-r--r--catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/ToscaElementOperation.java1
3 files changed, 21 insertions, 32 deletions
diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/AttributeDefinition.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/AttributeDefinition.java
index ee819310c1..1cf3baaac7 100644
--- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/AttributeDefinition.java
+++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/AttributeDefinition.java
@@ -19,55 +19,40 @@
*/
package org.openecomp.sdc.be.model;
-import lombok.Getter;
-import lombok.Setter;
-import lombok.ToString;
-import org.onap.sdc.tosca.datatypes.model.EntrySchema;
+import lombok.NoArgsConstructor;
import org.openecomp.sdc.be.datatypes.elements.AttributeDataDefinition;
-@Getter
-@Setter
-@ToString
+@NoArgsConstructor
public class AttributeDefinition extends AttributeDataDefinition implements IOperationParameter, IComplexDefaultValue {
- // All names are according to TOSCA spec from
- // https://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.3/os/TOSCA-Simple-Profile-YAML-v1.3-os.html#DEFN_ELEMENT_ATTRIBUTE_DEFN
- private String type;
- private String description;
- private Object _default;
- private String status;
- private EntrySchema entry_schema;
-
- public AttributeDefinition() {
- toscaPresentation = null;
- }
-
public AttributeDefinition(final AttributeDataDefinition attributeDataDefinition) {
super(attributeDataDefinition);
}
- public AttributeDefinition(final AttributeDefinition attributeDefinition) {
- super(attributeDefinition);
- this.type = attributeDefinition.getType();
- this.description = attributeDefinition.getDescription();
- this._default = attributeDefinition.get_default();
- this.status = attributeDefinition.getStatus();
- this.entry_schema = attributeDefinition.getEntry_schema();
- this.toscaPresentation = attributeDefinition.toscaPresentation;
- }
-
@Override
public String getDefaultValue() {
- return _default == null ? null : String.valueOf(_default);
+ return get_default() == null ? null : String.valueOf(get_default());
}
@Override
public void setDefaultValue(final String value) {
- this._default = value;
+ set_default(value);
}
@Override
public boolean isDefinition() {
return false;
}
+
+ @Override
+ public String toString() {
+ return "AttributeDefinition{" +
+ "name=" + getName() +
+ "uniqueId=" + getUniqueId() +
+ "ownerId=" + getOwnerId() +
+ "type=" + getType() +
+ "description=" + getDescription() +
+ "default=" + getDefaultValue() +
+ '}';
+ }
}
diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/NodeTypeOperation.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/NodeTypeOperation.java
index e8aba6dcb6..10c58ba697 100644
--- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/NodeTypeOperation.java
+++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/NodeTypeOperation.java
@@ -547,6 +547,11 @@ public class NodeTypeOperation extends ToscaElementOperation {
ToscaDataDefinition.mergeDataMaps(attributesAll, attributes);
}
if (!attributesAll.isEmpty()) {
+ log.debug("Creating vertex for attributes {}:{}", nodeType.getName(), nodeType.getUniqueId());
+ attributesAll.forEach((s, attributeDataDefinition) -> {
+ log.debug("Attribute {}:{}", s, attributeDataDefinition.getUniqueId());
+ });
+
Either<GraphVertex, StorageOperationStatus> assosiateElementToData = associateElementToData(nodeTypeVertex, VertexTypeEnum.ATTRIBUTES, EdgeLabelEnum.ATTRIBUTES, attributesAll);
if (assosiateElementToData.isRight()) {
return assosiateElementToData.right().value();
diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/ToscaElementOperation.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/ToscaElementOperation.java
index 32f7e14e00..8c8245e87f 100644
--- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/ToscaElementOperation.java
+++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/ToscaElementOperation.java
@@ -922,7 +922,6 @@ public abstract class ToscaElementOperation extends BaseOperation {
switch (label) {
case NODE_TYPE:
toscaElement = new NodeType();
- toscaElement.setAttributes(getAttributesFromComponentV(componentV));
break;
case TOPOLOGY_TEMPLATE:
toscaElement = new TopologyTemplate();