summaryrefslogtreecommitdiffstats
path: root/common-be
diff options
context:
space:
mode:
authormojahidi <mojahidul.islam@amdocs.com>2019-03-01 17:50:15 +0530
committerOren Kleks <orenkle@amdocs.com>2019-03-04 10:57:03 +0000
commit1f7c57414533b9886962ede7b19a29669fe7a59a (patch)
tree77bbf8f4f339a8f6a61f96e70ca701e2007a6ee3 /common-be
parente0c98681f9fcbae59eab32822784ae95c4768d40 (diff)
Requirement and capabilities feature
1. Enhance Service/VF/PNF to support Req & Cap 2. Added Type fetch APIs to fetch types from global types Change-Id: I2b749ec9da34e488421b8ebe311ccf03c4b7c0fd Issue-ID: SDC-2142 Signed-off-by: mojahidi <mojahidul.islam@amdocs.com>
Diffstat (limited to 'common-be')
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/CapabilityDataDefinition.java2
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/RelationshipInstDataDefinition.java13
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/RequirementDataDefinition.java6
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/JsonPresentationFields.java3
4 files changed, 17 insertions, 7 deletions
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/CapabilityDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/CapabilityDataDefinition.java
index fdd1386e48..2612e6f888 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/CapabilityDataDefinition.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/CapabilityDataDefinition.java
@@ -32,7 +32,7 @@ import java.util.List;
*/
public class CapabilityDataDefinition extends ToscaDataDefinition {
- public static final String MIN_OCCURRENCES = "1";
+ public static final String MIN_OCCURRENCES = "0";
public static final String MAX_OCCURRENCES = "UNBOUNDED";
/**
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/RelationshipInstDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/RelationshipInstDataDefinition.java
index 72d9c36bf6..2f995fd844 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/RelationshipInstDataDefinition.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/RelationshipInstDataDefinition.java
@@ -32,6 +32,7 @@ public class RelationshipInstDataDefinition extends ToscaDataDefinition {
this.setDescription(cdt.getDescription());
this.setType(cdt.getType());
this.setValidSourceTypes(cdt.getValidSourceTypes());
+ this.setValidTargetTypes(cdt.getValidTargetTypes());
this.setVersion(cdt.getVersion());
this.setOriginUI(cdt.isOriginUI());
this.setCreationTime(cdt.getCreationTime());
@@ -54,11 +55,11 @@ public class RelationshipInstDataDefinition extends ToscaDataDefinition {
return (String) getToscaPresentationValue(JsonPresentationFields.REQUIREMENT);
}
public void setCapability(String capability) {
- setToscaPresentationValue(JsonPresentationFields.CAPAPILITY, capability);
+ setToscaPresentationValue(JsonPresentationFields.CAPABILITY, capability);
}
public String getCapability() {
- return (String) getToscaPresentationValue(JsonPresentationFields.CAPAPILITY);
+ return (String) getToscaPresentationValue(JsonPresentationFields.CAPABILITY);
}
public void setToId(Object toId) {
setToscaPresentationValue(JsonPresentationFields.TO_ID, toId);
@@ -144,6 +145,14 @@ public class RelationshipInstDataDefinition extends ToscaDataDefinition {
setToscaPresentationValue(JsonPresentationFields.VALID_SOURCE_TYPES, validSourceTypes);
}
+ public List<String> getValidTargetTypes() {
+ return (List<String>) getToscaPresentationValue(JsonPresentationFields.VALID_TARGET_TYPES);
+ }
+
+ public void setValidTargetTypes(List<String> validTargetTypes) {
+ setToscaPresentationValue(JsonPresentationFields.VALID_TARGET_TYPES, validTargetTypes);
+ }
+
public String getVersion() {
return (String) getToscaPresentationValue(JsonPresentationFields.VERSION);
}
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/RequirementDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/RequirementDataDefinition.java
index 4ede93eaa6..0df5ba500d 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/RequirementDataDefinition.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/RequirementDataDefinition.java
@@ -31,7 +31,7 @@ import java.util.List;
*/
public class RequirementDataDefinition extends ToscaDataDefinition {
- public static final String MIN_OCCURRENCES = "1";
+ public static final String MIN_OCCURRENCES = "0";
public static final String MAX_OCCURRENCES = "UNBOUNDED";
public static final String MAX_DEFAULT_OCCURRENCES = "1";
@@ -107,11 +107,11 @@ public class RequirementDataDefinition extends ToscaDataDefinition {
*/
public String getCapability() {
- return (String) getToscaPresentationValue(JsonPresentationFields.CAPAPILITY);
+ return (String) getToscaPresentationValue(JsonPresentationFields.CAPABILITY);
}
public void setCapability(String capability) {
- setToscaPresentationValue(JsonPresentationFields.CAPAPILITY, capability);
+ setToscaPresentationValue(JsonPresentationFields.CAPABILITY, capability);
}
/**
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/JsonPresentationFields.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/JsonPresentationFields.java
index 7a4c3d4af7..a72984ab7d 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/JsonPresentationFields.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/JsonPresentationFields.java
@@ -129,10 +129,11 @@ public enum JsonPresentationFields {
SOURCE("source", null),
//Requirement
- CAPAPILITY("capability", null),
+ CAPABILITY("capability", null),
NODE("node", null),
RELATIONSHIP("relationship", null),
VALID_SOURCE_TYPES("validSourceTypes", null),
+ VALID_TARGET_TYPES("validTargetTypes", null),
REQUIREMENT_ID("requirementId", null),
PARENT_NAME("parentName", null),
PREVIOUS_NAME("previousName", null),