Repository: karaf-cellar
Updated Branches:
  refs/heads/master 6128b92b9 -> 385625834


[KARAF-5148] Remove org.json dependency replaced by org.apache.felix.utils.json


Project: http://git-wip-us.apache.org/repos/asf/karaf-cellar/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf-cellar/commit/38562583
Tree: http://git-wip-us.apache.org/repos/asf/karaf-cellar/tree/38562583
Diff: http://git-wip-us.apache.org/repos/asf/karaf-cellar/diff/38562583

Branch: refs/heads/master
Commit: 385625834489d5c39ae08dcef257d44644a68229
Parents: 6128b92
Author: Jean-Baptiste Onofré <jbono...@apache.org>
Authored: Mon May 29 14:06:03 2017 +0200
Committer: Jean-Baptiste Onofré <jbono...@apache.org>
Committed: Mon May 29 14:06:03 2017 +0200

----------------------------------------------------------------------
 NOTICE                                          |  3 -
 bundle/NOTICE                                   |  3 -
 cloud/NOTICE                                    |  3 -
 config/NOTICE                                   |  3 -
 core/NOTICE                                     |  3 -
 dns/NOTICE                                      |  3 -
 dosgi/NOTICE                                    |  3 -
 etcd/NOTICE                                     |  3 -
 event/NOTICE                                    |  3 -
 features/NOTICE                                 |  3 -
 hazelcast/NOTICE                                |  3 -
 http/balancer/NOTICE                            |  3 -
 kar/NOTICE                                      |  3 -
 kubernetes/NOTICE                               |  3 -
 log/NOTICE.txt                                  |  3 -
 manual/NOTICE                                   |  3 -
 obr/NOTICE                                      |  3 -
 pom.xml                                         |  2 +-
 samples/camel-hazelcast-app/NOTICE              |  3 -
 samples/dosgi-greeter/NOTICE                    |  3 -
 samples/hazelcast-app/NOTICE                    |  3 -
 samples/http-session-replication/NOTICE         |  3 -
 shell/NOTICE                                    |  3 -
 utils/NOTICE                                    |  3 -
 webconsole/NOTICE                               |  3 -
 webconsole/pom.xml                              | 15 +++--
 .../karaf/cellar/webconsole/CellarPlugin.java   | 61 +++++++++-----------
 27 files changed, 36 insertions(+), 114 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/38562583/NOTICE
----------------------------------------------------------------------
diff --git a/NOTICE b/NOTICE
index 64cb235..08afaff 100644
--- a/NOTICE
+++ b/NOTICE
@@ -31,9 +31,6 @@ This product uses software developed at
 SLF4J (http://www.slf4j.org/).
 Licensed under the MIT License.
 
-This product includes software from http://www.json.org.
-Copyright (c) 2002 JSON.org
-
 II. License Summary
 - Apache License 2.0
 - MIT License

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/38562583/bundle/NOTICE
----------------------------------------------------------------------
diff --git a/bundle/NOTICE b/bundle/NOTICE
index 64cb235..08afaff 100644
--- a/bundle/NOTICE
+++ b/bundle/NOTICE
@@ -31,9 +31,6 @@ This product uses software developed at
 SLF4J (http://www.slf4j.org/).
 Licensed under the MIT License.
 
-This product includes software from http://www.json.org.
-Copyright (c) 2002 JSON.org
-
 II. License Summary
 - Apache License 2.0
 - MIT License

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/38562583/cloud/NOTICE
----------------------------------------------------------------------
diff --git a/cloud/NOTICE b/cloud/NOTICE
index 64cb235..08afaff 100644
--- a/cloud/NOTICE
+++ b/cloud/NOTICE
@@ -31,9 +31,6 @@ This product uses software developed at
 SLF4J (http://www.slf4j.org/).
 Licensed under the MIT License.
 
-This product includes software from http://www.json.org.
-Copyright (c) 2002 JSON.org
-
 II. License Summary
 - Apache License 2.0
 - MIT License

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/38562583/config/NOTICE
----------------------------------------------------------------------
diff --git a/config/NOTICE b/config/NOTICE
index 64cb235..08afaff 100644
--- a/config/NOTICE
+++ b/config/NOTICE
@@ -31,9 +31,6 @@ This product uses software developed at
 SLF4J (http://www.slf4j.org/).
 Licensed under the MIT License.
 
-This product includes software from http://www.json.org.
-Copyright (c) 2002 JSON.org
-
 II. License Summary
 - Apache License 2.0
 - MIT License

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/38562583/core/NOTICE
----------------------------------------------------------------------
diff --git a/core/NOTICE b/core/NOTICE
index 64cb235..08afaff 100644
--- a/core/NOTICE
+++ b/core/NOTICE
@@ -31,9 +31,6 @@ This product uses software developed at
 SLF4J (http://www.slf4j.org/).
 Licensed under the MIT License.
 
-This product includes software from http://www.json.org.
-Copyright (c) 2002 JSON.org
-
 II. License Summary
 - Apache License 2.0
 - MIT License

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/38562583/dns/NOTICE
----------------------------------------------------------------------
diff --git a/dns/NOTICE b/dns/NOTICE
index 3f7fae7..16efa27 100644
--- a/dns/NOTICE
+++ b/dns/NOTICE
@@ -31,9 +31,6 @@ This product uses software developed at
 SLF4J (http://www.slf4j.org/).
 Licensed under the MIT License.
 
-This product includes software from http://www.json.org.
-Copyright (c) 2002 JSON.org
-
 II. License Summary
 - Apache License 2.0
 - MIT License

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/38562583/dosgi/NOTICE
----------------------------------------------------------------------
diff --git a/dosgi/NOTICE b/dosgi/NOTICE
index 64cb235..08afaff 100644
--- a/dosgi/NOTICE
+++ b/dosgi/NOTICE
@@ -31,9 +31,6 @@ This product uses software developed at
 SLF4J (http://www.slf4j.org/).
 Licensed under the MIT License.
 
-This product includes software from http://www.json.org.
-Copyright (c) 2002 JSON.org
-
 II. License Summary
 - Apache License 2.0
 - MIT License

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/38562583/etcd/NOTICE
----------------------------------------------------------------------
diff --git a/etcd/NOTICE b/etcd/NOTICE
index 9d59cae..4e92c2a 100644
--- a/etcd/NOTICE
+++ b/etcd/NOTICE
@@ -35,9 +35,6 @@ This product uses software developed at
 Netflix (https://github.com/Netflix/).
 Licensed under the Apache License 2.0.
 
-This product includes software from http://www.json.org.
-Copyright (c) 2002 JSON.org
-
 II. License Summary
 - Apache License 2.0
 - MIT License

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/38562583/event/NOTICE
----------------------------------------------------------------------
diff --git a/event/NOTICE b/event/NOTICE
index 64cb235..08afaff 100644
--- a/event/NOTICE
+++ b/event/NOTICE
@@ -31,9 +31,6 @@ This product uses software developed at
 SLF4J (http://www.slf4j.org/).
 Licensed under the MIT License.
 
-This product includes software from http://www.json.org.
-Copyright (c) 2002 JSON.org
-
 II. License Summary
 - Apache License 2.0
 - MIT License

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/38562583/features/NOTICE
----------------------------------------------------------------------
diff --git a/features/NOTICE b/features/NOTICE
index 64cb235..08afaff 100644
--- a/features/NOTICE
+++ b/features/NOTICE
@@ -31,9 +31,6 @@ This product uses software developed at
 SLF4J (http://www.slf4j.org/).
 Licensed under the MIT License.
 
-This product includes software from http://www.json.org.
-Copyright (c) 2002 JSON.org
-
 II. License Summary
 - Apache License 2.0
 - MIT License

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/38562583/hazelcast/NOTICE
----------------------------------------------------------------------
diff --git a/hazelcast/NOTICE b/hazelcast/NOTICE
index 64cb235..08afaff 100644
--- a/hazelcast/NOTICE
+++ b/hazelcast/NOTICE
@@ -31,9 +31,6 @@ This product uses software developed at
 SLF4J (http://www.slf4j.org/).
 Licensed under the MIT License.
 
-This product includes software from http://www.json.org.
-Copyright (c) 2002 JSON.org
-
 II. License Summary
 - Apache License 2.0
 - MIT License

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/38562583/http/balancer/NOTICE
----------------------------------------------------------------------
diff --git a/http/balancer/NOTICE b/http/balancer/NOTICE
index 64cb235..08afaff 100644
--- a/http/balancer/NOTICE
+++ b/http/balancer/NOTICE
@@ -31,9 +31,6 @@ This product uses software developed at
 SLF4J (http://www.slf4j.org/).
 Licensed under the MIT License.
 
-This product includes software from http://www.json.org.
-Copyright (c) 2002 JSON.org
-
 II. License Summary
 - Apache License 2.0
 - MIT License

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/38562583/kar/NOTICE
----------------------------------------------------------------------
diff --git a/kar/NOTICE b/kar/NOTICE
index 64cb235..08afaff 100644
--- a/kar/NOTICE
+++ b/kar/NOTICE
@@ -31,9 +31,6 @@ This product uses software developed at
 SLF4J (http://www.slf4j.org/).
 Licensed under the MIT License.
 
-This product includes software from http://www.json.org.
-Copyright (c) 2002 JSON.org
-
 II. License Summary
 - Apache License 2.0
 - MIT License

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/38562583/kubernetes/NOTICE
----------------------------------------------------------------------
diff --git a/kubernetes/NOTICE b/kubernetes/NOTICE
index 64cb235..08afaff 100644
--- a/kubernetes/NOTICE
+++ b/kubernetes/NOTICE
@@ -31,9 +31,6 @@ This product uses software developed at
 SLF4J (http://www.slf4j.org/).
 Licensed under the MIT License.
 
-This product includes software from http://www.json.org.
-Copyright (c) 2002 JSON.org
-
 II. License Summary
 - Apache License 2.0
 - MIT License

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/38562583/log/NOTICE.txt
----------------------------------------------------------------------
diff --git a/log/NOTICE.txt b/log/NOTICE.txt
index 64cb235..08afaff 100644
--- a/log/NOTICE.txt
+++ b/log/NOTICE.txt
@@ -31,9 +31,6 @@ This product uses software developed at
 SLF4J (http://www.slf4j.org/).
 Licensed under the MIT License.
 
-This product includes software from http://www.json.org.
-Copyright (c) 2002 JSON.org
-
 II. License Summary
 - Apache License 2.0
 - MIT License

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/38562583/manual/NOTICE
----------------------------------------------------------------------
diff --git a/manual/NOTICE b/manual/NOTICE
index 64cb235..08afaff 100644
--- a/manual/NOTICE
+++ b/manual/NOTICE
@@ -31,9 +31,6 @@ This product uses software developed at
 SLF4J (http://www.slf4j.org/).
 Licensed under the MIT License.
 
-This product includes software from http://www.json.org.
-Copyright (c) 2002 JSON.org
-
 II. License Summary
 - Apache License 2.0
 - MIT License

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/38562583/obr/NOTICE
----------------------------------------------------------------------
diff --git a/obr/NOTICE b/obr/NOTICE
index 64cb235..08afaff 100644
--- a/obr/NOTICE
+++ b/obr/NOTICE
@@ -31,9 +31,6 @@ This product uses software developed at
 SLF4J (http://www.slf4j.org/).
 Licensed under the MIT License.
 
-This product includes software from http://www.json.org.
-Copyright (c) 2002 JSON.org
-
 II. License Summary
 - Apache License 2.0
 - MIT License

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/38562583/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 9120306..d9a5ed2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -38,7 +38,7 @@
         <easymock.version>3.4</easymock.version>
         
<fabric8.kubernetes-client.version>1.4.7</fabric8.kubernetes-client.version>
         <felix.bundlerepository.version>2.0.6</felix.bundlerepository.version>
-        <felix.utils.version>1.8.0</felix.utils.version>
+        <felix.utils.version>1.10.0</felix.utils.version>
         <felix.webconsole.version>4.2.14</felix.webconsole.version>
         <hazelcast.version>3.8.2</hazelcast.version>
         <jclouds.version>1.9.1</jclouds.version>

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/38562583/samples/camel-hazelcast-app/NOTICE
----------------------------------------------------------------------
diff --git a/samples/camel-hazelcast-app/NOTICE 
b/samples/camel-hazelcast-app/NOTICE
index 64cb235..08afaff 100644
--- a/samples/camel-hazelcast-app/NOTICE
+++ b/samples/camel-hazelcast-app/NOTICE
@@ -31,9 +31,6 @@ This product uses software developed at
 SLF4J (http://www.slf4j.org/).
 Licensed under the MIT License.
 
-This product includes software from http://www.json.org.
-Copyright (c) 2002 JSON.org
-
 II. License Summary
 - Apache License 2.0
 - MIT License

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/38562583/samples/dosgi-greeter/NOTICE
----------------------------------------------------------------------
diff --git a/samples/dosgi-greeter/NOTICE b/samples/dosgi-greeter/NOTICE
index 64cb235..08afaff 100644
--- a/samples/dosgi-greeter/NOTICE
+++ b/samples/dosgi-greeter/NOTICE
@@ -31,9 +31,6 @@ This product uses software developed at
 SLF4J (http://www.slf4j.org/).
 Licensed under the MIT License.
 
-This product includes software from http://www.json.org.
-Copyright (c) 2002 JSON.org
-
 II. License Summary
 - Apache License 2.0
 - MIT License

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/38562583/samples/hazelcast-app/NOTICE
----------------------------------------------------------------------
diff --git a/samples/hazelcast-app/NOTICE b/samples/hazelcast-app/NOTICE
index 64cb235..08afaff 100644
--- a/samples/hazelcast-app/NOTICE
+++ b/samples/hazelcast-app/NOTICE
@@ -31,9 +31,6 @@ This product uses software developed at
 SLF4J (http://www.slf4j.org/).
 Licensed under the MIT License.
 
-This product includes software from http://www.json.org.
-Copyright (c) 2002 JSON.org
-
 II. License Summary
 - Apache License 2.0
 - MIT License

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/38562583/samples/http-session-replication/NOTICE
----------------------------------------------------------------------
diff --git a/samples/http-session-replication/NOTICE 
b/samples/http-session-replication/NOTICE
index 64cb235..08afaff 100644
--- a/samples/http-session-replication/NOTICE
+++ b/samples/http-session-replication/NOTICE
@@ -31,9 +31,6 @@ This product uses software developed at
 SLF4J (http://www.slf4j.org/).
 Licensed under the MIT License.
 
-This product includes software from http://www.json.org.
-Copyright (c) 2002 JSON.org
-
 II. License Summary
 - Apache License 2.0
 - MIT License

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/38562583/shell/NOTICE
----------------------------------------------------------------------
diff --git a/shell/NOTICE b/shell/NOTICE
index 64cb235..08afaff 100644
--- a/shell/NOTICE
+++ b/shell/NOTICE
@@ -31,9 +31,6 @@ This product uses software developed at
 SLF4J (http://www.slf4j.org/).
 Licensed under the MIT License.
 
-This product includes software from http://www.json.org.
-Copyright (c) 2002 JSON.org
-
 II. License Summary
 - Apache License 2.0
 - MIT License

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/38562583/utils/NOTICE
----------------------------------------------------------------------
diff --git a/utils/NOTICE b/utils/NOTICE
index 64cb235..08afaff 100644
--- a/utils/NOTICE
+++ b/utils/NOTICE
@@ -31,9 +31,6 @@ This product uses software developed at
 SLF4J (http://www.slf4j.org/).
 Licensed under the MIT License.
 
-This product includes software from http://www.json.org.
-Copyright (c) 2002 JSON.org
-
 II. License Summary
 - Apache License 2.0
 - MIT License

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/38562583/webconsole/NOTICE
----------------------------------------------------------------------
diff --git a/webconsole/NOTICE b/webconsole/NOTICE
index 64cb235..08afaff 100644
--- a/webconsole/NOTICE
+++ b/webconsole/NOTICE
@@ -31,9 +31,6 @@ This product uses software developed at
 SLF4J (http://www.slf4j.org/).
 Licensed under the MIT License.
 
-This product includes software from http://www.json.org.
-Copyright (c) 2002 JSON.org
-
 II. License Summary
 - Apache License 2.0
 - MIT License

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/38562583/webconsole/pom.xml
----------------------------------------------------------------------
diff --git a/webconsole/pom.xml b/webconsole/pom.xml
index bde5c42..1526f19 100644
--- a/webconsole/pom.xml
+++ b/webconsole/pom.xml
@@ -64,6 +64,11 @@
             <scope>provided</scope>
         </dependency>
         <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.utils</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
             <groupId>org.apache.geronimo.specs</groupId>
             <artifactId>geronimo-servlet_3.0_spec</artifactId>
             <scope>provided</scope>
@@ -73,13 +78,6 @@
             <artifactId>junit</artifactId>
             <scope>test</scope>
         </dependency>
-        <dependency>
-            <groupId>org.json</groupId>
-            <artifactId>json</artifactId>
-            <version>20070829</version>
-            <scope>compile</scope>
-            <optional>true</optional>
-        </dependency>
     </dependencies>
 
     <build>
@@ -121,7 +119,8 @@
                         <Embed-Dependency>json</Embed-Dependency>
                         <Private-Package>
                             org.apache.karaf.cellar.webconsole.internal.osgi,
-                            
org.apache.karaf.util.tracker;-split-package:=merge-first
+                            
org.apache.karaf.util.tracker;-split-package:=merge-first,
+                            org.apache.felix.utils.json
                         </Private-Package>
                     </instructions>
                 </configuration>

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/38562583/webconsole/src/main/java/org/apache/karaf/cellar/webconsole/CellarPlugin.java
----------------------------------------------------------------------
diff --git 
a/webconsole/src/main/java/org/apache/karaf/cellar/webconsole/CellarPlugin.java 
b/webconsole/src/main/java/org/apache/karaf/cellar/webconsole/CellarPlugin.java
index ac3f167..b95981d 100644
--- 
a/webconsole/src/main/java/org/apache/karaf/cellar/webconsole/CellarPlugin.java
+++ 
b/webconsole/src/main/java/org/apache/karaf/cellar/webconsole/CellarPlugin.java
@@ -13,13 +13,12 @@
  */
 package org.apache.karaf.cellar.webconsole;
 
+import org.apache.felix.utils.json.JSONWriter;
 import org.apache.felix.webconsole.AbstractWebConsolePlugin;
 import org.apache.karaf.cellar.core.ClusterManager;
 import org.apache.karaf.cellar.core.Group;
 import org.apache.karaf.cellar.core.GroupManager;
 import org.apache.karaf.cellar.core.Node;
-import org.json.JSONException;
-import org.json.JSONWriter;
 import org.osgi.framework.BundleContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -174,46 +173,42 @@ public class CellarPlugin extends 
AbstractWebConsolePlugin {
 
         final JSONWriter jw = new JSONWriter(pw);
 
-        try {
+        jw.object();
+        jw.key("status");
+        jw.value(getStatusLine(groups, nodes));
+        jw.key("groups");
+        jw.array();
+        for (Group g : groups) {
             jw.object();
-            jw.key("status");
-            jw.value(getStatusLine(groups, nodes));
-            jw.key("groups");
+            jw.key("name");
+            jw.value(g.getName());
+
+            Set<Node> members = g.getNodes();
+            jw.key("members");
             jw.array();
-            for (Group g : groups) {
-                jw.object();
-                jw.key("name");
-                jw.value(g.getName());
-
-                Set<Node> members = g.getNodes();
-                jw.key("members");
-                jw.array();
-                if (nodes != null) {
-                    for (Node n : members) {
-                        jw.object();
-                        jw.key("id");
-                        jw.value(n.getId());
-                        jw.endObject();
-                    }
+            if (nodes != null) {
+                for (Node n : members) {
+                    jw.object();
+                    jw.key("id");
+                    jw.value(n.getId());
+                    jw.endObject();
                 }
-
-                jw.endArray();
-                jw.key("actions");
-                jw.array();
-                boolean enable = true;
-                action(jw, enable, "removeNode", "Remove Node", "update");
-                action(jw, enable, "deleteGroup", "Delete Group", "delete");
-                jw.endArray();
-                jw.endObject();
             }
+
+            jw.endArray();
+            jw.key("actions");
+            jw.array();
+            boolean enable = true;
+            action(jw, enable, "removeNode", "Remove Node", "update");
+            action(jw, enable, "deleteGroup", "Delete Group", "delete");
             jw.endArray();
             jw.endObject();
-        } catch (JSONException je) {
-            throw new IOException(je.toString());
         }
+        jw.endArray();
+        jw.endObject();
     }
 
-    private void action(JSONWriter jw, boolean enabled, String op, String 
title, String image) throws JSONException {
+    private void action(JSONWriter jw, boolean enabled, String op, String 
title, String image) throws IOException {
         jw.object();
         jw.key("enabled").value(enabled);
         jw.key("op").value(op);

Reply via email to