airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scnakand...@apache.org
Subject [1/2] airavata git commit: Updating fields in process model in registry
Date Thu, 25 Jun 2015 21:44:34 GMT
Repository: airavata
Updated Branches:
  refs/heads/master ed5a17203 -> 6caf47871


Updating fields in process model in registry


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

Branch: refs/heads/master
Commit: dce0271e57815950d8e643e2eaa8d1e378f8eec2
Parents: ed5a172
Author: Supun Nakandala <scnakandala@apache.org>
Authored: Fri Jun 26 02:09:16 2015 +0530
Committer: Supun Nakandala <scnakandala@apache.org>
Committed: Fri Jun 26 02:09:16 2015 +0530

----------------------------------------------------------------------
 .../catalog/impl/ExperimentRegistry.java        | 24 +++++++++
 .../core/experiment/catalog/model/Process.java  | 56 ++++++++++++++++++++
 .../catalog/resources/ProcessResource.java      | 50 +++++++++++++++++
 .../experiment/catalog/resources/Utils.java     |  5 ++
 .../utils/ThriftDataModelConversion.java        |  8 +++
 .../src/main/resources/expcatalog-derby.sql     |  5 ++
 .../src/main/resources/expcatalog-mysql.sql     |  5 ++
 .../src/test/resources/expcatalog-derby.sql     |  5 ++
 8 files changed, 158 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/dce0271e/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/impl/ExperimentRegistry.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/impl/ExperimentRegistry.java
b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/impl/ExperimentRegistry.java
index 7c3fe0a..69e3409 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/impl/ExperimentRegistry.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/impl/ExperimentRegistry.java
@@ -253,6 +253,18 @@ public class ExperimentRegistry {
             processResource.setProcessDetail(process.getProcessDetail());
             processResource.setApplicationInterfaceId(process.getApplicationInterfaceId());
             processResource.setTaskDag(process.getTaskDag());
+            processResource.setGatewayExecutionId(process.getGatewayExecutionId());
+            processResource.setComputeResourceId(process.getComputeResourceId());
+            processResource.setApplicationInterfaceId(process.getApplicationInterfaceId());
+            if(process.isEnableEmailNotification()){
+                processResource.setEnableEmailNotification(true);
+                if(process.getEmailAddresses() != null){
+                    processResource.setEmailAddresses(StringUtils.join(process.getEmailAddresses(),
","));
+                }
+            }else{
+                processResource.setEnableEmailNotification(false);
+            }
+
             processResource.save();
 
             if(process.getResourceSchedule() != null) {
@@ -663,6 +675,18 @@ public class ExperimentRegistry {
             processResource.setProcessDetail(process.getProcessDetail());
             processResource.setApplicationInterfaceId(process.getApplicationInterfaceId());
             processResource.setTaskDag(process.getTaskDag());
+            processResource.setGatewayExecutionId(process.getGatewayExecutionId());
+            processResource.setComputeResourceId(process.getComputeResourceId());
+            processResource.setApplicationInterfaceId(process.getApplicationInterfaceId());
+            if(process.isEnableEmailNotification()){
+                processResource.setEnableEmailNotification(true);
+                if(process.getEmailAddresses() != null){
+                    processResource.setEmailAddresses(StringUtils.join(process.getEmailAddresses(),
","));
+                }
+            }else{
+                processResource.setEnableEmailNotification(false);
+            }
+
             processResource.save();
 
             if(process.getResourceSchedule() != null) {

http://git-wip-us.apache.org/repos/asf/airavata/blob/dce0271e/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Process.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Process.java
b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Process.java
index 71c561f..4226a85 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Process.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Process.java
@@ -38,6 +38,11 @@ public class Process {
     private String processDetail;
     private String applicationInterfaceId;
     private String taskDag;
+    private String applicationDeploymentId;
+    private String computeResourceId;
+    private String gatewayExecutionId;
+    private Boolean enableEmailNotification;
+    private String emailAddresses;
     private Experiment experiment;
     private Collection<ProcessError> processErrors;
     private Collection<ProcessInput> processInputs;
@@ -116,6 +121,57 @@ public class Process {
         this.taskDag = taskDag;
     }
 
+    @Basic
+    @Column(name = "APPLICATION_DEPLOYMENT_ID")
+    public String getApplicationDeploymentId() {
+        return applicationDeploymentId;
+    }
+
+    public void setApplicationDeploymentId(String applicationDeploymentId) {
+        this.applicationDeploymentId = applicationDeploymentId;
+    }
+
+    @Basic
+    @Column(name = "COMPUTE_RESOURCE_ID")
+    public String getComputeResourceId() {
+        return computeResourceId;
+    }
+
+    public void setComputeResourceId(String computeResourceId) {
+        this.computeResourceId = computeResourceId;
+    }
+
+    @Basic
+    @Column(name = "GATEWAY_EXECUTION_ID")
+    public String getGatewayExecutionId() {
+        return gatewayExecutionId;
+    }
+
+    public void setGatewayExecutionId(String gatewayExecutionId) {
+        this.gatewayExecutionId = gatewayExecutionId;
+    }
+
+
+    @Basic
+    @Column(name = "ENABLE_EMAIL_NOTIFICATION")
+    public Boolean getEnableEmailNotification() {
+        return enableEmailNotification;
+    }
+
+    public void setEnableEmailNotification(Boolean enableEmailNotification) {
+        this.enableEmailNotification = enableEmailNotification;
+    }
+
+    @Basic
+    @Column(name = "EMAIL_ADDRESSES")
+    public String getEmailAddresses() {
+        return emailAddresses;
+    }
+
+    public void setEmailAddresses(String emailAddresses) {
+        this.emailAddresses = emailAddresses;
+    }
+
 //    @Override
 //    public boolean equals(Object o) {
 //        if (this == o) return true;

http://git-wip-us.apache.org/repos/asf/airavata/blob/dce0271e/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessResource.java
b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessResource.java
index 2572129..9a26a45 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessResource.java
@@ -46,6 +46,11 @@ public class ProcessResource extends AbstractExpCatResource {
     private String processDetail;
     private String applicationInterfaceId;
     private String taskDag;
+    private String applicationDeploymentId;
+    private String computeResourceId;
+    private String gatewayExecutionId;
+    private Boolean enableEmailNotification;
+    private String emailAddresses;
 
     public String getProcessId() {
         return processId;
@@ -103,6 +108,46 @@ public class ProcessResource extends AbstractExpCatResource {
         this.taskDag = taskDag;
     }
 
+    public String getApplicationDeploymentId() {
+        return applicationDeploymentId;
+    }
+
+    public void setApplicationDeploymentId(String applicationDeploymentId) {
+        this.applicationDeploymentId = applicationDeploymentId;
+    }
+
+    public String getComputeResourceId() {
+        return computeResourceId;
+    }
+
+    public void setComputeResourceId(String computeResourceId) {
+        this.computeResourceId = computeResourceId;
+    }
+
+    public String getGatewayExecutionId() {
+        return gatewayExecutionId;
+    }
+
+    public void setGatewayExecutionId(String gatewayExecutionId) {
+        this.gatewayExecutionId = gatewayExecutionId;
+    }
+
+    public Boolean getEnableEmailNotification() {
+        return enableEmailNotification;
+    }
+
+    public void setEnableEmailNotification(Boolean enableEmailNotification) {
+        this.enableEmailNotification = enableEmailNotification;
+    }
+
+    public String getEmailAddresses() {
+        return emailAddresses;
+    }
+
+    public void setEmailAddresses(String emailAddresses) {
+        this.emailAddresses = emailAddresses;
+    }
+
     public ExperimentCatResource create(ResourceType type) throws RegistryException{
        switch (type){
            case PROCESS_ERROR:
@@ -405,6 +450,11 @@ public class ProcessResource extends AbstractExpCatResource {
             process.setProcessDetail(processDetail);
             process.setApplicationInterfaceId(applicationInterfaceId);
             process.setTaskDag(taskDag);
+            process.setComputeResourceId(computeResourceId);
+            process.setApplicationInterfaceId(applicationInterfaceId);
+            process.setGatewayExecutionId(gatewayExecutionId);
+            process.setEnableEmailNotification(enableEmailNotification);
+            process.setEmailAddresses(emailAddresses);
             em.persist(process);
             em.getTransaction().commit();
         } catch (Exception e) {

http://git-wip-us.apache.org/repos/asf/airavata/blob/dce0271e/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/Utils.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/Utils.java
b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/Utils.java
index 90fb348..d54b167 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/Utils.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/Utils.java
@@ -521,6 +521,11 @@ public class Utils {
             processResource.setProcessDetail(o.getProcessDetail());
             processResource.setApplicationInterfaceId(o.getApplicationInterfaceId());
             processResource.setTaskDag(o.getTaskDag());
+            processResource.setGatewayExecutionId(o.getGatewayExecutionId());
+            processResource.setComputeResourceId(o.getComputeResourceId());
+            processResource.setApplicationInterfaceId(o.getApplicationInterfaceId());
+            processResource.setEnableEmailNotification(o.getEnableEmailNotification());
+            processResource.setEmailAddresses(o.getEmailAddresses());
         }
         return processResource;
     }

http://git-wip-us.apache.org/repos/asf/airavata/blob/dce0271e/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/utils/ThriftDataModelConversion.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/utils/ThriftDataModelConversion.java
b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/utils/ThriftDataModelConversion.java
index a149dd6..fecfbc2 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/utils/ThriftDataModelConversion.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/utils/ThriftDataModelConversion.java
@@ -336,6 +336,14 @@ public class ThriftDataModelConversion {
             processModel.setProcessDetail(processResource.getProcessDetail());
             processModel.setApplicationInterfaceId(processResource.getApplicationInterfaceId());
             processModel.setTaskDag(processResource.getTaskDag());
+            processModel.setGatewayExecutionId(processResource.getGatewayExecutionId());
+            processModel.setApplicationInterfaceId(processResource.getApplicationInterfaceId());
+            processModel.setComputeResourceId(processResource.getComputeResourceId());
+            processModel.setEnableEmailNotification(processResource.getEnableEmailNotification());
+            if (processModel.isEnableEmailNotification()){
+                String notificationEmails = processResource.getEmailAddresses();
+                processModel.setEmailAddresses(getEmailAddresses(notificationEmails.split(",")));
+            }
 
             processModel.setProcessInputs(getProcessInputs(processResource.getProcessInputs()));
             processModel.setProcessOutputs(getProcessOutputs(processResource.getProcessOutputs()));

http://git-wip-us.apache.org/repos/asf/airavata/blob/dce0271e/modules/registry/registry-core/src/main/resources/expcatalog-derby.sql
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/resources/expcatalog-derby.sql b/modules/registry/registry-core/src/main/resources/expcatalog-derby.sql
index 6ad715c..22c047b 100644
--- a/modules/registry/registry-core/src/main/resources/expcatalog-derby.sql
+++ b/modules/registry/registry-core/src/main/resources/expcatalog-derby.sql
@@ -182,6 +182,11 @@ CREATE TABLE PROCESS (
   PROCESS_DETAIL CLOB,
   APPLICATION_INTERFACE_ID varchar(255),
   TASK_DAG varchar(255),
+  APPLICATION_DEPLOYMENT_ID varchar(255),
+  COMPUTE_RESOURCE_ID varchar(255),
+  GATEWAY_EXECUTION_ID varchar(255),
+  ENABLE_EMAIL_NOTIFICATION BOOLEAN,
+  EMAIL_ADDRESSES CLOB,
   PRIMARY KEY (PROCESS_ID),
   FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
 );

http://git-wip-us.apache.org/repos/asf/airavata/blob/dce0271e/modules/registry/registry-core/src/main/resources/expcatalog-mysql.sql
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/resources/expcatalog-mysql.sql b/modules/registry/registry-core/src/main/resources/expcatalog-mysql.sql
index a446386..b056482 100644
--- a/modules/registry/registry-core/src/main/resources/expcatalog-mysql.sql
+++ b/modules/registry/registry-core/src/main/resources/expcatalog-mysql.sql
@@ -184,6 +184,11 @@ CREATE TABLE PROCESS (
   PROCESS_DETAIL text,
   APPLICATION_INTERFACE_ID varchar(255),
   TASK_DAG varchar(255),
+  APPLICATION_DEPLOYMENT_ID varchar(255),
+  COMPUTE_RESOURCE_ID varchar(255),
+  GATEWAY_EXECUTION_ID varchar(255),
+  ENABLE_EMAIL_NOTIFICATION BOOLEAN,
+  EMAIL_ADDRESSES text,
   PRIMARY KEY (PROCESS_ID),
   FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
 );

http://git-wip-us.apache.org/repos/asf/airavata/blob/dce0271e/modules/registry/registry-core/src/test/resources/expcatalog-derby.sql
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/test/resources/expcatalog-derby.sql b/modules/registry/registry-core/src/test/resources/expcatalog-derby.sql
index 6ad715c..22c047b 100644
--- a/modules/registry/registry-core/src/test/resources/expcatalog-derby.sql
+++ b/modules/registry/registry-core/src/test/resources/expcatalog-derby.sql
@@ -182,6 +182,11 @@ CREATE TABLE PROCESS (
   PROCESS_DETAIL CLOB,
   APPLICATION_INTERFACE_ID varchar(255),
   TASK_DAG varchar(255),
+  APPLICATION_DEPLOYMENT_ID varchar(255),
+  COMPUTE_RESOURCE_ID varchar(255),
+  GATEWAY_EXECUTION_ID varchar(255),
+  ENABLE_EMAIL_NOTIFICATION BOOLEAN,
+  EMAIL_ADDRESSES CLOB,
   PRIMARY KEY (PROCESS_ID),
   FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
 );


Mime
View raw message