aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/org
diff options
context:
space:
mode:
authorShabanov, Marina (ms656r) <ms656r@intl.att.com>2019-09-10 10:17:30 +0300
committerShabanov, Marina (ms656r) <ms656r@intl.att.com>2019-09-10 10:17:30 +0300
commit401d395aa68626a4b5bcadd92490da82559f6431 (patch)
treee456b45b2dbc9ada28d1d8a5d7962323bedba8ca /src/main/java/org
parentd587783f089e834be0f568fe6ba30a3dc710199a (diff)
Return Input list from getEntity API
Issue-ID: SDC-2559 Signed-off-by: Shabanov, Marina (ms656r) <ms656r@intl.att.com> Change-Id: I104b83748a1b789a9fe749a38a1b940b00f52e3c
Diffstat (limited to 'src/main/java/org')
-rw-r--r--src/main/java/org/onap/sdc/tosca/parser/api/IEntityDetails.java6
-rw-r--r--src/main/java/org/onap/sdc/tosca/parser/elements/EntityDetails.java11
-rw-r--r--src/main/java/org/onap/sdc/tosca/parser/elements/NodeTemplateEntityDetails.java11
3 files changed, 26 insertions, 2 deletions
diff --git a/src/main/java/org/onap/sdc/tosca/parser/api/IEntityDetails.java b/src/main/java/org/onap/sdc/tosca/parser/api/IEntityDetails.java
index ac160e0..b69a8b3 100644
--- a/src/main/java/org/onap/sdc/tosca/parser/api/IEntityDetails.java
+++ b/src/main/java/org/onap/sdc/tosca/parser/api/IEntityDetails.java
@@ -25,6 +25,7 @@ import org.onap.sdc.toscaparser.api.CapabilityAssignment;
import org.onap.sdc.toscaparser.api.Property;
import org.onap.sdc.toscaparser.api.RequirementAssignment;
import org.onap.sdc.toscaparser.api.elements.Metadata;
+import org.onap.sdc.toscaparser.api.parameters.Input;
import java.util.List;
import java.util.Map;
@@ -104,4 +105,9 @@ public interface IEntityDetails {
* Retrieves list of policy target entity instances (groups or node templates)
*/
List<IEntityDetails> getTargetEntities();
+
+ /**
+ * Retrieves list of inputs
+ */
+ List<Input> getInputs();
}
diff --git a/src/main/java/org/onap/sdc/tosca/parser/elements/EntityDetails.java b/src/main/java/org/onap/sdc/tosca/parser/elements/EntityDetails.java
index 57559c6..6054ac9 100644
--- a/src/main/java/org/onap/sdc/tosca/parser/elements/EntityDetails.java
+++ b/src/main/java/org/onap/sdc/tosca/parser/elements/EntityDetails.java
@@ -26,6 +26,7 @@ import org.onap.sdc.toscaparser.api.CapabilityAssignment;
import org.onap.sdc.toscaparser.api.EntityTemplate;
import org.onap.sdc.toscaparser.api.Property;
import org.onap.sdc.toscaparser.api.RequirementAssignment;
+import org.onap.sdc.toscaparser.api.parameters.Input;
import java.util.Collections;
import java.util.List;
@@ -47,7 +48,7 @@ public abstract class EntityDetails implements IEntityDetails {
return entityTemplate.getName();
}
- EntityTemplate getEntityTemplate() {
+ public EntityTemplate getEntityTemplate() {
return entityTemplate;
}
@@ -109,7 +110,13 @@ public abstract class EntityDetails implements IEntityDetails {
}
@Override
- public List<String> getMembers() { return Collections.emptyList(); }
+ public List<String> getMembers()
+ { return Collections.emptyList(); }
+
+ @Override
+ public List<Input> getInputs(){
+ return Collections.emptyList();
+ }
diff --git a/src/main/java/org/onap/sdc/tosca/parser/elements/NodeTemplateEntityDetails.java b/src/main/java/org/onap/sdc/tosca/parser/elements/NodeTemplateEntityDetails.java
index 9893856..3b7aa99 100644
--- a/src/main/java/org/onap/sdc/tosca/parser/elements/NodeTemplateEntityDetails.java
+++ b/src/main/java/org/onap/sdc/tosca/parser/elements/NodeTemplateEntityDetails.java
@@ -24,6 +24,9 @@ import org.onap.sdc.tosca.parser.enums.EntityTemplateType;
import org.onap.sdc.toscaparser.api.EntityTemplate;
import org.onap.sdc.toscaparser.api.NodeTemplate;
import org.onap.sdc.toscaparser.api.elements.Metadata;
+import org.onap.sdc.toscaparser.api.parameters.Input;
+
+import java.util.List;
public class NodeTemplateEntityDetails extends EntityDetails {
@@ -43,4 +46,12 @@ public class NodeTemplateEntityDetails extends EntityDetails {
public Metadata getMetadata() {
return nodeTemplate.getMetaData();
}
+
+ @Override
+ public List<Input> getInputs(){
+ if (nodeTemplate.getSubMappingToscaTemplate()!= null) {
+ return nodeTemplate.getSubMappingToscaTemplate().getInputs();
+ }
+ return super.getInputs();
+ }
}