Author: chathuri
Date: Wed Nov 7 21:28:02 2012
New Revision: 1406818
URL: http://svn.apache.org/viewvc?rev=1406818&view=rev
Log:
adding java docs
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/DescriptorRegistryResource.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=1406818&r1=1406817&r2=1406818&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 21:28:02 2012
@@ -37,6 +37,10 @@ import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
+/**
+ * This class is a REST interface to all the methods related to Configuration
which are exposed by
+ * Airavata Registry API
+ */
@Path("/registry/api/congfigregistry")
public class ConfigurationRegistryResource {
private AiravataRegistry2 airavataRegistry;
@@ -48,6 +52,11 @@ public class ConfigurationRegistryResour
* ---------------------------------Configuration
Registry----------------------------------*
*/
+ /**
+ * This method will return the configuration value corrosponding to given
config key
+ * @param key configuration key
+ * @return HTTP Response
+ */
@Path("get/configuration")
@GET
@Produces(MediaType.TEXT_PLAIN)
@@ -72,7 +81,11 @@ public class ConfigurationRegistryResour
}
-
+ /**
+ * This method will return configuration list for given configuration key
+ * @param key configuration key
+ * @return HTTP response
+ */
@GET
@Path("get/configurationlist")
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
@@ -103,6 +116,13 @@ public class ConfigurationRegistryResour
}
+ /**
+ * This method will add a configuration with given config key, config
value and expiration date
+ * @param key configuration key
+ * @param value configuration value
+ * @param date configuration expire data
+ * @return HTTP response
+ */
@POST
@Path("save/configuration")
@Produces(MediaType.TEXT_PLAIN)
@@ -125,6 +145,14 @@ public class ConfigurationRegistryResour
}
}
+ /**
+ * This method will update the configuration according to the given config
value and expire
+ * date
+ * @param key config key
+ * @param value config value
+ * @param date expiration date
+ * @return HTTP response
+ */
@POST
@Path("update/configuration")
@Produces(MediaType.TEXT_PLAIN)
@@ -146,6 +174,11 @@ public class ConfigurationRegistryResour
}
}
+ /**
+ * This method will delete all configuration of the given config key
+ * @param key configuration key
+ * @return HTTP response
+ */
@DELETE
@Path("delete/allconfiguration")
@Produces(MediaType.TEXT_PLAIN)
@@ -163,6 +196,12 @@ public class ConfigurationRegistryResour
}
}
+ /**
+ * This method will delete the configuration with the given config key and
config value
+ * @param key configuration key
+ * @param value configuration value
+ * @return HTTP response
+ */
@DELETE
@Path("delete/configuration")
@Produces(MediaType.TEXT_PLAIN)
@@ -180,6 +219,10 @@ public class ConfigurationRegistryResour
}
}
+ /**
+ * This method will retrieve all the GFac URIs
+ * @return HTTP response
+ */
@GET
@Path("get/gfac/urilist")
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
@@ -209,7 +252,10 @@ public class ConfigurationRegistryResour
}
}
-
+ /**
+ * This method will retrieve all the workflow interpreter URIs
+ * @return HTTP response
+ */
@GET
@Path("get/workflowinterpreter/urilist")
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
@@ -239,6 +285,10 @@ public class ConfigurationRegistryResour
}
}
+ /**
+ * This method will retrieve eventing URI
+ * @return HTTP response
+ */
@GET
@Path("get/eventingservice/uri")
@Produces(MediaType.TEXT_PLAIN)
@@ -262,6 +312,10 @@ public class ConfigurationRegistryResour
}
}
+ /**
+ * This method will retrieve messagebox URI
+ * @return HTTP response
+ */
@GET
@Path("get/messagebox/uri")
@Produces(MediaType.TEXT_PLAIN)
@@ -285,6 +339,11 @@ public class ConfigurationRegistryResour
}
}
+ /**
+ * This method will add new GFac URI
+ * @param uri gfac URI
+ * @return HTTP response
+ */
@POST
@Path("add/gfacuri")
@Produces(MediaType.TEXT_PLAIN)
@@ -303,6 +362,11 @@ public class ConfigurationRegistryResour
}
}
+ /**
+ * This method will add new workflow interpreter URI
+ * @param uri workflow interpreter URI
+ * @return HTTP response
+ */
@POST
@Path("add/workflowinterpreteruri")
@Produces(MediaType.TEXT_PLAIN)
@@ -321,6 +385,11 @@ public class ConfigurationRegistryResour
}
}
+ /**
+ * This method will set a new eventing URI
+ * @param uri eventing URI
+ * @return HTTP response
+ */
@POST
@Path("add/eventinguri")
@Produces(MediaType.TEXT_PLAIN)
@@ -339,6 +408,11 @@ public class ConfigurationRegistryResour
}
}
+ /**
+ * This method will set message box URI
+ * @param uri message box URI
+ * @return HTTP response
+ */
@POST
@Path("add/msgboxuri")
@Produces(MediaType.TEXT_PLAIN)
@@ -357,6 +431,12 @@ public class ConfigurationRegistryResour
}
}
+ /**
+ * This method will update GFac URI expiring date
+ * @param uri GFac URI
+ * @param date Expiration date
+ * @return HTTP response
+ */
@POST
@Path("add/gfacuri/date")
@Produces(MediaType.TEXT_PLAIN)
@@ -377,6 +457,12 @@ public class ConfigurationRegistryResour
}
}
+ /**
+ * This method will update workflow interpreter URI expiration date
+ * @param uri workflow interpreter URI
+ * @param date workflow interpreter expiration date
+ * @return HTTP response
+ */
@POST
@Path("add/workflowinterpreteruri/date")
@Produces(MediaType.TEXT_PLAIN)
@@ -397,6 +483,12 @@ public class ConfigurationRegistryResour
}
}
+ /**
+ * This method will update Eventing URI expiration date
+ * @param uri eventing URI
+ * @param date eventing URI expiration date
+ * @return HTTP response
+ */
@POST
@Path("add/eventinguri/date")
@Produces(MediaType.TEXT_PLAIN)
@@ -417,6 +509,12 @@ public class ConfigurationRegistryResour
}
}
+ /**
+ * This method will update expiration date of Message box URI
+ * @param uri message box URI
+ * @param date message box expiration date
+ * @return HTTP response
+ */
@POST
@Path("add/msgboxuri/date")
@Produces(MediaType.TEXT_PLAIN)
@@ -437,6 +535,11 @@ public class ConfigurationRegistryResour
}
}
+ /**
+ * This method will remove GFac URI
+ * @param uri GFac URI
+ * @return HTTP response
+ */
@DELETE
@Path("delete/gfacuri")
@Produces(MediaType.TEXT_PLAIN)
@@ -455,6 +558,10 @@ public class ConfigurationRegistryResour
}
}
+ /**
+ * This method will remove all the GFac URIs
+ * @return HTTP response
+ */
@DELETE
@Path("delete/allgfacuris")
@Produces(MediaType.TEXT_PLAIN)
@@ -472,6 +579,11 @@ public class ConfigurationRegistryResour
}
}
+ /**
+ * This method will remove workflow interpreter URI
+ * @param uri workflow interpreter URI
+ * @return HTTP response
+ */
@DELETE
@Path("delete/workflowinterpreteruri")
@Produces(MediaType.TEXT_PLAIN)
@@ -490,6 +602,10 @@ public class ConfigurationRegistryResour
}
}
+ /**
+ * This method will remove all the workflow interpreter URIs
+ * @return HTTP response
+ */
@DELETE
@Path("delete/allworkflowinterpreteruris")
@Produces(MediaType.TEXT_PLAIN)
@@ -507,6 +623,10 @@ public class ConfigurationRegistryResour
}
}
+ /**
+ * This method will remove eventing URI
+ * @return HTTP response
+ */
@DELETE
@Path("delete/eventinguri")
@Produces(MediaType.TEXT_PLAIN)
@@ -524,6 +644,10 @@ public class ConfigurationRegistryResour
}
}
+ /**
+ * This method will remove message box URI
+ * @return HTTP response
+ */
@DELETE
@Path("delete/msgboxuri")
@Produces(MediaType.TEXT_PLAIN)
Modified:
airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resources/DescriptorRegistryResource.java
URL:
http://svn.apache.org/viewvc/airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resources/DescriptorRegistryResource.java?rev=1406818&r1=1406817&r2=1406818&view=diff
==============================================================================
---
airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resources/DescriptorRegistryResource.java
(original)
+++
airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resources/DescriptorRegistryResource.java
Wed Nov 7 21:28:02 2012
@@ -42,6 +42,10 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Map;
+/**
+ * This class is the REST interface for all the operation regarding
descriptors that are
+ * exposed from Airavata Registry API
+ */
@Path("/registry/api/descriptors")
public class DescriptorRegistryResource {
private AiravataRegistry2 airavataRegistry;
@@ -54,14 +58,19 @@ public class DescriptorRegistryResource
*/
+ /**
+ * This method will check whether the host descriptor exists
+ * @param hostDescriptorName host descriptor name
+ * @return HTTP response
+ */
@GET
@Path("hostdescriptor/exist")
@Produces(MediaType.TEXT_PLAIN)
- public Response isHostDescriptorExists(@QueryParam("descriptorName")
String descriptorName) {
+ public Response isHostDescriptorExists(@QueryParam("hostDescriptorName")
String hostDescriptorName) {
airavataRegistry = (AiravataRegistry2)
context.getAttribute(RestServicesConstants.AIRAVATA_REGISTRY);
boolean state;
try {
- state = airavataRegistry.isHostDescriptorExists(descriptorName);
+ state =
airavataRegistry.isHostDescriptorExists(hostDescriptorName);
if (state) {
Response.ResponseBuilder builder =
Response.status(Response.Status.OK);
builder.entity("Host Descriptor exists...");
@@ -78,6 +87,11 @@ public class DescriptorRegistryResource
}
}
+ /**
+ * This method will save the host descriptor
+ * @param host JSON message send according to HostDescriptor class
+ * @return HTTP response
+ */
@POST
@Path("hostdescriptor/save")
@Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
@@ -101,6 +115,11 @@ public class DescriptorRegistryResource
}
}
+ /**
+ * This method will update the host descriptor
+ * @param host JSON message send according to HostDescriptor class
+ * @return HTTP response
+ */
@POST
@Path("hostdescriptor/update")
@Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
@@ -124,6 +143,12 @@ public class DescriptorRegistryResource
}
}
+ /**
+ * This method will retrieve host descriptor. Clients will get a JSON
message that is generated
+ * according to HostDescriptor class
+ * @param hostName host name
+ * @return HTTP response
+ */
@GET
@Path("host/description")
@Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
@@ -150,6 +175,11 @@ public class DescriptorRegistryResource
}
+ /**
+ * This method will delete the given host descriptor
+ * @param hostName host descriptor name
+ * @return HTTP response
+ */
@DELETE
@Path("hostdescriptor/delete")
@Produces(MediaType.TEXT_PLAIN)
@@ -171,6 +201,10 @@ public class DescriptorRegistryResource
}
}
+ /**
+ * This method will retrieve all the host descriptors available.
+ * @return HTTP response
+ */
@GET
@Path("get/hostdescriptors")
@Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
@@ -202,6 +236,10 @@ public class DescriptorRegistryResource
}
}
+ /**
+ * This method will return all the host descriptor names available
+ * @return HTTP response
+ */
@GET
@Path("get/hostdescriptor/names")
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
@@ -231,14 +269,19 @@ public class DescriptorRegistryResource
}
}
+ /**
+ * This method will check whether the service descriptor available
+ * @param serviceDescriptorName service descriptor name
+ * @return HTTP response
+ */
@GET
@Path("servicedescriptor/exist")
@Produces(MediaType.TEXT_PLAIN)
- public Response isServiceDescriptorExists(@QueryParam("descriptorName")
String descriptorName) {
+ public Response
isServiceDescriptorExists(@QueryParam("serviceDescriptorName") String
serviceDescriptorName) {
airavataRegistry = (AiravataRegistry2)
context.getAttribute(RestServicesConstants.AIRAVATA_REGISTRY);
boolean state;
try {
- state = airavataRegistry.isServiceDescriptorExists(descriptorName);
+ state =
airavataRegistry.isServiceDescriptorExists(serviceDescriptorName);
if (state) {
Response.ResponseBuilder builder =
Response.status(Response.Status.OK);
builder.entity("True");
@@ -255,6 +298,11 @@ public class DescriptorRegistryResource
}
}
+ /**
+ * This method will save the service descriptor
+ * @param service this is a JSON message created according to
ServiceDescriptor class
+ * @return HTTP response
+ */
@POST
@Path("servicedescriptor/save")
@Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
@@ -278,6 +326,11 @@ public class DescriptorRegistryResource
}
}
+ /**
+ * This method will update the service descriptor
+ * @param service this is a JSON message generated according to Service
Descriptor class
+ * @return HTTP response
+ */
@POST
@Path("servicedescriptor/update")
@Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
@@ -301,6 +354,12 @@ public class DescriptorRegistryResource
}
}
+ /**
+ * This method will retrieve service descriptor for a given service
descriptor name. Clients
+ * will get a JSON message that is generated according to Service
Descriptor class
+ * @param serviceName service name
+ * @return HTTP response
+ */
@GET
@Path("servicedescriptor/description")
@Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
@@ -326,6 +385,11 @@ public class DescriptorRegistryResource
}
}
+ /**
+ * This method will delete a given service descriptor
+ * @param serviceName service descriptor name
+ * @return HTTP response
+ */
@DELETE
@Path("servicedescriptor/delete")
@Produces(MediaType.TEXT_PLAIN)
@@ -347,6 +411,10 @@ public class DescriptorRegistryResource
}
}
+ /**
+ * This method will retrieve all the service descriptors
+ * @return HTTP response
+ */
@GET
@Path("get/servicedescriptors")
@Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
@@ -379,16 +447,23 @@ public class DescriptorRegistryResource
}
+ /**
+ * This method will check whether the given application descriptor exists
+ * @param serviceName service descriptor name
+ * @param hostName host descriptor name
+ * @param appDescriptorName application descriptor name
+ * @return HTTP response
+ */
@GET
@Path("applicationdescriptor/exist")
@Produces(MediaType.TEXT_PLAIN)
public Response isApplicationDescriptorExists(@QueryParam("serviceName")
String serviceName,
@QueryParam("hostName")
String hostName,
-
@QueryParam("descriptorName") String descriptorName) {
+ @QueryParam("appDescName")
String appDescriptorName) {
airavataRegistry = (AiravataRegistry2)
context.getAttribute(RestServicesConstants.AIRAVATA_REGISTRY);
boolean state;
try {
- state =
airavataRegistry.isApplicationDescriptorExists(serviceName, hostName,
descriptorName);
+ state =
airavataRegistry.isApplicationDescriptorExists(serviceName, hostName,
appDescriptorName);
if (state) {
Response.ResponseBuilder builder =
Response.status(Response.Status.OK);
builder.entity("True");
@@ -405,7 +480,12 @@ public class DescriptorRegistryResource
}
}
-
+ /**
+ * This method will save given application descriptor
+ * @param applicationDescriptor this is a JSON message created according to
+ * ApplicationDescriptor class
+ * @return HTTP response
+ */
@POST
@Path("applicationdescriptor/build/save")
@Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
@@ -453,7 +533,11 @@ public class DescriptorRegistryResource
}
}
-
+ /**
+ * This method will update the application descriptor
+ * @param applicationDescriptor JSON message of ApplicationDescriptor class
+ * @return HTTP response
+ */
@POST
@Path("applicationdescriptor/update")
@Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
@@ -502,7 +586,14 @@ public class DescriptorRegistryResource
}
}
-
+ /**
+ * This method will retrieve an application descriptor according to given
service name, host name
+ * and application name
+ * @param serviceName service name
+ * @param hostName host name
+ * @param applicationName application name
+ * @return HTTP response
+ */
@GET
@Path("applicationdescriptor/description")
@Produces("text/xml")
@@ -534,6 +625,12 @@ public class DescriptorRegistryResource
}
}
+ /**
+ * This method will retrieve application descriptors for a given service
and host
+ * @param serviceName service name
+ * @param hostName host name
+ * @return HTTP response
+ */
@GET
@Path("applicationdescriptors/alldescriptors/host/service")
@Produces("text/xml")
@@ -564,6 +661,11 @@ public class DescriptorRegistryResource
}
}
+ /**
+ * This method will get all the application descriptors for a given service
+ * @param serviceName service name
+ * @return HTTP response
+ */
@GET
@Path("applicationdescriptor/alldescriptors/service")
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
@@ -607,6 +709,10 @@ public class DescriptorRegistryResource
}
}
+ /**
+ * This method will retrieve all the application descriptors available
+ * @return HTTP response
+ */
@GET
@Path("applicationdescriptor/alldescriptors")
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
@@ -652,6 +758,10 @@ public class DescriptorRegistryResource
}
}
+ /**
+ * This method will return all the application names available
+ * @return HTTP response
+ */
@GET
@Path("applicationdescriptor/names")
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
@@ -686,6 +796,14 @@ public class DescriptorRegistryResource
}
}
+ /**
+ * This method wil remove an application descriptor according to given
service name, host name
+ * and application name
+ * @param serviceName service name
+ * @param hostName host name
+ * @param appName application name
+ * @return HTTP response
+ */
@DELETE
@Path("applicationdescriptor/delete")
@Produces(MediaType.TEXT_PLAIN)
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=1406818&r1=1406817&r2=1406818&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 21:28:02 2012
@@ -42,6 +42,10 @@ import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
+/**
+ * This class is a REST interface all the methods related to experiments that
are exposed by
+ * Airavata Registry API
+ */
@Path("/registry/api/experimentregistry")
public class ExperimentRegistryResource {
private AiravataRegistry2 airavataRegistry;
@@ -53,6 +57,11 @@ public class ExperimentRegistryResource
*
---------------------------------Experiments----------------------------------*
*/
+ /**
+ * This method will delete an experiment with given experiment ID
+ * @param experimentId experiment ID
+ * @return HTTP response
+ */
@DELETE
@Path("delete/experiment")
@Produces(MediaType.TEXT_PLAIN)
@@ -70,10 +79,15 @@ public class ExperimentRegistryResource
}
}
+ /**
+ * This method will return all the experiments available
+ * @return HTTP response
+ *
+ */
@GET
@Path("get/experiments/all")
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
- public Response getExperiments() throws RegistryException {
+ public Response getExperiments(){
airavataRegistry = (AiravataRegistry2)
context.getAttribute(RestServicesConstants.AIRAVATA_REGISTRY);
try {
List<AiravataExperiment> airavataExperimentList =
airavataRegistry.getExperiments();
@@ -99,6 +113,11 @@ public class ExperimentRegistryResource
}
}
+ /**
+ * This method will return all the experiments for a given project
+ * @param projectName project name
+ * @return HTTP response
+ */
@GET
@Path("get/experiments/project")
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
@@ -128,6 +147,12 @@ public class ExperimentRegistryResource
}
}
+ /**
+ * This method will return all the experiments in a given period of time
+ * @param fromDate starting date
+ * @param toDate end date
+ * @return HTTP response
+ */
@GET
@Path("get/experiments/date")
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
@@ -166,6 +191,13 @@ public class ExperimentRegistryResource
}
}
+ /**
+ * This method will return all the experiments for a given project in a
given period of time
+ * @param projectName project name
+ * @param fromDate starting date
+ * @param toDate end date
+ * @return HTTP response
+ */
@GET
@Path("get/experiments/project/date")
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
@@ -205,6 +237,13 @@ public class ExperimentRegistryResource
}
}
+ /**
+ * This method will add a new experiment
+ * @param projectName project name
+ * @param experimentID experiment ID
+ * @param submittedDate submitted date
+ * @return HTTP response
+ */
@POST
@Path("add/experiment")
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
@@ -247,10 +286,15 @@ public class ExperimentRegistryResource
}
+ /**
+ * This method will check whether the given experiment ID exists
+ * @param experimentId experiment ID
+ * @return HTTP response
+ */
@GET
@Path("experiment/exist")
@Produces(MediaType.TEXT_PLAIN)
- public Response isExperimentExists(@QueryParam("experimentId") String
experimentId) throws RegistryException {
+ public Response isExperimentExists(@QueryParam("experimentId") String
experimentId) {
airavataRegistry = (AiravataRegistry2)
context.getAttribute(RestServicesConstants.AIRAVATA_REGISTRY);
try {
airavataRegistry.isExperimentExists(experimentId);
@@ -261,9 +305,20 @@ public class ExperimentRegistryResource
Response.ResponseBuilder builder =
Response.status(Response.Status.NOT_FOUND);
builder.entity("Exprtiment does not exist...");
return builder.build();
+ } catch (RegistryException e) {
+ Response.ResponseBuilder builder =
Response.status(Response.Status.NOT_FOUND);
+ builder.entity("Exprtiment does not exist...");
+ return builder.build();
}
}
+ /**
+ * This method will check whether an experiment exist and create if not
exists according to the
+ * createIfNotPresent flag
+ * @param experimentId experiment ID
+ * @param createIfNotPresent flag to check whether to create a new
experiment or not
+ * @return HTTP response
+ */
@GET
@Path("experiment/notexist/create")
@Produces(MediaType.TEXT_PLAIN)
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=1406818&r1=1406817&r2=1406818&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 21:28:02 2012
@@ -36,6 +36,10 @@ import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import java.util.List;
+/**
+ * This class is a REST interface for all the operations related to Project
that are exposed in
+ * Airavata Registry API
+ */
@Path("/registry/api/projectregistry")
public class ProjectRegistryResource {
private AiravataRegistry2 airavataRegistry;
@@ -46,6 +50,12 @@ public class ProjectRegistryResource {
/**
* ---------------------------------Project
Registry----------------------------------*
*/
+
+ /**
+ * This method will check whether a given project name exists
+ * @param projectName project name
+ * @return HTTP response
+ */
@GET
@Path("project/exist")
@Produces(MediaType.TEXT_PLAIN)
@@ -69,6 +79,13 @@ public class ProjectRegistryResource {
}
}
+ /**
+ * This method will check whether a project exists and create according to
the createIfNotExists
+ * flag
+ * @param projectName project name
+ * @param createIfNotExists flag to check whether a new project should be
created or not
+ * @return HTTP response
+ */
@POST
@Path("project/exist")
@Produces(MediaType.TEXT_PLAIN)
@@ -97,6 +114,11 @@ public class ProjectRegistryResource {
}
}
+ /**
+ * This method will add new workspace project
+ * @param projectName project name
+ * @return HTTP response
+ */
@POST
@Path("add/project")
@Produces(MediaType.TEXT_PLAIN)
@@ -119,6 +141,11 @@ public class ProjectRegistryResource {
}
}
+ /**
+ * This method will update the workspace project
+ * @param projectName project name
+ * @return HTTP response
+ */
@POST
@Path("update/project")
@Produces(MediaType.TEXT_PLAIN)
@@ -141,6 +168,11 @@ public class ProjectRegistryResource {
}
}
+ /**
+ * This method will delete workspace project
+ * @param projectName project name
+ * @return HTTP response
+ */
@DELETE
@Path("delete/project")
@Produces(MediaType.TEXT_PLAIN)
@@ -162,6 +194,11 @@ public class ProjectRegistryResource {
}
}
+ /**
+ * This method will retrieve the workspace project
+ * @param projectName project name
+ * @return HTTP response
+ */
@GET
@Path("get/project")
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
@@ -189,6 +226,10 @@ public class ProjectRegistryResource {
}
}
+ /**
+ * This method will retrieve all the workspace projects
+ * @return HTTP response
+ */
@GET
@Path("get/projects")
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
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=1406818&r1=1406817&r2=1406818&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 21:28:02 2012
@@ -42,6 +42,10 @@ import java.util.ArrayList;
import java.util.Date;
import java.util.List;
+/**
+ * This class is the REST interface for all the provenance data related
methods that are exposed
+ * by Airavata Registry API
+ */
@Path("/registry/api/provenanceregistry")
public class ProvenanceRegistryResource {
private AiravataRegistry2 airavataRegistry;
@@ -53,6 +57,12 @@ public class ProvenanceRegistryResource
* --------------------------------- Provenance Registry
----------------------------------*
*/
+ /**
+ * This method will update the experiment execution user
+ * @param experimentId experiment ID
+ * @param user experiment execution user
+ * @return HTTP response
+ */
@POST
@Path("update/experiment")
@Produces(MediaType.TEXT_PLAIN)
@@ -71,6 +81,11 @@ public class ProvenanceRegistryResource
}
}
+ /**
+ * This method will retrieve experiment execution user
+ * @param experimentId experiment ID
+ * @return HTTP response
+ */
@GET
@Path("get/experiment/executionuser")
@Produces(MediaType.TEXT_PLAIN)
@@ -94,6 +109,11 @@ public class ProvenanceRegistryResource
}
}
+ /**
+ * This method will retrieve the experiment name for a given experiment ID
+ * @param experimentId experiment ID
+ * @return HTTP response
+ */
@GET
@Path("get/experiment/name")
@Produces(MediaType.TEXT_PLAIN)
@@ -117,6 +137,12 @@ public class ProvenanceRegistryResource
}
}
+ /**
+ * This method will update the experiment name
+ * @param experimentId experiment ID
+ * @param experimentName experiment name
+ * @return HTTP response
+ */
@POST
@Path("update/experimentname")
@Produces(MediaType.TEXT_PLAIN)
@@ -135,7 +161,11 @@ public class ProvenanceRegistryResource
}
}
-
+ /**
+ * This method will retrieve the experiment metadata
+ * @param experimentId experiment ID
+ * @return HTTP response
+ */
@GET
@Path("get/experimentmetadata")
@Produces(MediaType.TEXT_PLAIN)
@@ -159,6 +189,12 @@ public class ProvenanceRegistryResource
}
}
+ /**
+ * This method will update the experiment metadata
+ * @param experimentId experiment ID
+ * @param metadata experiment metadata
+ * @return HTTP response
+ */
@POST
@Path("update/experimentmetadata")
@Produces(MediaType.TEXT_PLAIN)
@@ -178,7 +214,11 @@ public class ProvenanceRegistryResource
}
-
+ /**
+ * This method will retrieve workflow execution name
+ * @param workflowInstanceId workflow instance ID
+ * @return HTTP response
+ */
@GET
@Path("get/workflowtemplatename")
@Produces(MediaType.TEXT_PLAIN)
@@ -202,6 +242,12 @@ public class ProvenanceRegistryResource
}
}
+ /**
+ * This method will set the workflow instance template name
+ * @param workflowInstanceId workflow instance id
+ * @param templateName template name
+ * @return HTTP response
+ */
@POST
@Path("update/workflowinstancetemplatename")
@Produces(MediaType.TEXT_PLAIN)
@@ -220,6 +266,11 @@ public class ProvenanceRegistryResource
}
}
+ /**
+ * This method will get experiment workflow instances for a given
experiment ID
+ * @param experimentId experiment ID
+ * @return HTTP response
+ */
@GET
@Path("get/experimentworkflowinstances")
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
@@ -249,6 +300,11 @@ public class ProvenanceRegistryResource
}
}
+ /**
+ * This method will check whether a workflow instance exists
+ * @param instanceId workflow instance ID
+ * @return HTTP response
+ */
@GET
@Path("workflowinstance/exist/check")
@Produces(MediaType.TEXT_PLAIN)
@@ -273,6 +329,13 @@ public class ProvenanceRegistryResource
}
+ /**
+ * This method will check whether a workflow instance exist and create the
workflow instance
+ * according to createIfNotPresent flag
+ * @param instanceId workflow instance ID
+ * @param createIfNotPresent flag whether to create a new workflow
instance or not
+ * @return HTTP response
+ */
@GET
@Path("workflowinstance/exist/create")
@Produces(MediaType.TEXT_PLAIN)
@@ -297,6 +360,12 @@ public class ProvenanceRegistryResource
}
}
+ /**
+ * This method will update workflow instance status
+ * @param instanceId workflow instance ID
+ * @param executionStatus workflow execution status
+ * @return HTTP response
+ */
@POST
@Path("update/workflowinstancestatus/instanceid")
@Produces(MediaType.TEXT_PLAIN)
@@ -316,6 +385,13 @@ public class ProvenanceRegistryResource
}
}
+ /**
+ * This method will update the workflow instance status
+ * @param workflowInstanceId workflow instance ID
+ * @param executionStatus workflow execution status
+ * @param statusUpdateTime workflow status update time
+ * @return HTTP response
+ */
@POST
@Path("update/workflowinstancestatus")
@Produces(MediaType.TEXT_PLAIN)
@@ -344,6 +420,11 @@ public class ProvenanceRegistryResource
}
}
+ /**
+ * This method will retrieve workflow instance statuse for a given
workflow instance ID
+ * @param instanceId workflow instance ID
+ * @return HTTP response
+ */
@GET
@Path("get/workflowinstancestatus")
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
@@ -367,6 +448,13 @@ public class ProvenanceRegistryResource
}
}
+ /**
+ * This method will update workflowNodeInput
+ * @param nodeID workflow node ID
+ * @param workflowInstanceID workflow instance ID
+ * @param data input data
+ * @return HTTP response
+ */
@POST
@Path("update/workflownodeinput")
@Produces(MediaType.TEXT_PLAIN)
@@ -389,6 +477,13 @@ public class ProvenanceRegistryResource
}
+ /**
+ * This method will update workflow node output
+ * @param nodeID workflow node ID
+ * @param workflowInstanceID workflow instance ID
+ * @param data workflow node output data
+ * @return HTTP response
+ */
@POST
@Path("update/workflownodeoutput")
@Produces(MediaType.TEXT_PLAIN)
@@ -559,6 +654,12 @@ public class ProvenanceRegistryResource
}
*/
+ /**
+ * This method will return all the data related to a given experiment.
This will include workflow
+ * status, input values, output values to the workflow, node statuses etc.
+ * @param experimentId experiment ID
+ * @return HTTP response
+ */
@GET
@Path("get/experiment")
@Produces(MediaType.APPLICATION_XML)
@@ -582,6 +683,11 @@ public class ProvenanceRegistryResource
}
}
+ /**
+ * This method will return all the experiment IDs for a given user
+ * @param username experiment execution user
+ * @return HTTP response
+ */
@GET
@Path("get/experimentId/user")
@Produces(MediaType.APPLICATION_XML)
@@ -607,10 +713,16 @@ public class ProvenanceRegistryResource
}
}
+ /**
+ * This method will return all the experiments for a given user
+ * @param username experiment execution user
+ * @return HTTP response
+ *
+ */
@GET
@Path("get/experiment/user")
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
- public Response getExperimentByUser(@QueryParam("username") String
username) throws RegistryException {
+ public Response getExperimentByUser(@QueryParam("username") String
username){
airavataRegistry = (AiravataRegistry2)
context.getAttribute(RestServicesConstants.AIRAVATA_REGISTRY);
try{
List<ExperimentData> experimentDataList =
airavataRegistry.getExperimentByUser(username);
@@ -636,6 +748,13 @@ public class ProvenanceRegistryResource
}
}
+ /**
+ * This method will update the workflow node status
+ * @param workflowInstanceId workflow instance ID
+ * @param nodeId node ID
+ * @param executionStatus node execution status
+ * @return HTTP response
+ */
@POST
@Path("update/workflownode/status")
@Produces(MediaType.TEXT_PLAIN)
@@ -656,7 +775,12 @@ public class ProvenanceRegistryResource
}
}
-
+ /**
+ * This method will retrieve workflow status for a given workflow instance
and node
+ * @param workflowInstanceId workflow instance ID
+ * @param nodeId node ID
+ * @return HTTP response
+ */
@GET
@Path("get/workflownode/status")
@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
@@ -683,6 +807,12 @@ public class ProvenanceRegistryResource
}
}
+ /**
+ * This method will retrieve workflow node started time
+ * @param workflowInstanceId workflow instance ID
+ * @param nodeId node ID
+ * @return HTTP response
+ */
@GET
@Path("get/workflownode/starttime")
@Produces(MediaType.TEXT_PLAIN)
@@ -709,6 +839,11 @@ public class ProvenanceRegistryResource
}
}
+ /**
+ * This method will return workflow started time
+ * @param workflowInstanceId workflow instance ID
+ * @return HTTP response
+ */
@GET
@Path("get/workflow/starttime")
@Produces(MediaType.TEXT_PLAIN)
@@ -734,6 +869,11 @@ public class ProvenanceRegistryResource
}
}
+ /**
+ * This method will update workflow node Gram data
+ * @param workflowNodeGramData workflow node gram data object as a JSON
input
+ * @return HTTP response
+ */
@GET
@Path("update/workflownode/gramdata")
@Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
@@ -753,6 +893,11 @@ public class ProvenanceRegistryResource
}
+ /**
+ * This method will return all the information regarding a workflow
instance
+ * @param workflowInstanceId workflow instance ID
+ * @return HTTP response
+ */
@GET
@Path("get/workflowinstancedata")
@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
@@ -776,6 +921,12 @@ public class ProvenanceRegistryResource
}
}
+ /**
+ * This method wil check whether a workflow node present
+ * @param workflowInstanceId workflow instance ID
+ * @param nodeId node ID
+ * @return HTTP response
+ */
@GET
@Path("workflowinstance/exist")
@Produces(MediaType.TEXT_PLAIN)
@@ -801,6 +952,12 @@ public class ProvenanceRegistryResource
}
+ /**
+ * This method will return data related to the workflow instance node
+ * @param workflowInstanceId workflow instance ID
+ * @param nodeId node ID
+ * @return HTTP response
+ */
@GET
@Path("workflowinstance/nodeData")
@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
@@ -826,6 +983,13 @@ public class ProvenanceRegistryResource
}
+ /**
+ * This method will add a workflow instance
+ * @param experimentId experiment ID
+ * @param workflowInstanceId workflow instance ID
+ * @param templateName workflow template name
+ * @return HTTP response
+ */
@POST
@Path("add/workflowinstance")
@Produces(MediaType.TEXT_PLAIN)
@@ -845,12 +1009,19 @@ public class ProvenanceRegistryResource
}
}
+ /**
+ * This method will update the workflow node type
+ * @param workflowInstanceId workflow instance ID
+ * @param nodeId node ID
+ * @param nodeType node type
+ * @return HTTP response
+ */
@POST
@Path("update/workflownodetype")
@Produces(MediaType.TEXT_PLAIN)
public Response updateWorkflowNodeType(@FormParam("workflowInstanceId")
String workflowInstanceId,
@FormParam("nodeId") String nodeId,
- @FormParam("nodeType") String
nodeType) throws RegistryException {
+ @FormParam("nodeType") String
nodeType) {
airavataRegistry = (AiravataRegistry2)
context.getAttribute(RestServicesConstants.AIRAVATA_REGISTRY);
try{
WorkflowInstanceNodeData workflowInstanceNodeData =
airavataRegistry.getWorkflowInstanceData(workflowInstanceId).getNodeData(nodeId);
@@ -872,6 +1043,12 @@ public class ProvenanceRegistryResource
}
+ /**
+ * This method will add a new node to workflow instance
+ * @param workflowInstanceId workflow instance ID
+ * @param nodeId node ID
+ * @return HTTP response
+ */
@POST
@Path("add/workflowinstancenode")
@Produces(MediaType.TEXT_PLAIN)
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=1406818&r1=1406817&r2=1406818&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 21:28:02 2012
@@ -40,6 +40,10 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Map;
+/**
+ * This class is the REST interface for all the operations related to
published workflows that has
+ * been exposed by Airavata Registry API
+ */
@Path("/registry/api/publishwfregistry")
public class PublishWorkflowRegistryResource {
private AiravataRegistry2 airavataRegistry;
@@ -49,6 +53,11 @@ public class PublishWorkflowRegistryReso
/**---------------------------------Published Workflow
Registry----------------------------------**/
+ /**
+ * This method will check whether a given published workflow name already
exists
+ * @param workflowname publish workflow name
+ * @return HTTP response
+ */
@GET
@Path("publishwf/exist")
@Produces(MediaType.TEXT_PLAIN)
@@ -72,6 +81,12 @@ public class PublishWorkflowRegistryReso
}
}
+ /**
+ * This method will make a user workflow as a published workflow with the
given name
+ * @param workflowName user workflow name
+ * @param publishWorkflowName name need to save the published workflow as
+ * @return HTTP response
+ */
@POST
@Path("publish/workflow")
@Produces(MediaType.TEXT_PLAIN)
@@ -98,6 +113,11 @@ public class PublishWorkflowRegistryReso
}
}
+ /**
+ * This method will publish a workflow with the default workflow name
+ * @param workflowName workflow name
+ * @return HTTP response
+ */
@POST
@Path("publish/default/workflow")
@Produces(MediaType.TEXT_PLAIN)
@@ -123,6 +143,11 @@ public class PublishWorkflowRegistryReso
}
}
+ /**
+ * This method will return the worklflow graph
+ * @param workflowName workflow name
+ * @return HTTP response
+ */
@GET
@Path("get/publishworkflowgraph")
@Produces(MediaType.TEXT_PLAIN)
@@ -150,6 +175,10 @@ public class PublishWorkflowRegistryReso
}
}
+ /**
+ * This method will return all the published workflow names
+ * @return HTTP response
+ */
@GET
@Path("get/publishworkflownames")
@Produces(MediaType.TEXT_PLAIN)
@@ -175,6 +204,10 @@ public class PublishWorkflowRegistryReso
}
}
+ /**
+ * This method will return all the published workflows
+ * @return HTTP response
+ */
@GET
@Path("get/publishworkflows")
@Produces(MediaType.TEXT_PLAIN)
@@ -208,6 +241,11 @@ public class PublishWorkflowRegistryReso
}
}
+ /**
+ * This method will delete a published workflow with the given published
workflow name
+ * @param workflowName published workflow name
+ * @return HTTP response
+ */
@GET
@Path("remove/publishworkflow")
@Produces(MediaType.TEXT_PLAIN)
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=1406818&r1=1406817&r2=1406818&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 21:28:02 2012
@@ -38,6 +38,10 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Map;
+/**
+ * This class is a REST interface to all the operations related to user
workflows that has been
+ * exposed by Airavata Registry API
+ */
@Path("/registry/api/userwfregistry")
public class UserWorkflowRegistryResource {
private AiravataRegistry2 airavataRegistry;
@@ -47,6 +51,11 @@ public class UserWorkflowRegistryResourc
/**---------------------------------User Workflow
Registry----------------------------------**/
+ /**
+ * This method will check whether a given user workflow name already exists
+ * @param workflowName workflow name
+ * @return HTTP response
+ */
@GET
@Path("workflow/exist")
@Produces(MediaType.TEXT_PLAIN)
@@ -70,7 +79,12 @@ public class UserWorkflowRegistryResourc
}
}
-
+ /**
+ * This method will add a new workflow
+ * @param workflowName workflow name
+ * @param workflowGraphXml workflow content
+ * @return HTTP response
+ */
@POST
@Path("add/workflow")
@Produces(MediaType.TEXT_PLAIN)
@@ -93,6 +107,12 @@ public class UserWorkflowRegistryResourc
}
}
+ /**
+ * This method will update the workflow
+ * @param workflowName workflow name
+ * @param workflowGraphXml workflow content
+ * @return HTTP response
+ */
@POST
@Path("update/workflow")
@Produces(MediaType.TEXT_PLAIN)
@@ -115,6 +135,11 @@ public class UserWorkflowRegistryResourc
}
}
+ /**
+ * This method will return the content of the given workflow
+ * @param workflowName workflow name
+ * @return HTTP response
+ */
@GET
@Path("get/workflowgraph")
@Produces(MediaType.TEXT_PLAIN)
@@ -142,6 +167,10 @@ public class UserWorkflowRegistryResourc
}
}
+ /**
+ * This method will return all the user workflows
+ * @return HTTP response
+ */
@GET
@Path("get/workflows")
@Produces(MediaType.TEXT_PLAIN)
@@ -175,7 +204,11 @@ public class UserWorkflowRegistryResourc
}
}
-
+ /**
+ * This method will delete a user workflow with the given user workflow
name
+ * @param workflowName user workflow name
+ * @return HTTP response
+ */
@GET
@Path("remove/workflow")
@Produces(MediaType.TEXT_PLAIN)