aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api
diff options
context:
space:
mode:
authorGuillaume Jambet <guillaume.jambet@sonarsource.com>2018-02-15 14:54:15 +0100
committerGuillaume Jambet <guillaume.jambet@gmail.com>2018-03-01 15:21:05 +0100
commitd535686f89484af334723467ed820a685fba4fb0 (patch)
tree2b9d975c896e40c5710b1205f2ebaf7fba45403e /sonar-plugin-api
parent3ae18356c3fcafeb7b5348c8916098156cd0a824 (diff)
downloadsonarqube-d535686f89484af334723467ed820a685fba4fb0.tar.gz
sonarqube-d535686f89484af334723467ed820a685fba4fb0.zip
SONAR-10347 Add pagination to webhook deliveries search ws.
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/server/ws/WebService.java19
1 files changed, 19 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 900f5c0b29b..cdd5d5b25f4 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
@@ -394,6 +394,25 @@ public interface WebService extends Definable<WebService.Context> {
}
/**
+ * Add predefined parameters related to pagination of results with a maximum page size.
+ * Note the maximum is a documentation only feature. It does not check anything.
+ */
+ public NewAction addPagingParamsSince(int defaultPageSize, int maxPageSize, String version) {
+ createParam(Param.PAGE)
+ .setDescription("1-based page number")
+ .setExampleValue("42")
+ .setDefaultValue("1")
+ .setSince(version);
+ createParam(Param.PAGE_SIZE)
+ .setDescription("Page size. Must be greater than 0 and less than " + maxPageSize)
+ .setDefaultValue(String.valueOf(defaultPageSize))
+ .setMaximumValue(maxPageSize)
+ .setExampleValue("20")
+ .setSince(version);
+ 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.
*/