@@ -697,6 +697,7 @@ public Pair<List<? extends NetworkACLItem>, Integer> listNetworkACLItems(final L
697697 final String trafficType = cmd .getTrafficType ();
698698 final String protocol = cmd .getProtocol ();
699699 final String action = cmd .getAction ();
700+ final String keyword = cmd .getKeyword ();
700701 final Map <String , String > tags = cmd .getTags ();
701702 final Account caller = CallContext .current ().getCallingAccount ();
702703
@@ -708,6 +709,7 @@ public Pair<List<? extends NetworkACLItem>, Integer> listNetworkACLItems(final L
708709 sb .and ("trafficType" , sb .entity ().getTrafficType (), Op .EQ );
709710 sb .and ("protocol" , sb .entity ().getProtocol (), Op .EQ );
710711 sb .and ("action" , sb .entity ().getAction (), Op .EQ );
712+ sb .and ("reason" , sb .entity ().getReason (), Op .EQ );
711713
712714 if (tags != null && !tags .isEmpty ()) {
713715 final SearchBuilder <ResourceTagVO > tagSearch = _resourceTagDao .createSearchBuilder ();
@@ -730,6 +732,12 @@ public Pair<List<? extends NetworkACLItem>, Integer> listNetworkACLItems(final L
730732
731733 final SearchCriteria <NetworkACLItemVO > sc = sb .create ();
732734
735+ if (StringUtils .isNotBlank (keyword )) {
736+ final SearchCriteria <NetworkACLItemVO > ssc = _networkACLItemDao .createSearchCriteria ();
737+ ssc .addOr ("protocol" , SearchCriteria .Op .LIKE , "%" + keyword + "%" );
738+ ssc .addOr ("reason" , SearchCriteria .Op .LIKE , "%" + keyword + "%" );
739+ sc .addAnd ("acl_id" , SearchCriteria .Op .SC , ssc );
740+ }
733741 if (id != null ) {
734742 sc .setParameters ("id" , id );
735743 }
@@ -747,7 +755,6 @@ public Pair<List<? extends NetworkACLItem>, Integer> listNetworkACLItems(final L
747755 if (trafficType != null ) {
748756 sc .setParameters ("trafficType" , trafficType );
749757 }
750-
751758 if (aclId != null ) {
752759 // Get VPC and check access
753760 final NetworkACL acl = _networkACLDao .findById (aclId );
@@ -764,7 +771,7 @@ public Pair<List<? extends NetworkACLItem>, Integer> listNetworkACLItems(final L
764771
765772 // aclId is not specified
766773 // List permitted VPCs and filter aclItems
767- final List <Long > permittedAccounts = new ArrayList <Long >();
774+ final List <Long > permittedAccounts = new ArrayList <>();
768775 Long domainId = cmd .getDomainId ();
769776 boolean isRecursive = cmd .isRecursive ();
770777 final String accountName = cmd .getAccountName ();
@@ -780,7 +787,7 @@ public Pair<List<? extends NetworkACLItem>, Integer> listNetworkACLItems(final L
780787 final SearchCriteria <VpcVO > scVpc = sbVpc .create ();
781788 _accountMgr .buildACLSearchCriteria (scVpc , domainId , isRecursive , permittedAccounts , listProjectResourcesCriteria );
782789 final List <VpcVO > vpcs = _vpcDao .search (scVpc , null );
783- final List <Long > vpcIds = new ArrayList <Long >();
790+ final List <Long > vpcIds = new ArrayList <>();
784791 for (final VpcVO vpc : vpcs ) {
785792 vpcIds .add (vpc .getId ());
786793 }
0 commit comments