airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From samin...@apache.org
Subject svn commit: r1488309 - in /airavata/trunk/modules: airavata-client/src/main/java/org/apache/airavata/client/api/ airavata-client/src/main/java/org/apache/airavata/client/impl/ airavata-client/src/main/resources/ registry/airavata-jpa-registry/src/main/...
Date Fri, 31 May 2013 16:55:55 GMT
Author: samindaw
Date: Fri May 31 16:55:55 2013
New Revision: 1488309

URL: http://svn.apache.org/r1488309
Log:
renaming completedTime to statusUpdateTime

Modified:
    airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/ProvenanceManager.java
    airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/ProvenanceManagerImpl.java
    airavata/trunk/modules/airavata-client/src/main/resources/airavata-client.properties
    airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java
    airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/ProvenanceRegistry.java
    airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/ApplicationJob.java
    airavata/trunk/modules/rest/client/src/main/java/org/apache/airavata/rest/client/ProvenanceResourceClient.java
    airavata/trunk/modules/rest/client/src/main/java/org/apache/airavata/rest/client/RegistryClient.java
    airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/ProvenanceRegistryResource.java

Modified: airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/ProvenanceManager.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/ProvenanceManager.java?rev=1488309&r1=1488308&r2=1488309&view=diff
==============================================================================
--- airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/ProvenanceManager.java
(original)
+++ airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/ProvenanceManager.java
Fri May 31 16:55:55 2013
@@ -393,9 +393,10 @@ public interface ProvenanceManager {
       * Update the status of the job
       * @param jobId
       * @param status
+      * @param statusUpdateTime
       * @throws AiravataAPIInvocationException
       */
-     public void updateApplicationJobStatus(String jobId, ApplicationJobStatus status) throws
AiravataAPIInvocationException;
+     public void updateApplicationJobStatus(String jobId, ApplicationJobStatus status, Date
statusUpdateTime) throws AiravataAPIInvocationException;
      
      /**
       * Update the job data. GFacProvider implementation should decide the job data. Typically
it'll 
@@ -415,12 +416,12 @@ public interface ProvenanceManager {
      public void updateApplicationJobSubmittedTime(String jobId, Date submitted) throws AiravataAPIInvocationException;
      
      /**
-      * Update the time of job finished executing.
+      * Update the time of current job status is valid.
       * @param jobId
-      * @param completed
+      * @param statusUpdateTime
       * @throws AiravataAPIInvocationException
       */
-     public void updateApplicationJobCompletedTime(String jobId, Date completed) throws AiravataAPIInvocationException;
+     public void updateApplicationJobStatusUpdateTime(String jobId, Date statusUpdateTime)
throws AiravataAPIInvocationException;
      
      /**
       * Custom data field for users

Modified: airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/ProvenanceManagerImpl.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/ProvenanceManagerImpl.java?rev=1488309&r1=1488308&r2=1488309&view=diff
==============================================================================
--- airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/ProvenanceManagerImpl.java
(original)
+++ airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/ProvenanceManagerImpl.java
Fri May 31 16:55:55 2013
@@ -521,10 +521,10 @@ public class ProvenanceManagerImpl imple
 	}
 
 	@Override
-	public void updateApplicationJobStatus(String gfacJobId, ApplicationJobStatus status)
+	public void updateApplicationJobStatus(String gfacJobId, ApplicationJobStatus status, Date
statusUpdateTime)
 			throws AiravataAPIInvocationException {
 		try {
-			client.getRegistryClient().updateApplicationJobStatus(gfacJobId, status);
+			client.getRegistryClient().updateApplicationJobStatus(gfacJobId, status, statusUpdateTime);
 		} catch (Exception e) {
 			throw new AiravataAPIInvocationException(e);
 		}
@@ -551,10 +551,10 @@ public class ProvenanceManagerImpl imple
 	}
 
 	@Override
-	public void updateApplicationJobCompletedTime(String gfacJobId, Date completed)
+	public void updateApplicationJobStatusUpdateTime(String gfacJobId, Date completed)
 			throws AiravataAPIInvocationException {
 		try {
-			client.getRegistryClient().updateApplicationJobCompletedTime(gfacJobId, completed);
+			client.getRegistryClient().updateApplicationJobStatusUpdateTime(gfacJobId, completed);
 		} catch (Exception e) {
 			throw new AiravataAPIInvocationException(e);
 		}

Modified: airavata/trunk/modules/airavata-client/src/main/resources/airavata-client.properties
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/airavata-client/src/main/resources/airavata-client.properties?rev=1488309&r1=1488308&r2=1488309&view=diff
==============================================================================
--- airavata/trunk/modules/airavata-client/src/main/resources/airavata-client.properties (original)
+++ airavata/trunk/modules/airavata-client/src/main/resources/airavata-client.properties Fri
May 31 16:55:55 2013
@@ -32,6 +32,7 @@ class.registry.accessor=org.apache.airav
 
 ###---------------------REGISTRY API IMPLEMENTATION - CUSTOM SETTINGS----------------------###
 
+########################Registry JPA Implementation Settings########################
 #for mysql [AiravataJPARegistry]
 #registry.jdbc.driver=com.mysql.jdbc.Driver
 #registry.jdbc.url=jdbc:mysql://localhost:3306/persistent_data
@@ -42,20 +43,14 @@ registry.jdbc.url=jdbc:derby://localhost
 registry.jdbc.user=airavata
 registry.jdbc.password=airavata
 start.derby.server.mode=true
+
+
 validationQuery=SELECT 1
 defauly.registry.user=admin
 default.registry.password=admin
 default.registry.password.hash.method=SHA
 default.registry.gateway=default
 
-#for xbaya
-xbaya.registry.user=admin
-xbaya.registry.url=http://localhost:8080/airavata-registry/api
-xbaya.default.gateway=default
-
-trust.store=aiaravata.jks
-trust.store.password=airavata
-
 #user defined registry accessor classes
 #class.provenance.registry.accessor=org.apache.airavata.persistance.registry.jpa.impl.AiravataJPARegistry
 #class.configuration.registry.accessor=org.apache.airavata.persistance.registry.jpa.impl.AiravataJPARegistry
@@ -63,3 +58,16 @@ trust.store.password=airavata
 #class.project.registry.accessor=org.apache.airavata.persistance.registry.jpa.impl.AiravataJPARegistry
 #class.user.workflow.registry.accessor=org.apache.airavata.persistance.registry.jpa.impl.AiravataJPARegistry
 #class.published.workflow.registry.accessor=org.apache.airavata.persistance.registry.jpa.impl.AiravataJPARegistry
+
+########################Registry Rest Implementation Settings########################
+
+trust.store=aiaravata.jks
+trust.store.password=airavata
+
+#####################################################################################
+
+#for xbaya
+xbaya.registry.user=admin
+xbaya.registry.url=http://localhost:8080/airavata-registry/api
+xbaya.default.gateway=default
+

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=1488309&r1=1488308&r2=1488309&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
Fri May 31 16:55:55 2013
@@ -2268,7 +2268,7 @@ public class AiravataJPARegistry extends
 
 	private void setupValues(ApplicationJob job, GFacJobDataResource gfacJob) {
 		gfacJob.setApplicationDescID(job.getApplicationDescriptionId());
-		gfacJob.setCompletedTime(new Timestamp(job.getCompletedTime().getTime()));
+		gfacJob.setCompletedTime(new Timestamp(job.getStatusUpdateTime().getTime()));
 		gfacJob.setHostDescID(job.getHostDescriptionId());
 		gfacJob.setJobData(job.getJobData());
 		gfacJob.setMetadata(job.getMetadata());
@@ -2298,10 +2298,11 @@ public class AiravataJPARegistry extends
 	}
 
 	@Override
-	public void updateApplicationJobStatus(String gfacJobId, ApplicationJobStatus status)
+	public void updateApplicationJobStatus(String gfacJobId, ApplicationJobStatus status, Date
statusUpdateTime)
 			throws RegistryException {
 		GFacJobDataResource gFacJob = validateAndGetGFacJob(gfacJobId);
 		gFacJob.setStatus(status.toString());
+		gFacJob.setCompletedTime(new Timestamp(statusUpdateTime.getTime()));
 		gFacJob.save();
 	}
 
@@ -2322,7 +2323,7 @@ public class AiravataJPARegistry extends
 	}
 
 	@Override
-	public void updateApplicationJobCompletedTime(String gfacJobId, Date completed)
+	public void updateApplicationJobStatusUpdateTime(String gfacJobId, Date completed)
 			throws RegistryException {
 		GFacJobDataResource gFacJob = validateAndGetGFacJob(gfacJobId);
 		gFacJob.setCompletedTime(new Timestamp(completed.getTime()));
@@ -2347,7 +2348,7 @@ public class AiravataJPARegistry extends
 
 	private void setupValues(GFacJobDataResource gfacJob, ApplicationJob job) {
 		job.setApplicationDescriptionId(gfacJob.getApplicationDescID());
-		job.setCompletedTime(gfacJob.getCompletedTime());
+		job.setStatusUpdateTime(gfacJob.getCompletedTime());
 		job.setExperimentId(gfacJob.getExperimentDataResource().getExperimentID());
 		job.setHostDescriptionId(gfacJob.getHostDescID());
 		job.setJobData(gfacJob.getJobData());

Modified: airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/ProvenanceRegistry.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/ProvenanceRegistry.java?rev=1488309&r1=1488308&r2=1488309&view=diff
==============================================================================
--- airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/ProvenanceRegistry.java
(original)
+++ airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/ProvenanceRegistry.java
Fri May 31 16:55:55 2013
@@ -449,9 +449,10 @@ public interface ProvenanceRegistry exte
      * Update the status of the job
      * @param jobId
      * @param status
+     * @param statusUpdateTime
      * @throws RegistryException
      */
-    public void updateApplicationJobStatus(String jobId, ApplicationJobStatus status) throws
RegistryException;
+    public void updateApplicationJobStatus(String jobId, ApplicationJobStatus status, Date
statusUpdateTime) throws RegistryException;
     
     /**
      * Update the job data. GFacProvider implementation should decide the job data. Typically
it'll 
@@ -471,12 +472,12 @@ public interface ProvenanceRegistry exte
     public void updateApplicationJobSubmittedTime(String jobId, Date submitted) throws RegistryException;
     
     /**
-     * Update the time of job finished executing.
+     * Update the time of current job status is valid.
      * @param jobId
-     * @param completed
+     * @param statusUpdateTime
      * @throws RegistryException
      */
-    public void updateApplicationJobCompletedTime(String jobId, Date completed) throws RegistryException;
+    public void updateApplicationJobStatusUpdateTime(String jobId, Date statusUpdateTime)
throws RegistryException;
     
     /**
      * Custom data field for users

Modified: airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/ApplicationJob.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/ApplicationJob.java?rev=1488309&r1=1488308&r2=1488309&view=diff
==============================================================================
--- airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/ApplicationJob.java
(original)
+++ airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/ApplicationJob.java
Fri May 31 16:55:55 2013
@@ -31,12 +31,15 @@ import java.util.Date;
 public class ApplicationJob {
 	public static enum ApplicationJobStatus{
 		SUBMITTED, //job is submitted, possibly waiting to start executing
+		INITIALIZE, //job is being initialized 
+		PENDING, //job is pending to be started
 		EXECUTING, //submitted job is being executed
-		CANCELLED, //job was cancelled
 		PAUSED, //job was paused
 		WAITING_FOR_DATA, // job is waiting for data to continue executing
-		FAILED, // error occurred while job was executing and the job stopped
+		FINALIZE, //job is being initialized 
 		FINISHED, // job completed successfully
+		FAILED, // error occurred while job was executing and the job stopped
+		CANCELLED, //job was cancelled
 		UNKNOWN // unknown status. lookup the metadata for more details.
 	}
 	
@@ -52,7 +55,7 @@ public class ApplicationJob {
 	private String jobData;
 	
 	private Date submittedTime;
-	private Date completedTime;
+	private Date statusUpdateTime;
 	private ApplicationJobStatus jobStatus;
 	
 	private String metadata;
@@ -129,12 +132,12 @@ public class ApplicationJob {
 		this.submittedTime = submittedTime;
 	}
 
-	public Date getCompletedTime() {
-		return completedTime;
+	public Date getStatusUpdateTime() {
+		return statusUpdateTime;
 	}
 
-	public void setCompletedTime(Date completedTime) {
-		this.completedTime = completedTime;
+	public void setStatusUpdateTime(Date statusUpdateTime) {
+		this.statusUpdateTime = statusUpdateTime;
 	}
 
 	public ApplicationJobStatus getJobStatus() {

Modified: airavata/trunk/modules/rest/client/src/main/java/org/apache/airavata/rest/client/ProvenanceResourceClient.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/rest/client/src/main/java/org/apache/airavata/rest/client/ProvenanceResourceClient.java?rev=1488309&r1=1488308&r2=1488309&view=diff
==============================================================================
--- airavata/trunk/modules/rest/client/src/main/java/org/apache/airavata/rest/client/ProvenanceResourceClient.java
(original)
+++ airavata/trunk/modules/rest/client/src/main/java/org/apache/airavata/rest/client/ProvenanceResourceClient.java
Fri May 31 16:55:55 2013
@@ -2343,12 +2343,15 @@ public class ProvenanceResourceClient {
         }
     }
 
-    public void updateGFacJobStatus(String gfacJobId, ApplicationJob.ApplicationJobStatus
status) {
+    public void updateGFacJobStatus(String gfacJobId, ApplicationJob.ApplicationJobStatus
status, Date statusUpdateTime) {
         webResource = getProvenanceRegistryBaseResource().path(
                 ResourcePathConstants.ProvenanceResourcePathConstants.UPDATE_GFAC_JOB_STATUS);
+        DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        String submittedDate = dateFormat.format(statusUpdateTime);
         MultivaluedMap formParams = new MultivaluedMapImpl();
         formParams.add("gfacJobID", gfacJobId);
         formParams.add("gfacJobStatus", status.toString());
+        formParams.add("statusUpdateDate", submittedDate);
         builder = BasicAuthHeaderUtil.getBuilder(
                 webResource, null, userName, null, cookie, gateway);
         ClientResponse response = builder.accept(

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=1488309&r1=1488308&r2=1488309&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
Fri May 31 16:55:55 2013
@@ -914,9 +914,9 @@ public class RegistryClient extends Aira
 	}
 
 	@Override
-	public void updateApplicationJobStatus(String gfacJobId, ApplicationJobStatus status)
+	public void updateApplicationJobStatus(String gfacJobId, ApplicationJobStatus status, Date
statusUpdateTime)
 			throws RegistryException {
-        getProvenanceResourceClient().updateGFacJobStatus(gfacJobId, status);
+        getProvenanceResourceClient().updateGFacJobStatus(gfacJobId, status, statusUpdateTime);
 		
 	}
 
@@ -935,7 +935,7 @@ public class RegistryClient extends Aira
 	}
 
 	@Override
-	public void updateApplicationJobCompletedTime(String gfacJobId, Date completed)
+	public void updateApplicationJobStatusUpdateTime(String gfacJobId, Date completed)
 			throws RegistryException {
         getProvenanceResourceClient().updateGFacJobCompletedTime(gfacJobId, completed);
 		

Modified: airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/ProvenanceRegistryResource.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/ProvenanceRegistryResource.java?rev=1488309&r1=1488308&r2=1488309&view=diff
==============================================================================
--- airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/ProvenanceRegistryResource.java
(original)
+++ airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/ProvenanceRegistryResource.java
Fri May 31 16:55:55 2013
@@ -1664,11 +1664,14 @@ public class ProvenanceRegistryResource 
     @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
     @Produces(MediaType.TEXT_PLAIN)
     public Response updateGFacJobStatus(@FormParam("gfacJobID") String gfacJobID,
-                                        @FormParam("gfacJobStatus") String gfacJobStatus
) {
+                                        @FormParam("gfacJobStatus") String gfacJobStatus,
+                                        @FormParam("statusUpdateDate") String statusUpdatedDate
) {
         AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
         try {
             ApplicationJob.ApplicationJobStatus status = ApplicationJob.ApplicationJobStatus.valueOf(gfacJobStatus);
-            airavataRegistry.updateApplicationJobStatus(gfacJobID, status);
+            DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            Date formattedDate = dateFormat.parse(statusUpdatedDate);
+            airavataRegistry.updateApplicationJobStatus(gfacJobID, status, formattedDate);
             Response.ResponseBuilder builder = Response.status(Response.Status.OK);
             builder.entity("GFac Job status updated successfully");
             return builder.build();
@@ -1735,7 +1738,7 @@ public class ProvenanceRegistryResource 
         try {
             DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
             Date formattedDate = dateFormat.parse(completedDate);
-            airavataRegistry.updateApplicationJobCompletedTime(gfacJobID, formattedDate);
+            airavataRegistry.updateApplicationJobStatusUpdateTime(gfacJobID, formattedDate);
             Response.ResponseBuilder builder = Response.status(Response.Status.OK);
             builder.entity("GFac Job data completed date updated successfully");
             return builder.build();



Mime
View raw message