]> source.dussan.org Git - sonarqube.git/commitdiff
Initial generation of sonar-ws client
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Wed, 22 Nov 2017 20:51:52 +0000 (21:51 +0100)
committerDaniel Schwarz <bartfastiel@users.noreply.github.com>
Wed, 29 Nov 2017 19:24:11 +0000 (20:24 +0100)
110 files changed:
server/sonar-server/src/main/java/org/sonar/server/branch/ws/BranchesWs.java
server/sonar-server/src/main/java/org/sonar/server/branch/ws/DeleteAction.java
server/sonar-server/src/main/java/org/sonar/server/branch/ws/ListAction.java
server/sonar-server/src/main/java/org/sonar/server/branch/ws/ProjectBranchesParameters.java [new file with mode: 0644]
server/sonar-server/src/main/java/org/sonar/server/branch/ws/RenameAction.java
server/sonar-server/src/main/java/org/sonar/server/ce/ws/ActivityAction.java
server/sonar-server/src/main/java/org/sonar/server/ce/ws/ActivityStatusAction.java
server/sonar-server/src/main/java/org/sonar/server/ce/ws/CeWsParameters.java [new file with mode: 0644]
server/sonar-server/src/main/java/org/sonar/server/ce/ws/ComponentAction.java
server/sonar-server/src/main/java/org/sonar/server/ce/ws/WorkerCountAction.java
server/sonar-server/src/main/java/org/sonar/server/favorite/ws/AddAction.java
server/sonar-server/src/main/java/org/sonar/server/favorite/ws/FavoritesWsParameters.java [new file with mode: 0644]
server/sonar-server/src/main/java/org/sonar/server/favorite/ws/RemoveAction.java
server/sonar-server/src/main/java/org/sonar/server/favorite/ws/SearchAction.java
server/sonar-server/src/main/java/org/sonar/server/notification/ws/AddAction.java
server/sonar-server/src/main/java/org/sonar/server/notification/ws/ListAction.java
server/sonar-server/src/main/java/org/sonar/server/notification/ws/NotificationsWs.java
server/sonar-server/src/main/java/org/sonar/server/notification/ws/NotificationsWsParameters.java [new file with mode: 0644]
server/sonar-server/src/main/java/org/sonar/server/notification/ws/RemoveAction.java
server/sonar-server/src/main/java/org/sonar/server/projectlink/ws/CreateAction.java
server/sonar-server/src/main/java/org/sonar/server/projectlink/ws/DeleteAction.java
server/sonar-server/src/main/java/org/sonar/server/projectlink/ws/ProjectLinksWsParameters.java [new file with mode: 0644]
server/sonar-server/src/main/java/org/sonar/server/projectlink/ws/SearchAction.java
server/sonar-server/src/main/java/org/sonar/server/qualitygate/ws/CopyAction.java
server/sonar-server/src/main/java/org/sonar/server/qualitygate/ws/CreateAction.java
server/sonar-server/src/main/java/org/sonar/server/qualitygate/ws/CreateConditionAction.java
server/sonar-server/src/main/java/org/sonar/server/qualitygate/ws/DeleteConditionAction.java
server/sonar-server/src/main/java/org/sonar/server/qualitygate/ws/DeselectAction.java
server/sonar-server/src/main/java/org/sonar/server/qualitygate/ws/DestroyAction.java
server/sonar-server/src/main/java/org/sonar/server/qualitygate/ws/GetByProjectAction.java
server/sonar-server/src/main/java/org/sonar/server/qualitygate/ws/ProjectStatusAction.java
server/sonar-server/src/main/java/org/sonar/server/qualitygate/ws/QualityGatesWs.java
server/sonar-server/src/main/java/org/sonar/server/qualitygate/ws/QualityGatesWsParameters.java [new file with mode: 0644]
server/sonar-server/src/main/java/org/sonar/server/qualitygate/ws/RenameAction.java
server/sonar-server/src/main/java/org/sonar/server/qualitygate/ws/SearchAction.java
server/sonar-server/src/main/java/org/sonar/server/qualitygate/ws/SelectAction.java
server/sonar-server/src/main/java/org/sonar/server/qualitygate/ws/SetAsDefaultAction.java
server/sonar-server/src/main/java/org/sonar/server/qualitygate/ws/ShowAction.java
server/sonar-server/src/main/java/org/sonar/server/qualitygate/ws/UnsetDefaultAction.java
server/sonar-server/src/main/java/org/sonar/server/qualitygate/ws/UpdateConditionAction.java
server/sonar-server/src/main/java/org/sonar/server/usertoken/ws/GenerateAction.java
server/sonar-server/src/main/java/org/sonar/server/usertoken/ws/RevokeAction.java
server/sonar-server/src/main/java/org/sonar/server/usertoken/ws/SearchAction.java
server/sonar-server/src/main/java/org/sonar/server/usertoken/ws/UserTokensWs.java
server/sonar-server/src/main/java/org/sonar/server/usertoken/ws/UserTokensWsParameters.java [new file with mode: 0644]
server/sonar-server/src/test/java/org/sonar/server/ce/ws/ActivityActionTest.java
server/sonar-server/src/test/java/org/sonar/server/ce/ws/ActivityStatusActionTest.java
server/sonar-server/src/test/java/org/sonar/server/ce/ws/ComponentActionTest.java
server/sonar-server/src/test/java/org/sonar/server/favorite/ws/AddActionTest.java
server/sonar-server/src/test/java/org/sonar/server/favorite/ws/RemoveActionTest.java
server/sonar-server/src/test/java/org/sonar/server/notification/ws/AddActionTest.java
server/sonar-server/src/test/java/org/sonar/server/notification/ws/RemoveActionTest.java
server/sonar-server/src/test/java/org/sonar/server/projectlink/ws/CreateActionTest.java
server/sonar-server/src/test/java/org/sonar/server/projectlink/ws/DeleteActionTest.java
server/sonar-server/src/test/java/org/sonar/server/projectlink/ws/SearchActionTest.java
server/sonar-server/src/test/java/org/sonar/server/qualitygate/ws/CreateConditionActionTest.java
server/sonar-server/src/test/java/org/sonar/server/qualitygate/ws/DeleteConditionActionTest.java
server/sonar-server/src/test/java/org/sonar/server/qualitygate/ws/ProjectStatusActionTest.java
server/sonar-server/src/test/java/org/sonar/server/qualitygate/ws/UpdateConditionActionTest.java
server/sonar-server/src/test/java/org/sonar/server/usertoken/ws/GenerateActionTest.java
server/sonar-server/src/test/java/org/sonar/server/usertoken/ws/RevokeActionTest.java
server/sonar-server/src/test/java/org/sonar/server/usertoken/ws/SearchActionTest.java
sonar-ws/src/main/java/org/sonarqube/ws/client/DefaultWsClient.java
sonar-ws/src/main/java/org/sonarqube/ws/client/WsClient.java
sonar-ws/src/main/java/org/sonarqube/ws/client/ce/CeWsParameters.java [deleted file]
sonar-ws/src/main/java/org/sonarqube/ws/client/ce/package-info.java [deleted file]
sonar-ws/src/main/java/org/sonarqube/ws/client/favorite/FavoritesService.java [deleted file]
sonar-ws/src/main/java/org/sonarqube/ws/client/favorite/FavoritesWsParameters.java [deleted file]
sonar-ws/src/main/java/org/sonarqube/ws/client/favorite/SearchRequest.java [deleted file]
sonar-ws/src/main/java/org/sonarqube/ws/client/favorite/package-info.java [deleted file]
sonar-ws/src/main/java/org/sonarqube/ws/client/notification/AddRequest.java [deleted file]
sonar-ws/src/main/java/org/sonarqube/ws/client/notification/NotificationsWsParameters.java [deleted file]
sonar-ws/src/main/java/org/sonarqube/ws/client/notification/RemoveRequest.java [deleted file]
sonar-ws/src/main/java/org/sonarqube/ws/client/notification/package-info.java [deleted file]
sonar-ws/src/main/java/org/sonarqube/ws/client/projectbranches/ProjectBranchesParameters.java [deleted file]
sonar-ws/src/main/java/org/sonarqube/ws/client/projectbranches/ProjectBranchesServiceOld.java [deleted file]
sonar-ws/src/main/java/org/sonarqube/ws/client/projectbranches/package-info.java [deleted file]
sonar-ws/src/main/java/org/sonarqube/ws/client/projectlinks/CreateWsRequest.java [deleted file]
sonar-ws/src/main/java/org/sonarqube/ws/client/projectlinks/DeleteWsRequest.java [deleted file]
sonar-ws/src/main/java/org/sonarqube/ws/client/projectlinks/ProjectLinksService.java [deleted file]
sonar-ws/src/main/java/org/sonarqube/ws/client/projectlinks/ProjectLinksWsParameters.java [deleted file]
sonar-ws/src/main/java/org/sonarqube/ws/client/projectlinks/SearchWsRequest.java [deleted file]
sonar-ws/src/main/java/org/sonarqube/ws/client/projectlinks/package-info.java [deleted file]
sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygate/QualityGatesWsParameters.java [deleted file]
sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygate/package-info.java [deleted file]
sonar-ws/src/main/java/org/sonarqube/ws/client/system/SystemServiceOld.java [deleted file]
sonar-ws/src/main/java/org/sonarqube/ws/client/system/package-info.java [deleted file]
sonar-ws/src/main/java/org/sonarqube/ws/client/usertoken/GenerateWsRequest.java [deleted file]
sonar-ws/src/main/java/org/sonarqube/ws/client/usertoken/RevokeWsRequest.java [deleted file]
sonar-ws/src/main/java/org/sonarqube/ws/client/usertoken/SearchWsRequest.java [deleted file]
sonar-ws/src/main/java/org/sonarqube/ws/client/usertoken/UserTokensService.java [deleted file]
sonar-ws/src/main/java/org/sonarqube/ws/client/usertoken/UserTokensWsParameters.java [deleted file]
sonar-ws/src/main/java/org/sonarqube/ws/client/usertoken/package-info.java [deleted file]
sonar-ws/src/main/java/org/sonarqube/ws/client/webhook/DeliveriesRequest.java [deleted file]
sonar-ws/src/main/java/org/sonarqube/ws/client/webhook/WebhooksService.java [deleted file]
sonar-ws/src/main/java/org/sonarqube/ws/client/webhook/package-info.java [deleted file]
sonar-ws/src/test/java/org/sonarqube/ws/client/favorite/FavoritesServiceTest.java [deleted file]
sonar-ws/src/test/java/org/sonarqube/ws/client/favorite/SearchRequestTest.java [deleted file]
sonar-ws/src/test/java/org/sonarqube/ws/client/projectbranches/ProjectBranchesServiceTest.java [deleted file]
sonar-ws/src/test/java/org/sonarqube/ws/client/projectlinks/ProjectLinksServiceTest.java [deleted file]
sonar-ws/src/test/java/org/sonarqube/ws/client/system/SystemServiceTest.java [deleted file]
tests/src/test/java/org/sonarqube/tests/analysis/FavoriteTest.java
tests/src/test/java/org/sonarqube/tests/analysis/LinksTest.java
tests/src/test/java/org/sonarqube/tests/analysis/PermissionTest.java
tests/src/test/java/org/sonarqube/tests/component/BranchTest.java
tests/src/test/java/org/sonarqube/tests/project/ProjectLinksTest.java
tests/src/test/java/org/sonarqube/tests/project/ProjectsPageTest.java
tests/src/test/java/org/sonarqube/tests/user/FavoritesWsTest.java
tests/src/test/java/org/sonarqube/tests/user/LocalAuthenticationTest.java
tests/src/test/java/org/sonarqube/tests/webhook/WebhooksTest.java

index 7275130e1f3334b595325bb9e0d17d0f4f492ad4..17bafb54e4f6491b0187a3b0b3cc0c08307d26df 100644 (file)
@@ -23,9 +23,9 @@ import java.util.Arrays;
 import org.sonar.api.server.ws.WebService;
 
 import static org.sonar.server.ws.KeyExamples.KEY_PROJECT_EXAMPLE_001;
-import static org.sonarqube.ws.client.projectbranches.ProjectBranchesParameters.CONTROLLER;
-import static org.sonarqube.ws.client.projectbranches.ProjectBranchesParameters.PARAM_BRANCH;
-import static org.sonarqube.ws.client.projectbranches.ProjectBranchesParameters.PARAM_PROJECT;
+import static org.sonar.server.branch.ws.ProjectBranchesParameters.CONTROLLER;
+import static org.sonar.server.branch.ws.ProjectBranchesParameters.PARAM_BRANCH;
+import static org.sonar.server.branch.ws.ProjectBranchesParameters.PARAM_PROJECT;
 
 public class BranchesWs implements WebService {
   private final BranchWsAction[] actions;
index a04f6deed316ca8296689e09cf241ac932e81ac4..fd461cc6dac39a6cf229d8144e08cf4512907f30 100644 (file)
@@ -36,9 +36,9 @@ import org.sonar.server.user.UserSession;
 import static org.sonar.server.branch.ws.BranchesWs.addBranchParam;
 import static org.sonar.server.branch.ws.BranchesWs.addProjectParam;
 import static org.sonar.server.ws.WsUtils.checkFoundWithOptional;
-import static org.sonarqube.ws.client.projectbranches.ProjectBranchesParameters.ACTION_DELETE;
-import static org.sonarqube.ws.client.projectbranches.ProjectBranchesParameters.PARAM_BRANCH;
-import static org.sonarqube.ws.client.projectbranches.ProjectBranchesParameters.PARAM_PROJECT;
+import static org.sonar.server.branch.ws.ProjectBranchesParameters.ACTION_DELETE;
+import static org.sonar.server.branch.ws.ProjectBranchesParameters.PARAM_BRANCH;
+import static org.sonar.server.branch.ws.ProjectBranchesParameters.PARAM_PROJECT;
 
 public class DeleteAction implements BranchWsAction {
   private final DbClient dbClient;
index f82fe00936a5ee1e14007d812a692648d011e847..d337d8ca5fd0fa557d06451035f09b1eed8f22de 100644 (file)
@@ -58,8 +58,8 @@ import static org.sonar.core.util.stream.MoreCollectors.uniqueIndex;
 import static org.sonar.db.component.BranchType.LONG;
 import static org.sonar.db.component.BranchType.SHORT;
 import static org.sonar.server.branch.ws.BranchesWs.addProjectParam;
-import static org.sonarqube.ws.client.projectbranches.ProjectBranchesParameters.ACTION_LIST;
-import static org.sonarqube.ws.client.projectbranches.ProjectBranchesParameters.PARAM_PROJECT;
+import static org.sonar.server.branch.ws.ProjectBranchesParameters.ACTION_LIST;
+import static org.sonar.server.branch.ws.ProjectBranchesParameters.PARAM_PROJECT;
 
 public class ListAction implements BranchWsAction {
 
diff --git a/server/sonar-server/src/main/java/org/sonar/server/branch/ws/ProjectBranchesParameters.java b/server/sonar-server/src/main/java/org/sonar/server/branch/ws/ProjectBranchesParameters.java
new file mode 100644 (file)
index 0000000..8dd09ac
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info 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.sonar.server.branch.ws;
+
+public class ProjectBranchesParameters {
+
+  public static final String CONTROLLER = "api/project_branches";
+
+  // actions
+  public static final String ACTION_LIST = "list";
+  public static final String ACTION_DELETE = "delete";
+  public static final String ACTION_RENAME = "rename";
+
+  // parameters
+  public static final String PARAM_PROJECT = "project";
+  public static final String PARAM_COMPONENT = "component";
+  public static final String PARAM_BRANCH = "branch";
+  public static final String PARAM_NAME = "name";
+
+  private ProjectBranchesParameters() {
+    // static utility class
+  }
+}
index a12cd80b10a4530d78f51faa692f3afc3bd3792f..618659a114816de107d1698df998041cb6464170 100644 (file)
@@ -34,9 +34,9 @@ import org.sonar.server.user.UserSession;
 
 import static com.google.common.base.Preconditions.checkArgument;
 import static org.sonar.server.branch.ws.BranchesWs.addProjectParam;
-import static org.sonarqube.ws.client.projectbranches.ProjectBranchesParameters.ACTION_RENAME;
-import static org.sonarqube.ws.client.projectbranches.ProjectBranchesParameters.PARAM_NAME;
-import static org.sonarqube.ws.client.projectbranches.ProjectBranchesParameters.PARAM_PROJECT;
+import static org.sonar.server.branch.ws.ProjectBranchesParameters.ACTION_RENAME;
+import static org.sonar.server.branch.ws.ProjectBranchesParameters.PARAM_NAME;
+import static org.sonar.server.branch.ws.ProjectBranchesParameters.PARAM_PROJECT;
 
 public class RenameAction implements BranchWsAction {
   private final ComponentFinder componentFinder;
index a3f773fc5ca9572617d36da45e41cac4b7d8c7b1..30febfb0af8805df8566a71c29367e930ad08fe2 100644 (file)
@@ -64,13 +64,13 @@ import static org.sonar.db.Pagination.forPage;
 import static org.sonar.server.ws.WsUtils.checkFoundWithOptional;
 import static org.sonar.server.ws.WsUtils.checkRequest;
 import static org.sonar.server.ws.WsUtils.writeProtobuf;
-import static org.sonarqube.ws.client.ce.CeWsParameters.PARAM_COMPONENT_ID;
-import static org.sonarqube.ws.client.ce.CeWsParameters.PARAM_COMPONENT_QUERY;
-import static org.sonarqube.ws.client.ce.CeWsParameters.PARAM_MAX_EXECUTED_AT;
-import static org.sonarqube.ws.client.ce.CeWsParameters.PARAM_MIN_SUBMITTED_AT;
-import static org.sonarqube.ws.client.ce.CeWsParameters.PARAM_ONLY_CURRENTS;
-import static org.sonarqube.ws.client.ce.CeWsParameters.PARAM_STATUS;
-import static org.sonarqube.ws.client.ce.CeWsParameters.PARAM_TYPE;
+import static org.sonar.server.ce.ws.CeWsParameters.PARAM_COMPONENT_ID;
+import static org.sonar.server.ce.ws.CeWsParameters.PARAM_COMPONENT_QUERY;
+import static org.sonar.server.ce.ws.CeWsParameters.PARAM_MAX_EXECUTED_AT;
+import static org.sonar.server.ce.ws.CeWsParameters.PARAM_MIN_SUBMITTED_AT;
+import static org.sonar.server.ce.ws.CeWsParameters.PARAM_ONLY_CURRENTS;
+import static org.sonar.server.ce.ws.CeWsParameters.PARAM_STATUS;
+import static org.sonar.server.ce.ws.CeWsParameters.PARAM_TYPE;
 
 public class ActivityAction implements CeWsAction {
   private static final int MAX_PAGE_SIZE = 1000;
index cbe55189827273d8a5baa31c3dcee61e81d55666..d626c356732a8cd2447216b9f3ea14024678415f 100644 (file)
@@ -39,8 +39,8 @@ import org.sonarqube.ws.client.ce.ActivityStatusRequest;
 
 import static org.sonar.server.component.ComponentFinder.ParamNames.COMPONENT_ID_AND_KEY;
 import static org.sonar.server.ws.WsUtils.writeProtobuf;
-import static org.sonarqube.ws.client.ce.CeWsParameters.DEPRECATED_PARAM_COMPONENT_KEY;
-import static org.sonarqube.ws.client.ce.CeWsParameters.PARAM_COMPONENT_ID;
+import static org.sonar.server.ce.ws.CeWsParameters.DEPRECATED_PARAM_COMPONENT_KEY;
+import static org.sonar.server.ce.ws.CeWsParameters.PARAM_COMPONENT_ID;
 
 public class ActivityStatusAction implements CeWsAction {
   private final UserSession userSession;
diff --git a/server/sonar-server/src/main/java/org/sonar/server/ce/ws/CeWsParameters.java b/server/sonar-server/src/main/java/org/sonar/server/ce/ws/CeWsParameters.java
new file mode 100644 (file)
index 0000000..a6e5647
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info 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.sonar.server.ce.ws;
+
+public class CeWsParameters {
+
+  public static final String ACTION_WORKER_COUNT = "worker_count";
+
+  public static final String PARAM_COMPONENT_ID = "componentId";
+  public static final String DEPRECATED_PARAM_COMPONENT_KEY = "componentKey";
+  public static final String PARAM_COMPONENT = "component";
+  public static final String PARAM_COMPONENT_QUERY = "componentQuery";
+  public static final String PARAM_TYPE = "type";
+  public static final String PARAM_STATUS = "status";
+  public static final String PARAM_ONLY_CURRENTS = "onlyCurrents";
+  public static final String PARAM_MIN_SUBMITTED_AT = "minSubmittedAt";
+  public static final String PARAM_MAX_EXECUTED_AT = "maxExecutedAt";
+
+  private CeWsParameters() {
+    // prevent instantiation
+  }
+}
index 481164abc9414fd69618ca34e09fb0215a0b644a..cce38feeeb7a74bd621ff0b2b4f5e7cf75733b66 100644 (file)
@@ -41,8 +41,8 @@ import org.sonarqube.ws.Ce.ComponentResponse;
 import static org.sonar.db.Pagination.forPage;
 import static org.sonar.server.component.ComponentFinder.ParamNames.COMPONENT_ID_AND_COMPONENT;
 import static org.sonar.server.ws.WsUtils.writeProtobuf;
-import static org.sonarqube.ws.client.ce.CeWsParameters.PARAM_COMPONENT;
-import static org.sonarqube.ws.client.ce.CeWsParameters.PARAM_COMPONENT_ID;
+import static org.sonar.server.ce.ws.CeWsParameters.PARAM_COMPONENT;
+import static org.sonar.server.ce.ws.CeWsParameters.PARAM_COMPONENT_ID;
 
 public class ComponentAction implements CeWsAction {
 
index 5d0f402bec5b1c9007bd9a3833ce1bc47e938c94..b4bab925277676c0a3afa2b0e0074f013a67957e 100644 (file)
@@ -28,7 +28,7 @@ import org.sonar.server.user.UserSession;
 import org.sonarqube.ws.Ce.WorkerCountResponse;
 
 import static org.sonar.server.ws.WsUtils.writeProtobuf;
-import static org.sonarqube.ws.client.ce.CeWsParameters.ACTION_WORKER_COUNT;
+import static org.sonar.server.ce.ws.CeWsParameters.ACTION_WORKER_COUNT;
 
 public class WorkerCountAction implements CeWsAction {
 
index 8625996ef32ef3ba90968e171eeae34f869fb449..ff341b13ad87097b2cf504426672940ba49b8575 100644 (file)
@@ -32,7 +32,7 @@ import org.sonar.server.favorite.FavoriteUpdater;
 import org.sonar.server.user.UserSession;
 import org.sonar.server.ws.KeyExamples;
 
-import static org.sonarqube.ws.client.favorite.FavoritesWsParameters.PARAM_COMPONENT;
+import static org.sonar.server.favorite.ws.FavoritesWsParameters.PARAM_COMPONENT;
 
 public class AddAction implements FavoritesWsAction {
   private final UserSession userSession;
diff --git a/server/sonar-server/src/main/java/org/sonar/server/favorite/ws/FavoritesWsParameters.java b/server/sonar-server/src/main/java/org/sonar/server/favorite/ws/FavoritesWsParameters.java
new file mode 100644 (file)
index 0000000..f7ee2da
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info 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.sonar.server.favorite.ws;
+
+public class FavoritesWsParameters {
+  public static final String CONTROLLER_FAVORITES = "api/favorites";
+
+  public static final String ACTION_ADD = "add";
+  public static final String ACTION_REMOVE = "remove";
+  public static final String ACTION_SEARCH = "search";
+
+  public static final String PARAM_COMPONENT = "component";
+
+  private FavoritesWsParameters() {
+    // prevent instantiation
+  }
+}
index a749e33d64fb26c66d4370468b384854e71f64d9..a80f059531fa36bc0fe2269ff2fc2d909d443005 100644 (file)
@@ -31,7 +31,7 @@ import org.sonar.server.favorite.FavoriteUpdater;
 import org.sonar.server.user.UserSession;
 import org.sonar.server.ws.KeyExamples;
 
-import static org.sonarqube.ws.client.favorite.FavoritesWsParameters.PARAM_COMPONENT;
+import static org.sonar.server.favorite.ws.FavoritesWsParameters.PARAM_COMPONENT;
 
 public class RemoveAction implements FavoritesWsAction {
   private final UserSession userSession;
index a3bfca0621e545a5930d5fea2b40fffacde6e736..6b7b6ce40be82b1a4a718c0c768c72b12fd75352 100644 (file)
@@ -38,15 +38,16 @@ import org.sonar.server.user.UserSession;
 import org.sonarqube.ws.Common;
 import org.sonarqube.ws.Favorites.Favorite;
 import org.sonarqube.ws.Favorites.SearchResponse;
-import org.sonarqube.ws.client.favorite.SearchRequest;
+import org.sonarqube.ws.client.favorites.SearchRequest;
 
 import static com.google.common.base.Preconditions.checkArgument;
 import static org.sonar.core.util.Protobuf.setNullable;
 import static org.sonar.server.ws.WsUtils.writeProtobuf;
-import static org.sonarqube.ws.client.favorite.FavoritesWsParameters.ACTION_SEARCH;
-import static org.sonarqube.ws.client.favorite.SearchRequest.MAX_PAGE_SIZE;
+import static org.sonar.server.favorite.ws.FavoritesWsParameters.ACTION_SEARCH;
 
 public class SearchAction implements FavoritesWsAction {
+  private static final int MAX_PAGE_SIZE = 500;
+
   private final FavoriteFinder favoriteFinder;
   private final DbClient dbClient;
   private final UserSession userSession;
@@ -79,15 +80,15 @@ public class SearchAction implements FavoritesWsAction {
 
   private static SearchRequest toWsRequest(Request request) {
     return new SearchRequest()
-      .setPage(request.mandatoryParamAsInt(Param.PAGE))
-      .setPageSize(request.mandatoryParamAsInt(Param.PAGE_SIZE));
+      .setP(request.mandatoryParam(Param.PAGE))
+      .setPs(request.mandatoryParam(Param.PAGE_SIZE));
   }
 
   private SearchResults toSearchResults(SearchRequest request) {
     userSession.checkLoggedIn();
     try (DbSession dbSession = dbClient.openSession(false)) {
       List<ComponentDto> authorizedFavorites = getAuthorizedFavorites();
-      Paging paging = Paging.forPageIndex(request.getPage()).withPageSize(request.getPageSize()).andTotal(authorizedFavorites.size());
+      Paging paging = Paging.forPageIndex(Integer.parseInt(request.getP())).withPageSize(Integer.parseInt(request.getPs())).andTotal(authorizedFavorites.size());
       List<ComponentDto> displayedFavorites = authorizedFavorites.stream()
         .skip(paging.offset())
         .limit(paging.pageSize())
index 65eab55e15a7b91bb4bf27e06a032a0d61f34967..4fac5363b7092c34d656db5b3b83e4b4ec007fff 100644 (file)
@@ -39,7 +39,7 @@ import org.sonar.server.notification.NotificationUpdater;
 import org.sonar.server.notification.email.EmailNotificationChannel;
 import org.sonar.server.user.UserSession;
 import org.sonar.server.ws.KeyExamples;
-import org.sonarqube.ws.client.notification.AddRequest;
+import org.sonarqube.ws.client.notifications.AddRequest;
 
 import static java.util.Optional.empty;
 import static org.sonar.core.util.Protobuf.setNullable;
@@ -48,11 +48,11 @@ import static org.sonar.server.notification.NotificationDispatcherMetadata.GLOBA
 import static org.sonar.server.notification.NotificationDispatcherMetadata.PER_PROJECT_NOTIFICATION;
 import static org.sonar.server.ws.WsUtils.checkFound;
 import static org.sonar.server.ws.WsUtils.checkRequest;
-import static org.sonarqube.ws.client.notification.NotificationsWsParameters.ACTION_ADD;
-import static org.sonarqube.ws.client.notification.NotificationsWsParameters.PARAM_CHANNEL;
-import static org.sonarqube.ws.client.notification.NotificationsWsParameters.PARAM_LOGIN;
-import static org.sonarqube.ws.client.notification.NotificationsWsParameters.PARAM_PROJECT;
-import static org.sonarqube.ws.client.notification.NotificationsWsParameters.PARAM_TYPE;
+import static org.sonar.server.notification.ws.NotificationsWsParameters.ACTION_ADD;
+import static org.sonar.server.notification.ws.NotificationsWsParameters.PARAM_CHANNEL;
+import static org.sonar.server.notification.ws.NotificationsWsParameters.PARAM_LOGIN;
+import static org.sonar.server.notification.ws.NotificationsWsParameters.PARAM_PROJECT;
+import static org.sonar.server.notification.ws.NotificationsWsParameters.PARAM_TYPE;
 
 public class AddAction implements NotificationsWsAction {
   private final NotificationCenter notificationCenter;
@@ -152,25 +152,24 @@ public class AddAction implements NotificationsWsAction {
   }
 
   private AddRequest toWsRequest(Request request) {
-    AddRequest.Builder requestBuilder = AddRequest.builder()
+    AddRequest add = new AddRequest()
       .setType(request.mandatoryParam(PARAM_TYPE))
       .setChannel(request.mandatoryParam(PARAM_CHANNEL));
-    setNullable(request.param(PARAM_PROJECT), requestBuilder::setProject);
-    setNullable(request.param(PARAM_LOGIN), requestBuilder::setLogin);
-    AddRequest wsRequest = requestBuilder.build();
+    setNullable(request.param(PARAM_PROJECT), add::setProject);
+    setNullable(request.param(PARAM_LOGIN), add::setLogin);
 
-    if (wsRequest.getProject() == null) {
-      checkRequest(globalDispatchers.contains(wsRequest.getType()), "Value of parameter '%s' (%s) must be one of: %s",
+    if (add.getProject() == null) {
+      checkRequest(globalDispatchers.contains(add.getType()), "Value of parameter '%s' (%s) must be one of: %s",
         PARAM_TYPE,
-        wsRequest.getType(),
+        add.getType(),
         globalDispatchers);
     } else {
-      checkRequest(projectDispatchers.contains(wsRequest.getType()), "Value of parameter '%s' (%s) must be one of: %s",
+      checkRequest(projectDispatchers.contains(add.getType()), "Value of parameter '%s' (%s) must be one of: %s",
         PARAM_TYPE,
-        wsRequest.getType(),
+        add.getType(),
         projectDispatchers);
     }
 
-    return wsRequest;
+    return add;
   }
 }
index 3a81c95f56bb7657f5251c7e04d0f3222469fb76..9730cac9215166710ac39bed1a5e68b2ab1a4cd3 100644 (file)
@@ -57,8 +57,8 @@ import static org.sonar.server.notification.NotificationDispatcherMetadata.GLOBA
 import static org.sonar.server.notification.NotificationDispatcherMetadata.PER_PROJECT_NOTIFICATION;
 import static org.sonar.server.ws.WsUtils.checkFound;
 import static org.sonar.server.ws.WsUtils.writeProtobuf;
-import static org.sonarqube.ws.client.notification.NotificationsWsParameters.ACTION_LIST;
-import static org.sonarqube.ws.client.notification.NotificationsWsParameters.PARAM_LOGIN;
+import static org.sonar.server.notification.ws.NotificationsWsParameters.ACTION_LIST;
+import static org.sonar.server.notification.ws.NotificationsWsParameters.PARAM_LOGIN;
 
 public class ListAction implements NotificationsWsAction {
   private static final Splitter PROPERTY_KEY_SPLITTER = Splitter.on(".");
index 30d6f5e5a15ab0a9f6a8476fda33adf23ca47873..43dbd684579f26fb0f282a90f3838900bfbf2f56 100644 (file)
@@ -21,7 +21,7 @@ package org.sonar.server.notification.ws;
 
 import org.sonar.api.server.ws.WebService;
 
-import static org.sonarqube.ws.client.notification.NotificationsWsParameters.CONTROLLER;
+import static org.sonar.server.notification.ws.NotificationsWsParameters.CONTROLLER;
 
 public class NotificationsWs implements WebService {
   private final NotificationsWsAction[] actions;
diff --git a/server/sonar-server/src/main/java/org/sonar/server/notification/ws/NotificationsWsParameters.java b/server/sonar-server/src/main/java/org/sonar/server/notification/ws/NotificationsWsParameters.java
new file mode 100644 (file)
index 0000000..4e45e8d
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info 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.sonar.server.notification.ws;
+
+public class NotificationsWsParameters {
+  public static final String CONTROLLER = "api/notifications";
+  public static final String ACTION_ADD = "add";
+  public static final String ACTION_REMOVE = "remove";
+  public static final String ACTION_LIST = "list";
+
+  public static final String PARAM_PROJECT = "project";
+  public static final String PARAM_CHANNEL = "channel";
+  public static final String PARAM_TYPE = "type";
+  public static final String PARAM_LOGIN = "login";
+
+  private NotificationsWsParameters() {
+    // prevent instantiation
+  }
+}
index e44841a5bde3c88384a5e69ff8de5bfe2911338d..b8cd0a79ed2bfcf91a863426b6ce1b4d67101019 100644 (file)
@@ -39,7 +39,7 @@ import org.sonar.server.notification.NotificationUpdater;
 import org.sonar.server.notification.email.EmailNotificationChannel;
 import org.sonar.server.user.UserSession;
 import org.sonar.server.ws.KeyExamples;
-import org.sonarqube.ws.client.notification.RemoveRequest;
+import org.sonarqube.ws.client.notifications.RemoveRequest;
 
 import static java.util.Optional.empty;
 import static org.sonar.core.util.Protobuf.setNullable;
@@ -47,11 +47,11 @@ import static org.sonar.server.notification.NotificationDispatcherMetadata.GLOBA
 import static org.sonar.server.notification.NotificationDispatcherMetadata.PER_PROJECT_NOTIFICATION;
 import static org.sonar.server.ws.WsUtils.checkFound;
 import static org.sonar.server.ws.WsUtils.checkRequest;
-import static org.sonarqube.ws.client.notification.NotificationsWsParameters.ACTION_REMOVE;
-import static org.sonarqube.ws.client.notification.NotificationsWsParameters.PARAM_CHANNEL;
-import static org.sonarqube.ws.client.notification.NotificationsWsParameters.PARAM_LOGIN;
-import static org.sonarqube.ws.client.notification.NotificationsWsParameters.PARAM_PROJECT;
-import static org.sonarqube.ws.client.notification.NotificationsWsParameters.PARAM_TYPE;
+import static org.sonar.server.notification.ws.NotificationsWsParameters.ACTION_REMOVE;
+import static org.sonar.server.notification.ws.NotificationsWsParameters.PARAM_CHANNEL;
+import static org.sonar.server.notification.ws.NotificationsWsParameters.PARAM_LOGIN;
+import static org.sonar.server.notification.ws.NotificationsWsParameters.PARAM_PROJECT;
+import static org.sonar.server.notification.ws.NotificationsWsParameters.PARAM_TYPE;
 
 public class RemoveAction implements NotificationsWsAction {
   private final NotificationCenter notificationCenter;
@@ -150,25 +150,24 @@ public class RemoveAction implements NotificationsWsAction {
   }
 
   private RemoveRequest toWsRequest(Request request) {
-    RemoveRequest.Builder requestBuilder = RemoveRequest.builder()
+    RemoveRequest remove = new RemoveRequest()
       .setType(request.mandatoryParam(PARAM_TYPE))
       .setChannel(request.mandatoryParam(PARAM_CHANNEL));
-    setNullable(request.param(PARAM_PROJECT), requestBuilder::setProject);
-    setNullable(request.param(PARAM_LOGIN), requestBuilder::setLogin);
-    RemoveRequest wsRequest = requestBuilder.build();
+    setNullable(request.param(PARAM_PROJECT), remove::setProject);
+    setNullable(request.param(PARAM_LOGIN), remove::setLogin);
 
-    if (wsRequest.getProject() == null) {
-      checkRequest(globalDispatchers.contains(wsRequest.getType()), "Value of parameter '%s' (%s) must be one of: %s",
+    if (remove.getProject() == null) {
+      checkRequest(globalDispatchers.contains(remove.getType()), "Value of parameter '%s' (%s) must be one of: %s",
         PARAM_TYPE,
-        wsRequest.getType(),
+        remove.getType(),
         globalDispatchers);
     } else {
-      checkRequest(projectDispatchers.contains(wsRequest.getType()), "Value of parameter '%s' (%s) must be one of: %s",
+      checkRequest(projectDispatchers.contains(remove.getType()), "Value of parameter '%s' (%s) must be one of: %s",
         PARAM_TYPE,
-        wsRequest.getType(),
+        remove.getType(),
         projectDispatchers);
     }
 
-    return wsRequest;
+    return remove;
   }
 }
index 69fec71a4c8a368161f6792af7eb8a03ecdfc00e..11f7a31009f314b6dbfaca8e76866dca9b79e75d 100644 (file)
@@ -31,17 +31,17 @@ import org.sonar.server.component.ComponentFinder;
 import org.sonar.server.user.UserSession;
 import org.sonarqube.ws.ProjectLinks;
 import org.sonarqube.ws.ProjectLinks.CreateWsResponse;
-import org.sonarqube.ws.client.projectlinks.CreateWsRequest;
+import org.sonarqube.ws.client.projectlinks.CreateRequest;
 
 import static org.sonar.core.util.Slug.slugify;
 import static org.sonar.core.util.Uuids.UUID_EXAMPLE_01;
 import static org.sonar.server.ws.KeyExamples.KEY_PROJECT_EXAMPLE_001;
 import static org.sonar.server.ws.WsUtils.writeProtobuf;
-import static org.sonarqube.ws.client.projectlinks.ProjectLinksWsParameters.ACTION_CREATE;
-import static org.sonarqube.ws.client.projectlinks.ProjectLinksWsParameters.PARAM_NAME;
-import static org.sonarqube.ws.client.projectlinks.ProjectLinksWsParameters.PARAM_PROJECT_ID;
-import static org.sonarqube.ws.client.projectlinks.ProjectLinksWsParameters.PARAM_PROJECT_KEY;
-import static org.sonarqube.ws.client.projectlinks.ProjectLinksWsParameters.PARAM_URL;
+import static org.sonar.server.projectlink.ws.ProjectLinksWsParameters.ACTION_CREATE;
+import static org.sonar.server.projectlink.ws.ProjectLinksWsParameters.PARAM_NAME;
+import static org.sonar.server.projectlink.ws.ProjectLinksWsParameters.PARAM_PROJECT_ID;
+import static org.sonar.server.projectlink.ws.ProjectLinksWsParameters.PARAM_PROJECT_KEY;
+import static org.sonar.server.projectlink.ws.ProjectLinksWsParameters.PARAM_URL;
 
 public class CreateAction implements ProjectLinksWsAction {
   private final DbClient dbClient;
@@ -92,12 +92,12 @@ public class CreateAction implements ProjectLinksWsAction {
 
   @Override
   public void handle(Request request, Response response) throws Exception {
-    CreateWsRequest searchWsRequest = toCreateWsRequest(request);
+    CreateRequest searchWsRequest = toCreateWsRequest(request);
     CreateWsResponse createWsResponse = doHandle(searchWsRequest);
     writeProtobuf(createWsResponse, request, response);
   }
 
-  private CreateWsResponse doHandle(CreateWsRequest createWsRequest) {
+  private CreateWsResponse doHandle(CreateRequest createWsRequest) {
     String name = createWsRequest.getName();
     String url = createWsRequest.getUrl();
 
@@ -127,7 +127,7 @@ public class CreateAction implements ProjectLinksWsAction {
       .build();
   }
 
-  private ComponentDto getComponentByUuidOrKey(DbSession dbSession, CreateWsRequest request) {
+  private ComponentDto getComponentByUuidOrKey(DbSession dbSession, CreateRequest request) {
     return componentFinder.getRootComponentByUuidOrKey(
       dbSession,
       request.getProjectId(),
@@ -135,8 +135,8 @@ public class CreateAction implements ProjectLinksWsAction {
       ComponentFinder.ParamNames.PROJECT_ID_AND_KEY);
   }
 
-  private static CreateWsRequest toCreateWsRequest(Request request) {
-    return new CreateWsRequest()
+  private static CreateRequest toCreateWsRequest(Request request) {
+    return new CreateRequest()
       .setProjectId(request.param(PARAM_PROJECT_ID))
       .setProjectKey(request.param(PARAM_PROJECT_KEY))
       .setName(request.mandatoryParam(PARAM_NAME))
index 8fac8ecdb67d91b72ef901cd3c196caec9626549..243aac6040c70b17a4435a0e19e5c89e30c3eaea 100644 (file)
@@ -28,11 +28,11 @@ import org.sonar.db.DbSession;
 import org.sonar.db.component.ComponentLinkDto;
 import org.sonar.server.user.UserSession;
 import org.sonar.server.ws.WsUtils;
-import org.sonarqube.ws.client.projectlinks.DeleteWsRequest;
+import org.sonarqube.ws.client.projectlinks.DeleteRequest;
 
 import static org.sonar.db.component.ComponentLinkDto.PROVIDED_TYPES;
-import static org.sonarqube.ws.client.projectlinks.ProjectLinksWsParameters.ACTION_DELETE;
-import static org.sonarqube.ws.client.projectlinks.ProjectLinksWsParameters.PARAM_ID;
+import static org.sonar.server.projectlink.ws.ProjectLinksWsParameters.ACTION_DELETE;
+import static org.sonar.server.projectlink.ws.ProjectLinksWsParameters.PARAM_ID;
 
 public class DeleteAction implements ProjectLinksWsAction {
   private final DbClient dbClient;
@@ -61,19 +61,19 @@ public class DeleteAction implements ProjectLinksWsAction {
 
   @Override
   public void handle(Request request, Response response) throws Exception {
-    DeleteWsRequest deleteWsRequest = toDeleteWsRequest(request);
+    DeleteRequest deleteWsRequest = toDeleteWsRequest(request);
     doHandle(deleteWsRequest);
     response.noContent();
   }
 
-  private static DeleteWsRequest toDeleteWsRequest(Request request) {
-    return new DeleteWsRequest()
-      .setId(request.mandatoryParamAsLong(PARAM_ID));
+  private static DeleteRequest toDeleteWsRequest(Request request) {
+    return new DeleteRequest()
+      .setId(request.mandatoryParam(PARAM_ID));
   }
 
-  private void doHandle(DeleteWsRequest request) {
+  private void doHandle(DeleteRequest request) {
     try (DbSession dbSession = dbClient.openSession(false)) {
-      long id = request.getId();
+      long id = Long.parseLong(request.getId());
       ComponentLinkDto link = dbClient.componentLinkDao().selectById(dbSession, id);
 
       link = WsUtils.checkFound(link, "Link with id '%s' not found", id);
diff --git a/server/sonar-server/src/main/java/org/sonar/server/projectlink/ws/ProjectLinksWsParameters.java b/server/sonar-server/src/main/java/org/sonar/server/projectlink/ws/ProjectLinksWsParameters.java
new file mode 100644 (file)
index 0000000..426fcba
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info 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.sonar.server.projectlink.ws;
+
+public class ProjectLinksWsParameters {
+
+  //actions
+  public static final String ACTION_SEARCH = "search";
+  public static final String ACTION_CREATE = "create";
+  public static final String ACTION_DELETE = "delete";
+
+  // parameters
+  public static final String PARAM_PROJECT_ID = "projectId";
+  public static final String PARAM_PROJECT_KEY = "projectKey";
+  public static final String PARAM_ID = "id";
+  public static final String PARAM_NAME = "name";
+  public static final String PARAM_URL = "url";
+
+  private ProjectLinksWsParameters() {
+    // static utility class
+  }
+}
index 4a66a049295ac5bae133978adf2377bfafc33c31..0410d9c3f0181dccdbfa30646049a9182d4c3777 100644 (file)
@@ -33,16 +33,16 @@ import org.sonar.server.component.ComponentFinder;
 import org.sonar.server.user.UserSession;
 import org.sonarqube.ws.ProjectLinks.Link;
 import org.sonarqube.ws.ProjectLinks.SearchWsResponse;
-import org.sonarqube.ws.client.projectlinks.SearchWsRequest;
+import org.sonarqube.ws.client.projectlinks.SearchRequest;
 
 import static org.sonar.core.util.Protobuf.setNullable;
 import static org.sonar.core.util.Uuids.UUID_EXAMPLE_01;
 import static org.sonar.server.user.AbstractUserSession.insufficientPrivilegesException;
 import static org.sonar.server.ws.KeyExamples.KEY_PROJECT_EXAMPLE_001;
 import static org.sonar.server.ws.WsUtils.writeProtobuf;
-import static org.sonarqube.ws.client.projectlinks.ProjectLinksWsParameters.ACTION_SEARCH;
-import static org.sonarqube.ws.client.projectlinks.ProjectLinksWsParameters.PARAM_PROJECT_ID;
-import static org.sonarqube.ws.client.projectlinks.ProjectLinksWsParameters.PARAM_PROJECT_KEY;
+import static org.sonar.server.projectlink.ws.ProjectLinksWsParameters.ACTION_SEARCH;
+import static org.sonar.server.projectlink.ws.ProjectLinksWsParameters.PARAM_PROJECT_ID;
+import static org.sonar.server.projectlink.ws.ProjectLinksWsParameters.PARAM_PROJECT_KEY;
 
 public class SearchAction implements ProjectLinksWsAction {
   private final DbClient dbClient;
@@ -82,13 +82,13 @@ public class SearchAction implements ProjectLinksWsAction {
 
   @Override
   public void handle(Request request, Response response) throws Exception {
-    SearchWsRequest searchWsRequest = toSearchWsRequest(request);
+    SearchRequest searchWsRequest = toSearchWsRequest(request);
     SearchWsResponse searchWsResponse = doHandle(searchWsRequest);
 
     writeProtobuf(searchWsResponse, request, response);
   }
 
-  private SearchWsResponse doHandle(SearchWsRequest searchWsRequest) {
+  private SearchWsResponse doHandle(SearchRequest searchWsRequest) {
     try (DbSession dbSession = dbClient.openSession(false)) {
       ComponentDto component = getComponentByUuidOrKey(dbSession, searchWsRequest);
       List<ComponentLinkDto> links = dbClient.componentLinkDao()
@@ -114,7 +114,7 @@ public class SearchAction implements ProjectLinksWsAction {
     return builder.build();
   }
 
-  private ComponentDto getComponentByUuidOrKey(DbSession dbSession, SearchWsRequest request) {
+  private ComponentDto getComponentByUuidOrKey(DbSession dbSession, SearchRequest request) {
     ComponentDto component = componentFinder.getRootComponentByUuidOrKey(
       dbSession,
       request.getProjectId(),
@@ -129,8 +129,8 @@ public class SearchAction implements ProjectLinksWsAction {
     return component;
   }
 
-  private static SearchWsRequest toSearchWsRequest(Request request) {
-    return new SearchWsRequest()
+  private static SearchRequest toSearchWsRequest(Request request) {
+    return new SearchRequest()
       .setProjectId(request.param(PARAM_PROJECT_ID))
       .setProjectKey(request.param(PARAM_PROJECT_KEY));
   }
index 5a31ccb33c6e3fe6aca595a78fb989282f5eec63..187e71c3436e4768d08201d0f853aea531697f19 100644 (file)
@@ -26,8 +26,8 @@ import org.sonar.api.utils.text.JsonWriter;
 import org.sonar.db.qualitygate.QualityGateDto;
 import org.sonar.server.qualitygate.QualityGates;
 
-import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.PARAM_ID;
-import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.PARAM_NAME;
+import static org.sonar.server.qualitygate.ws.QualityGatesWsParameters.PARAM_ID;
+import static org.sonar.server.qualitygate.ws.QualityGatesWsParameters.PARAM_NAME;
 
 public class CopyAction implements QualityGatesWsAction {
 
index e188f6540364e83b75b53619efaf060fefa6eca9..9dae665d2d44911aef5d54c57626944578754a10 100644 (file)
@@ -32,8 +32,8 @@ import org.sonar.server.user.UserSession;
 import org.sonarqube.ws.Qualitygates.CreateWsResponse;
 
 import static org.sonar.server.ws.WsUtils.writeProtobuf;
-import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.ACTION_CREATE;
-import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.PARAM_NAME;
+import static org.sonar.server.qualitygate.ws.QualityGatesWsParameters.ACTION_CREATE;
+import static org.sonar.server.qualitygate.ws.QualityGatesWsParameters.PARAM_NAME;
 
 public class CreateAction implements QualityGatesWsAction {
 
index 14361803e3fee25d1e7d2aed51b0496528a88188..d54894299c6ea6f43486bb46ad958bd191f27f3a 100644 (file)
@@ -34,13 +34,13 @@ import org.sonarqube.ws.Qualitygates.CreateConditionWsResponse;
 import static org.sonar.core.util.Protobuf.setNullable;
 import static org.sonar.server.qualitygate.ws.QualityGatesWs.addConditionParams;
 import static org.sonar.server.ws.WsUtils.writeProtobuf;
-import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.ACTION_CREATE_CONDITION;
-import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.PARAM_ERROR;
-import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.PARAM_GATE_ID;
-import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.PARAM_METRIC;
-import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.PARAM_OPERATOR;
-import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.PARAM_PERIOD;
-import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.PARAM_WARNING;
+import static org.sonar.server.qualitygate.ws.QualityGatesWsParameters.ACTION_CREATE_CONDITION;
+import static org.sonar.server.qualitygate.ws.QualityGatesWsParameters.PARAM_ERROR;
+import static org.sonar.server.qualitygate.ws.QualityGatesWsParameters.PARAM_GATE_ID;
+import static org.sonar.server.qualitygate.ws.QualityGatesWsParameters.PARAM_METRIC;
+import static org.sonar.server.qualitygate.ws.QualityGatesWsParameters.PARAM_OPERATOR;
+import static org.sonar.server.qualitygate.ws.QualityGatesWsParameters.PARAM_PERIOD;
+import static org.sonar.server.qualitygate.ws.QualityGatesWsParameters.PARAM_WARNING;
 
 public class CreateConditionAction implements QualityGatesWsAction {
 
index 06c181b9aa45976a5cbb64835fb52aa9abb4eb4e..45bc460ddb5b57623fd8c47087297b3549862a53 100644 (file)
@@ -28,7 +28,7 @@ import org.sonar.db.organization.OrganizationDto;
 import org.sonar.server.user.UserSession;
 
 import static org.sonar.db.permission.OrganizationPermission.ADMINISTER_QUALITY_GATES;
-import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.PARAM_ID;
+import static org.sonar.server.qualitygate.ws.QualityGatesWsParameters.PARAM_ID;
 
 public class DeleteConditionAction implements QualityGatesWsAction {
 
index affdf16ab103ed55835b0e4e2223db43c86616c0..771287b00613fa30ce5c4696aec705ce5bd50052 100644 (file)
@@ -33,8 +33,8 @@ import org.sonar.server.component.ComponentFinder;
 import org.sonar.server.qualitygate.QualityGates;
 
 import static org.sonar.server.ws.KeyExamples.KEY_PROJECT_EXAMPLE_001;
-import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.PARAM_PROJECT_ID;
-import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.PARAM_PROJECT_KEY;
+import static org.sonar.server.qualitygate.ws.QualityGatesWsParameters.PARAM_PROJECT_ID;
+import static org.sonar.server.qualitygate.ws.QualityGatesWsParameters.PARAM_PROJECT_KEY;
 
 public class DeselectAction implements QualityGatesWsAction {
 
index b068af02f1caad1306659e233041e8f941765003..f2aca2ffea69e6598b774f2c9c147e46fada6e11 100644 (file)
@@ -23,7 +23,6 @@ import org.sonar.api.server.ws.Request;
 import org.sonar.api.server.ws.Response;
 import org.sonar.api.server.ws.WebService;
 import org.sonar.server.qualitygate.QualityGates;
-import org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters;
 
 public class DestroyAction implements QualityGatesWsAction {
 
index 5a6af960e6b0468b6ae80e0b10cfcb7ada0c45a3..8c89d6381d3e5ae4f3c72a8f0b91e5a37d707e39 100644 (file)
@@ -38,7 +38,7 @@ import org.sonarqube.ws.Qualitygates.GetByProjectWsResponse;
 import static org.sonar.server.user.AbstractUserSession.insufficientPrivilegesException;
 import static org.sonar.server.ws.KeyExamples.KEY_PROJECT_EXAMPLE_001;
 import static org.sonar.server.ws.WsUtils.writeProtobuf;
-import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.ACTION_GET_BY_PROJECT;
+import static org.sonar.server.qualitygate.ws.QualityGatesWsParameters.ACTION_GET_BY_PROJECT;
 
 public class GetByProjectAction implements QualityGatesWsAction {
   private static final String PARAM_PROJECT = "project";
index ab79a97b456146da9895b3e2204f0afe9ccbce91..46fbf90e8d0f208c637027bc75b41aed169da8ea 100644 (file)
@@ -50,10 +50,10 @@ import static org.sonar.server.user.AbstractUserSession.insufficientPrivilegesEx
 import static org.sonar.server.ws.WsUtils.checkFoundWithOptional;
 import static org.sonar.server.ws.WsUtils.checkRequest;
 import static org.sonar.server.ws.WsUtils.writeProtobuf;
-import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.ACTION_PROJECT_STATUS;
-import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.PARAM_ANALYSIS_ID;
-import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.PARAM_PROJECT_ID;
-import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.PARAM_PROJECT_KEY;
+import static org.sonar.server.qualitygate.ws.QualityGatesWsParameters.ACTION_PROJECT_STATUS;
+import static org.sonar.server.qualitygate.ws.QualityGatesWsParameters.PARAM_ANALYSIS_ID;
+import static org.sonar.server.qualitygate.ws.QualityGatesWsParameters.PARAM_PROJECT_ID;
+import static org.sonar.server.qualitygate.ws.QualityGatesWsParameters.PARAM_PROJECT_KEY;
 
 public class ProjectStatusAction implements QualityGatesWsAction {
   private static final String QG_STATUSES_ONE_LINE = Arrays.stream(ProjectStatusWsResponse.Status.values())
index 41865e75d92929fba0d8af9eb14c11b35b94b295..df2d83fa411719ec52fec287f241e41a050cf040 100644 (file)
@@ -26,14 +26,14 @@ import org.sonar.db.qualitygate.QualityGateConditionDto;
 import org.sonar.db.qualitygate.QualityGateDto;
 import org.sonar.server.exceptions.BadRequestException;
 
-import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.CONTROLLER_QUALITY_GATES;
-import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.PARAM_ERROR;
-import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.PARAM_ID;
-import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.PARAM_METRIC;
-import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.PARAM_NAME;
-import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.PARAM_OPERATOR;
-import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.PARAM_PERIOD;
-import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.PARAM_WARNING;
+import static org.sonar.server.qualitygate.ws.QualityGatesWsParameters.CONTROLLER_QUALITY_GATES;
+import static org.sonar.server.qualitygate.ws.QualityGatesWsParameters.PARAM_ERROR;
+import static org.sonar.server.qualitygate.ws.QualityGatesWsParameters.PARAM_ID;
+import static org.sonar.server.qualitygate.ws.QualityGatesWsParameters.PARAM_METRIC;
+import static org.sonar.server.qualitygate.ws.QualityGatesWsParameters.PARAM_NAME;
+import static org.sonar.server.qualitygate.ws.QualityGatesWsParameters.PARAM_OPERATOR;
+import static org.sonar.server.qualitygate.ws.QualityGatesWsParameters.PARAM_PERIOD;
+import static org.sonar.server.qualitygate.ws.QualityGatesWsParameters.PARAM_WARNING;
 
 public class QualityGatesWs implements WebService {
 
diff --git a/server/sonar-server/src/main/java/org/sonar/server/qualitygate/ws/QualityGatesWsParameters.java b/server/sonar-server/src/main/java/org/sonar/server/qualitygate/ws/QualityGatesWsParameters.java
new file mode 100644 (file)
index 0000000..b10013f
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info 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.sonar.server.qualitygate.ws;
+
+public class QualityGatesWsParameters {
+
+  public static final String CONTROLLER_QUALITY_GATES = "api/qualitygates";
+
+  public static final String ACTION_PROJECT_STATUS = "project_status";
+  public static final String ACTION_GET_BY_PROJECT = "get_by_project";
+  public static final String ACTION_SELECT = "select";
+  public static final String ACTION_CREATE = "create";
+  public static final String ACTION_CREATE_CONDITION = "create_condition";
+  public static final String ACTION_UPDATE_CONDITION = "update_condition";
+
+  public static final String PARAM_ANALYSIS_ID = "analysisId";
+  public static final String PARAM_PROJECT_ID = "projectId";
+  public static final String PARAM_PROJECT_KEY = "projectKey";
+  public static final String PARAM_PAGE_SIZE = "pageSize";
+  public static final String PARAM_PAGE = "page";
+  public static final String PARAM_QUERY = "query";
+  public static final String PARAM_NAME = "name";
+  public static final String PARAM_ERROR = "error";
+  public static final String PARAM_WARNING = "warning";
+  public static final String PARAM_PERIOD = "period";
+  public static final String PARAM_OPERATOR = "op";
+  public static final String PARAM_METRIC = "metric";
+  public static final String PARAM_GATE_ID = "gateId";
+  public static final String PARAM_ID = "id";
+
+  private QualityGatesWsParameters() {
+    // prevent instantiation
+  }
+
+}
index 8f49fffc6a957ed740363b6a8445c9d177cc0e4d..4421c21f000bc8358c1831cace266718a1fc043a 100644 (file)
@@ -27,8 +27,8 @@ import org.sonar.db.qualitygate.QualityGateDto;
 import org.sonar.server.qualitygate.QualityGates;
 
 import static org.sonar.server.qualitygate.ws.CreateAction.NAME_MAXIMUM_LENGTH;
-import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.PARAM_ID;
-import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.PARAM_NAME;
+import static org.sonar.server.qualitygate.ws.QualityGatesWsParameters.PARAM_ID;
+import static org.sonar.server.qualitygate.ws.QualityGatesWsParameters.PARAM_NAME;
 
 public class RenameAction implements QualityGatesWsAction {
 
index a8f7407949b1e09419753f2c475113d4d7d2eb0d..285d723bec7aaaba5ac4da9394b4767363295b24 100644 (file)
@@ -28,7 +28,6 @@ import org.sonar.api.utils.text.JsonWriter;
 import org.sonar.db.qualitygate.ProjectQgateAssociation;
 import org.sonar.db.qualitygate.ProjectQgateAssociationQuery;
 import org.sonar.server.qualitygate.QgateProjectFinder;
-import org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters;
 
 public class SearchAction implements QualityGatesWsAction {
 
index c3e33f58fccc8c1c21498c46e42b9d95bef2a509..1002fd8d0831be024aa1f965521d40236b4a78f5 100644 (file)
@@ -39,10 +39,10 @@ import static org.sonar.server.qualitygate.QualityGates.SONAR_QUALITYGATE_PROPER
 import static org.sonar.server.user.AbstractUserSession.insufficientPrivilegesException;
 import static org.sonar.server.ws.KeyExamples.KEY_PROJECT_EXAMPLE_001;
 import static org.sonar.server.ws.WsUtils.checkFound;
-import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.ACTION_SELECT;
-import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.PARAM_GATE_ID;
-import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.PARAM_PROJECT_ID;
-import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.PARAM_PROJECT_KEY;
+import static org.sonar.server.qualitygate.ws.QualityGatesWsParameters.ACTION_SELECT;
+import static org.sonar.server.qualitygate.ws.QualityGatesWsParameters.PARAM_GATE_ID;
+import static org.sonar.server.qualitygate.ws.QualityGatesWsParameters.PARAM_PROJECT_ID;
+import static org.sonar.server.qualitygate.ws.QualityGatesWsParameters.PARAM_PROJECT_KEY;
 
 public class SelectAction implements QualityGatesWsAction {
   private final DbClient dbClient;
index f9841353ec9bf6a53ca59cddb2f0efad44840653..823d7ced164fb58faaa15e8460bb7f04e200ccfd 100644 (file)
@@ -23,7 +23,6 @@ import org.sonar.api.server.ws.Request;
 import org.sonar.api.server.ws.Response;
 import org.sonar.api.server.ws.WebService;
 import org.sonar.server.qualitygate.QualityGates;
-import org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters;
 
 public class SetAsDefaultAction implements QualityGatesWsAction {
 
index 185941ae266cb3687fcde170935def6e6b31e39d..8bc6bde9463597dd3c05ab68faa196beb83278b3 100644 (file)
@@ -31,8 +31,8 @@ import org.sonar.db.qualitygate.QualityGateDto;
 import org.sonar.server.qualitygate.QualityGates;
 
 import static org.sonar.server.ws.WsUtils.checkRequest;
-import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.PARAM_ID;
-import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.PARAM_NAME;
+import static org.sonar.server.qualitygate.ws.QualityGatesWsParameters.PARAM_ID;
+import static org.sonar.server.qualitygate.ws.QualityGatesWsParameters.PARAM_NAME;
 
 public class ShowAction implements QualityGatesWsAction {
 
index 9daf27fb6779b5fad494710251a3a298512be8d3..555004feb492e739c3921afbc216fbb3e51467fe 100644 (file)
@@ -23,7 +23,6 @@ import org.sonar.api.server.ws.Request;
 import org.sonar.api.server.ws.Response;
 import org.sonar.api.server.ws.WebService;
 import org.sonar.server.qualitygate.QualityGates;
-import org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters;
 
 public class UnsetDefaultAction implements QualityGatesWsAction {
 
index 8284bf3d9c43117ca471e037562a976995bc9118..dff97b49f944b8fb8a76143269ae025bb4ba2256 100644 (file)
@@ -34,13 +34,13 @@ import static org.sonar.core.util.Protobuf.setNullable;
 import static org.sonar.db.permission.OrganizationPermission.ADMINISTER_QUALITY_GATES;
 import static org.sonar.server.qualitygate.ws.QualityGatesWs.addConditionParams;
 import static org.sonar.server.ws.WsUtils.writeProtobuf;
-import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.ACTION_UPDATE_CONDITION;
-import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.PARAM_ERROR;
-import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.PARAM_ID;
-import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.PARAM_METRIC;
-import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.PARAM_OPERATOR;
-import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.PARAM_PERIOD;
-import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.PARAM_WARNING;
+import static org.sonar.server.qualitygate.ws.QualityGatesWsParameters.ACTION_UPDATE_CONDITION;
+import static org.sonar.server.qualitygate.ws.QualityGatesWsParameters.PARAM_ERROR;
+import static org.sonar.server.qualitygate.ws.QualityGatesWsParameters.PARAM_ID;
+import static org.sonar.server.qualitygate.ws.QualityGatesWsParameters.PARAM_METRIC;
+import static org.sonar.server.qualitygate.ws.QualityGatesWsParameters.PARAM_OPERATOR;
+import static org.sonar.server.qualitygate.ws.QualityGatesWsParameters.PARAM_PERIOD;
+import static org.sonar.server.qualitygate.ws.QualityGatesWsParameters.PARAM_WARNING;
 
 public class UpdateConditionAction implements QualityGatesWsAction {
 
index cacf3c779946241eddee579c3603c88bbd808aa1..02973e250cb57e2e2541940402d090f6757a1d5f 100644 (file)
@@ -33,15 +33,15 @@ import org.sonar.server.user.UserSession;
 import org.sonar.server.usertoken.TokenGenerator;
 import org.sonarqube.ws.UserTokens;
 import org.sonarqube.ws.UserTokens.GenerateWsResponse;
-import org.sonarqube.ws.client.usertoken.GenerateWsRequest;
+import org.sonarqube.ws.client.usertokens.GenerateRequest;
 
 import static java.net.HttpURLConnection.HTTP_INTERNAL_ERROR;
 import static org.sonar.server.user.AbstractUserSession.insufficientPrivilegesException;
 import static org.sonar.server.ws.WsUtils.checkRequest;
 import static org.sonar.server.ws.WsUtils.writeProtobuf;
-import static org.sonarqube.ws.client.usertoken.UserTokensWsParameters.ACTION_GENERATE;
-import static org.sonarqube.ws.client.usertoken.UserTokensWsParameters.PARAM_LOGIN;
-import static org.sonarqube.ws.client.usertoken.UserTokensWsParameters.PARAM_NAME;
+import static org.sonar.server.usertoken.ws.UserTokensWsParameters.ACTION_GENERATE;
+import static org.sonar.server.usertoken.ws.UserTokensWsParameters.PARAM_LOGIN;
+import static org.sonar.server.usertoken.ws.UserTokensWsParameters.PARAM_NAME;
 
 public class GenerateAction implements UserTokensWsAction {
   private static final int MAX_TOKEN_NAME_LENGTH = 100;
@@ -85,7 +85,7 @@ public class GenerateAction implements UserTokensWsAction {
     writeProtobuf(generateWsResponse, request, response);
   }
 
-  private UserTokens.GenerateWsResponse doHandle(GenerateWsRequest request) {
+  private UserTokens.GenerateWsResponse doHandle(GenerateRequest request) {
     try (DbSession dbSession = dbClient.openSession(false)) {
       checkWsRequest(dbSession, request);
       TokenPermissionsValidator.validate(userSession, request.getLogin());
@@ -109,21 +109,21 @@ public class GenerateAction implements UserTokensWsAction {
     return tokenHash;
   }
 
-  private void checkWsRequest(DbSession dbSession, GenerateWsRequest request) {
+  private void checkWsRequest(DbSession dbSession, GenerateRequest request) {
     checkLoginExists(dbSession, request);
 
     Optional<UserTokenDto> userTokenDto = dbClient.userTokenDao().selectByLoginAndName(dbSession, request.getLogin(), request.getName());
     checkRequest(!userTokenDto.isPresent(), "A user token with login '%s' and name '%s' already exists", request.getLogin(), request.getName());
   }
 
-  private void checkLoginExists(DbSession dbSession, GenerateWsRequest request) {
+  private void checkLoginExists(DbSession dbSession, GenerateRequest request) {
     UserDto user = dbClient.userDao().selectByLogin(dbSession, request.getLogin());
     if (user == null) {
       throw insufficientPrivilegesException();
     }
   }
 
-  private UserTokenDto insertTokenInDb(DbSession dbSession, GenerateWsRequest request, String tokenHash) {
+  private UserTokenDto insertTokenInDb(DbSession dbSession, GenerateRequest request, String tokenHash) {
     UserTokenDto userTokenDto = new UserTokenDto()
       .setLogin(request.getLogin())
       .setName(request.getName())
@@ -135,8 +135,8 @@ public class GenerateAction implements UserTokensWsAction {
     return userTokenDto;
   }
 
-  private GenerateWsRequest toCreateWsRequest(Request request) {
-    GenerateWsRequest generateWsRequest = new GenerateWsRequest()
+  private GenerateRequest toCreateWsRequest(Request request) {
+    GenerateRequest generateWsRequest = new GenerateRequest()
       .setLogin(request.param(PARAM_LOGIN))
       .setName(request.mandatoryParam(PARAM_NAME).trim());
     if (generateWsRequest.getLogin() == null) {
index 548470186886ab968ecbf6621cdb09f95e1bbc17..fe828f6b41146a37b3a7ba40d65b08ef2eee9b8c 100644 (file)
@@ -25,11 +25,11 @@ import org.sonar.api.server.ws.WebService;
 import org.sonar.db.DbClient;
 import org.sonar.db.DbSession;
 import org.sonar.server.user.UserSession;
-import org.sonarqube.ws.client.usertoken.RevokeWsRequest;
+import org.sonarqube.ws.client.usertokens.RevokeRequest;
 
-import static org.sonarqube.ws.client.usertoken.UserTokensWsParameters.ACTION_REVOKE;
-import static org.sonarqube.ws.client.usertoken.UserTokensWsParameters.PARAM_LOGIN;
-import static org.sonarqube.ws.client.usertoken.UserTokensWsParameters.PARAM_NAME;
+import static org.sonar.server.usertoken.ws.UserTokensWsParameters.ACTION_REVOKE;
+import static org.sonar.server.usertoken.ws.UserTokensWsParameters.PARAM_LOGIN;
+import static org.sonar.server.usertoken.ws.UserTokensWsParameters.PARAM_NAME;
 
 public class RevokeAction implements UserTokensWsAction {
   private final DbClient dbClient;
@@ -61,11 +61,11 @@ public class RevokeAction implements UserTokensWsAction {
 
   @Override
   public void handle(Request request, Response response) throws Exception {
-    doHandle(toRevokeWsRequest(request));
+    doHandle(toRevokeRequest(request));
     response.noContent();
   }
 
-  private void doHandle(RevokeWsRequest request) {
+  private void doHandle(RevokeRequest request) {
     TokenPermissionsValidator.validate(userSession, request.getLogin());
 
     try (DbSession dbSession = dbClient.openSession(false)) {
@@ -74,13 +74,13 @@ public class RevokeAction implements UserTokensWsAction {
     }
   }
 
-  private RevokeWsRequest toRevokeWsRequest(Request request) {
-    RevokeWsRequest revokeWsRequest = new RevokeWsRequest()
+  private RevokeRequest toRevokeRequest(Request request) {
+    RevokeRequest RevokeRequest = new RevokeRequest()
       .setLogin(request.param(PARAM_LOGIN))
       .setName(request.mandatoryParam(PARAM_NAME));
-    if (revokeWsRequest.getLogin() == null) {
-      revokeWsRequest.setLogin(userSession.getLogin());
+    if (RevokeRequest.getLogin() == null) {
+      RevokeRequest.setLogin(userSession.getLogin());
     }
-    return revokeWsRequest;
+    return RevokeRequest;
   }
 }
index cadf64b42bb0ed3196615eade0980a28e0f0a146..e946788bfaeb4ae2f1c63af8c4b8518b5976c5b6 100644 (file)
@@ -29,13 +29,13 @@ import org.sonar.db.DbSession;
 import org.sonar.db.user.UserTokenDto;
 import org.sonar.server.user.UserSession;
 import org.sonarqube.ws.UserTokens.SearchWsResponse;
-import org.sonarqube.ws.client.usertoken.SearchWsRequest;
+import org.sonarqube.ws.client.usertokens.SearchRequest;
 
 import static org.sonar.api.utils.DateUtils.formatDateTime;
 import static org.sonar.server.ws.WsUtils.checkFound;
 import static org.sonar.server.ws.WsUtils.writeProtobuf;
-import static org.sonarqube.ws.client.usertoken.UserTokensWsParameters.ACTION_SEARCH;
-import static org.sonarqube.ws.client.usertoken.UserTokensWsParameters.PARAM_LOGIN;
+import static org.sonar.server.usertoken.ws.UserTokensWsParameters.ACTION_SEARCH;
+import static org.sonar.server.usertoken.ws.UserTokensWsParameters.PARAM_LOGIN;
 
 public class SearchAction implements UserTokensWsAction {
   private final DbClient dbClient;
@@ -63,11 +63,11 @@ public class SearchAction implements UserTokensWsAction {
 
   @Override
   public void handle(Request request, Response response) throws Exception {
-    SearchWsResponse searchWsResponse = doHandle(toSearchWsRequest(request));
+    SearchWsResponse searchWsResponse = doHandle(toSearchRequest(request));
     writeProtobuf(searchWsResponse, request, response);
   }
 
-  private SearchWsResponse doHandle(SearchWsRequest request) {
+  private SearchWsResponse doHandle(SearchRequest request) {
     TokenPermissionsValidator.validate(userSession, request.getLogin());
 
     try (DbSession dbSession = dbClient.openSession(false)) {
@@ -78,12 +78,12 @@ public class SearchAction implements UserTokensWsAction {
     }
   }
 
-  private SearchWsRequest toSearchWsRequest(Request request) {
-    SearchWsRequest searchWsRequest = new SearchWsRequest().setLogin(request.param(PARAM_LOGIN));
-    if (searchWsRequest.getLogin() == null) {
-      searchWsRequest.setLogin(userSession.getLogin());
+  private SearchRequest toSearchRequest(Request request) {
+    SearchRequest SearchRequest = new SearchRequest().setLogin(request.param(PARAM_LOGIN));
+    if (SearchRequest.getLogin() == null) {
+      SearchRequest.setLogin(userSession.getLogin());
     }
-    return searchWsRequest;
+    return SearchRequest;
   }
 
   private static SearchWsResponse buildResponse(String login, List<UserTokenDto> userTokensDto) {
index 7710e8858224fd1828609e6f39601f4b3c537695..760d3500392deef004b50e740e0adf203484699f 100644 (file)
@@ -21,7 +21,7 @@ package org.sonar.server.usertoken.ws;
 
 import org.sonar.api.server.ws.WebService;
 
-import static org.sonarqube.ws.client.usertoken.UserTokensWsParameters.CONTROLLER;
+import static org.sonar.server.usertoken.ws.UserTokensWsParameters.CONTROLLER;
 
 public class UserTokensWs implements WebService {
   private final UserTokensWsAction[] actions;
diff --git a/server/sonar-server/src/main/java/org/sonar/server/usertoken/ws/UserTokensWsParameters.java b/server/sonar-server/src/main/java/org/sonar/server/usertoken/ws/UserTokensWsParameters.java
new file mode 100644 (file)
index 0000000..bad14a0
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info 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.sonar.server.usertoken.ws;
+
+public class UserTokensWsParameters {
+  public static final String CONTROLLER = "api/user_tokens";
+  public static final String ACTION_GENERATE = "generate";
+  public static final String ACTION_REVOKE = "revoke";
+  public static final String ACTION_SEARCH = "search";
+
+  public static final String PARAM_LOGIN = "login";
+  public static final String PARAM_NAME = "name";
+
+  private UserTokensWsParameters() {
+    // constants only
+  }
+}
index d21308296a835b1bb45165fa318e832c6b067d06..11f0cc414a4ad6cd7dda0b5208fea4f4a59e3b18 100644 (file)
@@ -53,7 +53,6 @@ import org.sonar.test.JsonAssert;
 import org.sonarqube.ws.Ce;
 import org.sonarqube.ws.Common;
 import org.sonarqube.ws.MediaTypes;
-import org.sonarqube.ws.Ce;
 import org.sonarqube.ws.Ce.ActivityResponse;
 import org.sonarqube.ws.Ce.Task;
 
@@ -70,12 +69,12 @@ import static org.sonar.db.ce.CeQueueDto.Status.PENDING;
 import static org.sonar.db.ce.CeTaskCharacteristicDto.BRANCH_KEY;
 import static org.sonar.db.ce.CeTaskCharacteristicDto.BRANCH_TYPE_KEY;
 import static org.sonar.db.component.BranchType.LONG;
-import static org.sonarqube.ws.client.ce.CeWsParameters.PARAM_COMPONENT_ID;
-import static org.sonarqube.ws.client.ce.CeWsParameters.PARAM_COMPONENT_QUERY;
-import static org.sonarqube.ws.client.ce.CeWsParameters.PARAM_MAX_EXECUTED_AT;
-import static org.sonarqube.ws.client.ce.CeWsParameters.PARAM_MIN_SUBMITTED_AT;
-import static org.sonarqube.ws.client.ce.CeWsParameters.PARAM_STATUS;
-import static org.sonarqube.ws.client.ce.CeWsParameters.PARAM_TYPE;
+import static org.sonar.server.ce.ws.CeWsParameters.PARAM_COMPONENT_ID;
+import static org.sonar.server.ce.ws.CeWsParameters.PARAM_COMPONENT_QUERY;
+import static org.sonar.server.ce.ws.CeWsParameters.PARAM_MAX_EXECUTED_AT;
+import static org.sonar.server.ce.ws.CeWsParameters.PARAM_MIN_SUBMITTED_AT;
+import static org.sonar.server.ce.ws.CeWsParameters.PARAM_STATUS;
+import static org.sonar.server.ce.ws.CeWsParameters.PARAM_TYPE;
 
 public class ActivityActionTest {
 
index ca9f836a290d4064909a1fa237d80ecc9885554d..11bcaaa09f2460c03017c043f6feb3afad714097 100644 (file)
@@ -41,14 +41,13 @@ import org.sonar.server.tester.UserSessionRule;
 import org.sonar.server.ws.TestRequest;
 import org.sonar.server.ws.WsActionTester;
 import org.sonarqube.ws.Ce;
-import org.sonarqube.ws.Ce;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.sonar.db.ce.CeQueueTesting.newCeQueueDto;
 import static org.sonar.db.component.ComponentTesting.newPrivateProjectDto;
 import static org.sonar.test.JsonAssert.assertJson;
-import static org.sonarqube.ws.client.ce.CeWsParameters.DEPRECATED_PARAM_COMPONENT_KEY;
-import static org.sonarqube.ws.client.ce.CeWsParameters.PARAM_COMPONENT_ID;
+import static org.sonar.server.ce.ws.CeWsParameters.DEPRECATED_PARAM_COMPONENT_KEY;
+import static org.sonar.server.ce.ws.CeWsParameters.PARAM_COMPONENT_ID;
 
 public class ActivityStatusActionTest {
 
index c270a9058b7c0c3b2b8d622c99630cf18c3b09f7..14f555993f265c950dd4206b770f95e31eade5b8 100644 (file)
@@ -53,8 +53,8 @@ import static org.sonar.db.ce.CeTaskCharacteristicDto.BRANCH_KEY;
 import static org.sonar.db.ce.CeTaskCharacteristicDto.BRANCH_TYPE_KEY;
 import static org.sonar.db.component.BranchType.LONG;
 import static org.sonar.db.component.BranchType.SHORT;
-import static org.sonarqube.ws.client.ce.CeWsParameters.PARAM_COMPONENT;
-import static org.sonarqube.ws.client.ce.CeWsParameters.PARAM_COMPONENT_ID;
+import static org.sonar.server.ce.ws.CeWsParameters.PARAM_COMPONENT;
+import static org.sonar.server.ce.ws.CeWsParameters.PARAM_COMPONENT_ID;
 
 public class ComponentActionTest {
 
index b4aad0ceba1daec68ec6c6fc9d23f8c63e6e3903..1206e212e536462750979d1b3c062bdefce6ab63 100644 (file)
@@ -49,7 +49,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 import static org.sonar.core.util.Protobuf.setNullable;
 import static org.sonar.db.component.ComponentTesting.newFileDto;
 import static org.sonar.db.component.ComponentTesting.newPrivateProjectDto;
-import static org.sonarqube.ws.client.favorite.FavoritesWsParameters.PARAM_COMPONENT;
+import static org.sonar.server.favorite.ws.FavoritesWsParameters.PARAM_COMPONENT;
 
 public class AddActionTest {
   private static final String PROJECT_KEY = "project-key";
index 63fcc8e05c25c95b4ac826538a665fa45a0565ea..a362110143a8c1108c5d48c40fbcbc6f41d9b40a 100644 (file)
@@ -45,7 +45,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 import static org.sonar.core.util.Protobuf.setNullable;
 import static org.sonar.db.component.ComponentTesting.newFileDto;
 import static org.sonar.db.component.ComponentTesting.newPrivateProjectDto;
-import static org.sonarqube.ws.client.favorite.FavoritesWsParameters.PARAM_COMPONENT;
+import static org.sonar.server.favorite.ws.FavoritesWsParameters.PARAM_COMPONENT;
 
 public class RemoveActionTest {
   private static final String PROJECT_KEY = "project-key";
index 3f024bd13eefc66c3e466a864e6c4abf277ce1da..95558a89bcb15b75160bb2ebd52495747f6d635c 100644 (file)
@@ -42,7 +42,7 @@ import org.sonar.server.tester.UserSessionRule;
 import org.sonar.server.ws.TestRequest;
 import org.sonar.server.ws.TestResponse;
 import org.sonar.server.ws.WsActionTester;
-import org.sonarqube.ws.client.notification.AddRequest;
+import org.sonarqube.ws.client.notifications.AddRequest;
 
 import static java.lang.String.format;
 import static java.net.HttpURLConnection.HTTP_NO_CONTENT;
@@ -51,10 +51,10 @@ import static org.sonar.core.util.Protobuf.setNullable;
 import static org.sonar.db.component.ComponentTesting.newView;
 import static org.sonar.server.notification.NotificationDispatcherMetadata.GLOBAL_NOTIFICATION;
 import static org.sonar.server.notification.NotificationDispatcherMetadata.PER_PROJECT_NOTIFICATION;
-import static org.sonarqube.ws.client.notification.NotificationsWsParameters.PARAM_CHANNEL;
-import static org.sonarqube.ws.client.notification.NotificationsWsParameters.PARAM_LOGIN;
-import static org.sonarqube.ws.client.notification.NotificationsWsParameters.PARAM_PROJECT;
-import static org.sonarqube.ws.client.notification.NotificationsWsParameters.PARAM_TYPE;
+import static org.sonar.server.notification.ws.NotificationsWsParameters.PARAM_CHANNEL;
+import static org.sonar.server.notification.ws.NotificationsWsParameters.PARAM_LOGIN;
+import static org.sonar.server.notification.ws.NotificationsWsParameters.PARAM_PROJECT;
+import static org.sonar.server.notification.ws.NotificationsWsParameters.PARAM_TYPE;
 
 public class AddActionTest {
   private static final String NOTIF_MY_NEW_ISSUES = "Dispatcher1";
@@ -82,8 +82,7 @@ public class AddActionTest {
   private AddAction underTest;
   private WsActionTester ws;
 
-  private AddRequest.Builder request = AddRequest.builder()
-    .setType(NOTIF_MY_NEW_ISSUES);
+  private AddRequest request = new AddRequest().setType(NOTIF_MY_NEW_ISSUES);
 
   @Before
   public void setUp() {
@@ -313,13 +312,12 @@ public class AddActionTest {
       .setLogin(userSession.getLogin()));
   }
 
-  private TestResponse call(AddRequest.Builder wsRequestBuilder) {
-    AddRequest wsRequest = wsRequestBuilder.build();
+  private TestResponse call(AddRequest add) {
     TestRequest request = ws.newRequest();
-    request.setParam(PARAM_TYPE, wsRequest.getType());
-    setNullable(wsRequest.getChannel(), channel -> request.setParam(PARAM_CHANNEL, channel));
-    setNullable(wsRequest.getProject(), project -> request.setParam(PARAM_PROJECT, project));
-    setNullable(wsRequest.getLogin(), login -> request.setParam(PARAM_LOGIN, login));
+    request.setParam(PARAM_TYPE, add.getType());
+    setNullable(add.getChannel(), channel -> request.setParam(PARAM_CHANNEL, channel));
+    setNullable(add.getProject(), project -> request.setParam(PARAM_PROJECT, project));
+    setNullable(add.getLogin(), login -> request.setParam(PARAM_LOGIN, login));
     return request.execute();
   }
 
index f8a25ade4ee9950041383de3dd5f1dbead971cfb..2b9750759802fba04cb2ef055b9d3cd2510951a9 100644 (file)
@@ -42,7 +42,7 @@ import org.sonar.server.tester.UserSessionRule;
 import org.sonar.server.ws.TestRequest;
 import org.sonar.server.ws.TestResponse;
 import org.sonar.server.ws.WsActionTester;
-import org.sonarqube.ws.client.notification.RemoveRequest;
+import org.sonarqube.ws.client.notifications.RemoveRequest;
 
 import static java.lang.String.format;
 import static java.net.HttpURLConnection.HTTP_NO_CONTENT;
@@ -51,10 +51,10 @@ import static org.sonar.core.util.Protobuf.setNullable;
 import static org.sonar.db.component.ComponentTesting.newView;
 import static org.sonar.server.notification.NotificationDispatcherMetadata.GLOBAL_NOTIFICATION;
 import static org.sonar.server.notification.NotificationDispatcherMetadata.PER_PROJECT_NOTIFICATION;
-import static org.sonarqube.ws.client.notification.NotificationsWsParameters.PARAM_CHANNEL;
-import static org.sonarqube.ws.client.notification.NotificationsWsParameters.PARAM_LOGIN;
-import static org.sonarqube.ws.client.notification.NotificationsWsParameters.PARAM_PROJECT;
-import static org.sonarqube.ws.client.notification.NotificationsWsParameters.PARAM_TYPE;
+import static org.sonar.server.notification.ws.NotificationsWsParameters.PARAM_CHANNEL;
+import static org.sonar.server.notification.ws.NotificationsWsParameters.PARAM_LOGIN;
+import static org.sonar.server.notification.ws.NotificationsWsParameters.PARAM_PROJECT;
+import static org.sonar.server.notification.ws.NotificationsWsParameters.PARAM_TYPE;
 
 public class RemoveActionTest {
   private static final String NOTIF_MY_NEW_ISSUES = "Dispatcher1";
@@ -79,7 +79,7 @@ public class RemoveActionTest {
   private RemoveAction underTest;
 
   private WsActionTester ws;
-  private RemoveRequest.Builder request = RemoveRequest.builder().setType(NOTIF_MY_NEW_ISSUES);
+  private RemoveRequest request = new RemoveRequest().setType(NOTIF_MY_NEW_ISSUES);
 
   private UserDto user;
 
@@ -280,14 +280,12 @@ public class RemoveActionTest {
     call(request.setProject(branch.getDbKey()));
   }
 
-  private TestResponse call(RemoveRequest.Builder wsRequestBuilder) {
-    RemoveRequest wsRequest = wsRequestBuilder.build();
-
+  private TestResponse call(RemoveRequest remove) {
     TestRequest request = ws.newRequest();
-    request.setParam(PARAM_TYPE, wsRequest.getType());
-    setNullable(wsRequest.getChannel(), channel -> request.setParam(PARAM_CHANNEL, channel));
-    setNullable(wsRequest.getProject(), project -> request.setParam(PARAM_PROJECT, project));
-    setNullable(wsRequest.getLogin(), login -> request.setParam(PARAM_LOGIN, login));
+    request.setParam(PARAM_TYPE, remove.getType());
+    setNullable(remove.getChannel(), channel -> request.setParam(PARAM_CHANNEL, channel));
+    setNullable(remove.getProject(), project -> request.setParam(PARAM_PROJECT, project));
+    setNullable(remove.getLogin(), login -> request.setParam(PARAM_LOGIN, login));
     return request.execute();
   }
 
index f1ab8b32bb371ee267e76e75eb6414f2d6053f35..90d82f85f90b49cf73bfc7da8865cc357018d688 100644 (file)
@@ -50,10 +50,10 @@ import static org.assertj.core.api.Assertions.assertThat;
 import static org.sonar.core.util.Uuids.UUID_EXAMPLE_01;
 import static org.sonar.server.ws.KeyExamples.KEY_PROJECT_EXAMPLE_001;
 import static org.sonar.test.JsonAssert.assertJson;
-import static org.sonarqube.ws.client.projectlinks.ProjectLinksWsParameters.PARAM_NAME;
-import static org.sonarqube.ws.client.projectlinks.ProjectLinksWsParameters.PARAM_PROJECT_ID;
-import static org.sonarqube.ws.client.projectlinks.ProjectLinksWsParameters.PARAM_PROJECT_KEY;
-import static org.sonarqube.ws.client.projectlinks.ProjectLinksWsParameters.PARAM_URL;
+import static org.sonar.server.projectlink.ws.ProjectLinksWsParameters.PARAM_NAME;
+import static org.sonar.server.projectlink.ws.ProjectLinksWsParameters.PARAM_PROJECT_ID;
+import static org.sonar.server.projectlink.ws.ProjectLinksWsParameters.PARAM_PROJECT_KEY;
+import static org.sonar.server.projectlink.ws.ProjectLinksWsParameters.PARAM_URL;
 
 public class CreateActionTest {
 
index 81bcd42594d263431af4b30ca27e7055c2eb9677..5c46ed5daf34f9b84e28002dae1162121a6fa05b 100644 (file)
@@ -41,7 +41,7 @@ import org.sonar.server.ws.WsActionTester;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.sonar.core.util.Uuids.UUID_EXAMPLE_01;
 import static org.sonar.server.ws.KeyExamples.KEY_PROJECT_EXAMPLE_001;
-import static org.sonarqube.ws.client.projectlinks.ProjectLinksWsParameters.PARAM_ID;
+import static org.sonar.server.projectlink.ws.ProjectLinksWsParameters.PARAM_ID;
 
 public class DeleteActionTest {
 
index 7e421fc2451eb85c085dc4f85274c9f245846ba4..29cfea1e93f1698abb900cd9dea4c92044867587 100644 (file)
@@ -53,8 +53,8 @@ import static org.sonar.core.util.Uuids.UUID_EXAMPLE_01;
 import static org.sonar.db.component.ComponentTesting.newPrivateProjectDto;
 import static org.sonar.server.ws.KeyExamples.KEY_PROJECT_EXAMPLE_001;
 import static org.sonar.test.JsonAssert.assertJson;
-import static org.sonarqube.ws.client.projectlinks.ProjectLinksWsParameters.PARAM_PROJECT_ID;
-import static org.sonarqube.ws.client.projectlinks.ProjectLinksWsParameters.PARAM_PROJECT_KEY;
+import static org.sonar.server.projectlink.ws.ProjectLinksWsParameters.PARAM_PROJECT_ID;
+import static org.sonar.server.projectlink.ws.ProjectLinksWsParameters.PARAM_PROJECT_KEY;
 
 public class SearchActionTest {
 
index 01c7f67834b45f68e7e55fb5ed00410bd58a0d58..995bad40b56419f41d14c81261c4e3e78e074139 100644 (file)
@@ -48,12 +48,12 @@ import static org.assertj.core.api.Assertions.assertThat;
 import static org.sonar.db.metric.MetricTesting.newMetricDto;
 import static org.sonar.db.permission.OrganizationPermission.ADMINISTER_QUALITY_GATES;
 import static org.sonar.server.computation.task.projectanalysis.metric.Metric.MetricType.PERCENT;
-import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.PARAM_ERROR;
-import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.PARAM_GATE_ID;
-import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.PARAM_METRIC;
-import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.PARAM_OPERATOR;
-import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.PARAM_PERIOD;
-import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.PARAM_WARNING;
+import static org.sonar.server.qualitygate.ws.QualityGatesWsParameters.PARAM_ERROR;
+import static org.sonar.server.qualitygate.ws.QualityGatesWsParameters.PARAM_GATE_ID;
+import static org.sonar.server.qualitygate.ws.QualityGatesWsParameters.PARAM_METRIC;
+import static org.sonar.server.qualitygate.ws.QualityGatesWsParameters.PARAM_OPERATOR;
+import static org.sonar.server.qualitygate.ws.QualityGatesWsParameters.PARAM_PERIOD;
+import static org.sonar.server.qualitygate.ws.QualityGatesWsParameters.PARAM_WARNING;
 
 public class CreateConditionActionTest {
 
index 1dd44cefb0434c8319b16bac5468a65e30f66338..1e242273a33992649a479edfa7a5d93369bd8f08 100644 (file)
@@ -41,7 +41,7 @@ import static java.net.HttpURLConnection.HTTP_NO_CONTENT;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.sonar.db.permission.OrganizationPermission.ADMINISTER;
 import static org.sonar.db.permission.OrganizationPermission.ADMINISTER_QUALITY_GATES;
-import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.PARAM_ID;
+import static org.sonar.server.qualitygate.ws.QualityGatesWsParameters.PARAM_ID;
 
 public class DeleteConditionActionTest {
 
index c457670ae72275e3c48ddf54cd88cbaa2a588ea6..7e0115e803d5876515d12a997f3ab161983e0cfc 100644 (file)
@@ -54,9 +54,9 @@ import static org.sonar.db.component.SnapshotTesting.newAnalysis;
 import static org.sonar.db.measure.MeasureTesting.newMeasureDto;
 import static org.sonar.db.metric.MetricTesting.newMetricDto;
 import static org.sonar.test.JsonAssert.assertJson;
-import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.PARAM_ANALYSIS_ID;
-import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.PARAM_PROJECT_ID;
-import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.PARAM_PROJECT_KEY;
+import static org.sonar.server.qualitygate.ws.QualityGatesWsParameters.PARAM_ANALYSIS_ID;
+import static org.sonar.server.qualitygate.ws.QualityGatesWsParameters.PARAM_PROJECT_ID;
+import static org.sonar.server.qualitygate.ws.QualityGatesWsParameters.PARAM_PROJECT_KEY;
 
 public class ProjectStatusActionTest {
   private static final String ANALYSIS_ID = "task-uuid";
index 194ae1b1bc79df10a386a48c0a7a6e13ef4bed15..560a7de15291c5077d9137374dc220cdd86cc7dd 100644 (file)
@@ -48,12 +48,12 @@ import static org.assertj.core.api.Assertions.assertThat;
 import static org.sonar.db.metric.MetricTesting.newMetricDto;
 import static org.sonar.db.permission.OrganizationPermission.ADMINISTER_QUALITY_GATES;
 import static org.sonar.server.computation.task.projectanalysis.metric.Metric.MetricType.PERCENT;
-import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.PARAM_ERROR;
-import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.PARAM_ID;
-import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.PARAM_METRIC;
-import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.PARAM_OPERATOR;
-import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.PARAM_PERIOD;
-import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.PARAM_WARNING;
+import static org.sonar.server.qualitygate.ws.QualityGatesWsParameters.PARAM_ERROR;
+import static org.sonar.server.qualitygate.ws.QualityGatesWsParameters.PARAM_ID;
+import static org.sonar.server.qualitygate.ws.QualityGatesWsParameters.PARAM_METRIC;
+import static org.sonar.server.qualitygate.ws.QualityGatesWsParameters.PARAM_OPERATOR;
+import static org.sonar.server.qualitygate.ws.QualityGatesWsParameters.PARAM_PERIOD;
+import static org.sonar.server.qualitygate.ws.QualityGatesWsParameters.PARAM_WARNING;
 
 public class UpdateConditionActionTest {
 
index 2fae76356d22fb9905a84c4b1facc88645fa2ec5..8227c7d119b471e248a5f8b54896864dcbdd8b04 100644 (file)
@@ -44,8 +44,8 @@ import static org.mockito.Mockito.when;
 import static org.sonar.db.user.UserTesting.newUserDto;
 import static org.sonar.db.user.UserTokenTesting.newUserToken;
 import static org.sonar.test.JsonAssert.assertJson;
-import static org.sonarqube.ws.client.usertoken.UserTokensWsParameters.PARAM_LOGIN;
-import static org.sonarqube.ws.client.usertoken.UserTokensWsParameters.PARAM_NAME;
+import static org.sonar.server.usertoken.ws.UserTokensWsParameters.PARAM_LOGIN;
+import static org.sonar.server.usertoken.ws.UserTokensWsParameters.PARAM_NAME;
 
 public class GenerateActionTest {
   private static final String GRACE_HOPPER = "grace.hopper";
index 7ef7baf7921768a7b5b9479dcb5fd82e9c68b4c5..597ef95c3d0928506029a7977a051758c85dec79 100644 (file)
@@ -37,8 +37,8 @@ import org.sonar.server.ws.WsActionTester;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.sonar.db.user.UserTokenTesting.newUserToken;
-import static org.sonarqube.ws.client.usertoken.UserTokensWsParameters.PARAM_LOGIN;
-import static org.sonarqube.ws.client.usertoken.UserTokensWsParameters.PARAM_NAME;
+import static org.sonar.server.usertoken.ws.UserTokensWsParameters.PARAM_LOGIN;
+import static org.sonar.server.usertoken.ws.UserTokensWsParameters.PARAM_NAME;
 
 
 public class RevokeActionTest {
index eb0f1539d35c37c01162538da436e8ff515937c6..f97c912811f2ce5a3fea2c7770bc05f59d95b718 100644 (file)
@@ -40,7 +40,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 import static org.sonar.db.user.UserTesting.newUserDto;
 import static org.sonar.db.user.UserTokenTesting.newUserToken;
 import static org.sonar.test.JsonAssert.assertJson;
-import static org.sonarqube.ws.client.usertoken.UserTokensWsParameters.PARAM_LOGIN;
+import static org.sonar.server.usertoken.ws.UserTokensWsParameters.PARAM_LOGIN;
 
 public class SearchActionTest {
   private static final String GRACE_HOPPER = "grace.hopper";
index 473ec80ad45fad299191c3ef82a8826c0d904ef4..61f41989b8ff7eab05841f1c51041c791646a52c 100644 (file)
@@ -21,25 +21,26 @@ package org.sonarqube.ws.client;
 
 import org.sonarqube.ws.client.ce.CeService;
 import org.sonarqube.ws.client.component.ComponentsService;
-import org.sonarqube.ws.client.favorite.FavoritesService;
+import org.sonarqube.ws.client.favorites.FavoritesService;
 import org.sonarqube.ws.client.issue.IssuesService;
 import org.sonarqube.ws.client.measure.MeasuresService;
+import org.sonarqube.ws.client.notifications.NotificationsService;
 import org.sonarqube.ws.client.organization.OrganizationService;
 import org.sonarqube.ws.client.permission.PermissionsService;
 import org.sonarqube.ws.client.project.ProjectsService;
 import org.sonarqube.ws.client.projectanalysis.ProjectAnalysisService;
-import org.sonarqube.ws.client.projectbranches.ProjectBranchesServiceOld;
+import org.sonarqube.ws.client.projectbranches.ProjectBranchesService;
 import org.sonarqube.ws.client.projectlinks.ProjectLinksService;
 import org.sonarqube.ws.client.qualitygates.QualitygatesService;
 import org.sonarqube.ws.client.qualityprofile.QualityProfilesService;
 import org.sonarqube.ws.client.root.RootsService;
 import org.sonarqube.ws.client.rule.RulesService;
 import org.sonarqube.ws.client.setting.SettingsService;
-import org.sonarqube.ws.client.system.SystemServiceOld;
+import org.sonarqube.ws.client.system.SystemService;
 import org.sonarqube.ws.client.user.UsersService;
 import org.sonarqube.ws.client.usergroup.UserGroupsService;
-import org.sonarqube.ws.client.usertoken.UserTokensService;
-import org.sonarqube.ws.client.webhook.WebhooksService;
+import org.sonarqube.ws.client.usertokens.UserTokensService;
+import org.sonarqube.ws.client.webhooks.WebhooksService;
 
 /**
  * This class is not public anymore since version 5.5. It is
@@ -61,7 +62,7 @@ class DefaultWsClient implements WsClient {
   private final UserTokensService userTokensService;
   private final QualitygatesService qualityGatesService;
   private final MeasuresService measuresService;
-  private final SystemServiceOld systemService;
+  private final SystemService systemService;
   private final CeService ceService;
   private final RulesService rulesService;
   private final ProjectsService projectsService;
@@ -70,7 +71,8 @@ class DefaultWsClient implements WsClient {
   private final RootsService rootsService;
   private final WebhooksService webhooksService;
   private final ProjectAnalysisService projectAnalysisService;
-  private final ProjectBranchesServiceOld projectBranchesService;
+  private final NotificationsService notificationsService;
+  private final ProjectBranchesService projectBranchesService;
 
   DefaultWsClient(WsConnector wsConnector) {
     this.wsConnector = wsConnector;
@@ -85,7 +87,7 @@ class DefaultWsClient implements WsClient {
     this.userTokensService = new UserTokensService(wsConnector);
     this.qualityGatesService = new QualitygatesService(wsConnector);
     this.measuresService = new MeasuresService(wsConnector);
-    this.systemService = new SystemServiceOld(wsConnector);
+    this.systemService = new SystemService(wsConnector);
     this.ceService = new CeService(wsConnector);
     this.rulesService = new RulesService(wsConnector);
     this.projectsService = new ProjectsService(wsConnector);
@@ -94,7 +96,8 @@ class DefaultWsClient implements WsClient {
     this.rootsService = new RootsService(wsConnector);
     this.webhooksService = new WebhooksService(wsConnector);
     this.projectAnalysisService = new ProjectAnalysisService(wsConnector);
-    this.projectBranchesService = new ProjectBranchesServiceOld(wsConnector);
+    this.projectBranchesService = new ProjectBranchesService(wsConnector);
+    this.notificationsService = new NotificationsService(wsConnector);
   }
 
   @Override
@@ -158,7 +161,7 @@ class DefaultWsClient implements WsClient {
   }
 
   @Override
-  public SystemServiceOld system() {
+  public SystemService system() {
     return systemService;
   }
 
@@ -203,7 +206,12 @@ class DefaultWsClient implements WsClient {
   }
 
   @Override
-  public ProjectBranchesServiceOld projectBranches() {
+  public ProjectBranchesService projectBranches() {
     return projectBranchesService;
   }
+
+  @Override
+  public NotificationsService notifications() {
+    return notificationsService;
+  }
 }
index 71b00aa96d901c172e23a87d7ef7dfb1fa9faca6..824ec0089908916ad0457ac94deaf15dd54f7b98 100644 (file)
@@ -21,25 +21,26 @@ package org.sonarqube.ws.client;
 
 import org.sonarqube.ws.client.ce.CeService;
 import org.sonarqube.ws.client.component.ComponentsService;
-import org.sonarqube.ws.client.favorite.FavoritesService;
+import org.sonarqube.ws.client.favorites.FavoritesService;
 import org.sonarqube.ws.client.issue.IssuesService;
 import org.sonarqube.ws.client.measure.MeasuresService;
+import org.sonarqube.ws.client.notifications.NotificationsService;
 import org.sonarqube.ws.client.organization.OrganizationService;
 import org.sonarqube.ws.client.permission.PermissionsService;
 import org.sonarqube.ws.client.project.ProjectsService;
 import org.sonarqube.ws.client.projectanalysis.ProjectAnalysisService;
-import org.sonarqube.ws.client.projectbranches.ProjectBranchesServiceOld;
+import org.sonarqube.ws.client.projectbranches.ProjectBranchesService;
 import org.sonarqube.ws.client.projectlinks.ProjectLinksService;
 import org.sonarqube.ws.client.qualitygates.QualitygatesService;
 import org.sonarqube.ws.client.qualityprofile.QualityProfilesService;
 import org.sonarqube.ws.client.root.RootsService;
 import org.sonarqube.ws.client.rule.RulesService;
 import org.sonarqube.ws.client.setting.SettingsService;
-import org.sonarqube.ws.client.system.SystemServiceOld;
+import org.sonarqube.ws.client.system.SystemService;
 import org.sonarqube.ws.client.user.UsersService;
 import org.sonarqube.ws.client.usergroup.UserGroupsService;
-import org.sonarqube.ws.client.usertoken.UserTokensService;
-import org.sonarqube.ws.client.webhook.WebhooksService;
+import org.sonarqube.ws.client.usertokens.UserTokensService;
+import org.sonarqube.ws.client.webhooks.WebhooksService;
 
 /**
  * Allows to request the web services of SonarQube server. Instance is provided by
@@ -68,6 +69,8 @@ public interface WsClient {
 
   IssuesService issues();
 
+  NotificationsService notifications();
+
   PermissionsService permissions();
 
   QualityProfilesService qualityProfiles();
@@ -82,7 +85,7 @@ public interface WsClient {
 
   MeasuresService measures();
 
-  SystemServiceOld system();
+  SystemService system();
 
   CeService ce();
 
@@ -123,5 +126,5 @@ public interface WsClient {
   /**
    * @since 6.6>
    */
-  ProjectBranchesServiceOld projectBranches();
+  ProjectBranchesService projectBranches();
 }
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/ce/CeWsParameters.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/ce/CeWsParameters.java
deleted file mode 100644 (file)
index 9449526..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.ce;
-
-public class CeWsParameters {
-
-  public static final String ACTION_WORKER_COUNT = "worker_count";
-
-  public static final String PARAM_COMPONENT_ID = "componentId";
-  public static final String DEPRECATED_PARAM_COMPONENT_KEY = "componentKey";
-  public static final String PARAM_COMPONENT = "component";
-  public static final String PARAM_COMPONENT_QUERY = "componentQuery";
-  public static final String PARAM_TYPE = "type";
-  public static final String PARAM_STATUS = "status";
-  public static final String PARAM_ONLY_CURRENTS = "onlyCurrents";
-  public static final String PARAM_MIN_SUBMITTED_AT = "minSubmittedAt";
-  public static final String PARAM_MAX_EXECUTED_AT = "maxExecutedAt";
-
-  private CeWsParameters() {
-    // prevent instantiation
-  }
-}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/ce/package-info.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/ce/package-info.java
deleted file mode 100644 (file)
index 9971fa2..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.ce;
-
-import javax.annotation.ParametersAreNonnullByDefault;
-
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/favorite/FavoritesService.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/favorite/FavoritesService.java
deleted file mode 100644 (file)
index 1512630..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.favorite;
-
-import org.sonar.api.server.ws.WebService.Param;
-import org.sonarqube.ws.Favorites.SearchResponse;
-import org.sonarqube.ws.client.BaseService;
-import org.sonarqube.ws.client.GetRequest;
-import org.sonarqube.ws.client.PostRequest;
-import org.sonarqube.ws.client.WsConnector;
-
-import static org.sonarqube.ws.client.favorite.FavoritesWsParameters.ACTION_ADD;
-import static org.sonarqube.ws.client.favorite.FavoritesWsParameters.ACTION_REMOVE;
-import static org.sonarqube.ws.client.favorite.FavoritesWsParameters.ACTION_SEARCH;
-import static org.sonarqube.ws.client.favorite.FavoritesWsParameters.CONTROLLER_FAVORITES;
-import static org.sonarqube.ws.client.favorite.FavoritesWsParameters.PARAM_COMPONENT;
-
-public class FavoritesService extends BaseService {
-  public FavoritesService(WsConnector wsConnector) {
-    super(wsConnector, CONTROLLER_FAVORITES);
-  }
-
-  public void add(String component) {
-    PostRequest post = new PostRequest(path(ACTION_ADD)).setParam(PARAM_COMPONENT, component);
-
-    call(post);
-  }
-
-  public void remove(String component) {
-    PostRequest post = new PostRequest(path(ACTION_REMOVE)).setParam(PARAM_COMPONENT, component);
-
-    call(post);
-  }
-
-  public SearchResponse search(SearchRequest request) {
-    GetRequest get = new GetRequest(path(ACTION_SEARCH));
-    if (request.getPage() != null) {
-      get.setParam(Param.PAGE, request.getPage());
-    }
-    if (request.getPageSize() != null) {
-      get.setParam(Param.PAGE_SIZE, request.getPageSize());
-    }
-
-    return call(get, SearchResponse.parser());
-  }
-}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/favorite/FavoritesWsParameters.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/favorite/FavoritesWsParameters.java
deleted file mode 100644 (file)
index e38d8a7..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.favorite;
-
-public class FavoritesWsParameters {
-  public static final String CONTROLLER_FAVORITES = "api/favorites";
-
-  public static final String ACTION_ADD = "add";
-  public static final String ACTION_REMOVE = "remove";
-  public static final String ACTION_SEARCH = "search";
-
-  public static final String PARAM_COMPONENT = "component";
-
-  private FavoritesWsParameters() {
-    // prevent instantiation
-  }
-}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/favorite/SearchRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/favorite/SearchRequest.java
deleted file mode 100644 (file)
index e74c342..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.favorite;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-
-public class SearchRequest {
-  public static final int MAX_PAGE_SIZE = 500;
-
-  private Integer page;
-  private Integer pageSize;
-
-  @CheckForNull
-  public Integer getPage() {
-    return page;
-  }
-
-  public SearchRequest setPage(@Nullable Integer page) {
-    this.page = page;
-    return this;
-  }
-
-  @CheckForNull
-  public Integer getPageSize() {
-    return pageSize;
-  }
-
-  public SearchRequest setPageSize(@Nullable Integer pageSize) {
-    if (pageSize != null && pageSize > MAX_PAGE_SIZE) {
-      throw new IllegalArgumentException("Page size must be lower than or equals to " + MAX_PAGE_SIZE);
-    }
-    this.pageSize = pageSize;
-    return this;
-  }
-}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/favorite/package-info.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/favorite/package-info.java
deleted file mode 100644 (file)
index 971ad92..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.favorite;
-
-import javax.annotation.ParametersAreNonnullByDefault;
-
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/notification/AddRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/notification/AddRequest.java
deleted file mode 100644 (file)
index ff509a2..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.notification;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-
-import static java.util.Objects.requireNonNull;
-
-public class AddRequest {
-  private final String type;
-  private final String channel;
-  private final String project;
-  private final String login;
-
-  private AddRequest(Builder builder) {
-    this.channel = builder.channel;
-    this.type = builder.type;
-    this.project = builder.project;
-    this.login = builder.login;
-  }
-
-  public String getType() {
-    return type;
-  }
-
-  @CheckForNull
-  public String getChannel() {
-    return channel;
-  }
-
-  @CheckForNull
-  public String getProject() {
-    return project;
-  }
-
-  @CheckForNull
-  public String getLogin() {
-    return login;
-  }
-
-  public static Builder builder() {
-    return new Builder();
-  }
-
-  public static class Builder {
-    private String type;
-    private String channel;
-    private String project;
-    private String login;
-
-    private Builder() {
-      // enforce factory method
-    }
-
-    public Builder setType(String type) {
-      this.type = type;
-      return this;
-    }
-
-    public Builder setChannel(@Nullable String channel) {
-      this.channel = channel;
-      return this;
-    }
-
-    public Builder setProject(@Nullable String project) {
-      this.project = project;
-      return this;
-    }
-
-    public Builder setLogin(@Nullable String login) {
-      this.login = login;
-      return this;
-    }
-
-    public AddRequest build() {
-      requireNonNull(type, "Notification is required");
-      return new AddRequest(this);
-    }
-  }
-}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/notification/NotificationsWsParameters.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/notification/NotificationsWsParameters.java
deleted file mode 100644 (file)
index 40fe254..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.notification;
-
-public class NotificationsWsParameters {
-  public static final String CONTROLLER = "api/notifications";
-  public static final String ACTION_ADD = "add";
-  public static final String ACTION_REMOVE = "remove";
-  public static final String ACTION_LIST = "list";
-
-  public static final String PARAM_PROJECT = "project";
-  public static final String PARAM_CHANNEL = "channel";
-  public static final String PARAM_TYPE = "type";
-  public static final String PARAM_LOGIN = "login";
-
-  private NotificationsWsParameters() {
-    // prevent instantiation
-  }
-}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/notification/RemoveRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/notification/RemoveRequest.java
deleted file mode 100644 (file)
index 91547b5..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.notification;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-
-import static java.util.Objects.requireNonNull;
-
-public class RemoveRequest {
-  private final String type;
-  private final String channel;
-  private final String project;
-  private final String login;
-
-  private RemoveRequest(Builder builder) {
-    this.channel = builder.channel;
-    this.type = builder.type;
-    this.project = builder.project;
-    this.login = builder.login;
-  }
-
-  public String getType() {
-    return type;
-  }
-
-  @CheckForNull
-  public String getChannel() {
-    return channel;
-  }
-
-  @CheckForNull
-  public String getProject() {
-    return project;
-  }
-
-  @CheckForNull
-  public String getLogin() {
-    return login;
-  }
-
-  public static Builder builder() {
-    return new Builder();
-  }
-
-  public static class Builder {
-    private String type;
-    private String channel;
-    private String project;
-    private String login;
-
-    private Builder() {
-      // enforce factory method
-    }
-
-    public Builder setType(String type) {
-      this.type = type;
-      return this;
-    }
-
-    public Builder setChannel(@Nullable String channel) {
-      this.channel = channel;
-      return this;
-    }
-
-    public Builder setProject(@Nullable String project) {
-      this.project = project;
-      return this;
-    }
-
-    public Builder setLogin(@Nullable String login) {
-      this.login = login;
-      return this;
-    }
-
-    public RemoveRequest build() {
-      requireNonNull(type, "Notification is required");
-      return new RemoveRequest(this);
-    }
-  }
-}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/notification/package-info.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/notification/package-info.java
deleted file mode 100644 (file)
index 2aac876..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.notification;
-
-import javax.annotation.ParametersAreNonnullByDefault;
-
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/projectbranches/ProjectBranchesParameters.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/projectbranches/ProjectBranchesParameters.java
deleted file mode 100644 (file)
index 1df51cf..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.projectbranches;
-
-public class ProjectBranchesParameters {
-
-  public static final String CONTROLLER = "api/project_branches";
-
-  // actions
-  public static final String ACTION_LIST = "list";
-  public static final String ACTION_SHOW = "show";
-  public static final String ACTION_DELETE = "delete";
-  public static final String ACTION_RENAME = "rename";
-
-  // parameters
-  public static final String PARAM_PROJECT = "project";
-  public static final String PARAM_COMPONENT = "component";
-  public static final String PARAM_BRANCH = "branch";
-  public static final String PARAM_NAME = "name";
-
-  private ProjectBranchesParameters() {
-    // static utility class
-  }
-}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/projectbranches/ProjectBranchesServiceOld.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/projectbranches/ProjectBranchesServiceOld.java
deleted file mode 100644 (file)
index cee7e91..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.projectbranches;
-
-import org.sonarqube.ws.ProjectBranches.ListWsResponse;
-import org.sonarqube.ws.ProjectBranches.ShowWsResponse;
-import org.sonarqube.ws.client.BaseService;
-import org.sonarqube.ws.client.GetRequest;
-import org.sonarqube.ws.client.PostRequest;
-import org.sonarqube.ws.client.WsConnector;
-
-import static org.sonarqube.ws.client.projectbranches.ProjectBranchesParameters.ACTION_DELETE;
-import static org.sonarqube.ws.client.projectbranches.ProjectBranchesParameters.ACTION_LIST;
-import static org.sonarqube.ws.client.projectbranches.ProjectBranchesParameters.ACTION_RENAME;
-import static org.sonarqube.ws.client.projectbranches.ProjectBranchesParameters.ACTION_SHOW;
-import static org.sonarqube.ws.client.projectbranches.ProjectBranchesParameters.CONTROLLER;
-import static org.sonarqube.ws.client.projectbranches.ProjectBranchesParameters.PARAM_BRANCH;
-import static org.sonarqube.ws.client.projectbranches.ProjectBranchesParameters.PARAM_NAME;
-import static org.sonarqube.ws.client.projectbranches.ProjectBranchesParameters.PARAM_PROJECT;
-
-public class ProjectBranchesServiceOld extends BaseService {
-
-  public ProjectBranchesServiceOld(WsConnector wsConnector) {
-    super(wsConnector, CONTROLLER);
-  }
-
-  public ListWsResponse list(String project) {
-    GetRequest get = new GetRequest(path(ACTION_LIST))
-      .setParam(PARAM_PROJECT, project);
-    return call(get, ListWsResponse.parser());
-  }
-
-  public ShowWsResponse show(String project, String branch) {
-    GetRequest get = new GetRequest(path(ACTION_SHOW))
-      .setParam(PARAM_PROJECT, project)
-      .setParam(PARAM_BRANCH, branch);
-    return call(get, ShowWsResponse.parser());
-  }
-
-  public void delete(String project, String branch) {
-    PostRequest post = new PostRequest(path(ACTION_DELETE))
-      .setParam(PARAM_PROJECT, project)
-      .setParam(PARAM_BRANCH, branch);
-    call(post);
-  }
-
-  public void rename(String project, String name) {
-    PostRequest post = new PostRequest(path(ACTION_RENAME))
-      .setParam(PARAM_PROJECT, project)
-      .setParam(PARAM_NAME, name);
-    call(post);
-  }
-
-}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/projectbranches/package-info.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/projectbranches/package-info.java
deleted file mode 100644 (file)
index 148ff98..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.projectbranches;
-
-import javax.annotation.ParametersAreNonnullByDefault;
-
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/projectlinks/CreateWsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/projectlinks/CreateWsRequest.java
deleted file mode 100644 (file)
index 48d4059..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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 CreateWsRequest {
-  private String projectId;
-  private String projectKey;
-  private String name;
-  private String url;
-
-  @CheckForNull
-  public String getProjectId() {
-    return projectId;
-  }
-
-  public CreateWsRequest setProjectId(@Nullable String projectId) {
-    this.projectId = projectId;
-    return this;
-  }
-
-  @CheckForNull
-  public String getProjectKey() {
-    return projectKey;
-  }
-
-  public CreateWsRequest setProjectKey(@Nullable String projectKey) {
-    this.projectKey = projectKey;
-    return this;
-  }
-
-  public String getName() {
-    return name;
-  }
-
-  public CreateWsRequest setName(String name) {
-    this.name = name;
-    return this;
-  }
-
-  public String getUrl() {
-    return url;
-  }
-
-  public CreateWsRequest setUrl(String url) {
-    this.url = url;
-    return this;
-  }
-}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/projectlinks/DeleteWsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/projectlinks/DeleteWsRequest.java
deleted file mode 100644 (file)
index 71a5fd4..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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 DeleteWsRequest {
-  private Long id;
-
-  public Long getId() {
-    return id;
-  }
-
-  public DeleteWsRequest setId(Long id) {
-    this.id = id;
-    return this;
-  }
-}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/projectlinks/ProjectLinksService.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/projectlinks/ProjectLinksService.java
deleted file mode 100644 (file)
index 6266aa3..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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 org.sonarqube.ws.ProjectLinks.CreateWsResponse;
-import org.sonarqube.ws.ProjectLinks.SearchWsResponse;
-import org.sonarqube.ws.client.BaseService;
-import org.sonarqube.ws.client.GetRequest;
-import org.sonarqube.ws.client.PostRequest;
-import org.sonarqube.ws.client.WsConnector;
-
-import static org.sonarqube.ws.client.projectlinks.ProjectLinksWsParameters.ACTION_CREATE;
-import static org.sonarqube.ws.client.projectlinks.ProjectLinksWsParameters.ACTION_DELETE;
-import static org.sonarqube.ws.client.projectlinks.ProjectLinksWsParameters.ACTION_SEARCH;
-import static org.sonarqube.ws.client.projectlinks.ProjectLinksWsParameters.PARAM_ID;
-import static org.sonarqube.ws.client.projectlinks.ProjectLinksWsParameters.PARAM_NAME;
-import static org.sonarqube.ws.client.projectlinks.ProjectLinksWsParameters.PARAM_PROJECT_ID;
-import static org.sonarqube.ws.client.projectlinks.ProjectLinksWsParameters.PARAM_PROJECT_KEY;
-import static org.sonarqube.ws.client.projectlinks.ProjectLinksWsParameters.PARAM_URL;
-
-public class ProjectLinksService extends BaseService {
-
-  public ProjectLinksService(WsConnector wsConnector) {
-    super(wsConnector, "api/project_links");
-  }
-
-  public SearchWsResponse search(SearchWsRequest request) {
-    return call(new GetRequest(path(ACTION_SEARCH))
-      .setParam(PARAM_PROJECT_KEY, request.getProjectKey())
-      .setParam(PARAM_PROJECT_ID, request.getProjectId()),
-      SearchWsResponse.parser());
-  }
-
-  public CreateWsResponse create(CreateWsRequest request) {
-    return call(new PostRequest(path(ACTION_CREATE))
-      .setParam(PARAM_PROJECT_KEY, request.getProjectKey())
-      .setParam(PARAM_PROJECT_ID, request.getProjectId())
-      .setParam(PARAM_NAME, request.getName())
-      .setParam(PARAM_URL, request.getUrl()),
-      CreateWsResponse.parser());
-  }
-
-  public void delete(DeleteWsRequest request) {
-    call(new PostRequest(path(ACTION_DELETE))
-      .setParam(PARAM_ID, request.getId()));
-  }
-}
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
deleted file mode 100644 (file)
index 6b4c648..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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";
-  public static final String ACTION_CREATE = "create";
-  public static final String ACTION_DELETE = "delete";
-
-  // parameters
-  public static final String PARAM_PROJECT_ID = "projectId";
-  public static final String PARAM_PROJECT_KEY = "projectKey";
-  public static final String PARAM_ID = "id";
-  public static final String PARAM_NAME = "name";
-  public static final String PARAM_URL = "url";
-
-  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
deleted file mode 100644 (file)
index d329c76..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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
deleted file mode 100644 (file)
index 01d51ff..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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/java/org/sonarqube/ws/client/qualitygate/QualityGatesWsParameters.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygate/QualityGatesWsParameters.java
deleted file mode 100644 (file)
index 8764d64..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.qualitygate;
-
-public class QualityGatesWsParameters {
-
-  public static final String CONTROLLER_QUALITY_GATES = "api/qualitygates";
-
-  public static final String ACTION_PROJECT_STATUS = "project_status";
-  public static final String ACTION_GET_BY_PROJECT = "get_by_project";
-  public static final String ACTION_SELECT = "select";
-  public static final String ACTION_CREATE = "create";
-  public static final String ACTION_CREATE_CONDITION = "create_condition";
-  public static final String ACTION_UPDATE_CONDITION = "update_condition";
-
-  public static final String PARAM_ANALYSIS_ID = "analysisId";
-  public static final String PARAM_PROJECT_ID = "projectId";
-  public static final String PARAM_PROJECT_KEY = "projectKey";
-  public static final String PARAM_PAGE_SIZE = "pageSize";
-  public static final String PARAM_PAGE = "page";
-  public static final String PARAM_QUERY = "query";
-  public static final String PARAM_NAME = "name";
-  public static final String PARAM_ERROR = "error";
-  public static final String PARAM_WARNING = "warning";
-  public static final String PARAM_PERIOD = "period";
-  public static final String PARAM_OPERATOR = "op";
-  public static final String PARAM_METRIC = "metric";
-  public static final String PARAM_GATE_ID = "gateId";
-  public static final String PARAM_ID = "id";
-
-  private QualityGatesWsParameters() {
-    // prevent instantiation
-  }
-
-}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygate/package-info.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygate/package-info.java
deleted file mode 100644 (file)
index fa8dfc4..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.qualitygate;
-
-import javax.annotation.ParametersAreNonnullByDefault;
-
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/system/SystemServiceOld.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/system/SystemServiceOld.java
deleted file mode 100644 (file)
index 949cec1..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.system;
-
-import org.sonarqube.ws.System;
-import org.sonarqube.ws.client.BaseService;
-import org.sonarqube.ws.client.GetRequest;
-import org.sonarqube.ws.client.PostRequest;
-import org.sonarqube.ws.client.WsConnector;
-import org.sonarqube.ws.client.WsResponse;
-
-public class SystemServiceOld extends BaseService {
-  public SystemServiceOld(WsConnector wsConnector) {
-    super(wsConnector, "api/system");
-  }
-
-  public System.HealthResponse health() {
-    return call(new GetRequest(path("health")), System.HealthResponse.parser());
-  }
-
-  public void restart() {
-    call(new PostRequest(path("restart")));
-  }
-
-  public System.StatusResponse status() {
-    return call(new GetRequest(path("status")), System.StatusResponse.parser());
-  }
-
-  public void changeLogLevel(String level) {
-    call(new PostRequest(path("change_log_level")).setParam("level", level));
-  }
-
-  public WsResponse info() {
-    return call(new GetRequest(path("info")));
-  }
-}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/system/package-info.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/system/package-info.java
deleted file mode 100644 (file)
index 86b11d9..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.system;
-
-import javax.annotation.ParametersAreNonnullByDefault;
-
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/usertoken/GenerateWsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/usertoken/GenerateWsRequest.java
deleted file mode 100644 (file)
index 52500d1..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.usertoken;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-
-public class GenerateWsRequest {
-  private String login;
-  private String name;
-
-  @CheckForNull
-  public String getLogin() {
-    return login;
-  }
-
-  public GenerateWsRequest setLogin(@Nullable String login) {
-    this.login = login;
-    return this;
-  }
-
-  public String getName() {
-    return name;
-  }
-
-  public GenerateWsRequest setName(String name) {
-    this.name = name;
-    return this;
-  }
-}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/usertoken/RevokeWsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/usertoken/RevokeWsRequest.java
deleted file mode 100644 (file)
index 69654fc..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.usertoken;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-
-public class RevokeWsRequest {
-  private String login;
-  private String name;
-
-  @CheckForNull
-  public String getLogin() {
-    return login;
-  }
-
-  public RevokeWsRequest setLogin(@Nullable String login) {
-    this.login = login;
-    return this;
-  }
-
-  public String getName() {
-    return name;
-  }
-
-  public RevokeWsRequest setName(String name) {
-    this.name = name;
-    return this;
-  }
-}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/usertoken/SearchWsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/usertoken/SearchWsRequest.java
deleted file mode 100644 (file)
index a5efcec..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.usertoken;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-
-public class SearchWsRequest {
-  private String login;
-
-  @CheckForNull
-  public String getLogin() {
-    return login;
-  }
-
-  public SearchWsRequest setLogin(@Nullable String login) {
-    this.login = login;
-    return this;
-  }
-}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/usertoken/UserTokensService.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/usertoken/UserTokensService.java
deleted file mode 100644 (file)
index d3cd30a..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.usertoken;
-
-import org.sonarqube.ws.UserTokens.GenerateWsResponse;
-import org.sonarqube.ws.UserTokens.SearchWsResponse;
-import org.sonarqube.ws.client.BaseService;
-import org.sonarqube.ws.client.GetRequest;
-import org.sonarqube.ws.client.PostRequest;
-import org.sonarqube.ws.client.WsConnector;
-
-import static org.sonarqube.ws.client.usertoken.UserTokensWsParameters.ACTION_GENERATE;
-import static org.sonarqube.ws.client.usertoken.UserTokensWsParameters.ACTION_REVOKE;
-import static org.sonarqube.ws.client.usertoken.UserTokensWsParameters.ACTION_SEARCH;
-import static org.sonarqube.ws.client.usertoken.UserTokensWsParameters.CONTROLLER;
-import static org.sonarqube.ws.client.usertoken.UserTokensWsParameters.PARAM_LOGIN;
-import static org.sonarqube.ws.client.usertoken.UserTokensWsParameters.PARAM_NAME;
-
-public class UserTokensService extends BaseService {
-
-  public UserTokensService(WsConnector wsConnector) {
-    super(wsConnector, CONTROLLER);
-  }
-
-  public GenerateWsResponse generate(GenerateWsRequest request) {
-    return call(
-      new PostRequest(path(ACTION_GENERATE))
-        .setParam(PARAM_LOGIN, request.getLogin())
-        .setParam(PARAM_NAME, request.getName()),
-      GenerateWsResponse.parser());
-  }
-
-  public SearchWsResponse search(SearchWsRequest request) {
-    return call(
-      new GetRequest(path(ACTION_SEARCH)).setParam(PARAM_LOGIN, request.getLogin()),
-      SearchWsResponse.parser());
-  }
-
-  public void revoke(RevokeWsRequest request) {
-    call(
-      new PostRequest(path(ACTION_REVOKE))
-        .setParam(PARAM_LOGIN, request.getLogin())
-        .setParam(PARAM_NAME, request.getName()));
-  }
-
-}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/usertoken/UserTokensWsParameters.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/usertoken/UserTokensWsParameters.java
deleted file mode 100644 (file)
index 76d8c79..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.usertoken;
-
-public class UserTokensWsParameters {
-  public static final String CONTROLLER = "api/user_tokens";
-  public static final String ACTION_GENERATE = "generate";
-  public static final String ACTION_REVOKE = "revoke";
-  public static final String ACTION_SEARCH = "search";
-
-  public static final String PARAM_LOGIN = "login";
-  public static final String PARAM_NAME = "name";
-
-  private UserTokensWsParameters() {
-    // constants only
-  }
-}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/usertoken/package-info.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/usertoken/package-info.java
deleted file mode 100644 (file)
index 445face..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.usertoken;
-
-import javax.annotation.ParametersAreNonnullByDefault;
-
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/webhook/DeliveriesRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/webhook/DeliveriesRequest.java
deleted file mode 100644 (file)
index 6418fbb..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.webhook;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-import javax.annotation.concurrent.Immutable;
-
-@Immutable
-public class DeliveriesRequest {
-
-  private final String componentKey;
-  private final String ceTaskId;
-
-  private DeliveriesRequest(Builder builder) {
-    this.componentKey = builder.componentKey;
-    this.ceTaskId = builder.ceTaskId;
-  }
-
-  @CheckForNull
-  public String getComponentKey() {
-    return componentKey;
-  }
-
-  @CheckForNull
-  public String getCeTaskId() {
-    return ceTaskId;
-  }
-
-  public static Builder builder() {
-    return new Builder();
-  }
-
-  public static class Builder {
-    private String componentKey;
-    private String ceTaskId;
-
-    /**
-     * @see #builder()
-     */
-    private Builder() {
-    }
-
-    public Builder setComponentKey(@Nullable String s) {
-      this.componentKey = s;
-      return this;
-    }
-
-    public Builder setCeTaskId(@Nullable String s) {
-      this.ceTaskId = s;
-      return this;
-    }
-
-    public DeliveriesRequest build() {
-      return new DeliveriesRequest(this);
-    }
-  }
-}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/webhook/WebhooksService.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/webhook/WebhooksService.java
deleted file mode 100644 (file)
index ec56866..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.webhook;
-
-import org.sonarqube.ws.Webhooks;
-import org.sonarqube.ws.client.BaseService;
-import org.sonarqube.ws.client.GetRequest;
-import org.sonarqube.ws.client.WsConnector;
-
-/**
- * @since 6.2
- */
-public class WebhooksService extends BaseService {
-
-  public WebhooksService(WsConnector wsConnector) {
-    super(wsConnector, "api/webhooks");
-  }
-
-  public Webhooks.DeliveryWsResponse delivery(String deliveryId) {
-    GetRequest httpRequest = new GetRequest(path("delivery"))
-      .setParam("deliveryId", deliveryId);
-    return call(httpRequest, Webhooks.DeliveryWsResponse.parser());
-  }
-
-  /**
-   * @throws org.sonarqube.ws.client.HttpException if HTTP status code is not 2xx.
-   */
-  public Webhooks.DeliveriesWsResponse deliveries(DeliveriesRequest request) {
-    GetRequest httpRequest = new GetRequest(path("deliveries"))
-      .setParam("componentKey", request.getComponentKey())
-      .setParam("ceTaskId", request.getCeTaskId());
-    return call(httpRequest, Webhooks.DeliveriesWsResponse.parser());
-  }
-}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/webhook/package-info.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/webhook/package-info.java
deleted file mode 100644 (file)
index 6652765..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.webhook;
-
-import javax.annotation.ParametersAreNonnullByDefault;
-
diff --git a/sonar-ws/src/test/java/org/sonarqube/ws/client/favorite/FavoritesServiceTest.java b/sonar-ws/src/test/java/org/sonarqube/ws/client/favorite/FavoritesServiceTest.java
deleted file mode 100644 (file)
index 940a558..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.favorite;
-
-import org.junit.Rule;
-import org.junit.Test;
-import org.sonar.api.server.ws.WebService.Param;
-import org.sonarqube.ws.client.ServiceTester;
-import org.sonarqube.ws.client.WsConnector;
-
-import static org.mockito.Mockito.mock;
-import static org.sonarqube.ws.client.favorite.FavoritesWsParameters.PARAM_COMPONENT;
-
-public class FavoritesServiceTest {
-  @Rule
-  public ServiceTester<FavoritesService> serviceTester = new ServiceTester<>(new FavoritesService(mock(WsConnector.class)));
-
-  private FavoritesService underTest = serviceTester.getInstanceUnderTest();
-
-  @Test
-  public void add() {
-    underTest.add("my_project");
-
-    serviceTester.assertThat(serviceTester.getPostRequest())
-      .hasPath("add")
-      .hasParam(PARAM_COMPONENT, "my_project")
-      .andNoOtherParam();
-  }
-
-  @Test
-  public void remove() {
-    underTest.remove("my_project");
-
-    serviceTester.assertThat(serviceTester.getPostRequest())
-      .hasPath("remove")
-      .hasParam(PARAM_COMPONENT, "my_project")
-      .andNoOtherParam();
-  }
-
-  @Test
-  public void search() {
-    underTest.search(new SearchRequest().setPage(42).setPageSize(255));
-
-    serviceTester.assertThat(serviceTester.getGetRequest())
-      .hasPath("search")
-      .hasParam(Param.PAGE, 42)
-      .hasParam(Param.PAGE_SIZE, 255)
-      .andNoOtherParam();
-  }
-}
diff --git a/sonar-ws/src/test/java/org/sonarqube/ws/client/favorite/SearchRequestTest.java b/sonar-ws/src/test/java/org/sonarqube/ws/client/favorite/SearchRequestTest.java
deleted file mode 100644 (file)
index b2c4bf7..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.favorite;
-
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.ExpectedException;
-
-public class SearchRequestTest {
-  @Rule
-  public ExpectedException expectedException = ExpectedException.none();
-
-  private SearchRequest underTest = new SearchRequest();
-
-  @Test
-  public void fail_if_page_size_greater_than_500() {
-    expectedException.expect(IllegalArgumentException.class);
-    expectedException.expectMessage("Page size must be lower than or equals to 500");
-
-    underTest.setPageSize(501);
-  }
-}
diff --git a/sonar-ws/src/test/java/org/sonarqube/ws/client/projectbranches/ProjectBranchesServiceTest.java b/sonar-ws/src/test/java/org/sonarqube/ws/client/projectbranches/ProjectBranchesServiceTest.java
deleted file mode 100644 (file)
index a201376..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.projectbranches;
-
-import org.junit.Rule;
-import org.junit.Test;
-import org.sonarqube.ws.ProjectBranches.ListWsResponse;
-import org.sonarqube.ws.ProjectBranches.ShowWsResponse;
-import org.sonarqube.ws.client.GetRequest;
-import org.sonarqube.ws.client.PostRequest;
-import org.sonarqube.ws.client.ServiceTester;
-import org.sonarqube.ws.client.WsConnector;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Mockito.mock;
-import static org.sonarqube.ws.client.projectbranches.ProjectBranchesParameters.PARAM_BRANCH;
-import static org.sonarqube.ws.client.projectbranches.ProjectBranchesParameters.PARAM_NAME;
-import static org.sonarqube.ws.client.projectbranches.ProjectBranchesParameters.PARAM_PROJECT;
-
-public class ProjectBranchesServiceTest {
-
-  @Rule
-  public ServiceTester<ProjectBranchesServiceOld> serviceTester = new ServiceTester<>(new ProjectBranchesServiceOld(mock(WsConnector.class)));
-
-  private ProjectBranchesServiceOld underTest = serviceTester.getInstanceUnderTest();
-
-  @Test
-  public void list() {
-    underTest.list("projectKey");
-
-    assertThat(serviceTester.getGetParser()).isSameAs(ListWsResponse.parser());
-
-    GetRequest getRequest = serviceTester.getGetRequest();
-    serviceTester.assertThat(getRequest)
-      .hasPath("list")
-      .hasParam(PARAM_PROJECT, "projectKey")
-      .andNoOtherParam();
-  }
-
-  @Test
-  public void show() {
-    underTest.show("projectKey", "my_branch");
-
-    assertThat(serviceTester.getGetParser()).isSameAs(ShowWsResponse.parser());
-
-    GetRequest getRequest = serviceTester.getGetRequest();
-    serviceTester.assertThat(getRequest)
-      .hasPath("show")
-      .hasParam(PARAM_PROJECT, "projectKey")
-      .hasParam(PARAM_BRANCH, "my_branch")
-      .andNoOtherParam();
-  }
-
-  @Test
-  public void delete() {
-    underTest.delete("projectKey", "my_branch");
-
-    PostRequest postRequest = serviceTester.getPostRequest();
-    serviceTester.assertThat(postRequest)
-      .hasPath("delete")
-      .hasParam(PARAM_PROJECT, "projectKey")
-      .hasParam(PARAM_BRANCH, "my_branch")
-      .andNoOtherParam();
-  }
-
-  @Test
-  public void rename() {
-    underTest.rename("projectKey", "my_branch");
-
-    PostRequest postRequest = serviceTester.getPostRequest();
-    serviceTester.assertThat(postRequest)
-      .hasPath("rename")
-      .hasParam(PARAM_PROJECT, "projectKey")
-      .hasParam(PARAM_NAME, "my_branch")
-      .andNoOtherParam();
-  }
-
-}
diff --git a/sonar-ws/src/test/java/org/sonarqube/ws/client/projectlinks/ProjectLinksServiceTest.java b/sonar-ws/src/test/java/org/sonarqube/ws/client/projectlinks/ProjectLinksServiceTest.java
deleted file mode 100644 (file)
index 3ebf9c6..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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 org.junit.Rule;
-import org.junit.Test;
-import org.sonarqube.ws.ProjectLinks.CreateWsResponse;
-import org.sonarqube.ws.ProjectLinks.SearchWsResponse;
-import org.sonarqube.ws.client.GetRequest;
-import org.sonarqube.ws.client.PostRequest;
-import org.sonarqube.ws.client.ServiceTester;
-import org.sonarqube.ws.client.WsConnector;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Mockito.mock;
-import static org.sonarqube.ws.client.projectlinks.ProjectLinksWsParameters.PARAM_ID;
-import static org.sonarqube.ws.client.projectlinks.ProjectLinksWsParameters.PARAM_NAME;
-import static org.sonarqube.ws.client.projectlinks.ProjectLinksWsParameters.PARAM_PROJECT_ID;
-import static org.sonarqube.ws.client.projectlinks.ProjectLinksWsParameters.PARAM_PROJECT_KEY;
-import static org.sonarqube.ws.client.projectlinks.ProjectLinksWsParameters.PARAM_URL;
-
-public class ProjectLinksServiceTest {
-  private static final String PROJECT_ID_VALUE = "project_id_value";
-  private static final String PROJECT_KEY_VALUE = "project_key_value";
-  private static final String NAME_VALUE = "name_value";
-  private static final String URL_VALUE = "url_value";
-  private static final long ID_VALUE = 175;
-
-  @Rule
-  public ServiceTester<ProjectLinksService> serviceTester = new ServiceTester<>(new ProjectLinksService(mock(WsConnector.class)));
-
-  private ProjectLinksService underTest = serviceTester.getInstanceUnderTest();
-
-  @Test
-  public void search_does_GET_request() {
-    underTest.search(new SearchWsRequest()
-      .setProjectId(PROJECT_ID_VALUE)
-      .setProjectKey(PROJECT_KEY_VALUE));
-
-    assertThat(serviceTester.getGetParser()).isSameAs(SearchWsResponse.parser());
-
-    GetRequest getRequest = serviceTester.getGetRequest();
-
-    serviceTester.assertThat(getRequest)
-      .hasPath("search")
-      .hasParam(PARAM_PROJECT_ID, PROJECT_ID_VALUE)
-      .hasParam(PARAM_PROJECT_KEY, PROJECT_KEY_VALUE)
-      .andNoOtherParam();
-  }
-
-  @Test
-  public void create_does_POST_request() {
-    underTest.create(new CreateWsRequest()
-      .setProjectId(PROJECT_ID_VALUE)
-      .setProjectKey(PROJECT_KEY_VALUE)
-      .setName(NAME_VALUE)
-      .setUrl(URL_VALUE));
-
-    assertThat(serviceTester.getPostParser()).isSameAs(CreateWsResponse.parser());
-
-    PostRequest postRequest = serviceTester.getPostRequest();
-
-    serviceTester.assertThat(postRequest)
-      .hasPath("create")
-      .hasParam(PARAM_PROJECT_ID, PROJECT_ID_VALUE)
-      .hasParam(PARAM_PROJECT_KEY, PROJECT_KEY_VALUE)
-      .hasParam(PARAM_NAME, NAME_VALUE)
-      .hasParam(PARAM_URL, URL_VALUE)
-      .andNoOtherParam();
-  }
-
-  @Test
-  public void delete_does_POST_request() {
-    underTest.delete(new DeleteWsRequest().setId(ID_VALUE));
-
-    assertThat(serviceTester.getPostParser()).isNull();
-
-    PostRequest postRequest = serviceTester.getPostRequest();
-
-    serviceTester.assertThat(postRequest)
-      .hasPath("delete")
-      .hasParam(PARAM_ID, String.valueOf(ID_VALUE))
-      .andNoOtherParam();
-  }
-}
diff --git a/sonar-ws/src/test/java/org/sonarqube/ws/client/system/SystemServiceTest.java b/sonar-ws/src/test/java/org/sonarqube/ws/client/system/SystemServiceTest.java
deleted file mode 100644 (file)
index 766baa3..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.system;
-
-import org.junit.Rule;
-import org.junit.Test;
-import org.sonarqube.ws.client.GetRequest;
-import org.sonarqube.ws.client.PostRequest;
-import org.sonarqube.ws.client.ServiceTester;
-import org.sonarqube.ws.client.WsConnector;
-
-import static org.mockito.Mockito.mock;
-
-public class SystemServiceTest {
-
-  @Rule
-  public ServiceTester<SystemServiceOld> serviceTester = new ServiceTester<>(new SystemServiceOld(mock(WsConnector.class)));
-
-  private SystemServiceOld underTest = serviceTester.getInstanceUnderTest();
-
-  @Test
-  public void test_health() throws Exception {
-    underTest.health();
-
-    GetRequest getRequest = serviceTester.getGetRequest();
-    serviceTester.assertThat(getRequest)
-      .hasPath("health")
-      .andNoOtherParam();
-  }
-
-  @Test
-  public void test_status() throws Exception {
-    underTest.status();
-
-    GetRequest getRequest = serviceTester.getGetRequest();
-    serviceTester.assertThat(getRequest)
-      .hasPath("status")
-      .andNoOtherParam();
-  }
-
-  @Test
-  public void test_restart() throws Exception {
-    underTest.restart();
-
-    PostRequest postRequest = serviceTester.getPostRequest();
-    serviceTester.assertThat(postRequest)
-        .hasPath("restart")
-        .andNoOtherParam();
-  }
-
-  @Test
-  public void test_changeLogLevel() throws Exception {
-    underTest.changeLogLevel("TRACE");
-
-    PostRequest postRequest = serviceTester.getPostRequest();
-    serviceTester.assertThat(postRequest)
-        .hasPath("change_log_level")
-        .hasParam("level", "TRACE")
-        .andNoOtherParam();
-  }
-
-  @Test
-  public void test_info() throws Exception {
-    underTest.info();
-
-    GetRequest getRequest = serviceTester.getGetRequest();
-    serviceTester.assertThat(getRequest)
-        .hasPath("info")
-        .andNoOtherParam();
-  }
-}
index 1bb37ef730300169c534fe224aa6537f589517ee..14b60781d47bda8973666b8300241b86330db2c7 100644 (file)
@@ -31,7 +31,7 @@ import org.sonarqube.ws.Favorites;
 import org.sonarqube.ws.Favorites.Favorite;
 import org.sonarqube.ws.Permissions;
 import org.sonarqube.ws.client.WsClient;
-import org.sonarqube.ws.client.favorite.SearchRequest;
+import org.sonarqube.ws.client.favorites.SearchRequest;
 import org.sonarqube.ws.client.permission.AddProjectCreatorToTemplateWsRequest;
 import org.sonarqube.ws.client.permission.RemoveProjectCreatorFromTemplateWsRequest;
 import org.sonarqube.ws.client.permission.SearchTemplatesWsRequest;
index 574dc29c367f711bff9370bcdcefc3aceac1110c..2f2e20bc59ad133da7e8389b8644fc1eee69322d 100644 (file)
@@ -23,15 +23,15 @@ import com.google.common.collect.ImmutableMap;
 import com.sonar.orchestrator.Orchestrator;
 import com.sonar.orchestrator.build.MavenBuild;
 import com.sonar.orchestrator.build.SonarScanner;
-import org.sonarqube.tests.Category3Suite;
 import java.util.List;
 import java.util.Optional;
 import org.junit.After;
 import org.junit.ClassRule;
 import org.junit.Test;
+import org.sonarqube.tests.Category3Suite;
 import org.sonarqube.ws.ProjectLinks;
 import org.sonarqube.ws.client.WsClient;
-import org.sonarqube.ws.client.projectlinks.SearchWsRequest;
+import org.sonarqube.ws.client.projectlinks.SearchRequest;
 import util.ItUtils;
 
 import static org.assertj.core.api.Assertions.assertThat;
@@ -75,7 +75,7 @@ public class LinksTest {
 
   private void verifyLinks() {
     WsClient wsClient = ItUtils.newWsClient(orchestrator);
-    List<ProjectLinks.Link> links = wsClient.projectLinks().search(new SearchWsRequest().setProjectKey(PROJECT_KEY)).getLinksList();
+    List<ProjectLinks.Link> links = wsClient.projectLinks().search(new SearchRequest().setProjectKey(PROJECT_KEY)).getLinksList();
     verifyLink(links, "homepage", "http://www.simplesample.org_OVERRIDDEN");
     verifyLink(links, "ci", "http://bamboo.ci.codehaus.org/browse/SIMPLESAMPLE");
     verifyLink(links, "issue", "http://jira.codehaus.org/browse/SIMPLESAMPLE");
index d0f4eefd4a42d462b502ae6661bdbee988763b03..b7d8921246d410cdc72675764e4ea0247b5400a6 100644 (file)
@@ -32,9 +32,9 @@ import org.junit.Test;
 import org.sonarqube.ws.UserTokens;
 import org.sonarqube.ws.client.WsClient;
 import org.sonarqube.ws.client.permission.AddUserWsRequest;
-import org.sonarqube.ws.client.usertoken.GenerateWsRequest;
-import org.sonarqube.ws.client.usertoken.RevokeWsRequest;
-import org.sonarqube.ws.client.usertoken.UserTokensService;
+import org.sonarqube.ws.client.usertokens.GenerateRequest;
+import org.sonarqube.ws.client.usertokens.RevokeRequest;
+import org.sonarqube.ws.client.usertokens.UserTokensService;
 import util.user.UserRule;
 
 import static org.assertj.core.api.Assertions.assertThat;
@@ -79,7 +79,7 @@ public class PermissionTest {
     createUserWithProvisioningAndScanPermissions();
 
     String tokenName = "For test";
-    UserTokens.GenerateWsResponse generateWsResponse = userTokensWsClient.generate(new GenerateWsRequest()
+    UserTokens.GenerateWsResponse generateWsResponse = userTokensWsClient.generate(new GenerateRequest()
       .setLogin(A_LOGIN)
       .setName(tokenName));
     SonarScanner sampleProject = SonarScanner.create(projectDir("shared/xoo-sample"));
@@ -90,7 +90,7 @@ public class PermissionTest {
     BuildResult buildResult = orchestrator.executeBuild(sampleProject);
 
     assertThat(buildResult.isSuccess()).isTrue();
-    userTokensWsClient.revoke(new RevokeWsRequest().setLogin(A_LOGIN).setName(tokenName));
+    userTokensWsClient.revoke(new RevokeRequest().setLogin(A_LOGIN).setName(tokenName));
   }
 
   @Test
index 3d0b3c8ab023bcc0d2a0db321d3f1ee4e0b81c0b..a4a0ad170a8014dce51c4a051e844c83d9048cfd 100644 (file)
@@ -30,6 +30,7 @@ import org.sonarqube.ws.Common;
 import org.sonarqube.ws.ProjectBranches;
 import org.sonarqube.ws.client.GetRequest;
 import org.sonarqube.ws.client.WsResponse;
+import org.sonarqube.ws.client.projectbranches.ListRequest;
 import util.ItUtils;
 
 import static org.assertj.core.api.Java6Assertions.assertThat;
@@ -47,7 +48,7 @@ public class BranchTest {
   public void list_branches_contains_main_branch() {
     runProjectAnalysis(orchestrator, "shared/xoo-sample");
 
-    ProjectBranches.ListWsResponse result = tester.wsClient().projectBranches().list("sample");
+    ProjectBranches.ListWsResponse result = tester.wsClient().projectBranches().list(new ListRequest().setProject("sample"));
 
     assertThat(result.getBranchesList())
       .extracting(ProjectBranches.Branch::getName, ProjectBranches.Branch::getType, ProjectBranches.Branch::getIsMain)
index b980b287381536528647298f630c50c7172bd43f..17e15dadd13f96b46f50b50d6b0dfd362dcd3c7c 100644 (file)
@@ -33,8 +33,8 @@ import org.sonarqube.qa.util.Tester;
 import org.sonarqube.qa.util.pageobjects.ProjectLinkItem;
 import org.sonarqube.qa.util.pageobjects.ProjectLinksPage;
 import org.sonarqube.ws.ProjectLinks.CreateWsResponse;
-import org.sonarqube.ws.client.projectlinks.CreateWsRequest;
-import org.sonarqube.ws.client.projectlinks.DeleteWsRequest;
+import org.sonarqube.ws.client.projectlinks.CreateRequest;
+import org.sonarqube.ws.client.projectlinks.DeleteRequest;
 
 import static com.codeborne.selenide.Condition.text;
 import static com.codeborne.selenide.Selenide.$;
@@ -131,7 +131,7 @@ public class ProjectLinksTest {
   }
 
   private CreateWsResponse createCustomLink() {
-    return tester.wsClient().projectLinks().create(new CreateWsRequest()
+    return tester.wsClient().projectLinks().create(new CreateRequest()
       .setProjectKey("sample")
       .setName("Custom")
       .setUrl("http://example.org/custom"));
@@ -139,7 +139,7 @@ public class ProjectLinksTest {
 
   private void deleteLink(long id) {
     try {
-      tester.wsClient().projectLinks().delete(new DeleteWsRequest().setId(id));
+      tester.wsClient().projectLinks().delete(new DeleteRequest().setId("" + id));
     } catch (Exception e) {
       // fail silently
     }
index a18787080f500ec256684a084953e81ee54191fc..0bf926b80b33266b8dbd7eb322f3497756a50808 100644 (file)
@@ -32,6 +32,8 @@ import org.sonarqube.qa.util.pageobjects.projects.ProjectsPage;
 import org.sonarqube.ws.Users;
 import org.sonarqube.ws.client.PostRequest;
 import org.sonarqube.ws.client.WsClient;
+import org.sonarqube.ws.client.favorites.AddRequest;
+import org.sonarqube.ws.client.favorites.RemoveRequest;
 
 import static com.codeborne.selenide.Selenide.clearBrowserLocalStorage;
 import static com.codeborne.selenide.WebDriverRunner.url;
@@ -110,12 +112,12 @@ public class ProjectsPageTest {
 
     // favorite one project
     WsClient administratorWsClient = tester.as(administrator.getLogin()).wsClient();
-    administratorWsClient.favorites().add(PROJECT_KEY);
+    administratorWsClient.favorites().add(new AddRequest().setComponent(PROJECT_KEY));
     page = nav.openProjects();
     page.shouldHaveTotal(1).shouldDisplayFavoriteProjects();
 
     // un-favorite this project
-    administratorWsClient.favorites().remove(PROJECT_KEY);
+    administratorWsClient.favorites().remove(new RemoveRequest().setComponent(PROJECT_KEY));
     page = nav.openProjects();
     page.shouldHaveTotal(2).shouldDisplayAllProjects();
 
index fbcd3181ad3bf7551d7585011227903d70a31e24..8baa938ef66e1c7f9a3c0f5600883683045416c2 100644 (file)
@@ -21,14 +21,16 @@ package org.sonarqube.tests.user;
 
 import com.sonar.orchestrator.Orchestrator;
 import com.sonar.orchestrator.build.SonarScanner;
-import org.sonarqube.tests.Category4Suite;
 import java.util.List;
 import org.junit.Before;
 import org.junit.ClassRule;
 import org.junit.Test;
+import org.sonarqube.tests.Category4Suite;
 import org.sonarqube.ws.Favorites.Favorite;
 import org.sonarqube.ws.client.WsClient;
-import org.sonarqube.ws.client.favorite.SearchRequest;
+import org.sonarqube.ws.client.favorites.AddRequest;
+import org.sonarqube.ws.client.favorites.RemoveRequest;
+import org.sonarqube.ws.client.favorites.SearchRequest;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static util.ItUtils.newAdminWsClient;
@@ -56,15 +58,15 @@ public class FavoritesWsTest {
     assertThat(favorites).isEmpty();
 
     // POST (create favorites)
-    adminClient.favorites().add("sample");
-    adminClient.favorites().add("sample:src/main/xoo/sample/Sample.xoo");
+    adminClient.favorites().add(new AddRequest().setComponent("sample"));
+    adminClient.favorites().add(new AddRequest().setComponent("sample:src/main/xoo/sample/Sample.xoo"));
 
     // GET (created favorites)
     favorites = adminClient.favorites().search(new SearchRequest()).getFavoritesList();
     assertThat(favorites.stream().map(Favorite::getKey)).containsOnly("sample", "sample:src/main/xoo/sample/Sample.xoo");
 
     // DELETE (a favorite)
-    adminClient.favorites().remove("sample");
+    adminClient.favorites().remove(new RemoveRequest().setComponent("sample"));
     favorites = adminClient.favorites().search(new SearchRequest()).getFavoritesList();
     assertThat(favorites.stream().map(Favorite::getKey)).containsOnly("sample:src/main/xoo/sample/Sample.xoo");
   }
index 14b8237feabcb4390abaeb2588b0a10fe802ced7..1955c1c2f62e4b61d2ea4da878a922bc2f0b9dfb 100644 (file)
@@ -40,10 +40,10 @@ import org.sonarqube.ws.client.WsClient;
 import org.sonarqube.ws.client.WsClientFactories;
 import org.sonarqube.ws.client.WsResponse;
 import org.sonarqube.ws.client.user.CreateRequest;
-import org.sonarqube.ws.client.usertoken.GenerateWsRequest;
-import org.sonarqube.ws.client.usertoken.RevokeWsRequest;
-import org.sonarqube.ws.client.usertoken.SearchWsRequest;
-import org.sonarqube.ws.client.usertoken.UserTokensService;
+import org.sonarqube.ws.client.usertokens.GenerateRequest;
+import org.sonarqube.ws.client.usertokens.RevokeRequest;
+import org.sonarqube.ws.client.usertokens.SearchRequest;
+import org.sonarqube.ws.client.usertokens.UserTokensService;
 import util.selenium.Selenese;
 
 import static java.lang.String.format;
@@ -106,7 +106,7 @@ public class LocalAuthenticationTest {
     User user = tester.users().generate();
     String tokenName = "Validate token based authentication";
     UserTokensService tokensService = tester.wsClient().userTokens();
-    UserTokens.GenerateWsResponse generateWsResponse = tokensService.generate(new GenerateWsRequest()
+    UserTokens.GenerateWsResponse generateWsResponse = tokensService.generate(new GenerateRequest()
       .setLogin(user.getLogin())
       .setName(tokenName));
     WsClient wsClient = WsClientFactories.getDefault().newClient(HttpConnector.newBuilder()
@@ -117,10 +117,10 @@ public class LocalAuthenticationTest {
 
     assertThat(response.content()).isEqualTo("{\"valid\":true}");
 
-    UserTokens.SearchWsResponse searchResponse = tokensService.search(new SearchWsRequest().setLogin(user.getLogin()));
+    UserTokens.SearchWsResponse searchResponse = tokensService.search(new SearchRequest().setLogin(user.getLogin()));
     assertThat(searchResponse.getUserTokensCount()).isEqualTo(1);
-    tokensService.revoke(new RevokeWsRequest().setLogin(user.getLogin()).setName(tokenName));
-    searchResponse = tokensService.search(new SearchWsRequest().setLogin(user.getLogin()));
+    tokensService.revoke(new RevokeRequest().setLogin(user.getLogin()).setName(tokenName));
+    searchResponse = tokensService.search(new SearchRequest().setLogin(user.getLogin()));
     assertThat(searchResponse.getUserTokensCount()).isEqualTo(0);
   }
 
index 003c3eba941a03f3ac22347193f3f49ff7fbecd5..5aba7eeb6c4fb73d713136ef3ab0c3677f191613 100644 (file)
@@ -37,7 +37,8 @@ import org.sonarqube.ws.client.WsClient;
 import org.sonarqube.ws.client.project.DeleteRequest;
 import org.sonarqube.ws.client.setting.ResetRequest;
 import org.sonarqube.ws.client.setting.SetRequest;
-import org.sonarqube.ws.client.webhook.DeliveriesRequest;
+import org.sonarqube.ws.client.webhooks.DeliveriesRequest;
+import org.sonarqube.ws.client.webhooks.DeliveryRequest;
 import util.ItUtils;
 
 import static java.util.Objects.requireNonNull;
@@ -220,7 +221,7 @@ public class WebhooksTest {
   }
 
   private List<Webhooks.Delivery> getPersistedDeliveries() {
-    DeliveriesRequest deliveriesReq = DeliveriesRequest.builder().setComponentKey(PROJECT_KEY).build();
+    DeliveriesRequest deliveriesReq = new DeliveriesRequest().setComponentKey(PROJECT_KEY);
     return adminWs.webhooks().deliveries(deliveriesReq).getDeliveriesList();
   }
 
@@ -230,7 +231,7 @@ public class WebhooksTest {
   }
 
   private Webhooks.Delivery getDetailOfPersistedDelivery(Webhooks.Delivery delivery) {
-    Webhooks.Delivery detail = adminWs.webhooks().delivery(delivery.getId()).getDelivery();
+    Webhooks.Delivery detail = adminWs.webhooks().delivery(new DeliveryRequest().setDeliveryId(delivery.getId())).getDelivery();
     return requireNonNull(detail);
   }