airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ramin...@apache.org
Subject svn commit: r1558837 - in /airavata/trunk: ./ modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/ modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/impl/ modules/orchestra...
Date Thu, 16 Jan 2014 15:38:00 GMT
Author: raminder
Date: Thu Jan 16 15:38:00 2014
New Revision: 1558837

URL: http://svn.apache.org/r1558837
Log:
Orchestrator data changes to pass application and job request

Modified:
    airavata/trunk/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/ExperimentRequest.java
    airavata/trunk/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/PullBasedOrchestrator.java
    airavata/trunk/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/impl/EmbeddedGFACJobSubmitter.java
    airavata/trunk/modules/orchestrator/orchestrator-core/src/test/resources/data-derby.sql
    airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java
    airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Orchestrator_Data.java
    airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/AbstractResource.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/java/org/apache/airavata/persistance/registry/jpa/resources/Utils.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/java/org/apache/airavata/persistance/registry/jpa/OrchestratorDataResourceTest.java
    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/OrchestratorRegistry.java
    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
    airavata/trunk/modules/rest/client/src/main/java/org/apache/airavata/rest/client/RegistryClient.java
    airavata/trunk/pom.xml

Modified: airavata/trunk/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/ExperimentRequest.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/ExperimentRequest.java?rev=1558837&r1=1558836&r2=1558837&view=diff
==============================================================================
--- airavata/trunk/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/ExperimentRequest.java
(original)
+++ airavata/trunk/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/ExperimentRequest.java
Thu Jan 16 15:38:00 2014
@@ -20,8 +20,6 @@
 */
 package org.apache.airavata.orchestrator.core;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 /**
  * This is the initial experiment Creation request
@@ -29,13 +27,16 @@ import org.slf4j.LoggerFactory;
  * This contains user specified userExperimentID
  */
 public class ExperimentRequest {
-    private final static Logger logger = LoggerFactory.getLogger(ExperimentRequest.class);
-
+  
     private String userName;
 
     private String userExperimentID;
     
-    private String orchestratorID;
+    private String systemExperimentID;
+    
+    private String applicationName;
+    
+    private String jobRequest;
 
     public String getUserExperimentID() {
         return userExperimentID;
@@ -53,11 +54,27 @@ public class ExperimentRequest {
         this.userName = userName;
     }
 
-	public String getOrchestratorID() {
-		return orchestratorID;
+	public String getSystemExperimentID() {
+		return systemExperimentID;
+	}
+
+	public void setSystemExperimentID(String systemExperimentID) {
+		this.systemExperimentID = systemExperimentID;
+	}
+
+	public String getApplicationName() {
+		return applicationName;
+	}
+
+	public void setApplicationName(String applicationName) {
+		this.applicationName = applicationName;
+	}
+
+	public String getJobRequest() {
+		return jobRequest;
 	}
 
-	public void setOrchestratorID(String orchestratorID) {
-		this.orchestratorID = orchestratorID;
+	public void setJobRequest(String jobRequest) {
+		this.jobRequest = jobRequest;
 	}
 }

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=1558837&r1=1558836&r2=1558837&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
Thu Jan 16 15:38:00 2014
@@ -20,6 +20,16 @@
 */
 package org.apache.airavata.orchestrator.core;
 
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.UUID;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
 import org.apache.airavata.client.AiravataAPIFactory;
 import org.apache.airavata.client.api.AiravataAPI;
 import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
@@ -31,18 +41,16 @@ import org.apache.airavata.orchestrator.
 import org.apache.airavata.orchestrator.core.exception.OrchestratorException;
 import org.apache.airavata.orchestrator.core.gfac.GFACInstance;
 import org.apache.airavata.orchestrator.core.job.JobSubmitter;
-import org.apache.airavata.orchestrator.core.utils.OrchestratorConstants;
 import org.apache.airavata.orchestrator.core.utils.OrchestratorUtils;
-import org.apache.airavata.registry.api.*;
+import org.apache.airavata.registry.api.AiravataRegistry2;
+import org.apache.airavata.registry.api.AiravataRegistryFactory;
+import org.apache.airavata.registry.api.AiravataUser;
+import org.apache.airavata.registry.api.Gateway;
+import org.apache.airavata.registry.api.JobRequest;
 import org.apache.airavata.registry.api.exception.RegistryException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.io.IOException;
-import java.util.*;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
 public class PullBasedOrchestrator implements Orchestrator {
     private final static Logger logger = LoggerFactory.getLogger(PullBasedOrchestrator.class);
 
@@ -132,13 +140,11 @@ 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 orchestratorID = UUID.randomUUID().toString();
         if(experimentID == null){
-            experimentID = orchestratorID;
+        	experimentID = UUID.randomUUID().toString(); 
         }
-        String username = request.getUserName();
         try {
-            airavataRegistry.storeExperiment(username, experimentID, orchestratorID);
+            airavataRegistry.storeExperiment(request.getUserName(), experimentID, request.getApplicationName(),
request.getJobRequest());
         } catch (RegistryException e) {
             //todo put more meaningful error  message
             logger.error("Failed to create experiment for the request from " + request.getUserName());

Modified: airavata/trunk/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/impl/EmbeddedGFACJobSubmitter.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/impl/EmbeddedGFACJobSubmitter.java?rev=1558837&r1=1558836&r2=1558837&view=diff
==============================================================================
--- airavata/trunk/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/impl/EmbeddedGFACJobSubmitter.java
(original)
+++ airavata/trunk/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/impl/EmbeddedGFACJobSubmitter.java
Thu Jan 16 15:38:00 2014
@@ -21,6 +21,13 @@
 package org.apache.airavata.orchestrator.core.impl;
 
 
+import java.io.File;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
 import org.apache.airavata.client.api.AiravataAPI;
 import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
 import org.apache.airavata.common.utils.AiravataJobState;
@@ -31,7 +38,6 @@ import org.apache.airavata.commons.gfac.
 import org.apache.airavata.gfac.Constants;
 import org.apache.airavata.gfac.GFacAPI;
 import org.apache.airavata.gfac.GFacConfiguration;
-import org.apache.airavata.gfac.GFacException;
 import org.apache.airavata.gfac.context.ApplicationContext;
 import org.apache.airavata.gfac.context.JobExecutionContext;
 import org.apache.airavata.gfac.context.MessageContext;
@@ -40,24 +46,10 @@ import org.apache.airavata.orchestrator.
 import org.apache.airavata.orchestrator.core.exception.OrchestratorException;
 import org.apache.airavata.orchestrator.core.gfac.GFACInstance;
 import org.apache.airavata.orchestrator.core.job.JobSubmitter;
-import org.apache.airavata.orchestrator.core.utils.OrchestratorConstants;
 import org.apache.airavata.orchestrator.core.utils.OrchestratorUtils;
-import org.apache.airavata.registry.api.AiravataRegistry2;
 import org.apache.airavata.registry.api.JobRequest;
-import org.apache.airavata.registry.api.exception.RegistryException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.xml.sax.SAXException;
-
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.xpath.XPathExpressionException;
-import java.io.File;
-import java.io.IOException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
 
 /**
  * This is the simplest implementation for JobSubmitter,

Modified: airavata/trunk/modules/orchestrator/orchestrator-core/src/test/resources/data-derby.sql
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/orchestrator/orchestrator-core/src/test/resources/data-derby.sql?rev=1558837&r1=1558836&r2=1558837&view=diff
==============================================================================
--- airavata/trunk/modules/orchestrator/orchestrator-core/src/test/resources/data-derby.sql
(original)
+++ airavata/trunk/modules/orchestrator/orchestrator-core/src/test/resources/data-derby.sql
Thu Jan 16 15:38:00 2014
@@ -273,6 +273,8 @@ create table Orchestrator_Data
         status varchar(255),
         state varchar(255),
         gfacEPR varchar(255),
+        applicationName varchar(255),
+        jobRequest CLOB,
         PRIMARY KEY (experiment_ID)
 );
 

Modified: airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java?rev=1558837&r1=1558836&r2=1558837&view=diff
==============================================================================
--- airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java
(original)
+++ airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java
Thu Jan 16 15:38:00 2014
@@ -2581,9 +2581,9 @@ public class AiravataJPARegistry extends
         return false;  //To change body of implemented methods use File | Settings | File
Templates.
     }
 
-    public boolean storeExperiment(String userName, String experimentID, String orchestratorID)
throws RegistryException {
+    public boolean storeExperiment(String userName, String experimentID, String applicationName,
String jobRequest) throws RegistryException {
     	GatewayResource gateway = jpa.getGateway();
-		OrchestratorDataResource dataResource = gateway.createOrchestratorData(orchestratorID);

+		OrchestratorDataResource dataResource = gateway.createOrchestratorData(experimentID); 
 		dataResource.setUserName(userName);
 		dataResource.setExperimentID(experimentID);
 		dataResource.setStatus(AiravataJobState.State.CREATED.toString());
@@ -2598,9 +2598,9 @@ public class AiravataJPARegistry extends
 		dataResource.save();
 		return true; 
     }
-    public boolean changeStatus(String orchestratorID, AiravataJobState.State state, String
gfacEPR) throws RegistryException {
+    public boolean changeStatus(String experimentID, AiravataJobState.State state, String
gfacEPR) throws RegistryException {
     	GatewayResource gateway = jpa.getGateway();
-		OrchestratorDataResource dataResource = gateway.createOrchestratorData(orchestratorID);

+		OrchestratorDataResource dataResource = gateway.createOrchestratorData(experimentID); 
 		dataResource.setStatus(state.toString());
 		dataResource.setGfacEPR(gfacEPR);
 		dataResource.save();

Modified: airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Orchestrator_Data.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Orchestrator_Data.java?rev=1558837&r1=1558836&r2=1558837&view=diff
==============================================================================
--- airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Orchestrator_Data.java
(original)
+++ airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Orchestrator_Data.java
Thu Jan 16 15:38:00 2014
@@ -3,6 +3,7 @@ package org.apache.airavata.persistance.
 import javax.persistence.Entity;
 import javax.persistence.GeneratedValue;
 import javax.persistence.Id;
+import javax.persistence.Lob;
 import javax.persistence.Table;
 
 @Entity
@@ -17,6 +18,9 @@ public class Orchestrator_Data {
 	private String status;
 	private String state;
 	private String gfacEPR;
+	private String applicationName;
+	@Lob
+	private String jobRequest;
 	
 	public String getExperiment_ID() {
 		return experiment_ID;
@@ -55,6 +59,18 @@ public class Orchestrator_Data {
 	public void setGfacEPR(String gfacEPR) {
 		this.gfacEPR = gfacEPR;
 	}
+	public String getApplicationName() {
+		return applicationName;
+	}
+	public void setApplicationName(String applicationName) {
+		this.applicationName = applicationName;
+	}
+	public String getJobRequest() {
+		return jobRequest;
+	}
+	public void setJobRequest(String jobRequest) {
+		this.jobRequest = jobRequest;
+	}
 	
 
 }

Modified: airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/AbstractResource.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/AbstractResource.java?rev=1558837&r1=1558836&r2=1558837&view=diff
==============================================================================
--- airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/AbstractResource.java
(original)
+++ airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/AbstractResource.java
Thu Jan 16 15:38:00 2014
@@ -219,6 +219,9 @@ public abstract class AbstractResource i
 		public static final String USERNAME = "username";
 		public static final String STATUS = "status";
 		public static final String STATE = "state";
+		public static final String APPLICATION_NAME = "applicationName";
+		public static final String JOB_REQUEST = "jobRequest";
+		
 	}
 
 	protected AbstractResource() {

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=1558837&r1=1558836&r2=1558837&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
Thu Jan 16 15:38:00 2014
@@ -9,6 +9,7 @@ import javax.persistence.Query;
 import org.apache.airavata.persistance.registry.jpa.Resource;
 import org.apache.airavata.persistance.registry.jpa.ResourceType;
 import org.apache.airavata.persistance.registry.jpa.ResourceUtils;
+import org.apache.airavata.persistance.registry.jpa.model.Experiment;
 import org.apache.airavata.persistance.registry.jpa.model.Orchestrator_Data;
 import org.apache.airavata.persistance.registry.jpa.utils.QueryGenerator;
 import org.slf4j.Logger;
@@ -20,9 +21,11 @@ public class OrchestratorDataResource ex
 	private String experimentID;
 	private int orchestratorID;
 	private String userName;
+	private String applicationName;
 	private String status;
 	private String state;
 	private String gfacEPR;
+	private String jobRequest;
 	private GatewayResource gateway;
 
 	public String getExperimentID() {
@@ -49,6 +52,14 @@ public class OrchestratorDataResource ex
 		this.userName = userName;
 	}
 
+	public String getApplicationName() {
+		return applicationName;
+	}
+
+	public void setApplicationName(String applicationName) {
+		this.applicationName = applicationName;
+	}
+
 	public String getStatus() {
 		return status;
 	}
@@ -73,6 +84,14 @@ public class OrchestratorDataResource ex
 		this.gfacEPR = gfacEPR;
 	}
 
+	public String getJobRequest() {
+		return jobRequest;
+	}
+
+	public void setJobRequest(String jobRequest) {
+		this.jobRequest = jobRequest;
+	}
+
 	public GatewayResource getGateway() {
 		return gateway;
 	}
@@ -90,6 +109,8 @@ public class OrchestratorDataResource ex
 	            orchestratorResource.setState(state);
 	            orchestratorResource.setStatus(status);
 	            orchestratorResource.setGfacEPR(gfacEPR);
+	            orchestratorResource.setApplicationName(applicationName);
+	            orchestratorResource.setJobRequest(jobRequest);
 	            return orchestratorResource;
 	        } else {
 	            log.error("Unsupported resource type for orchestrator resource.", new IllegalArgumentException());
@@ -106,13 +127,13 @@ public class OrchestratorDataResource ex
 	@Override
 	public Resource get(ResourceType type, Object name) {
 		  EntityManager em = ResourceUtils.getEntityManager();
-	        em.getTransaction().begin();
-	        QueryGenerator generator;
-	        Query q;
+	      em.getTransaction().begin();
+	      QueryGenerator generator;
+	      Query q;
 	        switch (type) {
 	            case ORCHESTRATOR_DATA:
 	                generator = new QueryGenerator(ORCHESTRATORDATA);
-	                generator.setParameter(OrchestratorDataConstants.EXPERIMENT_ID, name);
+	                generator.setParameter(OrchestratorDataConstants.EXPERIMENT_ID, name.toString());
 	                q = generator.selectQuery(em);
 	                Orchestrator_Data orchestrator_data = (Orchestrator_Data)q.getSingleResult();
 	                OrchestratorDataResource orchestratorDataResource = (OrchestratorDataResource)Utils.getResource(ResourceType.ORCHESTRATOR_DATA,
orchestrator_data);
@@ -126,7 +147,33 @@ public class OrchestratorDataResource ex
 	                throw new IllegalArgumentException("Unsupported resource type for node data
resource.");
 	        }
 	}
+	public List<Resource> getDataWithStatus(ResourceType type,Object name) {
+		 List<Resource> resourceList = new ArrayList<Resource>();
 
+	        if (type == ResourceType.ORCHESTRATOR_DATA) {
+	            EntityManager em = ResourceUtils.getEntityManager();
+	            em.getTransaction().begin();
+	        	QueryGenerator generator = new QueryGenerator(ORCHESTRATORDATA);
+	        	generator.setParameter(OrchestratorDataConstants.STATUS, name);
+	        	Query q = generator.selectQuery(em);
+	            List<?> results = q.getResultList();
+	            if (results.size() != 0) {
+	                for (Object result : results) {
+	                	Orchestrator_Data orchestratorData = (Orchestrator_Data) result;
+	                	OrchestratorDataResource orchestratorDataResource = (OrchestratorDataResource)
+	                            Utils.getResource(ResourceType.ORCHESTRATOR_DATA, orchestratorData);
+	                    resourceList.add(orchestratorDataResource);
+	                }
+	            }
+	            em.getTransaction().commit();
+	            em.close();
+	        } else {
+	            log.error("Unsupported resource type for orchestrator data resource.", new IllegalArgumentException());
+	            throw new IllegalArgumentException("Unsupported resource type for orchestrator
data resource.");
+	        }
+	        return resourceList;
+	}
+	
 	@Override
 	public List<Resource> get(ResourceType type) {
 		 List<Resource> resourceList = new ArrayList<Resource>();
@@ -161,7 +208,6 @@ public class OrchestratorDataResource ex
 		Orchestrator_Data existingOrchestratorData = em.find(Orchestrator_Data.class,
 				experimentID);
 		em.close();
-
 		em = ResourceUtils.getEntityManager();
 		em.getTransaction().begin();
 		Orchestrator_Data orchestratorData = new Orchestrator_Data();
@@ -170,19 +216,22 @@ public class OrchestratorDataResource ex
 		orchestratorData.setGfacEPR(gfacEPR);
 		orchestratorData.setState(state);
 		orchestratorData.setStatus(status);
+		orchestratorData.setApplicationName(applicationName);
+		orchestratorData.setJobRequest(jobRequest);
 		if (existingOrchestratorData != null) {
 			existingOrchestratorData.setExperiment_ID(experimentID);
 			existingOrchestratorData.setUserName(userName);
 			existingOrchestratorData.setState(state);
 			existingOrchestratorData.setStatus(status);
 			existingOrchestratorData.setGfacEPR(gfacEPR);
+			existingOrchestratorData.setApplicationName(applicationName);
+			existingOrchestratorData.setJobRequest(jobRequest);
 			orchestratorData = em.merge(existingOrchestratorData);
 		} else {
 			em.persist(orchestratorData);
 		}
 		em.getTransaction().commit();
 		em.close();
-
 	}
 
 }
\ No newline at end of file

Modified: airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/Utils.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/Utils.java?rev=1558837&r1=1558836&r2=1558837&view=diff
==============================================================================
--- airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/Utils.java
(original)
+++ airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/Utils.java
Thu Jan 16 15:38:00 2014
@@ -331,6 +331,13 @@ public class Utils {
                     logger.error("Object should be a GFac Job Status type.", new IllegalArgumentException());
                     throw new IllegalArgumentException("Object should be a GFac Job Status.");
                 }
+            case ORCHESTRATOR_DATA:
+            	if(o instanceof Orchestrator_Data){
+            		return createOrchestratorData((Orchestrator_Data)o);
+            	}else{
+            		 logger.error("Object should be orchestrator data.", new IllegalArgumentException());
+                     throw new IllegalArgumentException("Object should be orchestrator data.");
+            	}
             default:
         }
         return null;
@@ -645,6 +652,16 @@ public class Utils {
         return gFacJobStatusResource;
     }
 
+    private static Resource createOrchestratorData(Orchestrator_Data data){
+    	OrchestratorDataResource dataResource = new OrchestratorDataResource();
+    	dataResource.setExperimentID(data.getExperiment_ID());
+    	dataResource.setUserName(data.getUserName());
+    	dataResource.setApplicationName(data.getApplicationName());
+    	dataResource.setStatus(data.getStatus());
+    	dataResource.setGfacEPR(data.getGfacEPR());
+    	dataResource.setJobRequest(data.getJobRequest());
+    	return dataResource;
+    }
 //    public static byte[] getByteArray(String content){
 //        byte[] contentBytes = content.getBytes();
 //        return contentBytes;

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=1558837&r1=1558836&r2=1558837&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
Thu Jan 16 15:38:00 2014
@@ -273,6 +273,8 @@ create table Orchestrator_Data
         status varchar(255),
         state varchar(255),
         gfacEPR varchar(255),
+        applicationName varchar(255),
+        jobRequest CLOB,
         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=1558837&r1=1558836&r2=1558837&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
Thu Jan 16 15:38:00 2014
@@ -270,6 +270,8 @@ create table Orchestrator_Data
         status varchar(255),
         state varchar(255),
         gfacEPR varchar(255),
+        applicationName varchar(255),
+        jobRequest LONGTEXT,
         PRIMARY KEY (experiment_ID)
 );
 

Modified: airavata/trunk/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/OrchestratorDataResourceTest.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/OrchestratorDataResourceTest.java?rev=1558837&r1=1558836&r2=1558837&view=diff
==============================================================================
--- airavata/trunk/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/OrchestratorDataResourceTest.java
(original)
+++ airavata/trunk/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/OrchestratorDataResourceTest.java
Thu Jan 16 15:38:00 2014
@@ -9,6 +9,7 @@ import org.apache.airavata.persistance.r
 public class OrchestratorDataResourceTest extends AbstractResourceTest{
 	 private OrchestratorDataResource dataResource;
 	 private String experimentID = UUID.randomUUID().toString();
+	 private String applicationName = "echo_test";
 	
 	 @Override
 	    public void setUp() throws Exception {
@@ -21,14 +22,13 @@ public class OrchestratorDataResourceTes
 	    public void testSave() throws Exception {
 	        dataResource.setExperimentID(experimentID);
 	        dataResource.setStatus(AiravataJobState.State.CREATED.toString());
+	        dataResource.setApplicationName(applicationName);
 	        dataResource.save();
 	        assertNotNull("Orchestrator data resource created successfully", dataResource);
+	        // Get saved data
+	        assertNotNull("Orchestrator data resource get successfully", dataResource.get(ResourceType.ORCHESTRATOR_DATA,
experimentID));
 	    }
 
-	    public void testGet() throws Exception {
-//	        dataResource.get(ResourceType.ORCHESTRATOR_DATA, experimentID);
-//	        assertNotNull("Orchestrator data resource created successfully", dataResource);
-	    }
 	    @Override
 	    public void tearDown() throws Exception {
 	        super.tearDown();

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=1558837&r1=1558836&r2=1558837&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
Thu Jan 16 15:38:00 2014
@@ -274,6 +274,8 @@ create table Orchestrator_Data
         status varchar(255),
         state varchar(255),
         gfacEPR varchar(255),
+        applicationName varchar(255),
+        jobRequest CLOB,
         PRIMARY KEY (experiment_ID)
 );
 -- CREATE TABLE openjpa_sequence_table

Modified: airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/OrchestratorRegistry.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/OrchestratorRegistry.java?rev=1558837&r1=1558836&r2=1558837&view=diff
==============================================================================
--- airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/OrchestratorRegistry.java
(original)
+++ airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/OrchestratorRegistry.java
Thu Jan 16 15:38:00 2014
@@ -54,7 +54,7 @@ public interface OrchestratorRegistry ex
      * @return
      * @throws RegistryException
      */
-    boolean storeExperiment(String userName,String experimentID, String orchestratorID)throws
RegistryException;
+    boolean storeExperiment(String userName,String experimentID, String applicationName,
String jobRequest)throws RegistryException;
 
     /**
      * This can be used to change the status to any valid status

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=1558837&r1=1558836&r2=1558837&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
Thu Jan 16 15:38:00 2014
@@ -30,6 +30,10 @@ public interface OrchestratorData {
 	public String getUser();
 
 	/**
+	 * Returns application name to execute
+	 */
+	public String getApplicationName();
+	/**
 	 * Returns GFAC service URL
 	 * 
 	 * @return
@@ -80,6 +84,11 @@ public interface OrchestratorData {
 	 */
 	public void setStatus(String status);
 
+	/**
+	 * 
+	 * @param applicationName
+	 */
+	public void setApplicationName(String applicationName);
 
 	
 }

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=1558837&r1=1558836&r2=1558837&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
Thu Jan 16 15:38:00 2014
@@ -16,6 +16,7 @@ public class OrchestratorDataImpl implem
 	private String status;
 	private String state;
 	private String gfacEPR;
+	private String applicationName;
 	private boolean lazyLoaded=false;
 
     public OrchestratorDataImpl() {
@@ -80,5 +81,13 @@ public class OrchestratorDataImpl implem
 	public void setStatus(String status) {
 		this.status = status;
 	}
+	@Override
+	public String getApplicationName() {
+		return applicationName;
+	}
+	@Override
+	public void setApplicationName(String applicationName) {
+		this.applicationName = applicationName;
+	}
 
 }

Modified: airavata/trunk/modules/rest/client/src/main/java/org/apache/airavata/rest/client/RegistryClient.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/rest/client/src/main/java/org/apache/airavata/rest/client/RegistryClient.java?rev=1558837&r1=1558836&r2=1558837&view=diff
==============================================================================
--- airavata/trunk/modules/rest/client/src/main/java/org/apache/airavata/rest/client/RegistryClient.java
(original)
+++ airavata/trunk/modules/rest/client/src/main/java/org/apache/airavata/rest/client/RegistryClient.java
Thu Jan 16 15:38:00 2014
@@ -1057,7 +1057,7 @@ public class RegistryClient extends Aira
 
 	@Override
 	public boolean storeExperiment(String userName, String experimentID,
-			String orchestratorID) throws RegistryException {
+			String applicationName, String jobRequest) throws RegistryException {
 		// TODO Auto-generated method stub
 		return false;
 	}

Modified: airavata/trunk/pom.xml
URL: http://svn.apache.org/viewvc/airavata/trunk/pom.xml?rev=1558837&r1=1558836&r2=1558837&view=diff
==============================================================================
--- airavata/trunk/pom.xml (original)
+++ airavata/trunk/pom.xml Thu Jan 16 15:38:00 2014
@@ -446,6 +446,7 @@
                 <module>modules/credential-store</module>
                 <module>modules/rest</module>
                 <module>modules/thrift</module>
+                <module>modules/orchestrator</module>
                 <module>tools</module>
                 <module>samples</module>
                 <module>modules/server</module>



Mime
View raw message