airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shame...@apache.org
Subject [46/53] [abbrv] airavata git commit: sorting job list based on time
Date Thu, 07 Jul 2016 19:30:32 GMT
sorting job list based on time


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

Branch: refs/heads/master
Commit: c382ae2ab059240d48938664794498d78999056b
Parents: b9b43b6
Author: scnakandala <supun.nakandala@gmail.com>
Authored: Tue Jul 5 16:56:28 2016 -0400
Committer: scnakandala <supun.nakandala@gmail.com>
Committed: Tue Jul 5 16:56:28 2016 -0400

----------------------------------------------------------------------
 .../api/server/handler/AiravataServerHandler.java        | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/c382ae2a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
index a274641..1a7ee72 100644
--- a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
+++ b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
@@ -80,10 +80,7 @@ import org.apache.thrift.TException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 public class AiravataServerHandler implements Airavata.Iface {
     private static final Logger logger = LoggerFactory.getLogger(AiravataServerHandler.class);
@@ -1259,6 +1256,12 @@ public class AiravataServerHandler implements Airavata.Iface {
                             List<JobModel> jobList  = new ArrayList<JobModel>();
                             if(jobObjects != null){
                                 jobObjects.stream().forEach(j -> jobList.add((JobModel)j));
+                                Collections.sort(jobList, new Comparator<JobModel>()
{
+                                    @Override
+                                    public int compare(JobModel o1, JobModel o2) {
+                                        return (int) (o1.getCreationTime() - o2.getCreationTime());
+                                    }
+                                });
                                 t.setJobs(jobList);
                             }
                         } catch (RegistryException e) {


Mime
View raw message