aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-ws
diff options
context:
space:
mode:
authorTeryk Bellahsene <teryk.bellahsene@sonarsource.com>2015-12-17 16:19:44 +0100
committerTeryk Bellahsene <teryk.bellahsene@sonarsource.com>2015-12-21 12:27:25 +0100
commit6fe8b0cd64c4b4e2386d994016b465b0386ed09c (patch)
tree73006c620bed41a2849e4d563aa8c1981de7c38d /sonar-ws
parent8239ac084eb9aaaba9f661a4e2fe5891bda8d452 (diff)
downloadsonarqube-6fe8b0cd64c4b4e2386d994016b465b0386ed09c.tar.gz
sonarqube-6fe8b0cd64c4b4e2386d994016b465b0386ed09c.zip
SONAR-7129 WS api/components/tree
Diffstat (limited to 'sonar-ws')
-rw-r--r--sonar-ws/src/main/java/org/sonarqube/ws/client/component/ComponentsWsParameters.java36
-rw-r--r--sonar-ws/src/main/java/org/sonarqube/ws/client/component/TreeWsRequest.java127
-rw-r--r--sonar-ws/src/main/protobuf/ws-components.proto24
3 files changed, 180 insertions, 7 deletions
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/component/ComponentsWsParameters.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/component/ComponentsWsParameters.java
new file mode 100644
index 00000000000..9467eb8adc9
--- /dev/null
+++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/component/ComponentsWsParameters.java
@@ -0,0 +1,36 @@
+/*
+ * 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.component;
+
+public class ComponentsWsParameters {
+ private ComponentsWsParameters() {
+ // static utility class
+ }
+
+ //actions
+ public static final String ACTION_TREE = "tree";
+
+ // parameters
+ public static final String PARAM_QUALIFIERS = "qualifiers";
+ public static final String PARAM_BASE_COMPONENT_ID = "baseComponentId";
+ public static final String PARAM_BASE_COMPONENT_KEY = "baseComponentKey";
+ public static final String PARAM_STRATEGY = "strategy";
+}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/component/TreeWsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/component/TreeWsRequest.java
new file mode 100644
index 00000000000..e3c8ebb468d
--- /dev/null
+++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/component/TreeWsRequest.java
@@ -0,0 +1,127 @@
+/*
+ * 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.component;
+
+import java.util.List;
+import javax.annotation.CheckForNull;
+import javax.annotation.Nullable;
+
+public class TreeWsRequest {
+ @CheckForNull
+ private String baseComponentId;
+ @CheckForNull
+ private String baseComponentKey;
+ @CheckForNull
+ private String strategy;
+ @CheckForNull
+ private List<String> qualifiers;
+ @CheckForNull
+ private String query;
+ @CheckForNull
+ private List<String> sort;
+ @CheckForNull
+ private Boolean asc;
+ @CheckForNull
+ private Integer page;
+ @CheckForNull
+ private Integer pageSize;
+
+ public String getBaseComponentId() {
+ return baseComponentId;
+ }
+
+ public TreeWsRequest setBaseComponentId(@Nullable String baseComponentId) {
+ this.baseComponentId = baseComponentId;
+ return this;
+ }
+
+ public String getBaseComponentKey() {
+ return baseComponentKey;
+ }
+
+ public TreeWsRequest setBaseComponentKey(@Nullable String baseComponentKey) {
+ this.baseComponentKey = baseComponentKey;
+ return this;
+ }
+
+ public String getStrategy() {
+ return strategy;
+ }
+
+ public TreeWsRequest setStrategy(@Nullable String strategy) {
+ this.strategy = strategy;
+ return this;
+ }
+
+ public List<String> getQualifiers() {
+ return qualifiers;
+ }
+
+ public TreeWsRequest setQualifiers(@Nullable List<String> qualifiers) {
+ this.qualifiers = qualifiers;
+ return this;
+ }
+
+ public String getQuery() {
+ return query;
+ }
+
+ public TreeWsRequest setQuery(@Nullable String query) {
+ this.query = query;
+ return this;
+ }
+
+ public List<String> getSort() {
+ return sort;
+ }
+
+ public TreeWsRequest setSort(@Nullable List<String> sort) {
+ this.sort = sort;
+ return this;
+ }
+
+ public Boolean getAsc() {
+ return asc;
+ }
+
+ public TreeWsRequest setAsc(boolean asc) {
+ this.asc = asc;
+ return this;
+ }
+
+ public Integer getPage() {
+ return page;
+ }
+
+ public TreeWsRequest setPage(int page) {
+ this.page = page;
+ return this;
+ }
+
+ public Integer getPageSize() {
+ return pageSize;
+ }
+
+ public TreeWsRequest setPageSize(int pageSize) {
+ this.pageSize = pageSize;
+ return this;
+ }
+}
diff --git a/sonar-ws/src/main/protobuf/ws-components.proto b/sonar-ws/src/main/protobuf/ws-components.proto
index 2f94e41f670..aad40d8cab2 100644
--- a/sonar-ws/src/main/protobuf/ws-components.proto
+++ b/sonar-ws/src/main/protobuf/ws-components.proto
@@ -28,13 +28,23 @@ option optimize_for = SPEED;
// WS api/components/search
message SearchWsResponse {
- message Component {
- optional string id = 1;
- optional string key = 2;
- optional string qualifier = 3;
- optional string name = 4;
- }
-
optional sonarqube.ws.commons.Paging paging = 1;
repeated Component components = 2;
}
+
+// WS api/components/tree
+message TreeWsResponse {
+ optional sonarqube.ws.commons.Paging paging = 1;
+ optional string projectId = 2;
+ repeated Component components = 3;
+}
+
+message Component {
+ optional string id = 1;
+ optional string key = 2;
+ optional string projectId = 3;
+ optional string name = 4;
+ optional string description = 5;
+ optional string qualifier = 6;
+ optional string path = 7;
+}