airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scnakand...@apache.org
Subject [2/3] airavata git commit: making errors and statuses list in Process and Task models
Date Mon, 29 Aug 2016 20:06:15 GMT
http://git-wip-us.apache.org/repos/asf/airavata/blob/b46fd511/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/task/TaskModel.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/task/TaskModel.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/task/TaskModel.java
index 3d6450f..5ebdacf 100644
--- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/task/TaskModel.java
+++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/task/TaskModel.java
@@ -23,32 +23,16 @@
  */
 package org.apache.airavata.model.task;
 
+import org.apache.thrift.EncodingUtils;
+import org.apache.thrift.protocol.TTupleProtocol;
 import org.apache.thrift.scheme.IScheme;
 import org.apache.thrift.scheme.SchemeFactory;
 import org.apache.thrift.scheme.StandardScheme;
-
 import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
+
 import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import java.nio.ByteBuffer;
+import java.util.*;
 
 @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
 /**
@@ -69,10 +53,10 @@ public class TaskModel implements org.apache.thrift.TBase<TaskModel, TaskModel._
   private static final org.apache.thrift.protocol.TField PARENT_PROCESS_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("parentProcessId", org.apache.thrift.protocol.TType.STRING, (short)3);
   private static final org.apache.thrift.protocol.TField CREATION_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("creationTime", org.apache.thrift.protocol.TType.I64, (short)4);
   private static final org.apache.thrift.protocol.TField LAST_UPDATE_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("lastUpdateTime", org.apache.thrift.protocol.TType.I64, (short)5);
-  private static final org.apache.thrift.protocol.TField TASK_STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("taskStatus", org.apache.thrift.protocol.TType.STRUCT, (short)6);
+  private static final org.apache.thrift.protocol.TField TASK_STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("taskStatuses", org.apache.thrift.protocol.TType.LIST, (short)6);
   private static final org.apache.thrift.protocol.TField TASK_DETAIL_FIELD_DESC = new org.apache.thrift.protocol.TField("taskDetail", org.apache.thrift.protocol.TType.STRING, (short)7);
   private static final org.apache.thrift.protocol.TField SUB_TASK_MODEL_FIELD_DESC = new org.apache.thrift.protocol.TField("subTaskModel", org.apache.thrift.protocol.TType.STRING, (short)8);
-  private static final org.apache.thrift.protocol.TField TASK_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("taskError", org.apache.thrift.protocol.TType.STRUCT, (short)9);
+  private static final org.apache.thrift.protocol.TField TASK_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("taskErrors", org.apache.thrift.protocol.TType.LIST, (short)9);
   private static final org.apache.thrift.protocol.TField JOBS_FIELD_DESC = new org.apache.thrift.protocol.TField("jobs", org.apache.thrift.protocol.TType.LIST, (short)10);
 
   private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
@@ -86,10 +70,10 @@ public class TaskModel implements org.apache.thrift.TBase<TaskModel, TaskModel._
   private String parentProcessId; // required
   private long creationTime; // required
   private long lastUpdateTime; // required
-  private org.apache.airavata.model.status.TaskStatus taskStatus; // required
+  private List<org.apache.airavata.model.status.TaskStatus> taskStatuses; // required
   private String taskDetail; // optional
   private ByteBuffer subTaskModel; // optional
-  private org.apache.airavata.model.commons.ErrorModel taskError; // optional
+  private List<org.apache.airavata.model.commons.ErrorModel> taskErrors; // optional
   private List<org.apache.airavata.model.job.JobModel> jobs; // optional
 
   /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
@@ -103,10 +87,10 @@ public class TaskModel implements org.apache.thrift.TBase<TaskModel, TaskModel._
     PARENT_PROCESS_ID((short)3, "parentProcessId"),
     CREATION_TIME((short)4, "creationTime"),
     LAST_UPDATE_TIME((short)5, "lastUpdateTime"),
-    TASK_STATUS((short)6, "taskStatus"),
+    TASK_STATUS((short)6, "taskStatuses"),
     TASK_DETAIL((short)7, "taskDetail"),
     SUB_TASK_MODEL((short)8, "subTaskModel"),
-    TASK_ERROR((short)9, "taskError"),
+    TASK_ERROR((short)9, "taskErrors"),
     JOBS((short)10, "jobs");
 
     private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
@@ -199,14 +183,16 @@ public class TaskModel implements org.apache.thrift.TBase<TaskModel, TaskModel._
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
     tmpMap.put(_Fields.LAST_UPDATE_TIME, new org.apache.thrift.meta_data.FieldMetaData("lastUpdateTime", org.apache.thrift.TFieldRequirementType.REQUIRED, 
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
-    tmpMap.put(_Fields.TASK_STATUS, new org.apache.thrift.meta_data.FieldMetaData("taskStatus", org.apache.thrift.TFieldRequirementType.REQUIRED, 
-        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.airavata.model.status.TaskStatus.class)));
+    tmpMap.put(_Fields.TASK_STATUS, new org.apache.thrift.meta_data.FieldMetaData("taskStatuses", org.apache.thrift.TFieldRequirementType.REQUIRED,
+        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
+            new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.airavata.model.status.TaskStatus.class))));
     tmpMap.put(_Fields.TASK_DETAIL, new org.apache.thrift.meta_data.FieldMetaData("taskDetail", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
     tmpMap.put(_Fields.SUB_TASK_MODEL, new org.apache.thrift.meta_data.FieldMetaData("subTaskModel", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING        , true)));
-    tmpMap.put(_Fields.TASK_ERROR, new org.apache.thrift.meta_data.FieldMetaData("taskError", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.airavata.model.commons.ErrorModel.class)));
+    tmpMap.put(_Fields.TASK_ERROR, new org.apache.thrift.meta_data.FieldMetaData("taskErrors", org.apache.thrift.TFieldRequirementType.OPTIONAL,
+        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
+            new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.airavata.model.commons.ErrorModel.class))));
     tmpMap.put(_Fields.JOBS, new org.apache.thrift.meta_data.FieldMetaData("jobs", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
             new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.airavata.model.job.JobModel.class))));
@@ -225,7 +211,7 @@ public class TaskModel implements org.apache.thrift.TBase<TaskModel, TaskModel._
     String parentProcessId,
     long creationTime,
     long lastUpdateTime,
-    org.apache.airavata.model.status.TaskStatus taskStatus)
+    List<org.apache.airavata.model.status.TaskStatus> taskStatus)
   {
     this();
     this.taskId = taskId;
@@ -235,7 +221,7 @@ public class TaskModel implements org.apache.thrift.TBase<TaskModel, TaskModel._
     setCreationTimeIsSet(true);
     this.lastUpdateTime = lastUpdateTime;
     setLastUpdateTimeIsSet(true);
-    this.taskStatus = taskStatus;
+    this.taskStatuses = taskStatus;
   }
 
   /**
@@ -255,7 +241,11 @@ public class TaskModel implements org.apache.thrift.TBase<TaskModel, TaskModel._
     this.creationTime = other.creationTime;
     this.lastUpdateTime = other.lastUpdateTime;
     if (other.isSetTaskStatus()) {
-      this.taskStatus = new org.apache.airavata.model.status.TaskStatus(other.taskStatus);
+      List<org.apache.airavata.model.status.TaskStatus> __this__taskStatus = new ArrayList<org.apache.airavata.model.status.TaskStatus>(other.taskStatuses.size());
+      for (org.apache.airavata.model.status.TaskStatus other_element : other.taskStatuses) {
+        __this__taskStatus.add(new org.apache.airavata.model.status.TaskStatus(other_element));
+      }
+      this.taskStatuses = __this__taskStatus;
     }
     if (other.isSetTaskDetail()) {
       this.taskDetail = other.taskDetail;
@@ -264,7 +254,11 @@ public class TaskModel implements org.apache.thrift.TBase<TaskModel, TaskModel._
       this.subTaskModel = org.apache.thrift.TBaseHelper.copyBinary(other.subTaskModel);
     }
     if (other.isSetTaskError()) {
-      this.taskError = new org.apache.airavata.model.commons.ErrorModel(other.taskError);
+      List<org.apache.airavata.model.commons.ErrorModel> __this__taskError = new ArrayList<org.apache.airavata.model.commons.ErrorModel>(other.taskErrors.size());
+      for (org.apache.airavata.model.commons.ErrorModel other_element : other.taskErrors) {
+        __this__taskError.add(new org.apache.airavata.model.commons.ErrorModel(other_element));
+      }
+      this.taskErrors = __this__taskError;
     }
     if (other.isSetJobs()) {
       List<org.apache.airavata.model.job.JobModel> __this__jobs = new ArrayList<org.apache.airavata.model.job.JobModel>(other.jobs.size());
@@ -289,10 +283,10 @@ public class TaskModel implements org.apache.thrift.TBase<TaskModel, TaskModel._
     this.creationTime = 0;
     setLastUpdateTimeIsSet(false);
     this.lastUpdateTime = 0;
-    this.taskStatus = null;
+    this.taskStatuses = null;
     this.taskDetail = null;
     this.subTaskModel = null;
-    this.taskError = null;
+    this.taskErrors = null;
     this.jobs = null;
   }
 
@@ -417,26 +411,41 @@ public class TaskModel implements org.apache.thrift.TBase<TaskModel, TaskModel._
     __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __LASTUPDATETIME_ISSET_ID, value);
   }
 
-  public org.apache.airavata.model.status.TaskStatus getTaskStatus() {
-    return this.taskStatus;
+  public int getTaskStatusSize() {
+    return (this.taskStatuses == null) ? 0 : this.taskStatuses.size();
+  }
+
+  public java.util.Iterator<org.apache.airavata.model.status.TaskStatus> getTaskStatusIterator() {
+    return (this.taskStatuses == null) ? null : this.taskStatuses.iterator();
+  }
+
+  public void addToTaskStatus(org.apache.airavata.model.status.TaskStatus elem) {
+    if (this.taskStatuses == null) {
+      this.taskStatuses = new ArrayList<org.apache.airavata.model.status.TaskStatus>();
+    }
+    this.taskStatuses.add(elem);
+  }
+
+  public List<org.apache.airavata.model.status.TaskStatus> getTaskStatuses() {
+    return this.taskStatuses;
   }
 
-  public void setTaskStatus(org.apache.airavata.model.status.TaskStatus taskStatus) {
-    this.taskStatus = taskStatus;
+  public void setTaskStatuses(List<org.apache.airavata.model.status.TaskStatus> taskStatuses) {
+    this.taskStatuses = taskStatuses;
   }
 
   public void unsetTaskStatus() {
-    this.taskStatus = null;
+    this.taskStatuses = null;
   }
 
-  /** Returns true if field taskStatus is set (has been assigned a value) and false otherwise */
+  /** Returns true if field taskStatuses is set (has been assigned a value) and false otherwise */
   public boolean isSetTaskStatus() {
-    return this.taskStatus != null;
+    return this.taskStatuses != null;
   }
 
   public void setTaskStatusIsSet(boolean value) {
     if (!value) {
-      this.taskStatus = null;
+      this.taskStatuses = null;
     }
   }
 
@@ -495,26 +504,41 @@ public class TaskModel implements org.apache.thrift.TBase<TaskModel, TaskModel._
     }
   }
 
-  public org.apache.airavata.model.commons.ErrorModel getTaskError() {
-    return this.taskError;
+  public int getTaskErrorSize() {
+    return (this.taskErrors == null) ? 0 : this.taskErrors.size();
   }
 
-  public void setTaskError(org.apache.airavata.model.commons.ErrorModel taskError) {
-    this.taskError = taskError;
+  public java.util.Iterator<org.apache.airavata.model.commons.ErrorModel> getTaskErrorIterator() {
+    return (this.taskErrors == null) ? null : this.taskErrors.iterator();
+  }
+
+  public void addToTaskError(org.apache.airavata.model.commons.ErrorModel elem) {
+    if (this.taskErrors == null) {
+      this.taskErrors = new ArrayList<org.apache.airavata.model.commons.ErrorModel>();
+    }
+    this.taskErrors.add(elem);
+  }
+
+  public List<org.apache.airavata.model.commons.ErrorModel> getTaskErrors() {
+    return this.taskErrors;
+  }
+
+  public void setTaskErrors(List<org.apache.airavata.model.commons.ErrorModel> taskErrors) {
+    this.taskErrors = taskErrors;
   }
 
   public void unsetTaskError() {
-    this.taskError = null;
+    this.taskErrors = null;
   }
 
-  /** Returns true if field taskError is set (has been assigned a value) and false otherwise */
+  /** Returns true if field taskErrors is set (has been assigned a value) and false otherwise */
   public boolean isSetTaskError() {
-    return this.taskError != null;
+    return this.taskErrors != null;
   }
 
   public void setTaskErrorIsSet(boolean value) {
     if (!value) {
-      this.taskError = null;
+      this.taskErrors = null;
     }
   }
 
@@ -602,7 +626,7 @@ public class TaskModel implements org.apache.thrift.TBase<TaskModel, TaskModel._
       if (value == null) {
         unsetTaskStatus();
       } else {
-        setTaskStatus((org.apache.airavata.model.status.TaskStatus)value);
+        setTaskStatuses((List<org.apache.airavata.model.status.TaskStatus>) value);
       }
       break;
 
@@ -626,7 +650,7 @@ public class TaskModel implements org.apache.thrift.TBase<TaskModel, TaskModel._
       if (value == null) {
         unsetTaskError();
       } else {
-        setTaskError((org.apache.airavata.model.commons.ErrorModel)value);
+        setTaskErrors((List<org.apache.airavata.model.commons.ErrorModel>) value);
       }
       break;
 
@@ -659,7 +683,7 @@ public class TaskModel implements org.apache.thrift.TBase<TaskModel, TaskModel._
       return getLastUpdateTime();
 
     case TASK_STATUS:
-      return getTaskStatus();
+      return getTaskStatuses();
 
     case TASK_DETAIL:
       return getTaskDetail();
@@ -668,7 +692,7 @@ public class TaskModel implements org.apache.thrift.TBase<TaskModel, TaskModel._
       return getSubTaskModel();
 
     case TASK_ERROR:
-      return getTaskError();
+      return getTaskErrors();
 
     case JOBS:
       return getJobs();
@@ -771,7 +795,7 @@ public class TaskModel implements org.apache.thrift.TBase<TaskModel, TaskModel._
     if (this_present_taskStatus || that_present_taskStatus) {
       if (!(this_present_taskStatus && that_present_taskStatus))
         return false;
-      if (!this.taskStatus.equals(that.taskStatus))
+      if (!this.taskStatuses.equals(that.taskStatuses))
         return false;
     }
 
@@ -798,7 +822,7 @@ public class TaskModel implements org.apache.thrift.TBase<TaskModel, TaskModel._
     if (this_present_taskError || that_present_taskError) {
       if (!(this_present_taskError && that_present_taskError))
         return false;
-      if (!this.taskError.equals(that.taskError))
+      if (!this.taskErrors.equals(that.taskErrors))
         return false;
     }
 
@@ -846,7 +870,7 @@ public class TaskModel implements org.apache.thrift.TBase<TaskModel, TaskModel._
     boolean present_taskStatus = true && (isSetTaskStatus());
     list.add(present_taskStatus);
     if (present_taskStatus)
-      list.add(taskStatus);
+      list.add(taskStatuses);
 
     boolean present_taskDetail = true && (isSetTaskDetail());
     list.add(present_taskDetail);
@@ -861,7 +885,7 @@ public class TaskModel implements org.apache.thrift.TBase<TaskModel, TaskModel._
     boolean present_taskError = true && (isSetTaskError());
     list.add(present_taskError);
     if (present_taskError)
-      list.add(taskError);
+      list.add(taskErrors);
 
     boolean present_jobs = true && (isSetJobs());
     list.add(present_jobs);
@@ -934,7 +958,7 @@ public class TaskModel implements org.apache.thrift.TBase<TaskModel, TaskModel._
       return lastComparison;
     }
     if (isSetTaskStatus()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.taskStatus, other.taskStatus);
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.taskStatuses, other.taskStatuses);
       if (lastComparison != 0) {
         return lastComparison;
       }
@@ -964,7 +988,7 @@ public class TaskModel implements org.apache.thrift.TBase<TaskModel, TaskModel._
       return lastComparison;
     }
     if (isSetTaskError()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.taskError, other.taskError);
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.taskErrors, other.taskErrors);
       if (lastComparison != 0) {
         return lastComparison;
       }
@@ -1031,11 +1055,11 @@ public class TaskModel implements org.apache.thrift.TBase<TaskModel, TaskModel._
     sb.append(this.lastUpdateTime);
     first = false;
     if (!first) sb.append(", ");
-    sb.append("taskStatus:");
-    if (this.taskStatus == null) {
+    sb.append("taskStatuses:");
+    if (this.taskStatuses == null) {
       sb.append("null");
     } else {
-      sb.append(this.taskStatus);
+      sb.append(this.taskStatuses);
     }
     first = false;
     if (isSetTaskDetail()) {
@@ -1060,11 +1084,11 @@ public class TaskModel implements org.apache.thrift.TBase<TaskModel, TaskModel._
     }
     if (isSetTaskError()) {
       if (!first) sb.append(", ");
-      sb.append("taskError:");
-      if (this.taskError == null) {
+      sb.append("taskErrors:");
+      if (this.taskErrors == null) {
         sb.append("null");
       } else {
-        sb.append(this.taskError);
+        sb.append(this.taskErrors);
       }
       first = false;
     }
@@ -1105,16 +1129,10 @@ public class TaskModel implements org.apache.thrift.TBase<TaskModel, TaskModel._
     }
 
     if (!isSetTaskStatus()) {
-      throw new org.apache.thrift.protocol.TProtocolException("Required field 'taskStatus' is unset! Struct:" + toString());
+      throw new org.apache.thrift.protocol.TProtocolException("Required field 'taskStatuses' is unset! Struct:" + toString());
     }
 
     // check for sub-struct validity
-    if (taskStatus != null) {
-      taskStatus.validate();
-    }
-    if (taskError != null) {
-      taskError.validate();
-    }
   }
 
   private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
@@ -1194,9 +1212,19 @@ public class TaskModel implements org.apache.thrift.TBase<TaskModel, TaskModel._
             }
             break;
           case 6: // TASK_STATUS
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
-              struct.taskStatus = new org.apache.airavata.model.status.TaskStatus();
-              struct.taskStatus.read(iprot);
+            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
+              {
+                org.apache.thrift.protocol.TList _list0 = iprot.readListBegin();
+                struct.taskStatuses = new ArrayList<org.apache.airavata.model.status.TaskStatus>(_list0.size);
+                org.apache.airavata.model.status.TaskStatus _elem1;
+                for (int _i2 = 0; _i2 < _list0.size; ++_i2)
+                {
+                  _elem1 = new org.apache.airavata.model.status.TaskStatus();
+                  _elem1.read(iprot);
+                  struct.taskStatuses.add(_elem1);
+                }
+                iprot.readListEnd();
+              }
               struct.setTaskStatusIsSet(true);
             } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
@@ -1219,9 +1247,19 @@ public class TaskModel implements org.apache.thrift.TBase<TaskModel, TaskModel._
             }
             break;
           case 9: // TASK_ERROR
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
-              struct.taskError = new org.apache.airavata.model.commons.ErrorModel();
-              struct.taskError.read(iprot);
+            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
+              {
+                org.apache.thrift.protocol.TList _list3 = iprot.readListBegin();
+                struct.taskErrors = new ArrayList<org.apache.airavata.model.commons.ErrorModel>(_list3.size);
+                org.apache.airavata.model.commons.ErrorModel _elem4;
+                for (int _i5 = 0; _i5 < _list3.size; ++_i5)
+                {
+                  _elem4 = new org.apache.airavata.model.commons.ErrorModel();
+                  _elem4.read(iprot);
+                  struct.taskErrors.add(_elem4);
+                }
+                iprot.readListEnd();
+              }
               struct.setTaskErrorIsSet(true);
             } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
@@ -1230,14 +1268,14 @@ public class TaskModel implements org.apache.thrift.TBase<TaskModel, TaskModel._
           case 10: // JOBS
             if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
               {
-                org.apache.thrift.protocol.TList _list0 = iprot.readListBegin();
-                struct.jobs = new ArrayList<org.apache.airavata.model.job.JobModel>(_list0.size);
-                org.apache.airavata.model.job.JobModel _elem1;
-                for (int _i2 = 0; _i2 < _list0.size; ++_i2)
+                org.apache.thrift.protocol.TList _list6 = iprot.readListBegin();
+                struct.jobs = new ArrayList<org.apache.airavata.model.job.JobModel>(_list6.size);
+                org.apache.airavata.model.job.JobModel _elem7;
+                for (int _i8 = 0; _i8 < _list6.size; ++_i8)
                 {
-                  _elem1 = new org.apache.airavata.model.job.JobModel();
-                  _elem1.read(iprot);
-                  struct.jobs.add(_elem1);
+                  _elem7 = new org.apache.airavata.model.job.JobModel();
+                  _elem7.read(iprot);
+                  struct.jobs.add(_elem7);
                 }
                 iprot.readListEnd();
               }
@@ -1280,9 +1318,16 @@ public class TaskModel implements org.apache.thrift.TBase<TaskModel, TaskModel._
       oprot.writeFieldBegin(LAST_UPDATE_TIME_FIELD_DESC);
       oprot.writeI64(struct.lastUpdateTime);
       oprot.writeFieldEnd();
-      if (struct.taskStatus != null) {
+      if (struct.taskStatuses != null) {
         oprot.writeFieldBegin(TASK_STATUS_FIELD_DESC);
-        struct.taskStatus.write(oprot);
+        {
+          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.taskStatuses.size()));
+          for (org.apache.airavata.model.status.TaskStatus _iter9 : struct.taskStatuses)
+          {
+            _iter9.write(oprot);
+          }
+          oprot.writeListEnd();
+        }
         oprot.writeFieldEnd();
       }
       if (struct.taskDetail != null) {
@@ -1299,10 +1344,17 @@ public class TaskModel implements org.apache.thrift.TBase<TaskModel, TaskModel._
           oprot.writeFieldEnd();
         }
       }
-      if (struct.taskError != null) {
+      if (struct.taskErrors != null) {
         if (struct.isSetTaskError()) {
           oprot.writeFieldBegin(TASK_ERROR_FIELD_DESC);
-          struct.taskError.write(oprot);
+          {
+            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.taskErrors.size()));
+            for (org.apache.airavata.model.commons.ErrorModel _iter10 : struct.taskErrors)
+            {
+              _iter10.write(oprot);
+            }
+            oprot.writeListEnd();
+          }
           oprot.writeFieldEnd();
         }
       }
@@ -1311,9 +1363,9 @@ public class TaskModel implements org.apache.thrift.TBase<TaskModel, TaskModel._
           oprot.writeFieldBegin(JOBS_FIELD_DESC);
           {
             oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.jobs.size()));
-            for (org.apache.airavata.model.job.JobModel _iter3 : struct.jobs)
+            for (org.apache.airavata.model.job.JobModel _iter11 : struct.jobs)
             {
-              _iter3.write(oprot);
+              _iter11.write(oprot);
             }
             oprot.writeListEnd();
           }
@@ -1342,7 +1394,13 @@ public class TaskModel implements org.apache.thrift.TBase<TaskModel, TaskModel._
       oprot.writeString(struct.parentProcessId);
       oprot.writeI64(struct.creationTime);
       oprot.writeI64(struct.lastUpdateTime);
-      struct.taskStatus.write(oprot);
+      {
+        oprot.writeI32(struct.taskStatuses.size());
+        for (org.apache.airavata.model.status.TaskStatus _iter12 : struct.taskStatuses)
+        {
+          _iter12.write(oprot);
+        }
+      }
       BitSet optionals = new BitSet();
       if (struct.isSetTaskDetail()) {
         optionals.set(0);
@@ -1364,14 +1422,20 @@ public class TaskModel implements org.apache.thrift.TBase<TaskModel, TaskModel._
         oprot.writeBinary(struct.subTaskModel);
       }
       if (struct.isSetTaskError()) {
-        struct.taskError.write(oprot);
+        {
+          oprot.writeI32(struct.taskErrors.size());
+          for (org.apache.airavata.model.commons.ErrorModel _iter13 : struct.taskErrors)
+          {
+            _iter13.write(oprot);
+          }
+        }
       }
       if (struct.isSetJobs()) {
         {
           oprot.writeI32(struct.jobs.size());
-          for (org.apache.airavata.model.job.JobModel _iter4 : struct.jobs)
+          for (org.apache.airavata.model.job.JobModel _iter14 : struct.jobs)
           {
-            _iter4.write(oprot);
+            _iter14.write(oprot);
           }
         }
       }
@@ -1390,8 +1454,17 @@ public class TaskModel implements org.apache.thrift.TBase<TaskModel, TaskModel._
       struct.setCreationTimeIsSet(true);
       struct.lastUpdateTime = iprot.readI64();
       struct.setLastUpdateTimeIsSet(true);
-      struct.taskStatus = new org.apache.airavata.model.status.TaskStatus();
-      struct.taskStatus.read(iprot);
+      {
+        org.apache.thrift.protocol.TList _list15 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
+        struct.taskStatuses = new ArrayList<org.apache.airavata.model.status.TaskStatus>(_list15.size);
+        org.apache.airavata.model.status.TaskStatus _elem16;
+        for (int _i17 = 0; _i17 < _list15.size; ++_i17)
+        {
+          _elem16 = new org.apache.airavata.model.status.TaskStatus();
+          _elem16.read(iprot);
+          struct.taskStatuses.add(_elem16);
+        }
+      }
       struct.setTaskStatusIsSet(true);
       BitSet incoming = iprot.readBitSet(4);
       if (incoming.get(0)) {
@@ -1403,20 +1476,29 @@ public class TaskModel implements org.apache.thrift.TBase<TaskModel, TaskModel._
         struct.setSubTaskModelIsSet(true);
       }
       if (incoming.get(2)) {
-        struct.taskError = new org.apache.airavata.model.commons.ErrorModel();
-        struct.taskError.read(iprot);
+        {
+          org.apache.thrift.protocol.TList _list18 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
+          struct.taskErrors = new ArrayList<org.apache.airavata.model.commons.ErrorModel>(_list18.size);
+          org.apache.airavata.model.commons.ErrorModel _elem19;
+          for (int _i20 = 0; _i20 < _list18.size; ++_i20)
+          {
+            _elem19 = new org.apache.airavata.model.commons.ErrorModel();
+            _elem19.read(iprot);
+            struct.taskErrors.add(_elem19);
+          }
+        }
         struct.setTaskErrorIsSet(true);
       }
       if (incoming.get(3)) {
         {
-          org.apache.thrift.protocol.TList _list5 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
-          struct.jobs = new ArrayList<org.apache.airavata.model.job.JobModel>(_list5.size);
-          org.apache.airavata.model.job.JobModel _elem6;
-          for (int _i7 = 0; _i7 < _list5.size; ++_i7)
+          org.apache.thrift.protocol.TList _list21 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
+          struct.jobs = new ArrayList<org.apache.airavata.model.job.JobModel>(_list21.size);
+          org.apache.airavata.model.job.JobModel _elem22;
+          for (int _i23 = 0; _i23 < _list21.size; ++_i23)
           {
-            _elem6 = new org.apache.airavata.model.job.JobModel();
-            _elem6.read(iprot);
-            struct.jobs.add(_elem6);
+            _elem22 = new org.apache.airavata.model.job.JobModel();
+            _elem22.read(iprot);
+            struct.jobs.add(_elem22);
           }
         }
         struct.setJobsIsSet(true);

http://git-wip-us.apache.org/repos/asf/airavata/blob/b46fd511/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GFacUtils.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GFacUtils.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GFacUtils.java
index 0015a21..0fc54fe 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GFacUtils.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GFacUtils.java
@@ -210,9 +210,14 @@ public class GFacUtils {
 	public static void saveJobStatus(ProcessContext processContext, JobModel jobModel) throws GFacException {
 		try {
             // first we save job jobModel to the registry for sa and then save the job status.
-			JobStatus jobStatus = jobModel.getJobStatus();
+            JobStatus jobStatus = null;
+            if(jobModel.getJobStatuses() != null)
+			    jobStatus = jobModel.getJobStatuses().get(0);
+
             ExperimentCatalog experimentCatalog = processContext.getExperimentCatalog();
-            jobModel.setJobStatus(jobStatus);
+            List<JobStatus> statuses = new ArrayList<>();
+            statuses.add(jobStatus);
+            jobModel.setJobStatuses(statuses);
             if (jobStatus.getTimeOfStateChange() == 0 || jobStatus.getTimeOfStateChange() > 0 ){
                 jobStatus.setTimeOfStateChange(AiravataUtils.getCurrentTimestamp().getTime());
             }else {

http://git-wip-us.apache.org/repos/asf/airavata/blob/b46fd511/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/context/ProcessContext.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/context/ProcessContext.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/context/ProcessContext.java
index 0e8c1f0..8a2cc4e 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/context/ProcessContext.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/context/ProcessContext.java
@@ -362,8 +362,8 @@ public class ProcessContext {
 	}
 
 	public ProcessState getProcessState() {
-		if(processModel.getProcessStatus() != null && processModel.getProcessStatus().size() > 0)
-			return processModel.getProcessStatus().get(0).getState();
+		if(processModel.getProcessStatuses() != null && processModel.getProcessStatuses().size() > 0)
+			return processModel.getProcessStatuses().get(0).getState();
 		else
 			return null;
 	}
@@ -374,13 +374,13 @@ public class ProcessContext {
 					getProcessState().name(), status.getState().name());
 			List<ProcessStatus> processStatuses = new ArrayList<>();
 			processStatuses.add(status);
-			processModel.setProcessStatus(processStatuses);
+			processModel.setProcessStatuses(processStatuses);
 		}
 	}
 
 	public ProcessStatus getProcessStatus(){
-		if(processModel.getProcessStatus() != null)
-			return processModel.getProcessStatus().get(0);
+		if(processModel.getProcessStatuses() != null)
+			return processModel.getProcessStatuses().get(0);
 		else
 			return null;
 	}

http://git-wip-us.apache.org/repos/asf/airavata/blob/b46fd511/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/context/TaskContext.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/context/TaskContext.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/context/TaskContext.java
index 1a276b3..6f95d3d 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/context/TaskContext.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/context/TaskContext.java
@@ -30,6 +30,9 @@ import org.apache.thrift.TException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.util.ArrayList;
+import java.util.List;
+
 public class TaskContext {
 	private static final Logger log = LoggerFactory.getLogger(TaskContext.class);
 
@@ -64,15 +67,23 @@ public class TaskContext {
 		log.info("expId: {}, processId: {}, taskId: {}, type: {}:- Task status changed {} -> {}", parentProcessContext
 				.getExperimentId(), parentProcessContext.getProcessId(), getTaskId(), getTaskType().name(),
 				getTaskState().name(), taskStatus .getState().name());
-		taskModel.setTaskStatus(taskStatus);
+		List<TaskStatus> taskStatuses = new ArrayList<>();
+		taskStatuses.add(taskStatus);
+		taskModel.setTaskStatuses(taskStatuses);
 	}
 
 	public TaskStatus getTaskStatus() {
-		return taskModel.getTaskStatus();
+		if(taskModel.getTaskStatuses() != null)
+			return taskModel.getTaskStatuses().get(0);
+		else
+			return null;
 	}
 
 	public TaskState getTaskState() {
-		return taskModel.getTaskStatus().getState();
+		if(taskModel.getTaskStatuses() != null)
+			return taskModel.getTaskStatuses().get(0).getState();
+		else
+			return null;
 	}
 
 	public TaskTypes getTaskType() {

http://git-wip-us.apache.org/repos/asf/airavata/blob/b46fd511/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/GFacEngineImpl.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/GFacEngineImpl.java b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/GFacEngineImpl.java
index f64e521..90acacc 100644
--- a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/GFacEngineImpl.java
+++ b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/GFacEngineImpl.java
@@ -37,7 +37,6 @@ import org.apache.airavata.gfac.core.monitor.JobMonitor;
 import org.apache.airavata.gfac.core.task.JobSubmissionTask;
 import org.apache.airavata.gfac.core.task.Task;
 import org.apache.airavata.gfac.core.task.TaskException;
-import org.apache.airavata.gfac.impl.task.DataStageTask;
 import org.apache.airavata.gfac.impl.task.DataStreamingTask;
 import org.apache.airavata.gfac.impl.task.EnvironmentSetupTask;
 import org.apache.airavata.model.appcatalog.appinterface.ApplicationInterfaceDescription;
@@ -53,19 +52,9 @@ import org.apache.airavata.model.commons.ErrorModel;
 import org.apache.airavata.model.data.movement.SecurityProtocol;
 import org.apache.airavata.model.job.JobModel;
 import org.apache.airavata.model.process.ProcessModel;
-import org.apache.airavata.model.status.JobState;
-import org.apache.airavata.model.status.JobStatus;
-import org.apache.airavata.model.status.ProcessState;
-import org.apache.airavata.model.status.ProcessStatus;
-import org.apache.airavata.model.status.TaskState;
-import org.apache.airavata.model.status.TaskStatus;
+import org.apache.airavata.model.status.*;
 import org.apache.airavata.model.task.*;
-import org.apache.airavata.registry.cpi.AppCatalog;
-import org.apache.airavata.registry.cpi.AppCatalogException;
-import org.apache.airavata.registry.cpi.ExpCatChildDataType;
-import org.apache.airavata.registry.cpi.ExperimentCatalog;
-import org.apache.airavata.registry.cpi.ExperimentCatalogModelType;
-import org.apache.airavata.registry.cpi.RegistryException;
+import org.apache.airavata.registry.cpi.*;
 import org.apache.airavata.registry.cpi.utils.Constants;
 import org.apache.curator.framework.CuratorFramework;
 import org.apache.curator.utils.ZKPaths;
@@ -339,7 +328,7 @@ public class GFacEngineImpl implements GFacEngine {
                     executeJobSubmission(taskContext, processContext.isRecovery());
                     // Don't put any checkpoint in between JobSubmission and Monitoring tasks
 
-                    JobStatus jobStatus = processContext.getJobModel().getJobStatus();
+                    JobStatus jobStatus = processContext.getJobModel().getJobStatuses().get(0);
                     if (jobStatus != null && (jobStatus.getJobState() == JobState.SUBMITTED
                             || jobStatus.getJobState() == JobState.QUEUED || jobStatus.getJobState() == JobState.ACTIVE)) {
 
@@ -350,7 +339,7 @@ public class GFacEngineImpl implements GFacEngine {
                                     if (output.isOutputStreaming()){
                                         TaskModel streamingTaskModel = new TaskModel();
                                         streamingTaskModel.setTaskType(TaskTypes.OUTPUT_FETCHING);
-                                        streamingTaskModel.setTaskStatus(new TaskStatus(TaskState.CREATED));
+                                        streamingTaskModel.setTaskStatuses(Arrays.asList(new TaskStatus(TaskState.CREATED)));
                                         streamingTaskModel.setCreationTime(AiravataUtils.getCurrentTimestamp().getTime());
                                         streamingTaskModel.setParentProcessId(processContext.getProcessId());
                                         TaskContext streamingTaskContext = getTaskContext(processContext);
@@ -589,7 +578,7 @@ public class GFacEngineImpl implements GFacEngine {
         TaskModel taskModel = null;
         for (String taskId : taskExecutionOrder) {
             taskModel = taskMap.get(taskId);
-            TaskState state = taskModel.getTaskStatus().getState();
+            TaskState state = taskModel.getTaskStatuses().get(0).getState();
             if (state == TaskState.CREATED || state == TaskState.EXECUTING) {
                 recoverTaskId = taskId;
                 break;
@@ -786,7 +775,7 @@ public class GFacEngineImpl implements GFacEngine {
         taskModel.setLastUpdateTime(taskModel.getCreationTime());
         TaskStatus taskStatus = new TaskStatus(TaskState.CREATED);
         taskStatus.setTimeOfStateChange(AiravataUtils.getCurrentTimestamp().getTime());
-        taskModel.setTaskStatus(taskStatus);
+        taskModel.setTaskStatuses(Arrays.asList(taskStatus));
         taskModel.setTaskType(TaskTypes.JOB_SUBMISSION);
         taskCtx.setTaskModel(taskModel);
         return taskCtx;
@@ -803,7 +792,7 @@ public class GFacEngineImpl implements GFacEngine {
         taskModel.setLastUpdateTime(taskModel.getCreationTime());
         TaskStatus taskStatus = new TaskStatus(TaskState.CREATED);
         taskStatus.setTimeOfStateChange(AiravataUtils.getCurrentTimestamp().getTime());
-        taskModel.setTaskStatus(taskStatus);
+        taskModel.setTaskStatuses(Arrays.asList(taskStatus));
         taskModel.setTaskType(TaskTypes.DATA_STAGING);
         // create data staging sub task model
         String remoteOutputDir = processContext.getOutputDir();

http://git-wip-us.apache.org/repos/asf/airavata/blob/b46fd511/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/ArchiveTask.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/ArchiveTask.java b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/ArchiveTask.java
index 755eed5..df22654 100644
--- a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/ArchiveTask.java
+++ b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/ArchiveTask.java
@@ -54,6 +54,7 @@ import org.slf4j.LoggerFactory;
 import java.io.File;
 import java.net.URI;
 import java.net.URISyntaxException;
+import java.util.Arrays;
 import java.util.Map;
 
 public class ArchiveTask implements Task {
@@ -89,7 +90,7 @@ public class ArchiveTask implements Task {
             ErrorModel errorModel = new ErrorModel();
             errorModel.setActualErrorMessage(e.getMessage());
             errorModel.setUserFriendlyMessage(msg);
-            taskContext.getTaskModel().setTaskError(errorModel);
+            taskContext.getTaskModel().setTaskErrors(Arrays.asList(errorModel));
             return status;
         }
 
@@ -159,7 +160,7 @@ public class ArchiveTask implements Task {
             ErrorModel errorModel = new ErrorModel();
             errorModel.setActualErrorMessage(e.getMessage());
             errorModel.setUserFriendlyMessage(msg);
-            taskContext.getTaskModel().setTaskError(errorModel);
+            taskContext.getTaskModel().setTaskErrors(Arrays.asList(errorModel));
         }
         return status;
     }

http://git-wip-us.apache.org/repos/asf/airavata/blob/b46fd511/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/BESJobSubmissionTask.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/BESJobSubmissionTask.java b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/BESJobSubmissionTask.java
index 6529395..a4dcb5d 100644
--- a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/BESJobSubmissionTask.java
+++ b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/BESJobSubmissionTask.java
@@ -35,7 +35,6 @@ import org.apache.airavata.gfac.core.GFacException;
 import org.apache.airavata.gfac.core.GFacUtils;
 import org.apache.airavata.gfac.core.SSHApiException;
 import org.apache.airavata.gfac.core.authentication.AuthenticationInfo;
-import org.apache.airavata.gfac.core.authentication.SSHKeyAuthentication;
 import org.apache.airavata.gfac.core.cluster.ServerInfo;
 import org.apache.airavata.gfac.core.context.ProcessContext;
 import org.apache.airavata.gfac.core.context.TaskContext;
@@ -73,6 +72,7 @@ import java.io.File;
 import java.io.IOException;
 import java.net.URI;
 import java.net.URISyntaxException;
+import java.util.Arrays;
 import java.util.Calendar;
 import java.util.List;
 import java.util.Map;
@@ -169,7 +169,7 @@ public class BESJobSubmissionTask implements JobSubmissionTask {
             log.info("JobID: " + jobId);
             jobDetails.setJobId(jobId);
             jobDetails.setJobDescription(activityEpr.toString());
-            jobDetails.setJobStatus(new JobStatus(JobState.SUBMITTED));
+            jobDetails.setJobStatuses(Arrays.asList(new JobStatus(JobState.SUBMITTED)));
             processContext.setJobModel(jobDetails);
             GFacUtils.saveJobModel(processContext, jobDetails);
             GFacUtils.saveJobStatus(processContext, jobDetails);
@@ -198,7 +198,7 @@ public class BESJobSubmissionTask implements JobSubmissionTask {
                 log.error(error);
 
                 JobState applicationJobStatus = JobState.FAILED;
-                jobDetails.setJobStatus(new JobStatus(applicationJobStatus));
+                jobDetails.setJobStatuses(Arrays.asList(new JobStatus(applicationJobStatus)));
                 sendNotification(processContext, jobDetails);
                 try {Thread.sleep(5000);} catch (InterruptedException e) {}
 
@@ -208,7 +208,7 @@ public class BESJobSubmissionTask implements JobSubmissionTask {
 
             } else if (activityStatus.getState() == ActivityStateEnumeration.CANCELLED) {
                 JobState applicationJobStatus = JobState.CANCELED;
-                jobDetails.setJobStatus(new JobStatus(applicationJobStatus));
+                jobDetails.setJobStatuses(Arrays.asList(new JobStatus(applicationJobStatus)));
                 GFacUtils.saveJobStatus(processContext, jobDetails);
                 throw new GFacException(
                         processContext.getExperimentId() + "Job Canceled");
@@ -218,7 +218,7 @@ public class BESJobSubmissionTask implements JobSubmissionTask {
                 } catch (InterruptedException ignored) {
                 }
                 JobState applicationJobStatus = JobState.COMPLETE;
-                jobDetails.setJobStatus(new JobStatus(applicationJobStatus));
+                jobDetails.setJobStatuses(Arrays.asList(new JobStatus(applicationJobStatus)));
                 GFacUtils.saveJobStatus(processContext, jobDetails);
                 log.info("Job Id: {}, exit code: {}, exit status: {}", jobDetails.getJobId(),
                         activityStatus.getExitCode(), ActivityStateEnumeration.FINISHED.toString());

http://git-wip-us.apache.org/repos/asf/airavata/blob/b46fd511/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/DataStageTask.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/DataStageTask.java b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/DataStageTask.java
index 69e8d77..8c6a125 100644
--- a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/DataStageTask.java
+++ b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/DataStageTask.java
@@ -20,7 +20,6 @@
  */
 package org.apache.airavata.gfac.impl.task;
 
-import org.apache.airavata.common.utils.ThriftUtils;
 import org.apache.airavata.gfac.core.SSHApiException;
 import org.apache.airavata.gfac.core.context.TaskContext;
 import org.apache.airavata.gfac.core.task.Task;
@@ -37,6 +36,7 @@ import org.slf4j.LoggerFactory;
 
 import java.net.URI;
 import java.net.URISyntaxException;
+import java.util.Arrays;
 import java.util.Map;
 
 public class DataStageTask implements Task {
@@ -83,7 +83,7 @@ public class DataStageTask implements Task {
 				ErrorModel errorModel = new ErrorModel();
 				errorModel.setActualErrorMessage(e.getMessage());
 				errorModel.setUserFriendlyMessage(msg);
-				taskContext.getTaskModel().setTaskError(errorModel);
+				taskContext.getTaskModel().setTaskErrors(Arrays.asList(errorModel));
 			} catch (TException e) {
 				String msg = "Invalid task invocation";
 				log.error(msg, e);
@@ -92,7 +92,7 @@ public class DataStageTask implements Task {
 				ErrorModel errorModel = new ErrorModel();
 				errorModel.setActualErrorMessage(e.getMessage());
 				errorModel.setUserFriendlyMessage(msg);
-				taskContext.getTaskModel().setTaskError(errorModel);
+				taskContext.getTaskModel().setTaskErrors(Arrays.asList(errorModel));
 			} catch (URISyntaxException e) {
 				String msg = "source or destination is not a valid URI";
 				log.error(msg, e);
@@ -101,7 +101,7 @@ public class DataStageTask implements Task {
 				ErrorModel errorModel = new ErrorModel();
 				errorModel.setActualErrorMessage(e.getMessage());
 				errorModel.setUserFriendlyMessage(msg);
-				taskContext.getTaskModel().setTaskError(errorModel);
+				taskContext.getTaskModel().setTaskErrors(Arrays.asList(errorModel));
 			}
 		}
 		return status;

http://git-wip-us.apache.org/repos/asf/airavata/blob/b46fd511/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/DefaultJobSubmissionTask.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/DefaultJobSubmissionTask.java b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/DefaultJobSubmissionTask.java
index b7f150f..a131ef5 100644
--- a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/DefaultJobSubmissionTask.java
+++ b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/DefaultJobSubmissionTask.java
@@ -24,7 +24,6 @@ package org.apache.airavata.gfac.impl.task;
 import org.apache.airavata.common.exception.ApplicationSettingsException;
 import org.apache.airavata.common.utils.AiravataUtils;
 import org.apache.airavata.gfac.core.*;
-import org.apache.airavata.gfac.core.cluster.CommandInfo;
 import org.apache.airavata.gfac.core.cluster.JobSubmissionOutput;
 import org.apache.airavata.gfac.core.cluster.RawCommandInfo;
 import org.apache.airavata.gfac.core.cluster.RemoteCluster;
@@ -49,6 +48,9 @@ import org.slf4j.LoggerFactory;
 
 import java.io.File;
 import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
 import java.util.Map;
 
 public class DefaultJobSubmissionTask implements JobSubmissionTask {
@@ -92,8 +94,10 @@ public class DefaultJobSubmissionTask implements JobSubmissionTask {
                 if (exitCode != 0 || jobSubmissionOutput.isJobSubmissionFailed()) {
 					jobModel.setJobId(DEFAULT_JOB_ID);
 					if (jobSubmissionOutput.isJobSubmissionFailed()) {
-						jobModel.setJobStatus(new JobStatus(JobState.FAILED));
-						jobModel.getJobStatus().setReason(jobSubmissionOutput.getFailureReason());
+						List<JobStatus> statusList = new ArrayList<>();
+						statusList.add(new JobStatus(JobState.FAILED));
+						statusList.get(0).setReason(jobSubmissionOutput.getFailureReason());
+						jobModel.setJobStatuses(statusList);
 						GFacUtils.saveJobModel(processContext, jobModel);
 						log.error("expId: {}, processid: {}, taskId: {} :- Job submission failed for job name {}",
                                 experimentId, taskContext.getProcessId(), taskContext.getTaskId(), jobModel.getJobName());
@@ -150,13 +154,13 @@ public class DefaultJobSubmissionTask implements JobSubmissionTask {
                             .getComputeResourceDescription();
                     jobStatus.setReason("Successfully Submitted to " + computeResourceDescription.getHostName());
                     jobStatus.setTimeOfStateChange(AiravataUtils.getCurrentTimestamp().getTime());
-				    jobModel.setJobStatus(jobStatus);
+				    jobModel.setJobStatuses(Arrays.asList(jobStatus));
 				    GFacUtils.saveJobStatus(taskContext.getParentProcessContext(), jobModel);
 				    if (verifyJobSubmissionByJobId(remoteCluster, jobId)) {
 					    jobStatus.setJobState(JobState.QUEUED);
 					    jobStatus.setReason("Verification step succeeded");
                         jobStatus.setTimeOfStateChange(AiravataUtils.getCurrentTimestamp().getTime());
-					    jobModel.setJobStatus(jobStatus);
+					    jobModel.setJobStatuses(Arrays.asList(jobStatus));
 					    GFacUtils.saveJobStatus(taskContext.getParentProcessContext(), jobModel);
 				    }
                     // doing gateway reporting
@@ -184,7 +188,7 @@ public class DefaultJobSubmissionTask implements JobSubmissionTask {
 							jobStatus.setJobState(JobState.QUEUED);
 							jobStatus.setReason("Verification step succeeded");
 							jobStatus.setTimeOfStateChange(AiravataUtils.getCurrentTimestamp().getTime());
-							jobModel.setJobStatus(jobStatus);
+							jobModel.setJobStatuses(Arrays.asList(jobStatus));
 							GFacUtils.saveJobStatus(taskContext.getParentProcessContext(), jobModel);
 							taskStatus.setState(TaskState.COMPLETED);
 							taskStatus.setReason("Submitted job to compute resource");
@@ -233,7 +237,7 @@ public class DefaultJobSubmissionTask implements JobSubmissionTask {
 		    ErrorModel errorModel = new ErrorModel();
 		    errorModel.setActualErrorMessage(e.getMessage());
 		    errorModel.setUserFriendlyMessage(msg);
-		    taskContext.getTaskModel().setTaskError(errorModel);
+		    taskContext.getTaskModel().setTaskErrors(Arrays.asList(errorModel));
 	    } catch (ApplicationSettingsException | GFacException e) {
 		    String msg = "Error occurred while creating job descriptor";
 		    log.error(msg, e);
@@ -243,7 +247,7 @@ public class DefaultJobSubmissionTask implements JobSubmissionTask {
 		    ErrorModel errorModel = new ErrorModel();
 		    errorModel.setActualErrorMessage(e.getMessage());
 		    errorModel.setUserFriendlyMessage(msg);
-		    taskContext.getTaskModel().setTaskError(errorModel);
+		    taskContext.getTaskModel().setTaskErrors(Arrays.asList(errorModel));
 	    } catch (SSHApiException e) {
 		    String msg = "Error occurred while submitting the job";
 		    log.error(msg, e);
@@ -253,7 +257,7 @@ public class DefaultJobSubmissionTask implements JobSubmissionTask {
 		    ErrorModel errorModel = new ErrorModel();
 		    errorModel.setActualErrorMessage(e.getMessage());
 		    errorModel.setUserFriendlyMessage(msg);
-		    taskContext.getTaskModel().setTaskError(errorModel);
+		    taskContext.getTaskModel().setTaskErrors(Arrays.asList(errorModel));
 	    } catch (IOException e) {
 		    String msg = "Error while reading the content of the job file";
 		    log.error(msg, e);
@@ -263,7 +267,7 @@ public class DefaultJobSubmissionTask implements JobSubmissionTask {
 		    ErrorModel errorModel = new ErrorModel();
 		    errorModel.setActualErrorMessage(e.getMessage());
 		    errorModel.setUserFriendlyMessage(msg);
-		    taskContext.getTaskModel().setTaskError(errorModel);
+		    taskContext.getTaskModel().setTaskErrors(Arrays.asList(errorModel));
 	    } catch (InterruptedException e) {
 		    String msg = "Error occurred while verifying the job submission";
 		    log.error(msg, e);
@@ -273,7 +277,7 @@ public class DefaultJobSubmissionTask implements JobSubmissionTask {
 		    ErrorModel errorModel = new ErrorModel();
 		    errorModel.setActualErrorMessage(e.getMessage());
 		    errorModel.setUserFriendlyMessage(msg);
-		    taskContext.getTaskModel().setTaskError(errorModel);
+		    taskContext.getTaskModel().setTaskErrors(Arrays.asList(errorModel));
 	    } catch (RegistryException e) {
             e.printStackTrace();
         }

http://git-wip-us.apache.org/repos/asf/airavata/blob/b46fd511/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/EnvironmentSetupTask.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/EnvironmentSetupTask.java b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/EnvironmentSetupTask.java
index 1256e48..7de0282 100644
--- a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/EnvironmentSetupTask.java
+++ b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/EnvironmentSetupTask.java
@@ -32,6 +32,7 @@ import org.apache.airavata.model.task.TaskTypes;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.util.Arrays;
 import java.util.Map;
 
 public class EnvironmentSetupTask implements Task {
@@ -57,7 +58,7 @@ public class EnvironmentSetupTask implements Task {
 			ErrorModel errorModel = new ErrorModel();
 			errorModel.setActualErrorMessage(e.getMessage());
 			errorModel.setUserFriendlyMessage(msg);
-			taskContext.getTaskModel().setTaskError(errorModel);
+			taskContext.getTaskModel().setTaskErrors(Arrays.asList(errorModel));
 		}
 		return status;
 	}

http://git-wip-us.apache.org/repos/asf/airavata/blob/b46fd511/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/ForkJobSubmissionTask.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/ForkJobSubmissionTask.java b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/ForkJobSubmissionTask.java
index 59a36e1..b57b68d 100644
--- a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/ForkJobSubmissionTask.java
+++ b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/ForkJobSubmissionTask.java
@@ -46,6 +46,7 @@ import org.slf4j.LoggerFactory;
 
 import java.io.File;
 import java.io.IOException;
+import java.util.Arrays;
 import java.util.Map;
 
 public class ForkJobSubmissionTask implements JobSubmissionTask {
@@ -87,7 +88,7 @@ public class ForkJobSubmissionTask implements JobSubmissionTask {
                     jobStatus.setReason("Successfully Submitted to " + taskContext.getParentProcessContext()
                             .getComputeResourceDescription().getHostName());
                     jobStatus.setTimeOfStateChange(AiravataUtils.getCurrentTimestamp().getTime());
-                    jobModel.setJobStatus(jobStatus);
+                    jobModel.setJobStatuses(Arrays.asList(jobStatus));
                     GFacUtils.saveJobStatus(taskContext.getParentProcessContext(), jobModel);
                     taskStatus = new TaskStatus(TaskState.COMPLETED);
                     taskStatus.setReason("Submitted job to compute resource");
@@ -124,7 +125,7 @@ public class ForkJobSubmissionTask implements JobSubmissionTask {
             ErrorModel errorModel = new ErrorModel();
             errorModel.setActualErrorMessage(e.getMessage());
             errorModel.setUserFriendlyMessage(msg);
-            taskContext.getTaskModel().setTaskError(errorModel);
+            taskContext.getTaskModel().setTaskErrors(Arrays.asList(errorModel));
         } catch (AppCatalogException e) {
             String msg = "Error while instantiating app catalog";
             log.error(msg, e);
@@ -133,7 +134,7 @@ public class ForkJobSubmissionTask implements JobSubmissionTask {
             ErrorModel errorModel = new ErrorModel();
             errorModel.setActualErrorMessage(e.getMessage());
             errorModel.setUserFriendlyMessage(msg);
-            taskContext.getTaskModel().setTaskError(errorModel);
+            taskContext.getTaskModel().setTaskErrors(Arrays.asList(errorModel));
         } catch (GFacException e) {
             String msg = "Error occurred while creating job descriptor";
             log.error(msg, e);
@@ -142,7 +143,7 @@ public class ForkJobSubmissionTask implements JobSubmissionTask {
             ErrorModel errorModel = new ErrorModel();
             errorModel.setActualErrorMessage(e.getMessage());
             errorModel.setUserFriendlyMessage(msg);
-            taskContext.getTaskModel().setTaskError(errorModel);
+            taskContext.getTaskModel().setTaskErrors(Arrays.asList(errorModel));
         } catch (SSHApiException e) {
             String msg = "Error occurred while submitting the job";
             log.error(msg, e);
@@ -151,7 +152,7 @@ public class ForkJobSubmissionTask implements JobSubmissionTask {
             ErrorModel errorModel = new ErrorModel();
             errorModel.setActualErrorMessage(e.getMessage());
             errorModel.setUserFriendlyMessage(msg);
-            taskContext.getTaskModel().setTaskError(errorModel);
+            taskContext.getTaskModel().setTaskErrors(Arrays.asList(errorModel));
         } catch (IOException e) {
             String msg = "Error while reading the content of the job file";
             log.error(msg, e);
@@ -160,7 +161,7 @@ public class ForkJobSubmissionTask implements JobSubmissionTask {
             ErrorModel errorModel = new ErrorModel();
             errorModel.setActualErrorMessage(e.getMessage());
             errorModel.setUserFriendlyMessage(msg);
-            taskContext.getTaskModel().setTaskError(errorModel);
+            taskContext.getTaskModel().setTaskErrors(Arrays.asList(errorModel));
         }
         return taskStatus;
     }

http://git-wip-us.apache.org/repos/asf/airavata/blob/b46fd511/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/SCPDataStageTask.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/SCPDataStageTask.java b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/SCPDataStageTask.java
index 904d486..6a8800e 100644
--- a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/SCPDataStageTask.java
+++ b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/SCPDataStageTask.java
@@ -24,7 +24,6 @@ import com.jcraft.jsch.JSchException;
 import com.jcraft.jsch.Session;
 import org.apache.airavata.common.exception.AiravataException;
 import org.apache.airavata.common.exception.ApplicationSettingsException;
-import org.apache.airavata.common.utils.ThriftUtils;
 import org.apache.airavata.gfac.core.GFacException;
 import org.apache.airavata.gfac.core.GFacUtils;
 import org.apache.airavata.gfac.core.SSHApiException;
@@ -57,6 +56,7 @@ import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.net.URI;
 import java.net.URISyntaxException;
+import java.util.Arrays;
 import java.util.Map;
 
 /**
@@ -179,7 +179,7 @@ public class SCPDataStageTask implements Task {
             ErrorModel errorModel = new ErrorModel();
             errorModel.setActualErrorMessage(e.getMessage());
             errorModel.setUserFriendlyMessage(msg);
-            taskContext.getTaskModel().setTaskError(errorModel);
+            taskContext.getTaskModel().setTaskErrors(Arrays.asList(errorModel));
             return status;
         } catch (ApplicationSettingsException | FileNotFoundException e) {
             String msg = "Failed while reading credentials";
@@ -189,7 +189,7 @@ public class SCPDataStageTask implements Task {
             ErrorModel errorModel = new ErrorModel();
             errorModel.setActualErrorMessage(e.getMessage());
             errorModel.setUserFriendlyMessage(msg);
-            taskContext.getTaskModel().setTaskError(errorModel);
+            taskContext.getTaskModel().setTaskErrors(Arrays.asList(errorModel));
         } catch (URISyntaxException e) {
             String msg = "Source or destination uri is not correct source : " + subTaskModel.getSource() + ", " +
                     "destination : " + subTaskModel.getDestination();
@@ -199,7 +199,7 @@ public class SCPDataStageTask implements Task {
             ErrorModel errorModel = new ErrorModel();
             errorModel.setActualErrorMessage(e.getMessage());
             errorModel.setUserFriendlyMessage(msg);
-            taskContext.getTaskModel().setTaskError(errorModel);
+            taskContext.getTaskModel().setTaskErrors(Arrays.asList(errorModel));
         } catch (SSHApiException e) {
             String msg = e.getMessage();
             log.error(msg, e);
@@ -208,7 +208,7 @@ public class SCPDataStageTask implements Task {
             ErrorModel errorModel = new ErrorModel();
             errorModel.setActualErrorMessage(e.getMessage());
             errorModel.setUserFriendlyMessage(msg);
-            taskContext.getTaskModel().setTaskError(errorModel);
+            taskContext.getTaskModel().setTaskErrors(Arrays.asList(errorModel));
         } catch (AiravataException e) {
             String msg = "Error while creating ssh session with client";
             log.error(msg, e);
@@ -217,7 +217,7 @@ public class SCPDataStageTask implements Task {
             ErrorModel errorModel = new ErrorModel();
             errorModel.setActualErrorMessage(e.getMessage());
             errorModel.setUserFriendlyMessage(msg);
-            taskContext.getTaskModel().setTaskError(errorModel);
+            taskContext.getTaskModel().setTaskErrors(Arrays.asList(errorModel));
         } catch (JSchException | IOException e) {
             String msg = "Failed to do scp with client";
             log.error(msg, e);
@@ -226,7 +226,7 @@ public class SCPDataStageTask implements Task {
             ErrorModel errorModel = new ErrorModel();
             errorModel.setActualErrorMessage(e.getMessage());
             errorModel.setUserFriendlyMessage(msg);
-            taskContext.getTaskModel().setTaskError(errorModel);
+            taskContext.getTaskModel().setTaskErrors(Arrays.asList(errorModel));
         } catch (GFacException e) {
             String msg = "Failed update experiment and process inputs and outputs";
             log.error(msg, e);
@@ -235,7 +235,7 @@ public class SCPDataStageTask implements Task {
             ErrorModel errorModel = new ErrorModel();
             errorModel.setActualErrorMessage(e.getMessage());
             errorModel.setUserFriendlyMessage(msg);
-            taskContext.getTaskModel().setTaskError(errorModel);
+            taskContext.getTaskModel().setTaskErrors(Arrays.asList(errorModel));
         }
         return status;
     }

http://git-wip-us.apache.org/repos/asf/airavata/blob/b46fd511/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/utils/StreamData.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/utils/StreamData.java b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/utils/StreamData.java
index 76b678a..375e570 100644
--- a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/utils/StreamData.java
+++ b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/utils/StreamData.java
@@ -24,15 +24,11 @@ package org.apache.airavata.gfac.impl.task.utils;
 import com.jcraft.jsch.JSchException;
 import com.jcraft.jsch.Session;
 import org.apache.airavata.common.exception.AiravataException;
-import org.apache.airavata.credential.store.credential.Credential;
-import org.apache.airavata.credential.store.credential.impl.ssh.SSHCredential;
-import org.apache.airavata.credential.store.store.CredentialReader;
 import org.apache.airavata.credential.store.store.CredentialStoreException;
 import org.apache.airavata.gfac.core.GFacException;
 import org.apache.airavata.gfac.core.GFacUtils;
 import org.apache.airavata.gfac.core.SSHApiException;
 import org.apache.airavata.gfac.core.authentication.AuthenticationInfo;
-import org.apache.airavata.gfac.core.authentication.SSHKeyAuthentication;
 import org.apache.airavata.gfac.core.cluster.CommandInfo;
 import org.apache.airavata.gfac.core.cluster.RawCommandInfo;
 import org.apache.airavata.gfac.core.cluster.RemoteCluster;
@@ -40,7 +36,6 @@ import org.apache.airavata.gfac.core.cluster.ServerInfo;
 import org.apache.airavata.gfac.core.context.TaskContext;
 import org.apache.airavata.gfac.impl.Factory;
 import org.apache.airavata.gfac.impl.SSHUtils;
-import org.apache.airavata.model.commons.ErrorModel;
 import org.apache.airavata.model.status.JobState;
 import org.apache.airavata.model.status.JobStatus;
 import org.apache.airavata.model.task.DataStagingTaskModel;
@@ -48,7 +43,6 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import java.io.File;
-import java.io.FileOutputStream;
 import java.io.IOException;
 import java.net.URI;
 import java.net.URISyntaxException;
@@ -78,7 +72,7 @@ public class StreamData extends TimerTask  {
     public void run() {
         try {
             // output staging should start when the job is in active state
-            JobStatus jobStatus = taskContext.getParentProcessContext().getJobModel().getJobStatus();
+            JobStatus jobStatus = taskContext.getParentProcessContext().getJobModel().getJobStatuses().get(0);
             if (jobStatus != null && jobStatus.getJobState().equals(JobState.ACTIVE)){
                 runOutputStaging();
             }

http://git-wip-us.apache.org/repos/asf/airavata/blob/b46fd511/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/monitor/email/EmailBasedMonitor.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/monitor/email/EmailBasedMonitor.java b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/monitor/email/EmailBasedMonitor.java
index b2df00b..b24aa75 100644
--- a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/monitor/email/EmailBasedMonitor.java
+++ b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/monitor/email/EmailBasedMonitor.java
@@ -135,7 +135,7 @@ public class EmailBasedMonitor implements JobMonitor, Runnable{
                     newJobStatus.setReason("Moving job status to cancel, as we didn't see any email from this job " +
                             "for a while after execute job cancel command. This may happen if job was in queued state " +
                             "when we run the cancel command");
-                    jobModel.setJobStatus(newJobStatus);
+                    jobModel.setJobStatuses(Arrays.asList(newJobStatus));
                     GFacUtils.saveJobStatus(pc, jobModel);
                 }
                 ProcessStatus pStatus = new ProcessStatus(ProcessState.CANCELLING);
@@ -374,7 +374,7 @@ public class EmailBasedMonitor implements JobMonitor, Runnable{
         }
 	    if (jobStatus.getJobState() != null) {
 		    try {
-			    jobModel.setJobStatus(jobStatus);
+			    jobModel.setJobStatuses(Arrays.asList(jobStatus));
 			    log.info("[EJM]: Publishing status changes to amqp. " + jobDetails);
 			    GFacUtils.saveJobStatus(parentProcessContext, jobModel);
 		    } catch (GFacException e) {

http://git-wip-us.apache.org/repos/asf/airavata/blob/b46fd511/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/impl/SimpleOrchestratorImpl.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/impl/SimpleOrchestratorImpl.java b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/impl/SimpleOrchestratorImpl.java
index 73a6aef..b1218e4 100644
--- a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/impl/SimpleOrchestratorImpl.java
+++ b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/impl/SimpleOrchestratorImpl.java
@@ -217,7 +217,7 @@ public class SimpleOrchestratorImpl extends AbstractOrchestrator{
         // FIXME
 //        List<JobDetails> jobDetailsList = task.getJobDetailsList();
 //        for(JobDetails jobDetails:jobDetailsList) {
-//            JobState jobState = jobDetails.getJobStatus().getJobState();
+//            JobState jobState = jobDetails.getJobStatuses().getJobState();
 //            if (jobState.getValue() > 4){
 //                logger.error("Cannot cancel the job, because current job state is : " + jobState.toString() +
 //                "jobId: " + jobDetails.getJobID() + " Job Name: " + jobDetails.getJobName());
@@ -346,7 +346,7 @@ public class SimpleOrchestratorImpl extends AbstractOrchestrator{
         List<String> envTaskIds = new ArrayList<>();
         TaskModel envSetupTask = new TaskModel();
         envSetupTask.setTaskType(TaskTypes.ENV_SETUP);
-        envSetupTask.setTaskStatus(new TaskStatus(TaskState.CREATED));
+        envSetupTask.setTaskStatuses(Arrays.asList(new TaskStatus(TaskState.CREATED)));
         envSetupTask.setCreationTime(AiravataUtils.getCurrentTimestamp().getTime());
         envSetupTask.setParentProcessId(processModel.getProcessId());
         EnvironmentSetupTaskModel envSetupSubModel = new EnvironmentSetupTaskModel();
@@ -487,7 +487,7 @@ public class SimpleOrchestratorImpl extends AbstractOrchestrator{
         taskModel.setLastUpdateTime(taskModel.getCreationTime());
         TaskStatus taskStatus = new TaskStatus(TaskState.CREATED);
         taskStatus.setTimeOfStateChange(AiravataUtils.getCurrentTimestamp().getTime());
-        taskModel.setTaskStatus(taskStatus);
+        taskModel.setTaskStatuses(Arrays.asList(taskStatus));
         taskModel.setTaskType(TaskTypes.JOB_SUBMISSION);
         JobSubmissionTaskModel submissionSubTask = new JobSubmissionTaskModel();
         submissionSubTask.setMonitorMode(monitorMode);
@@ -508,7 +508,7 @@ public class SimpleOrchestratorImpl extends AbstractOrchestrator{
             monitorTaskModel.setLastUpdateTime(monitorTaskModel.getCreationTime());
             TaskStatus monitorTaskStatus = new TaskStatus(TaskState.CREATED);
             monitorTaskStatus.setTimeOfStateChange(AiravataUtils.getCurrentTimestamp().getTime());
-            monitorTaskModel.setTaskStatus(monitorTaskStatus);
+            monitorTaskModel.setTaskStatuses(Arrays.asList(monitorTaskStatus));
             monitorTaskModel.setTaskType(TaskTypes.MONITORING);
             MonitorTaskModel monitorSubTaskModel = new MonitorTaskModel();
             monitorSubTaskModel.setMonitorMode(monitorMode);
@@ -538,7 +538,7 @@ public class SimpleOrchestratorImpl extends AbstractOrchestrator{
         taskModel.setLastUpdateTime(taskModel.getCreationTime());
         TaskStatus taskStatus = new TaskStatus(TaskState.CREATED);
         taskStatus.setTimeOfStateChange(AiravataUtils.getCurrentTimestamp().getTime());
-        taskModel.setTaskStatus(taskStatus);
+        taskModel.setTaskStatuses(Arrays.asList(taskStatus));
         taskModel.setTaskType(TaskTypes.DATA_STAGING);
         // create data staging sub task model
         DataStagingTaskModel submodel = new DataStagingTaskModel();
@@ -576,7 +576,7 @@ public class SimpleOrchestratorImpl extends AbstractOrchestrator{
             taskModel.setLastUpdateTime(taskModel.getCreationTime());
             TaskStatus taskStatus = new TaskStatus(TaskState.CREATED);
             taskStatus.setTimeOfStateChange(AiravataUtils.getCurrentTimestamp().getTime());
-            taskModel.setTaskStatus(taskStatus);
+            taskModel.setTaskStatuses(Arrays.asList(taskStatus));
             taskModel.setTaskType(TaskTypes.DATA_STAGING);
             ComputeResourcePreference computeResourcePreference = OrchestratorUtils.getComputeResourcePreference(orchestratorContext, processModel, gatewayId);
             ComputeResourceDescription computeResource = orchestratorContext.getRegistry().getAppCatalog().getComputeResource().getComputeResource(processModel.getComputeResourceId());

http://git-wip-us.apache.org/repos/asf/airavata/blob/b46fd511/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/JobEntity.java
----------------------------------------------------------------------
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/JobEntity.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/JobEntity.java
index a66295e..763f5da 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/JobEntity.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/JobEntity.java
@@ -38,7 +38,7 @@ public class JobEntity {
     private String stdErr;
     private int exitCode;
 
-    private List<JobStatusEntity> jobStatus;
+    private List<JobStatusEntity> jobStatuses;
 
     private TaskEntity task;
 
@@ -145,12 +145,12 @@ public class JobEntity {
     }
 
     @OneToMany(targetEntity = JobStatusEntity.class, cascade = CascadeType.ALL, mappedBy = "job")
-    public List<JobStatusEntity> getJobStatus() {
-        return jobStatus;
+    public List<JobStatusEntity> getJobStatuses() {
+        return jobStatuses;
     }
 
-    public void setJobStatus(List<JobStatusEntity> jobStatus) {
-        this.jobStatus = jobStatus;
+    public void setJobStatuses(List<JobStatusEntity> jobStatus) {
+        this.jobStatuses = jobStatus;
     }
 
     @ManyToOne(targetEntity = TaskEntity.class, cascade = CascadeType.ALL, fetch = FetchType.LAZY)

http://git-wip-us.apache.org/repos/asf/airavata/blob/b46fd511/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ProcessEntity.java
----------------------------------------------------------------------
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ProcessEntity.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ProcessEntity.java
index 109041e..a379ef6 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ProcessEntity.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ProcessEntity.java
@@ -45,8 +45,8 @@ public class ProcessEntity {
     private String experimentDataDir;
     private String userName;
 
-    private List<ProcessStatusEntity> processStatus;
-    private List<ProcessErrorEntity> processError;
+    private List<ProcessStatusEntity> processStatuses;
+    private List<ProcessErrorEntity> processErrors;
     private List<ProcessInputEntity> processInputs;
     private List<ProcessOutputEntity> processOutputs;
     private ProcessResourceSchedulingEntity processResourceSchedule;
@@ -211,21 +211,21 @@ public class ProcessEntity {
     }
 
     @OneToMany(targetEntity = ProcessStatusEntity.class, cascade = CascadeType.ALL, mappedBy = "process")
-    public List<ProcessStatusEntity> getProcessStatus() {
-        return processStatus;
+    public List<ProcessStatusEntity> getProcessStatuses() {
+        return processStatuses;
     }
 
-    public void setProcessStatus(List<ProcessStatusEntity> processStatus) {
-        this.processStatus = processStatus;
+    public void setProcessStatuses(List<ProcessStatusEntity> processStatus) {
+        this.processStatuses = processStatus;
     }
 
     @OneToMany(targetEntity = ProcessErrorEntity.class, cascade = CascadeType.ALL, mappedBy = "process")
-    public List<ProcessErrorEntity> getProcessError() {
-        return processError;
+    public List<ProcessErrorEntity> getProcessErrors() {
+        return processErrors;
     }
 
-    public void setProcessError(List<ProcessErrorEntity> processError) {
-        this.processError = processError;
+    public void setProcessErrors(List<ProcessErrorEntity> processError) {
+        this.processErrors = processError;
     }
 
     @OneToMany(targetEntity = ProcessInputEntity.class, cascade = CascadeType.ALL, mappedBy = "process")

http://git-wip-us.apache.org/repos/asf/airavata/blob/b46fd511/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/TaskEntity.java
----------------------------------------------------------------------
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/TaskEntity.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/TaskEntity.java
index f01fa10..8e4be82 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/TaskEntity.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/TaskEntity.java
@@ -37,8 +37,8 @@ public class TaskEntity {
     private String taskDetail;
     private ByteBuffer subTaskModel;
 
-    private List<TaskStatusEntity> taskStatus;
-    private List<TaskErrorEntity> taskError;
+    private List<TaskStatusEntity> taskStatuses;
+    private List<TaskErrorEntity> taskErrors;
     private List<JobEntity> jobs;
 
     private ProcessEntity process;
@@ -109,21 +109,21 @@ public class TaskEntity {
     }
 
     @OneToMany(targetEntity = TaskStatusEntity.class, cascade = CascadeType.ALL, mappedBy = "task")
-    public List<TaskStatusEntity> getTaskStatus() {
-        return taskStatus;
+    public List<TaskStatusEntity> getTaskStatuses() {
+        return taskStatuses;
     }
 
-    public void setTaskStatus(List<TaskStatusEntity> taskStatus) {
-        this.taskStatus = taskStatus;
+    public void setTaskStatuses(List<TaskStatusEntity> taskStatus) {
+        this.taskStatuses = taskStatus;
     }
 
     @OneToMany(targetEntity = TaskErrorEntity.class, cascade = CascadeType.ALL, mappedBy = "task")
-    public List<TaskErrorEntity> getTaskError() {
-        return taskError;
+    public List<TaskErrorEntity> getTaskErrors() {
+        return taskErrors;
     }
 
-    public void setTaskError(List<TaskErrorEntity> taskError) {
-        this.taskError = taskError;
+    public void setTaskErrors(List<TaskErrorEntity> taskError) {
+        this.taskErrors = taskError;
     }
 
     @OneToMany(targetEntity = JobEntity.class, cascade = CascadeType.ALL, mappedBy = "task")

http://git-wip-us.apache.org/repos/asf/airavata/blob/b46fd511/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/expcatalog/ExperimentRepository.java
----------------------------------------------------------------------
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/expcatalog/ExperimentRepository.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/expcatalog/ExperimentRepository.java
index d30b1de..a79a462 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/expcatalog/ExperimentRepository.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/expcatalog/ExperimentRepository.java
@@ -73,10 +73,10 @@ public class ExperimentRepository extends AbstractRepository<ExperimentModel, Ex
                     process.getProcessInputs().forEach(proInput->proInput.setProceseId(processId));
                 if(process.getProcessOutputs() != null)
                     process.getProcessOutputs().forEach(proOutput->proOutput.setProcessId(processId));
-                if(process.getProcessError() != null)
-                    process.getProcessError().forEach(processErr->processErr.setProcessId(processId));
-                if(process.getProcessStatus() != null)
-                    process.getProcessStatus().forEach(processStat->processStat.setProcessId(processId));
+                if(process.getProcessErrors() != null)
+                    process.getProcessErrors().forEach(processErr->processErr.setProcessId(processId));
+                if(process.getProcessStatuses() != null)
+                    process.getProcessStatuses().forEach(processStat->processStat.setProcessId(processId));
 
                 if(process.getTasks() != null){
                     process.getTasks().forEach(task->{

http://git-wip-us.apache.org/repos/asf/airavata/blob/b46fd511/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/impl/ExperimentRegistry.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/impl/ExperimentRegistry.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/impl/ExperimentRegistry.java
index f66b283..8465af4 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/impl/ExperimentRegistry.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/impl/ExperimentRegistry.java
@@ -309,8 +309,8 @@ public class ExperimentRegistry {
             processStatuses.add(processStatus);
             addProcessStatus(processStatuses.get(0), process.getProcessId());
 
-            if(process.getProcessError() != null) {
-                addProcessError(process.getProcessError().get(0), process.getProcessId());
+            if(process.getProcessErrors() != null) {
+                addProcessError(process.getProcessErrors().get(0), process.getProcessId());
             }
         } catch (Exception e) {
             logger.error(expId, "Error while adding process...", e);
@@ -463,8 +463,8 @@ public class ExperimentRegistry {
             taskStatus.setTimeOfStateChange(AiravataUtils.getCurrentTimestamp().getTime());
 	        addTaskStatus(taskStatus, task.getTaskId());
 
-            if(task.getTaskError() != null) {
-                addTaskError(task.getTaskError(), task.getTaskId());
+            if(task.getTaskErrors() != null) {
+                addTaskError(task.getTaskErrors().get(0), task.getTaskId());
             }
         } catch (Exception e) {
             logger.error(processID, "Error while adding task...", e);
@@ -763,11 +763,11 @@ public class ExperimentRegistry {
             if(process.getProcessOutputs() != null && process.getProcessOutputs().size() > 0) {
                 updateProcessOutputs(process.getProcessOutputs(), process.getProcessId());
             }
-            if(process.getProcessStatus() != null) {
-                updateProcessStatus(process.getProcessStatus().get(0), process.getProcessId());
+            if(process.getProcessStatuses() != null) {
+                updateProcessStatus(process.getProcessStatuses().get(0), process.getProcessId());
             }
-            if(process.getProcessError() != null) {
-                updateProcessError(process.getProcessError().get(0), process.getProcessId());
+            if(process.getProcessErrors() != null) {
+                updateProcessError(process.getProcessErrors().get(0), process.getProcessId());
             }
             if(process.getTasks() != null && process.getTasks().size() > 0){
                 for(TaskModel task : process.getTasks()){
@@ -883,11 +883,11 @@ public class ExperimentRegistry {
             taskResource.setSubTaskModel(task.getSubTaskModel());
             taskResource.save();
 
-            if(task.getTaskError() != null) {
-                updateTaskError(task.getTaskError(), task.getTaskId());
+            if(task.getTaskErrors() != null) {
+                updateTaskError(task.getTaskErrors().get(0), task.getTaskId());
             }
-            if(task.getTaskError() != null) {
-                updateTaskError(task.getTaskError(), task.getTaskId());
+            if(task.getTaskErrors() != null) {
+                updateTaskError(task.getTaskErrors().get(0), task.getTaskId());
             }
         } catch (Exception e) {
             logger.error(taskID, "Error while adding task...", e);
@@ -1252,7 +1252,9 @@ public class ExperimentRegistry {
 	                if (latestSR != null) {
 		                JobStatus jobStatus = new JobStatus(JobState.valueOf(latestSR.getState()));
 		                jobStatus.setReason(latestSR.getReason());
-		                jobModel.setJobStatus(jobStatus);
+                        List<JobStatus> statuses = new ArrayList<>();
+                        statuses.add(jobStatus);
+		                jobModel.setJobStatuses(statuses);
 	                }
 	                jobs.add(jobModel);
                 }
@@ -1267,7 +1269,9 @@ public class ExperimentRegistry {
                     if (latestSR != null) {
                         JobStatus jobStatus = new JobStatus(JobState.valueOf(latestSR.getState()));
                         jobStatus.setReason(latestSR.getReason());
-                        jobModel.setJobStatus(jobStatus);
+                        List<JobStatus> statuses = new ArrayList<>();
+                        statuses.add(jobStatus);
+                        jobModel.setJobStatuses(statuses);
                     }
                     jobs.add(jobModel);
                 }


Mime
View raw message