airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chath...@apache.org
Subject git commit: AIRAVATA-1049
Date Wed, 05 Mar 2014 16:09:57 GMT
Repository: airavata
Updated Branches:
  refs/heads/master d4ed9c583 -> 79cb0ef51


AIRAVATA-1049


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/79cb0ef5
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/79cb0ef5
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/79cb0ef5

Branch: refs/heads/master
Commit: 79cb0ef511aa09b5e7a30f5f8d3018dfe6782e53
Parents: d4ed9c5
Author: chathuri <chathuri@apache.org>
Authored: Wed Mar 5 11:09:50 2014 -0500
Committer: chathuri <chathuri@apache.org>
Committed: Wed Mar 5 11:09:50 2014 -0500

----------------------------------------------------------------------
 .../registry/jpa/impl/ExperimentRegistry.java   | 24 ++++++++++++++++++++
 .../registry/jpa/impl/RegistryFactory.java      | 12 ++++++++--
 2 files changed, 34 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/79cb0ef5/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
index 49a5403..d2fcd9c 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
@@ -924,6 +924,30 @@ public class ExperimentRegistry {
             jobDetail.setCreationTime(getTime(jobDetails.getCreationTime()));
             jobDetail.setComputeResourceConsumed(jobDetails.getComputeResourceConsumed());
             jobDetail.save();
+            JobStatus jobStatus = jobDetails.getJobStatus();
+            if (jobStatus != null){
+                JobStatus status = getJobStatus(ids);
+                if (status != null){
+                    updateJobStatus(jobStatus, (String)ids.getSecondLevelIdentifier());
+                }else {
+                    addJobStatus(jobStatus, ids);
+                }
+            }
+            ApplicationStatus applicationStatus = jobDetails.getApplicationStatus();
+            if (applicationStatus != null){
+                ApplicationStatus appStatus = getApplicationStatus(ids);
+                if (appStatus != null){
+                    updateApplicationStatus(applicationStatus, (String)ids.getSecondLevelIdentifier());
+                }else {
+                    addApplicationStatus(applicationStatus, ids);
+                }
+            }
+            List<ErrorDetails> errors = jobDetails.getErrors();
+            if (errors != null && !errors.isEmpty()){
+                for (ErrorDetails error : errors ){
+                    addErrorDetails(error, ids.getSecondLevelIdentifier());
+                }
+            }
             return jobDetail.getJobId();
         } catch (Exception e) {
             logger.error("Error while adding job details...", e.getMessage());

http://git-wip-us.apache.org/repos/asf/airavata/blob/79cb0ef5/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/RegistryFactory.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/RegistryFactory.java
b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/RegistryFactory.java
index f23a4ee..476347f 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/RegistryFactory.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/RegistryFactory.java
@@ -24,11 +24,19 @@ package org.apache.airavata.persistance.registry.jpa.impl;
 import org.apache.airavata.registry.cpi.Registry;
 
 public class RegistryFactory {
+    private static Registry registry;
+
     public static Registry getRegistry(String gateway, String username, String password){
-        return new RegistryImpl(gateway, username, password);
+        if (registry == null){
+            registry = new RegistryImpl(gateway, username, password);
+        }
+        return registry;
     }
 
     public static Registry getDefaultRegistry () {
-        return new RegistryImpl();
+        if (registry == null){
+            registry = new RegistryImpl();
+        }
+        return registry;
     }
 }


Mime
View raw message