diff options
author | vasraz <vasyl.razinkov@est.tech> | 2021-02-05 19:24:06 +0000 |
---|---|---|
committer | Christophe Closset <christophe.closset@intl.att.com> | 2021-02-24 08:03:45 +0000 |
commit | b6d953c506c08a5369c0be7242ef3ce3ec888452 (patch) | |
tree | dbe45662f4252e88df9161c917664ba578bcc7a3 /common-be/src/main/java/org/openecomp | |
parent | b485c37b36ddb3ab5e8085c009b26e97c8e62d74 (diff) |
Implement Attributes/Outputs BE (part 2)
This commit includes support for:
- declare Attribute as Output
- undeclare Attribute as Output
- export 'Tosca Artifacts' with Attributes/Outputs
Change-Id: Iedfbf936e439fd2f7d252b660fe2c42b8d9b9113
Signed-off-by: Vasyl Razinkov <vasyl.razinkov@est.tech>
Issue-ID: SDC-3448
Diffstat (limited to 'common-be/src/main/java/org/openecomp')
4 files changed, 33 insertions, 19 deletions
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/AttributeDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/AttributeDataDefinition.java index f1ca2167f6..d159da853a 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/AttributeDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/AttributeDataDefinition.java @@ -19,9 +19,9 @@ */ package org.openecomp.sdc.be.datatypes.elements; -import java.io.Serializable; import java.util.List; import lombok.Getter; +import lombok.NoArgsConstructor; import lombok.Setter; import org.onap.sdc.tosca.datatypes.model.EntrySchema; import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields; @@ -29,14 +29,16 @@ import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition; @Getter @Setter -public class AttributeDataDefinition extends ToscaDataDefinition implements Serializable { +@NoArgsConstructor +public class AttributeDataDefinition extends ToscaDataDefinition { private List<GetOutputValueDataDefinition> getOutputValues; private String outputId; private String value; - - public AttributeDataDefinition() { - } + private String outputPath; + private String instanceUniqueId; + private String attributeId; + private String parentUniqueId; public AttributeDataDefinition(final AttributeDataDefinition attributeDataDefinition) { super(); @@ -46,16 +48,21 @@ public class AttributeDataDefinition extends ToscaDataDefinition implements Seri this.setType(attributeDataDefinition.getType()); this.setDescription(attributeDataDefinition.getDescription()); this.set_default(attributeDataDefinition.get_default()); + this.setValue(attributeDataDefinition.getValue()); this.setStatus(attributeDataDefinition.getStatus()); this.setEntry_schema(attributeDataDefinition.getEntry_schema()); this.setSchema(attributeDataDefinition.getSchema()); + this.setOutputPath(attributeDataDefinition.getOutputPath()); + this.setInstanceUniqueId(attributeDataDefinition.getInstanceUniqueId()); + this.setAttributeId(attributeDataDefinition.getAttributeId()); + this.setParentUniqueId(attributeDataDefinition.getParentUniqueId()); } public String getUniqueId() { return (String) getToscaPresentationValue(JsonPresentationFields.UNIQUE_ID); } - public void setUniqueId(String uniqueId) { + public void setUniqueId(final String uniqueId) { setToscaPresentationValue(JsonPresentationFields.UNIQUE_ID, uniqueId); } @@ -65,7 +72,7 @@ public class AttributeDataDefinition extends ToscaDataDefinition implements Seri } @Override - public void setOwnerId(String ownerId) { + public void setOwnerId(final String ownerId) { setToscaPresentationValue(JsonPresentationFields.OWNER_ID, ownerId); } @@ -73,7 +80,7 @@ public class AttributeDataDefinition extends ToscaDataDefinition implements Seri return (String) getToscaPresentationValue(JsonPresentationFields.NAME); } - public void setName(String name) { + public void setName(final String name) { setToscaPresentationValue(JsonPresentationFields.NAME, name); } @@ -82,7 +89,8 @@ public class AttributeDataDefinition extends ToscaDataDefinition implements Seri return (String) getToscaPresentationValue(JsonPresentationFields.TYPE); } - public void setType(String type) { + @Override + public void setType(final String type) { setToscaPresentationValue(JsonPresentationFields.TYPE, type); } @@ -90,7 +98,7 @@ public class AttributeDataDefinition extends ToscaDataDefinition implements Seri return (String) getToscaPresentationValue(JsonPresentationFields.DESCRIPTION); } - public void setDescription(String description) { + public void setDescription(final String description) { setToscaPresentationValue(JsonPresentationFields.DESCRIPTION, description); } @@ -98,7 +106,7 @@ public class AttributeDataDefinition extends ToscaDataDefinition implements Seri return getToscaPresentationValue(JsonPresentationFields.DEFAULT); } - public void set_default(Object _default) { + public void set_default(final Object _default) { setToscaPresentationValue(JsonPresentationFields.DEFAULT, _default); } @@ -106,7 +114,7 @@ public class AttributeDataDefinition extends ToscaDataDefinition implements Seri return (String) getToscaPresentationValue(JsonPresentationFields.STATUS); } - public void setStatus(String status) { + public void setStatus(final String status) { setToscaPresentationValue(JsonPresentationFields.STATUS, status); } @@ -114,7 +122,7 @@ public class AttributeDataDefinition extends ToscaDataDefinition implements Seri return (EntrySchema) getToscaPresentationValue(JsonPresentationFields.SCHEMA); } - public void setEntry_schema(EntrySchema entrySchema) { + public void setEntry_schema(final EntrySchema entrySchema) { setToscaPresentationValue(JsonPresentationFields.SCHEMA, entrySchema); } @@ -122,4 +130,8 @@ public class AttributeDataDefinition extends ToscaDataDefinition implements Seri return (SchemaDefinition) getToscaPresentationValue(JsonPresentationFields.SCHEMA); } + public String getParentUniqueId() { + return getOwnerId(); + } + } diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/GetOutputValueDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/GetOutputValueDataDefinition.java index 8bb7f7e153..534aa232c8 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/GetOutputValueDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/GetOutputValueDataDefinition.java @@ -34,11 +34,11 @@ import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition; public class GetOutputValueDataDefinition extends ToscaDataDefinition { private String attribName; - private String inputName; - private String inputId; + private String outputName; + private String outputId; private Integer indexValue; private GetOutputValueDataDefinition getOutputIndex; - private boolean isList = false; + private boolean isList; public GetOutputValueDataDefinition() { super(); @@ -50,8 +50,8 @@ public class GetOutputValueDataDefinition extends ToscaDataDefinition { public GetOutputValueDataDefinition(GetOutputValueDataDefinition p) { this.setAttribName(p.getAttribName()); - this.setInputName(p.getInputName()); - this.setInputId(p.getInputId()); + this.setOutputName(p.getOutputName()); + this.setOutputId(p.getOutputId()); this.setIndexValue(p.getIndexValue()); this.setGetOutputIndex(p.getGetOutputIndex()); this.setList(p.isList()); diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/ComponentFieldsEnum.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/ComponentFieldsEnum.java index 91c956d613..ac6d1bba82 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/ComponentFieldsEnum.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/ComponentFieldsEnum.java @@ -40,6 +40,7 @@ public enum ComponentFieldsEnum { ATTRIBUTES("attributes"), COMPONENT_INSTANCES_ATTRIBUTES("componentInstancesAttributes"), COMPONENT_INSTANCE_INPUTS("componentInstancesInputs"), + COMPONENT_INSTANCE_OUTPUTS("componentInstancesOutputs"), COMPONENT_INSTANCE_RELATION("componentInstancesRelations"), DEPLOYMENT_ARTIFACTS("deploymentArtifacts"), TOSCA_ARTIFACTS("toscaArtifacts"), diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/DeclarationTypeEnum.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/DeclarationTypeEnum.java index a25df30fcd..30b536ea1d 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/DeclarationTypeEnum.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/DeclarationTypeEnum.java @@ -22,5 +22,6 @@ package org.openecomp.sdc.be.datatypes.enums; public enum DeclarationTypeEnum { INPUT, - POLICY; + OUTPUT, + POLICY } |