aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-ws/src/main
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2017-03-16 15:39:12 +0100
committerJulien Lancelot <julien.lancelot@sonarsource.com>2017-03-21 13:05:50 +0100
commit0155d0c25355a6008b36fd04449fc15f8ec230b2 (patch)
treebaa9abc85d8b363730ac47eb90779d690223df21 /sonar-ws/src/main
parentfb65076b67848376353f2cc995ba5e5eec9d8281 (diff)
downloadsonarqube-0155d0c25355a6008b36fd04449fc15f8ec230b2.tar.gz
sonarqube-0155d0c25355a6008b36fd04449fc15f8ec230b2.zip
SONAR-8893 Add missing organizations param in organization search client
Diffstat (limited to 'sonar-ws/src/main')
-rw-r--r--sonar-ws/src/main/java/org/sonarqube/ws/client/organization/OrganizationService.java1
-rw-r--r--sonar-ws/src/main/java/org/sonarqube/ws/client/organization/SearchWsRequest.java20
2 files changed, 21 insertions, 0 deletions
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/organization/OrganizationService.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/organization/OrganizationService.java
index 441bee64831..c0395baeaba 100644
--- a/sonar-ws/src/main/java/org/sonarqube/ws/client/organization/OrganizationService.java
+++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/organization/OrganizationService.java
@@ -38,6 +38,7 @@ public class OrganizationService extends BaseService {
public SearchWsResponse search(SearchWsRequest request) {
GetRequest get = new GetRequest(path("search"))
+ .setParam("organizations", inlineMultipleParamValue(request.getOrganizations()))
.setParam("p", request.getPage())
.setParam("ps", request.getPageSize());
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/organization/SearchWsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/organization/SearchWsRequest.java
index d114625926f..92dbfb5d88e 100644
--- a/sonar-ws/src/main/java/org/sonarqube/ws/client/organization/SearchWsRequest.java
+++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/organization/SearchWsRequest.java
@@ -19,18 +19,23 @@
*/
package org.sonarqube.ws.client.organization;
+import java.util.List;
import javax.annotation.CheckForNull;
import javax.annotation.Nullable;
import javax.annotation.concurrent.Immutable;
+import static java.util.Arrays.asList;
+
@Immutable
public class SearchWsRequest {
private final Integer page;
private final Integer pageSize;
+ private final List<String> organizations;
private SearchWsRequest(Builder builder) {
this.page = builder.page;
this.pageSize = builder.pageSize;
+ this.organizations = builder.organizations;
}
@CheckForNull
@@ -43,9 +48,19 @@ public class SearchWsRequest {
return page;
}
+ @CheckForNull
+ public List<String> getOrganizations() {
+ return organizations;
+ }
+
+ public static Builder builder() {
+ return new Builder();
+ }
+
public static final class Builder {
private Integer page;
private Integer pageSize;
+ private List<String> organizations;
public Builder setPage(@Nullable Integer page) {
this.page = page;
@@ -57,6 +72,11 @@ public class SearchWsRequest {
return this;
}
+ public Builder setOrganizations(String... organizations) {
+ this.organizations = asList(organizations);
+ return this;
+ }
+
public SearchWsRequest build() {
return new SearchWsRequest(this);
}