aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Lando <ml636r@att.com>2017-11-01 12:32:22 +0200
committerMichael Lando <ml636r@att.com>2017-11-01 12:32:22 +0200
commitf3f4dc3d82aed8424f820747c19ab546d8ca02b6 (patch)
treecf92d60747761e42373f522d6714b060faa7f4f3
parent041a46e73ce69584df7ebf8cf8235a55de855af3 (diff)
revert changes and update versionv1.1.11.0.0-ONAP1.0.0-Amsterdam
Change-Id: I4fa696c7a20adfcce6733ac004c2457528d626a4 Issue-Id: SDC-569 Signed-off-by: Michael Lando <ml636r@att.com>
-rw-r--r--pom.xml424
-rw-r--r--src/main/java/org/openecomp/sdc/toscaparser/api/TopologyTemplate.java22
-rw-r--r--src/main/java/org/openecomp/sdc/toscaparser/api/ToscaTemplate.java28
-rw-r--r--src/main/java/org/openecomp/sdc/toscaparser/api/extensions/ExtTools.java4
-rw-r--r--src/main/java/org/openecomp/sdc/toscaparser/api/functions/Function.java40
-rw-r--r--src/main/java/org/openecomp/sdc/toscaparser/api/functions/GetProperty.java4
-rw-r--r--version.properties2
7 files changed, 248 insertions, 276 deletions
diff --git a/pom.xml b/pom.xml
index 2fae095..6af670b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,212 +1,212 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <groupId>org.openecomp.sdc.jtosca</groupId>
- <artifactId>jtosca</artifactId>
- <version>1.1.3-SNAPSHOT</version>
- <name>sdc-jtosca</name>
- <properties>
-
- <!-- ==================== -->
- <!-- Generic properties -->
- <!-- ==================== -->
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-
- <!-- ==================== -->
- <!-- Versions -->
- <!-- ==================== -->
- <!-- Global project version -->
-
- <!-- Dependencies projects version -->
- <sonar.skipDesign>true</sonar.skipDesign>
- <sonar.projectBaseDir>${project.basedir}</sonar.projectBaseDir>
- <sonar.jacoco.reportPath>${project.basedir}/target/jacoco.exec</sonar.jacoco.reportPath>
- <nexus.proxy>https://nexus.onap.org</nexus.proxy>
- <sitePath>/content/sites/site/org/openecomp/sdc/jtosca/${project.version}</sitePath>
- <snapshots.path>snapshots</snapshots.path>
- <releases.path>releases</releases.path>
- <staging.profile.id>176c31dfe190a</staging.profile.id>
-
- </properties>
-
- <dependencies>
- <!-- YAML parser -->
- <dependency>
- <groupId>org.yaml</groupId>
- <artifactId>snakeyaml</artifactId>
- <version>1.14</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <version>1.7.25</version>
- </dependency>
-
- <!-- <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId>
- <version>1.1.2</version> <scope>test</scope> </dependency> -->
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.12</version>
- </dependency>
- </dependencies>
-
- <reporting>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <version>2.10.4</version>
- <configuration>
- <failOnError>false</failOnError>
- <doclet>org.umlgraph.doclet.UmlGraphDoc</doclet>
- <docletArtifact>
- <groupId>org.umlgraph</groupId>
- <artifactId>umlgraph</artifactId>
- <version>5.6</version>
- </docletArtifact>
- <additionalparam>-views</additionalparam>
- <useStandardDocletOptions>true</useStandardDocletOptions>
- </configuration>
- </plugin>
- </plugins>
- </reporting>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-site-plugin</artifactId>
- <version>3.4</version>
- <dependencies>
- <dependency>
- <groupId>org.apache.maven.wagon</groupId>
- <artifactId>wagon-webdav-jackrabbit</artifactId>
- <version>2.10</version>
- </dependency>
- </dependencies>
- </plugin>
-
- <plugin>
- <groupId>org.jacoco</groupId>
- <artifactId>jacoco-maven-plugin</artifactId>
- <version>0.7.8</version>
- <executions>
- <!-- Unit-Tests -->
- <execution>
- <id>prepare-agent</id>
- <goals>
- <goal>prepare-agent</goal>
- </goals>
- <configuration>
- <destFile>${sonar.jacoco.reportPath}</destFile>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <!-- Staging Plugin -->
- <plugin>
- <groupId>org.sonatype.plugins</groupId>
- <artifactId>nexus-staging-maven-plugin</artifactId>
- <version>1.6.7</version>
- <extensions>true</extensions>
- <configuration>
- <nexusUrl>${nexus.proxy}</nexusUrl>
- <stagingProfileId>${staging.profile.id}</stagingProfileId>
- <serverId>ecomp-staging</serverId>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>2.5.1</version>
- <inherited>true</inherited>
- <configuration>
- <source>1.8</source>
- <target>1.8</target>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <version>2.10.3</version>
- <configuration />
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>license-maven-plugin</artifactId>
- <version>1.10</version>
- <configuration>
- <addJavaLicenseAfterPackage>false</addJavaLicenseAfterPackage>
- <processStartTag>============LICENSE_START=======================================================</processStartTag>
- <processEndTag>============LICENSE_END=========================================================</processEndTag>
- <sectionDelimiter>================================================================================</sectionDelimiter>
- <licenseName>apache_v2</licenseName>
- <inceptionYear>2017</inceptionYear>
- <organizationName>AT&amp;T Intellectual Property. All rights
- reserved.</organizationName>
- <projectName>jtosca</projectName>
- <canUpdateCopyright>true</canUpdateCopyright>
- <canUpdateDescription>true</canUpdateDescription>
- <canUpdateLicense>true</canUpdateLicense>
- <emptyLineAfterHeader>true</emptyLineAfterHeader>
- <verbose>false</verbose>
- <includes>
- <include>**/*.java</include>
- </includes>
- </configuration>
- <executions>
- <execution>
- <id>first</id>
- <goals>
- <goal>update-file-header</goal>
- </goals>
- <!--phase>process-sources</phase -->
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
- <repositories>
- <repository>
- <id>central</id>
- <name>Official Maven repository</name>
- <url>http://repo2.maven.org/maven2/</url>
- </repository>
- <repository>
- <id>ecomp-releases</id>
- <name>Release Repository</name>
- <url>${nexus.proxy}/content/repositories/releases/</url>
- </repository>
- <repository>
- <id>ecomp-staging</id>
- <name>Staging Repository</name>
- <url>${nexus.proxy}/content/repositories/staging/</url>
- </repository>
- </repositories>
-
- <distributionManagement>
- <repository>
- <id>ecomp-releases</id>
- <name>Release Repository</name>
- <url>${nexus.proxy}/content/repositories/${releases.path}/</url>
- </repository>
- <snapshotRepository>
- <id>ecomp-snapshots</id>
- <name>Snapshot Repository</name>
- <url>${nexus.proxy}/content/repositories/${snapshots.path}/</url>
- </snapshotRepository>
- <site>
- <id>ecomp-site</id>
- <url>dav:${nexus.proxy}${sitePath}</url>
- </site>
- </distributionManagement>
-
-</project>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.openecomp.sdc.jtosca</groupId>
+ <artifactId>jtosca</artifactId>
+ <version>1.1.1-SNAPSHOT</version>
+ <name>sdc-jtosca</name>
+ <properties>
+
+ <!-- ==================== -->
+ <!-- Generic properties -->
+ <!-- ==================== -->
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+
+ <!-- ==================== -->
+ <!-- Versions -->
+ <!-- ==================== -->
+ <!-- Global project version -->
+
+ <!-- Dependencies projects version -->
+ <sonar.skipDesign>true</sonar.skipDesign>
+ <sonar.projectBaseDir>${project.basedir}</sonar.projectBaseDir>
+ <sonar.jacoco.reportPath>${project.basedir}/target/jacoco.exec</sonar.jacoco.reportPath>
+ <nexus.proxy>https://nexus.onap.org</nexus.proxy>
+ <sitePath>/content/sites/site/org/openecomp/sdc/jtosca/${project.version}</sitePath>
+ <snapshots.path>snapshots</snapshots.path>
+ <releases.path>releases</releases.path>
+ <staging.profile.id>176c31dfe190a</staging.profile.id>
+
+ </properties>
+
+ <dependencies>
+ <!-- YAML parser -->
+ <dependency>
+ <groupId>org.yaml</groupId>
+ <artifactId>snakeyaml</artifactId>
+ <version>1.14</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.7.25</version>
+ </dependency>
+
+ <!-- <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId>
+ <version>1.1.2</version> <scope>test</scope> </dependency> -->
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.12</version>
+ </dependency>
+ </dependencies>
+
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>2.10.4</version>
+ <configuration>
+ <failOnError>false</failOnError>
+ <doclet>org.umlgraph.doclet.UmlGraphDoc</doclet>
+ <docletArtifact>
+ <groupId>org.umlgraph</groupId>
+ <artifactId>umlgraph</artifactId>
+ <version>5.6</version>
+ </docletArtifact>
+ <additionalparam>-views</additionalparam>
+ <useStandardDocletOptions>true</useStandardDocletOptions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </reporting>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-site-plugin</artifactId>
+ <version>3.4</version>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven.wagon</groupId>
+ <artifactId>wagon-webdav-jackrabbit</artifactId>
+ <version>2.10</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+
+ <plugin>
+ <groupId>org.jacoco</groupId>
+ <artifactId>jacoco-maven-plugin</artifactId>
+ <version>0.7.8</version>
+ <executions>
+ <!-- Unit-Tests -->
+ <execution>
+ <id>prepare-agent</id>
+ <goals>
+ <goal>prepare-agent</goal>
+ </goals>
+ <configuration>
+ <destFile>${sonar.jacoco.reportPath}</destFile>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <!-- Staging Plugin -->
+ <plugin>
+ <groupId>org.sonatype.plugins</groupId>
+ <artifactId>nexus-staging-maven-plugin</artifactId>
+ <version>1.6.7</version>
+ <extensions>true</extensions>
+ <configuration>
+ <nexusUrl>${nexus.proxy}</nexusUrl>
+ <stagingProfileId>${staging.profile.id}</stagingProfileId>
+ <serverId>ecomp-staging</serverId>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.5.1</version>
+ <inherited>true</inherited>
+ <configuration>
+ <source>1.8</source>
+ <target>1.8</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>2.10.3</version>
+ <configuration />
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>license-maven-plugin</artifactId>
+ <version>1.10</version>
+ <configuration>
+ <addJavaLicenseAfterPackage>false</addJavaLicenseAfterPackage>
+ <processStartTag>============LICENSE_START=======================================================</processStartTag>
+ <processEndTag>============LICENSE_END=========================================================</processEndTag>
+ <sectionDelimiter>================================================================================</sectionDelimiter>
+ <licenseName>apache_v2</licenseName>
+ <inceptionYear>2017</inceptionYear>
+ <organizationName>AT&amp;T Intellectual Property. All rights
+ reserved.</organizationName>
+ <projectName>jtosca</projectName>
+ <canUpdateCopyright>true</canUpdateCopyright>
+ <canUpdateDescription>true</canUpdateDescription>
+ <canUpdateLicense>true</canUpdateLicense>
+ <emptyLineAfterHeader>true</emptyLineAfterHeader>
+ <verbose>false</verbose>
+ <includes>
+ <include>**/*.java</include>
+ </includes>
+ </configuration>
+ <executions>
+ <execution>
+ <id>first</id>
+ <goals>
+ <goal>update-file-header</goal>
+ </goals>
+ <!--phase>process-sources</phase -->
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <repositories>
+ <repository>
+ <id>central</id>
+ <name>Official Maven repository</name>
+ <url>http://repo2.maven.org/maven2/</url>
+ </repository>
+ <repository>
+ <id>ecomp-releases</id>
+ <name>Release Repository</name>
+ <url>${nexus.proxy}/content/repositories/releases/</url>
+ </repository>
+ <repository>
+ <id>ecomp-staging</id>
+ <name>Staging Repository</name>
+ <url>${nexus.proxy}/content/repositories/staging/</url>
+ </repository>
+ </repositories>
+
+ <distributionManagement>
+ <repository>
+ <id>ecomp-releases</id>
+ <name>Release Repository</name>
+ <url>${nexus.proxy}/content/repositories/${releases.path}/</url>
+ </repository>
+ <snapshotRepository>
+ <id>ecomp-snapshots</id>
+ <name>Snapshot Repository</name>
+ <url>${nexus.proxy}/content/repositories/${snapshots.path}/</url>
+ </snapshotRepository>
+ <site>
+ <id>ecomp-site</id>
+ <url>dav:${nexus.proxy}${sitePath}</url>
+ </site>
+ </distributionManagement>
+
+</project>
diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/TopologyTemplate.java b/src/main/java/org/openecomp/sdc/toscaparser/api/TopologyTemplate.java
index 709dc81..25f118b 100644
--- a/src/main/java/org/openecomp/sdc/toscaparser/api/TopologyTemplate.java
+++ b/src/main/java/org/openecomp/sdc/toscaparser/api/TopologyTemplate.java
@@ -48,15 +48,13 @@ public class TopologyTemplate {
private String description;
private ToscaGraph graph;
private SubstitutionMappings substitutionMappings;
- private boolean resolveGetInput;
public TopologyTemplate(
LinkedHashMap<String,Object> _template,
LinkedHashMap<String,Object> _customDefs,
LinkedHashMap<String,Object> _relTypes,//TYPE
LinkedHashMap<String, Object> _parsedParams,
- NodeTemplate _subMappedNodeTemplate,
- boolean _resolveGetInput) {
+ NodeTemplate _subMappedNodeTemplate) {
tpl = _template;
if(tpl != null) {
@@ -65,7 +63,6 @@ public class TopologyTemplate {
customDefs = _customDefs;
relTypes = _relTypes;
parsedParams = _parsedParams;
- resolveGetInput = _resolveGetInput;
_validateField();
description = _tplDescription();
inputs = _inputs();
@@ -403,14 +400,14 @@ public class TopologyTemplate {
if(nodeTemplates != null) {
for(NodeTemplate nt: nodeTemplates) {
for(Property prop: nt.getPropertiesObjects()) {
- prop.setValue(Function.getFunction(this,nt,prop.getValue(), resolveGetInput));
+ prop.setValue(Function.getFunction(this,nt,prop.getValue()));
}
for(InterfacesDef ifd: nt.getInterfaces()) {
LinkedHashMap<String,Object> ifin = ifd.getInputs();
if(ifin != null) {
for(Map.Entry<String,Object> me: ifin.entrySet()) {
String name = me.getKey();
- Object value = Function.getFunction(this,nt,me.getValue(), resolveGetInput);
+ Object value = Function.getFunction(this,nt,me.getValue());
ifd.setInput(name,value);
}
}
@@ -441,7 +438,7 @@ public class TopologyTemplate {
(LinkedHashMap<String,Object>)rel.get("properties");
for(String key: relprops.keySet()) {
Object value = relprops.get(key);
- Object func = Function.getFunction(this,req,value, resolveGetInput);
+ Object func = Function.getFunction(this,req,value);
relprops.put(key,func);
}
}
@@ -451,7 +448,7 @@ public class TopologyTemplate {
for(Capability cap: nt.getCapabilitiesObjects()) {
if(cap.getPropertiesObjects() != null) {
for(Property prop: cap.getPropertiesObjects()) {
- Object propvalue = Function.getFunction(this,nt,prop.getValue(), resolveGetInput);
+ Object propvalue = Function.getFunction(this,nt,prop.getValue());
if(propvalue instanceof GetInput) {
propvalue = ((GetInput)propvalue).result();
for(String p: cap.getProperties().keySet()) {
@@ -478,8 +475,7 @@ public class TopologyTemplate {
Object func = Function.getFunction(
this,
relTpl,
- value,
- resolveGetInput);
+ value);
iface.setInput(name,func);
}
}
@@ -490,7 +486,7 @@ public class TopologyTemplate {
}
}
for(Output output: outputs) {
- Object func = Function.getFunction(this,outputs,output.getValue(), resolveGetInput);
+ Object func = Function.getFunction(this,outputs,output.getValue());
if(func instanceof GetAttribute) {
output.setAttr(Output.VALUE,func);
}
@@ -546,10 +542,6 @@ public class TopologyTemplate {
public LinkedHashMap<String,Object> getParsedParams() {
return parsedParams;
}
-
- public boolean getResolveGetInput() {
- return resolveGetInput;
- }
}
/*python
diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/ToscaTemplate.java b/src/main/java/org/openecomp/sdc/toscaparser/api/ToscaTemplate.java
index 5d5cb87..76b86f5 100644
--- a/src/main/java/org/openecomp/sdc/toscaparser/api/ToscaTemplate.java
+++ b/src/main/java/org/openecomp/sdc/toscaparser/api/ToscaTemplate.java
@@ -69,7 +69,6 @@ public class ToscaTemplate extends Object {
private String path;
private String inputPath;
private LinkedHashMap<String,Object> parsedParams;
- private boolean resolveGetInput;
private LinkedHashMap<String,Object> tpl;
private String version;
private ArrayList<Object> imports;
@@ -90,25 +89,11 @@ public class ToscaTemplate extends Object {
private int nestingLoopCounter;
private LinkedHashMap<String, LinkedHashMap<String, Object>> metaProperties;
+ @SuppressWarnings("unchecked")
public ToscaTemplate(String _path,
- LinkedHashMap<String,Object> _parsedParams,
- boolean aFile,
- LinkedHashMap<String,Object> yamlDictTpl) throws JToscaException {
- init(_path, _parsedParams, aFile, yamlDictTpl, true);
- }
-
- public ToscaTemplate(String _path,
- LinkedHashMap<String,Object> _parsedParams,
+ LinkedHashMap<String,Object> _parsedParams,
boolean aFile,
- LinkedHashMap<String,Object> yamlDictTpl, boolean resolveGetInput) throws JToscaException {
- init(_path, _parsedParams, aFile, yamlDictTpl, resolveGetInput);
- }
-
- @SuppressWarnings("unchecked")
- private void init(String _path,
- LinkedHashMap<String, Object> _parsedParams,
- boolean aFile,
- LinkedHashMap<String, Object> yamlDictTpl, boolean _resolveGetInput) throws JToscaException {
+ LinkedHashMap<String,Object> yamlDictTpl) throws JToscaException {
ThreadLocalsHolder.setCollector(new ExceptionCollector(_path));
@@ -131,7 +116,6 @@ public class ToscaTemplate extends Object {
csarTempDir = null;
nestedToscaTplsWithTopology = new ConcurrentHashMap<>();
nestedToscaTemplatesWithTopology = new ArrayList<TopologyTemplate>();
- resolveGetInput = _resolveGetInput;
if(_path != null && !_path.isEmpty()) {
// save the original input path
@@ -222,8 +206,7 @@ public class ToscaTemplate extends Object {
_getAllCustomDefs(imports),
relationshipTypes,
parsedParams,
- null,
- resolveGetInput);
+ null);
}
private ArrayList<Input> _inputs() {
@@ -401,8 +384,7 @@ public class ToscaTemplate extends Object {
_getAllCustomDefs(alim),
relationshipTypes,
parsedParams,
- nt,
- resolveGetInput);
+ nt);
if(topologyWithSubMapping.getSubstitutionMappings() != null) {
// Record nested topology templates in top level template
//nestedToscaTemplatesWithTopology.add(topologyWithSubMapping);
diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/extensions/ExtTools.java b/src/main/java/org/openecomp/sdc/toscaparser/api/extensions/ExtTools.java
index 90aa35c..6403d6e 100644
--- a/src/main/java/org/openecomp/sdc/toscaparser/api/extensions/ExtTools.java
+++ b/src/main/java/org/openecomp/sdc/toscaparser/api/extensions/ExtTools.java
@@ -37,6 +37,10 @@ public class ExtTools {
// for all folders in extdir
File extDir = new File(extdir);
File extDirList[] = extDir.listFiles();
+ if (extDirList == null) {
+ String a = "aaaa";
+
+ }
if (extDirList != null) {
for(File f: extDirList) {
if(f.isDirectory()) {
diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/functions/Function.java b/src/main/java/org/openecomp/sdc/toscaparser/api/functions/Function.java
index 7615a00..85fa62e 100644
--- a/src/main/java/org/openecomp/sdc/toscaparser/api/functions/Function.java
+++ b/src/main/java/org/openecomp/sdc/toscaparser/api/functions/Function.java
@@ -3,7 +3,6 @@ package org.openecomp.sdc.toscaparser.api.functions;
import java.util.*;
import org.openecomp.sdc.toscaparser.api.TopologyTemplate;
-import org.openecomp.sdc.toscaparser.api.ToscaTemplate;
public abstract class Function {
@@ -78,7 +77,7 @@ public abstract class Function {
}
@SuppressWarnings("unchecked")
- public static Object getFunction(TopologyTemplate ttpl,Object context,Object rawFunctionObj, boolean resolveGetInput) {
+ public static Object getFunction(TopologyTemplate ttpl,Object context,Object rawFunctionObj) {
// Gets a Function instance representing the provided template function.
// If the format provided raw_function format is not relevant for template
@@ -99,13 +98,13 @@ public abstract class Function {
if (rawFunctionObj instanceof LinkedHashMap) { // In map type case
LinkedHashMap rawFunction = ((LinkedHashMap) rawFunctionObj);
if(rawFunction.size() == 1) { // End point
- return getFunctionForObjectItem(ttpl, context, rawFunction, resolveGetInput);
+ return getFunctionForObjectItem(ttpl, context, rawFunction);
} else {
// iterate over map nested properties in recursion, convert leaves to function,
// and collect them in the same hierarchy as the original map.
LinkedHashMap rawFunctionObjMap = new LinkedHashMap();
for (Object rawFunctionObjItem: rawFunction.entrySet()) {
- Object itemValue = getFunction(ttpl, context, ((Map.Entry)rawFunctionObjItem).getValue(), resolveGetInput);
+ Object itemValue = getFunction(ttpl, context, ((Map.Entry)rawFunctionObjItem).getValue());
rawFunctionObjMap.put(((Map.Entry)rawFunctionObjItem).getKey(), itemValue);
}
return rawFunctionObjMap;
@@ -115,7 +114,7 @@ public abstract class Function {
// and collect them in the same hierarchy as the original list.
ArrayList<Object> rawFunctionObjList = new ArrayList<>();
for (Object rawFunctionObjItem: (ArrayList) rawFunctionObj) {
- rawFunctionObjList.add(getFunction(ttpl, context, rawFunctionObjItem, resolveGetInput));
+ rawFunctionObjList.add(getFunction(ttpl, context, rawFunctionObjItem));
}
return rawFunctionObjList;
}
@@ -123,7 +122,7 @@ public abstract class Function {
return rawFunctionObj;
}
- private static Object getFunctionForObjectItem(TopologyTemplate ttpl, Object context, Object rawFunctionObjItem, boolean resolveGetInput) {
+ private static Object getFunctionForObjectItem(TopologyTemplate ttpl, Object context, Object rawFunctionObjItem) {
if(isFunction(rawFunctionObjItem)) {
LinkedHashMap<String, Object> rawFunction = (LinkedHashMap<String, Object>) rawFunctionObjItem;
String funcName = (new ArrayList<String>(rawFunction.keySet())).get(0);
@@ -138,23 +137,18 @@ public abstract class Function {
funcArgs.add(oargs);
}
- switch (funcType) {
- case "GetInput":
- if (resolveGetInput) {
- GetInput input = new GetInput(ttpl, context, funcName, funcArgs);
- return input.result();
- }
- return new GetInput(ttpl, context, funcName, funcArgs);
- case "GetAttribute":
- return new GetAttribute(ttpl, context, funcName, funcArgs);
- case "GetProperty":
- return new GetProperty(ttpl, context, funcName, funcArgs);
- case "GetOperationOutput":
- return new GetOperationOutput(ttpl, context, funcName, funcArgs);
- case "Concat":
- return new Concat(ttpl, context, funcName, funcArgs);
- case "Token":
- return new Token(ttpl, context, funcName, funcArgs);
+ if (funcType.equals("GetInput")) {
+ return new GetInput(ttpl, context, funcName, funcArgs);
+ } else if (funcType.equals("GetAttribute")) {
+ return new GetAttribute(ttpl, context, funcName, funcArgs);
+ } else if (funcType.equals("GetProperty")) {
+ return new GetProperty(ttpl, context, funcName, funcArgs);
+ } else if (funcType.equals("GetOperationOutput")) {
+ return new GetOperationOutput(ttpl, context, funcName, funcArgs);
+ } else if (funcType.equals("Concat")) {
+ return new Concat(ttpl, context, funcName, funcArgs);
+ } else if (funcType.equals("Token")) {
+ return new Token(ttpl, context, funcName, funcArgs);
}
}
}
diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/functions/GetProperty.java b/src/main/java/org/openecomp/sdc/toscaparser/api/functions/GetProperty.java
index 71420e8..3550542 100644
--- a/src/main/java/org/openecomp/sdc/toscaparser/api/functions/GetProperty.java
+++ b/src/main/java/org/openecomp/sdc/toscaparser/api/functions/GetProperty.java
@@ -58,7 +58,7 @@ public class GetProperty extends Function {
}
Object prop = foundProp.getValue();
if(prop instanceof Function) {
- Function.getFunction(toscaTpl,context, prop, toscaTpl.getResolveGetInput());
+ Function.getFunction(toscaTpl,context, prop);
}
}
else if(args.size() >= 3) {
@@ -336,7 +336,7 @@ public class GetProperty extends Function {
if(propertyValue instanceof Function) {
return ((Function)propertyValue).result();
}
- return Function.getFunction(toscaTpl,context,propertyValue, toscaTpl.getResolveGetInput());
+ return Function.getFunction(toscaTpl,context,propertyValue);
}
public String getNodeTemplateName() {
diff --git a/version.properties b/version.properties
index 7921ad4..6608eae 100644
--- a/version.properties
+++ b/version.properties
@@ -5,7 +5,7 @@
major=1
minor=1
-patch=3
+patch=1
base_version=${major}.${minor}.${patch}