airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shame...@apache.org
Subject [02/28] airavata git commit: AIRAVATA-1667 - Modified both mysql and derby sql script files and introduced email monitor property table. Add part of new email monitor property resource implementation.
Date Wed, 15 Apr 2015 20:48:38 GMT
AIRAVATA-1667 - Modified both mysql and derby sql script files and introduced email monitor
property table. Add part of new email monitor property resource implementation.


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

Branch: refs/heads/emailMonitoring
Commit: 3cdea29b319942b5561d658bfd550ba537212f47
Parents: f987a73
Author: shamrath <shameerainfo@gmail.com>
Authored: Mon Apr 13 11:30:19 2015 -0400
Committer: shamrath <shameerainfo@gmail.com>
Committed: Mon Apr 13 11:30:19 2015 -0400

----------------------------------------------------------------------
 .../catalog/data/model/SshJobSubmission.java    | 33 +++++++++++++++++++
 .../resources/SshJobSubmissionResource.java     | 34 +++++++++++++++++++-
 .../catalog/data/util/AppCatalogJPAUtils.java   |  3 ++
 .../src/main/resources/appcatalog-derby.sql     | 18 ++++++++++-
 .../src/main/resources/appcatalog-mysql.sql     | 18 ++++++++++-
 5 files changed, 103 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/3cdea29b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/model/SshJobSubmission.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/model/SshJobSubmission.java
b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/model/SshJobSubmission.java
index fc72881..8e812c4 100644
--- a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/model/SshJobSubmission.java
+++ b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/model/SshJobSubmission.java
@@ -59,6 +59,15 @@ public class SshJobSubmission implements Serializable {
 	@Column(name = "SSH_PORT")
 	private int sshPort;
 
+    @Column(name = "MONITOR_MODE")
+    private String monitorMode;
+
+    @Column(name = "EMAIL_MONITOR_PROPERTY_ID")
+    private String emailMonitorPropertyId;
+
+    @JoinColumn(name = "EMAIL_MONITOR_PROPERTY_ID")
+    private EmailMonitorProperty emailMonitorProperty;
+
     @Column(name = "CREATION_TIME")
     private Timestamp creationTime;
 
@@ -129,4 +138,28 @@ public class SshJobSubmission implements Serializable {
 	public void setSshPort(int sshPort) {
 		this.sshPort=sshPort;
 	}
+
+    public String getMonitorMode() {
+        return monitorMode;
+    }
+
+    public void setMonitorMode(String monitorMode) {
+        this.monitorMode = monitorMode;
+    }
+
+    public EmailMonitorProperty getEmailMonitorProperty() {
+        return emailMonitorProperty;
+    }
+
+    public void setEmailMonitorProperty(EmailMonitorProperty emailMonitorProperty) {
+        this.emailMonitorProperty = emailMonitorProperty;
+    }
+
+    public String getEmailMonitorPropertyId() {
+        return emailMonitorPropertyId;
+    }
+
+    public void setEmailMonitorPropertyId(String emailMonitorPropertyId) {
+        this.emailMonitorPropertyId = emailMonitorPropertyId;
+    }
 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/3cdea29b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/SshJobSubmissionResource.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/SshJobSubmissionResource.java
b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/SshJobSubmissionResource.java
index 4b46dd3..2d87c60 100644
--- a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/SshJobSubmissionResource.java
+++ b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/SshJobSubmissionResource.java
@@ -27,6 +27,7 @@ import javax.persistence.EntityManager;
 import javax.persistence.Query;
 
 import org.airavata.appcatalog.cpi.AppCatalogException;
+import org.apache.aiaravata.application.catalog.data.model.EmailMonitorProperty;
 import org.apache.aiaravata.application.catalog.data.model.ResourceJobManager;
 import org.apache.aiaravata.application.catalog.data.model.SshJobSubmission;
 import org.apache.aiaravata.application.catalog.data.util.AppCatalogJPAUtils;
@@ -45,6 +46,9 @@ public class SshJobSubmissionResource extends AbstractResource {
 	private String alternativeSshHostname;
 	private String securityProtocol;
 	private int sshPort;
+    private String monitorMode;
+    private String emailMonitorPropertyId;
+    private EmailMonitorProperty emailMonitorProperty;
     private Timestamp createdTime;
     private Timestamp updatedTime;
 
@@ -230,7 +234,11 @@ public class SshJobSubmissionResource extends AbstractResource {
 			sshJobSubmission.setAlternativeSshHostname(getAlternativeSshHostname());
 			sshJobSubmission.setSecurityProtocol(getSecurityProtocol());
 			sshJobSubmission.setSshPort(getSshPort());
-			if (existingSshJobSubmission == null) {
+            sshJobSubmission.setMonitorMode(getMonitorMode());
+            sshJobSubmission.setEmailMonitorPropertyId(getEmailMonitorPropertyId());
+            EmailMonitorProperty emailMonitorProperty = em.find(EmailMonitorProperty.class,
getEmailMonitorPropertyId());
+            sshJobSubmission.setEmailMonitorProperty(emailMonitorProperty);
+            if (existingSshJobSubmission == null) {
 				em.persist(sshJobSubmission);
 			} else {
 				em.merge(sshJobSubmission);
@@ -318,4 +326,28 @@ public class SshJobSubmissionResource extends AbstractResource {
 	public void setSshPort(int sshPort) {
 		this.sshPort=sshPort;
 	}
+
+    public String getMonitorMode() {
+        return monitorMode;
+    }
+
+    public void setMonitorMode(String monitorMode) {
+        this.monitorMode = monitorMode;
+    }
+
+    public EmailMonitorProperty getEmailMonitorProperty() {
+        return emailMonitorProperty;
+    }
+
+    public void setEmailMonitorProperty(EmailMonitorProperty emailMonitorProperty) {
+        this.emailMonitorProperty = emailMonitorProperty;
+    }
+
+    public String getEmailMonitorPropertyId() {
+        return emailMonitorPropertyId;
+    }
+
+    public void setEmailMonitorPropertyId(String emailMonitorPropertyId) {
+        this.emailMonitorPropertyId = emailMonitorPropertyId;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/3cdea29b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/util/AppCatalogJPAUtils.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/util/AppCatalogJPAUtils.java
b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/util/AppCatalogJPAUtils.java
index 3a9b6ed..95eb20b 100644
--- a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/util/AppCatalogJPAUtils.java
+++ b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/util/AppCatalogJPAUtils.java
@@ -25,6 +25,7 @@ import org.apache.aiaravata.application.catalog.data.model.*;
 import org.apache.aiaravata.application.catalog.data.resources.*;
 import org.apache.airavata.common.exception.ApplicationSettingsException;
 import org.apache.airavata.common.utils.ServerSettings;
+import org.apache.airavata.model.appcatalog.computeresource.MonitorMode;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -606,6 +607,8 @@ public class AppCatalogJPAUtils {
             sshJobSubmissionResource.setAlternativeSshHostname(o.getAlternativeSshHostname());
             sshJobSubmissionResource.setSecurityProtocol(o.getSecurityProtocol());
             sshJobSubmissionResource.setSshPort(o.getSshPort());
+            sshJobSubmissionResource.setMonitorMode(o.getMonitorMode());
+            sshJobSubmissionResource.setEmailMonitorProperty(o.getEmailMonitorProperty());
             sshJobSubmissionResource.setCreatedTime(o.getCreationTime());
             if (o.getUpdateTime() != null){
                 sshJobSubmissionResource.setUpdatedTime(o.getUpdateTime());

http://git-wip-us.apache.org/repos/asf/airavata/blob/3cdea29b/modules/app-catalog/app-catalog-data/src/main/resources/appcatalog-derby.sql
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-data/src/main/resources/appcatalog-derby.sql
b/modules/app-catalog/app-catalog-data/src/main/resources/appcatalog-derby.sql
index 4e28e04..5d56086 100644
--- a/modules/app-catalog/app-catalog-data/src/main/resources/appcatalog-derby.sql
+++ b/modules/app-catalog/app-catalog-data/src/main/resources/appcatalog-derby.sql
@@ -117,10 +117,13 @@ CREATE TABLE SSH_JOB_SUBMISSION
         ALTERNATIVE_SSH_HOSTNAME VARCHAR (255),
         SECURITY_PROTOCOL VARCHAR (255) NOT NULL,
         SSH_PORT INTEGER,
+        MONITOR_MODE VARCHAR (255),
+        EMAIL_MONITOR_PROPERTY_ID VARCHAR (255),
         CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
         UPDATE_TIME TIMESTAMP DEFAULT '0000-00-00 00:00:00',
         PRIMARY KEY (JOB_SUBMISSION_INTERFACE_ID),
-        FOREIGN KEY (RESOURCE_JOB_MANAGER_ID) REFERENCES RESOURCE_JOB_MANAGER(RESOURCE_JOB_MANAGER_ID)
+        FOREIGN KEY (RESOURCE_JOB_MANAGER_ID) REFERENCES RESOURCE_JOB_MANAGER(RESOURCE_JOB_MANAGER_ID),
+        FOREIGN KEY (EMAIL_MONITOR_PROPERTY_ID) REFERENCES  EMAIL_MONITOR_PROPERTY(EMAIL_MONITOR_PROPERTY_ID)
 );
 
 CREATE TABLE SCP_DATA_MOVEMENT
@@ -442,6 +445,19 @@ CREATE TABLE WORKFLOW_OUTPUT
          FOREIGN KEY (WF_TEMPLATE_ID) REFERENCES WORKFLOW(WF_TEMPLATE_ID) ON DELETE CASCADE
 );
 
+CREATE TABLE EMAIL_MONITOR_PROPERTY
+(
+         JOB_SUBMISSION_INTERFACE_ID VARCHAR (255) NOT NULL,
+         EMAIL_MONITOR_PROPERTY_ID VARCHAR (255) NOT NULL,
+         HOST VARCHAR(255),
+         EMAIL_ADDRESS VARCHAR(255),
+         PASSWORD CLOB,
+         FOLDER_NAME VARCHAR(255) DEFAULT "INBOX",
+         EMAIL_PROTOCOL VARCHAR(255),
+         PRIMARY KEY(JOB_SUBMISSION_INTERFACE_ID,EMAIL_MONITOR_PROPERTY_ID),
+         FOREIGN KEY (JOB_SUBMISSION_INTERFACE_ID)  REFERENCES SSH_JOB_SUBMISSION(JOB_SUBMISSION_INTERFACE_ID)
ON DELETE CASCADE
+);
+
 CREATE TABLE CONFIGURATION
 (
         CONFIG_KEY VARCHAR(255),

http://git-wip-us.apache.org/repos/asf/airavata/blob/3cdea29b/modules/app-catalog/app-catalog-data/src/main/resources/appcatalog-mysql.sql
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-data/src/main/resources/appcatalog-mysql.sql
b/modules/app-catalog/app-catalog-data/src/main/resources/appcatalog-mysql.sql
index 2dcc119..aecf044 100644
--- a/modules/app-catalog/app-catalog-data/src/main/resources/appcatalog-mysql.sql
+++ b/modules/app-catalog/app-catalog-data/src/main/resources/appcatalog-mysql.sql
@@ -128,10 +128,13 @@ CREATE TABLE SSH_JOB_SUBMISSION
         ALTERNATIVE_SSH_HOSTNAME VARCHAR (255),
         SECURITY_PROTOCOL VARCHAR (255) NOT NULL,
         SSH_PORT INTEGER,
+        MONITOR_MODE VARCHAR (255),
+        EMAIL_MONITOR_PROPERTY_ID VARCHAR (255),
         CREATION_TIME TIMESTAMP DEFAULT NOW(),
         UPDATE_TIME TIMESTAMP DEFAULT '0000-00-00 00:00:00' ,
         PRIMARY KEY (JOB_SUBMISSION_INTERFACE_ID),
-        FOREIGN KEY (RESOURCE_JOB_MANAGER_ID) REFERENCES RESOURCE_JOB_MANAGER(RESOURCE_JOB_MANAGER_ID)
+        FOREIGN KEY (RESOURCE_JOB_MANAGER_ID) REFERENCES RESOURCE_JOB_MANAGER(RESOURCE_JOB_MANAGER_ID),
+        FOREIGN KEY (EMAIL_MONITOR_PROPERTY_ID) REFERENCES  EMAIL_MONITOR_PROPERTY(EMAIL_MONITOR_PROPERTY_ID)
 );
 
 CREATE TABLE SCP_DATA_MOVEMENT
@@ -440,6 +443,19 @@ CREATE TABLE WORKFLOW_OUTPUT
          FOREIGN KEY (WF_TEMPLATE_ID) REFERENCES WORKFLOW(WF_TEMPLATE_ID) ON DELETE CASCADE
 );
 
+CREATE TABLE EMAIL_MONITOR_PROPERTY
+(
+         JOB_SUBMISSION_INTERFACE_ID VARCHAR (255) NOT NULL,
+         EMAIL_MONITOR_PROPERTY_ID VARCHAR (255) NOT NULL,
+         HOST VARCHAR(255),
+         EMAIL_ADDRESS VARCHAR(255),
+         PASSWORD CLOB,
+         FOLDER_NAME VARCHAR(255) DEFAULT "INBOX",
+         EMAIL_PROTOCOL VARCHAR(255),
+         PRIMARY KEY(JOB_SUBMISSION_INTERFACE_ID,EMAIL_MONITOR_PROPERTY_ID),
+         FOREIGN KEY (JOB_SUBMISSION_INTERFACE_ID)  REFERENCES SSH_JOB_SUBMISSION(JOB_SUBMISSION_INTERFACE_ID)
ON DELETE CASCADE
+);
+
 CREATE TABLE CONFIGURATION
 (
           CONFIG_KEY VARCHAR(255),


Mime
View raw message