aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api/src/main/java
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2016-04-15 17:17:01 +0200
committerTeryk Bellahsene <teryk.bellahsene@sonarsource.com>2016-04-21 01:23:38 +0200
commita2e88e9141e5f9d5bda8b62414b816685e767227 (patch)
treeccda2ca97544a4d8833f33e6c83c702b428f9dc1 /sonar-plugin-api/src/main/java
parentc2412a35e2fed2ffba40825d335d72b0c66ee818 (diff)
downloadsonarqube-a2e88e9141e5f9d5bda8b62414b816685e767227.tar.gz
sonarqube-a2e88e9141e5f9d5bda8b62414b816685e767227.zip
SONAR-7187 Remove paging from api/ce/activity
In order to have no more full scan on the ce_activity table, we had to remove paging as it was executing a select count(* from ce_activity)
Diffstat (limited to 'sonar-plugin-api/src/main/java')
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/server/ws/WebService.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/server/ws/WebService.java b/sonar-plugin-api/src/main/java/org/sonar/api/server/ws/WebService.java
index 484956d7a68..3a9b87fe478 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/server/ws/WebService.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/server/ws/WebService.java
@@ -349,12 +349,21 @@ public interface WebService extends Definable<WebService.Context> {
* Note the maximum is a documentation only feature. It does not check anything.
*/
public NewAction addPagingParams(int defaultPageSize, int maxPageSize) {
+ addPageParam();
+ addPageSize(defaultPageSize, maxPageSize);
+ return this;
+ }
+
+ public NewAction addPageParam() {
createParam(Param.PAGE)
.setDescription("1-based page number")
.setExampleValue("42")
.setDeprecatedKey("pageIndex")
.setDefaultValue("1");
+ return this;
+ }
+ public NewAction addPageSize(int defaultPageSize, int maxPageSize) {
createParam(Param.PAGE_SIZE)
.setDescription("Page size. Must be greater than 0 and less than " + maxPageSize)
.setExampleValue("20")