Author: amilaj
Date: Mon Jul 15 14:03:51 2013
New Revision: 1503256

URL: http://svn.apache.org/r1503256
Log:
Fixing AIRAVATA-887. Patching rest service interface. Thanks Shameera for 
contribution

Modified:
    
airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/BasicRegistryResouce.java
    
airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/ConfigurationRegistryResource.java
    
airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/DescriptorRegistryResource.java
    
airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/ExperimentRegistryResource.java
    
airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/UserWorkflowRegistryResource.java

Modified: 
airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/BasicRegistryResouce.java
URL: 
http://svn.apache.org/viewvc/airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/BasicRegistryResouce.java?rev=1503256&r1=1503255&r2=1503256&view=diff
==============================================================================
--- 
airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/BasicRegistryResouce.java
 (original)
+++ 
airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/BasicRegistryResouce.java
 Mon Jul 15 14:03:51 2013
@@ -155,7 +155,7 @@ public class BasicRegistryResouce {
 
     @GET
     @Path(ResourcePathConstants.BasicRegistryConstants.GET_SERVICE_URL)
-    @Produces(MediaType.TEXT_PLAIN)
+    @Produces({MediaType.TEXT_PLAIN,MediaType.APPLICATION_JSON})
     public Response getConnectionURL (){
         AiravataRegistry2 airavataRegistry = 
RegPoolUtils.acquireRegistry(context);
         try{
@@ -179,7 +179,7 @@ public class BasicRegistryResouce {
 
     @POST
     @Path(ResourcePathConstants.BasicRegistryConstants.SET_SERVICE_URL)
-    @Produces(MediaType.TEXT_PLAIN)
+    @Produces({MediaType.TEXT_PLAIN,MediaType.APPLICATION_JSON})
     public Response setConnectionURL (@FormParam("connectionurl") String 
connectionURL){
         AiravataRegistry2 airavataRegistry = 
RegPoolUtils.acquireRegistry(context);
         try{

Modified: 
airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/ConfigurationRegistryResource.java
URL: 
http://svn.apache.org/viewvc/airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/ConfigurationRegistryResource.java?rev=1503256&r1=1503255&r2=1503256&view=diff
==============================================================================
--- 
airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/ConfigurationRegistryResource.java
 (original)
+++ 
airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/ConfigurationRegistryResource.java
 Mon Jul 15 14:03:51 2013
@@ -58,7 +58,7 @@ public class ConfigurationRegistryResour
      */
     @Path(ResourcePathConstants.ConfigResourcePathConstants.GET_CONFIGURATION)
     @GET
-    @Produces(MediaType.TEXT_PLAIN)
+    @Produces({MediaType.TEXT_PLAIN, MediaType.APPLICATION_JSON})
     public Response getConfiguration(@QueryParam("key") String key) {
         AiravataRegistry2 airavataRegistry = 
RegPoolUtils.acquireRegistry(context);
         try {
@@ -129,7 +129,7 @@ public class ConfigurationRegistryResour
     @POST
     @Path(ResourcePathConstants.ConfigResourcePathConstants.SAVE_CONFIGURATION)
     @Produces(MediaType.TEXT_PLAIN)
-    @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
+    @Consumes({MediaType.APPLICATION_FORM_URLENCODED, 
MediaType.APPLICATION_JSON})
     public Response setConfiguration(@FormParam("key") String key,
                                      @FormParam("value") String value,
                                      @FormParam("date") String date) {

Modified: 
airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/DescriptorRegistryResource.java
URL: 
http://svn.apache.org/viewvc/airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/DescriptorRegistryResource.java?rev=1503256&r1=1503255&r2=1503256&view=diff
==============================================================================
--- 
airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/DescriptorRegistryResource.java
 (original)
+++ 
airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/DescriptorRegistryResource.java
 Mon Jul 15 14:03:51 2013
@@ -66,7 +66,7 @@ public class DescriptorRegistryResource 
      */
     @GET
     @Path(ResourcePathConstants.DecResourcePathConstants.HOST_DESC_EXISTS)
-    @Produces(MediaType.TEXT_PLAIN)
+    @Produces({MediaType.TEXT_PLAIN, MediaType.APPLICATION_JSON})
     public Response isHostDescriptorExists(@QueryParam("hostDescriptorName") 
String hostDescriptorName) {
         AiravataRegistry2 airavataRegistry = 
RegPoolUtils.acquireRegistry(context);
         boolean state;
@@ -195,7 +195,7 @@ public class DescriptorRegistryResource 
      */
     @DELETE
     @Path(ResourcePathConstants.DecResourcePathConstants.HOST_DESC_DELETE)
-    @Produces(MediaType.TEXT_PLAIN)
+    @Produces({MediaType.TEXT_PLAIN, MediaType.APPLICATION_JSON})
     public Response removeHostDescriptor(@QueryParam("hostName") String 
hostName) {
         AiravataRegistry2 airavataRegistry = 
RegPoolUtils.acquireRegistry(context);
         try {
@@ -296,7 +296,7 @@ public class DescriptorRegistryResource 
      */
     @GET
     @Path(ResourcePathConstants.DecResourcePathConstants.SERVICE_DESC_EXISTS)
-    @Produces(MediaType.TEXT_PLAIN)
+    @Produces({MediaType.TEXT_PLAIN, MediaType.APPLICATION_JSON})
     public Response 
isServiceDescriptorExists(@QueryParam("serviceDescriptorName") String 
serviceDescriptorName) {
         AiravataRegistry2 airavataRegistry = 
RegPoolUtils.acquireRegistry(context);
         boolean state;
@@ -424,7 +424,7 @@ public class DescriptorRegistryResource 
      */
     @DELETE
     @Path(ResourcePathConstants.DecResourcePathConstants.SERVICE_DESC_DELETE)
-    @Produces(MediaType.TEXT_PLAIN)
+    @Produces({MediaType.TEXT_PLAIN, MediaType.APPLICATION_JSON})
     public Response removeServiceDescriptor(@QueryParam("serviceName") String 
serviceName) {
         AiravataRegistry2 airavataRegistry = 
RegPoolUtils.acquireRegistry(context);
         try {
@@ -493,7 +493,7 @@ public class DescriptorRegistryResource 
      */
     @GET
     @Path(ResourcePathConstants.DecResourcePathConstants.APPL_DESC_EXIST)
-    @Produces(MediaType.TEXT_PLAIN)
+    @Produces({MediaType.TEXT_PLAIN, MediaType.APPLICATION_JSON})
     public Response isApplicationDescriptorExists(@QueryParam("serviceName") 
String serviceName,
                                                   @QueryParam("hostName") 
String hostName,
                                                   @QueryParam("appDescName") 
String appDescriptorName) {

Modified: 
airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/ExperimentRegistryResource.java
URL: 
http://svn.apache.org/viewvc/airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/ExperimentRegistryResource.java?rev=1503256&r1=1503255&r2=1503256&view=diff
==============================================================================
--- 
airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/ExperimentRegistryResource.java
 (original)
+++ 
airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/ExperimentRegistryResource.java
 Mon Jul 15 14:03:51 2013
@@ -166,7 +166,7 @@ public class ExperimentRegistryResource 
      */
     @GET
     
@Path(ResourcePathConstants.ExperimentResourcePathConstants.GET_EXPS_BY_DATE)
-    @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
+    @Consumes({MediaType.APPLICATION_FORM_URLENCODED, 
MediaType.APPLICATION_JSON})
     @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
     public Response getExperimentsByDate(@QueryParam("fromDate") String 
fromDate,
                                          @QueryParam("toDate") String toDate) {
@@ -213,7 +213,7 @@ public class ExperimentRegistryResource 
      */
     @GET
     
@Path(ResourcePathConstants.ExperimentResourcePathConstants.GET_EXPS_PER_PROJECT_BY_DATE)
-    @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
+    @Consumes({MediaType.APPLICATION_FORM_URLENCODED, 
MediaType.APPLICATION_JSON})
     @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
     public Response getExperimentsByProjectDate(@QueryParam("projectName") 
String projectName,
                                                 @QueryParam("fromDate") String 
fromDate,
@@ -261,7 +261,7 @@ public class ExperimentRegistryResource 
      */
     @POST
     @Path(ResourcePathConstants.ExperimentResourcePathConstants.ADD_EXP)
-    @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
+    @Consumes({MediaType.APPLICATION_FORM_URLENCODED, 
MediaType.APPLICATION_JSON})
     @Produces(MediaType.TEXT_PLAIN)
     public Response addExperiment(@FormParam("projectName") String projectName,
                                   @FormParam("experimentID") String 
experimentID,

Modified: 
airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/UserWorkflowRegistryResource.java
URL: 
http://svn.apache.org/viewvc/airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/UserWorkflowRegistryResource.java?rev=1503256&r1=1503255&r2=1503256&view=diff
==============================================================================
--- 
airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/UserWorkflowRegistryResource.java
 (original)
+++ 
airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/UserWorkflowRegistryResource.java
 Mon Jul 15 14:03:51 2013
@@ -59,7 +59,7 @@ public class UserWorkflowRegistryResourc
      */
     @GET
     @Path(ResourcePathConstants.UserWFConstants.WORKFLOW_EXIST)
-    @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
+    @Consumes({MediaType.APPLICATION_FORM_URLENCODED, 
MediaType.APPLICATION_JSON})
     @Produces(MediaType.TEXT_PLAIN)
     public Response isWorkflowExists(@QueryParam("workflowName") String 
workflowName) {
         AiravataRegistry2 airavataRegistry = 
RegPoolUtils.acquireRegistry(context);
@@ -92,7 +92,7 @@ public class UserWorkflowRegistryResourc
      */
     @POST
     @Path(ResourcePathConstants.UserWFConstants.ADD_WORKFLOW)
-    @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
+    
@Consumes({MediaType.APPLICATION_FORM_URLENCODED,MediaType.APPLICATION_JSON})
     @Produces(MediaType.TEXT_PLAIN)
     public Response addWorkflow(@FormParam("workflowName") String workflowName,
                                 @FormParam("workflowGraphXml") String 
workflowGraphXml) {
@@ -124,7 +124,7 @@ public class UserWorkflowRegistryResourc
      */
     @POST
     @Path(ResourcePathConstants.UserWFConstants.UPDATE_WORKFLOW)
-    @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
+    @Consumes({MediaType.APPLICATION_FORM_URLENCODED, 
MediaType.APPLICATION_JSON})
     @Produces(MediaType.TEXT_PLAIN)
     public Response updateWorkflow(@FormParam("workflowName") String 
workflowName,
                                    @FormParam("workflowGraphXml") String 
workflowGraphXml) {
@@ -155,7 +155,7 @@ public class UserWorkflowRegistryResourc
      */
     @GET
     @Path(ResourcePathConstants.UserWFConstants.GET_WORKFLOWGRAPH)
-    @Produces(MediaType.APPLICATION_FORM_URLENCODED)
+    @Produces({MediaType.APPLICATION_FORM_URLENCODED, 
MediaType.APPLICATION_JSON})
     public Response getWorkflowGraphXML(@QueryParam("workflowName") String 
workflowName) {
         AiravataRegistry2 airavataRegistry = 
RegPoolUtils.acquireRegistry(context);
         try {


Reply via email to