[ARVADOS] updated: 97252f1f34486073c778c0a1c9de25f2f275cacd

git at public.curoverse.com git at public.curoverse.com
Wed May 7 06:49:46 EDT 2014


Summary of changes:
 sdk/java/ArvadosSDKJavaExample.java           |   43 ++++++++++++++++++++++--
 sdk/java/ArvadosSDKJavaExampleWithPrompt.java |   16 ++++++++-
 services/api/Rakefile                         |    6 +++
 3 files changed, 59 insertions(+), 6 deletions(-)

       via  97252f1f34486073c778c0a1c9de25f2f275cacd (commit)
       via  ff6a6fb89b42d17693786be6405c267bee445c4d (commit)
       via  11b48e1b182cef419918d4df1a4998001d665a9a (commit)
      from  d70ff3d064c9a6da8b8678b249abf7f4b93b6370 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 97252f1f34486073c778c0a1c9de25f2f275cacd
Merge: ff6a6fb 11b48e1
Author: radhika <radhika at curoverse.com>
Date:   Wed May 7 06:49:07 2014 -0400

    Merge branch 'master' into 2525-java-sdk


commit ff6a6fb89b42d17693786be6405c267bee445c4d
Author: radhika <radhika at curoverse.com>
Date:   Wed May 7 06:47:47 2014 -0400

    2525: improve response printing in the examples for readability.

diff --git a/sdk/java/ArvadosSDKJavaExample.java b/sdk/java/ArvadosSDKJavaExample.java
index 050eaa6..3c6578c 100644
--- a/sdk/java/ArvadosSDKJavaExample.java
+++ b/sdk/java/ArvadosSDKJavaExample.java
@@ -10,6 +10,8 @@ import java.io.File;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
 
 public class ArvadosSDKJavaExample {
   /** Make sure the following environment variables are set before using Arvados:
@@ -35,8 +37,19 @@ public class ArvadosSDKJavaExample {
     Map<String, Object> params = new HashMap<String, Object>();
 
     Map response = arv.call("users", "list", params);
-    System.out.println("Arvados users.list:\n" + response);
-
+    System.out.println("Arvados users.list:\n");
+    Set<Entry<String,Object>> entrySet = (Set<Entry<String,Object>>)response.entrySet();
+    for (Map.Entry<String, Object> entry : entrySet) {
+      if ("items".equals(entry.getKey())) {
+        List items = (List)entry.getValue();
+        for (Object item : items) {
+          System.out.println("    " + item);
+        }            
+      } else {
+        System.out.println(entry.getKey() + " = " + entry.getValue());
+      }
+    }
+    
     // get uuid of the first user from the response
     List items = (List)response.get("items");
 
@@ -48,7 +61,18 @@ public class ArvadosSDKJavaExample {
     params = new HashMap<String, Object>();
     params.put("uuid", userUuid);
     response = arv.call("users", "get", params);
-    System.out.println("Arvados users.get:\n" + response);
+    System.out.println("Arvados users.get:\n");
+    entrySet = (Set<Entry<String,Object>>)response.entrySet();
+    for (Map.Entry<String, Object> entry : entrySet) {
+      if ("items".equals(entry.getKey())) {
+        items = (List)entry.getValue();
+        for (Object item : items) {
+          System.out.println("    " + item);
+        }            
+      } else {
+        System.out.println(entry.getKey() + " = " + entry.getValue());
+      }
+    }
 
     // Make a pipeline_templates list call
     System.out.println("\n\n\nMaking a pipeline_templates.list call.");
@@ -56,6 +80,17 @@ public class ArvadosSDKJavaExample {
     params = new HashMap<String, Object>();
     response = arv.call("pipeline_templates", "list", params);
 
-    System.out.println("Arvados pipelinetempates.list:\n" + response);
+    System.out.println("Arvados pipelinetempates.list:\n");
+    entrySet = (Set<Entry<String,Object>>)response.entrySet();
+    for (Map.Entry<String, Object> entry : entrySet) {
+      if ("items".equals(entry.getKey())) {
+        items = (List)entry.getValue();
+        for (Object item : items) {
+          System.out.println("    " + item);
+        }            
+      } else {
+        System.out.println(entry.getKey() + " = " + entry.getValue());
+      }
+    }
   }
 }
diff --git a/sdk/java/ArvadosSDKJavaExampleWithPrompt.java b/sdk/java/ArvadosSDKJavaExampleWithPrompt.java
index f332869..b87c00f 100644
--- a/sdk/java/ArvadosSDKJavaExampleWithPrompt.java
+++ b/sdk/java/ArvadosSDKJavaExampleWithPrompt.java
@@ -13,7 +13,8 @@ import java.io.File;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-
+import java.util.Map.Entry;
+import java.util.Set;
 import java.io.BufferedReader;
 import java.io.InputStreamReader;
 
@@ -76,7 +77,18 @@ public class ArvadosSDKJavaExampleWithPrompt {
       try {
         System.out.println ("Making a call for " + resourceName + " " + methodName);
         Map response = arv.call(resourceName, methodName, paramsMap);
-        System.out.println(response);
+        
+        Set<Entry<String,Object>> entrySet = (Set<Entry<String,Object>>)response.entrySet();
+        for (Map.Entry<String, Object> entry : entrySet) {
+          if ("items".equals(entry.getKey())) {
+            List items = (List)entry.getValue();
+            for (Object item : items) {
+              System.out.println("    " + item);
+            }            
+          } else {
+            System.out.println(entry.getKey() + " = " + entry.getValue());
+          }
+        }
       } catch (Exception e){
         System.out.println (e.getMessage());
         System.out.println ("\nStart over");

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list