airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chath...@apache.org
Subject svn commit: r1484950 - in /airavata/trunk/modules: registry/registry-api/ registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/ rest/client/src/main/java/org/apache/airavata/rest/client/ rest/service/src/main/java/org/apache/ai...
Date Tue, 21 May 2013 20:52:24 GMT
Author: chathuri
Date: Tue May 21 20:52:24 2013
New Revision: 1484950

URL: http://svn.apache.org/r1484950
Log:
fixing getExecutionErrors method

Modified:
    airavata/trunk/modules/registry/registry-api/pom.xml
    airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/ExecutionError.java
    airavata/trunk/modules/rest/client/src/main/java/org/apache/airavata/rest/client/ProvenanceResourceClient.java
    airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/ProvenanceRegistryResource.java

Modified: airavata/trunk/modules/registry/registry-api/pom.xml
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/registry-api/pom.xml?rev=1484950&r1=1484949&r2=1484950&view=diff
==============================================================================
--- airavata/trunk/modules/registry/registry-api/pom.xml (original)
+++ airavata/trunk/modules/registry/registry-api/pom.xml Tue May 21 20:52:24 2013
@@ -64,6 +64,11 @@
 			<artifactId>slf4j-log4j12</artifactId>
 			<scope>test</scope>
 		</dependency>
+        <dependency>
+            <groupId>org.codehaus.jackson</groupId>
+            <artifactId>jackson-mapper-asl</artifactId>
+            <version>1.9.2</version>
+        </dependency>
 
     </dependencies>
 

Modified: airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/ExecutionError.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/ExecutionError.java?rev=1484950&r1=1484949&r2=1484950&view=diff
==============================================================================
--- airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/ExecutionError.java
(original)
+++ airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/ExecutionError.java
Tue May 21 20:52:24 2013
@@ -24,13 +24,16 @@ package org.apache.airavata.registry.api
 import java.util.Date;
 
 import org.apache.airavata.registry.api.ExecutionErrors;
+import org.codehaus.jackson.annotate.JsonTypeInfo;
 
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlSeeAlso;
 
 @XmlRootElement
 @XmlAccessorType(XmlAccessType.FIELD)
+@JsonTypeInfo(use=JsonTypeInfo.Id.CLASS, include=JsonTypeInfo.As.PROPERTY, property="@class")
 public abstract class ExecutionError {
 	public ExecutionErrors.Source source;
 	public Date errorTime;

Modified: airavata/trunk/modules/rest/client/src/main/java/org/apache/airavata/rest/client/ProvenanceResourceClient.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/rest/client/src/main/java/org/apache/airavata/rest/client/ProvenanceResourceClient.java?rev=1484950&r1=1484949&r2=1484950&view=diff
==============================================================================
--- airavata/trunk/modules/rest/client/src/main/java/org/apache/airavata/rest/client/ProvenanceResourceClient.java
(original)
+++ airavata/trunk/modules/rest/client/src/main/java/org/apache/airavata/rest/client/ProvenanceResourceClient.java
Tue May 21 20:52:24 2013
@@ -2056,12 +2056,18 @@ public class ProvenanceResourceClient {
                                                    ExecutionErrors.Source... filterBy){
         webResource = getProvenanceRegistryBaseResource().path(
                 ResourcePathConstants.ProvenanceResourcePathConstants.GET_EXECUTION_ERRORS);
+        String sourceErrors = "";
+        for (ExecutionErrors.Source source : filterBy){
+            sourceErrors += source.toString() + ",";
+        }
+        sourceErrors = sourceErrors.substring(0, sourceErrors.length() - 1);
+        System.out.println(sourceErrors);
         MultivaluedMap queryParams = new MultivaluedMapImpl();
         queryParams.add("experimentId", experimentId);
         queryParams.add("workflowInstanceId", workflowInstanceId);
         queryParams.add("nodeId", nodeId);
         queryParams.add("gfacJobId", gfacJobId);
-        queryParams.add("sourceFilter", filterBy);
+        queryParams.add("sourceFilter", sourceErrors);
         builder = BasicAuthHeaderUtil.getBuilder(
                 webResource, queryParams, userName, null, cookie, gateway);
 
@@ -2099,7 +2105,6 @@ public class ProvenanceResourceClient {
             throw new RuntimeException("Failed : HTTP error code : "
                     + status);
         }
-
         ExecutionErrorsList executionErrorsList = response.getEntity(ExecutionErrorsList.class);
         return executionErrorsList.getExecutionErrors();
     }

Modified: airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/ProvenanceRegistryResource.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/ProvenanceRegistryResource.java?rev=1484950&r1=1484949&r2=1484950&view=diff
==============================================================================
--- airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/ProvenanceRegistryResource.java
(original)
+++ airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/ProvenanceRegistryResource.java
Tue May 21 20:52:24 2013
@@ -1490,11 +1490,17 @@ public class ProvenanceRegistryResource 
                                        @QueryParam("workflowInstanceId") String workflowInstanceId,
                                        @QueryParam("nodeId") String nodeId,
                                        @QueryParam("gfacJobId") String gfacJobId,
-                                       @QueryParam("sourceFilter") ExecutionErrors.Source
sourceFilter) {
+                                       @QueryParam("sourceFilter") String sourceFilter) {
         AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
         try {
             ExecutionErrorsList executionErrorsList = new ExecutionErrorsList();
-            List<ExecutionError> executionErrors = airavataRegistry.getExecutionErrors(experimentId,
workflowInstanceId, nodeId, gfacJobId, sourceFilter);
+            String[] sourceList = sourceFilter.split(",");
+            List<ExecutionErrors.Source> sourceFilters = new ArrayList<ExecutionErrors.Source>();
+            for (String source : sourceList){
+                ExecutionErrors.Source errorSource = ExecutionErrors.Source.valueOf(source);
+                sourceFilters.add(errorSource);
+            }
+            List<ExecutionError> executionErrors = airavataRegistry.getExecutionErrors(experimentId,
workflowInstanceId, nodeId, gfacJobId, sourceFilters.toArray(new ExecutionErrors.Source[]{}));
             if (executionErrors.size() != 0) {
                 Response.ResponseBuilder builder = Response.status(Response.Status.OK);
                 executionErrorsList.setExecutionErrors(executionErrors);



Mime
View raw message