summaryrefslogtreecommitdiffstats
path: root/restapi-call-node
diff options
context:
space:
mode:
Diffstat (limited to 'restapi-call-node')
-rw-r--r--restapi-call-node/features/ccsdk-restapi-call-node/pom.xml92
-rwxr-xr-xrestapi-call-node/installer/pom.xml4
-rw-r--r--restapi-call-node/installer/src/assembly/assemble_mvnrepo_zip.xml2
-rwxr-xr-xrestapi-call-node/provider/pom.xml4
-rw-r--r--restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlJsonUtil.java24
-rw-r--r--restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlJsonUtil.java6
6 files changed, 73 insertions, 59 deletions
diff --git a/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml
index 43dcc74f0..822a6d1e7 100644
--- a/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml
+++ b/restapi-call-node/features/ccsdk-restapi-call-node/pom.xml
@@ -1,53 +1,55 @@
<?xml version="1.0" encoding="UTF-8"?>
-<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>
+<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>
- <parent>
- <groupId>org.onap.ccsdk.parent</groupId>
- <artifactId>single-feature-parent</artifactId>
- <version>1.1.0-SNAPSHOT</version>
- <relativePath />
- </parent>
+ <parent>
+ <groupId>org.onap.ccsdk.parent</groupId>
+ <artifactId>single-feature-parent</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
+ <relativePath />
+ </parent>
- <groupId>org.onap.ccsdk.sli.plugins</groupId>
- <artifactId>ccsdk-restapi-call-node</artifactId>
- <version>0.3.0-SNAPSHOT</version>
- <packaging>feature</packaging>
+ <groupId>org.onap.ccsdk.sli.plugins</groupId>
+ <artifactId>ccsdk-restapi-call-node</artifactId>
+ <version>0.3.0-SNAPSHOT</version>
+ <packaging>feature</packaging>
- <name>ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId}</name>
+ <name>ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId}</name>
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>mdsal-model-artifacts</artifactId>
+ <version>${odl.mdsal.model.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>mdsal-artifacts</artifactId>
+ <version>${odl.mdsal.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
- <properties>
- <skip.karaf.featureTest>true</skip.karaf.featureTest>
- </properties>
+ <dependencies>
-
- <dependencies>
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>odl-mdsal-broker</artifactId>
- <type>xml</type>
- <classifier>features</classifier>
- </dependency>
- <dependency>
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <artifactId>ccsdk-sli</artifactId>
- <version>${ccsdk.sli.core.version}</version>
- <type>xml</type>
- <classifier>features</classifier>
- </dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>restapi-call-node-provider</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>com.sun.jersey</groupId>
- <artifactId>jersey-client</artifactId>
- </dependency>
- <dependency>
- <groupId>org.codehaus.jettison</groupId>
- <artifactId>jettison</artifactId>
- </dependency>
- </dependencies>
+ <dependency>
+ <groupId>org.onap.ccsdk.sli.core</groupId>
+ <artifactId>ccsdk-sli</artifactId>
+ <version>${ccsdk.sli.core.version}</version>
+ <type>xml</type>
+ <classifier>features</classifier>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>restapi-call-node-provider</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
</project>
diff --git a/restapi-call-node/installer/pom.xml b/restapi-call-node/installer/pom.xml
index 0badf58b5..8e2f402eb 100755
--- a/restapi-call-node/installer/pom.xml
+++ b/restapi-call-node/installer/pom.xml
@@ -66,12 +66,12 @@
</goals>
<phase>package</phase>
<configuration>
- <attach>false</attach>
+ <attach>true</attach>
<finalName>stage/${application.name}-${project.version}</finalName>
<descriptors>
<descriptor>src/assembly/assemble_mvnrepo_zip.xml</descriptor>
</descriptors>
- <appendAssemblyId>false</appendAssemblyId>
+ <appendAssemblyId>true</appendAssemblyId>
</configuration>
</execution>
<execution>
diff --git a/restapi-call-node/installer/src/assembly/assemble_mvnrepo_zip.xml b/restapi-call-node/installer/src/assembly/assemble_mvnrepo_zip.xml
index cb56f2cd4..35e79db18 100644
--- a/restapi-call-node/installer/src/assembly/assemble_mvnrepo_zip.xml
+++ b/restapi-call-node/installer/src/assembly/assemble_mvnrepo_zip.xml
@@ -25,7 +25,7 @@
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
- <id>mvnrepo_zip</id>
+ <id>repo</id>
<formats>
<format>zip</format>
</formats>
diff --git a/restapi-call-node/provider/pom.xml b/restapi-call-node/provider/pom.xml
index 4831356c3..18a20cef1 100755
--- a/restapi-call-node/provider/pom.xml
+++ b/restapi-call-node/provider/pom.xml
@@ -54,24 +54,20 @@
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-client</artifactId>
- <scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sun.jersey.contribs.jersey-oauth</groupId>
<artifactId>oauth-signature</artifactId>
<version>${jersey.version}</version>
- <scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sun.jersey.contribs.jersey-oauth</groupId>
<artifactId>oauth-client</artifactId>
<version>${jersey.version}</version>
- <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.codehaus.jettison</groupId>
<artifactId>jettison</artifactId>
- <scope>provided</scope>
</dependency>
</dependencies>
</project>
diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlJsonUtil.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlJsonUtil.java
index 965d3daaa..8a0ca8d94 100644
--- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlJsonUtil.java
+++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlJsonUtil.java
@@ -55,8 +55,14 @@ public final class XmlJsonUtil {
escape = false;
}
+ boolean quotes = true;
+ if (var.startsWith("\"")) {
+ var = var.substring(1);
+ quotes = false;
+ }
+
Object o = createStructure(varmap, var);
- return generateJson(o, escape);
+ return generateJson(o, escape, quotes);
}
private static Object createStructure(Map<String, String> flatmap, String var) {
@@ -159,22 +165,26 @@ public final class XmlJsonUtil {
return null;
}
- private static String generateJson(Object o, boolean escape) {
+ private static String generateJson(Object o, boolean escape, boolean quotes) {
if (o == null)
return null;
StringBuilder ss = new StringBuilder();
- generateJson(ss, o, 0, false, escape);
+ generateJson(ss, o, 0, false, escape, quotes);
return ss.toString();
}
@SuppressWarnings("unchecked")
- private static void generateJson(StringBuilder ss, Object o, int indent, boolean padFirst, boolean escape) {
+ private static void generateJson(StringBuilder ss, Object o, int indent, boolean padFirst, boolean escape, boolean quotes) {
if (o instanceof String) {
String s = escape ? escapeJson((String) o) : (String) o;
if (padFirst)
ss.append(pad(indent));
- ss.append('"').append(s).append('"');
+ if (quotes) {
+ ss.append('"').append(s).append('"');
+ } else {
+ ss.append(s);
+ }
return;
}
@@ -193,7 +203,7 @@ public final class XmlJsonUtil {
Object v = entry.getValue();
String key = entry.getKey();
ss.append(pad(indent + 1)).append('"').append(key).append("\": ");
- generateJson(ss, v, indent + 1, false, escape);
+ generateJson(ss, v, indent + 1, false, escape, true);
}
ss.append("\n");
@@ -215,7 +225,7 @@ public final class XmlJsonUtil {
ss.append(",\n");
first = false;
- generateJson(ss, o1, indent + 1, true, escape);
+ generateJson(ss, o1, indent + 1, true, escape, quotes);
}
ss.append("\n");
diff --git a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlJsonUtil.java b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlJsonUtil.java
index 579d194d5..fcbd844fc 100644
--- a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlJsonUtil.java
+++ b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestXmlJsonUtil.java
@@ -144,6 +144,12 @@ public class TestXmlJsonUtil {
ss = XmlJsonUtil.getJson(mm, "service-data.vnf-config-information");
log.info(ss);
+
+ ss = XmlJsonUtil.getJson(mm, "service-data.vnf-config-information.vnf-host-ip-address");
+ log.info(ss);
+
+ ss = XmlJsonUtil.getJson(mm, "\"service-data.vnf-config-information.vnf-host-ip-address");
+ log.info(ss);
}
@Test