|
19 | 19 | import java.util.List; |
20 | 20 |
|
21 | 21 |
|
| 22 | +import com.cloud.utils.db.Filter; |
22 | 23 | import org.springframework.stereotype.Component; |
23 | 24 |
|
24 | 25 | import org.apache.cloudstack.ldap.LdapConfigurationVO; |
@@ -63,29 +64,29 @@ public LdapConfigurationVO findByHostname(final String hostname) { |
63 | 64 |
|
64 | 65 | @Override |
65 | 66 | public LdapConfigurationVO find(String hostname, int port, Long domainId) { |
66 | | - SearchCriteria<LdapConfigurationVO> sc = getSearchCriteria(hostname, port, domainId, false); |
| 67 | + SearchCriteria<LdapConfigurationVO> sc = getSearchCriteria(hostname, port, domainId, false, null, null); |
67 | 68 | return findOneBy(sc); |
68 | 69 | } |
69 | 70 |
|
70 | 71 | @Override |
71 | 72 | public LdapConfigurationVO find(String hostname, int port, Long domainId, boolean listAll) { |
72 | | - SearchCriteria<LdapConfigurationVO> sc = getSearchCriteria(hostname, port, domainId, listAll); |
| 73 | + SearchCriteria<LdapConfigurationVO> sc = getSearchCriteria(hostname, port, domainId, listAll, null, null); |
73 | 74 | return findOneBy(sc); |
74 | 75 | } |
75 | 76 |
|
76 | 77 | @Override |
77 | | - public Pair<List<LdapConfigurationVO>, Integer> searchConfigurations(final String hostname, final int port, final Long domainId) { |
78 | | - SearchCriteria<LdapConfigurationVO> sc = getSearchCriteria(hostname, port, domainId, false); |
79 | | - return searchAndCount(sc, null); |
| 78 | + public Pair<List<LdapConfigurationVO>, Integer> searchConfigurations(final String hostname, final int port, final Long domainId, Long offset, Long limit) { |
| 79 | + SearchCriteria<LdapConfigurationVO> sc = getSearchCriteria(hostname, port, domainId, false, offset, limit); |
| 80 | + return searchAndCount(sc, new Filter(LdapConfigurationVO.class, "id", true, offset, limit)); |
80 | 81 | } |
81 | 82 |
|
82 | 83 | @Override |
83 | | - public Pair<List<LdapConfigurationVO>, Integer> searchConfigurations(final String hostname, final int port, final Long domainId, final boolean listAll) { |
84 | | - SearchCriteria<LdapConfigurationVO> sc = getSearchCriteria(hostname, port, domainId, listAll); |
85 | | - return searchAndCount(sc, null); |
| 84 | + public Pair<List<LdapConfigurationVO>, Integer> searchConfigurations(final String hostname, final int port, final Long domainId, final boolean listAll, Long offset, Long limit) { |
| 85 | + SearchCriteria<LdapConfigurationVO> sc = getSearchCriteria(hostname, port, domainId, listAll, offset, limit); |
| 86 | + return searchAndCount(sc, new Filter(LdapConfigurationVO.class, "id", true, offset, limit)); |
86 | 87 | } |
87 | 88 |
|
88 | | - private SearchCriteria<LdapConfigurationVO> getSearchCriteria(String hostname, int port, Long domainId,boolean listAll) { |
| 89 | + private SearchCriteria<LdapConfigurationVO> getSearchCriteria(String hostname, int port, Long domainId,boolean listAll, Long offset, Long limit) { |
89 | 90 | SearchCriteria<LdapConfigurationVO> sc; |
90 | 91 | if (domainId != null) { |
91 | 92 | // If domainid is present, ignore listall |
|
0 commit comments