aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api
diff options
context:
space:
mode:
authorTeryk Bellahsene <teryk.bellahsene@sonarsource.com>2015-12-07 15:03:34 +0100
committerTeryk Bellahsene <teryk.bellahsene@sonarsource.com>2015-12-07 18:02:35 +0100
commit5aeeedbda63c17fefc7bba99dbf8c718c7bbbd17 (patch)
tree16a1bbc36a6b8bc0a0304cbe7fdc2a3a4820ba3e /sonar-plugin-api
parent15dc8ea86dba565fa8f02814ca7c8fb9130ae3a7 (diff)
downloadsonarqube-5aeeedbda63c17fefc7bba99dbf8c718c7bbbd17.tar.gz
sonarqube-5aeeedbda63c17fefc7bba99dbf8c718c7bbbd17.zip
SONAR-6820 WS api/rules/search has a page size limit of 500
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/server/ws/WebService.java18
1 files changed, 18 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 6141bed8d8f..c75c80daded 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
@@ -364,6 +364,24 @@ public interface WebService extends Definable<WebService.Context> {
}
/**
+ * Add predefined parameters related to pagination of results.
+ */
+ public NewAction addPagingParams(int defaultPageSize, int maxSize) {
+ createParam(Param.PAGE)
+ .setDescription("1-based page number")
+ .setExampleValue("42")
+ .setDeprecatedKey("pageIndex")
+ .setDefaultValue("1");
+
+ createParam(Param.PAGE_SIZE)
+ .setDescription("Page size. Must be greater than 0 and less than " + maxSize)
+ .setExampleValue("20")
+ .setDeprecatedKey("pageSize")
+ .setDefaultValue(String.valueOf(defaultPageSize));
+ return this;
+ }
+
+ /**
* Creates the parameter {@link org.sonar.api.server.ws.WebService.Param#FIELDS}, which is
* used to restrict the number of fields returned in JSON response.
*/