aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-ws/src/main
diff options
context:
space:
mode:
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);
}