diff options
author | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2015-11-18 08:11:09 +0100 |
---|---|---|
committer | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2015-11-18 08:11:09 +0100 |
commit | 678d27506f2c945273ce9703933d19ea79723a34 (patch) | |
tree | af3f8b821521679e0c2a5e5f9d9e54d845bf587c /sonar-ws | |
parent | 01570a451806cce75fd66b9e02a4631d4ba5509e (diff) | |
download | sonarqube-678d27506f2c945273ce9703933d19ea79723a34.tar.gz sonarqube-678d27506f2c945273ce9703933d19ea79723a34.zip |
SONAR-6947 api/issues/search use issue.SearchWsRequest
Diffstat (limited to 'sonar-ws')
6 files changed, 701 insertions, 1 deletions
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/WsClient.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/WsClient.java index 2981de40769..b9822ee9872 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/WsClient.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/WsClient.java @@ -23,7 +23,10 @@ package org.sonarqube.ws.client; import com.google.common.annotations.VisibleForTesting; import com.google.protobuf.Message; import com.google.protobuf.Parser; +import org.sonarqube.ws.client.component.ComponentsWsClient; +import org.sonarqube.ws.client.issue.IssuesWsClient; import org.sonarqube.ws.client.permission.PermissionsWsClient; +import org.sonarqube.ws.client.qualityprofile.QualityProfilesWsClient; import static org.sonarqube.ws.client.WsRequest.MediaType.PROTOBUF; @@ -42,10 +45,16 @@ public class WsClient { @VisibleForTesting final WsConnector wsConnector; private final PermissionsWsClient permissionsWsClient; + private final ComponentsWsClient componentsWsClient; + private final QualityProfilesWsClient qualityProfilesWsClient; + private final IssuesWsClient issuesWsClient; public WsClient(WsConnector wsConnector) { this.wsConnector = wsConnector; this.permissionsWsClient = new PermissionsWsClient(this); + this.componentsWsClient = new ComponentsWsClient(this); + this.qualityProfilesWsClient = new QualityProfilesWsClient(this); + this.issuesWsClient = new IssuesWsClient(this); } public String execute(WsRequest wsRequest) { @@ -59,4 +68,16 @@ public class WsClient { public PermissionsWsClient permissionsClient() { return this.permissionsWsClient; } + + public ComponentsWsClient componentsWsClient() { + return componentsWsClient; + } + + public QualityProfilesWsClient qualityProfilesWsClient() { + return qualityProfilesWsClient; + } + + public IssuesWsClient issuesWsClient() { + return issuesWsClient; + } } diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/issue/IssueFilterParameters.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/issue/IssueFilterParameters.java new file mode 100644 index 00000000000..7ab7cea2e7c --- /dev/null +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/issue/IssueFilterParameters.java @@ -0,0 +1,93 @@ +/* + * SonarQube, open source software quality management tool. + * Copyright (C) 2008-2014 SonarSource + * mailto:contact AT sonarsource DOT com + * + * SonarQube is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * SonarQube is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.sonarqube.ws.client.issue; + +import com.google.common.base.Predicate; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Iterables; +import java.util.List; + +import static com.google.common.collect.Lists.newArrayList; + +/** + * @since 3.7 + */ +public class IssueFilterParameters { + + public static final String ISSUES = "issues"; + public static final String SEVERITIES = "severities"; + public static final String STATUSES = "statuses"; + public static final String RESOLUTIONS = "resolutions"; + public static final String RESOLVED = "resolved"; + public static final String COMPONENTS = "components"; + public static final String COMPONENT_KEYS = "componentKeys"; + public static final String COMPONENT_UUIDS = "componentUuids"; + public static final String COMPONENT_ROOTS = "componentRoots"; + public static final String COMPONENT_ROOT_UUIDS = "componentRootUuids"; + public static final String MODULE_UUIDS = "moduleUuids"; + public static final String PROJECTS = "projects"; + public static final String PROJECT_KEYS = "projectKeys"; + public static final String PROJECT_UUIDS = "projectUuids"; + public static final String DIRECTORIES = "directories"; + public static final String FILE_UUIDS = "fileUuids"; + public static final String ON_COMPONENT_ONLY = "onComponentOnly"; + public static final String RULES = "rules"; + public static final String ACTION_PLANS = "actionPlans"; + public static final String REPORTERS = "reporters"; + public static final String ASSIGNEES = "assignees"; + public static final String AUTHORS = "authors"; + public static final String LANGUAGES = "languages"; + public static final String TAGS = "tags"; + public static final String ASSIGNED = "assigned"; + public static final String PLANNED = "planned"; + public static final String HIDE_RULES = "hideRules"; + public static final String HIDE_COMMENTS = "hideComments"; + public static final String CREATED_AFTER = "createdAfter"; + public static final String CREATED_AT = "createdAt"; + public static final String CREATED_BEFORE = "createdBefore"; + public static final String CREATED_IN_LAST = "createdInLast"; + public static final String PAGE_SIZE = "pageSize"; + public static final String PAGE_INDEX = "pageIndex"; + public static final String SORT = "sort"; + public static final String ASC = "asc"; + public static final String ADDITIONAL_FIELDS = "additionalFields"; + + public static final String FACET_MODE = "facetMode"; + public static final String FACET_MODE_COUNT = "count"; + + public static final String FACET_MODE_DEBT = "debt"; + + public static final String FACET_ASSIGNED_TO_ME = "assigned_to_me"; + + public static final List<String> ALL = ImmutableList.of(ISSUES, SEVERITIES, STATUSES, RESOLUTIONS, RESOLVED, COMPONENTS, COMPONENT_ROOTS, RULES, ACTION_PLANS, REPORTERS, TAGS, + ASSIGNEES, LANGUAGES, ASSIGNED, PLANNED, HIDE_RULES, CREATED_AT, CREATED_AFTER, CREATED_BEFORE, CREATED_IN_LAST, COMPONENT_UUIDS, COMPONENT_ROOT_UUIDS, FACET_MODE, + PROJECTS, PROJECT_UUIDS, PROJECT_KEYS, COMPONENT_KEYS, MODULE_UUIDS, DIRECTORIES, FILE_UUIDS, AUTHORS, HIDE_COMMENTS, PAGE_SIZE, PAGE_INDEX, SORT, ASC); + public static final List<String> ALL_WITHOUT_PAGINATION = newArrayList(Iterables.filter(ALL, new Predicate<String>() { + @Override + public boolean apply(String input) { + return !PAGE_INDEX.equals(input) && !PAGE_SIZE.equals(input); + } + })); + + private IssueFilterParameters() { + // Utility class + } +} diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/issue/IssuesWsClient.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/issue/IssuesWsClient.java new file mode 100644 index 00000000000..70708974382 --- /dev/null +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/issue/IssuesWsClient.java @@ -0,0 +1,126 @@ +/* + * SonarQube, open source software quality management tool. + * Copyright (C) 2008-2014 SonarSource + * mailto:contact AT sonarsource DOT com + * + * SonarQube is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * SonarQube is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.sonarqube.ws.client.issue; + +import com.google.common.base.Joiner; +import java.util.List; +import javax.annotation.CheckForNull; +import javax.annotation.Nullable; +import org.sonarqube.ws.Issues.SearchWsResponse; +import org.sonarqube.ws.client.WsClient; + +import static org.sonarqube.ws.client.WsRequest.newGetRequest; +import static org.sonarqube.ws.client.issue.IssueFilterParameters.ACTION_PLANS; +import static org.sonarqube.ws.client.issue.IssueFilterParameters.ADDITIONAL_FIELDS; +import static org.sonarqube.ws.client.issue.IssueFilterParameters.ASC; +import static org.sonarqube.ws.client.issue.IssueFilterParameters.ASSIGNED; +import static org.sonarqube.ws.client.issue.IssueFilterParameters.ASSIGNEES; +import static org.sonarqube.ws.client.issue.IssueFilterParameters.AUTHORS; +import static org.sonarqube.ws.client.issue.IssueFilterParameters.COMPONENTS; +import static org.sonarqube.ws.client.issue.IssueFilterParameters.COMPONENT_KEYS; +import static org.sonarqube.ws.client.issue.IssueFilterParameters.COMPONENT_ROOTS; +import static org.sonarqube.ws.client.issue.IssueFilterParameters.COMPONENT_ROOT_UUIDS; +import static org.sonarqube.ws.client.issue.IssueFilterParameters.COMPONENT_UUIDS; +import static org.sonarqube.ws.client.issue.IssueFilterParameters.CREATED_AFTER; +import static org.sonarqube.ws.client.issue.IssueFilterParameters.CREATED_AT; +import static org.sonarqube.ws.client.issue.IssueFilterParameters.CREATED_BEFORE; +import static org.sonarqube.ws.client.issue.IssueFilterParameters.CREATED_IN_LAST; +import static org.sonarqube.ws.client.issue.IssueFilterParameters.DIRECTORIES; +import static org.sonarqube.ws.client.issue.IssueFilterParameters.FACET_MODE; +import static org.sonarqube.ws.client.issue.IssueFilterParameters.FILE_UUIDS; +import static org.sonarqube.ws.client.issue.IssueFilterParameters.ISSUES; +import static org.sonarqube.ws.client.issue.IssueFilterParameters.LANGUAGES; +import static org.sonarqube.ws.client.issue.IssueFilterParameters.MODULE_UUIDS; +import static org.sonarqube.ws.client.issue.IssueFilterParameters.ON_COMPONENT_ONLY; +import static org.sonarqube.ws.client.issue.IssueFilterParameters.PLANNED; +import static org.sonarqube.ws.client.issue.IssueFilterParameters.PROJECTS; +import static org.sonarqube.ws.client.issue.IssueFilterParameters.PROJECT_KEYS; +import static org.sonarqube.ws.client.issue.IssueFilterParameters.PROJECT_UUIDS; +import static org.sonarqube.ws.client.issue.IssueFilterParameters.REPORTERS; +import static org.sonarqube.ws.client.issue.IssueFilterParameters.RESOLUTIONS; +import static org.sonarqube.ws.client.issue.IssueFilterParameters.RESOLVED; +import static org.sonarqube.ws.client.issue.IssueFilterParameters.RULES; +import static org.sonarqube.ws.client.issue.IssueFilterParameters.SEVERITIES; +import static org.sonarqube.ws.client.issue.IssueFilterParameters.STATUSES; +import static org.sonarqube.ws.client.issue.IssueFilterParameters.TAGS; + +public class IssuesWsClient { + private static final Joiner LIST_TO_PARAMS_STRING = Joiner.on(",").skipNulls(); + private final WsClient wsClient; + + public IssuesWsClient(WsClient wsClient) { + this.wsClient = wsClient; + } + + public SearchWsResponse search(SearchWsRequest request) { + return wsClient.execute( + newGetRequest(action("search")) + .setParam(ACTION_PLANS, listToParamList(request.getActionPlans())) + .setParam(ADDITIONAL_FIELDS, listToParamList(request.getAdditionalFields())) + .setParam(ASC, request.getAsc()) + .setParam(ASSIGNED, request.getAssigned()) + .setParam(ASSIGNEES, listToParamList(request.getAssignees())) + .setParam(AUTHORS, listToParamList(request.getAuthors())) + .setParam(COMPONENT_KEYS, listToParamList(request.getComponentKeys())) + .setParam(COMPONENT_ROOT_UUIDS, listToParamList(request.getComponentRootUuids())) + .setParam(COMPONENT_ROOTS, listToParamList(request.getComponentRoots())) + .setParam(COMPONENT_UUIDS, listToParamList(request.getComponentUuids())) + .setParam(COMPONENTS, listToParamList(request.getComponents())) + .setParam(CREATED_AFTER, request.getCreatedAfter()) + .setParam(CREATED_AT, request.getCreatedAt()) + .setParam(CREATED_BEFORE, request.getCreatedBefore()) + .setParam(CREATED_IN_LAST, request.getCreatedInLast()) + .setParam(DIRECTORIES, listToParamList(request.getDirectories())) + .setParam(FACET_MODE, request.getFacetMode()) + .setParam("facets", listToParamList(request.getFacets())) + .setParam(FILE_UUIDS, listToParamList(request.getFileUuids())) + .setParam(ISSUES, listToParamList(request.getIssues())) + .setParam(LANGUAGES, listToParamList(request.getLanguages())) + .setParam(MODULE_UUIDS, listToParamList(request.getModuleUuids())) + .setParam(ON_COMPONENT_ONLY, request.getOnComponentOnly()) + .setParam("p", request.getPage()) + .setParam("ps", request.getPageSize()) + .setParam(PLANNED, request.getPlanned()) + .setParam(PROJECT_KEYS, listToParamList(request.getProjectKeys())) + .setParam(PROJECT_UUIDS, listToParamList(request.getProjectUuids())) + .setParam(PROJECTS, listToParamList(request.getProjects())) + .setParam(REPORTERS, listToParamList(request.getReporters())) + .setParam(RESOLUTIONS, listToParamList(request.getResolutions())) + .setParam(RESOLVED, request.getResolved()) + .setParam(RULES, listToParamList(request.getRules())) + .setParam("s", request.getSort()) + .setParam(SEVERITIES, listToParamList(request.getSeverities())) + .setParam(STATUSES, listToParamList(request.getStatuses())) + .setParam(TAGS, listToParamList(request.getTags())), + SearchWsResponse.parser()); + } + + private static String action(String action) { + return "api/issues/" + action; + } + + @CheckForNull + private static String listToParamList(@Nullable List<String> strings) { + return strings == null + ? null + : LIST_TO_PARAMS_STRING.join(strings); + } +} diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/issue/SearchWsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/issue/SearchWsRequest.java new file mode 100644 index 00000000000..093b7198b78 --- /dev/null +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/issue/SearchWsRequest.java @@ -0,0 +1,435 @@ +/* + * SonarQube, open source software quality management tool. + * Copyright (C) 2008-2014 SonarSource + * mailto:contact AT sonarsource DOT com + * + * SonarQube is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * SonarQube is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.sonarqube.ws.client.issue; + +import java.util.List; +import javax.annotation.CheckForNull; +import javax.annotation.Nullable; + +public class SearchWsRequest { + private List<String> actionPlans; + private List<String> additionalFields; + private Boolean asc; + private Boolean assigned; + private List<String> assignees; + private List<String> authors; + private List<String> componentKeys; + private List<String> componentRootUuids; + private List<String> componentRoots; + private List<String> componentUuids; + private List<String> components; + private String createdAfter; + private String createdAt; + private String createdBefore; + private String createdInLast; + private List<String> directories; + private String facetMode; + private List<String> facets; + private List<String> fileUuids; + private List<String> issues; + private List<String> languages; + private List<String> moduleUuids; + private Boolean onComponentOnly; + private Integer page; + private Integer pageSize; + private Boolean planned; + private List<String> projectKeys; + private List<String> projectUuids; + private List<String> projects; + private List<String> reporters; + private List<String> resolutions; + private Boolean resolved; + private List<String> rules; + private String sort; + private List<String> severities; + private List<String> statuses; + private List<String> tags; + + @CheckForNull + public List<String> getActionPlans() { + return actionPlans; + } + + public SearchWsRequest setActionPlans(@Nullable List<String> actionPlans) { + this.actionPlans = actionPlans; + return this; + } + + @CheckForNull + public List<String> getAdditionalFields() { + return additionalFields; + } + + public SearchWsRequest setAdditionalFields(@Nullable List<String> additionalFields) { + this.additionalFields = additionalFields; + return this; + } + + @CheckForNull + public Boolean getAsc() { + return asc; + } + + public SearchWsRequest setAsc(boolean asc) { + this.asc = asc; + return this; + } + + @CheckForNull + public Boolean getAssigned() { + return assigned; + } + + public SearchWsRequest setAssigned(@Nullable Boolean assigned) { + this.assigned = assigned; + return this; + } + + @CheckForNull + public List<String> getAssignees() { + return assignees; + } + + public SearchWsRequest setAssignees(@Nullable List<String> assignees) { + this.assignees = assignees; + return this; + } + + @CheckForNull + public List<String> getAuthors() { + return authors; + } + + public SearchWsRequest setAuthors(@Nullable List<String> authors) { + this.authors = authors; + return this; + } + + @CheckForNull + public List<String> getComponentKeys() { + return componentKeys; + } + + public SearchWsRequest setComponentKeys(@Nullable List<String> componentKeys) { + this.componentKeys = componentKeys; + return this; + } + + @CheckForNull + public List<String> getComponentUuids() { + return componentUuids; + } + + public SearchWsRequest setComponentUuids(@Nullable List<String> componentUuids) { + this.componentUuids = componentUuids; + return this; + } + + @CheckForNull + public String getCreatedAfter() { + return createdAfter; + } + + public SearchWsRequest setCreatedAfter(@Nullable String createdAfter) { + this.createdAfter = createdAfter; + return this; + } + + @CheckForNull + public String getCreatedAt() { + return createdAt; + } + + public SearchWsRequest setCreatedAt(@Nullable String createdAt) { + this.createdAt = createdAt; + return this; + } + + @CheckForNull + public String getCreatedBefore() { + return createdBefore; + } + + public SearchWsRequest setCreatedBefore(@Nullable String createdBefore) { + this.createdBefore = createdBefore; + return this; + } + + @CheckForNull + public String getCreatedInLast() { + return createdInLast; + } + + public SearchWsRequest setCreatedInLast(@Nullable String createdInLast) { + this.createdInLast = createdInLast; + return this; + } + + @CheckForNull + public List<String> getDirectories() { + return directories; + } + + public SearchWsRequest setDirectories(@Nullable List<String> directories) { + this.directories = directories; + return this; + } + + @CheckForNull + public String getFacetMode() { + return facetMode; + } + + public SearchWsRequest setFacetMode(@Nullable String facetMode) { + this.facetMode = facetMode; + return this; + } + + @CheckForNull + public List<String> getFacets() { + return facets; + } + + public SearchWsRequest setFacets(@Nullable List<String> facets) { + this.facets = facets; + return this; + } + + @CheckForNull + public List<String> getFileUuids() { + return fileUuids; + } + + public SearchWsRequest setFileUuids(@Nullable List<String> fileUuids) { + this.fileUuids = fileUuids; + return this; + } + + @CheckForNull + public List<String> getIssues() { + return issues; + } + + public SearchWsRequest setIssues(@Nullable List<String> issues) { + this.issues = issues; + return this; + } + + @CheckForNull + public List<String> getLanguages() { + return languages; + } + + public SearchWsRequest setLanguages(@Nullable List<String> languages) { + this.languages = languages; + return this; + } + + @CheckForNull + public List<String> getModuleUuids() { + return moduleUuids; + } + + public SearchWsRequest setModuleUuids(@Nullable List<String> moduleUuids) { + this.moduleUuids = moduleUuids; + return this; + } + + @CheckForNull + public Boolean getOnComponentOnly() { + return onComponentOnly; + } + + public SearchWsRequest setOnComponentOnly(Boolean onComponentOnly) { + this.onComponentOnly = onComponentOnly; + return this; + } + + @CheckForNull + public Integer getPage() { + return page; + } + + public SearchWsRequest setPage(int page) { + this.page = page; + return this; + } + + @CheckForNull + public Integer getPageSize() { + return pageSize; + } + + public SearchWsRequest setPageSize(int pageSize) { + this.pageSize = pageSize; + return this; + } + + @CheckForNull + public Boolean getPlanned() { + return planned; + } + + public SearchWsRequest setPlanned(@Nullable Boolean planned) { + this.planned = planned; + return this; + } + + @CheckForNull + public List<String> getProjectKeys() { + return projectKeys; + } + + public SearchWsRequest setProjectKeys(@Nullable List<String> projectKeys) { + this.projectKeys = projectKeys; + return this; + } + + @CheckForNull + public List<String> getProjectUuids() { + return projectUuids; + } + + public SearchWsRequest setProjectUuids(@Nullable List<String> projectUuids) { + this.projectUuids = projectUuids; + return this; + } + + @CheckForNull + public List<String> getReporters() { + return reporters; + } + + public SearchWsRequest setReporters(@Nullable List<String> reporters) { + this.reporters = reporters; + return this; + } + + @CheckForNull + public List<String> getResolutions() { + return resolutions; + } + + public SearchWsRequest setResolutions(@Nullable List<String> resolutions) { + this.resolutions = resolutions; + return this; + } + + @CheckForNull + public Boolean getResolved() { + return resolved; + } + + public SearchWsRequest setResolved(@Nullable Boolean resolved) { + this.resolved = resolved; + return this; + } + + @CheckForNull + public List<String> getRules() { + return rules; + } + + public SearchWsRequest setRules(@Nullable List<String> rules) { + this.rules = rules; + return this; + } + + @CheckForNull + public String getSort() { + return sort; + } + + public SearchWsRequest setSort(@Nullable String sort) { + this.sort = sort; + return this; + } + + @CheckForNull + public List<String> getSeverities() { + return severities; + } + + public SearchWsRequest setSeverities(@Nullable List<String> severities) { + this.severities = severities; + return this; + } + + @CheckForNull + public List<String> getStatuses() { + return statuses; + } + + public SearchWsRequest setStatuses(@Nullable List<String> statuses) { + this.statuses = statuses; + return this; + } + + @CheckForNull + public List<String> getTags() { + return tags; + } + + public SearchWsRequest setTags(@Nullable List<String> tags) { + this.tags = tags; + return this; + } + + @CheckForNull + public List<String> getComponentRootUuids() { + return componentRootUuids; + } + + public SearchWsRequest setComponentRootUuids(List<String> componentRootUuids) { + this.componentRootUuids = componentRootUuids; + return this; + } + + @CheckForNull + public List<String> getComponentRoots() { + return componentRoots; + } + + public SearchWsRequest setComponentRoots(@Nullable List<String> componentRoots) { + this.componentRoots = componentRoots; + return this; + } + + @CheckForNull + public List<String> getComponents() { + return components; + } + + public SearchWsRequest setComponents(@Nullable List<String> components) { + this.components = components; + return this; + } + + @CheckForNull + public List<String> getProjects() { + return projects; + } + + public SearchWsRequest setProjects(@Nullable List<String> projects) { + this.projects = projects; + return this; + } +} diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/package-info.java b/sonar-ws/src/main/java/org/sonarqube/ws/package-info.java new file mode 100644 index 00000000000..5d704420ad4 --- /dev/null +++ b/sonar-ws/src/main/java/org/sonarqube/ws/package-info.java @@ -0,0 +1,25 @@ +/* + * SonarQube, open source software quality management tool. + * Copyright (C) 2008-2014 SonarSource + * mailto:contact AT sonarsource DOT com + * + * SonarQube is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * SonarQube is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +@ParametersAreNonnullByDefault +package org.sonarqube.ws; + +import javax.annotation.ParametersAreNonnullByDefault; + diff --git a/sonar-ws/src/main/protobuf/ws-issues.proto b/sonar-ws/src/main/protobuf/ws-issues.proto index 96315eef2c1..87a34a07390 100644 --- a/sonar-ws/src/main/protobuf/ws-issues.proto +++ b/sonar-ws/src/main/protobuf/ws-issues.proto @@ -27,7 +27,7 @@ option java_outer_classname = "Issues"; option optimize_for = SPEED; // Response of GET api/issues/search -message Search { +message SearchWsResponse { optional int64 total = 1; optional int64 p = 2; optional int32 ps = 3; |