airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chath...@apache.org
Subject svn commit: r1409377 - in /airavata/trunk/modules/airavata-rest-services/src/main/java/org/apache/airavata/services/registry/rest: client/ resources/
Date Wed, 14 Nov 2012 20:24:59 GMT
Author: chathuri
Date: Wed Nov 14 20:24:58 2012
New Revision: 1409377

URL: http://svn.apache.org/viewvc?rev=1409377&view=rev
Log:
updating rest client methods

Modified:
    airavata/trunk/modules/airavata-rest-services/src/main/java/org/apache/airavata/services/registry/rest/client/ConfigurationResourceClient.java
    airavata/trunk/modules/airavata-rest-services/src/main/java/org/apache/airavata/services/registry/rest/client/DescriptorResourceClient.java
    airavata/trunk/modules/airavata-rest-services/src/main/java/org/apache/airavata/services/registry/rest/client/ExperimentResourceClient.java
    airavata/trunk/modules/airavata-rest-services/src/main/java/org/apache/airavata/services/registry/rest/client/ProjectResourceClient.java
    airavata/trunk/modules/airavata-rest-services/src/main/java/org/apache/airavata/services/registry/rest/client/ProvenanceResourceClient.java
    airavata/trunk/modules/airavata-rest-services/src/main/java/org/apache/airavata/services/registry/rest/client/PublishedWorkflowResourceClient.java
    airavata/trunk/modules/airavata-rest-services/src/main/java/org/apache/airavata/services/registry/rest/client/UserWorkflowResourceClient.java
    airavata/trunk/modules/airavata-rest-services/src/main/java/org/apache/airavata/services/registry/rest/resources/ExperimentRegistryResource.java
    airavata/trunk/modules/airavata-rest-services/src/main/java/org/apache/airavata/services/registry/rest/resources/UserWorkflowRegistryResource.java

Modified: airavata/trunk/modules/airavata-rest-services/src/main/java/org/apache/airavata/services/registry/rest/client/ConfigurationResourceClient.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/airavata-rest-services/src/main/java/org/apache/airavata/services/registry/rest/client/ConfigurationResourceClient.java?rev=1409377&r1=1409376&r2=1409377&view=diff
==============================================================================
--- airavata/trunk/modules/airavata-rest-services/src/main/java/org/apache/airavata/services/registry/rest/client/ConfigurationResourceClient.java (original)
+++ airavata/trunk/modules/airavata-rest-services/src/main/java/org/apache/airavata/services/registry/rest/client/ConfigurationResourceClient.java Wed Nov 14 20:24:58 2012
@@ -70,7 +70,7 @@ public class ConfigurationResourceClient
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -86,7 +86,7 @@ public class ConfigurationResourceClient
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -111,7 +111,7 @@ public class ConfigurationResourceClient
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -128,7 +128,7 @@ public class ConfigurationResourceClient
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -142,7 +142,7 @@ public class ConfigurationResourceClient
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -158,7 +158,7 @@ public class ConfigurationResourceClient
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -172,7 +172,7 @@ public class ConfigurationResourceClient
             int status = response.getStatus();
 
             if (status != 200) {
-                logger.error("Failed : HTTP error code : " + status);
+                logger.error(response.getEntity(String.class));
                 throw new RuntimeException("Failed : HTTP error code : "
                         + status);
             }
@@ -198,7 +198,7 @@ public class ConfigurationResourceClient
             int status = response.getStatus();
 
             if (status != 200) {
-                logger.error("Failed : HTTP error code : " + status);
+                logger.error(response.getEntity(String.class));
                 throw new RuntimeException("Failed : HTTP error code : "
                         + status);
             }
@@ -223,7 +223,7 @@ public class ConfigurationResourceClient
             int status = response.getStatus();
 
             if (status != 200) {
-                logger.error("Failed : HTTP error code : " + status);
+                logger.error(response.getEntity(String.class));
                 throw new RuntimeException("Failed : HTTP error code : "
                         + status);
             }
@@ -243,7 +243,7 @@ public class ConfigurationResourceClient
             int status = response.getStatus();
 
             if (status != 200) {
-                logger.error("Failed : HTTP error code : " + status);
+                logger.error(response.getEntity(String.class));
                 throw new RuntimeException("Failed : HTTP error code : "
                         + status);
             }
@@ -265,7 +265,7 @@ public class ConfigurationResourceClient
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -280,7 +280,7 @@ public class ConfigurationResourceClient
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -295,7 +295,7 @@ public class ConfigurationResourceClient
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -310,7 +310,7 @@ public class ConfigurationResourceClient
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -326,7 +326,7 @@ public class ConfigurationResourceClient
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -342,7 +342,7 @@ public class ConfigurationResourceClient
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -358,7 +358,7 @@ public class ConfigurationResourceClient
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -374,7 +374,7 @@ public class ConfigurationResourceClient
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -388,7 +388,7 @@ public class ConfigurationResourceClient
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -400,7 +400,7 @@ public class ConfigurationResourceClient
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -414,7 +414,7 @@ public class ConfigurationResourceClient
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -426,7 +426,7 @@ public class ConfigurationResourceClient
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -438,7 +438,7 @@ public class ConfigurationResourceClient
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -450,7 +450,7 @@ public class ConfigurationResourceClient
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }

Modified: airavata/trunk/modules/airavata-rest-services/src/main/java/org/apache/airavata/services/registry/rest/client/DescriptorResourceClient.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/airavata-rest-services/src/main/java/org/apache/airavata/services/registry/rest/client/DescriptorResourceClient.java?rev=1409377&r1=1409376&r2=1409377&view=diff
==============================================================================
--- airavata/trunk/modules/airavata-rest-services/src/main/java/org/apache/airavata/services/registry/rest/client/DescriptorResourceClient.java (original)
+++ airavata/trunk/modules/airavata-rest-services/src/main/java/org/apache/airavata/services/registry/rest/client/DescriptorResourceClient.java Wed Nov 14 20:24:58 2012
@@ -76,7 +76,7 @@ public class DescriptorResourceClient {
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         } else {
@@ -92,7 +92,7 @@ public class DescriptorResourceClient {
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -106,7 +106,7 @@ public class DescriptorResourceClient {
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -121,7 +121,7 @@ public class DescriptorResourceClient {
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -139,7 +139,7 @@ public class DescriptorResourceClient {
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -152,7 +152,7 @@ public class DescriptorResourceClient {
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -175,7 +175,7 @@ public class DescriptorResourceClient {
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -192,7 +192,7 @@ public class DescriptorResourceClient {
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         } else {
@@ -208,7 +208,7 @@ public class DescriptorResourceClient {
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -222,7 +222,7 @@ public class DescriptorResourceClient {
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -237,7 +237,7 @@ public class DescriptorResourceClient {
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -255,7 +255,7 @@ public class DescriptorResourceClient {
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -268,7 +268,7 @@ public class DescriptorResourceClient {
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -293,7 +293,7 @@ public class DescriptorResourceClient {
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         } else {
@@ -315,7 +315,7 @@ public class DescriptorResourceClient {
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -334,7 +334,7 @@ public class DescriptorResourceClient {
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -354,7 +354,7 @@ public class DescriptorResourceClient {
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -373,7 +373,7 @@ public class DescriptorResourceClient {
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -393,7 +393,7 @@ public class DescriptorResourceClient {
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -414,7 +414,7 @@ public class DescriptorResourceClient {
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -433,7 +433,7 @@ public class DescriptorResourceClient {
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -456,7 +456,7 @@ public class DescriptorResourceClient {
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -477,7 +477,7 @@ public class DescriptorResourceClient {
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }

Modified: airavata/trunk/modules/airavata-rest-services/src/main/java/org/apache/airavata/services/registry/rest/client/ExperimentResourceClient.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/airavata-rest-services/src/main/java/org/apache/airavata/services/registry/rest/client/ExperimentResourceClient.java?rev=1409377&r1=1409376&r2=1409377&view=diff
==============================================================================
--- airavata/trunk/modules/airavata-rest-services/src/main/java/org/apache/airavata/services/registry/rest/client/ExperimentResourceClient.java (original)
+++ airavata/trunk/modules/airavata-rest-services/src/main/java/org/apache/airavata/services/registry/rest/client/ExperimentResourceClient.java Wed Nov 14 20:24:58 2012
@@ -38,6 +38,8 @@ import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.MultivaluedMap;
 import javax.ws.rs.core.UriBuilder;
 import java.net.URI;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
@@ -62,17 +64,20 @@ public class ExperimentResourceClient {
     }
 
     public void addExperiment(String projectName, AiravataExperiment experiment){
+        DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        String date = dateFormat.format(experiment.getSubmittedDate());
         webResource = getExperimentRegistryBaseResource().path(ResourcePathConstants.ExperimentResourcePathConstants.ADD_EXP);
         MultivaluedMap formParams = new MultivaluedMapImpl();
         formParams.add("projectName", projectName);
         formParams.add("experimentID", experiment.getExperimentId());
-        formParams.add("submittedDate", experiment.getSubmittedDate().toString());
+        formParams.add("submittedDate", date);
 
-        ClientResponse response = webResource.accept(MediaType.TEXT_PLAIN).type(MediaType.APPLICATION_FORM_URLENCODED).post(ClientResponse.class, formParams);
+        ClientResponse response = webResource.accept(MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            String errorMsg = response.getEntity(String.class);
+            logger.error(errorMsg);
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -86,7 +91,7 @@ public class ExperimentResourceClient {
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -98,7 +103,9 @@ public class ExperimentResourceClient {
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            String errorMsg = response.getEntity(String.class);
+            System.out.println(errorMsg);
+            logger.error(errorMsg);
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -121,7 +128,7 @@ public class ExperimentResourceClient {
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -137,16 +144,19 @@ public class ExperimentResourceClient {
     }
 
     public List<AiravataExperiment> getExperiments(Date from, Date to){
+        DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        String fromDate = dateFormat.format(from);
+        String toDate = dateFormat.format(to);
         webResource = getExperimentRegistryBaseResource().path(ResourcePathConstants.ExperimentResourcePathConstants.GET_EXPS_BY_DATE);
         MultivaluedMap queryParams = new MultivaluedMapImpl();
-        queryParams.add("fromDate", from.toString());
-        queryParams.add("toDate", to.toString());
+        queryParams.add("fromDate", fromDate);
+        queryParams.add("toDate", toDate);
 
         ClientResponse response = webResource.queryParams(queryParams).accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -162,17 +172,20 @@ public class ExperimentResourceClient {
     }
 
     public List<AiravataExperiment> getExperiments(String projectName, Date from, Date to){
+        DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        String fromDate = dateFormat.format(from);
+        String toDate = dateFormat.format(to);
         webResource = getExperimentRegistryBaseResource().path(ResourcePathConstants.ExperimentResourcePathConstants.GET_EXPS_PER_PROJECT_BY_DATE);
         MultivaluedMap queryParams = new MultivaluedMapImpl();
         queryParams.add("projectName", projectName);
-        queryParams.add("fromDate", from.toString());
-        queryParams.add("toDate", to.toString());
+        queryParams.add("fromDate", fromDate);
+        queryParams.add("toDate", toDate);
 
         ClientResponse response = webResource.queryParams(queryParams).accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -195,7 +208,7 @@ public class ExperimentResourceClient {
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }else {
@@ -217,7 +230,7 @@ public class ExperimentResourceClient {
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }else {

Modified: airavata/trunk/modules/airavata-rest-services/src/main/java/org/apache/airavata/services/registry/rest/client/ProjectResourceClient.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/airavata-rest-services/src/main/java/org/apache/airavata/services/registry/rest/client/ProjectResourceClient.java?rev=1409377&r1=1409376&r2=1409377&view=diff
==============================================================================
--- airavata/trunk/modules/airavata-rest-services/src/main/java/org/apache/airavata/services/registry/rest/client/ProjectResourceClient.java (original)
+++ airavata/trunk/modules/airavata-rest-services/src/main/java/org/apache/airavata/services/registry/rest/client/ProjectResourceClient.java Wed Nov 14 20:24:58 2012
@@ -68,7 +68,7 @@ public class ProjectResourceClient {
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         } else {
@@ -90,7 +90,7 @@ public class ProjectResourceClient {
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }else {
@@ -107,7 +107,7 @@ public class ProjectResourceClient {
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -122,7 +122,7 @@ public class ProjectResourceClient {
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -136,7 +136,7 @@ public class ProjectResourceClient {
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -150,7 +150,7 @@ public class ProjectResourceClient {
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -165,7 +165,7 @@ public class ProjectResourceClient {
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }

Modified: airavata/trunk/modules/airavata-rest-services/src/main/java/org/apache/airavata/services/registry/rest/client/ProvenanceResourceClient.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/airavata-rest-services/src/main/java/org/apache/airavata/services/registry/rest/client/ProvenanceResourceClient.java?rev=1409377&r1=1409376&r2=1409377&view=diff
==============================================================================
--- airavata/trunk/modules/airavata-rest-services/src/main/java/org/apache/airavata/services/registry/rest/client/ProvenanceResourceClient.java (original)
+++ airavata/trunk/modules/airavata-rest-services/src/main/java/org/apache/airavata/services/registry/rest/client/ProvenanceResourceClient.java Wed Nov 14 20:24:58 2012
@@ -76,7 +76,7 @@ public class ProvenanceResourceClient {
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -90,7 +90,7 @@ public class ProvenanceResourceClient {
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -106,7 +106,7 @@ public class ProvenanceResourceClient {
         ClientResponse response = webResource.queryParams(queryParams).accept(MediaType.TEXT_PLAIN).get(ClientResponse.class);
         int status = response.getStatus();
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -120,7 +120,7 @@ public class ProvenanceResourceClient {
         ClientResponse response = webResource.queryParams(queryParams).accept(MediaType.TEXT_PLAIN).get(ClientResponse.class);
         int status = response.getStatus();
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -138,7 +138,7 @@ public class ProvenanceResourceClient {
         ClientResponse response = webResource.accept(MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
         int status = response.getStatus();
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -152,7 +152,7 @@ public class ProvenanceResourceClient {
         ClientResponse response = webResource.queryParams(queryParams).accept(MediaType.TEXT_PLAIN).get(ClientResponse.class);
         int status = response.getStatus();
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -170,7 +170,7 @@ public class ProvenanceResourceClient {
         ClientResponse response = webResource.accept(MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
         int status = response.getStatus();
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -183,7 +183,7 @@ public class ProvenanceResourceClient {
         ClientResponse response = webResource.queryParams(queryParams).accept(MediaType.TEXT_PLAIN).get(ClientResponse.class);
         int status = response.getStatus();
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -201,7 +201,7 @@ public class ProvenanceResourceClient {
         ClientResponse response = webResource.accept(MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
         int status = response.getStatus();
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -214,7 +214,7 @@ public class ProvenanceResourceClient {
         ClientResponse response = webResource.queryParams(queryParams).accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);
         int status = response.getStatus();
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -237,7 +237,7 @@ public class ProvenanceResourceClient {
         ClientResponse response = webResource.queryParams(queryParams).accept(MediaType.TEXT_PLAIN).get(ClientResponse.class);
         int status = response.getStatus();
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -253,7 +253,7 @@ public class ProvenanceResourceClient {
         ClientResponse response = webResource.accept(MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
         int status = response.getStatus();
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -269,7 +269,7 @@ public class ProvenanceResourceClient {
         ClientResponse response = webResource.accept(MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
         int status = response.getStatus();
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -285,7 +285,7 @@ public class ProvenanceResourceClient {
         ClientResponse response = webResource.accept(MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
         int status = response.getStatus();
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -298,7 +298,7 @@ public class ProvenanceResourceClient {
         ClientResponse response = webResource.queryParams(queryParams).accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);
         int status = response.getStatus();
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -317,7 +317,7 @@ public class ProvenanceResourceClient {
         ClientResponse response = webResource.accept(MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
         int status = response.getStatus();
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -333,7 +333,7 @@ public class ProvenanceResourceClient {
         ClientResponse response = webResource.accept(MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
         int status = response.getStatus();
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -346,7 +346,7 @@ public class ProvenanceResourceClient {
         ClientResponse response = webResource.queryParams(queryParams).accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);
         int status = response.getStatus();
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -362,7 +362,7 @@ public class ProvenanceResourceClient {
         ClientResponse response = webResource.queryParams(queryParams).accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);
         int status = response.getStatus();
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -378,7 +378,7 @@ public class ProvenanceResourceClient {
         ClientResponse response = webResource.queryParams(queryParams).accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);
         int status = response.getStatus();
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -400,7 +400,7 @@ public class ProvenanceResourceClient {
         ClientResponse response = webResource.queryParams(queryParams).accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);
         int status = response.getStatus();
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -421,7 +421,7 @@ public class ProvenanceResourceClient {
         ClientResponse response = webResource.queryParams(queryParams).accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);
         int status = response.getStatus();
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -438,7 +438,7 @@ public class ProvenanceResourceClient {
         ClientResponse response = webResource.queryParams(queryParams).accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);
         int status = response.getStatus();
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -461,7 +461,7 @@ public class ProvenanceResourceClient {
         ClientResponse response = webResource.accept(MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
         int status = response.getStatus();
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -477,7 +477,7 @@ public class ProvenanceResourceClient {
         ClientResponse response = webResource.accept(MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
         int status = response.getStatus();
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -493,7 +493,7 @@ public class ProvenanceResourceClient {
         ClientResponse response = webResource.accept(MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
         int status = response.getStatus();
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -507,7 +507,7 @@ public class ProvenanceResourceClient {
         ClientResponse response = webResource.queryParams(queryParams).accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);
         int status = response.getStatus();
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -524,7 +524,7 @@ public class ProvenanceResourceClient {
         ClientResponse response = webResource.queryParams(queryParams).accept(MediaType.TEXT_PLAIN).get(ClientResponse.class);
         int status = response.getStatus();
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -547,7 +547,7 @@ public class ProvenanceResourceClient {
         ClientResponse response = webResource.queryParams(queryParams).accept(MediaType.TEXT_PLAIN).get(ClientResponse.class);
         int status = response.getStatus();
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -568,7 +568,7 @@ public class ProvenanceResourceClient {
         ClientResponse response = webResource.type(MediaType.APPLICATION_JSON).accept(MediaType.TEXT_PLAIN).post(ClientResponse.class, workflowNodeGramData);
         int status = response.getStatus();
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -581,7 +581,7 @@ public class ProvenanceResourceClient {
         ClientResponse response = webResource.queryParams(queryParams).accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);
         int status = response.getStatus();
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -598,7 +598,7 @@ public class ProvenanceResourceClient {
         ClientResponse response = webResource.queryParams(queryParams).accept(MediaType.TEXT_PLAIN).get(ClientResponse.class);
         int status = response.getStatus();
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -614,7 +614,7 @@ public class ProvenanceResourceClient {
         ClientResponse response = webResource.queryParams(queryParams).accept(MediaType.TEXT_PLAIN).get(ClientResponse.class);
         int status = response.getStatus();
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -629,7 +629,7 @@ public class ProvenanceResourceClient {
         ClientResponse response = webResource.queryParams(queryParams).accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);
         int status = response.getStatus();
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -648,7 +648,7 @@ public class ProvenanceResourceClient {
         ClientResponse response = webResource.accept(MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
         int status = response.getStatus();
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -664,7 +664,7 @@ public class ProvenanceResourceClient {
         ClientResponse response = webResource.accept(MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
         int status = response.getStatus();
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -679,7 +679,7 @@ public class ProvenanceResourceClient {
         ClientResponse response = webResource.accept(MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
         int status = response.getStatus();
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }

Modified: airavata/trunk/modules/airavata-rest-services/src/main/java/org/apache/airavata/services/registry/rest/client/PublishedWorkflowResourceClient.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/airavata-rest-services/src/main/java/org/apache/airavata/services/registry/rest/client/PublishedWorkflowResourceClient.java?rev=1409377&r1=1409376&r2=1409377&view=diff
==============================================================================
--- airavata/trunk/modules/airavata-rest-services/src/main/java/org/apache/airavata/services/registry/rest/client/PublishedWorkflowResourceClient.java (original)
+++ airavata/trunk/modules/airavata-rest-services/src/main/java/org/apache/airavata/services/registry/rest/client/PublishedWorkflowResourceClient.java Wed Nov 14 20:24:58 2012
@@ -70,7 +70,7 @@ public class PublishedWorkflowResourceCl
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -87,7 +87,7 @@ public class PublishedWorkflowResourceCl
         ClientResponse response = webResource.accept(MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
         int status = response.getStatus();
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -101,7 +101,7 @@ public class PublishedWorkflowResourceCl
         ClientResponse response = webResource.accept(MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
         int status = response.getStatus();
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -116,7 +116,7 @@ public class PublishedWorkflowResourceCl
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -132,7 +132,7 @@ public class PublishedWorkflowResourceCl
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -148,7 +148,7 @@ public class PublishedWorkflowResourceCl
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -172,7 +172,7 @@ public class PublishedWorkflowResourceCl
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }

Modified: airavata/trunk/modules/airavata-rest-services/src/main/java/org/apache/airavata/services/registry/rest/client/UserWorkflowResourceClient.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/airavata-rest-services/src/main/java/org/apache/airavata/services/registry/rest/client/UserWorkflowResourceClient.java?rev=1409377&r1=1409376&r2=1409377&view=diff
==============================================================================
--- airavata/trunk/modules/airavata-rest-services/src/main/java/org/apache/airavata/services/registry/rest/client/UserWorkflowResourceClient.java (original)
+++ airavata/trunk/modules/airavata-rest-services/src/main/java/org/apache/airavata/services/registry/rest/client/UserWorkflowResourceClient.java Wed Nov 14 20:24:58 2012
@@ -69,7 +69,7 @@ public class UserWorkflowResourceClient 
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -86,7 +86,7 @@ public class UserWorkflowResourceClient 
         ClientResponse response = webResource.type(MediaType.APPLICATION_FORM_URLENCODED).accept(MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
         int status = response.getStatus();
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -98,10 +98,10 @@ public class UserWorkflowResourceClient 
         formParams.add("workflowName", workflowName);
         formParams.add("workflowGraphXml", workflowGraphXml);
 
-        ClientResponse response = webResource.type(MediaType.APPLICATION_FORM_URLENCODED).accept(MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
+        ClientResponse response = webResource.accept(MediaType.TEXT_PLAIN).type(MediaType.APPLICATION_FORM_URLENCODED).post(ClientResponse.class, formParams);
         int status = response.getStatus();
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -110,12 +110,12 @@ public class UserWorkflowResourceClient 
     public String getWorkflowGraphXML(String workflowName){
         webResource = getUserWFRegistryBaseResource().path(ResourcePathConstants.UserWFConstants.GET_WORKFLOWGRAPH);
         MultivaluedMap queryParams = new MultivaluedMapImpl();
-        queryParams.add("workflowname", workflowName);
-        ClientResponse response = webResource.queryParams(queryParams).accept(MediaType.TEXT_PLAIN).get(ClientResponse.class);
+        queryParams.add("workflowName", workflowName);
+        ClientResponse response = webResource.queryParams(queryParams).accept(MediaType.APPLICATION_FORM_URLENCODED).get(ClientResponse.class);
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -130,7 +130,7 @@ public class UserWorkflowResourceClient 
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
@@ -149,12 +149,12 @@ public class UserWorkflowResourceClient 
     public void removeWorkflow(String workflowName){
         webResource = getUserWFRegistryBaseResource().path(ResourcePathConstants.UserWFConstants.REMOVE_WORKFLOW);
         MultivaluedMap queryParams = new MultivaluedMapImpl();
-        queryParams.add("workflowname", workflowName);
+        queryParams.add("workflowName", workflowName);
         ClientResponse response = webResource.queryParams(queryParams).accept(MediaType.TEXT_PLAIN).delete(ClientResponse.class);
         int status = response.getStatus();
 
         if (status != 200) {
-            logger.error("Failed : HTTP error code : " + status);
+            logger.error(response.getEntity(String.class));
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }

Modified: airavata/trunk/modules/airavata-rest-services/src/main/java/org/apache/airavata/services/registry/rest/resources/ExperimentRegistryResource.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/airavata-rest-services/src/main/java/org/apache/airavata/services/registry/rest/resources/ExperimentRegistryResource.java?rev=1409377&r1=1409376&r2=1409377&view=diff
==============================================================================
--- airavata/trunk/modules/airavata-rest-services/src/main/java/org/apache/airavata/services/registry/rest/resources/ExperimentRegistryResource.java (original)
+++ airavata/trunk/modules/airavata-rest-services/src/main/java/org/apache/airavata/services/registry/rest/resources/ExperimentRegistryResource.java Wed Nov 14 20:24:58 2012
@@ -320,11 +320,11 @@ public class ExperimentRegistryResource 
      * @param createIfNotPresent  flag to check whether to create a new experiment or not
      * @return HTTP response
      */
-    @GET
+    @POST
     @Path(ResourcePathConstants.ExperimentResourcePathConstants.EXP_EXISTS_CREATE)
     @Produces(MediaType.TEXT_PLAIN)
-    public Response isExperimentExistsThenCreate(@QueryParam("experimentId") String experimentId,
-                                                 @QueryParam("createIfNotPresent") String createIfNotPresent) {
+    public Response isExperimentExistsThenCreate(@FormParam("experimentId") String experimentId,
+                                                 @FormParam("createIfNotPresent") String createIfNotPresent) {
         boolean createIfNotPresentStatus = false;
         if (createIfNotPresent.equals("true")) {
             createIfNotPresentStatus = true;

Modified: airavata/trunk/modules/airavata-rest-services/src/main/java/org/apache/airavata/services/registry/rest/resources/UserWorkflowRegistryResource.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/airavata-rest-services/src/main/java/org/apache/airavata/services/registry/rest/resources/UserWorkflowRegistryResource.java?rev=1409377&r1=1409376&r2=1409377&view=diff
==============================================================================
--- airavata/trunk/modules/airavata-rest-services/src/main/java/org/apache/airavata/services/registry/rest/resources/UserWorkflowRegistryResource.java (original)
+++ airavata/trunk/modules/airavata-rest-services/src/main/java/org/apache/airavata/services/registry/rest/resources/UserWorkflowRegistryResource.java Wed Nov 14 20:24:58 2012
@@ -117,6 +117,7 @@ public class UserWorkflowRegistryResourc
      */
     @POST
     @Path(ResourcePathConstants.UserWFConstants.UPDATE_WORKFLOW)
+    @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
     @Produces(MediaType.TEXT_PLAIN)
     public Response updateWorkflow(@FormParam("workflowName") String workflowName,
                                    @FormParam("workflowGraphXml") String workflowGraphXml){
@@ -144,7 +145,7 @@ public class UserWorkflowRegistryResourc
      */
     @GET
     @Path(ResourcePathConstants.UserWFConstants.GET_WORKFLOWGRAPH)
-    @Produces(MediaType.TEXT_PLAIN)
+    @Produces(MediaType.APPLICATION_FORM_URLENCODED)
     public Response getWorkflowGraphXML(@QueryParam("workflowName") String workflowName) {
         airavataRegistry = (AiravataRegistry2) context.getAttribute(RestServicesConstants.AIRAVATA_REGISTRY);
         try{
@@ -175,7 +176,7 @@ public class UserWorkflowRegistryResourc
      */
     @GET
     @Path(ResourcePathConstants.UserWFConstants.GET_WORKFLOWS)
-    @Produces(MediaType.TEXT_PLAIN)
+    @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
     public Response getWorkflows()  {
         airavataRegistry = (AiravataRegistry2) context.getAttribute(RestServicesConstants.AIRAVATA_REGISTRY);
         try{
@@ -211,7 +212,7 @@ public class UserWorkflowRegistryResourc
      * @param workflowName user workflow name
      * @return HTTP response
      */
-    @GET
+    @DELETE
     @Path(ResourcePathConstants.UserWFConstants.REMOVE_WORKFLOW)
     @Produces(MediaType.TEXT_PLAIN)
     public Response removeWorkflow(@QueryParam("workflowName") String workflowName) {



Mime
View raw message