airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chath...@apache.org
Subject svn commit: r1406730 - /airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resources/
Date Wed, 07 Nov 2012 17:40:16 GMT
Author: chathuri
Date: Wed Nov  7 17:40:15 2012
New Revision: 1406730

URL: http://svn.apache.org/viewvc?rev=1406730&view=rev
Log:
adding custom messages

Modified:
    airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resources/ConfigurationRegistryResource.java
    airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resources/ExperimentRegistryResource.java
    airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resources/ProjectRegistryResource.java
    airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resources/ProvenanceRegistryResource.java
    airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resources/PublishWorkflowRegistryResource.java
    airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resources/UserWorkflowRegistryResource.java

Modified: airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resources/ConfigurationRegistryResource.java
URL: http://svn.apache.org/viewvc/airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resources/ConfigurationRegistryResource.java?rev=1406730&r1=1406729&r2=1406730&view=diff
==============================================================================
--- airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resources/ConfigurationRegistryResource.java (original)
+++ airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resources/ConfigurationRegistryResource.java Wed Nov  7 17:40:15 2012
@@ -61,10 +61,12 @@ public class ConfigurationRegistryResour
                 return builder.build();
             } else {
                 Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+                builder.entity("Configuration does not exist...");
                 return builder.build();
             }
         } catch (Exception e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            builder.entity(e.getMessage());
             return builder.build();
         }
 
@@ -90,10 +92,12 @@ public class ConfigurationRegistryResour
                 return builder.build();
             } else {
                 Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+                builder.entity("No configuration available with given config key...");
                 return builder.build();
             }
         } catch (Exception e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            builder.entity(e.getMessage());
             return builder.build();
         }
     }
@@ -111,10 +115,12 @@ public class ConfigurationRegistryResour
             Date formattedDate = dateFormat.parse(date);
             airavataRegistry = (AiravataRegistry2) context.getAttribute(RestServicesConstants.AIRAVATA_REGISTRY);
             airavataRegistry.setConfiguration(key, value, formattedDate);
-            Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
+            builder.entity("Configuration saved successfully...");
             return builder.build();
         } catch (Exception e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            builder.entity(e.getMessage());
             return builder.build();
         }
     }
@@ -130,10 +136,12 @@ public class ConfigurationRegistryResour
             Date formattedDate = dateFormat.parse(date);
             airavataRegistry = (AiravataRegistry2) context.getAttribute(RestServicesConstants.AIRAVATA_REGISTRY);
             airavataRegistry.addConfiguration(key, value, formattedDate);
-            Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
+            builder.entity("Configuration updated successfully...");
             return builder.build();
         } catch (Exception e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            builder.entity(e.getMessage());
             return builder.build();
         }
     }
@@ -145,10 +153,12 @@ public class ConfigurationRegistryResour
         try {
             airavataRegistry = (AiravataRegistry2) context.getAttribute(RestServicesConstants.AIRAVATA_REGISTRY);
             airavataRegistry.removeAllConfiguration(key);
-            Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
+            builder.entity("All configurations with given config key removed successfully...");
             return builder.build();
         } catch (Exception e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            builder.entity(e.getMessage());
             return builder.build();
         }
     }
@@ -160,10 +170,12 @@ public class ConfigurationRegistryResour
         try {
             airavataRegistry = (AiravataRegistry2) context.getAttribute(RestServicesConstants.AIRAVATA_REGISTRY);
             airavataRegistry.removeConfiguration(key, value);
-            Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
+            builder.entity("Configuration removed successfully...");
             return builder.build();
         } catch (Exception e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            builder.entity(e.getMessage());
             return builder.build();
         }
     }
@@ -187,10 +199,12 @@ public class ConfigurationRegistryResour
                 return builder.build();
             } else {
                 Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+                builder.entity("No GFac URIs available...");
                 return builder.build();
             }
         } catch (Exception e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            builder.entity(e.getMessage());
             return builder.build();
         }
     }
@@ -215,10 +229,12 @@ public class ConfigurationRegistryResour
                 return builder.build();
             } else {
                 Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+                builder.entity("No Workflow Interpreter URIs available...");
                 return builder.build();
             }
         } catch (Exception e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            builder.entity(e.getMessage());
             return builder.build();
         }
     }
@@ -236,10 +252,12 @@ public class ConfigurationRegistryResour
                 return builder.build();
             } else {
                 Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+                builder.entity("No eventing URI available...");
                 return builder.build();
             }
         } catch (Exception e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            builder.entity(e.getMessage());
             return builder.build();
         }
     }
@@ -257,10 +275,12 @@ public class ConfigurationRegistryResour
                 return builder.build();
             } else {
                 Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+                builder.entity("No message box URI available...");
                 return builder.build();
             }
         } catch (Exception e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            builder.entity(e.getMessage());
             return builder.build();
         }
     }
@@ -273,10 +293,12 @@ public class ConfigurationRegistryResour
         try {
             URI gfacURI = new URI(uri);
             airavataRegistry.addGFacURI(gfacURI);
-            Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
+            builder.entity("GFac URI added successfully...");
             return builder.build();
         } catch (Exception e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            builder.entity(e.getMessage());
             return builder.build();
         }
     }
@@ -289,10 +311,12 @@ public class ConfigurationRegistryResour
         try {
             URI interpreterURI = new URI(uri);
             airavataRegistry.addWorkflowInterpreterURI(interpreterURI);
-            Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
+            builder.entity("Workflow interpreter URI added successfully...");
             return builder.build();
         } catch (Exception e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            builder.entity(e.getMessage());
             return builder.build();
         }
     }
@@ -305,10 +329,12 @@ public class ConfigurationRegistryResour
         try {
             URI eventingURI = new URI(uri);
             airavataRegistry.setEventingURI(eventingURI);
-            Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
+            builder.entity("Eventing URI set successfully...");
             return builder.build();
         } catch (Exception e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            builder.entity(e.getMessage());
             return builder.build();
         }
     }
@@ -322,9 +348,11 @@ public class ConfigurationRegistryResour
             URI msgBoxURI = new URI(uri);
             airavataRegistry.setMessageBoxURI(msgBoxURI);
             Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+            builder.entity("MessageBox URI set successfully...");
             return builder.build();
         } catch (Exception e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            builder.entity(e.getMessage());
             return builder.build();
         }
     }
@@ -339,10 +367,12 @@ public class ConfigurationRegistryResour
             Date formattedDate = dateFormat.parse(date);
             URI gfacURI = new URI(uri);
             airavataRegistry.addGFacURI(gfacURI, formattedDate);
-            Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
+            builder.entity("GFac URI added successfully...");
             return builder.build();
         } catch (Exception e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            builder.entity(e.getMessage());
             return builder.build();
         }
     }
@@ -357,10 +387,12 @@ public class ConfigurationRegistryResour
             Date formattedDate = dateFormat.parse(date);
             URI interpreterURI = new URI(uri);
             airavataRegistry.addWorkflowInterpreterURI(interpreterURI, formattedDate);
-            Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
+            builder.entity("Workflow interpreter URI added successfully...");
             return builder.build();
         } catch (Exception e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            builder.entity(e.getMessage());
             return builder.build();
         }
     }
@@ -375,10 +407,12 @@ public class ConfigurationRegistryResour
             Date formattedDate = dateFormat.parse(date);
             URI eventingURI = new URI(uri);
             airavataRegistry.setEventingURI(eventingURI, formattedDate);
-            Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
+            builder.entity("Eventing URI added successfully...");
             return builder.build();
         } catch (Exception e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            builder.entity(e.getMessage());
             return builder.build();
         }
     }
@@ -393,10 +427,12 @@ public class ConfigurationRegistryResour
             Date formattedDate = dateFormat.parse(date);
             URI msgBoxURI = new URI(uri);
             airavataRegistry.setMessageBoxURI(msgBoxURI, formattedDate);
-            Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
+            builder.entity("Message box URI retrieved successfully...");
             return builder.build();
         } catch (Exception e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            builder.entity(e.getMessage());
             return builder.build();
         }
     }
@@ -409,10 +445,12 @@ public class ConfigurationRegistryResour
         try {
             URI gfacURI = new URI(uri);
             airavataRegistry.removeGFacURI(gfacURI);
-            Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
+            builder.entity("GFac URI deleted successfully...");
             return builder.build();
         } catch (Exception e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            builder.entity(e.getMessage());
             return builder.build();
         }
     }
@@ -424,10 +462,12 @@ public class ConfigurationRegistryResour
         airavataRegistry = (AiravataRegistry2) context.getAttribute(RestServicesConstants.AIRAVATA_REGISTRY);
         try {
             airavataRegistry.removeAllGFacURI();
-            Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
+            builder.entity("All GFac URIs deleted successfully...");
             return builder.build();
         } catch (Exception e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            builder.entity(e.getMessage());
             return builder.build();
         }
     }
@@ -440,10 +480,12 @@ public class ConfigurationRegistryResour
         try {
             URI intURI = new URI(uri);
             airavataRegistry.removeWorkflowInterpreterURI(intURI);
-            Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
+            builder.entity("Workflow Interpreter URI deleted successfully...");
             return builder.build();
         } catch (Exception e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            builder.entity(e.getMessage());
             return builder.build();
         }
     }
@@ -455,10 +497,12 @@ public class ConfigurationRegistryResour
         airavataRegistry = (AiravataRegistry2) context.getAttribute(RestServicesConstants.AIRAVATA_REGISTRY);
         try {
             airavataRegistry.removeAllWorkflowInterpreterURI();
-            Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
+            builder.entity("All workflow interpreter URIs deleted successfully...");
             return builder.build();
         } catch (Exception e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            builder.entity(e.getMessage());
             return builder.build();
         }
     }
@@ -470,10 +514,12 @@ public class ConfigurationRegistryResour
         airavataRegistry = (AiravataRegistry2) context.getAttribute(RestServicesConstants.AIRAVATA_REGISTRY);
         try {
             airavataRegistry.unsetEventingURI();
-            Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
+            builder.entity("Eventing URI deleted successfully...");
             return builder.build();
         } catch (Exception e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            builder.entity(e.getMessage());
             return builder.build();
         }
     }
@@ -485,10 +531,12 @@ public class ConfigurationRegistryResour
         airavataRegistry = (AiravataRegistry2) context.getAttribute(RestServicesConstants.AIRAVATA_REGISTRY);
         try {
             airavataRegistry.unsetMessageBoxURI();
-            Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
+            builder.entity("MessageBox URI deleted successfully...");
             return builder.build();
         } catch (Exception e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            builder.entity(e.getMessage());
             return builder.build();
         }
     }

Modified: airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resources/ExperimentRegistryResource.java
URL: http://svn.apache.org/viewvc/airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resources/ExperimentRegistryResource.java?rev=1406730&r1=1406729&r2=1406730&view=diff
==============================================================================
--- airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resources/ExperimentRegistryResource.java (original)
+++ airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resources/ExperimentRegistryResource.java Wed Nov  7 17:40:15 2012
@@ -60,10 +60,12 @@ public class ExperimentRegistryResource 
         airavataRegistry = (AiravataRegistry2) context.getAttribute(RestServicesConstants.AIRAVATA_REGISTRY);
         try {
             airavataRegistry.removeExperiment(experimentId);
-            Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
+            builder.entity("Experiment removed successfully...");
             return builder.build();
         } catch (ExperimentDoesNotExistsException e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.NOT_FOUND);
+            builder.entity(e.getMessage());
             return builder.build();
         }
     }
@@ -87,10 +89,12 @@ public class ExperimentRegistryResource 
                 return builder.build();
             } else {
                 Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+                builder.entity("No experiments found...");
                 return builder.build();
             }
         } catch (RegistryException e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            builder.entity(e.getMessage());
             return builder.build();
         }
     }
@@ -114,10 +118,12 @@ public class ExperimentRegistryResource 
                 return builder.build();
             } else {
                 Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+                builder.entity("No experiments available...");
                 return builder.build();
             }
         } catch (RegistryException e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            builder.entity(e.getMessage());
             return builder.build();
         }
     }
@@ -146,13 +152,16 @@ public class ExperimentRegistryResource 
                 return builder.build();
             } else {
                 Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+                builder.entity("No experiments available...");
                 return builder.build();
             }
         } catch (RegistryException e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            builder.entity(e.getMessage());
             return builder.build();
         } catch (ParseException e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            builder.entity(e.getMessage());
             return builder.build();
         }
     }
@@ -182,13 +191,16 @@ public class ExperimentRegistryResource 
                 return builder.build();
             } else {
                 Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+                builder.entity("No experiments available...");
                 return builder.build();
             }
         } catch (RegistryException e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            builder.entity(e.getMessage());
             return builder.build();
         } catch (ParseException e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            builder.entity(e.getMessage());
             return builder.build();
         }
     }
@@ -212,19 +224,24 @@ public class ExperimentRegistryResource 
             Date formattedDate = dateFormat.parse(submittedDate);
             experiment.setSubmittedDate(formattedDate);
             airavataRegistry.addExperiment(projectName, experiment);
-            Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
+            builder.entity("Experiment added successfully...");
             return builder.build();
         } catch (ExperimentDoesNotExistsException e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.NOT_FOUND);
+            builder.entity(e.getMessage());
             return builder.build();
         } catch (WorkspaceProjectDoesNotExistsException e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.NOT_FOUND);
+            builder.entity(e.getMessage());
             return builder.build();
         } catch (RegistryException e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            builder.entity(e.getMessage());
             return builder.build();
         } catch (ParseException e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            builder.entity(e.getMessage());
             return builder.build();
         }
 
@@ -238,11 +255,11 @@ public class ExperimentRegistryResource 
         try {
             airavataRegistry.isExperimentExists(experimentId);
             Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-            builder.entity("True");
+            builder.entity("Experiment exists...");
             return builder.build();
         } catch (ExperimentDoesNotExistsException e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.NOT_FOUND);
-            builder.entity("False");
+            builder.entity("Exprtiment does not exist...");
             return builder.build();
         }
     }
@@ -260,10 +277,11 @@ public class ExperimentRegistryResource 
         try {
             airavataRegistry.isExperimentExists(experimentId, createIfNotPresentStatus);
             Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-            builder.entity("True");
+            builder.entity("New experiment created...");
             return builder.build();
         } catch (RegistryException e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.NOT_FOUND);
+            builder.entity(e.getMessage());
             return builder.build();
         }
     }

Modified: airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resources/ProjectRegistryResource.java
URL: http://svn.apache.org/viewvc/airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resources/ProjectRegistryResource.java?rev=1406730&r1=1406729&r2=1406730&view=diff
==============================================================================
--- airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resources/ProjectRegistryResource.java (original)
+++ airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resources/ProjectRegistryResource.java Wed Nov  7 17:40:15 2012
@@ -55,15 +55,16 @@ public class ProjectRegistryResource {
             boolean result = airavataRegistry.isWorkspaceProjectExists(projectName);
             if (result) {
                 Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity("True");
+                builder.entity("Project exists...");
                 return builder.build();
             } else {
                 Response.ResponseBuilder builder = Response.status(Response.Status.NOT_FOUND);
-                builder.entity("False");
+                builder.entity("Project does not exist...");
                 return builder.build();
             }
         } catch (RegistryException e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            builder.entity(e.getMessage());
             return builder.build();
         }
     }
@@ -82,16 +83,16 @@ public class ProjectRegistryResource {
             boolean result = airavataRegistry.isWorkspaceProjectExists(projectName, createIfNotExistStatus);
             if (result) {
                 Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity("True");
+                builder.entity("New project has been created...");
                 return builder.build();
             } else {
                 Response.ResponseBuilder builder = Response.status(Response.Status.NOT_FOUND);
-                builder.entity("False");
+                builder.entity("Could not create the project...");
                 return builder.build();
             }
         } catch (RegistryException e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity("False");
+            builder.entity(e.getMessage());
             return builder.build();
         }
     }
@@ -104,13 +105,16 @@ public class ProjectRegistryResource {
         try {
             WorkspaceProject workspaceProject = new WorkspaceProject(projectName, airavataRegistry);
             airavataRegistry.addWorkspaceProject(workspaceProject);
-            Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
+            builder.entity("Workspace project added successfully...");
             return builder.build();
         } catch (WorkspaceProjectAlreadyExistsException e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            builder.entity(e.getMessage());
             return builder.build();
         } catch (RegistryException e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            builder.entity(e.getMessage());
             return builder.build();
         }
     }
@@ -123,13 +127,16 @@ public class ProjectRegistryResource {
         try {
             WorkspaceProject workspaceProject = new WorkspaceProject(projectName, airavataRegistry);
             airavataRegistry.updateWorkspaceProject(workspaceProject);
-            Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
+            builder.entity("Workspace project updated successfully...");
             return builder.build();
         } catch (WorkspaceProjectDoesNotExistsException e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            builder.entity(e.getMessage());
             return builder.build();
         } catch (RegistryException e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            builder.entity(e.getMessage());
             return builder.build();
         }
     }
@@ -141,13 +148,16 @@ public class ProjectRegistryResource {
         airavataRegistry = (AiravataRegistry2) context.getAttribute(RestServicesConstants.AIRAVATA_REGISTRY);
         try {
             airavataRegistry.deleteWorkspaceProject(projectName);
-            Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
+            builder.entity("Workspace project deleted successfully...");
             return builder.build();
         } catch (WorkspaceProjectDoesNotExistsException e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            builder.entity(e.getMessage());
             return builder.build();
         } catch (RegistryException e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            builder.entity(e.getMessage());
             return builder.build();
         }
     }
@@ -165,13 +175,16 @@ public class ProjectRegistryResource {
                 return builder.build();
             } else {
                 Response.ResponseBuilder builder = Response.status(Response.Status.NOT_FOUND);
+                builder.entity("No workspace projects available...");
                 return builder.build();
             }
         } catch (WorkspaceProjectDoesNotExistsException e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            builder.entity(e.getMessage());
             return builder.build();
         } catch (RegistryException e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            builder.entity(e.getMessage());
             return builder.build();
         }
     }
@@ -195,10 +208,12 @@ public class ProjectRegistryResource {
                 return builder.build();
             } else {
                 Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+                builder.entity("No workspace projects available...");
                 return builder.build();
             }
         } catch (RegistryException e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            builder.entity(e.getMessage());
             return builder.build();
         }
     }

Modified: airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resources/ProvenanceRegistryResource.java
URL: http://svn.apache.org/viewvc/airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resources/ProvenanceRegistryResource.java?rev=1406730&r1=1406729&r2=1406730&view=diff
==============================================================================
--- airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resources/ProvenanceRegistryResource.java (original)
+++ airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resources/ProvenanceRegistryResource.java Wed Nov  7 17:40:15 2012
@@ -62,9 +62,11 @@ public class ProvenanceRegistryResource 
         try {
             airavataRegistry.updateExperimentExecutionUser(experimentId, user);
             Response.ResponseBuilder builder = Response.status(Response.Status.OK);
+            builder.entity("Experiment execution user updated successfully...");
             return builder.build();
         } catch (RegistryException e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.NOT_FOUND);
+            builder.entity(e.getMessage());
             return builder.build();
         }
     }
@@ -82,10 +84,12 @@ public class ProvenanceRegistryResource 
                 return builder.build();
             } else {
                 Response.ResponseBuilder builder = Response.status(Response.Status.NOT_MODIFIED);
+                builder.entity("Could not get experiment execution user...");
                 return builder.build();
             }
         } catch (RegistryException e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            builder.entity(e.getMessage());
             return builder.build();
         }
     }
@@ -103,10 +107,12 @@ public class ProvenanceRegistryResource 
                 return builder.build();
             } else {
                 Response.ResponseBuilder builder = Response.status(Response.Status.NOT_MODIFIED);
+                builder.entity("Experiment name not available...");
                 return builder.build();
             }
         } catch (RegistryException e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            builder.entity(e.getMessage());
             return builder.build();
         }
     }
@@ -120,9 +126,11 @@ public class ProvenanceRegistryResource 
         try {
             airavataRegistry.updateExperimentName(experimentId, experimentName);
             Response.ResponseBuilder builder = Response.status(Response.Status.OK);
+            builder.entity("Experiment Name updated successfully...");
             return builder.build();
         } catch (RegistryException e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.NOT_FOUND);
+            builder.entity(e.getMessage());
             return builder.build();
         }
     }
@@ -140,11 +148,13 @@ public class ProvenanceRegistryResource 
                 builder.entity(result);
                 return builder.build();
             } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NOT_MODIFIED);
+                Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+                builder.entity("Experiment metadata not available...");
                 return builder.build();
             }
         } catch (RegistryException e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            builder.entity(e.getMessage());
             return builder.build();
         }
     }
@@ -158,9 +168,11 @@ public class ProvenanceRegistryResource 
         try {
             airavataRegistry.updateExperimentMetadata(experimentId, metadata);
             Response.ResponseBuilder builder = Response.status(Response.Status.OK);
+            builder.entity("Experiment metadata updated successfully...");
             return builder.build();
         } catch (RegistryException e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.NOT_FOUND);
+            builder.entity(e.getMessage());
             return builder.build();
         }
     }
@@ -179,11 +191,13 @@ public class ProvenanceRegistryResource 
                 builder.entity(result);
                 return builder.build();
             } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NOT_MODIFIED);
+                Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+                builder.entity("Workflow template name not available...");
                 return builder.build();
             }
         } catch (RegistryException e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            builder.entity(e.getMessage());
             return builder.build();
         }
     }
@@ -196,10 +210,12 @@ public class ProvenanceRegistryResource 
         airavataRegistry = (AiravataRegistry2) context.getAttribute(RestServicesConstants.AIRAVATA_REGISTRY);
         try {
             airavataRegistry.setWorkflowInstanceTemplateName(workflowInstanceId, templateName);
-            Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
+            builder.entity("Workflow template name updated successfully...");
             return builder.build();
         } catch (RegistryException e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.NOT_FOUND);
+            builder.entity(e.getMessage());
             return builder.build();
         }
     }
@@ -223,10 +239,12 @@ public class ProvenanceRegistryResource 
                 return builder.build();
             } else {
                 Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+                builder.entity("No workflow instances available...");
                 return builder.build();
             }
         } catch (RegistryException e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            builder.entity(e.getMessage());
             return builder.build();
         }
     }
@@ -240,15 +258,16 @@ public class ProvenanceRegistryResource 
             Boolean result = airavataRegistry.isWorkflowInstanceExists(instanceId);
             if (result) {
                 Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity("True");
+                builder.entity("Workflow instance available...");
                 return builder.build();
             } else {
                 Response.ResponseBuilder builder = Response.status(Response.Status.NOT_FOUND);
-                builder.entity("False");
+                builder.entity("Workflow instance does not exist...");
                 return builder.build();
             }
         } catch (RegistryException e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.NOT_FOUND);
+            builder.entity(e.getMessage());
             return builder.build();
         }
 
@@ -264,14 +283,16 @@ public class ProvenanceRegistryResource 
             Boolean result = airavataRegistry.isWorkflowInstanceExists(instanceId, createIfNotPresent);
             if (result) {
                 Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity("True");
+                builder.entity("New workflow instance has been created...");
                 return builder.build();
             } else {
                 Response.ResponseBuilder builder = Response.status(Response.Status.NOT_FOUND);
+                builder.entity("Could not create workflow instance...");
                 return builder.build();
             }
         } catch (RegistryException e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.NOT_FOUND);
+            builder.entity(e.getMessage());
             return builder.build();
         }
     }
@@ -286,9 +307,11 @@ public class ProvenanceRegistryResource 
             WorkflowInstanceStatus.ExecutionStatus status = WorkflowInstanceStatus.ExecutionStatus.valueOf(executionStatus);
             airavataRegistry.updateWorkflowInstanceStatus(instanceId, status);
             Response.ResponseBuilder builder = Response.status(Response.Status.OK);
+            builder.entity("Workflow instance status updated successfully...");
             return builder.build();
         } catch (RegistryException e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.NOT_FOUND);
+            builder.entity(e.getMessage());
             return builder.build();
         }
     }
@@ -308,12 +331,15 @@ public class ProvenanceRegistryResource 
             WorkflowInstanceStatus workflowInstanceStatus = new WorkflowInstanceStatus(workflowInstance, status, formattedDate);
             airavataRegistry.updateWorkflowInstanceStatus(workflowInstanceStatus);
             Response.ResponseBuilder builder = Response.status(Response.Status.OK);
+            builder.entity("Workflow instance status updated successfully...");
             return builder.build();
         } catch (RegistryException e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.NOT_FOUND);
+            builder.entity(e.getMessage());
             return builder.build();
         } catch (ParseException e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.NOT_FOUND);
+            builder.entity(e.getMessage());
             return builder.build();
         }
     }
@@ -331,10 +357,12 @@ public class ProvenanceRegistryResource 
                 return builder.build();
             } else {
                 Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+                builder.entity("Could not get workflow instance status...");
                 return builder.build();
             }
         } catch (RegistryException e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            builder.entity(e.getMessage());
             return builder.build();
         }
     }
@@ -351,9 +379,11 @@ public class ProvenanceRegistryResource 
             WorkflowInstanceNode workflowInstanceNode = workflowInstanceData.getNodeData(nodeID).getWorkflowInstanceNode();
             airavataRegistry.updateWorkflowNodeInput(workflowInstanceNode, data);
             Response.ResponseBuilder builder = Response.status(Response.Status.OK);
+            builder.entity("Workflow node input saved successfully...");
             return builder.build();
         } catch (RegistryException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.NOT_FOUND);
+            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            builder.entity(e.getMessage());
             return builder.build();
         }
 
@@ -371,9 +401,11 @@ public class ProvenanceRegistryResource 
             WorkflowInstanceNode workflowInstanceNode = workflowInstanceData.getNodeData(nodeID).getWorkflowInstanceNode();
             airavataRegistry.updateWorkflowNodeOutput(workflowInstanceNode, data);
             Response.ResponseBuilder builder = Response.status(Response.Status.OK);
+            builder.entity("Workflow node output saved successfully...");
             return builder.build();
         } catch (RegistryException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.NOT_FOUND);
+            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            builder.entity(e.getMessage());
             return builder.build();
         }
     }
@@ -540,10 +572,12 @@ public class ProvenanceRegistryResource 
                 return builder.build();
             } else {
                 Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+                builder.entity("No experiments available...");
                 return builder.build();
             }
         } catch (RegistryException e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            builder.entity(e.getMessage());
             return builder.build();
         }
     }
@@ -557,17 +591,18 @@ public class ProvenanceRegistryResource 
             ArrayList<String> experiments = (ArrayList)airavataRegistry.getExperimentIdByUser(username);
             ExperimentIDList experimentIDList = new ExperimentIDList();
             experimentIDList.setExperimentIDList(experiments);
-
             if (experiments.size() != 0){
                 Response.ResponseBuilder builder = Response.status(Response.Status.OK);
                 builder.entity(experimentIDList);
                 return builder.build();
             } else {
                 Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+                builder.entity("No experiments available...");
                 return builder.build();
             }
         } catch (RegistryException e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            builder.entity(e.getMessage());
             return builder.build();
         }
     }
@@ -591,10 +626,12 @@ public class ProvenanceRegistryResource 
                 return builder.build();
             } else {
                 Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+                builder.entity("No experiments available...");
                 return builder.build();
             }
         } catch (RegistryException e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            builder.entity(e.getMessage());
             return builder.build();
         }
     }
@@ -610,9 +647,11 @@ public class ProvenanceRegistryResource 
             WorkflowInstanceStatus.ExecutionStatus status = WorkflowInstanceStatus.ExecutionStatus.valueOf(executionStatus);
             airavataRegistry.updateWorkflowNodeStatus(workflowInstanceId, nodeId, status);
             Response.ResponseBuilder builder = Response.status(Response.Status.OK);
+            builder.entity("Workflow node status updated successfully...");
             return builder.build();
         } catch (RegistryException e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            builder.entity(e.getMessage());
             return builder.build();
         }
     }
@@ -634,10 +673,12 @@ public class ProvenanceRegistryResource 
                 return builder.build();
             } else {
                 Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+                builder.entity("Could not retrieve workflow node status...");
                 return builder.build();
             }
         } catch (RegistryException e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            builder.entity(e.getMessage());
             return builder.build();
         }
     }
@@ -658,10 +699,12 @@ public class ProvenanceRegistryResource 
                 return builder.build();
             } else {
                 Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+                builder.entity("Could not retrieve workflow node started time...");
                 return builder.build();
             }
         } catch (RegistryException e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            builder.entity(e.getMessage());
             return builder.build();
         }
     }
@@ -681,10 +724,12 @@ public class ProvenanceRegistryResource 
                 return builder.build();
             } else {
                 Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+                builder.entity("Could not retrieve workflow start time...");
                 return builder.build();
             }
         } catch (RegistryException e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            builder.entity(e.getMessage());
             return builder.build();
         }
     }
@@ -698,9 +743,11 @@ public class ProvenanceRegistryResource 
         try{
             airavataRegistry.updateWorkflowNodeGramData(workflowNodeGramData);
             Response.ResponseBuilder builder = Response.status(Response.Status.OK);
+            builder.entity("Workflow node Gram data updated successfully...");
             return builder.build();
         } catch (RegistryException e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            builder.entity(e.getMessage());
             return builder.build();
         }
 
@@ -719,10 +766,12 @@ public class ProvenanceRegistryResource 
                 return builder.build();
             } else {
                 Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+                builder.entity("Could not retrieve workflow instance data...");
                 return builder.build();
             }
         } catch (RegistryException e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+            builder.entity(e.getMessage());
             return builder.build();
         }
     }
@@ -737,11 +786,11 @@ public class ProvenanceRegistryResource 
             boolean workflowInstanceNodePresent = airavataRegistry.isWorkflowInstanceNodePresent(workflowInstanceId, nodeId);
             if (workflowInstanceNodePresent){
                 Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity("True");
+                builder.entity("Workflow instance node exists...");
                 return builder.build();
             } else {
                 Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                builder.entity("False");
+                builder.entity("Workflow instance node does not exist...");
                 return builder.build();
             }
         } catch (RegistryException e) {
@@ -766,6 +815,7 @@ public class ProvenanceRegistryResource 
                 return builder.build();
             }  else {
                 Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+                builder.entity("Could not retrieve workflow instance node data...");
                 return builder.build();
             }
         } catch (RegistryException e) {
@@ -786,6 +836,7 @@ public class ProvenanceRegistryResource 
         try{
             airavataRegistry.addWorkflowInstance(experimentId, workflowInstanceId, templateName);
             Response.ResponseBuilder builder = Response.status(Response.Status.OK);
+            builder.entity("Workflow instance added successfully...");
             return builder.build();
         } catch (RegistryException e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
@@ -811,6 +862,7 @@ public class ProvenanceRegistryResource 
 //            workflowNodeType.setNodeType(nodeType);
             airavataRegistry.updateWorkflowNodeType(workflowInstanceNode, workflowNodeType);
             Response.ResponseBuilder builder = Response.status(Response.Status.OK);
+            builder.entity("Workflow instance node type updated successfully...");
             return builder.build();
         } catch (RegistryException e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
@@ -829,6 +881,7 @@ public class ProvenanceRegistryResource 
         try{
             airavataRegistry.addWorkflowInstanceNode(workflowInstanceId, nodeId);
             Response.ResponseBuilder builder = Response.status(Response.Status.OK);
+            builder.entity("Workflow instance node added successfully...");
             return builder.build();
         } catch (RegistryException e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);

Modified: airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resources/PublishWorkflowRegistryResource.java
URL: http://svn.apache.org/viewvc/airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resources/PublishWorkflowRegistryResource.java?rev=1406730&r1=1406729&r2=1406730&view=diff
==============================================================================
--- airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resources/PublishWorkflowRegistryResource.java (original)
+++ airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resources/PublishWorkflowRegistryResource.java Wed Nov  7 17:40:15 2012
@@ -58,11 +58,11 @@ public class PublishWorkflowRegistryReso
             boolean workflowExists = airavataRegistry.isPublishedWorkflowExists(workflowname);
             if (workflowExists){
                 Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity("True");
+                builder.entity("Publish workflow exists...");
                 return builder.build();
             }else {
                 Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                builder.entity("False");
+                builder.entity("Publish workflow does not exists...");
                 return builder.build();
             }
         } catch (RegistryException e) {
@@ -81,6 +81,7 @@ public class PublishWorkflowRegistryReso
         try{
             airavataRegistry.publishWorkflow(workflowName, publishWorkflowName);
             Response.ResponseBuilder builder = Response.status(Response.Status.OK);
+            builder.entity("Workflow published successfully...");
             return builder.build();
         } catch (UserWorkflowDoesNotExistsException e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
@@ -105,6 +106,7 @@ public class PublishWorkflowRegistryReso
         try{
             airavataRegistry.publishWorkflow(workflowName);
             Response.ResponseBuilder builder = Response.status(Response.Status.OK);
+            builder.entity("Workflow published successfully...");
             return builder.build();
         } catch (UserWorkflowDoesNotExistsException e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
@@ -134,6 +136,7 @@ public class PublishWorkflowRegistryReso
                 return builder.build();
             }else {
                 Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+                builder.entity("Could not find workflow graph...");
                 return builder.build();
             }
         } catch (PublishedWorkflowDoesNotExistsException e) {
@@ -162,6 +165,7 @@ public class PublishWorkflowRegistryReso
                 return builder.build();
             } else {
                 Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+                builder.entity("No published workflows available...");
                 return builder.build();
             }
         } catch (RegistryException e) {
@@ -193,6 +197,7 @@ public class PublishWorkflowRegistryReso
                 return builder.build();
             } else {
                 Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+                builder.entity("Publish workflows does not exists...");
                 return builder.build();
             }
 
@@ -211,6 +216,7 @@ public class PublishWorkflowRegistryReso
         try{
             airavataRegistry.removePublishedWorkflow(workflowName);
             Response.ResponseBuilder builder = Response.status(Response.Status.OK);
+            builder.entity("Publish workflow removed successfully...");
             return builder.build();
         } catch (PublishedWorkflowDoesNotExistsException e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);

Modified: airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resources/UserWorkflowRegistryResource.java
URL: http://svn.apache.org/viewvc/airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resources/UserWorkflowRegistryResource.java?rev=1406730&r1=1406729&r2=1406730&view=diff
==============================================================================
--- airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resources/UserWorkflowRegistryResource.java (original)
+++ airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resources/UserWorkflowRegistryResource.java Wed Nov  7 17:40:15 2012
@@ -56,11 +56,11 @@ public class UserWorkflowRegistryResourc
             boolean workflowExists = airavataRegistry.isWorkflowExists(workflowName);
             if (workflowExists){
                 Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity("True");
+                builder.entity("User workflow exists...");
                 return builder.build();
             }else {
                 Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                builder.entity("False");
+                builder.entity("User workflow does not exists...");
                 return builder.build();
             }
         } catch (RegistryException e) {
@@ -80,6 +80,7 @@ public class UserWorkflowRegistryResourc
         try{
             airavataRegistry.addWorkflow(workflowName, workflowGraphXml);
             Response.ResponseBuilder builder = Response.status(Response.Status.OK);
+            builder.entity("Workflow added successfully...");
             return builder.build();
         } catch (UserWorkflowAlreadyExistsException e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
@@ -101,6 +102,7 @@ public class UserWorkflowRegistryResourc
         try{
             airavataRegistry.updateWorkflow(workflowName, workflowGraphXml);
             Response.ResponseBuilder builder = Response.status(Response.Status.OK);
+            builder.entity("Workflow updated successfully...");
             return builder.build();
         } catch (UserWorkflowAlreadyExistsException e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
@@ -126,6 +128,7 @@ public class UserWorkflowRegistryResourc
                 return builder.build();
             }else {
                 Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+                builder.entity("Could not get workflow graph...");
                 return builder.build();
             }
         } catch (UserWorkflowDoesNotExistsException e) {
@@ -161,6 +164,7 @@ public class UserWorkflowRegistryResourc
                 return builder.build();
             } else {
                 Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+                builder.entity("User workflows do not exists...");
                 return builder.build();
             }
 
@@ -180,6 +184,7 @@ public class UserWorkflowRegistryResourc
         try{
             airavataRegistry.removeWorkflow(workflowName);
             Response.ResponseBuilder builder = Response.status(Response.Status.OK);
+            builder.entity("Workflow removed successfully...");
             return builder.build();
         } catch (UserWorkflowDoesNotExistsException e) {
             Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);



Mime
View raw message