airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scnakand...@apache.org
Subject [1/8] airavata git commit: adding missing API functionality to xsede branch from master
Date Tue, 23 Jun 2015 16:23:43 GMT
Repository: airavata
Updated Branches:
  refs/heads/xsede-tutorial-2015 7b9418ae9 -> 82913953c


http://git-wip-us.apache.org/repos/asf/airavata/blob/811fd17e/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/apache/airavata/model/workspace/experiment/ttypes.py
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/apache/airavata/model/workspace/experiment/ttypes.py b/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/apache/airavata/model/workspace/experiment/ttypes.py
index 3ffe2b2..125fec6 100644
--- a/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/apache/airavata/model/workspace/experiment/ttypes.py
+++ b/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/apache/airavata/model/workspace/experiment/ttypes.py
@@ -60,6 +60,32 @@ class ExperimentState:
     "UNKNOWN": 10,
   }
 
+class ExperimentSearchFields:
+  EXPERIMENT_NAME = 0
+  EXPERIMENT_DESC = 1
+  APPLICATION_ID = 2
+  FROM_DATE = 3
+  TO_DATE = 4
+  STATUS = 5
+
+  _VALUES_TO_NAMES = {
+    0: "EXPERIMENT_NAME",
+    1: "EXPERIMENT_DESC",
+    2: "APPLICATION_ID",
+    3: "FROM_DATE",
+    4: "TO_DATE",
+    5: "STATUS",
+  }
+
+  _NAMES_TO_VALUES = {
+    "EXPERIMENT_NAME": 0,
+    "EXPERIMENT_DESC": 1,
+    "APPLICATION_ID": 2,
+    "FROM_DATE": 3,
+    "TO_DATE": 4,
+    "STATUS": 5,
+  }
+
 class WorkflowNodeState:
   INVOKED = 0
   EXECUTING = 1
@@ -2902,7 +2928,6 @@ class ExperimentSummary:
    - description
    - applicationId
    - experimentStatus
-   - errors
   """
 
   thrift_spec = (
@@ -2915,10 +2940,9 @@ class ExperimentSummary:
     (6, TType.STRING, 'description', None, None, ), # 6
     (7, TType.STRING, 'applicationId', None, None, ), # 7
     (8, TType.STRUCT, 'experimentStatus', (ExperimentStatus, ExperimentStatus.thrift_spec), None, ), # 8
-    (9, TType.LIST, 'errors', (TType.STRUCT,(ErrorDetails, ErrorDetails.thrift_spec)), None, ), # 9
   )
 
-  def __init__(self, experimentID=None, projectID=None, creationTime=None, userName=None, name=None, description=None, applicationId=None, experimentStatus=None, errors=None,):
+  def __init__(self, experimentID=None, projectID=None, creationTime=None, userName=None, name=None, description=None, applicationId=None, experimentStatus=None,):
     self.experimentID = experimentID
     self.projectID = projectID
     self.creationTime = creationTime
@@ -2927,7 +2951,6 @@ class ExperimentSummary:
     self.description = description
     self.applicationId = applicationId
     self.experimentStatus = experimentStatus
-    self.errors = errors
 
   def read(self, iprot):
     if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
@@ -2979,17 +3002,6 @@ class ExperimentSummary:
           self.experimentStatus.read(iprot)
         else:
           iprot.skip(ftype)
-      elif fid == 9:
-        if ftype == TType.LIST:
-          self.errors = []
-          (_etype136, _size133) = iprot.readListBegin()
-          for _i137 in xrange(_size133):
-            _elem138 = ErrorDetails()
-            _elem138.read(iprot)
-            self.errors.append(_elem138)
-          iprot.readListEnd()
-        else:
-          iprot.skip(ftype)
       else:
         iprot.skip(ftype)
       iprot.readFieldEnd()
@@ -3032,13 +3044,6 @@ class ExperimentSummary:
       oprot.writeFieldBegin('experimentStatus', TType.STRUCT, 8)
       self.experimentStatus.write(oprot)
       oprot.writeFieldEnd()
-    if self.errors is not None:
-      oprot.writeFieldBegin('errors', TType.LIST, 9)
-      oprot.writeListBegin(TType.STRUCT, len(self.errors))
-      for iter139 in self.errors:
-        iter139.write(oprot)
-      oprot.writeListEnd()
-      oprot.writeFieldEnd()
     oprot.writeFieldStop()
     oprot.writeStructEnd()
 
@@ -3064,3 +3069,191 @@ class ExperimentSummary:
 
   def __ne__(self, other):
     return not (self == other)
+
+class ExperimentStatistics:
+  """
+  Attributes:
+   - allExperimentCount
+   - completedExperimentCount
+   - cancelledExperimentCount
+   - failedExperimentCount
+   - allExperiments
+   - completedExperiments
+   - failedExperiments
+   - cancelledExperiments
+  """
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.I32, 'allExperimentCount', None, None, ), # 1
+    (2, TType.I32, 'completedExperimentCount', None, None, ), # 2
+    (3, TType.I32, 'cancelledExperimentCount', None, None, ), # 3
+    (4, TType.I32, 'failedExperimentCount', None, None, ), # 4
+    (5, TType.LIST, 'allExperiments', (TType.STRUCT,(ExperimentSummary, ExperimentSummary.thrift_spec)), None, ), # 5
+    (6, TType.LIST, 'completedExperiments', (TType.STRUCT,(ExperimentSummary, ExperimentSummary.thrift_spec)), None, ), # 6
+    (7, TType.LIST, 'failedExperiments', (TType.STRUCT,(ExperimentSummary, ExperimentSummary.thrift_spec)), None, ), # 7
+    (8, TType.LIST, 'cancelledExperiments', (TType.STRUCT,(ExperimentSummary, ExperimentSummary.thrift_spec)), None, ), # 8
+  )
+
+  def __init__(self, allExperimentCount=None, completedExperimentCount=None, cancelledExperimentCount=None, failedExperimentCount=None, allExperiments=None, completedExperiments=None, failedExperiments=None, cancelledExperiments=None,):
+    self.allExperimentCount = allExperimentCount
+    self.completedExperimentCount = completedExperimentCount
+    self.cancelledExperimentCount = cancelledExperimentCount
+    self.failedExperimentCount = failedExperimentCount
+    self.allExperiments = allExperiments
+    self.completedExperiments = completedExperiments
+    self.failedExperiments = failedExperiments
+    self.cancelledExperiments = cancelledExperiments
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 1:
+        if ftype == TType.I32:
+          self.allExperimentCount = iprot.readI32();
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.I32:
+          self.completedExperimentCount = iprot.readI32();
+        else:
+          iprot.skip(ftype)
+      elif fid == 3:
+        if ftype == TType.I32:
+          self.cancelledExperimentCount = iprot.readI32();
+        else:
+          iprot.skip(ftype)
+      elif fid == 4:
+        if ftype == TType.I32:
+          self.failedExperimentCount = iprot.readI32();
+        else:
+          iprot.skip(ftype)
+      elif fid == 5:
+        if ftype == TType.LIST:
+          self.allExperiments = []
+          (_etype136, _size133) = iprot.readListBegin()
+          for _i137 in xrange(_size133):
+            _elem138 = ExperimentSummary()
+            _elem138.read(iprot)
+            self.allExperiments.append(_elem138)
+          iprot.readListEnd()
+        else:
+          iprot.skip(ftype)
+      elif fid == 6:
+        if ftype == TType.LIST:
+          self.completedExperiments = []
+          (_etype142, _size139) = iprot.readListBegin()
+          for _i143 in xrange(_size139):
+            _elem144 = ExperimentSummary()
+            _elem144.read(iprot)
+            self.completedExperiments.append(_elem144)
+          iprot.readListEnd()
+        else:
+          iprot.skip(ftype)
+      elif fid == 7:
+        if ftype == TType.LIST:
+          self.failedExperiments = []
+          (_etype148, _size145) = iprot.readListBegin()
+          for _i149 in xrange(_size145):
+            _elem150 = ExperimentSummary()
+            _elem150.read(iprot)
+            self.failedExperiments.append(_elem150)
+          iprot.readListEnd()
+        else:
+          iprot.skip(ftype)
+      elif fid == 8:
+        if ftype == TType.LIST:
+          self.cancelledExperiments = []
+          (_etype154, _size151) = iprot.readListBegin()
+          for _i155 in xrange(_size151):
+            _elem156 = ExperimentSummary()
+            _elem156.read(iprot)
+            self.cancelledExperiments.append(_elem156)
+          iprot.readListEnd()
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('ExperimentStatistics')
+    if self.allExperimentCount is not None:
+      oprot.writeFieldBegin('allExperimentCount', TType.I32, 1)
+      oprot.writeI32(self.allExperimentCount)
+      oprot.writeFieldEnd()
+    if self.completedExperimentCount is not None:
+      oprot.writeFieldBegin('completedExperimentCount', TType.I32, 2)
+      oprot.writeI32(self.completedExperimentCount)
+      oprot.writeFieldEnd()
+    if self.cancelledExperimentCount is not None:
+      oprot.writeFieldBegin('cancelledExperimentCount', TType.I32, 3)
+      oprot.writeI32(self.cancelledExperimentCount)
+      oprot.writeFieldEnd()
+    if self.failedExperimentCount is not None:
+      oprot.writeFieldBegin('failedExperimentCount', TType.I32, 4)
+      oprot.writeI32(self.failedExperimentCount)
+      oprot.writeFieldEnd()
+    if self.allExperiments is not None:
+      oprot.writeFieldBegin('allExperiments', TType.LIST, 5)
+      oprot.writeListBegin(TType.STRUCT, len(self.allExperiments))
+      for iter157 in self.allExperiments:
+        iter157.write(oprot)
+      oprot.writeListEnd()
+      oprot.writeFieldEnd()
+    if self.completedExperiments is not None:
+      oprot.writeFieldBegin('completedExperiments', TType.LIST, 6)
+      oprot.writeListBegin(TType.STRUCT, len(self.completedExperiments))
+      for iter158 in self.completedExperiments:
+        iter158.write(oprot)
+      oprot.writeListEnd()
+      oprot.writeFieldEnd()
+    if self.failedExperiments is not None:
+      oprot.writeFieldBegin('failedExperiments', TType.LIST, 7)
+      oprot.writeListBegin(TType.STRUCT, len(self.failedExperiments))
+      for iter159 in self.failedExperiments:
+        iter159.write(oprot)
+      oprot.writeListEnd()
+      oprot.writeFieldEnd()
+    if self.cancelledExperiments is not None:
+      oprot.writeFieldBegin('cancelledExperiments', TType.LIST, 8)
+      oprot.writeListBegin(TType.STRUCT, len(self.cancelledExperiments))
+      for iter160 in self.cancelledExperiments:
+        iter160.write(oprot)
+      oprot.writeListEnd()
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def validate(self):
+    if self.allExperimentCount is None:
+      raise TProtocol.TProtocolException(message='Required field allExperimentCount is unset!')
+    if self.completedExperimentCount is None:
+      raise TProtocol.TProtocolException(message='Required field completedExperimentCount is unset!')
+    if self.failedExperimentCount is None:
+      raise TProtocol.TProtocolException(message='Required field failedExperimentCount is unset!')
+    if self.allExperiments is None:
+      raise TProtocol.TProtocolException(message='Required field allExperiments is unset!')
+    return
+
+
+  def __repr__(self):
+    L = ['%s=%r' % (key, value)
+      for key, value in self.__dict__.iteritems()]
+    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)

http://git-wip-us.apache.org/repos/asf/airavata/blob/811fd17e/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/workspace/experiment/ExperimentSummary.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/workspace/experiment/ExperimentSummary.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/workspace/experiment/ExperimentSummary.java
index c30e4ea..b1a1630 100644
--- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/workspace/experiment/ExperimentSummary.java
+++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/workspace/experiment/ExperimentSummary.java
@@ -60,7 +60,6 @@ import org.slf4j.LoggerFactory;
   private static final org.apache.thrift.protocol.TField DESCRIPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("description", org.apache.thrift.protocol.TType.STRING, (short)6);
   private static final org.apache.thrift.protocol.TField APPLICATION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("applicationId", org.apache.thrift.protocol.TType.STRING, (short)7);
   private static final org.apache.thrift.protocol.TField EXPERIMENT_STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("experimentStatus", org.apache.thrift.protocol.TType.STRUCT, (short)8);
-  private static final org.apache.thrift.protocol.TField ERRORS_FIELD_DESC = new org.apache.thrift.protocol.TField("errors", org.apache.thrift.protocol.TType.LIST, (short)9);
 
   private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
   static {
@@ -76,7 +75,6 @@ import org.slf4j.LoggerFactory;
   private String description; // optional
   private String applicationId; // optional
   private ExperimentStatus experimentStatus; // optional
-  private List<ErrorDetails> errors; // optional
 
   /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
   @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
@@ -87,8 +85,7 @@ import org.slf4j.LoggerFactory;
     NAME((short)5, "name"),
     DESCRIPTION((short)6, "description"),
     APPLICATION_ID((short)7, "applicationId"),
-    EXPERIMENT_STATUS((short)8, "experimentStatus"),
-    ERRORS((short)9, "errors");
+    EXPERIMENT_STATUS((short)8, "experimentStatus");
 
     private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
@@ -119,8 +116,6 @@ import org.slf4j.LoggerFactory;
           return APPLICATION_ID;
         case 8: // EXPERIMENT_STATUS
           return EXPERIMENT_STATUS;
-        case 9: // ERRORS
-          return ERRORS;
         default:
           return null;
       }
@@ -163,7 +158,7 @@ import org.slf4j.LoggerFactory;
   // isset id assignments
   private static final int __CREATIONTIME_ISSET_ID = 0;
   private byte __isset_bitfield = 0;
-  private _Fields optionals[] = {_Fields.CREATION_TIME,_Fields.DESCRIPTION,_Fields.APPLICATION_ID,_Fields.EXPERIMENT_STATUS,_Fields.ERRORS};
+  private _Fields optionals[] = {_Fields.CREATION_TIME,_Fields.DESCRIPTION,_Fields.APPLICATION_ID,_Fields.EXPERIMENT_STATUS};
   public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
   static {
     Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
@@ -183,9 +178,6 @@ import org.slf4j.LoggerFactory;
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
     tmpMap.put(_Fields.EXPERIMENT_STATUS, new org.apache.thrift.meta_data.FieldMetaData("experimentStatus", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ExperimentStatus.class)));
-    tmpMap.put(_Fields.ERRORS, new org.apache.thrift.meta_data.FieldMetaData("errors", 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, ErrorDetails.class))));
     metaDataMap = Collections.unmodifiableMap(tmpMap);
     org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ExperimentSummary.class, metaDataMap);
   }
@@ -233,13 +225,6 @@ import org.slf4j.LoggerFactory;
     if (other.isSetExperimentStatus()) {
       this.experimentStatus = new ExperimentStatus(other.experimentStatus);
     }
-    if (other.isSetErrors()) {
-      List<ErrorDetails> __this__errors = new ArrayList<ErrorDetails>(other.errors.size());
-      for (ErrorDetails other_element : other.errors) {
-        __this__errors.add(new ErrorDetails(other_element));
-      }
-      this.errors = __this__errors;
-    }
   }
 
   public ExperimentSummary deepCopy() {
@@ -257,7 +242,6 @@ import org.slf4j.LoggerFactory;
     this.description = null;
     this.applicationId = null;
     this.experimentStatus = null;
-    this.errors = null;
   }
 
   public String getExperimentID() {
@@ -443,44 +427,6 @@ import org.slf4j.LoggerFactory;
     }
   }
 
-  public int getErrorsSize() {
-    return (this.errors == null) ? 0 : this.errors.size();
-  }
-
-  public java.util.Iterator<ErrorDetails> getErrorsIterator() {
-    return (this.errors == null) ? null : this.errors.iterator();
-  }
-
-  public void addToErrors(ErrorDetails elem) {
-    if (this.errors == null) {
-      this.errors = new ArrayList<ErrorDetails>();
-    }
-    this.errors.add(elem);
-  }
-
-  public List<ErrorDetails> getErrors() {
-    return this.errors;
-  }
-
-  public void setErrors(List<ErrorDetails> errors) {
-    this.errors = errors;
-  }
-
-  public void unsetErrors() {
-    this.errors = null;
-  }
-
-  /** Returns true if field errors is set (has been assigned a value) and false otherwise */
-  public boolean isSetErrors() {
-    return this.errors != null;
-  }
-
-  public void setErrorsIsSet(boolean value) {
-    if (!value) {
-      this.errors = null;
-    }
-  }
-
   public void setFieldValue(_Fields field, Object value) {
     switch (field) {
     case EXPERIMENT_ID:
@@ -547,14 +493,6 @@ import org.slf4j.LoggerFactory;
       }
       break;
 
-    case ERRORS:
-      if (value == null) {
-        unsetErrors();
-      } else {
-        setErrors((List<ErrorDetails>)value);
-      }
-      break;
-
     }
   }
 
@@ -584,9 +522,6 @@ import org.slf4j.LoggerFactory;
     case EXPERIMENT_STATUS:
       return getExperimentStatus();
 
-    case ERRORS:
-      return getErrors();
-
     }
     throw new IllegalStateException();
   }
@@ -614,8 +549,6 @@ import org.slf4j.LoggerFactory;
       return isSetApplicationId();
     case EXPERIMENT_STATUS:
       return isSetExperimentStatus();
-    case ERRORS:
-      return isSetErrors();
     }
     throw new IllegalStateException();
   }
@@ -705,15 +638,6 @@ import org.slf4j.LoggerFactory;
         return false;
     }
 
-    boolean this_present_errors = true && this.isSetErrors();
-    boolean that_present_errors = true && that.isSetErrors();
-    if (this_present_errors || that_present_errors) {
-      if (!(this_present_errors && that_present_errors))
-        return false;
-      if (!this.errors.equals(that.errors))
-        return false;
-    }
-
     return true;
   }
 
@@ -810,16 +734,6 @@ import org.slf4j.LoggerFactory;
         return lastComparison;
       }
     }
-    lastComparison = Boolean.valueOf(isSetErrors()).compareTo(other.isSetErrors());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetErrors()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.errors, other.errors);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
     return 0;
   }
 
@@ -907,16 +821,6 @@ import org.slf4j.LoggerFactory;
       }
       first = false;
     }
-    if (isSetErrors()) {
-      if (!first) sb.append(", ");
-      sb.append("errors:");
-      if (this.errors == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.errors);
-      }
-      first = false;
-    }
     sb.append(")");
     return sb.toString();
   }
@@ -1046,25 +950,6 @@ import org.slf4j.LoggerFactory;
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
             }
             break;
-          case 9: // ERRORS
-            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
-              {
-                org.apache.thrift.protocol.TList _list152 = iprot.readListBegin();
-                struct.errors = new ArrayList<ErrorDetails>(_list152.size);
-                for (int _i153 = 0; _i153 < _list152.size; ++_i153)
-                {
-                  ErrorDetails _elem154;
-                  _elem154 = new ErrorDetails();
-                  _elem154.read(iprot);
-                  struct.errors.add(_elem154);
-                }
-                iprot.readListEnd();
-              }
-              struct.setErrorsIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
           default:
             org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
@@ -1124,20 +1009,6 @@ import org.slf4j.LoggerFactory;
           oprot.writeFieldEnd();
         }
       }
-      if (struct.errors != null) {
-        if (struct.isSetErrors()) {
-          oprot.writeFieldBegin(ERRORS_FIELD_DESC);
-          {
-            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.errors.size()));
-            for (ErrorDetails _iter155 : struct.errors)
-            {
-              _iter155.write(oprot);
-            }
-            oprot.writeListEnd();
-          }
-          oprot.writeFieldEnd();
-        }
-      }
       oprot.writeFieldStop();
       oprot.writeStructEnd();
     }
@@ -1172,10 +1043,7 @@ import org.slf4j.LoggerFactory;
       if (struct.isSetExperimentStatus()) {
         optionals.set(3);
       }
-      if (struct.isSetErrors()) {
-        optionals.set(4);
-      }
-      oprot.writeBitSet(optionals, 5);
+      oprot.writeBitSet(optionals, 4);
       if (struct.isSetCreationTime()) {
         oprot.writeI64(struct.creationTime);
       }
@@ -1188,15 +1056,6 @@ import org.slf4j.LoggerFactory;
       if (struct.isSetExperimentStatus()) {
         struct.experimentStatus.write(oprot);
       }
-      if (struct.isSetErrors()) {
-        {
-          oprot.writeI32(struct.errors.size());
-          for (ErrorDetails _iter156 : struct.errors)
-          {
-            _iter156.write(oprot);
-          }
-        }
-      }
     }
 
     @Override
@@ -1210,7 +1069,7 @@ import org.slf4j.LoggerFactory;
       struct.setUserNameIsSet(true);
       struct.name = iprot.readString();
       struct.setNameIsSet(true);
-      BitSet incoming = iprot.readBitSet(5);
+      BitSet incoming = iprot.readBitSet(4);
       if (incoming.get(0)) {
         struct.creationTime = iprot.readI64();
         struct.setCreationTimeIsSet(true);
@@ -1228,20 +1087,6 @@ import org.slf4j.LoggerFactory;
         struct.experimentStatus.read(iprot);
         struct.setExperimentStatusIsSet(true);
       }
-      if (incoming.get(4)) {
-        {
-          org.apache.thrift.protocol.TList _list157 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
-          struct.errors = new ArrayList<ErrorDetails>(_list157.size);
-          for (int _i158 = 0; _i158 < _list157.size; ++_i158)
-          {
-            ErrorDetails _elem159;
-            _elem159 = new ErrorDetails();
-            _elem159.read(iprot);
-            struct.errors.add(_elem159);
-          }
-        }
-        struct.setErrorsIsSet(true);
-      }
     }
   }
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/811fd17e/airavata-api/thrift-interface-descriptions/airavataAPI.thrift
----------------------------------------------------------------------
diff --git a/airavata-api/thrift-interface-descriptions/airavataAPI.thrift b/airavata-api/thrift-interface-descriptions/airavataAPI.thrift
index 7f027f5..2ee3299 100644
--- a/airavata-api/thrift-interface-descriptions/airavataAPI.thrift
+++ b/airavata-api/thrift-interface-descriptions/airavataAPI.thrift
@@ -20,7 +20,7 @@
 
 /**
  * Application Programming Interface definition for Apache Airavata Services.
- *   this parent thrift file is contains all service interfaces. The data models are 
+ *   this parent thrift file is contains all service interfaces. The data models are
  *   described in respective thrift files.
 */
 
@@ -69,7 +69,8 @@ service Airavata {
   string getAPIVersion()
         throws (1: airavataErrors.InvalidRequestException ire,
                 2: airavataErrors.AiravataClientException ace,
-                3: airavataErrors.AiravataSystemException ase)
+                3: airavataErrors.AiravataSystemException ase,
+                4: airavataErrors.AuthorizationException ae)
 
   string addGateway(1: required workspaceModel.Gateway gateway)
          throws (1: airavataErrors.InvalidRequestException ire,
@@ -501,6 +502,43 @@ service Airavata {
                         2: airavataErrors.AiravataClientException ace,
                         3: airavataErrors.AiravataSystemException ase)
 
+  /**
+   * Search Experiments by using multiple filter criteria with pagination. Results will be sorted
+   * based on creation time DESC
+   *
+   * @param gatewayId
+   *       Identifier of the requested gateway
+   * @param userName
+   *       Username of the requested user
+   * @param filters
+   *       map of multiple filter criteria.
+   * @param limit
+   *       Amount of results to be fetched
+   * @param offset
+   *       The starting point of the results to be fetched
+   */
+    list<experimentModel.ExperimentSummary> searchExperiments(1: required string gatewayId,
+                            2: required string userName, 3: map<experimentModel.ExperimentSearchFields, string> filters,
+                            4: required i32 limit, 5: required i32 offset)
+                throws (1: airavataErrors.InvalidRequestException ire,
+                        2: airavataErrors.AiravataClientException ace,
+                        3: airavataErrors.AiravataSystemException ase)
+
+    /**
+     * Get Experiment Statisitics for the given gateway for a specific time period
+     * @param gatewayId
+     *       Identifier of the requested gateway
+     * @param fromTime
+     *       Starting date time
+     * @param toTime
+     *       Ending data time
+     **/
+    experimentModel.ExperimentStatistics getExperimentStatistics(1: required string gatewayId,
+                            2: required i64 fromTime, 3: required i64 toTime)
+                throws (1: airavataErrors.InvalidRequestException ire,
+                        2: airavataErrors.AiravataClientException ace,
+                        3: airavataErrors.AiravataSystemException ase)
+
    /**
     * Get all Experiments within a Project
     *
@@ -581,7 +619,7 @@ service Airavata {
      *      the ExperimentMetadata is a required field.
      *
      * @return
-     *   The server-side generated airavata experiment globally unique identifier.
+     *   The server-side generated.airavata.registry.core.experiment.globally unique identifier.
      *
      * @throws org.apache.airavata.model.error.InvalidRequestException
      *    For any incorrect forming of the request itself.
@@ -622,13 +660,13 @@ service Airavata {
    *
    * @throws org.apache.airavata.model.error.InvalidRequestException
    *    For any incorrect forming of the request itself.
-   * 
+   *
    * @throws org.apache.airavata.model.error.ExperimentNotFoundException
    *    If the specified experiment is not previously created, then an Experiment Not Found Exception is thrown.
-   * 
+   *
    * @throws org.apache.airavata.model.error.AiravataClientException
    *    The following list of exceptions are thrown which Airavata Client can take corrective actions to resolve:
-   *      
+   *
    *      UNKNOWN_GATEWAY_ID - If a Gateway is not registered with Airavata as a one time administrative
    *         step, then Airavata Registry will not have a provenance area setup. The client has to follow
    *         gateway registration steps and retry this request.
@@ -667,13 +705,13 @@ service Airavata {
    *
    * @throws org.apache.airavata.model.error.InvalidRequestException
    *    For any incorrect forming of the request itself.
-   * 
+   *
    * @throws org.apache.airavata.model.error.ExperimentNotFoundException
    *    If the specified experiment is not previously created, then an Experiment Not Found Exception is thrown.
-   * 
+   *
    * @throws org.apache.airavata.model.error.AiravataClientException
    *    The following list of exceptions are thrown which Airavata Client can take corrective actions to resolve:
-   *      
+   *
    *      UNKNOWN_GATEWAY_ID - If a Gateway is not registered with Airavata as a one time administrative
    *         step, then Airavata Registry will not have a provenance area setup. The client has to follow
    *         gateway registration steps and retry this request.
@@ -728,7 +766,7 @@ service Airavata {
    *     credentials with Airavata Credential Store. The administrative API (related to credential store) will return a
    *     generated token associated with the registered credentials. The client has to security posses this token id and is
    *     required to pass it to Airavata Server for all execution requests.
-   *   Note: At this point only the credential store token is required so the string is directly passed here. In future if 
+   *   Note: At this point only the credential store token is required so the string is directly passed here. In future if
    *     if more security credentials are enables, then the structure ExecutionSecurityParameters should be used.
    *   Note: This parameter is not persisted within Airavata Registry for security reasons.
    *
@@ -737,13 +775,13 @@ service Airavata {
    *
    * @throws org.apache.airavata.model.error.InvalidRequestException
    *    For any incorrect forming of the request itself.
-   * 
+   *
    * @throws org.apache.airavata.model.error.ExperimentNotFoundException
    *    If the specified experiment is not previously created, then an Experiment Not Found Exception is thrown.
-   * 
+   *
    * @throws org.apache.airavata.model.error.AiravataClientException
    *    The following list of exceptions are thrown which Airavata Client can take corrective actions to resolve:
-   *      
+   *
    *      UNKNOWN_GATEWAY_ID - If a Gateway is not registered with Airavata as a one time administrative
    *         step, then Airavata Registry will not have a provenance area setup. The client has to follow
    *         gateway registration steps and retry this request.
@@ -807,7 +845,7 @@ service Airavata {
 
   /**
    * Clone an specified experiment with a new name. A copy of the experiment configuration is made and is persisted with new metadata.
-   *   The client has to subsequently update this configuration if needed and launch the cloned experiment. 
+   *   The client has to subsequently update this configuration if needed and launch the cloned experiment.
    *
    * @param newExperimentName
    *    experiment name that should be used in the cloned experiment
@@ -818,17 +856,17 @@ service Airavata {
    *      should be shared public by default.
    *
    * @return
-   *   The server-side generated airavata experiment globally unique identifier for the newly cloned experiment.
+   *   The server-side generated.airavata.registry.core.experiment.globally unique identifier for the newly cloned experiment.
    *
    * @throws org.apache.airavata.model.error.InvalidRequestException
    *    For any incorrect forming of the request itself.
-   * 
+   *
    * @throws org.apache.airavata.model.error.ExperimentNotFoundException
    *    If the specified experiment is not previously created, then an Experiment Not Found Exception is thrown.
-   * 
+   *
    * @throws org.apache.airavata.model.error.AiravataClientException
    *    The following list of exceptions are thrown which Airavata Client can take corrective actions to resolve:
-   *      
+   *
    *      UNKNOWN_GATEWAY_ID - If a Gateway is not registered with Airavata as a one time administrative
    *         step, then Airavata Registry will not have a provenance area setup. The client has to follow
    *         gateway registration steps and retry this request.
@@ -862,13 +900,13 @@ service Airavata {
    *
    * @throws org.apache.airavata.model.error.InvalidRequestException
    *    For any incorrect forming of the request itself.
-   * 
+   *
    * @throws org.apache.airavata.model.error.ExperimentNotFoundException
    *    If the specified experiment is not previously created, then an Experiment Not Found Exception is thrown.
-   * 
+   *
    * @throws org.apache.airavata.model.error.AiravataClientException
    *    The following list of exceptions are thrown which Airavata Client can take corrective actions to resolve:
-   *      
+   *
    *      UNKNOWN_GATEWAY_ID - If a Gateway is not registered with Airavata as a one time administrative
    *         step, then Airavata Registry will not have a provenance area setup. The client has to follow
    *         gateway registration steps and retry this request.

http://git-wip-us.apache.org/repos/asf/airavata/blob/811fd17e/airavata-api/thrift-interface-descriptions/experimentModel.thrift
----------------------------------------------------------------------
diff --git a/airavata-api/thrift-interface-descriptions/experimentModel.thrift b/airavata-api/thrift-interface-descriptions/experimentModel.thrift
index 51aaca7..f9d76ab 100644
--- a/airavata-api/thrift-interface-descriptions/experimentModel.thrift
+++ b/airavata-api/thrift-interface-descriptions/experimentModel.thrift
@@ -27,7 +27,7 @@ namespace cpp apache.airavata.model.workspace.experiment
 namespace py apache.airavata.model.workspace.experiment
 
 /*
- * This file describes the definitions of the Airavata Experiment Data Structures. Each of the
+ * This file describes the definitions of the.airavata.registry.core.experiment.Data Structures. Each of the
  *   language specific Airavata Client SDK's will translate this neutral data model into an
  *   appropriate form for passing to the Airavata Server Execution API Calls.
  * 
@@ -72,6 +72,15 @@ enum ExperimentState {
     UNKNOWN
 }
 
+enum ExperimentSearchFields {
+    EXPERIMENT_NAME,
+    EXPERIMENT_DESC,
+    APPLICATION_ID,
+    FROM_DATE,
+    TO_DATE,
+    STATUS
+}
+
 struct ExperimentStatus {
     1: required ExperimentState experimentState,
     2: optional i64 timeOfStateChange
@@ -399,5 +408,15 @@ struct ExperimentSummary {
     6: optional string description,
     7: optional string applicationId,
     8: optional ExperimentStatus experimentStatus,
-    9: optional list<ErrorDetails> errors
+}
+
+struct ExperimentStatistics {
+    1: required i32 allExperimentCount,
+    2: required i32 completedExperimentCount,
+    3: optional i32 cancelledExperimentCount,
+    4: required i32 failedExperimentCount,
+    5: required list<ExperimentSummary> allExperiments,
+    6: optional list<ExperimentSummary> completedExperiments,
+    7: optional list<ExperimentSummary> failedExperiments,
+    8: optional list<ExperimentSummary> cancelledExperiments,
 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/811fd17e/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/ResourceType.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/ResourceType.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/ResourceType.java
index 0a38664..55a4d0f 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/ResourceType.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/ResourceType.java
@@ -28,6 +28,7 @@ public enum ResourceType {
     CONFIGURATION,
     GATEWAY_WORKER,
     EXPERIMENT,
+    EXPERIMENT_SUMMARY,
     NOTIFICATION_EMAIL,
     EXPERIMENT_INPUT,
     EXPERIMENT_OUTPUT,

http://git-wip-us.apache.org/repos/asf/airavata/blob/811fd17e/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
index 536c054..e2253d8 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
@@ -2905,18 +2905,17 @@ public class ExperimentRegistry {
                         toTime = Long.parseLong(filters.get(field));
                     }
                 }
+                List<ExperimentSummaryResource> experimentSummaryResources;
                 if (fromTime != 0 && toTime != 0) {
-                    return searchExperimentsByCreationTime(new Timestamp(fromTime), new Timestamp(toTime)
-                            , limit, offset, orderByIdentifier, resultOrderType);
-                } else if(fil.get(AbstractResource.StatusConstants.STATE) != null ) {
-                    return searchExperimentsByStatus(fil, limit, offset, orderByIdentifier, resultOrderType);
+                    experimentSummaryResources = workerResource.searchExperiments(new Timestamp(fromTime), new Timestamp(toTime), fil
+                            ,limit , offset, orderByIdentifier, resultOrderType);
                 } else {
-                    List<ExperimentResource> experimentResources = workerResource
-                            .searchExperiments(fil, limit, offset, orderByIdentifier, resultOrderType);
-                    if (experimentResources != null && !experimentResources.isEmpty()) {
-                        for (ExperimentResource ex : experimentResources) {
-                            experimentSummaries.add(ThriftDataModelConversion.getExperimentSummary(ex));
-                        }
+                    experimentSummaryResources = workerResource
+                            .searchExperiments(null, null, fil, limit, offset, orderByIdentifier, resultOrderType);
+                }
+                if (experimentSummaryResources != null && !experimentSummaryResources.isEmpty()) {
+                    for (ExperimentSummaryResource ex : experimentSummaryResources) {
+                        experimentSummaries.add(ThriftDataModelConversion.getExperimentSummary(ex));
                     }
                 }
                 return experimentSummaries;
@@ -2929,86 +2928,54 @@ public class ExperimentRegistry {
         return null;
     }
 
-    /**
-     * To get list of experiments of specified state
-     * @param filters
-     * @return
-     * @throws RegistryException
-     */
-    public List<ExperimentSummary> searchExperimentsByStatus(Map<String, String> filters) throws RegistryException {
-        return searchExperimentsByStatus(filters, -1, -1, null, null);
-    }
 
     /**
-     * To get list of experiments of specified state with pagination and ordering
-     *
+     * Method to get experiment execution statistics for a specific time period
      * @param filters
-     * @param limit
-     * @param offset
-     * @param orderByIdentifier
-     * @param resultOrderType
      * @return
      * @throws RegistryException
      */
-    public List<ExperimentSummary> searchExperimentsByStatus(Map<String, String> filters, int limit,
-        int offset, Object orderByIdentifier, ResultOrderType resultOrderType) throws RegistryException {
+    public ExperimentStatistics getExperimentStatistics(Map<String,String> filters) throws RegistryException {
         try {
-            List<ExperimentSummary> experimentSummaries = new ArrayList<ExperimentSummary>();
-            List<ExperimentResource> experimentResources = workerResource.searchExperimentsByState(filters, limit, offset,
-                    orderByIdentifier, resultOrderType);
-            if (experimentResources != null && !experimentResources.isEmpty()) {
-                for (ExperimentResource ex : experimentResources) {
-                    experimentSummaries.add(ThriftDataModelConversion.getExperimentSummary(ex));
-                }
-            }
-            return experimentSummaries;
+            ExperimentStatistics experimentStatistics = new ExperimentStatistics();
+            ExperimentStatisticsResource experimentStatisticsResource = workerResource.getExperimentStatistics(
+                    filters.get(Constants.FieldConstants.ExperimentConstants.GATEWAY),
+                    new Timestamp(Long.parseLong(filters.get(Constants.FieldConstants.ExperimentConstants.FROM_DATE))),
+                    new Timestamp(Long.parseLong(filters.get(Constants.FieldConstants.ExperimentConstants.TO_DATE)))
+            );
 
-        } catch (Exception e) {
-            logger.error("Error while retrieving experiment summary from registry", e);
-            throw new RegistryException(e);
-        }
-    }
+            experimentStatistics.setAllExperimentCount(experimentStatisticsResource.getAllExperimentCount());
+            experimentStatistics.setCompletedExperimentCount(experimentStatisticsResource.getCompletedExperimentCount());
+            experimentStatistics.setFailedExperimentCount(experimentStatisticsResource.getFailedExperimentCount());
+            experimentStatistics.setCancelledExperimentCount(experimentStatisticsResource.getCancelledExperimentCount());
 
+            ArrayList<ExperimentSummary> experimentSummaries = new ArrayList();
+            for (ExperimentSummaryResource ex : experimentStatisticsResource.getAllExperiments()) {
+                experimentSummaries.add(ThriftDataModelConversion.getExperimentSummary(ex));
+            }
+            experimentStatistics.setAllExperiments(experimentSummaries);
 
-    /**
-     * Search experiements based on creation time within specified time interval.
-     * @param fromTime
-     * @param toTime
-     * @return
-     * @throws RegistryException
-     */
-    public List<ExperimentSummary> searchExperimentsByCreationTime(Timestamp fromTime, Timestamp toTime) throws RegistryException {
-        return searchExperimentsByCreationTime(fromTime, toTime, -1, -1, null, null);
-    }
+            experimentSummaries = new ArrayList();
+            for (ExperimentSummaryResource ex : experimentStatisticsResource.getCompletedExperiments()) {
+                experimentSummaries.add(ThriftDataModelConversion.getExperimentSummary(ex));
+            }
+            experimentStatistics.setCompletedExperiments(experimentSummaries);
 
-    /**
-     * Search experiements based on creation time within specified time interval with pagination.
-     * @param fromTime
-     * @param toTime
-     * @param limit
-     * @param offset
-     * @param orderByIdentifier
-     * @param resultOrderType
-     * @return
-     * @throws RegistryException
-     */
-    public List<ExperimentSummary> searchExperimentsByCreationTime(
-            Timestamp fromTime, Timestamp toTime, int limit,
-            int offset, Object orderByIdentifier, ResultOrderType resultOrderType) throws RegistryException {
-        try {
-            List<ExperimentSummary> experimentSummaries = new ArrayList<ExperimentSummary>();
-            List<ExperimentResource> experimentResources
-                    = workerResource.searchExperimentsByCreationTime(fromTime, toTime, limit, offset,
-                    orderByIdentifier, resultOrderType);
-            if (experimentResources != null && !experimentResources.isEmpty()) {
-                for (ExperimentResource ex : experimentResources) {
-                    experimentSummaries.add(ThriftDataModelConversion.getExperimentSummary(ex));
-                }
+            experimentSummaries = new ArrayList();
+            for (ExperimentSummaryResource ex : experimentStatisticsResource.getFailedExperiments()) {
+                experimentSummaries.add(ThriftDataModelConversion.getExperimentSummary(ex));
             }
-            return experimentSummaries;
+            experimentStatistics.setFailedExperiments(experimentSummaries);
 
-        } catch (Exception e) {
-            logger.error("Error while retrieving experiment summary from registry", e);
+            experimentSummaries = new ArrayList();
+            for (ExperimentSummaryResource ex : experimentStatisticsResource.getCancelledExperiments()) {
+                experimentSummaries.add(ThriftDataModelConversion.getExperimentSummary(ex));
+            }
+            experimentStatistics.setCancelledExperiments(experimentSummaries);
+
+            return experimentStatistics;
+        } catch (RegistryException e) {
+            logger.error("Error while retrieving experiment statistics from registry", e);
             throw new RegistryException(e);
         }
     }

http://git-wip-us.apache.org/repos/asf/airavata/blob/811fd17e/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/RegistryImpl.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/RegistryImpl.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/RegistryImpl.java
index 953b11e..8ced7a3 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/RegistryImpl.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/RegistryImpl.java
@@ -544,6 +544,9 @@ public class RegistryImpl implements Registry {
                         result.add(ex);
                     }
                     return result;
+                case EXPERIMENT_STATISTICS:
+                    result.add(experimentRegistry.getExperimentStatistics(filters));
+                    return result;
                 default:
                     logger.error("Unsupported data type...", new UnsupportedOperationException());
                     throw new UnsupportedOperationException();

http://git-wip-us.apache.org/repos/asf/airavata/blob/811fd17e/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Experiment.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Experiment.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Experiment.java
index 1c2d430..4a30d6d 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Experiment.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/Experiment.java
@@ -26,6 +26,7 @@ import org.apache.openjpa.persistence.DataCache;
 import javax.persistence.*;
 import java.io.Serializable;
 import java.sql.Timestamp;
+import java.util.Collection;
 
 @Entity
 @Table(name = "EXPERIMENT")
@@ -73,6 +74,9 @@ public class Experiment implements Serializable {
     @JoinColumn(name = "EXECUTION_USER", referencedColumnName = "USER_NAME")
     private Users user;
 
+    @OneToMany(fetch=FetchType.LAZY, mappedBy = "experiment")
+    private Collection<Status> statuses;
+
     public String getExpId() {
         return expId;
     }
@@ -208,4 +212,12 @@ public class Experiment implements Serializable {
     public void setGatewayExecutionId(String gatewayExecutionId) {
         this.gatewayExecutionId = gatewayExecutionId;
     }
+
+    public Collection<Status> getStatuses() {
+        return statuses;
+    }
+
+    public void setStatuses(Collection<Status> statuses) {
+        this.statuses = statuses;
+    }
 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/811fd17e/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ExperimentStatisticsResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ExperimentStatisticsResource.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ExperimentStatisticsResource.java
new file mode 100644
index 0000000..16e8542
--- /dev/null
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ExperimentStatisticsResource.java
@@ -0,0 +1,133 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.persistance.registry.jpa.resources;
+
+import org.apache.airavata.persistance.registry.jpa.Resource;
+import org.apache.airavata.persistance.registry.jpa.ResourceType;
+import org.apache.airavata.registry.cpi.RegistryException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.el.MethodNotFoundException;
+import java.util.List;
+
+public class ExperimentStatisticsResource extends AbstractResource {
+    private final static Logger logger = LoggerFactory.getLogger(ExperimentStatisticsResource.class);
+
+    private int allExperimentCount;
+    private int completedExperimentCount;
+    private int cancelledExperimentCount;
+    private int failedExperimentCount;
+
+    private List<ExperimentSummaryResource> allExperiments;
+    private List<ExperimentSummaryResource> completedExperiments;
+    private List<ExperimentSummaryResource> cancelledExperiments;
+    private List<ExperimentSummaryResource> failedExperiments;
+
+    @Override
+    public ExperimentResource create(ResourceType type) throws RegistryException {
+        throw new MethodNotFoundException();
+    }
+
+    @Override
+    public void remove(ResourceType type, Object name) throws RegistryException {
+        throw new MethodNotFoundException();
+    }
+
+    @Override
+    public ExperimentResource get(ResourceType type, Object name) throws RegistryException {
+        throw new MethodNotFoundException();
+    }
+
+    @Override
+    public List<Resource> get(ResourceType type) throws RegistryException {
+        throw new MethodNotFoundException();
+    }
+
+    @Override
+    public void save() throws RegistryException {
+        throw new MethodNotFoundException();
+    }
+
+    public int getAllExperimentCount() {
+        return allExperimentCount;
+    }
+
+    public void setAllExperimentCount(int allExperimentCount) {
+        this.allExperimentCount = allExperimentCount;
+    }
+
+    public int getCompletedExperimentCount() {
+        return completedExperimentCount;
+    }
+
+    public void setCompletedExperimentCount(int completedExperimentCount) {
+        this.completedExperimentCount = completedExperimentCount;
+    }
+
+    public int getCancelledExperimentCount() {
+        return cancelledExperimentCount;
+    }
+
+    public void setCancelledExperimentCount(int cancelledExperimentCount) {
+        this.cancelledExperimentCount = cancelledExperimentCount;
+    }
+
+    public int getFailedExperimentCount() {
+        return failedExperimentCount;
+    }
+
+    public void setFailedExperimentCount(int failedExperimentCount) {
+        this.failedExperimentCount = failedExperimentCount;
+    }
+
+    public List<ExperimentSummaryResource> getAllExperiments() {
+        return allExperiments;
+    }
+
+    public void setAllExperiments(List<ExperimentSummaryResource> allExperiments) {
+        this.allExperiments = allExperiments;
+    }
+
+    public List<ExperimentSummaryResource> getCompletedExperiments() {
+        return completedExperiments;
+    }
+
+    public void setCompletedExperiments(List<ExperimentSummaryResource> completedExperiments) {
+        this.completedExperiments = completedExperiments;
+    }
+
+    public List<ExperimentSummaryResource> getCancelledExperiments() {
+        return cancelledExperiments;
+    }
+
+    public void setCancelledExperiments(List<ExperimentSummaryResource> cancelledExperiments) {
+        this.cancelledExperiments = cancelledExperiments;
+    }
+
+    public List<ExperimentSummaryResource> getFailedExperiments() {
+        return failedExperiments;
+    }
+
+    public void setFailedExperiments(List<ExperimentSummaryResource> failedExperiments) {
+        this.failedExperiments = failedExperiments;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/811fd17e/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ExperimentSummaryResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ExperimentSummaryResource.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ExperimentSummaryResource.java
new file mode 100644
index 0000000..10c1fff
--- /dev/null
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ExperimentSummaryResource.java
@@ -0,0 +1,135 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.persistance.registry.jpa.resources;
+
+import org.apache.airavata.persistance.registry.jpa.Resource;
+import org.apache.airavata.persistance.registry.jpa.ResourceType;
+import org.apache.airavata.registry.cpi.RegistryException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.el.MethodNotFoundException;
+import java.sql.Timestamp;
+import java.util.List;
+
+public class ExperimentSummaryResource extends AbstractResource {
+    private final static Logger logger = LoggerFactory.getLogger(ExperimentSummaryResource.class);
+
+    private String executionUser;
+    private String expID;
+    private String projectID;
+    private Timestamp creationTime;
+    private String expName;
+    private String description;
+    private String applicationId;
+
+    private StatusResource status;
+
+    @Override
+    public ExperimentResource create(ResourceType type) throws RegistryException {
+        throw new MethodNotFoundException();
+    }
+
+    @Override
+    public void remove(ResourceType type, Object name) throws RegistryException {
+        throw new MethodNotFoundException();
+    }
+
+    @Override
+    public ExperimentResource get(ResourceType type, Object name) throws RegistryException {
+        throw new MethodNotFoundException();
+    }
+
+    @Override
+    public List<Resource> get(ResourceType type) throws RegistryException {
+        throw new MethodNotFoundException();
+    }
+
+
+    @Override
+    public void save() throws RegistryException {
+        throw new MethodNotFoundException();
+    }
+
+    public String getExecutionUser() {
+        return executionUser;
+    }
+
+    public void setExecutionUser(String executionUser) {
+        this.executionUser = executionUser;
+    }
+
+    public String getExpID() {
+        return expID;
+    }
+
+    public void setExpID(String expID) {
+        this.expID = expID;
+    }
+
+    public String getProjectID() {
+        return projectID;
+    }
+
+    public void setProjectID(String projectID) {
+        this.projectID = projectID;
+    }
+
+    public Timestamp getCreationTime() {
+        return creationTime;
+    }
+
+    public void setCreationTime(Timestamp creationTime) {
+        this.creationTime = creationTime;
+    }
+
+    public String getExpName() {
+        return expName;
+    }
+
+    public void setExpName(String expName) {
+        this.expName = expName;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    public String getApplicationId() {
+        return applicationId;
+    }
+
+    public void setApplicationId(String applicationId) {
+        this.applicationId = applicationId;
+    }
+
+    public StatusResource getStatus() {
+        return status;
+    }
+
+    public void setStatus(StatusResource status) {
+        this.status = status;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/811fd17e/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/WorkerResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/WorkerResource.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/WorkerResource.java
index d3609b8..5b9dfe4 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/WorkerResource.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/WorkerResource.java
@@ -27,20 +27,21 @@ import org.apache.airavata.persistance.registry.jpa.ResourceType;
 import org.apache.airavata.persistance.registry.jpa.ResourceUtils;
 import org.apache.airavata.persistance.registry.jpa.model.*;
 import org.apache.airavata.persistance.registry.jpa.utils.QueryGenerator;
+import org.apache.airavata.registry.cpi.RegistryException;
 import org.apache.airavata.registry.cpi.ResultOrderType;
 import org.apache.airavata.registry.cpi.utils.Constants;
 import org.apache.airavata.registry.cpi.utils.StatusType;
+import org.apache.openjpa.persistence.OpenJPAPersistence;
+import org.apache.openjpa.persistence.OpenJPAQuery;
+import org.apache.openjpa.persistence.jdbc.FetchMode;
+import org.apache.openjpa.persistence.jdbc.JDBCFetchPlan;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.apache.airavata.registry.cpi.RegistryException;
 
 import javax.persistence.EntityManager;
 import javax.persistence.Query;
 import java.sql.Timestamp;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
+import java.util.*;
 
 public class WorkerResource extends AbstractResource {
     private final static Logger logger = LoggerFactory.getLogger(WorkerResource.class);
@@ -612,21 +613,13 @@ public class WorkerResource extends AbstractResource {
     }
 
     /**
-     * To search experiments of user with the given filter criteria. All the matching results will be sent.
-     * Results are not ordered in any order
-     * @param filters
-     * @return
-     * @throws RegistryException
-     */
-    public List<ExperimentResource> searchExperiments (Map<String, String> filters) throws RegistryException{
-        return searchExperiments(filters, -1, -1, null, null);
-    }
-
-    /**
-     * To search the experiments of user with the given filter criteria and retrieve the results with
+     * To search the experiments of user with the given time period and filter criteria and retrieve the results with
      * pagination support. Results can be ordered based on an identifier (i.e column) either ASC or
-     * DESC. But in the current implementation ordering is only supported based on creationTime
+     * DESC. But in the current implementation ordering is only supported based on creationTime. Also if
+     * time period values i.e fromTime and toTime are null they will be ignored.
      *
+     * @param fromTime
+     * @param toTime
      * @param filters
      * @param limit
      * @param offset
@@ -635,116 +628,35 @@ public class WorkerResource extends AbstractResource {
      * @return
      * @throws RegistryException
      */
-    public List<ExperimentResource> searchExperiments(Map<String, String> filters, int limit,
-                                                      int offset, Object orderByIdentifier, ResultOrderType resultOrderType) throws RegistryException {
-
-        List<ExperimentResource> result = new ArrayList<ExperimentResource>();
+    public List<ExperimentSummaryResource> searchExperiments(Timestamp fromTime, Timestamp toTime, Map<String, String> filters, int limit,
+                                                             int offset, Object orderByIdentifier, ResultOrderType resultOrderType) throws RegistryException {
+        List<ExperimentSummaryResource> result = new ArrayList();
         EntityManager em = null;
         try {
-            String query = "SELECT e from Experiment e WHERE ";
-            if (filters != null && filters.size() != 0) {
-                for (String field : filters.keySet()) {
-                    String filterVal = filters.get(field);
-                    if (field.equals(ExperimentConstants.EXECUTION_USER)) {
-                        query += "e." + field + "= '" + filterVal + "' AND ";
-                    }else if (field.equals(ExperimentConstants.GATEWAY_ID)) {
-                        query += "e." + field + "= '" + filterVal + "' AND ";
-                    } else if (field.equals(ExperimentConstants.PROJECT_ID)) {
-                        query += "e." + field + "= '" + filterVal + "' AND ";
-                    } else {
-                        if (filterVal.contains("*")){
-                            filterVal = filterVal.replaceAll("\\*", "");
-                        }
-                        query += "e." + field + " LIKE '%" + filterVal + "%' AND ";
-                    }
-                }
-            }
-            query = query.substring(0, query.length() - 5);
-
-            //ordering
-            if( orderByIdentifier != null && resultOrderType != null
-                    && orderByIdentifier.equals(Constants.FieldConstants.ExperimentConstants.CREATION_TIME)){
-                String order = (resultOrderType == ResultOrderType.ASC) ? "ASC" : "DESC";
-                query += " ORDER BY e." + ExperimentConstants.CREATION_TIME + " " + order;
-            }
-
-            em = ResourceUtils.getEntityManager();
-            em.getTransaction().begin();
-            Query q;
-
-            //pagination
-            if(offset>=0 && limit >=0){
-                q = em.createQuery(query).setFirstResult(offset).setMaxResults(limit);
-            }else{
-                q = em.createQuery(query);
+            String query = "SELECT e, s FROM Experiment e " +
+                    ",Status s WHERE e.expId=s.expId AND " +
+                    "s.statusType='" + StatusType.EXPERIMENT + "' AND ";
+            if (filters.get(StatusConstants.STATE) != null) {
+                String experimentState = ExperimentState.valueOf(filters.get(StatusConstants.STATE)).toString();
+                query += "s.state='" + experimentState + "' AND ";
             }
 
-            List resultList = q.getResultList();
-            for (Object o : resultList) {
-                Experiment experiment = (Experiment) o;
-                ExperimentResource experimentResource =
-                        (ExperimentResource) Utils.getResource(ResourceType.EXPERIMENT, experiment);
-                result.add(experimentResource);
-            }
-            em.getTransaction().commit();
-            em.close();
-        } catch (Exception e) {
-            logger.error(e.getMessage(), e);
-            throw new RegistryException(e);
-        } finally {
-            if (em != null && em.isOpen()) {
-                if (em.getTransaction().isActive()){
-                    em.getTransaction().rollback();
-                }
-                em.close();
+            if (toTime != null && fromTime != null && toTime.after(fromTime)) {
+                query += "e.creationTime > '" + fromTime + "' " + "AND e.creationTime <'" + toTime + "' AND ";
             }
-        }
-        return result;
-    }
-
-    /**
-     * Method to get experiments by state
-     * @param filters
-     * @return
-     * @throws RegistryException
-     */
-    public List<ExperimentResource> searchExperimentsByState (Map<String, String> filters) throws RegistryException{
-        return searchExperimentsByState(filters, -1, -1, null, null);
-    }
-
-    /**
-     * Method to get experiments of the given state with pagination and ordering
-     * @param filters
-     * @param limit
-     * @param offset
-     * @param orderByIdentifier
-     * @param resultOrderType
-     * @return
-     * @throws RegistryException
-     */
-    public List<ExperimentResource> searchExperimentsByState (Map<String, String> filters, int limit, int offset,
-            Object orderByIdentifier, ResultOrderType resultOrderType) throws RegistryException{
-        List<ExperimentResource> result = new ArrayList<ExperimentResource>();
-        EntityManager em = null;
-        try {
-            String experimentState = ExperimentState.valueOf(filters.get(StatusConstants.STATE)).toString();
-            String query = "SELECT e FROM Status s " +
-                    "JOIN s.experiment e " +
-                    "WHERE s.state='" + experimentState +  "' " +
-                    "AND s.statusType='" + StatusType.EXPERIMENT + "' AND ";
 
             filters.remove(StatusConstants.STATE);
-            if (filters.size() != 0) {
+            if (filters != null && filters.size() != 0) {
                 for (String field : filters.keySet()) {
                     String filterVal = filters.get(field);
                     if (field.equals(ExperimentConstants.EXECUTION_USER)) {
                         query += "e." + field + "= '" + filterVal + "' AND ";
-                    }else if (field.equals(ExperimentConstants.GATEWAY_ID)) {
+                    } else if (field.equals(ExperimentConstants.GATEWAY_ID)) {
                         query += "e." + field + "= '" + filterVal + "' AND ";
                     } else if (field.equals(ExperimentConstants.PROJECT_ID)) {
                         query += "e." + field + "= '" + filterVal + "' AND ";
                     } else {
-                        if (filterVal.contains("*")){
+                        if (filterVal.contains("*")) {
                             filterVal = filterVal.replaceAll("\\*", "");
                         }
                         query += "e." + field + " LIKE '%" + filterVal + "%' AND ";
@@ -754,8 +666,8 @@ public class WorkerResource extends AbstractResource {
             query = query.substring(0, query.length() - 5);
 
             //ordering
-            if( orderByIdentifier != null && resultOrderType != null
-                    && orderByIdentifier.equals(Constants.FieldConstants.ExperimentConstants.CREATION_TIME)){
+            if (orderByIdentifier != null && resultOrderType != null
+                    && orderByIdentifier.equals(Constants.FieldConstants.ExperimentConstants.CREATION_TIME)) {
                 String order = (resultOrderType == ResultOrderType.ASC) ? "ASC" : "DESC";
                 query += " ORDER BY e." + ExperimentConstants.CREATION_TIME + " " + order;
             }
@@ -765,17 +677,23 @@ public class WorkerResource extends AbstractResource {
             Query q;
 
             //pagination
-            if(offset>=0 && limit >=0){
+            if (offset >= 0 && limit >= 0) {
                 q = em.createQuery(query).setFirstResult(offset).setMaxResults(limit);
-            }else{
+            } else {
                 q = em.createQuery(query);
             }
+            OpenJPAQuery kq = OpenJPAPersistence.cast(q);
+            JDBCFetchPlan fetch = (JDBCFetchPlan) kq.getFetchPlan();
+            fetch.setEagerFetchMode(FetchMode.JOIN);
 
             List resultList = q.getResultList();
             for (Object o : resultList) {
-                Experiment experiment = (Experiment) o;
-                ExperimentResource experimentResource = (ExperimentResource) Utils.getResource(ResourceType.EXPERIMENT, experiment);
-                result.add(experimentResource);
+                Experiment experiment = (Experiment) ((Object[]) o)[0];
+                Status experimentStatus = (Status) ((Object[]) o)[1];
+                experiment.setStatuses(Arrays.asList(experimentStatus));
+                ExperimentSummaryResource experimentSummaryResource =
+                        (ExperimentSummaryResource) Utils.getResource(ResourceType.EXPERIMENT_SUMMARY, experiment);
+                result.add(experimentSummaryResource);
             }
             em.getTransaction().commit();
             em.close();
@@ -784,7 +702,7 @@ public class WorkerResource extends AbstractResource {
             throw new RegistryException(e);
         } finally {
             if (em != null && em.isOpen()) {
-                if (em.getTransaction().isActive()){
+                if (em.getTransaction().isActive()) {
                     em.getTransaction().rollback();
                 }
                 em.close();
@@ -793,102 +711,66 @@ public class WorkerResource extends AbstractResource {
         return result;
     }
 
-    /**
-     * Search experiments from creation time between interval. Returns all results
-     * @param fromTime
-     * @param toTime
-     * @return
-     * @throws RegistryException
-     */
-    public List<ExperimentResource> searchExperimentsByCreationTime (Timestamp fromTime, Timestamp toTime) throws RegistryException{
-        return  searchExperimentsByCreationTime(fromTime, toTime, -1, -1, null, null);
-    }
-
 
     /**
-     * Search experiments from creation time between interval. Results are ordered creation time DESC.
-     * Supports pagination
+     * Method to get experiment statistics for a gateway
      *
+     * @param gatewayId
      * @param fromTime
      * @param toTime
-     * @param limit
-     * @param offset
-     * @param orderByIdentifier
-     * @param resultOrderType
      * @return
      * @throws RegistryException
      */
-    public List<ExperimentResource> searchExperimentsByCreationTime(
-            Timestamp fromTime, Timestamp toTime, int limit, int offset, Object orderByIdentifier,
-            ResultOrderType resultOrderType) throws RegistryException{
+    public ExperimentStatisticsResource getExperimentStatistics(String gatewayId, Timestamp fromTime, Timestamp toTime) throws RegistryException {
+        ExperimentStatisticsResource experimentStatisticsResource = new ExperimentStatisticsResource();
+        List<ExperimentSummaryResource> allExperiments = getExperimentStatisticsForState(null, gatewayId, fromTime, toTime);
+        experimentStatisticsResource.setAllExperimentCount(allExperiments.size());
+        experimentStatisticsResource.setAllExperiments(allExperiments);
 
-        List<ExperimentResource> result = new ArrayList<ExperimentResource>();
-        EntityManager em = null;
-        try {
-            String query = "SELECT e FROM Experiment e " +
-                    "WHERE e.creationTime > '" + fromTime +  "' " +
-                    "AND e.creationTime <'" + toTime + "'";
+        List<ExperimentSummaryResource> completedExperiments = getExperimentStatisticsForState(ExperimentState.COMPLETED, gatewayId, fromTime, toTime);
+        experimentStatisticsResource.setCompletedExperimentCount(completedExperiments.size());
+        experimentStatisticsResource.setCompletedExperiments(completedExperiments);
 
-            //ordering
-            if( orderByIdentifier != null && resultOrderType != null
-                    && orderByIdentifier.equals(Constants.FieldConstants.ExperimentConstants.CREATION_TIME)){
-                String order = (resultOrderType == ResultOrderType.ASC) ? "ASC" : "DESC";
-                query += " ORDER BY e." + ExperimentConstants.CREATION_TIME + " " + order;
-            }
+        List<ExperimentSummaryResource> failedExperiments = getExperimentStatisticsForState(ExperimentState.FAILED, gatewayId, fromTime, toTime);
+        experimentStatisticsResource.setFailedExperimentCount(failedExperiments.size());
+        experimentStatisticsResource.setFailedExperiments(failedExperiments);
 
-            em = ResourceUtils.getEntityManager();
-            em.getTransaction().begin();
-            Query q;
-
-            //pagination
-            if(offset>=0 && limit >=0){
-                q = em.createQuery(query).setFirstResult(offset).setMaxResults(limit);
-            }else{
-                q = em.createQuery(query);
-            }
+        List<ExperimentSummaryResource> cancelledExperiments = getExperimentStatisticsForState(ExperimentState.CANCELED, gatewayId, fromTime, toTime);
+        experimentStatisticsResource.setCancelledExperimentCount(cancelledExperiments.size());
+        experimentStatisticsResource.setCancelledExperiments(cancelledExperiments);
 
-            List resultList = q.getResultList();
-            for (Object o : resultList) {
-                Experiment experiment = (Experiment) o;
-                ExperimentResource experimentResource = (ExperimentResource) Utils.getResource(ResourceType.EXPERIMENT, experiment);
-                result.add(experimentResource);
-            }
-            em.getTransaction().commit();
-            em.close();
-        } catch (Exception e) {
-            logger.error(e.getMessage(), e);
-            throw new RegistryException(e);
-        } finally {
-            if (em != null && em.isOpen()) {
-                if (em.getTransaction().isActive()){
-                    em.getTransaction().rollback();
-                }
-                em.close();
-            }
-        }
-        return result;
+        return experimentStatisticsResource;
     }
 
-    /**
-     *
-     * @return list of experiments for the user
-     */
-    public List<ExperimentResource> getExperimentsByCaching(String user) throws RegistryException{
-        List<ExperimentResource> result = new ArrayList<ExperimentResource>();
+    private List<ExperimentSummaryResource> getExperimentStatisticsForState(
+            ExperimentState expState, String gatewayId, Timestamp fromTime, Timestamp toTime) throws RegistryException {
         EntityManager em = null;
+        List<ExperimentSummaryResource> result = new ArrayList();
         try {
-            String query = "SELECT e from Experiment e WHERE e.executionUser = '" + user + "'";
+            String query = "SELECT e, s FROM Experiment e " +
+                    ",Status s WHERE e.expId=s.expId AND " +
+                    "s.statusType='" + StatusType.EXPERIMENT + "' AND ";
+            if (expState != null) {
+                query += "s.state='" + expState.toString() + "' AND ";
+            }
+            query += "e.creationTime > '" + fromTime + "' " + "AND e.creationTime <'" + toTime + "' AND ";
+            query += "e." + ExperimentConstants.GATEWAY_ID + "= '" + gatewayId + "'";
+
             em = ResourceUtils.getEntityManager();
-//        OpenJPAEntityManagerFactory oemf = OpenJPAPersistence.cast(em.getEntityManagerFactory());
-//        QueryResultCache qcache = oemf.getQueryResultCache();
-            // qcache.evictAll(Experiment.class);
             em.getTransaction().begin();
             Query q = em.createQuery(query);
+            OpenJPAQuery kq = OpenJPAPersistence.cast(q);
+            JDBCFetchPlan fetch = (JDBCFetchPlan) kq.getFetchPlan();
+            fetch.setEagerFetchMode(FetchMode.JOIN);
+
             List resultList = q.getResultList();
             for (Object o : resultList) {
-                Experiment experiment = (Experiment) o;
-                ExperimentResource experimentResource = (ExperimentResource) Utils.getResource(ResourceType.EXPERIMENT, experiment);
-                result.add(experimentResource);
+                Experiment experiment = (Experiment) ((Object[]) o)[0];
+                Status experimentStatus = (Status) ((Object[]) o)[1];
+                experiment.setStatuses(Arrays.asList(experimentStatus));
+                ExperimentSummaryResource experimentSummaryResource =
+                        (ExperimentSummaryResource) Utils.getResource(ResourceType.EXPERIMENT_SUMMARY, experiment);
+                result.add(experimentSummaryResource);
             }
             em.getTransaction().commit();
             em.close();
@@ -897,7 +779,7 @@ public class WorkerResource extends AbstractResource {
             throw new RegistryException(e);
         } finally {
             if (em != null && em.isOpen()) {
-                if (em.getTransaction().isActive()){
+                if (em.getTransaction().isActive()) {
                     em.getTransaction().rollback();
                 }
                 em.close();

http://git-wip-us.apache.org/repos/asf/airavata/blob/811fd17e/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/utils/ThriftDataModelConversion.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/utils/ThriftDataModelConversion.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/utils/ThriftDataModelConversion.java
index 8f385e8..53b3919 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/utils/ThriftDataModelConversion.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/utils/ThriftDataModelConversion.java
@@ -21,40 +21,12 @@
 
 package org.apache.airavata.persistance.registry.jpa.utils;
 
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.airavata.common.utils.StringUtil;
-import org.apache.airavata.model.appcatalog.appinterface.*;
+import org.apache.airavata.model.appcatalog.appinterface.DataType;
+import org.apache.airavata.model.appcatalog.appinterface.InputDataObjectType;
+import org.apache.airavata.model.appcatalog.appinterface.OutputDataObjectType;
 import org.apache.airavata.model.workspace.Gateway;
 import org.apache.airavata.model.workspace.Project;
-import org.apache.airavata.model.workspace.experiment.ActionableGroup;
-import org.apache.airavata.model.workspace.experiment.AdvancedInputDataHandling;
-import org.apache.airavata.model.workspace.experiment.AdvancedOutputDataHandling;
-import org.apache.airavata.model.workspace.experiment.ApplicationStatus;
-import org.apache.airavata.model.workspace.experiment.ComputationalResourceScheduling;
-import org.apache.airavata.model.workspace.experiment.CorrectiveAction;
-import org.apache.airavata.model.workspace.experiment.DataTransferDetails;
-import org.apache.airavata.model.workspace.experiment.ErrorCategory;
-import org.apache.airavata.model.workspace.experiment.ErrorDetails;
-import org.apache.airavata.model.workspace.experiment.ExecutionUnit;
-import org.apache.airavata.model.workspace.experiment.Experiment;
-import org.apache.airavata.model.workspace.experiment.ExperimentState;
-import org.apache.airavata.model.workspace.experiment.ExperimentStatus;
-import org.apache.airavata.model.workspace.experiment.ExperimentSummary;
-import org.apache.airavata.model.workspace.experiment.JobDetails;
-import org.apache.airavata.model.workspace.experiment.JobState;
-import org.apache.airavata.model.workspace.experiment.JobStatus;
-import org.apache.airavata.model.workspace.experiment.QualityOfServiceParams;
-import org.apache.airavata.model.workspace.experiment.TaskDetails;
-import org.apache.airavata.model.workspace.experiment.TaskState;
-import org.apache.airavata.model.workspace.experiment.TaskStatus;
-import org.apache.airavata.model.workspace.experiment.TransferState;
-import org.apache.airavata.model.workspace.experiment.TransferStatus;
-import org.apache.airavata.model.workspace.experiment.UserConfigurationData;
-import org.apache.airavata.model.workspace.experiment.WorkflowNodeDetails;
-import org.apache.airavata.model.workspace.experiment.WorkflowNodeState;
-import org.apache.airavata.model.workspace.experiment.WorkflowNodeStatus;
+import org.apache.airavata.model.workspace.experiment.*;
 import org.apache.airavata.persistance.registry.jpa.Resource;
 import org.apache.airavata.persistance.registry.jpa.ResourceType;
 import org.apache.airavata.persistance.registry.jpa.resources.*;
@@ -62,6 +34,9 @@ import org.apache.airavata.registry.cpi.RegistryException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.util.ArrayList;
+import java.util.List;
+
 public class ThriftDataModelConversion {
     private final static Logger logger = LoggerFactory.getLogger(ThriftDataModelConversion.class);
 
@@ -159,26 +134,20 @@ public class ThriftDataModelConversion {
         return null;
     }
 
-    public static ExperimentSummary getExperimentSummary(ExperimentResource experimentResource) throws RegistryException {
-        if (experimentResource != null){
+    public static ExperimentSummary getExperimentSummary(ExperimentSummaryResource experimentSummaryResource) throws RegistryException {
+        if (experimentSummaryResource != null){
             ExperimentSummary experimentSummary = new ExperimentSummary();
-            if (experimentResource.getProject()!= null){
-                experimentSummary.setProjectID(experimentResource.getProject().getId());
-            }
-            experimentSummary.setExperimentID(experimentResource.getExpID());
-            experimentSummary.setCreationTime(experimentResource.getCreationTime().getTime());
-            experimentSummary.setUserName(experimentResource.getExecutionUser());
-            experimentSummary.setName(experimentResource.getExpName());
-            experimentSummary.setDescription(experimentResource.getDescription());
-            experimentSummary.setApplicationId(experimentResource.getApplicationId());
-            StatusResource experimentStatus = experimentResource.getExperimentStatus();
+            experimentSummary.setProjectID(experimentSummaryResource.getProjectID());
+            experimentSummary.setExperimentID(experimentSummaryResource.getExpID());
+            experimentSummary.setCreationTime(experimentSummaryResource.getCreationTime().getTime());
+            experimentSummary.setUserName(experimentSummaryResource.getExecutionUser());
+            experimentSummary.setName(experimentSummaryResource.getExpName());
+            experimentSummary.setDescription(experimentSummaryResource.getDescription());
+            experimentSummary.setApplicationId(experimentSummaryResource.getApplicationId());
+            StatusResource experimentStatus = experimentSummaryResource.getStatus();
             if (experimentStatus != null){
                 experimentSummary.setExperimentStatus(getExperimentStatus(experimentStatus));
             }
-            List<ErrorDetailResource> errorDetails = experimentResource.getErrorDetails();
-            if (errorDetails!= null && !errorDetails.isEmpty()){
-                experimentSummary.setErrors(getErrorDetailList(errorDetails));
-            }
             return experimentSummary;
         }
         return null;

http://git-wip-us.apache.org/repos/asf/airavata/blob/811fd17e/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/RegistryModelType.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/RegistryModelType.java b/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/RegistryModelType.java
index b6557f3..d3ef8f6 100644
--- a/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/RegistryModelType.java
+++ b/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/RegistryModelType.java
@@ -26,6 +26,7 @@ public enum RegistryModelType {
     PROJECT,
     GATEWAY,
     EXPERIMENT,
+    EXPERIMENT_STATISTICS,
     EXPERIMENT_INPUT,
     EXPERIMENT_OUTPUT,
     EXPERIMENT_STATUS,


Mime
View raw message