airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ramin...@apache.org
Subject svn commit: r1558084 - in /airavata/trunk/modules: orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/ registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/ registry/airavata-jp...
Date Tue, 14 Jan 2014 16:00:14 GMT
Author: raminder
Date: Tue Jan 14 16:00:13 2014
New Revision: 1558084

URL: http://svn.apache.org/r1558084
Log:
updated database and function calls

Modified:
    airavata/trunk/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/PullBasedOrchestrator.java
    airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/OrchestratorData.java
    airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/GatewayResource.java
    airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/OrchestratorDataResource.java
    airavata/trunk/modules/registry/airavata-jpa-registry/src/main/resources/data-derby.sql
    airavata/trunk/modules/registry/airavata-jpa-registry/src/main/resources/data-mysql.sql
    airavata/trunk/modules/registry/airavata-jpa-registry/src/test/resources/data-derby.sql
    airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/orchestrator/OrchestratorData.java
    airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/orchestrator/impl/OrchestratorDataImpl.java

Modified: airavata/trunk/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/PullBasedOrchestrator.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/PullBasedOrchestrator.java?rev=1558084&r1=1558083&r2=1558084&view=diff
==============================================================================
--- airavata/trunk/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/PullBasedOrchestrator.java
(original)
+++ airavata/trunk/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/PullBasedOrchestrator.java
Tue Jan 14 16:00:13 2014
@@ -112,7 +112,7 @@ public class PullBasedOrchestrator imple
 
     public String createExperiment(ExperimentRequest request) throws OrchestratorException
{
         //todo use a consistent method to create the experiment ID
-            String experimentID = request.getUserExperimentID();
+        String experimentID = request.getUserExperimentID();
         String orchestratorID = UUID.randomUUID().toString();
         String username = request.getUserName();
         try {

Modified: airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/OrchestratorData.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/OrchestratorData.java?rev=1558084&r1=1558083&r2=1558084&view=diff
==============================================================================
--- airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/OrchestratorData.java
(original)
+++ airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/OrchestratorData.java
Tue Jan 14 16:00:13 2014
@@ -1,66 +1,58 @@
 package org.apache.airavata.persistance.registry.jpa.model;
 
 import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
 import javax.persistence.Id;
 
 @Entity
 public class OrchestratorData {
 	
 	@Id
-	private String experimentId;
-	private String orchestratorId;
+    private String experiment_ID;
+	@GeneratedValue
+	private int orchestrator_ID;
 	private String user;
 	private String status;
 	private String state;
 	private String gfacEPR;
-
-	public String getOrchestratorId() {
-		return orchestratorId;
+	
+	public String getExperiment_ID() {
+		return experiment_ID;
 	}
-
-	public String getExperimentId() {
-		return experimentId;
+	public void setExperiment_ID(String experiment_ID) {
+		this.experiment_ID = experiment_ID;
+	}
+	
+	public int getOrchestrator_ID() {
+		return orchestrator_ID;
+	}
+	public void setOrchestrator_ID(int orchestrator_ID) {
+		this.orchestrator_ID = orchestrator_ID;
 	}
-
 	public String getUser() {
 		return user;
 	}
-
-	public String getGFACServiceEPR() {
-		return gfacEPR;
-	}
-
-	public String getState() {
-		return state;
+	public void setUser(String user) {
+		this.user = user;
 	}
-
 	public String getStatus() {
-		return status.toString();
-	}
-
-	public void setOrchestratorId(String orchestratorId) {
-		this.orchestratorId = orchestratorId;
-	}
-	
-	public void setExperimentId(String experimentId) {
-		this.experimentId = experimentId;
+		return status;
 	}
-
-	public void setUser(String user) {
-		this.user = user;
-
+	public void setStatus(String status) {
+		this.status = status;
 	}
-
-	public void setGFACServiceEPR(String gfacEPR) {
-		this.gfacEPR = gfacEPR;
+	public String getState() {
+		return state;
 	}
-
 	public void setState(String state) {
 		this.state = state;
 	}
-
-	public void setStatus(String status) {
-		this.status = status;
+	public String getGfacEPR() {
+		return gfacEPR;
+	}
+	public void setGfacEPR(String gfacEPR) {
+		this.gfacEPR = gfacEPR;
 	}
+	
 
 }

Modified: airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/GatewayResource.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/GatewayResource.java?rev=1558084&r1=1558083&r2=1558084&view=diff
==============================================================================
--- airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/GatewayResource.java
(original)
+++ airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/GatewayResource.java
Tue Jan 14 16:00:13 2014
@@ -745,9 +745,9 @@ public class GatewayResource extends Abs
     	remove(ResourceType.PUBLISHED_WORKFLOW, workflowTemplateName);
     }
     
-    public OrchestratorDataResource createOrchestratorData(String orchestratorID){
+    public OrchestratorDataResource createOrchestratorData(String experimentID){
     	OrchestratorDataResource dataResource = (OrchestratorDataResource)create(ResourceType.ORCHESTRATOR_DATA);
-    	dataResource.setOrchestratorID(orchestratorID);
+    	dataResource.setExperimentID(experimentID);
     	return dataResource;
     }
 }

Modified: airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/OrchestratorDataResource.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/OrchestratorDataResource.java?rev=1558084&r1=1558083&r2=1558084&view=diff
==============================================================================
--- airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/OrchestratorDataResource.java
(original)
+++ airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/OrchestratorDataResource.java
Tue Jan 14 16:00:13 2014
@@ -18,7 +18,7 @@ public class OrchestratorDataResource ex
    
 	private final static Logger log = LoggerFactory.getLogger(OrchestratorDataResource.class);
 	private String experimentID;
-	private String orchestratorID;
+	private int orchestratorID;
 	private String userName;
 	private String status;
 	private String state;
@@ -29,7 +29,7 @@ public class OrchestratorDataResource ex
 		return experimentID;
 	}
 
-	public String getOrchestratorID() {
+	public int getOrchestratorID() {
 		return orchestratorID;
 	}
 
@@ -41,7 +41,7 @@ public class OrchestratorDataResource ex
 		this.experimentID = experimentID;
 	}
 
-	public void setOrchestratorID(String orchestratorID) {
+	public void setOrchestratorID(int orchestratorID) {
 		this.orchestratorID = orchestratorID;
 	}
 
@@ -85,7 +85,6 @@ public class OrchestratorDataResource ex
 	public Resource create(ResourceType type) {
 		 if (type == ResourceType.ORCHESTRATOR_DATA) {
 	            OrchestratorDataResource orchestratorResource = new OrchestratorDataResource();
-	            orchestratorResource.setOrchestratorID(orchestratorID);
 	            orchestratorResource.setExperimentID(experimentID);
 	            orchestratorResource.setUserName(userName);
 	            orchestratorResource.setState(state);
@@ -136,7 +135,7 @@ public class OrchestratorDataResource ex
 	            EntityManager em = ResourceUtils.getEntityManager();
 	            em.getTransaction().begin();
 	        	QueryGenerator generator = new QueryGenerator(ORCHESTRATORDATA);
-	        	generator.setParameter(OrchestratorDataConstants.ORCHESTRATOR_ID, orchestratorID);
+	        	generator.setParameter(OrchestratorDataConstants.EXPERIMENT_ID, experimentID);
 	        	Query q = generator.selectQuery(em);
 	            List<?> results = q.getResultList();
 	            if (results.size() != 0) {
@@ -166,18 +165,17 @@ public class OrchestratorDataResource ex
 		em = ResourceUtils.getEntityManager();
 		em.getTransaction().begin();
 		OrchestratorData orchestratorData = new OrchestratorData();
-		orchestratorData.setExperimentId(experimentID);
-		orchestratorData.setOrchestratorId(orchestratorID);
+		orchestratorData.setExperiment_ID(experimentID);
 		orchestratorData.setUser(userName);
-		orchestratorData.setGFACServiceEPR(gfacEPR);
+		orchestratorData.setGfacEPR(gfacEPR);
 		orchestratorData.setState(state);
 		orchestratorData.setStatus(status);
 		if (existingOrchestratorData != null) {
-			existingOrchestratorData.setExperimentId(experimentID);
+			existingOrchestratorData.setExperiment_ID(experimentID);
 			existingOrchestratorData.setUser(userName);
-			existingOrchestratorData.setGFACServiceEPR(gfacEPR);
 			existingOrchestratorData.setState(state);
 			existingOrchestratorData.setStatus(status);
+			existingOrchestratorData.setGfacEPR(gfacEPR);
 			orchestratorData = em.merge(existingOrchestratorData);
 		} else {
 			em.persist(orchestratorData);

Modified: airavata/trunk/modules/registry/airavata-jpa-registry/src/main/resources/data-derby.sql
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/resources/data-derby.sql?rev=1558084&r1=1558083&r2=1558084&view=diff
==============================================================================
--- airavata/trunk/modules/registry/airavata-jpa-registry/src/main/resources/data-derby.sql
(original)
+++ airavata/trunk/modules/registry/airavata-jpa-registry/src/main/resources/data-derby.sql
Tue Jan 14 16:00:13 2014
@@ -267,11 +267,12 @@ CREATE TABLE Execution_Error
 
 create table Orchestrator_Data
 (
-        orchestrator_ID varchar(255),
-        experiment_ID varchar(255),
-        username varchar(255),
+        experiment_ID varchar(255) NOT NULL,
+        orchestrator_ID INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
+        user varchar(255),
         status varchar(255),
         state varchar(255),
+        gfacEPR varchar(255),
         PRIMARY KEY (experiment_ID)
 );
 

Modified: airavata/trunk/modules/registry/airavata-jpa-registry/src/main/resources/data-mysql.sql
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/resources/data-mysql.sql?rev=1558084&r1=1558083&r2=1558084&view=diff
==============================================================================
--- airavata/trunk/modules/registry/airavata-jpa-registry/src/main/resources/data-mysql.sql
(original)
+++ airavata/trunk/modules/registry/airavata-jpa-registry/src/main/resources/data-mysql.sql
Tue Jan 14 16:00:13 2014
@@ -264,11 +264,12 @@ CREATE TABLE Execution_Error
 
 create table Orchestrator_Data
 (
-        orchestrator_ID varchar(255) NOT NULL,
         experiment_ID varchar(255) NOT NULL,
+        orchestrator_ID INT NOT NULL AUTO_INCREMENT,
         username varchar(255),
         status varchar(255),
         state varchar(255),
+        gfacEPR varchar(255),
         PRIMARY KEY (experiment_ID)
 );
 

Modified: airavata/trunk/modules/registry/airavata-jpa-registry/src/test/resources/data-derby.sql
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/airavata-jpa-registry/src/test/resources/data-derby.sql?rev=1558084&r1=1558083&r2=1558084&view=diff
==============================================================================
--- airavata/trunk/modules/registry/airavata-jpa-registry/src/test/resources/data-derby.sql
(original)
+++ airavata/trunk/modules/registry/airavata-jpa-registry/src/test/resources/data-derby.sql
Tue Jan 14 16:00:13 2014
@@ -266,6 +266,16 @@ CREATE TABLE Execution_Error
        FOREIGN KEY (experiment_ID) REFERENCES Experiment_Data(experiment_ID) ON DELETE CASCADE
 );
 
+create table Orchestrator_Data
+(
+        experiment_ID varchar(255) NOT NULL,
+        orchestrator_ID INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
+        user varchar(255),
+        status varchar(255),
+        state varchar(255),
+        gfacEPR varchar(255),
+        PRIMARY KEY (experiment_ID)
+);
 -- CREATE TABLE openjpa_sequence_table
 -- (
 --   id SMALLINT NOT NULL,

Modified: airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/orchestrator/OrchestratorData.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/orchestrator/OrchestratorData.java?rev=1558084&r1=1558083&r2=1558084&view=diff
==============================================================================
--- airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/orchestrator/OrchestratorData.java
(original)
+++ airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/orchestrator/OrchestratorData.java
Tue Jan 14 16:00:13 2014
@@ -14,7 +14,7 @@ public interface OrchestratorData {
 	 * 
 	 * @return
 	 */
-	public String getOrchestratorId();
+	public int getOrchestratorId();
 
 	/**
 	 * 

Modified: airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/orchestrator/impl/OrchestratorDataImpl.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/orchestrator/impl/OrchestratorDataImpl.java?rev=1558084&r1=1558083&r2=1558084&view=diff
==============================================================================
--- airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/orchestrator/impl/OrchestratorDataImpl.java
(original)
+++ airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/orchestrator/impl/OrchestratorDataImpl.java
Tue Jan 14 16:00:13 2014
@@ -10,7 +10,7 @@ import org.apache.airavata.registry.api.
 @XmlRootElement
 public class OrchestratorDataImpl implements OrchestratorData{
 
-	private String orchestratorId;
+	private int orchestratorId;
 	private String experimentId;
 	private String user;
 	private String status;
@@ -26,7 +26,7 @@ public class OrchestratorDataImpl implem
         this.lazyLoaded = lazyLoaded;
     }
 	@Override
-	public String getOrchestratorId() {
+	public int getOrchestratorId() {
 		return orchestratorId;
 	}
 



Mime
View raw message