airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scnakand...@apache.org
Subject [53/57] airavata git commit: return empty when accessible number of resources is zero
Date Thu, 28 Jul 2016 17:46:07 GMT
return empty when accessible number of resources is zero


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

Branch: refs/heads/develop
Commit: defc75b478327255469a10bcbf1e1c7781699f82
Parents: 1871ba1
Author: scnakandala <supun.nakandala@gmail.com>
Authored: Fri Jul 15 09:21:00 2016 -0400
Committer: scnakandala <supun.nakandala@gmail.com>
Committed: Fri Jul 15 09:21:00 2016 -0400

----------------------------------------------------------------------
 .../airavata/api/server/handler/AiravataServerHandler.java  | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/defc75b4/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
index a16429d..9c2877b 100644
--- a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
+++ b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
@@ -84,7 +84,6 @@ import org.apache.airavata.registry.core.app.catalog.resources.*;
 import org.apache.airavata.registry.core.app.catalog.util.AppCatalogThriftConversion;
 import org.apache.airavata.registry.core.experiment.catalog.ExpCatResourceUtils;
 import org.apache.airavata.registry.core.experiment.catalog.impl.RegistryFactory;
-import org.apache.airavata.registry.core.experiment.catalog.resources.ExperimentResource;
 import org.apache.airavata.registry.cpi.*;
 import org.apache.airavata.registry.cpi.utils.Constants;
 import org.apache.thrift.TException;
@@ -874,6 +873,10 @@ public class AiravataServerHandler implements Airavata.Iface {
             }
             List<String> accessibleProjIds  = new ArrayList<>();
             accessibleProjIds.addAll(getAllAccessibleResourcesForUser(userName+"@"+gatewayId,
ResourceType.PROJECT, ResourcePermissionType.READ));
+
+            if(accessibleProjIds.size() == 0)
+                return new ArrayList<>();
+
             List<Object> results = experimentCatalog.searchAllAccessible(ExperimentCatalogModelType.PROJECT,
accessibleProjIds,
                     regFilters, limit, offset, Constants.FieldConstants.ProjectConstants.CREATION_TIME,
ResultOrderType.DESC);
             for (Object object : results) {
@@ -954,6 +957,10 @@ public class AiravataServerHandler implements Airavata.Iface {
             }
             List<String> accessibleExpIds = new ArrayList<>();
             accessibleExpIds.addAll(getAllAccessibleResourcesForUser(userName + "@" + gatewayId,
ResourceType.EXPERIMENT, ResourcePermissionType.READ));
+
+            if(accessibleExpIds.size() == 0)
+                return new ArrayList<>();
+
             List<Object> results = experimentCatalog.searchAllAccessible(ExperimentCatalogModelType.EXPERIMENT,
                     accessibleExpIds, regFilters, limit,
                     offset, Constants.FieldConstants.ExperimentConstants.CREATION_TIME, ResultOrderType.DESC);


Mime
View raw message