2424import javax .inject .Inject ;
2525import javax .naming .ConfigurationException ;
2626
27+ import com .cloud .utils .db .Filter ;
2728import org .apache .log4j .Logger ;
2829import org .springframework .stereotype .Component ;
2930
@@ -819,6 +820,8 @@ public Pair<List<? extends DedicatedResourceVO>, Integer> listDedicatedZones(Lis
819820 String accountName = cmd .getAccountName ();
820821 Long accountId = null ;
821822 Long affinityGroupId = cmd .getAffinityGroupId ();
823+ Long startIndex = cmd .getStartIndex ();
824+ Long pageSize = cmd .getPageSizeVal ();
822825
823826 if (accountName != null ) {
824827 if (domainId != null ) {
@@ -830,7 +833,8 @@ public Pair<List<? extends DedicatedResourceVO>, Integer> listDedicatedZones(Lis
830833 throw new InvalidParameterValueException ("Please specify the domain id of the account: " + accountName );
831834 }
832835 }
833- Pair <List <DedicatedResourceVO >, Integer > result = _dedicatedDao .searchDedicatedZones (zoneId , domainId , accountId , affinityGroupId );
836+ Filter searchFilter = new Filter (DedicatedResourceVO .class , "id" , true , startIndex , pageSize );
837+ Pair <List <DedicatedResourceVO >, Integer > result = _dedicatedDao .searchDedicatedZones (zoneId , domainId , accountId , affinityGroupId , searchFilter );
834838 return new Pair <List <? extends DedicatedResourceVO >, Integer >(result .first (), result .second ());
835839 }
836840
@@ -841,6 +845,8 @@ public Pair<List<? extends DedicatedResourceVO>, Integer> listDedicatedPods(List
841845 String accountName = cmd .getAccountName ();
842846 Long accountId = null ;
843847 Long affinityGroupId = cmd .getAffinityGroupId ();
848+ Long startIndex = cmd .getStartIndex ();
849+ Long pageSize = cmd .getPageSizeVal ();
844850
845851 if (accountName != null ) {
846852 if (domainId != null ) {
@@ -852,7 +858,8 @@ public Pair<List<? extends DedicatedResourceVO>, Integer> listDedicatedPods(List
852858 throw new InvalidParameterValueException ("Please specify the domain id of the account: " + accountName );
853859 }
854860 }
855- Pair <List <DedicatedResourceVO >, Integer > result = _dedicatedDao .searchDedicatedPods (podId , domainId , accountId , affinityGroupId );
861+ Filter searchFilter = new Filter (DedicatedResourceVO .class , "id" , true , startIndex , pageSize );
862+ Pair <List <DedicatedResourceVO >, Integer > result = _dedicatedDao .searchDedicatedPods (podId , domainId , accountId , affinityGroupId , searchFilter );
856863 return new Pair <List <? extends DedicatedResourceVO >, Integer >(result .first (), result .second ());
857864 }
858865
@@ -863,6 +870,8 @@ public Pair<List<? extends DedicatedResourceVO>, Integer> listDedicatedClusters(
863870 String accountName = cmd .getAccountName ();
864871 Long accountId = null ;
865872 Long affinityGroupId = cmd .getAffinityGroupId ();
873+ Long startIndex = cmd .getStartIndex ();
874+ Long pageSize = cmd .getPageSizeVal ();
866875
867876 if (accountName != null ) {
868877 if (domainId != null ) {
@@ -874,7 +883,8 @@ public Pair<List<? extends DedicatedResourceVO>, Integer> listDedicatedClusters(
874883 throw new InvalidParameterValueException ("Please specify the domain id of the account: " + accountName );
875884 }
876885 }
877- Pair <List <DedicatedResourceVO >, Integer > result = _dedicatedDao .searchDedicatedClusters (clusterId , domainId , accountId , affinityGroupId );
886+ Filter searchFilter = new Filter (DedicatedResourceVO .class , "id" , true , startIndex , pageSize );
887+ Pair <List <DedicatedResourceVO >, Integer > result = _dedicatedDao .searchDedicatedClusters (clusterId , domainId , accountId , affinityGroupId , searchFilter );
878888 return new Pair <List <? extends DedicatedResourceVO >, Integer >(result .first (), result .second ());
879889 }
880890
@@ -884,6 +894,8 @@ public Pair<List<? extends DedicatedResourceVO>, Integer> listDedicatedHosts(Lis
884894 Long domainId = cmd .getDomainId ();
885895 String accountName = cmd .getAccountName ();
886896 Long affinityGroupId = cmd .getAffinityGroupId ();
897+ Long startIndex = cmd .getStartIndex ();
898+ Long pageSize = cmd .getPageSizeVal ();
887899
888900 Long accountId = null ;
889901 if (accountName != null ) {
@@ -896,8 +908,8 @@ public Pair<List<? extends DedicatedResourceVO>, Integer> listDedicatedHosts(Lis
896908 throw new InvalidParameterValueException ("Please specify the domain id of the account: " + accountName );
897909 }
898910 }
899-
900- Pair <List <DedicatedResourceVO >, Integer > result = _dedicatedDao .searchDedicatedHosts (hostId , domainId , accountId , affinityGroupId );
911+ Filter searchFilter = new Filter ( DedicatedResourceVO . class , "id" , true , startIndex , pageSize );
912+ Pair <List <DedicatedResourceVO >, Integer > result = _dedicatedDao .searchDedicatedHosts (hostId , domainId , accountId , affinityGroupId , searchFilter );
901913 return new Pair <List <? extends DedicatedResourceVO >, Integer >(result .first (), result .second ());
902914 }
903915
0 commit comments