cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kis...@apache.org
Subject [2/2] git commit: updated refs/heads/master to 79dc74d
Date Wed, 01 Jan 2014 11:36:40 GMT
CLOUDSTACK-5698: support network ACL list search by keyword

Conflicts:
	server/src/com/cloud/network/vpc/NetworkACLServiceImpl.java


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

Branch: refs/heads/master
Commit: 79dc74dcb85adfbc0b5b72925263b383e6155cda
Parents: faa503d
Author: Kishan Kavala <kishan@cloud.com>
Authored: Wed Jan 1 16:51:53 2014 +0530
Committer: Kishan Kavala <kishan@cloud.com>
Committed: Wed Jan 1 16:59:52 2014 +0530

----------------------------------------------------------------------
 .../src/com/cloud/network/vpc/NetworkACLServiceImpl.java | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/79dc74dc/server/src/com/cloud/network/vpc/NetworkACLServiceImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/vpc/NetworkACLServiceImpl.java b/server/src/com/cloud/network/vpc/NetworkACLServiceImpl.java
index a95ef1a..e5a59ff 100644
--- a/server/src/com/cloud/network/vpc/NetworkACLServiceImpl.java
+++ b/server/src/com/cloud/network/vpc/NetworkACLServiceImpl.java
@@ -116,6 +116,7 @@ public class NetworkACLServiceImpl extends ManagerBase implements NetworkACLServ
         String name = cmd.getName();
         Long networkId = cmd.getNetworkId();
         Long vpcId = cmd.getVpcId();
+        String keyword = cmd.getKeyword();
         SearchBuilder<NetworkACLVO> sb = _networkACLDao.createSearchBuilder();
         sb.and("id", sb.entity().getId(), Op.EQ);
         sb.and("name", sb.entity().getName(), Op.EQ);
@@ -130,7 +131,15 @@ public class NetworkACLServiceImpl extends ManagerBase implements NetworkACLServ
         }
 
         SearchCriteria<NetworkACLVO> sc = sb.create();
-        if (id != null) {
+
+        if (keyword != null) {
+            SearchCriteria<NetworkACLVO> ssc = _networkACLDao.createSearchCriteria();
+            ssc.addOr("name", SearchCriteria.Op.LIKE, "%" + keyword + "%");
+            ssc.addOr("description", SearchCriteria.Op.LIKE, "%" + keyword + "%");
+            sc.addAnd("name", SearchCriteria.Op.SC, ssc);
+        }
+
+        if(id != null){
             sc.setParameters("id", id);
         }
 


Mime
View raw message