diff options
Diffstat (limited to 'sonar-ws/src/main/java/org/sonarqube/ws')
9 files changed, 3 insertions, 238 deletions
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/BaseRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/BaseRequest.java index 6a92121fd8c..73e99ed14b6 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/BaseRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/BaseRequest.java @@ -29,8 +29,6 @@ import java.util.Objects; import java.util.Optional; import java.util.OptionalInt; import java.util.Set; -import java.util.function.Function; -import java.util.stream.Collectors; import javax.annotation.CheckForNull; import javax.annotation.Nullable; import org.sonarqube.ws.MediaTypes; @@ -90,7 +88,7 @@ abstract class BaseRequest<SELF extends BaseRequest<SELF>> implements WsRequest * Expected media type of response. Default is {@link MediaTypes#JSON}. */ @SuppressWarnings("unchecked") - public <T extends SELF> T setMediaType(String s) { + public <T extends SELF> T setMediaType(String s) { requireNonNull(s, "media type of response cannot be null"); this.mediaType = s; return (T) this; @@ -143,18 +141,6 @@ abstract class BaseRequest<SELF extends BaseRequest<SELF>> implements WsRequest } @Override - public Map<String, String> getParams() { - return parameters.keyValues.keySet().stream() - .collect(Collectors.toMap( - Function.identity(), - key -> parameters.keyValues.get(key).get(0), - (v1, v2) -> { - throw new IllegalStateException(String.format("Duplicate key '%s' in request", v1)); - }, - LinkedHashMap::new)); - } - - @Override public Parameters getParameters() { return parameters; } diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/DefaultWsClient.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/DefaultWsClient.java index 70aee7bc31b..fe46a2ed771 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/DefaultWsClient.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/DefaultWsClient.java @@ -66,7 +66,6 @@ import org.sonarqube.ws.client.push.SonarLintServerPushService; import org.sonarqube.ws.client.qualitygates.QualitygatesService; import org.sonarqube.ws.client.qualityprofiles.QualityprofilesService; import org.sonarqube.ws.client.regulatoryreports.RegulatoryReportsService; -import org.sonarqube.ws.client.roots.RootsService; import org.sonarqube.ws.client.rules.RulesService; import org.sonarqube.ws.client.securityreports.SecurityReportsService; import org.sonarqube.ws.client.server.ServerService; @@ -130,7 +129,6 @@ class DefaultWsClient implements WsClient { private final ProjectsService projectsService; private final QualitygatesService qualitygatesService; private final QualityprofilesService qualityprofilesService; - private final RootsService rootsService; private final RulesService rulesService; private final ServerService serverService; private final SettingsService settingsService; @@ -197,7 +195,6 @@ class DefaultWsClient implements WsClient { this.projectsService = new ProjectsService(wsConnector); this.qualitygatesService = new QualitygatesService(wsConnector); this.qualityprofilesService = new QualityprofilesService(wsConnector); - this.rootsService = new RootsService(wsConnector); this.rulesService = new RulesService(wsConnector); this.serverService = new ServerService(wsConnector); this.settingsService = new SettingsService(wsConnector); @@ -453,11 +450,6 @@ class DefaultWsClient implements WsClient { } @Override - public RootsService roots() { - return rootsService; - } - - @Override public RulesService rules() { return rulesService; } diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/WsClient.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/WsClient.java index 3a3edda8b30..60350474b84 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/WsClient.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/WsClient.java @@ -66,7 +66,6 @@ import org.sonarqube.ws.client.push.SonarLintServerPushService; import org.sonarqube.ws.client.qualitygates.QualitygatesService; import org.sonarqube.ws.client.qualityprofiles.QualityprofilesService; import org.sonarqube.ws.client.regulatoryreports.RegulatoryReportsService; -import org.sonarqube.ws.client.roots.RootsService; import org.sonarqube.ws.client.rules.RulesService; import org.sonarqube.ws.client.securityreports.SecurityReportsService; import org.sonarqube.ws.client.server.ServerService; @@ -189,8 +188,6 @@ public interface WsClient { QualityprofilesService qualityprofiles(); - RootsService roots(); - RulesService rules(); ServerService server(); diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/WsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/WsRequest.java index bf338d5a9cc..65dee5e36b2 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/WsRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/WsRequest.java @@ -19,7 +19,6 @@ */ package org.sonarqube.ws.client; -import java.util.Map; import java.util.OptionalInt; /** @@ -37,15 +36,6 @@ public interface WsRequest { OptionalInt getWriteTimeOutInMs(); - /** - * - * In case of multi value parameters, returns the first value - * - * @deprecated since 6.1. Use {@link #getParameters()} instead - */ - @Deprecated - Map<String, String> getParams(); - Parameters getParameters(); Headers getHeaders(); diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/issue/IssuesWsParameters.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/issue/IssuesWsParameters.java index 46c73bfdab5..7844a135df7 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/issue/IssuesWsParameters.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/issue/IssuesWsParameters.java @@ -93,6 +93,8 @@ public class IssuesWsParameters { public static final String PARAM_PCI_DSS_40 = "pciDss-4.0"; public static final String PARAM_OWASP_ASVS = "owaspAsvs"; public static final String PARAM_OWASP_ASVS_40 = "owaspAsvs-4.0"; + public static final String PARAM_OWASP_MOBILE_TOP_10 = "owaspMobileTop10"; + public static final String PARAM_OWASP_MOBILE_TOP_10_2024 = "owaspMobileTop10-2024"; public static final String PARAM_OWASP_TOP_10 = "owaspTop10"; public static final String PARAM_OWASP_TOP_10_2021 = "owaspTop10-2021"; public static final String PARAM_STIG_ASD_V5R3 = "stig-ASD_V5R3"; diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/roots/RootsService.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/roots/RootsService.java deleted file mode 100644 index fba80339f52..00000000000 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/roots/RootsService.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2025 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.roots; - -import jakarta.annotation.Generated; -import org.sonarqube.ws.MediaTypes; -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.Roots.SearchResponse; - -/** - * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/roots">Further information about this web service online</a> - */ -@Generated("sonar-ws-generator") -public class RootsService extends BaseService { - - public RootsService(WsConnector wsConnector) { - super(wsConnector, "api/roots"); - } - - /** - * - * This is part of the internal API. - * This is a GET request. - * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/roots/search">Further information about this action online (including a response example)</a> - * @since 6.2 - */ - public SearchResponse search() { - return call( - new GetRequest(path("search")), - SearchResponse.parser()); - } - - /** - * - * This is part of the internal API. - * This is a POST request. - * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/roots/set_root">Further information about this action online (including a response example)</a> - * @since 6.2 - */ - public void setRoot(SetRootRequest request) { - call( - new PostRequest(path("set_root")) - .setParam("login", request.getLogin()) - .setMediaType(MediaTypes.JSON) - ).content(); - } - - /** - * - * This is part of the internal API. - * This is a POST request. - * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/roots/unset_root">Further information about this action online (including a response example)</a> - * @since 6.2 - */ - public void unsetRoot(UnsetRootRequest request) { - call( - new PostRequest(path("unset_root")) - .setParam("login", request.getLogin()) - .setMediaType(MediaTypes.JSON) - ).content(); - } -} diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/roots/SetRootRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/roots/SetRootRequest.java deleted file mode 100644 index d7b7b2a74c7..00000000000 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/roots/SetRootRequest.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2025 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.roots; - -import jakarta.annotation.Generated; - -/** - * This is part of the internal API. - * This is a POST request. - * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/roots/set_root">Further information about this action online (including a response example)</a> - * @since 6.2 - */ -@Generated("sonar-ws-generator") -public class SetRootRequest { - - private String login; - - /** - * This is a mandatory parameter. - * Example value: "admin" - */ - public SetRootRequest setLogin(String login) { - this.login = login; - return this; - } - - public String getLogin() { - return login; - } -} diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/roots/UnsetRootRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/roots/UnsetRootRequest.java deleted file mode 100644 index 0d4ebef768b..00000000000 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/roots/UnsetRootRequest.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2025 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.roots; - -import jakarta.annotation.Generated; - -/** - * This is part of the internal API. - * This is a POST request. - * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/roots/unset_root">Further information about this action online (including a response example)</a> - * @since 6.2 - */ -@Generated("sonar-ws-generator") -public class UnsetRootRequest { - - private String login; - - /** - * This is a mandatory parameter. - * Example value: "admin" - */ - public UnsetRootRequest setLogin(String login) { - this.login = login; - return this; - } - - public String getLogin() { - return login; - } -} diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/roots/package-info.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/roots/package-info.java deleted file mode 100644 index c255d1eea80..00000000000 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/roots/package-info.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2025 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 -@Generated("sonar-ws-generator") -package org.sonarqube.ws.client.roots; - -import javax.annotation.ParametersAreNonnullByDefault; -import jakarta.annotation.Generated; - |