aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-ws
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2016-07-26 14:43:29 +0200
committerStas Vilchik <vilchiks@gmail.com>2016-07-28 17:31:14 +0200
commitfa27bf616fad3cb743994ea8407feabd96a22ae9 (patch)
treec270d62ddaf679973004712bd64ff9d1d67fd312 /sonar-ws
parentc61be4f486e6c9fabc5cc5fd03dba40b79e056f1 (diff)
downloadsonarqube-fa27bf616fad3cb743994ea8407feabd96a22ae9.tar.gz
sonarqube-fa27bf616fad3cb743994ea8407feabd96a22ae9.zip
SONAR-7925 Create WS to list project links
Diffstat (limited to 'sonar-ws')
-rw-r--r--sonar-ws/src/main/java/org/sonarqube/ws/client/projectlinks/ProjectLinksWsParameters.java34
-rw-r--r--sonar-ws/src/main/java/org/sonarqube/ws/client/projectlinks/SearchWsRequest.java50
-rw-r--r--sonar-ws/src/main/java/org/sonarqube/ws/client/projectlinks/package-info.java25
-rw-r--r--sonar-ws/src/main/protobuf/ws-projectlink.proto19
4 files changed, 128 insertions, 0 deletions
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/projectlinks/ProjectLinksWsParameters.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/projectlinks/ProjectLinksWsParameters.java
new file mode 100644
index 00000000000..ea43c3fc466
--- /dev/null
+++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/projectlinks/ProjectLinksWsParameters.java
@@ -0,0 +1,34 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2016 SonarSource SA
+ * mailto:contact AT sonarsource DOT com
+ *
+ * This program 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.
+ *
+ * This program 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.projectlinks;
+
+public class ProjectLinksWsParameters {
+
+ //actions
+ public static final String ACTION_SEARCH = "search";
+
+ // parameters
+ public static final String PARAM_PROJECT_ID = "projectId";
+ public static final String PARAM_PROJECT_KEY = "projectKey";
+
+ private ProjectLinksWsParameters() {
+ // static utility class
+ }
+}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/projectlinks/SearchWsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/projectlinks/SearchWsRequest.java
new file mode 100644
index 00000000000..68ec36607d9
--- /dev/null
+++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/projectlinks/SearchWsRequest.java
@@ -0,0 +1,50 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2016 SonarSource SA
+ * mailto:contact AT sonarsource DOT com
+ *
+ * This program 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.
+ *
+ * This program 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.projectlinks;
+
+import javax.annotation.CheckForNull;
+import javax.annotation.Nullable;
+
+public class SearchWsRequest {
+ @CheckForNull
+ private String projectId;
+ @CheckForNull
+ private String projectKey;
+
+ @CheckForNull
+ public String getProjectId() {
+ return projectId;
+ }
+
+ public SearchWsRequest setProjectId(@Nullable String projectId) {
+ this.projectId = projectId;
+ return this;
+ }
+
+ @CheckForNull
+ public String getProjectKey() {
+ return projectKey;
+ }
+
+ public SearchWsRequest setProjectKey(@Nullable String projectKey) {
+ this.projectKey = projectKey;
+ return this;
+ }
+}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/projectlinks/package-info.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/projectlinks/package-info.java
new file mode 100644
index 00000000000..9c27157c46b
--- /dev/null
+++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/projectlinks/package-info.java
@@ -0,0 +1,25 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2016 SonarSource SA
+ * mailto:contact AT sonarsource DOT com
+ *
+ * This program 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.
+ *
+ * This program 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.client.projectlinks;
+
+import javax.annotation.ParametersAreNonnullByDefault;
+
diff --git a/sonar-ws/src/main/protobuf/ws-projectlink.proto b/sonar-ws/src/main/protobuf/ws-projectlink.proto
new file mode 100644
index 00000000000..32e1d59d725
--- /dev/null
+++ b/sonar-ws/src/main/protobuf/ws-projectlink.proto
@@ -0,0 +1,19 @@
+syntax = "proto2";
+
+package sonarqube.ws.projectlink;
+
+option java_package = "org.sonarqube.ws";
+option java_outer_classname = "WsProjectLinks";
+option optimize_for = SPEED;
+
+// WS api/project_links/list
+message SearchWsResponse {
+ repeated Link links = 1;
+}
+
+message Link {
+ optional string id = 1;
+ optional string name = 2;
+ optional string type = 3;
+ optional string url = 4;
+} \ No newline at end of file