You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sc...@apache.org on 2016/12/13 19:55:26 UTC

[2/6] airavata git commit: AIRAVATA-1792 Appname/hostname filtering

AIRAVATA-1792 Appname/hostname filtering

Username, appname and hostname filtering are implemented as substring
matching instead of exact matching.


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

Branch: refs/heads/develop
Commit: 7b7bb532cbf940e6d028c44cef0758a7a9c56e29
Parents: 465f766
Author: Marcus Christie <ma...@iu.edu>
Authored: Tue Dec 13 10:54:05 2016 -0500
Committer: Marcus Christie <ma...@iu.edu>
Committed: Tue Dec 13 10:54:05 2016 -0500

----------------------------------------------------------------------
 .../experiment/catalog/resources/WorkerResource.java    | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/7b7bb532/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/WorkerResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/WorkerResource.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/WorkerResource.java
index 50ca874..762829f 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/WorkerResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/WorkerResource.java
@@ -745,8 +745,16 @@ public class WorkerResource extends AbstractExpCatResource {
             query += "e.creationTime > '" + fromTime + "' " + "AND e.creationTime <'" + toTime + "' AND ";
             query += "e." + ExperimentConstants.GATEWAY_ID + "= '" + gatewayId + "' ";
             if (userName != null) {
-                query += "AND e.userName = :userName ";
-                queryParameters.put("userName", userName);
+                query += "AND e.userName LIKE :userName ";
+                queryParameters.put("userName", "%" + userName + "%");
+            }
+            if (applicationName != null) {
+                query += "AND e.executionId LIKE :applicationName ";
+                queryParameters.put("applicationName", "%" + applicationName + "%");
+            }
+            if (resourceHostName != null) {
+                query += "AND e.resourceHostId LIKE :resourceHostName ";
+                queryParameters.put("resourceHostName", "%" + resourceHostName + "%");
             }
             query += "ORDER BY e.creationTime DESC";