From 412f42cb112802614e541ca186d3e35006f28be9 Mon Sep 17 00:00:00 2001 From: Wojtek Wajerowicz <115081248+wojciech-wajerowicz-sonarsource@users.noreply.github.com> Date: Tue, 19 Mar 2024 14:15:49 +0100 Subject: [PATCH] SONAR-21819 Extract logic reusable between legacy and v2 endpoints. --- server/sonar-webserver-common/build.gradle | 4 +++ .../common}/component/ComponentUpdaterIT.java | 13 +++++----- .../DefaultTemplatesResolverImplIT.java | 2 +- .../permission/GroupPermissionChangerIT.java | 6 ++++- .../PermissionTemplateServiceIT.java | 4 ++- .../permission/UserPermissionChangerIT.java | 4 ++- .../almintegration}/ProjectKeyGenerator.java | 2 +- .../common/almintegration}/package-info.java | 2 +- ...DelegatingDevOpsProjectCreatorFactory.java | 2 +- .../almsettings}/DevOpsProjectCreator.java | 2 +- .../DevOpsProjectCreatorFactory.java | 2 +- .../almsettings}/DevOpsProjectDescriptor.java | 2 +- .../GithubProjectCreationParameters.java | 3 ++- .../github}/GithubProjectCreator.java | 20 +++++++------- .../github}/GithubProjectCreatorFactory.java | 13 ++++++---- .../almsettings/github/package-info.java | 23 ++++++++++++++++ .../gitlab/GitlabProjectCreator.java | 10 +++---- .../gitlab/GitlabProjectCreatorFactory.java | 12 ++++----- .../almsettings/gitlab/package-info.java | 23 ++++++++++++++++ .../common/almsettings/package-info.java | 23 ++++++++++++++++ .../ComponentCreationParameters.java | 2 +- .../common}/component/ComponentUpdater.java | 11 ++++---- .../common}/component/NewComponent.java | 2 +- .../server/common/component/package-info.java | 23 ++++++++++++++++ .../common}/newcodeperiod/CaycUtils.java | 2 +- .../NewCodeDefinitionResolver.java | 2 +- .../common/newcodeperiod/package-info.java | 23 ++++++++++++++++ .../permission/DefaultTemplatesResolver.java | 2 +- .../DefaultTemplatesResolverImpl.java | 2 +- .../GranteeTypeSpecificPermissionUpdater.java | 4 +-- .../permission/GroupPermissionChange.java | 5 ++-- .../permission/GroupPermissionChanger.java | 8 +++--- .../common}/permission/PermissionChange.java | 4 +-- .../permission/PermissionTemplateService.java | 5 ++-- .../common}/permission/PermissionUpdater.java | 2 +- .../permission/UserPermissionChange.java | 3 ++- .../permission/UserPermissionChanger.java | 4 +-- .../common/project}/ProjectCreator.java | 11 ++++---- .../server/common/project/package-info.java | 23 ++++++++++++++++ .../ProjectKeyGeneratorTest.java | 6 ++--- ...gatingDevOpsProjectCreatorFactoryTest.java | 2 +- .../GithubProjectCreatorFactoryTest.java | 15 +++++++---- .../github}/GithubProjectCreatorTest.java | 17 ++++++------ .../GitlabProjectCreatorFactoryTest.java | 4 +-- .../gitlab/GitlabProjectCreatorTest.java | 8 +++--- .../common}/newcodeperiod/CaycUtilsTest.java | 2 +- .../NewCodeDefinitionResolverTest.java | 3 +-- .../ws/azure/ImportAzureProjectActionIT.java | 10 +++---- .../ImportBitbucketCloudRepoActionIT.java | 10 +++---- .../ImportBitbucketServerProjectActionIT.java | 10 +++---- .../github/ImportGithubProjectActionIT.java | 20 +++++++------- .../gitlab/ImportGitLabProjectActionIT.java | 14 +++++----- .../ce/queue/BranchReportSubmitterIT.java | 12 ++++----- .../server/ce/queue/ReportSubmitterIT.java | 26 +++++++++---------- .../permission/ws/BasePermissionWsIT.java | 6 ++--- .../ws/template/ApplyTemplateActionIT.java | 6 ++--- .../template/BulkApplyTemplateActionIT.java | 6 ++--- .../ws/template/DeleteTemplateActionIT.java | 4 +-- .../ws/template/SearchTemplatesActionIT.java | 4 +-- .../server/project/ws/CreateActionIT.java | 12 ++++----- .../ws/azure/ImportAzureProjectAction.java | 18 ++++++------- .../ImportBitbucketCloudRepoAction.java | 18 ++++++------- .../ImportBitbucketServerProjectAction.java | 18 ++++++------- .../ws/github/ImportGithubProjectAction.java | 16 ++++++------ .../ws/gitlab/ImportGitLabProjectAction.java | 16 ++++++------ .../server/ce/queue/ReportSubmitter.java | 10 +++---- .../server/newcodeperiod/ws/SetAction.java | 2 +- .../server/newcodeperiod/ws/UnsetAction.java | 2 +- .../server/permission/ws/AddGroupAction.java | 4 +-- .../server/permission/ws/AddUserAction.java | 4 +-- .../permission/ws/RemoveGroupAction.java | 4 +-- .../permission/ws/RemoveUserAction.java | 4 +-- .../ws/template/ApplyTemplateAction.java | 2 +- .../ws/template/BulkApplyTemplateAction.java | 2 +- .../ws/template/DeleteTemplateAction.java | 4 +-- .../ws/template/SearchTemplatesAction.java | 4 +-- .../ws/template/SearchTemplatesData.java | 2 +- .../sonar/server/project/ws/CreateAction.java | 16 ++++++------ .../server/project/ws/ProjectsWsModule.java | 1 + .../server/component/NewComponentTest.java | 3 ++- .../ws/template/SearchTemplatesDataTest.java | 2 +- .../platformlevel/PlatformLevel4.java | 22 ++++++++-------- 82 files changed, 424 insertions(+), 257 deletions(-) rename server/{sonar-webserver-webapi/src/it/java/org/sonar/server => sonar-webserver-common/src/it/java/org/sonar/server/common}/component/ComponentUpdaterIT.java (98%) rename server/{sonar-webserver-webapi/src/it/java/org/sonar/server => sonar-webserver-common/src/it/java/org/sonar/server/common}/permission/DefaultTemplatesResolverImplIT.java (99%) rename server/{sonar-webserver-webapi/src/it/java/org/sonar/server => sonar-webserver-common/src/it/java/org/sonar/server/common}/permission/GroupPermissionChangerIT.java (98%) rename server/{sonar-webserver-webapi/src/it/java/org/sonar/server => sonar-webserver-common/src/it/java/org/sonar/server/common}/permission/PermissionTemplateServiceIT.java (99%) rename server/{sonar-webserver-webapi/src/it/java/org/sonar/server => sonar-webserver-common/src/it/java/org/sonar/server/common}/permission/UserPermissionChangerIT.java (99%) rename server/{sonar-webserver-webapi/src/main/java/org/sonar/server/almintegration/ws => sonar-webserver-common/src/main/java/org/sonar/server/common/almintegration}/ProjectKeyGenerator.java (98%) rename server/{sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws/gitlab => sonar-webserver-common/src/main/java/org/sonar/server/common/almintegration}/package-info.java (95%) rename server/{sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws => sonar-webserver-common/src/main/java/org/sonar/server/common/almsettings}/DelegatingDevOpsProjectCreatorFactory.java (97%) rename server/{sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws => sonar-webserver-common/src/main/java/org/sonar/server/common/almsettings}/DevOpsProjectCreator.java (96%) rename server/{sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws => sonar-webserver-common/src/main/java/org/sonar/server/common/almsettings}/DevOpsProjectCreatorFactory.java (96%) rename server/{sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws => sonar-webserver-common/src/main/java/org/sonar/server/common/almsettings}/DevOpsProjectDescriptor.java (95%) rename server/{sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws => sonar-webserver-common/src/main/java/org/sonar/server/common/almsettings/github}/GithubProjectCreationParameters.java (92%) rename server/{sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws => sonar-webserver-common/src/main/java/org/sonar/server/common/almsettings/github}/GithubProjectCreator.java (96%) rename server/{sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws => sonar-webserver-common/src/main/java/org/sonar/server/common/almsettings/github}/GithubProjectCreatorFactory.java (94%) create mode 100644 server/sonar-webserver-common/src/main/java/org/sonar/server/common/almsettings/github/package-info.java rename server/{sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws => sonar-webserver-common/src/main/java/org/sonar/server/common/almsettings}/gitlab/GitlabProjectCreator.java (95%) rename server/{sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws => sonar-webserver-common/src/main/java/org/sonar/server/common/almsettings}/gitlab/GitlabProjectCreatorFactory.java (87%) create mode 100644 server/sonar-webserver-common/src/main/java/org/sonar/server/common/almsettings/gitlab/package-info.java create mode 100644 server/sonar-webserver-common/src/main/java/org/sonar/server/common/almsettings/package-info.java rename server/{sonar-webserver-webapi/src/main/java/org/sonar/server => sonar-webserver-common/src/main/java/org/sonar/server/common}/component/ComponentCreationParameters.java (98%) rename server/{sonar-webserver-webapi/src/main/java/org/sonar/server => sonar-webserver-common/src/main/java/org/sonar/server/common}/component/ComponentUpdater.java (97%) rename server/{sonar-webserver-webapi/src/main/java/org/sonar/server => sonar-webserver-common/src/main/java/org/sonar/server/common}/component/NewComponent.java (98%) create mode 100644 server/sonar-webserver-common/src/main/java/org/sonar/server/common/component/package-info.java rename server/{sonar-webserver-webapi/src/main/java/org/sonar/server => sonar-webserver-common/src/main/java/org/sonar/server/common}/newcodeperiod/CaycUtils.java (96%) rename server/{sonar-webserver-webapi/src/main/java/org/sonar/server => sonar-webserver-common/src/main/java/org/sonar/server/common}/newcodeperiod/NewCodeDefinitionResolver.java (99%) create mode 100644 server/sonar-webserver-common/src/main/java/org/sonar/server/common/newcodeperiod/package-info.java rename server/{sonar-webserver-webapi/src/main/java/org/sonar/server => sonar-webserver-common/src/main/java/org/sonar/server/common}/permission/DefaultTemplatesResolver.java (98%) rename server/{sonar-webserver-webapi/src/main/java/org/sonar/server => sonar-webserver-common/src/main/java/org/sonar/server/common}/permission/DefaultTemplatesResolverImpl.java (98%) rename server/{sonar-webserver-webapi/src/main/java/org/sonar/server => sonar-webserver-common/src/main/java/org/sonar/server/common}/permission/GranteeTypeSpecificPermissionUpdater.java (90%) rename server/{sonar-webserver-webapi/src/main/java/org/sonar/server => sonar-webserver-common/src/main/java/org/sonar/server/common}/permission/GroupPermissionChange.java (91%) rename server/{sonar-webserver-webapi/src/main/java/org/sonar/server => sonar-webserver-common/src/main/java/org/sonar/server/common}/permission/GroupPermissionChanger.java (97%) rename server/{sonar-webserver-webapi/src/main/java/org/sonar/server => sonar-webserver-common/src/main/java/org/sonar/server/common}/permission/PermissionChange.java (96%) rename server/{sonar-webserver-webapi/src/main/java/org/sonar/server => sonar-webserver-common/src/main/java/org/sonar/server/common}/permission/PermissionTemplateService.java (98%) rename server/{sonar-webserver-webapi/src/main/java/org/sonar/server => sonar-webserver-common/src/main/java/org/sonar/server/common}/permission/PermissionUpdater.java (98%) rename server/{sonar-webserver-webapi/src/main/java/org/sonar/server => sonar-webserver-common/src/main/java/org/sonar/server/common}/permission/UserPermissionChange.java (94%) rename server/{sonar-webserver-webapi/src/main/java/org/sonar/server => sonar-webserver-common/src/main/java/org/sonar/server/common}/permission/UserPermissionChanger.java (99%) rename server/{sonar-webserver-webapi/src/main/java/org/sonar/server/project/ws => sonar-webserver-common/src/main/java/org/sonar/server/common/project}/ProjectCreator.java (89%) create mode 100644 server/sonar-webserver-common/src/main/java/org/sonar/server/common/project/package-info.java rename server/{sonar-webserver-webapi/src/test/java/org/sonar/server/almintegration/ws => sonar-webserver-common/src/test/java/org/sonar/server/common/almintegration}/ProjectKeyGeneratorTest.java (93%) rename server/{sonar-webserver-webapi/src/test/java/org/sonar/server/almsettings/ws => sonar-webserver-common/src/test/java/org/sonar/server/common/almsettings}/DelegatingDevOpsProjectCreatorFactoryTest.java (98%) rename server/{sonar-webserver-webapi/src/test/java/org/sonar/server/almsettings/ws => sonar-webserver-common/src/test/java/org/sonar/server/common/almsettings/github}/GithubProjectCreatorFactoryTest.java (95%) rename server/{sonar-webserver-webapi/src/test/java/org/sonar/server/almsettings/ws => sonar-webserver-common/src/test/java/org/sonar/server/common/almsettings/github}/GithubProjectCreatorTest.java (97%) rename server/{sonar-webserver-webapi/src/test/java/org/sonar/server/almsettings/ws => sonar-webserver-common/src/test/java/org/sonar/server/common/almsettings}/gitlab/GitlabProjectCreatorFactoryTest.java (95%) rename server/{sonar-webserver-webapi/src/test/java/org/sonar/server/almsettings/ws => sonar-webserver-common/src/test/java/org/sonar/server/common/almsettings}/gitlab/GitlabProjectCreatorTest.java (97%) rename server/{sonar-webserver-webapi/src/it/java/org/sonar/server => sonar-webserver-common/src/test/java/org/sonar/server/common}/newcodeperiod/CaycUtilsTest.java (98%) rename server/{sonar-webserver-webapi/src/it/java/org/sonar/server => sonar-webserver-common/src/test/java/org/sonar/server/common}/newcodeperiod/NewCodeDefinitionResolverTest.java (98%) diff --git a/server/sonar-webserver-common/build.gradle b/server/sonar-webserver-common/build.gradle index d12d353e29b..89ce2803657 100644 --- a/server/sonar-webserver-common/build.gradle +++ b/server/sonar-webserver-common/build.gradle @@ -26,11 +26,15 @@ dependencies { testImplementation 'org.assertj:assertj-core' testImplementation 'org.junit.jupiter:junit-jupiter-api' testImplementation 'org.mockito:mockito-core' + testImplementation 'org.mockito:mockito-junit-jupiter' testImplementation project(':sonar-testing-harness') testImplementation testFixtures(project(':server:sonar-db-dao')) testImplementation testFixtures(project(':server:sonar-server-common')) testImplementation testFixtures(project(':server:sonar-webserver-api')) + testImplementation testFixtures(project(':server:sonar-webserver-auth')) + testImplementation testFixtures(project(':server:sonar-webserver-es')) + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine' testRuntimeOnly 'org.junit.vintage:junit-vintage-engine' diff --git a/server/sonar-webserver-webapi/src/it/java/org/sonar/server/component/ComponentUpdaterIT.java b/server/sonar-webserver-common/src/it/java/org/sonar/server/common/component/ComponentUpdaterIT.java similarity index 98% rename from server/sonar-webserver-webapi/src/it/java/org/sonar/server/component/ComponentUpdaterIT.java rename to server/sonar-webserver-common/src/it/java/org/sonar/server/common/component/ComponentUpdaterIT.java index 11077edd3e4..30a70a126ef 100644 --- a/server/sonar-webserver-webapi/src/it/java/org/sonar/server/component/ComponentUpdaterIT.java +++ b/server/sonar-webserver-common/src/it/java/org/sonar/server/common/component/ComponentUpdaterIT.java @@ -17,7 +17,7 @@ * 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.component; +package org.sonar.server.common.component; import java.util.List; import java.util.Optional; @@ -41,6 +41,12 @@ import org.sonar.db.component.ResourceTypesRule; import org.sonar.db.project.CreationMethod; import org.sonar.db.project.ProjectDto; import org.sonar.db.user.UserDto; +import org.sonar.server.common.permission.GroupPermissionChanger; +import org.sonar.server.common.permission.PermissionTemplateService; +import org.sonar.server.common.permission.PermissionUpdater; +import org.sonar.server.common.permission.UserPermissionChange; +import org.sonar.server.common.permission.UserPermissionChanger; +import org.sonar.server.component.ComponentCreationData; import org.sonar.server.es.EsTester; import org.sonar.server.es.Indexers; import org.sonar.server.es.IndexersImpl; @@ -48,13 +54,8 @@ import org.sonar.server.es.TestIndexers; import org.sonar.server.exceptions.BadRequestException; import org.sonar.server.favorite.FavoriteUpdater; import org.sonar.server.l18n.I18nRule; -import org.sonar.server.permission.GroupPermissionChanger; import org.sonar.server.permission.PermissionService; import org.sonar.server.permission.PermissionServiceImpl; -import org.sonar.server.permission.PermissionTemplateService; -import org.sonar.server.permission.PermissionUpdater; -import org.sonar.server.permission.UserPermissionChange; -import org.sonar.server.permission.UserPermissionChanger; import org.sonar.server.permission.index.FooIndexDefinition; import org.sonar.server.permission.index.PermissionIndexer; import org.sonar.server.project.DefaultBranchNameResolver; diff --git a/server/sonar-webserver-webapi/src/it/java/org/sonar/server/permission/DefaultTemplatesResolverImplIT.java b/server/sonar-webserver-common/src/it/java/org/sonar/server/common/permission/DefaultTemplatesResolverImplIT.java similarity index 99% rename from server/sonar-webserver-webapi/src/it/java/org/sonar/server/permission/DefaultTemplatesResolverImplIT.java rename to server/sonar-webserver-common/src/it/java/org/sonar/server/common/permission/DefaultTemplatesResolverImplIT.java index 337e3630ca7..2a3716ab1af 100644 --- a/server/sonar-webserver-webapi/src/it/java/org/sonar/server/permission/DefaultTemplatesResolverImplIT.java +++ b/server/sonar-webserver-common/src/it/java/org/sonar/server/common/permission/DefaultTemplatesResolverImplIT.java @@ -17,7 +17,7 @@ * 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.permission; +package org.sonar.server.common.permission; import org.junit.Rule; import org.junit.Test; diff --git a/server/sonar-webserver-webapi/src/it/java/org/sonar/server/permission/GroupPermissionChangerIT.java b/server/sonar-webserver-common/src/it/java/org/sonar/server/common/permission/GroupPermissionChangerIT.java similarity index 98% rename from server/sonar-webserver-webapi/src/it/java/org/sonar/server/permission/GroupPermissionChangerIT.java rename to server/sonar-webserver-common/src/it/java/org/sonar/server/common/permission/GroupPermissionChangerIT.java index 10c8f1a57de..03e760bea6b 100644 --- a/server/sonar-webserver-webapi/src/it/java/org/sonar/server/permission/GroupPermissionChangerIT.java +++ b/server/sonar-webserver-common/src/it/java/org/sonar/server/common/permission/GroupPermissionChangerIT.java @@ -17,7 +17,7 @@ * 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.permission; +package org.sonar.server.common.permission; import java.util.Set; import org.apache.commons.lang3.StringUtils; @@ -38,8 +38,12 @@ import org.sonar.db.permission.GroupPermissionDto; import org.sonar.db.project.ProjectDto; import org.sonar.db.user.GroupDto; import org.sonar.db.user.UserDto; +import org.sonar.server.common.permission.GroupPermissionChange; +import org.sonar.server.common.permission.GroupPermissionChanger; import org.sonar.server.common.permission.Operation; import org.sonar.server.exceptions.BadRequestException; +import org.sonar.server.permission.PermissionService; +import org.sonar.server.permission.PermissionServiceImpl; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; diff --git a/server/sonar-webserver-webapi/src/it/java/org/sonar/server/permission/PermissionTemplateServiceIT.java b/server/sonar-webserver-common/src/it/java/org/sonar/server/common/permission/PermissionTemplateServiceIT.java similarity index 99% rename from server/sonar-webserver-webapi/src/it/java/org/sonar/server/permission/PermissionTemplateServiceIT.java rename to server/sonar-webserver-common/src/it/java/org/sonar/server/common/permission/PermissionTemplateServiceIT.java index e0b83440ce6..d7095c13bcd 100644 --- a/server/sonar-webserver-webapi/src/it/java/org/sonar/server/permission/PermissionTemplateServiceIT.java +++ b/server/sonar-webserver-common/src/it/java/org/sonar/server/common/permission/PermissionTemplateServiceIT.java @@ -17,7 +17,7 @@ * 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.permission; +package org.sonar.server.common.permission; import java.util.List; import java.util.stream.Collectors; @@ -40,6 +40,8 @@ import org.sonar.db.user.UserDto; import org.sonar.server.es.Indexers; import org.sonar.server.es.TestIndexers; import org.sonar.server.exceptions.TemplateMatchingKeyException; +import org.sonar.server.permission.PermissionService; +import org.sonar.server.permission.PermissionServiceImpl; import org.sonar.server.tester.UserSessionRule; import static java.util.Collections.singletonList; diff --git a/server/sonar-webserver-webapi/src/it/java/org/sonar/server/permission/UserPermissionChangerIT.java b/server/sonar-webserver-common/src/it/java/org/sonar/server/common/permission/UserPermissionChangerIT.java similarity index 99% rename from server/sonar-webserver-webapi/src/it/java/org/sonar/server/permission/UserPermissionChangerIT.java rename to server/sonar-webserver-common/src/it/java/org/sonar/server/common/permission/UserPermissionChangerIT.java index f98ff2ae425..479a28e81d4 100644 --- a/server/sonar-webserver-webapi/src/it/java/org/sonar/server/permission/UserPermissionChangerIT.java +++ b/server/sonar-webserver-common/src/it/java/org/sonar/server/common/permission/UserPermissionChangerIT.java @@ -17,7 +17,7 @@ * 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.permission; +package org.sonar.server.common.permission; import java.util.Set; import org.apache.commons.lang3.StringUtils; @@ -38,6 +38,8 @@ import org.sonar.db.user.GroupDto; import org.sonar.db.user.UserDto; import org.sonar.db.user.UserIdDto; import org.sonar.server.exceptions.BadRequestException; +import org.sonar.server.permission.PermissionService; +import org.sonar.server.permission.PermissionServiceImpl; import static java.util.stream.Collectors.toSet; import static org.assertj.core.api.Assertions.assertThat; diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/almintegration/ws/ProjectKeyGenerator.java b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/almintegration/ProjectKeyGenerator.java similarity index 98% rename from server/sonar-webserver-webapi/src/main/java/org/sonar/server/almintegration/ws/ProjectKeyGenerator.java rename to server/sonar-webserver-common/src/main/java/org/sonar/server/common/almintegration/ProjectKeyGenerator.java index 4a84afdc9f4..cf5a04a2c8e 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/almintegration/ws/ProjectKeyGenerator.java +++ b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/almintegration/ProjectKeyGenerator.java @@ -17,7 +17,7 @@ * 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.almintegration.ws; +package org.sonar.server.common.almintegration; import com.google.common.annotations.VisibleForTesting; import java.util.List; diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws/gitlab/package-info.java b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/almintegration/package-info.java similarity index 95% rename from server/sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws/gitlab/package-info.java rename to server/sonar-webserver-common/src/main/java/org/sonar/server/common/almintegration/package-info.java index 86fc9b5867f..6cfcd9bc704 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws/gitlab/package-info.java +++ b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/almintegration/package-info.java @@ -18,6 +18,6 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ @ParametersAreNonnullByDefault -package org.sonar.server.almsettings.ws.gitlab; +package org.sonar.server.common.almintegration; import javax.annotation.ParametersAreNonnullByDefault; diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws/DelegatingDevOpsProjectCreatorFactory.java b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/almsettings/DelegatingDevOpsProjectCreatorFactory.java similarity index 97% rename from server/sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws/DelegatingDevOpsProjectCreatorFactory.java rename to server/sonar-webserver-common/src/main/java/org/sonar/server/common/almsettings/DelegatingDevOpsProjectCreatorFactory.java index 1adf4d6c5d8..dc0660d97cf 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws/DelegatingDevOpsProjectCreatorFactory.java +++ b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/almsettings/DelegatingDevOpsProjectCreatorFactory.java @@ -17,7 +17,7 @@ * 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.almsettings.ws; +package org.sonar.server.common.almsettings; import java.util.Map; import java.util.Optional; diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws/DevOpsProjectCreator.java b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/almsettings/DevOpsProjectCreator.java similarity index 96% rename from server/sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws/DevOpsProjectCreator.java rename to server/sonar-webserver-common/src/main/java/org/sonar/server/common/almsettings/DevOpsProjectCreator.java index 3c18b3acaf2..86225fa1ac8 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws/DevOpsProjectCreator.java +++ b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/almsettings/DevOpsProjectCreator.java @@ -17,7 +17,7 @@ * 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.almsettings.ws; +package org.sonar.server.common.almsettings; import javax.annotation.Nullable; import org.sonar.db.DbSession; diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws/DevOpsProjectCreatorFactory.java b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/almsettings/DevOpsProjectCreatorFactory.java similarity index 96% rename from server/sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws/DevOpsProjectCreatorFactory.java rename to server/sonar-webserver-common/src/main/java/org/sonar/server/common/almsettings/DevOpsProjectCreatorFactory.java index f409d2d239b..55835f45c23 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws/DevOpsProjectCreatorFactory.java +++ b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/almsettings/DevOpsProjectCreatorFactory.java @@ -17,7 +17,7 @@ * 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.almsettings.ws; +package org.sonar.server.common.almsettings; import java.util.Map; import java.util.Optional; diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws/DevOpsProjectDescriptor.java b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/almsettings/DevOpsProjectDescriptor.java similarity index 95% rename from server/sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws/DevOpsProjectDescriptor.java rename to server/sonar-webserver-common/src/main/java/org/sonar/server/common/almsettings/DevOpsProjectDescriptor.java index e7df4243e96..4459ccbbf09 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws/DevOpsProjectDescriptor.java +++ b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/almsettings/DevOpsProjectDescriptor.java @@ -17,7 +17,7 @@ * 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.almsettings.ws; +package org.sonar.server.common.almsettings; import org.sonar.db.alm.setting.ALM; diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws/GithubProjectCreationParameters.java b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/almsettings/github/GithubProjectCreationParameters.java similarity index 92% rename from server/sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws/GithubProjectCreationParameters.java rename to server/sonar-webserver-common/src/main/java/org/sonar/server/common/almsettings/github/GithubProjectCreationParameters.java index dd4d19100bf..72b2ca87602 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws/GithubProjectCreationParameters.java +++ b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/almsettings/github/GithubProjectCreationParameters.java @@ -17,12 +17,13 @@ * 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.almsettings.ws; +package org.sonar.server.common.almsettings.github; import javax.annotation.Nullable; import org.sonar.auth.github.AppInstallationToken; import org.sonar.auth.github.security.AccessToken; import org.sonar.db.alm.setting.AlmSettingDto; +import org.sonar.server.common.almsettings.DevOpsProjectDescriptor; import org.sonar.server.user.UserSession; public record GithubProjectCreationParameters(DevOpsProjectDescriptor devOpsProjectDescriptor, AlmSettingDto almSettingDto, UserSession userSession, diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws/GithubProjectCreator.java b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/almsettings/github/GithubProjectCreator.java similarity index 96% rename from server/sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws/GithubProjectCreator.java rename to server/sonar-webserver-common/src/main/java/org/sonar/server/common/almsettings/github/GithubProjectCreator.java index 8b1ca0d25e1..47902dd9c98 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws/GithubProjectCreator.java +++ b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/almsettings/github/GithubProjectCreator.java @@ -17,22 +17,22 @@ * 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.almsettings.ws; +package org.sonar.server.common.almsettings.github; import java.util.Optional; import java.util.Set; import javax.annotation.CheckForNull; import javax.annotation.Nullable; +import org.sonar.alm.client.github.GithubPermissionConverter; +import org.sonar.api.web.UserRole; import org.sonar.auth.github.AppInstallationToken; import org.sonar.auth.github.GitHubSettings; -import org.sonar.auth.github.client.GithubApplicationClient; -import org.sonar.alm.client.github.GithubPermissionConverter; import org.sonar.auth.github.GsonRepositoryCollaborator; +import org.sonar.auth.github.GsonRepositoryPermissions; import org.sonar.auth.github.GsonRepositoryTeam; +import org.sonar.auth.github.client.GithubApplicationClient; import org.sonar.auth.github.client.GithubApplicationClient.Repository; import org.sonar.auth.github.security.AccessToken; -import org.sonar.api.web.UserRole; -import org.sonar.auth.github.GsonRepositoryPermissions; import org.sonar.db.DbClient; import org.sonar.db.DbSession; import org.sonar.db.alm.setting.AlmSettingDto; @@ -43,14 +43,16 @@ import org.sonar.db.project.ProjectDto; import org.sonar.db.provisioning.GithubPermissionsMappingDto; import org.sonar.db.user.GroupDto; import org.sonar.db.user.UserIdDto; -import org.sonar.server.almintegration.ws.ProjectKeyGenerator; +import org.sonar.server.common.almintegration.ProjectKeyGenerator; +import org.sonar.server.common.almsettings.DevOpsProjectCreator; +import org.sonar.server.common.almsettings.DevOpsProjectDescriptor; import org.sonar.server.common.permission.Operation; +import org.sonar.server.common.permission.PermissionUpdater; +import org.sonar.server.common.permission.UserPermissionChange; +import org.sonar.server.common.project.ProjectCreator; import org.sonar.server.component.ComponentCreationData; import org.sonar.server.management.ManagedProjectService; import org.sonar.server.permission.PermissionService; -import org.sonar.server.permission.PermissionUpdater; -import org.sonar.server.permission.UserPermissionChange; -import org.sonar.server.project.ws.ProjectCreator; import org.sonar.server.user.UserSession; import static java.util.Objects.requireNonNull; diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws/GithubProjectCreatorFactory.java b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/almsettings/github/GithubProjectCreatorFactory.java similarity index 94% rename from server/sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws/GithubProjectCreatorFactory.java rename to server/sonar-webserver-common/src/main/java/org/sonar/server/common/almsettings/github/GithubProjectCreatorFactory.java index 935a8b1d85f..2a1821c2165 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws/GithubProjectCreatorFactory.java +++ b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/almsettings/github/GithubProjectCreatorFactory.java @@ -17,7 +17,7 @@ * 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.almsettings.ws; +package org.sonar.server.common.almsettings.github; import java.util.Map; import java.util.Optional; @@ -37,13 +37,16 @@ import org.sonar.db.DbSession; import org.sonar.db.alm.pat.AlmPatDto; import org.sonar.db.alm.setting.ALM; import org.sonar.db.alm.setting.AlmSettingDto; -import org.sonar.server.almintegration.ws.ProjectKeyGenerator; +import org.sonar.server.common.almintegration.ProjectKeyGenerator; +import org.sonar.server.common.almsettings.DevOpsProjectCreator; +import org.sonar.server.common.almsettings.DevOpsProjectCreatorFactory; +import org.sonar.server.common.almsettings.DevOpsProjectDescriptor; +import org.sonar.server.common.permission.PermissionUpdater; +import org.sonar.server.common.permission.UserPermissionChange; +import org.sonar.server.common.project.ProjectCreator; import org.sonar.server.exceptions.BadConfigurationException; import org.sonar.server.management.ManagedProjectService; import org.sonar.server.permission.PermissionService; -import org.sonar.server.permission.PermissionUpdater; -import org.sonar.server.permission.UserPermissionChange; -import org.sonar.server.project.ws.ProjectCreator; import org.sonar.server.user.UserSession; import static java.lang.String.format; diff --git a/server/sonar-webserver-common/src/main/java/org/sonar/server/common/almsettings/github/package-info.java b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/almsettings/github/package-info.java new file mode 100644 index 00000000000..651c6710b55 --- /dev/null +++ b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/almsettings/github/package-info.java @@ -0,0 +1,23 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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.sonar.server.common.almsettings.github; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws/gitlab/GitlabProjectCreator.java b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/almsettings/gitlab/GitlabProjectCreator.java similarity index 95% rename from server/sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws/gitlab/GitlabProjectCreator.java rename to server/sonar-webserver-common/src/main/java/org/sonar/server/common/almsettings/gitlab/GitlabProjectCreator.java index ccf025af59c..2c530a0fc89 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws/gitlab/GitlabProjectCreator.java +++ b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/almsettings/gitlab/GitlabProjectCreator.java @@ -17,7 +17,7 @@ * 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.almsettings.ws.gitlab; +package org.sonar.server.common.almsettings.gitlab; import java.util.Optional; import org.jetbrains.annotations.Nullable; @@ -32,11 +32,11 @@ import org.sonar.db.alm.setting.AlmSettingDto; import org.sonar.db.alm.setting.ProjectAlmSettingDto; import org.sonar.db.project.CreationMethod; import org.sonar.db.project.ProjectDto; -import org.sonar.server.almintegration.ws.ProjectKeyGenerator; -import org.sonar.server.almsettings.ws.DevOpsProjectCreator; -import org.sonar.server.almsettings.ws.DevOpsProjectDescriptor; +import org.sonar.server.common.almintegration.ProjectKeyGenerator; +import org.sonar.server.common.almsettings.DevOpsProjectCreator; +import org.sonar.server.common.almsettings.DevOpsProjectDescriptor; +import org.sonar.server.common.project.ProjectCreator; import org.sonar.server.component.ComponentCreationData; -import org.sonar.server.project.ws.ProjectCreator; import org.sonar.server.user.UserSession; import static java.lang.String.format; diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws/gitlab/GitlabProjectCreatorFactory.java b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/almsettings/gitlab/GitlabProjectCreatorFactory.java similarity index 87% rename from server/sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws/gitlab/GitlabProjectCreatorFactory.java rename to server/sonar-webserver-common/src/main/java/org/sonar/server/common/almsettings/gitlab/GitlabProjectCreatorFactory.java index 1e32d828a9a..19176e8c41a 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws/gitlab/GitlabProjectCreatorFactory.java +++ b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/almsettings/gitlab/GitlabProjectCreatorFactory.java @@ -17,7 +17,7 @@ * 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.almsettings.ws.gitlab; +package org.sonar.server.common.almsettings.gitlab; import java.util.Map; import java.util.Optional; @@ -26,11 +26,11 @@ import org.sonar.db.DbClient; import org.sonar.db.DbSession; import org.sonar.db.alm.setting.ALM; import org.sonar.db.alm.setting.AlmSettingDto; -import org.sonar.server.almintegration.ws.ProjectKeyGenerator; -import org.sonar.server.almsettings.ws.DevOpsProjectCreator; -import org.sonar.server.almsettings.ws.DevOpsProjectCreatorFactory; -import org.sonar.server.almsettings.ws.DevOpsProjectDescriptor; -import org.sonar.server.project.ws.ProjectCreator; +import org.sonar.server.common.almintegration.ProjectKeyGenerator; +import org.sonar.server.common.almsettings.DevOpsProjectCreator; +import org.sonar.server.common.almsettings.DevOpsProjectCreatorFactory; +import org.sonar.server.common.almsettings.DevOpsProjectDescriptor; +import org.sonar.server.common.project.ProjectCreator; import org.sonar.server.user.UserSession; public class GitlabProjectCreatorFactory implements DevOpsProjectCreatorFactory { diff --git a/server/sonar-webserver-common/src/main/java/org/sonar/server/common/almsettings/gitlab/package-info.java b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/almsettings/gitlab/package-info.java new file mode 100644 index 00000000000..f5cc5a1abc8 --- /dev/null +++ b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/almsettings/gitlab/package-info.java @@ -0,0 +1,23 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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.sonar.server.common.almsettings.gitlab; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/server/sonar-webserver-common/src/main/java/org/sonar/server/common/almsettings/package-info.java b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/almsettings/package-info.java new file mode 100644 index 00000000000..2883960112a --- /dev/null +++ b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/almsettings/package-info.java @@ -0,0 +1,23 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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.sonar.server.common.almsettings; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/component/ComponentCreationParameters.java b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/component/ComponentCreationParameters.java similarity index 98% rename from server/sonar-webserver-webapi/src/main/java/org/sonar/server/component/ComponentCreationParameters.java rename to server/sonar-webserver-common/src/main/java/org/sonar/server/common/component/ComponentCreationParameters.java index 84879ca80eb..4ba5d2c8431 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/component/ComponentCreationParameters.java +++ b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/component/ComponentCreationParameters.java @@ -17,7 +17,7 @@ * 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.component; +package org.sonar.server.common.component; import javax.annotation.Nullable; import org.sonar.db.project.CreationMethod; diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/component/ComponentUpdater.java b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/component/ComponentUpdater.java similarity index 97% rename from server/sonar-webserver-webapi/src/main/java/org/sonar/server/component/ComponentUpdater.java rename to server/sonar-webserver-common/src/main/java/org/sonar/server/common/component/ComponentUpdater.java index 18ede19a08f..e42e77a33e1 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/component/ComponentUpdater.java +++ b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/component/ComponentUpdater.java @@ -17,7 +17,7 @@ * 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.component; +package org.sonar.server.common.component; import java.util.Date; import java.util.List; @@ -41,13 +41,14 @@ import org.sonar.db.portfolio.PortfolioDto.SelectionMode; import org.sonar.db.project.CreationMethod; import org.sonar.db.project.ProjectDto; import org.sonar.db.user.UserDto; +import org.sonar.server.common.permission.Operation; +import org.sonar.server.common.permission.PermissionTemplateService; +import org.sonar.server.common.permission.PermissionUpdater; +import org.sonar.server.common.permission.UserPermissionChange; +import org.sonar.server.component.ComponentCreationData; import org.sonar.server.es.Indexers; import org.sonar.server.favorite.FavoriteUpdater; -import org.sonar.server.common.permission.Operation; import org.sonar.server.permission.PermissionService; -import org.sonar.server.permission.PermissionTemplateService; -import org.sonar.server.permission.PermissionUpdater; -import org.sonar.server.permission.UserPermissionChange; import org.sonar.server.project.DefaultBranchNameResolver; import static com.google.common.base.Preconditions.checkState; diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/component/NewComponent.java b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/component/NewComponent.java similarity index 98% rename from server/sonar-webserver-webapi/src/main/java/org/sonar/server/component/NewComponent.java rename to server/sonar-webserver-common/src/main/java/org/sonar/server/common/component/NewComponent.java index 3429bb5b953..8167bdae6ab 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/component/NewComponent.java +++ b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/component/NewComponent.java @@ -17,7 +17,7 @@ * 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.component; +package org.sonar.server.common.component; import javax.annotation.CheckForNull; import javax.annotation.Nullable; diff --git a/server/sonar-webserver-common/src/main/java/org/sonar/server/common/component/package-info.java b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/component/package-info.java new file mode 100644 index 00000000000..51d90d85a8c --- /dev/null +++ b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/component/package-info.java @@ -0,0 +1,23 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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.sonar.server.common.component; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/newcodeperiod/CaycUtils.java b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/newcodeperiod/CaycUtils.java similarity index 96% rename from server/sonar-webserver-webapi/src/main/java/org/sonar/server/newcodeperiod/CaycUtils.java rename to server/sonar-webserver-common/src/main/java/org/sonar/server/common/newcodeperiod/CaycUtils.java index f2ef6a38f83..b206539df16 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/newcodeperiod/CaycUtils.java +++ b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/newcodeperiod/CaycUtils.java @@ -17,7 +17,7 @@ * 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.newcodeperiod; +package org.sonar.server.common.newcodeperiod; import org.sonar.db.newcodeperiod.NewCodePeriodType; diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/newcodeperiod/NewCodeDefinitionResolver.java b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/newcodeperiod/NewCodeDefinitionResolver.java similarity index 99% rename from server/sonar-webserver-webapi/src/main/java/org/sonar/server/newcodeperiod/NewCodeDefinitionResolver.java rename to server/sonar-webserver-common/src/main/java/org/sonar/server/common/newcodeperiod/NewCodeDefinitionResolver.java index 12491a1b0a4..8956831e8cf 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/newcodeperiod/NewCodeDefinitionResolver.java +++ b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/newcodeperiod/NewCodeDefinitionResolver.java @@ -17,7 +17,7 @@ * 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.newcodeperiod; +package org.sonar.server.common.newcodeperiod; import com.google.common.base.Preconditions; import java.util.EnumSet; diff --git a/server/sonar-webserver-common/src/main/java/org/sonar/server/common/newcodeperiod/package-info.java b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/newcodeperiod/package-info.java new file mode 100644 index 00000000000..47a06a53a29 --- /dev/null +++ b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/newcodeperiod/package-info.java @@ -0,0 +1,23 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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.sonar.server.common.newcodeperiod; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/DefaultTemplatesResolver.java b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/permission/DefaultTemplatesResolver.java similarity index 98% rename from server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/DefaultTemplatesResolver.java rename to server/sonar-webserver-common/src/main/java/org/sonar/server/common/permission/DefaultTemplatesResolver.java index 016134781c4..471d49723bf 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/DefaultTemplatesResolver.java +++ b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/permission/DefaultTemplatesResolver.java @@ -17,7 +17,7 @@ * 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.permission; +package org.sonar.server.common.permission; import java.util.Optional; import javax.annotation.Nullable; diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/DefaultTemplatesResolverImpl.java b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/permission/DefaultTemplatesResolverImpl.java similarity index 98% rename from server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/DefaultTemplatesResolverImpl.java rename to server/sonar-webserver-common/src/main/java/org/sonar/server/common/permission/DefaultTemplatesResolverImpl.java index d1c62f96925..ec32b6d3cf6 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/DefaultTemplatesResolverImpl.java +++ b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/permission/DefaultTemplatesResolverImpl.java @@ -17,7 +17,7 @@ * 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.permission; +package org.sonar.server.common.permission; import org.sonar.api.resources.Qualifiers; import org.sonar.api.resources.ResourceType; diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/GranteeTypeSpecificPermissionUpdater.java b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/permission/GranteeTypeSpecificPermissionUpdater.java similarity index 90% rename from server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/GranteeTypeSpecificPermissionUpdater.java rename to server/sonar-webserver-common/src/main/java/org/sonar/server/common/permission/GranteeTypeSpecificPermissionUpdater.java index 7965a5a4252..76a7602a91d 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/GranteeTypeSpecificPermissionUpdater.java +++ b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/permission/GranteeTypeSpecificPermissionUpdater.java @@ -17,13 +17,13 @@ * 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.permission; +package org.sonar.server.common.permission; import java.util.Set; import javax.annotation.Nullable; import org.sonar.db.DbSession; -interface GranteeTypeSpecificPermissionUpdater { +public interface GranteeTypeSpecificPermissionUpdater { Class getHandledClass(); Set loadExistingEntityPermissions(DbSession dbSession, String uuidOfGrantee, @Nullable String entityUuid); diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/GroupPermissionChange.java b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/permission/GroupPermissionChange.java similarity index 91% rename from server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/GroupPermissionChange.java rename to server/sonar-webserver-common/src/main/java/org/sonar/server/common/permission/GroupPermissionChange.java index 18b92113a20..cb655361bdf 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/GroupPermissionChange.java +++ b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/permission/GroupPermissionChange.java @@ -17,13 +17,14 @@ * 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.permission; +package org.sonar.server.common.permission; import java.util.Optional; import javax.annotation.Nullable; import org.sonar.db.entity.EntityDto; import org.sonar.db.user.GroupDto; -import org.sonar.server.common.permission.Operation; +import org.sonar.server.permission.GroupUuidOrAnyone; +import org.sonar.server.permission.PermissionService; public class GroupPermissionChange extends PermissionChange { diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/GroupPermissionChanger.java b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/permission/GroupPermissionChanger.java similarity index 97% rename from server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/GroupPermissionChanger.java rename to server/sonar-webserver-common/src/main/java/org/sonar/server/common/permission/GroupPermissionChanger.java index 004b6c0d364..23c893ef1ae 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/GroupPermissionChanger.java +++ b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/permission/GroupPermissionChanger.java @@ -17,7 +17,7 @@ * 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.permission; +package org.sonar.server.common.permission; import java.util.HashSet; import java.util.Set; @@ -29,12 +29,14 @@ import org.sonar.db.DbSession; import org.sonar.db.entity.EntityDto; import org.sonar.db.permission.GlobalPermission; import org.sonar.db.permission.GroupPermissionDto; +import org.sonar.server.exceptions.BadRequestException; +import org.sonar.server.permission.GroupUuidOrAnyone; import static com.google.common.base.Preconditions.checkNotNull; import static java.lang.String.format; -import static org.sonar.server.exceptions.BadRequestException.checkRequest; import static org.sonar.server.common.permission.Operation.ADD; import static org.sonar.server.common.permission.Operation.REMOVE; +import static org.sonar.server.exceptions.BadRequestException.checkRequest; public class GroupPermissionChanger implements GranteeTypeSpecificPermissionUpdater { @@ -112,7 +114,7 @@ public class GroupPermissionChanger implements GranteeTypeSpecificPermissionUpda checkRequest( !isAttemptToAddPermissionToAnyoneOnPrivateComponent(change, project), "No permission can be granted to Anyone on a private component"); - checkRequest( + BadRequestException.checkRequest( !isAttemptToRemovePublicPermissionFromPublicComponent(change, project), "Permission %s can't be removed from a public component", change.getPermission()); } diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/PermissionChange.java b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/permission/PermissionChange.java similarity index 96% rename from server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/PermissionChange.java rename to server/sonar-webserver-common/src/main/java/org/sonar/server/common/permission/PermissionChange.java index 1e96e721fcc..30173c3def7 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/PermissionChange.java +++ b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/permission/PermissionChange.java @@ -17,13 +17,13 @@ * 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.permission; +package org.sonar.server.common.permission; import javax.annotation.CheckForNull; import javax.annotation.Nullable; import org.sonar.db.entity.EntityDto; import org.sonar.db.permission.GlobalPermission; -import org.sonar.server.common.permission.Operation; +import org.sonar.server.permission.PermissionService; import static java.util.Objects.requireNonNull; import static org.sonar.server.exceptions.BadRequestException.checkRequest; diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/PermissionTemplateService.java b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/permission/PermissionTemplateService.java similarity index 98% rename from server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/PermissionTemplateService.java rename to server/sonar-webserver-common/src/main/java/org/sonar/server/common/permission/PermissionTemplateService.java index 2b2bd606ada..3857d0c3f9c 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/PermissionTemplateService.java +++ b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/permission/PermissionTemplateService.java @@ -17,7 +17,7 @@ * 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.permission; +package org.sonar.server.common.permission; import java.text.MessageFormat; import java.util.ArrayList; @@ -47,7 +47,6 @@ import org.sonar.db.user.UserDto; import org.sonar.db.user.UserId; import org.sonar.server.es.Indexers; import org.sonar.server.exceptions.TemplateMatchingKeyException; -import org.sonar.server.permission.DefaultTemplatesResolver.ResolvedDefaultTemplates; import org.sonar.server.user.UserSession; import static com.google.common.base.Preconditions.checkArgument; @@ -207,7 +206,7 @@ public class PermissionTemplateService { } String qualifier = entityDto.getQualifier(); - ResolvedDefaultTemplates resolvedDefaultTemplates = defaultTemplatesResolver.resolve(dbSession); + DefaultTemplatesResolver.ResolvedDefaultTemplates resolvedDefaultTemplates = defaultTemplatesResolver.resolve(dbSession); switch (qualifier) { case Qualifiers.PROJECT: return dbClient.permissionTemplateDao().selectByUuid(dbSession, resolvedDefaultTemplates.getProject()); diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/PermissionUpdater.java b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/permission/PermissionUpdater.java similarity index 98% rename from server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/PermissionUpdater.java rename to server/sonar-webserver-common/src/main/java/org/sonar/server/common/permission/PermissionUpdater.java index db9e77e52a2..e2beb971b46 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/PermissionUpdater.java +++ b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/permission/PermissionUpdater.java @@ -17,7 +17,7 @@ * 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.permission; +package org.sonar.server.common.permission; import java.util.ArrayList; import java.util.Collection; diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/UserPermissionChange.java b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/permission/UserPermissionChange.java similarity index 94% rename from server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/UserPermissionChange.java rename to server/sonar-webserver-common/src/main/java/org/sonar/server/common/permission/UserPermissionChange.java index 013edc61c69..acb5c260065 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/UserPermissionChange.java +++ b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/permission/UserPermissionChange.java @@ -17,12 +17,13 @@ * 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.permission; +package org.sonar.server.common.permission; import javax.annotation.Nullable; import org.sonar.db.entity.EntityDto; import org.sonar.db.user.UserId; import org.sonar.server.common.permission.Operation; +import org.sonar.server.permission.PermissionService; import static java.util.Objects.requireNonNull; diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/UserPermissionChanger.java b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/permission/UserPermissionChanger.java similarity index 99% rename from server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/UserPermissionChanger.java rename to server/sonar-webserver-common/src/main/java/org/sonar/server/common/permission/UserPermissionChanger.java index 0df91b7dd71..3874f7b1f48 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/UserPermissionChanger.java +++ b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/permission/UserPermissionChanger.java @@ -17,7 +17,7 @@ * 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.permission; +package org.sonar.server.common.permission; import java.util.HashSet; import java.util.Set; @@ -30,9 +30,9 @@ import org.sonar.db.entity.EntityDto; import org.sonar.db.permission.GlobalPermission; import org.sonar.db.permission.UserPermissionDto; -import static org.sonar.server.exceptions.BadRequestException.checkRequest; import static org.sonar.server.common.permission.Operation.ADD; import static org.sonar.server.common.permission.Operation.REMOVE; +import static org.sonar.server.exceptions.BadRequestException.checkRequest; /** * Adds and removes user permissions. Both global and project scopes are supported. diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/project/ws/ProjectCreator.java b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/project/ProjectCreator.java similarity index 89% rename from server/sonar-webserver-webapi/src/main/java/org/sonar/server/project/ws/ProjectCreator.java rename to server/sonar-webserver-common/src/main/java/org/sonar/server/common/project/ProjectCreator.java index 219ed696dab..22cf07233f4 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/project/ws/ProjectCreator.java +++ b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/project/ProjectCreator.java @@ -17,21 +17,20 @@ * 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.project.ws; +package org.sonar.server.common.project; import javax.annotation.Nullable; import org.sonar.api.server.ServerSide; import org.sonar.db.DbSession; import org.sonar.db.project.CreationMethod; +import org.sonar.server.common.component.ComponentCreationParameters; +import org.sonar.server.common.component.ComponentUpdater; +import org.sonar.server.common.component.NewComponent; import org.sonar.server.component.ComponentCreationData; -import org.sonar.server.component.ComponentCreationParameters; -import org.sonar.server.component.ComponentUpdater; -import org.sonar.server.component.NewComponent; import org.sonar.server.project.ProjectDefaultVisibility; import org.sonar.server.user.UserSession; import static org.sonar.api.resources.Qualifiers.PROJECT; -import static org.sonar.server.component.NewComponent.newComponentBuilder; @ServerSide public class ProjectCreator { @@ -49,7 +48,7 @@ public class ProjectCreator { public ComponentCreationData createProject(DbSession dbSession, String projectKey, String projectName, @Nullable String mainBranchName, CreationMethod creationMethod, @Nullable Boolean isPrivate, boolean isManaged) { boolean visibility = isPrivate != null ? isPrivate : projectDefaultVisibility.get(dbSession).isPrivate(); - NewComponent projectComponent = newComponentBuilder() + NewComponent projectComponent = NewComponent.newComponentBuilder() .setKey(projectKey) .setName(projectName) .setPrivate(visibility) diff --git a/server/sonar-webserver-common/src/main/java/org/sonar/server/common/project/package-info.java b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/project/package-info.java new file mode 100644 index 00000000000..174ee7fd7cb --- /dev/null +++ b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/project/package-info.java @@ -0,0 +1,23 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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.sonar.server.common.project; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/server/sonar-webserver-webapi/src/test/java/org/sonar/server/almintegration/ws/ProjectKeyGeneratorTest.java b/server/sonar-webserver-common/src/test/java/org/sonar/server/common/almintegration/ProjectKeyGeneratorTest.java similarity index 93% rename from server/sonar-webserver-webapi/src/test/java/org/sonar/server/almintegration/ws/ProjectKeyGeneratorTest.java rename to server/sonar-webserver-common/src/test/java/org/sonar/server/common/almintegration/ProjectKeyGeneratorTest.java index 576c9250391..3751d757bda 100644 --- a/server/sonar-webserver-webapi/src/test/java/org/sonar/server/almintegration/ws/ProjectKeyGeneratorTest.java +++ b/server/sonar-webserver-common/src/test/java/org/sonar/server/common/almintegration/ProjectKeyGeneratorTest.java @@ -17,7 +17,7 @@ * 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.almintegration.ws; +package org.sonar.server.common.almintegration; import org.apache.commons.lang3.RandomStringUtils; import org.junit.Before; @@ -30,8 +30,8 @@ import org.sonar.core.util.UuidFactory; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.when; -import static org.sonar.server.almintegration.ws.ProjectKeyGenerator.MAX_PROJECT_KEY_SIZE; -import static org.sonar.server.almintegration.ws.ProjectKeyGenerator.PROJECT_KEY_SEPARATOR; +import static org.sonar.server.common.almintegration.ProjectKeyGenerator.MAX_PROJECT_KEY_SIZE; +import static org.sonar.server.common.almintegration.ProjectKeyGenerator.PROJECT_KEY_SEPARATOR; @RunWith(MockitoJUnitRunner.class) public class ProjectKeyGeneratorTest { diff --git a/server/sonar-webserver-webapi/src/test/java/org/sonar/server/almsettings/ws/DelegatingDevOpsProjectCreatorFactoryTest.java b/server/sonar-webserver-common/src/test/java/org/sonar/server/common/almsettings/DelegatingDevOpsProjectCreatorFactoryTest.java similarity index 98% rename from server/sonar-webserver-webapi/src/test/java/org/sonar/server/almsettings/ws/DelegatingDevOpsProjectCreatorFactoryTest.java rename to server/sonar-webserver-common/src/test/java/org/sonar/server/common/almsettings/DelegatingDevOpsProjectCreatorFactoryTest.java index 8aa9ab23b51..b8815607956 100644 --- a/server/sonar-webserver-webapi/src/test/java/org/sonar/server/almsettings/ws/DelegatingDevOpsProjectCreatorFactoryTest.java +++ b/server/sonar-webserver-common/src/test/java/org/sonar/server/common/almsettings/DelegatingDevOpsProjectCreatorFactoryTest.java @@ -17,7 +17,7 @@ * 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.almsettings.ws; +package org.sonar.server.common.almsettings; import java.util.Map; import java.util.Optional; diff --git a/server/sonar-webserver-webapi/src/test/java/org/sonar/server/almsettings/ws/GithubProjectCreatorFactoryTest.java b/server/sonar-webserver-common/src/test/java/org/sonar/server/common/almsettings/github/GithubProjectCreatorFactoryTest.java similarity index 95% rename from server/sonar-webserver-webapi/src/test/java/org/sonar/server/almsettings/ws/GithubProjectCreatorFactoryTest.java rename to server/sonar-webserver-common/src/test/java/org/sonar/server/common/almsettings/github/GithubProjectCreatorFactoryTest.java index f1d153ab38e..ac805ea74ab 100644 --- a/server/sonar-webserver-webapi/src/test/java/org/sonar/server/almsettings/ws/GithubProjectCreatorFactoryTest.java +++ b/server/sonar-webserver-common/src/test/java/org/sonar/server/common/almsettings/github/GithubProjectCreatorFactoryTest.java @@ -17,7 +17,7 @@ * 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.almsettings.ws; +package org.sonar.server.common.almsettings.github; import java.util.List; import java.util.Map; @@ -40,14 +40,19 @@ import org.sonar.db.DbSession; import org.sonar.db.alm.pat.AlmPatDto; import org.sonar.db.alm.setting.ALM; import org.sonar.db.alm.setting.AlmSettingDto; -import org.sonar.server.almintegration.ws.ProjectKeyGenerator; +import org.sonar.server.common.almintegration.ProjectKeyGenerator; +import org.sonar.server.common.almsettings.DevOpsProjectCreator; +import org.sonar.server.common.almsettings.DevOpsProjectDescriptor; +import org.sonar.server.common.almsettings.github.GithubProjectCreationParameters; +import org.sonar.server.common.almsettings.github.GithubProjectCreator; +import org.sonar.server.common.almsettings.github.GithubProjectCreatorFactory; import org.sonar.server.exceptions.BadConfigurationException; import org.sonar.server.management.ManagedProjectService; import org.sonar.server.permission.PermissionService; -import org.sonar.server.permission.PermissionUpdater; -import org.sonar.server.permission.UserPermissionChange; +import org.sonar.server.common.permission.PermissionUpdater; +import org.sonar.server.common.permission.UserPermissionChange; import org.sonar.server.project.ProjectDefaultVisibility; -import org.sonar.server.project.ws.ProjectCreator; +import org.sonar.server.common.project.ProjectCreator; import org.sonar.server.user.UserSession; import static java.lang.String.format; diff --git a/server/sonar-webserver-webapi/src/test/java/org/sonar/server/almsettings/ws/GithubProjectCreatorTest.java b/server/sonar-webserver-common/src/test/java/org/sonar/server/common/almsettings/github/GithubProjectCreatorTest.java similarity index 97% rename from server/sonar-webserver-webapi/src/test/java/org/sonar/server/almsettings/ws/GithubProjectCreatorTest.java rename to server/sonar-webserver-common/src/test/java/org/sonar/server/common/almsettings/github/GithubProjectCreatorTest.java index 619846492bb..dcff559a270 100644 --- a/server/sonar-webserver-webapi/src/test/java/org/sonar/server/almsettings/ws/GithubProjectCreatorTest.java +++ b/server/sonar-webserver-common/src/test/java/org/sonar/server/common/almsettings/github/GithubProjectCreatorTest.java @@ -17,7 +17,7 @@ * 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.almsettings.ws; +package org.sonar.server.common.almsettings.github; import java.util.Arrays; import java.util.Collection; @@ -51,19 +51,20 @@ import org.sonar.db.project.CreationMethod; import org.sonar.db.project.ProjectDto; import org.sonar.db.provisioning.GithubPermissionsMappingDto; import org.sonar.db.user.GroupDto; -import org.sonar.server.almintegration.ws.ProjectKeyGenerator; +import org.sonar.server.common.almintegration.ProjectKeyGenerator; +import org.sonar.server.common.almsettings.DevOpsProjectDescriptor; +import org.sonar.server.common.component.ComponentCreationParameters; +import org.sonar.server.common.component.ComponentUpdater; +import org.sonar.server.common.component.NewComponent; +import org.sonar.server.common.permission.PermissionUpdater; +import org.sonar.server.common.permission.UserPermissionChange; +import org.sonar.server.common.project.ProjectCreator; import org.sonar.server.component.ComponentCreationData; -import org.sonar.server.component.ComponentCreationParameters; -import org.sonar.server.component.ComponentUpdater; -import org.sonar.server.component.NewComponent; import org.sonar.server.management.ManagedProjectService; import org.sonar.server.permission.PermissionService; import org.sonar.server.permission.PermissionServiceImpl; -import org.sonar.server.permission.PermissionUpdater; -import org.sonar.server.permission.UserPermissionChange; import org.sonar.server.project.ProjectDefaultVisibility; import org.sonar.server.project.Visibility; -import org.sonar.server.project.ws.ProjectCreator; import org.sonar.server.user.UserSession; import static java.util.Objects.requireNonNull; diff --git a/server/sonar-webserver-webapi/src/test/java/org/sonar/server/almsettings/ws/gitlab/GitlabProjectCreatorFactoryTest.java b/server/sonar-webserver-common/src/test/java/org/sonar/server/common/almsettings/gitlab/GitlabProjectCreatorFactoryTest.java similarity index 95% rename from server/sonar-webserver-webapi/src/test/java/org/sonar/server/almsettings/ws/gitlab/GitlabProjectCreatorFactoryTest.java rename to server/sonar-webserver-common/src/test/java/org/sonar/server/common/almsettings/gitlab/GitlabProjectCreatorFactoryTest.java index 6df2d2c6e4c..2abdd276753 100644 --- a/server/sonar-webserver-webapi/src/test/java/org/sonar/server/almsettings/ws/gitlab/GitlabProjectCreatorFactoryTest.java +++ b/server/sonar-webserver-common/src/test/java/org/sonar/server/common/almsettings/gitlab/GitlabProjectCreatorFactoryTest.java @@ -17,7 +17,7 @@ * 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.almsettings.ws.gitlab; +package org.sonar.server.common.almsettings.gitlab; import java.util.Map; import org.assertj.core.api.AssertionsForClassTypes; @@ -29,7 +29,7 @@ import org.mockito.junit.jupiter.MockitoExtension; import org.sonar.db.DbSession; import org.sonar.db.alm.setting.ALM; import org.sonar.db.alm.setting.AlmSettingDto; -import org.sonar.server.almsettings.ws.DevOpsProjectDescriptor; +import org.sonar.server.common.almsettings.DevOpsProjectDescriptor; import static org.assertj.core.api.AssertionsForClassTypes.assertThat; import static org.mockito.Mockito.mock; diff --git a/server/sonar-webserver-webapi/src/test/java/org/sonar/server/almsettings/ws/gitlab/GitlabProjectCreatorTest.java b/server/sonar-webserver-common/src/test/java/org/sonar/server/common/almsettings/gitlab/GitlabProjectCreatorTest.java similarity index 97% rename from server/sonar-webserver-webapi/src/test/java/org/sonar/server/almsettings/ws/gitlab/GitlabProjectCreatorTest.java rename to server/sonar-webserver-common/src/test/java/org/sonar/server/common/almsettings/gitlab/GitlabProjectCreatorTest.java index ad989a73288..76e2d2da308 100644 --- a/server/sonar-webserver-webapi/src/test/java/org/sonar/server/almsettings/ws/gitlab/GitlabProjectCreatorTest.java +++ b/server/sonar-webserver-common/src/test/java/org/sonar/server/common/almsettings/gitlab/GitlabProjectCreatorTest.java @@ -17,7 +17,7 @@ * 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.almsettings.ws.gitlab; +package org.sonar.server.common.almsettings.gitlab; import java.util.List; import java.util.Optional; @@ -41,10 +41,10 @@ import org.sonar.db.alm.setting.AlmSettingDto; import org.sonar.db.alm.setting.ProjectAlmSettingDto; import org.sonar.db.project.CreationMethod; import org.sonar.db.project.ProjectDto; -import org.sonar.server.almintegration.ws.ProjectKeyGenerator; -import org.sonar.server.almsettings.ws.DevOpsProjectDescriptor; +import org.sonar.server.common.almintegration.ProjectKeyGenerator; +import org.sonar.server.common.almsettings.DevOpsProjectDescriptor; +import org.sonar.server.common.project.ProjectCreator; import org.sonar.server.component.ComponentCreationData; -import org.sonar.server.project.ws.ProjectCreator; import org.sonar.server.user.UserSession; import static org.assertj.core.api.AssertionsForClassTypes.assertThat; diff --git a/server/sonar-webserver-webapi/src/it/java/org/sonar/server/newcodeperiod/CaycUtilsTest.java b/server/sonar-webserver-common/src/test/java/org/sonar/server/common/newcodeperiod/CaycUtilsTest.java similarity index 98% rename from server/sonar-webserver-webapi/src/it/java/org/sonar/server/newcodeperiod/CaycUtilsTest.java rename to server/sonar-webserver-common/src/test/java/org/sonar/server/common/newcodeperiod/CaycUtilsTest.java index c69f1dbe818..0afe761eeaa 100644 --- a/server/sonar-webserver-webapi/src/it/java/org/sonar/server/newcodeperiod/CaycUtilsTest.java +++ b/server/sonar-webserver-common/src/test/java/org/sonar/server/common/newcodeperiod/CaycUtilsTest.java @@ -17,7 +17,7 @@ * 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.newcodeperiod; +package org.sonar.server.common.newcodeperiod; import org.junit.Test; import org.sonar.db.newcodeperiod.NewCodePeriodDto; diff --git a/server/sonar-webserver-webapi/src/it/java/org/sonar/server/newcodeperiod/NewCodeDefinitionResolverTest.java b/server/sonar-webserver-common/src/test/java/org/sonar/server/common/newcodeperiod/NewCodeDefinitionResolverTest.java similarity index 98% rename from server/sonar-webserver-webapi/src/it/java/org/sonar/server/newcodeperiod/NewCodeDefinitionResolverTest.java rename to server/sonar-webserver-common/src/test/java/org/sonar/server/common/newcodeperiod/NewCodeDefinitionResolverTest.java index 332918ffed6..6bba3336ad9 100644 --- a/server/sonar-webserver-webapi/src/it/java/org/sonar/server/newcodeperiod/NewCodeDefinitionResolverTest.java +++ b/server/sonar-webserver-common/src/test/java/org/sonar/server/common/newcodeperiod/NewCodeDefinitionResolverTest.java @@ -17,7 +17,7 @@ * 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.newcodeperiod; +package org.sonar.server.common.newcodeperiod; import java.util.Optional; import org.junit.Rule; @@ -28,7 +28,6 @@ import org.sonar.db.DbClient; import org.sonar.db.DbSession; import org.sonar.db.DbTester; import org.sonar.db.newcodeperiod.NewCodePeriodDto; -import org.sonar.server.component.ComponentCreationData; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatNoException; diff --git a/server/sonar-webserver-webapi/src/it/java/org/sonar/server/almintegration/ws/azure/ImportAzureProjectActionIT.java b/server/sonar-webserver-webapi/src/it/java/org/sonar/server/almintegration/ws/azure/ImportAzureProjectActionIT.java index 40455a78208..1ffde3bd74e 100644 --- a/server/sonar-webserver-webapi/src/it/java/org/sonar/server/almintegration/ws/azure/ImportAzureProjectActionIT.java +++ b/server/sonar-webserver-webapi/src/it/java/org/sonar/server/almintegration/ws/azure/ImportAzureProjectActionIT.java @@ -41,8 +41,8 @@ import org.sonar.db.project.CreationMethod; import org.sonar.db.project.ProjectDto; import org.sonar.db.user.UserDto; import org.sonar.server.almintegration.ws.ImportHelper; -import org.sonar.server.almintegration.ws.ProjectKeyGenerator; -import org.sonar.server.component.ComponentUpdater; +import org.sonar.server.common.almintegration.ProjectKeyGenerator; +import org.sonar.server.common.component.ComponentUpdater; import org.sonar.server.es.TestIndexers; import org.sonar.server.exceptions.BadRequestException; import org.sonar.server.exceptions.ForbiddenException; @@ -50,10 +50,10 @@ import org.sonar.server.exceptions.NotFoundException; import org.sonar.server.exceptions.UnauthorizedException; import org.sonar.server.favorite.FavoriteUpdater; import org.sonar.server.l18n.I18nRule; -import org.sonar.server.newcodeperiod.NewCodeDefinitionResolver; +import org.sonar.server.common.newcodeperiod.NewCodeDefinitionResolver; import org.sonar.server.permission.PermissionService; -import org.sonar.server.permission.PermissionTemplateService; -import org.sonar.server.permission.PermissionUpdater; +import org.sonar.server.common.permission.PermissionTemplateService; +import org.sonar.server.common.permission.PermissionUpdater; import org.sonar.server.project.DefaultBranchNameResolver; import org.sonar.server.project.ProjectDefaultVisibility; import org.sonar.server.project.Visibility; diff --git a/server/sonar-webserver-webapi/src/it/java/org/sonar/server/almintegration/ws/bitbucketcloud/ImportBitbucketCloudRepoActionIT.java b/server/sonar-webserver-webapi/src/it/java/org/sonar/server/almintegration/ws/bitbucketcloud/ImportBitbucketCloudRepoActionIT.java index 1405595b259..8dab56edddb 100644 --- a/server/sonar-webserver-webapi/src/it/java/org/sonar/server/almintegration/ws/bitbucketcloud/ImportBitbucketCloudRepoActionIT.java +++ b/server/sonar-webserver-webapi/src/it/java/org/sonar/server/almintegration/ws/bitbucketcloud/ImportBitbucketCloudRepoActionIT.java @@ -41,8 +41,8 @@ import org.sonar.db.project.CreationMethod; import org.sonar.db.project.ProjectDto; import org.sonar.db.user.UserDto; import org.sonar.server.almintegration.ws.ImportHelper; -import org.sonar.server.almintegration.ws.ProjectKeyGenerator; -import org.sonar.server.component.ComponentUpdater; +import org.sonar.server.common.almintegration.ProjectKeyGenerator; +import org.sonar.server.common.component.ComponentUpdater; import org.sonar.server.es.TestIndexers; import org.sonar.server.exceptions.BadRequestException; import org.sonar.server.exceptions.ForbiddenException; @@ -50,10 +50,10 @@ import org.sonar.server.exceptions.NotFoundException; import org.sonar.server.exceptions.UnauthorizedException; import org.sonar.server.favorite.FavoriteUpdater; import org.sonar.server.l18n.I18nRule; -import org.sonar.server.newcodeperiod.NewCodeDefinitionResolver; +import org.sonar.server.common.newcodeperiod.NewCodeDefinitionResolver; import org.sonar.server.permission.PermissionService; -import org.sonar.server.permission.PermissionTemplateService; -import org.sonar.server.permission.PermissionUpdater; +import org.sonar.server.common.permission.PermissionTemplateService; +import org.sonar.server.common.permission.PermissionUpdater; import org.sonar.server.project.DefaultBranchNameResolver; import org.sonar.server.project.ProjectDefaultVisibility; import org.sonar.server.project.Visibility; diff --git a/server/sonar-webserver-webapi/src/it/java/org/sonar/server/almintegration/ws/bitbucketserver/ImportBitbucketServerProjectActionIT.java b/server/sonar-webserver-webapi/src/it/java/org/sonar/server/almintegration/ws/bitbucketserver/ImportBitbucketServerProjectActionIT.java index 1ddecc7a524..55cb770a561 100644 --- a/server/sonar-webserver-webapi/src/it/java/org/sonar/server/almintegration/ws/bitbucketserver/ImportBitbucketServerProjectActionIT.java +++ b/server/sonar-webserver-webapi/src/it/java/org/sonar/server/almintegration/ws/bitbucketserver/ImportBitbucketServerProjectActionIT.java @@ -47,8 +47,8 @@ import org.sonar.db.project.CreationMethod; import org.sonar.db.project.ProjectDto; import org.sonar.db.user.UserDto; import org.sonar.server.almintegration.ws.ImportHelper; -import org.sonar.server.almintegration.ws.ProjectKeyGenerator; -import org.sonar.server.component.ComponentUpdater; +import org.sonar.server.common.almintegration.ProjectKeyGenerator; +import org.sonar.server.common.component.ComponentUpdater; import org.sonar.server.es.TestIndexers; import org.sonar.server.exceptions.BadRequestException; import org.sonar.server.exceptions.ForbiddenException; @@ -56,10 +56,10 @@ import org.sonar.server.exceptions.NotFoundException; import org.sonar.server.exceptions.UnauthorizedException; import org.sonar.server.favorite.FavoriteUpdater; import org.sonar.server.l18n.I18nRule; -import org.sonar.server.newcodeperiod.NewCodeDefinitionResolver; +import org.sonar.server.common.newcodeperiod.NewCodeDefinitionResolver; import org.sonar.server.permission.PermissionService; -import org.sonar.server.permission.PermissionTemplateService; -import org.sonar.server.permission.PermissionUpdater; +import org.sonar.server.common.permission.PermissionTemplateService; +import org.sonar.server.common.permission.PermissionUpdater; import org.sonar.server.project.DefaultBranchNameResolver; import org.sonar.server.project.ProjectDefaultVisibility; import org.sonar.server.project.Visibility; diff --git a/server/sonar-webserver-webapi/src/it/java/org/sonar/server/almintegration/ws/github/ImportGithubProjectActionIT.java b/server/sonar-webserver-webapi/src/it/java/org/sonar/server/almintegration/ws/github/ImportGithubProjectActionIT.java index fed6d8d4f80..0bd1deaa6a1 100644 --- a/server/sonar-webserver-webapi/src/it/java/org/sonar/server/almintegration/ws/github/ImportGithubProjectActionIT.java +++ b/server/sonar-webserver-webapi/src/it/java/org/sonar/server/almintegration/ws/github/ImportGithubProjectActionIT.java @@ -51,9 +51,9 @@ import org.sonar.db.project.CreationMethod; import org.sonar.db.project.ProjectDto; import org.sonar.db.user.UserDto; import org.sonar.server.almintegration.ws.ImportHelper; -import org.sonar.server.almintegration.ws.ProjectKeyGenerator; -import org.sonar.server.almsettings.ws.GithubProjectCreatorFactory; -import org.sonar.server.component.ComponentUpdater; +import org.sonar.server.common.almintegration.ProjectKeyGenerator; +import org.sonar.server.common.almsettings.github.GithubProjectCreatorFactory; +import org.sonar.server.common.component.ComponentUpdater; import org.sonar.server.es.EsTester; import org.sonar.server.es.IndexersImpl; import org.sonar.server.es.TestIndexers; @@ -62,20 +62,20 @@ import org.sonar.server.exceptions.NotFoundException; import org.sonar.server.exceptions.UnauthorizedException; import org.sonar.server.favorite.FavoriteUpdater; import org.sonar.server.management.ManagedProjectService; -import org.sonar.server.newcodeperiod.NewCodeDefinitionResolver; -import org.sonar.server.permission.GroupPermissionChanger; +import org.sonar.server.common.newcodeperiod.NewCodeDefinitionResolver; +import org.sonar.server.common.permission.GroupPermissionChanger; import org.sonar.server.permission.PermissionService; import org.sonar.server.permission.PermissionServiceImpl; -import org.sonar.server.permission.PermissionTemplateService; -import org.sonar.server.permission.PermissionUpdater; -import org.sonar.server.permission.UserPermissionChange; -import org.sonar.server.permission.UserPermissionChanger; +import org.sonar.server.common.permission.PermissionTemplateService; +import org.sonar.server.common.permission.PermissionUpdater; +import org.sonar.server.common.permission.UserPermissionChange; +import org.sonar.server.common.permission.UserPermissionChanger; import org.sonar.server.permission.index.FooIndexDefinition; import org.sonar.server.permission.index.PermissionIndexer; import org.sonar.server.project.DefaultBranchNameResolver; import org.sonar.server.project.ProjectDefaultVisibility; import org.sonar.server.project.Visibility; -import org.sonar.server.project.ws.ProjectCreator; +import org.sonar.server.common.project.ProjectCreator; import org.sonar.server.tester.UserSessionRule; import org.sonar.server.ws.TestRequest; import org.sonar.server.ws.WsActionTester; diff --git a/server/sonar-webserver-webapi/src/it/java/org/sonar/server/almintegration/ws/gitlab/ImportGitLabProjectActionIT.java b/server/sonar-webserver-webapi/src/it/java/org/sonar/server/almintegration/ws/gitlab/ImportGitLabProjectActionIT.java index 9d0b82db325..a9914d3c810 100644 --- a/server/sonar-webserver-webapi/src/it/java/org/sonar/server/almintegration/ws/gitlab/ImportGitLabProjectActionIT.java +++ b/server/sonar-webserver-webapi/src/it/java/org/sonar/server/almintegration/ws/gitlab/ImportGitLabProjectActionIT.java @@ -41,20 +41,20 @@ import org.sonar.db.project.CreationMethod; import org.sonar.db.project.ProjectDto; import org.sonar.db.user.UserDto; import org.sonar.server.almintegration.ws.ImportHelper; -import org.sonar.server.almintegration.ws.ProjectKeyGenerator; -import org.sonar.server.almsettings.ws.gitlab.GitlabProjectCreatorFactory; -import org.sonar.server.component.ComponentUpdater; +import org.sonar.server.common.almintegration.ProjectKeyGenerator; +import org.sonar.server.common.almsettings.gitlab.GitlabProjectCreatorFactory; +import org.sonar.server.common.component.ComponentUpdater; import org.sonar.server.es.TestIndexers; import org.sonar.server.exceptions.NotFoundException; import org.sonar.server.favorite.FavoriteUpdater; -import org.sonar.server.newcodeperiod.NewCodeDefinitionResolver; +import org.sonar.server.common.newcodeperiod.NewCodeDefinitionResolver; import org.sonar.server.permission.PermissionService; -import org.sonar.server.permission.PermissionTemplateService; -import org.sonar.server.permission.PermissionUpdater; +import org.sonar.server.common.permission.PermissionTemplateService; +import org.sonar.server.common.permission.PermissionUpdater; import org.sonar.server.project.DefaultBranchNameResolver; import org.sonar.server.project.ProjectDefaultVisibility; import org.sonar.server.project.Visibility; -import org.sonar.server.project.ws.ProjectCreator; +import org.sonar.server.common.project.ProjectCreator; import org.sonar.server.tester.UserSessionRule; import org.sonar.server.ws.TestRequest; import org.sonar.server.ws.WsActionTester; diff --git a/server/sonar-webserver-webapi/src/it/java/org/sonar/server/ce/queue/BranchReportSubmitterIT.java b/server/sonar-webserver-webapi/src/it/java/org/sonar/server/ce/queue/BranchReportSubmitterIT.java index 623c04f0f81..a71aa16951f 100644 --- a/server/sonar-webserver-webapi/src/it/java/org/sonar/server/ce/queue/BranchReportSubmitterIT.java +++ b/server/sonar-webserver-webapi/src/it/java/org/sonar/server/ce/queue/BranchReportSubmitterIT.java @@ -47,18 +47,18 @@ import org.sonar.db.component.ProjectData; import org.sonar.db.project.CreationMethod; import org.sonar.db.project.ProjectDto; import org.sonar.db.user.UserDto; -import org.sonar.server.almsettings.ws.DevOpsProjectCreatorFactory; -import org.sonar.server.almsettings.ws.GithubProjectCreatorFactory; +import org.sonar.server.common.almsettings.DevOpsProjectCreatorFactory; +import org.sonar.server.common.almsettings.github.GithubProjectCreatorFactory; import org.sonar.server.component.ComponentCreationData; -import org.sonar.server.component.ComponentCreationParameters; -import org.sonar.server.component.ComponentUpdater; +import org.sonar.server.common.component.ComponentCreationParameters; +import org.sonar.server.common.component.ComponentUpdater; import org.sonar.server.exceptions.ForbiddenException; import org.sonar.server.favorite.FavoriteUpdater; import org.sonar.server.management.ManagedInstanceService; -import org.sonar.server.permission.PermissionTemplateService; +import org.sonar.server.common.permission.PermissionTemplateService; import org.sonar.server.project.ProjectDefaultVisibility; import org.sonar.server.project.Visibility; -import org.sonar.server.project.ws.ProjectCreator; +import org.sonar.server.common.project.ProjectCreator; import org.sonar.server.tester.UserSessionRule; import static java.util.Collections.emptyMap; diff --git a/server/sonar-webserver-webapi/src/it/java/org/sonar/server/ce/queue/ReportSubmitterIT.java b/server/sonar-webserver-webapi/src/it/java/org/sonar/server/ce/queue/ReportSubmitterIT.java index 2e8b1e1e134..ef5e940f567 100644 --- a/server/sonar-webserver-webapi/src/it/java/org/sonar/server/ce/queue/ReportSubmitterIT.java +++ b/server/sonar-webserver-webapi/src/it/java/org/sonar/server/ce/queue/ReportSubmitterIT.java @@ -48,15 +48,15 @@ import org.sonar.db.permission.GlobalPermission; import org.sonar.db.project.CreationMethod; import org.sonar.db.project.ProjectDto; import org.sonar.db.user.UserDto; -import org.sonar.server.almintegration.ws.ProjectKeyGenerator; -import org.sonar.server.almsettings.ws.DelegatingDevOpsProjectCreatorFactory; -import org.sonar.server.almsettings.ws.DevOpsProjectCreator; -import org.sonar.server.almsettings.ws.DevOpsProjectCreatorFactory; -import org.sonar.server.almsettings.ws.DevOpsProjectDescriptor; -import org.sonar.server.almsettings.ws.GithubProjectCreationParameters; -import org.sonar.server.almsettings.ws.GithubProjectCreator; -import org.sonar.server.almsettings.ws.GithubProjectCreatorFactory; -import org.sonar.server.component.ComponentUpdater; +import org.sonar.server.common.almintegration.ProjectKeyGenerator; +import org.sonar.server.common.almsettings.DelegatingDevOpsProjectCreatorFactory; +import org.sonar.server.common.almsettings.DevOpsProjectCreator; +import org.sonar.server.common.almsettings.DevOpsProjectCreatorFactory; +import org.sonar.server.common.almsettings.DevOpsProjectDescriptor; +import org.sonar.server.common.almsettings.github.GithubProjectCreationParameters; +import org.sonar.server.common.almsettings.github.GithubProjectCreator; +import org.sonar.server.common.almsettings.github.GithubProjectCreatorFactory; +import org.sonar.server.common.component.ComponentUpdater; import org.sonar.server.es.TestIndexers; import org.sonar.server.exceptions.BadRequestException; import org.sonar.server.exceptions.ForbiddenException; @@ -65,13 +65,13 @@ import org.sonar.server.management.ManagedInstanceService; import org.sonar.server.management.ManagedProjectService; import org.sonar.server.permission.PermissionService; import org.sonar.server.permission.PermissionServiceImpl; -import org.sonar.server.permission.PermissionTemplateService; -import org.sonar.server.permission.PermissionUpdater; -import org.sonar.server.permission.UserPermissionChange; +import org.sonar.server.common.permission.PermissionTemplateService; +import org.sonar.server.common.permission.PermissionUpdater; +import org.sonar.server.common.permission.UserPermissionChange; import org.sonar.server.project.DefaultBranchNameResolver; import org.sonar.server.project.ProjectDefaultVisibility; import org.sonar.server.project.Visibility; -import org.sonar.server.project.ws.ProjectCreator; +import org.sonar.server.common.project.ProjectCreator; import org.sonar.server.tester.UserSessionRule; import static java.lang.String.format; diff --git a/server/sonar-webserver-webapi/src/it/java/org/sonar/server/permission/ws/BasePermissionWsIT.java b/server/sonar-webserver-webapi/src/it/java/org/sonar/server/permission/ws/BasePermissionWsIT.java index f40a9adfc2d..70687fc68b2 100644 --- a/server/sonar-webserver-webapi/src/it/java/org/sonar/server/permission/ws/BasePermissionWsIT.java +++ b/server/sonar-webserver-webapi/src/it/java/org/sonar/server/permission/ws/BasePermissionWsIT.java @@ -32,9 +32,9 @@ import org.sonar.db.component.ResourceTypesRule; import org.sonar.db.permission.template.PermissionTemplateDto; import org.sonar.server.es.EsTester; import org.sonar.server.es.IndexersImpl; -import org.sonar.server.permission.GroupPermissionChanger; -import org.sonar.server.permission.PermissionUpdater; -import org.sonar.server.permission.UserPermissionChanger; +import org.sonar.server.common.permission.GroupPermissionChanger; +import org.sonar.server.common.permission.PermissionUpdater; +import org.sonar.server.common.permission.UserPermissionChanger; import org.sonar.server.permission.index.FooIndexDefinition; import org.sonar.server.permission.index.PermissionIndexer; import org.sonar.server.tester.UserSessionRule; diff --git a/server/sonar-webserver-webapi/src/it/java/org/sonar/server/permission/ws/template/ApplyTemplateActionIT.java b/server/sonar-webserver-webapi/src/it/java/org/sonar/server/permission/ws/template/ApplyTemplateActionIT.java index 80482347f5f..47f1ca2f1ca 100644 --- a/server/sonar-webserver-webapi/src/it/java/org/sonar/server/permission/ws/template/ApplyTemplateActionIT.java +++ b/server/sonar-webserver-webapi/src/it/java/org/sonar/server/permission/ws/template/ApplyTemplateActionIT.java @@ -40,9 +40,9 @@ import org.sonar.server.exceptions.ForbiddenException; import org.sonar.server.exceptions.NotFoundException; import org.sonar.server.common.management.ManagedInstanceChecker; import org.sonar.server.management.ManagedProjectService; -import org.sonar.server.permission.DefaultTemplatesResolver; -import org.sonar.server.permission.DefaultTemplatesResolverImpl; -import org.sonar.server.permission.PermissionTemplateService; +import org.sonar.server.common.permission.DefaultTemplatesResolver; +import org.sonar.server.common.permission.DefaultTemplatesResolverImpl; +import org.sonar.server.common.permission.PermissionTemplateService; import org.sonar.server.permission.ws.BasePermissionWsIT; import org.sonar.server.ws.TestRequest; diff --git a/server/sonar-webserver-webapi/src/it/java/org/sonar/server/permission/ws/template/BulkApplyTemplateActionIT.java b/server/sonar-webserver-webapi/src/it/java/org/sonar/server/permission/ws/template/BulkApplyTemplateActionIT.java index 52f93e53f5c..f66366b10f4 100644 --- a/server/sonar-webserver-webapi/src/it/java/org/sonar/server/permission/ws/template/BulkApplyTemplateActionIT.java +++ b/server/sonar-webserver-webapi/src/it/java/org/sonar/server/permission/ws/template/BulkApplyTemplateActionIT.java @@ -45,9 +45,9 @@ import org.sonar.server.exceptions.BadRequestException; import org.sonar.server.exceptions.NotFoundException; import org.sonar.server.l18n.I18nRule; import org.sonar.server.management.ManagedProjectService; -import org.sonar.server.permission.DefaultTemplatesResolver; -import org.sonar.server.permission.DefaultTemplatesResolverImpl; -import org.sonar.server.permission.PermissionTemplateService; +import org.sonar.server.common.permission.DefaultTemplatesResolver; +import org.sonar.server.common.permission.DefaultTemplatesResolverImpl; +import org.sonar.server.common.permission.PermissionTemplateService; import org.sonar.server.permission.ws.BasePermissionWsIT; import static org.assertj.core.api.Assertions.assertThat; diff --git a/server/sonar-webserver-webapi/src/it/java/org/sonar/server/permission/ws/template/DeleteTemplateActionIT.java b/server/sonar-webserver-webapi/src/it/java/org/sonar/server/permission/ws/template/DeleteTemplateActionIT.java index 1bb8621fbc8..3b52322edec 100644 --- a/server/sonar-webserver-webapi/src/it/java/org/sonar/server/permission/ws/template/DeleteTemplateActionIT.java +++ b/server/sonar-webserver-webapi/src/it/java/org/sonar/server/permission/ws/template/DeleteTemplateActionIT.java @@ -38,8 +38,8 @@ import org.sonar.server.exceptions.BadRequestException; import org.sonar.server.exceptions.ForbiddenException; import org.sonar.server.exceptions.NotFoundException; import org.sonar.server.exceptions.UnauthorizedException; -import org.sonar.server.permission.DefaultTemplatesResolver; -import org.sonar.server.permission.DefaultTemplatesResolverImpl; +import org.sonar.server.common.permission.DefaultTemplatesResolver; +import org.sonar.server.common.permission.DefaultTemplatesResolverImpl; import org.sonar.server.permission.ws.PermissionWsSupport; import org.sonar.server.tester.UserSessionRule; import org.sonar.server.usergroups.DefaultGroupFinder; diff --git a/server/sonar-webserver-webapi/src/it/java/org/sonar/server/permission/ws/template/SearchTemplatesActionIT.java b/server/sonar-webserver-webapi/src/it/java/org/sonar/server/permission/ws/template/SearchTemplatesActionIT.java index ff91930e3be..6322ebe7a84 100644 --- a/server/sonar-webserver-webapi/src/it/java/org/sonar/server/permission/ws/template/SearchTemplatesActionIT.java +++ b/server/sonar-webserver-webapi/src/it/java/org/sonar/server/permission/ws/template/SearchTemplatesActionIT.java @@ -35,8 +35,8 @@ import org.sonar.db.user.GroupDto; import org.sonar.db.user.UserDto; import org.sonar.server.exceptions.UnauthorizedException; import org.sonar.server.l18n.I18nRule; -import org.sonar.server.permission.DefaultTemplatesResolver; -import org.sonar.server.permission.DefaultTemplatesResolverImpl; +import org.sonar.server.common.permission.DefaultTemplatesResolver; +import org.sonar.server.common.permission.DefaultTemplatesResolverImpl; import org.sonar.server.permission.PermissionService; import org.sonar.server.permission.PermissionServiceImpl; import org.sonar.server.permission.ws.BasePermissionWsIT; diff --git a/server/sonar-webserver-webapi/src/it/java/org/sonar/server/project/ws/CreateActionIT.java b/server/sonar-webserver-webapi/src/it/java/org/sonar/server/project/ws/CreateActionIT.java index 42863cddfc0..305dd991f97 100644 --- a/server/sonar-webserver-webapi/src/it/java/org/sonar/server/project/ws/CreateActionIT.java +++ b/server/sonar-webserver-webapi/src/it/java/org/sonar/server/project/ws/CreateActionIT.java @@ -38,17 +38,17 @@ import org.sonar.db.newcodeperiod.NewCodePeriodDto; import org.sonar.db.project.CreationMethod; import org.sonar.db.project.ProjectDto; import org.sonar.db.user.UserDto; -import org.sonar.server.component.ComponentUpdater; +import org.sonar.server.common.component.ComponentUpdater; import org.sonar.server.es.Indexers; import org.sonar.server.es.TestIndexers; import org.sonar.server.exceptions.BadRequestException; import org.sonar.server.exceptions.ForbiddenException; import org.sonar.server.favorite.FavoriteUpdater; import org.sonar.server.l18n.I18nRule; -import org.sonar.server.newcodeperiod.NewCodeDefinitionResolver; +import org.sonar.server.common.newcodeperiod.NewCodeDefinitionResolver; import org.sonar.server.permission.PermissionService; -import org.sonar.server.permission.PermissionTemplateService; -import org.sonar.server.permission.PermissionUpdater; +import org.sonar.server.common.permission.PermissionTemplateService; +import org.sonar.server.common.permission.PermissionUpdater; import org.sonar.server.project.DefaultBranchNameResolver; import org.sonar.server.project.ProjectDefaultVisibility; import org.sonar.server.project.Visibility; @@ -71,8 +71,8 @@ import static org.sonar.db.component.BranchDto.DEFAULT_MAIN_BRANCH_NAME; import static org.sonar.db.newcodeperiod.NewCodePeriodType.NUMBER_OF_DAYS; import static org.sonar.db.newcodeperiod.NewCodePeriodType.REFERENCE_BRANCH; import static org.sonar.db.permission.GlobalPermission.PROVISION_PROJECTS; -import static org.sonar.server.newcodeperiod.NewCodeDefinitionResolver.NEW_CODE_PERIOD_TYPE_DESCRIPTION_PROJECT_CREATION; -import static org.sonar.server.newcodeperiod.NewCodeDefinitionResolver.NEW_CODE_PERIOD_VALUE_DESCRIPTION_PROJECT_CREATION; +import static org.sonar.server.common.newcodeperiod.NewCodeDefinitionResolver.NEW_CODE_PERIOD_TYPE_DESCRIPTION_PROJECT_CREATION; +import static org.sonar.server.common.newcodeperiod.NewCodeDefinitionResolver.NEW_CODE_PERIOD_VALUE_DESCRIPTION_PROJECT_CREATION; import static org.sonar.server.project.Visibility.PRIVATE; import static org.sonar.test.JsonAssert.assertJson; import static org.sonarqube.ws.client.WsRequest.Method.POST; diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/almintegration/ws/azure/ImportAzureProjectAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/almintegration/ws/azure/ImportAzureProjectAction.java index 88bfc22573c..93d5001ed57 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/almintegration/ws/azure/ImportAzureProjectAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/almintegration/ws/azure/ImportAzureProjectAction.java @@ -37,12 +37,12 @@ import org.sonar.db.component.BranchDto; import org.sonar.db.project.ProjectDto; import org.sonar.server.almintegration.ws.AlmIntegrationsWsAction; import org.sonar.server.almintegration.ws.ImportHelper; -import org.sonar.server.almintegration.ws.ProjectKeyGenerator; +import org.sonar.server.common.almintegration.ProjectKeyGenerator; import org.sonar.server.component.ComponentCreationData; -import org.sonar.server.component.ComponentCreationParameters; -import org.sonar.server.component.ComponentUpdater; -import org.sonar.server.component.NewComponent; -import org.sonar.server.newcodeperiod.NewCodeDefinitionResolver; +import org.sonar.server.common.component.ComponentCreationParameters; +import org.sonar.server.common.component.ComponentUpdater; +import org.sonar.server.common.component.NewComponent; +import org.sonar.server.common.newcodeperiod.NewCodeDefinitionResolver; import org.sonar.server.project.DefaultBranchNameResolver; import org.sonar.server.project.ProjectDefaultVisibility; import org.sonar.server.user.UserSession; @@ -54,10 +54,10 @@ import static org.sonar.db.project.CreationMethod.Category.ALM_IMPORT; import static org.sonar.db.project.CreationMethod.getCreationMethod; import static org.sonar.server.almintegration.ws.ImportHelper.PARAM_ALM_SETTING; import static org.sonar.server.almintegration.ws.ImportHelper.toCreateResponse; -import static org.sonar.server.component.NewComponent.newComponentBuilder; -import static org.sonar.server.newcodeperiod.NewCodeDefinitionResolver.NEW_CODE_PERIOD_TYPE_DESCRIPTION_PROJECT_CREATION; -import static org.sonar.server.newcodeperiod.NewCodeDefinitionResolver.NEW_CODE_PERIOD_VALUE_DESCRIPTION_PROJECT_CREATION; -import static org.sonar.server.newcodeperiod.NewCodeDefinitionResolver.checkNewCodeDefinitionParam; +import static org.sonar.server.common.component.NewComponent.newComponentBuilder; +import static org.sonar.server.common.newcodeperiod.NewCodeDefinitionResolver.NEW_CODE_PERIOD_TYPE_DESCRIPTION_PROJECT_CREATION; +import static org.sonar.server.common.newcodeperiod.NewCodeDefinitionResolver.NEW_CODE_PERIOD_VALUE_DESCRIPTION_PROJECT_CREATION; +import static org.sonar.server.common.newcodeperiod.NewCodeDefinitionResolver.checkNewCodeDefinitionParam; import static org.sonar.server.ws.WsUtils.writeProtobuf; import static org.sonarqube.ws.client.project.ProjectsWsParameters.PARAM_NEW_CODE_DEFINITION_TYPE; import static org.sonarqube.ws.client.project.ProjectsWsParameters.PARAM_NEW_CODE_DEFINITION_VALUE; diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/almintegration/ws/bitbucketcloud/ImportBitbucketCloudRepoAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/almintegration/ws/bitbucketcloud/ImportBitbucketCloudRepoAction.java index 3834697bd0b..0f77f2fe2b6 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/almintegration/ws/bitbucketcloud/ImportBitbucketCloudRepoAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/almintegration/ws/bitbucketcloud/ImportBitbucketCloudRepoAction.java @@ -38,12 +38,12 @@ import org.sonar.db.component.BranchDto; import org.sonar.db.project.ProjectDto; import org.sonar.server.almintegration.ws.AlmIntegrationsWsAction; import org.sonar.server.almintegration.ws.ImportHelper; -import org.sonar.server.almintegration.ws.ProjectKeyGenerator; +import org.sonar.server.common.almintegration.ProjectKeyGenerator; import org.sonar.server.component.ComponentCreationData; -import org.sonar.server.component.ComponentCreationParameters; -import org.sonar.server.component.ComponentUpdater; -import org.sonar.server.component.NewComponent; -import org.sonar.server.newcodeperiod.NewCodeDefinitionResolver; +import org.sonar.server.common.component.ComponentCreationParameters; +import org.sonar.server.common.component.ComponentUpdater; +import org.sonar.server.common.component.NewComponent; +import org.sonar.server.common.newcodeperiod.NewCodeDefinitionResolver; import org.sonar.server.project.DefaultBranchNameResolver; import org.sonar.server.project.ProjectDefaultVisibility; import org.sonar.server.user.UserSession; @@ -55,10 +55,10 @@ import static org.sonar.db.project.CreationMethod.Category.ALM_IMPORT; import static org.sonar.db.project.CreationMethod.getCreationMethod; import static org.sonar.server.almintegration.ws.ImportHelper.PARAM_ALM_SETTING; import static org.sonar.server.almintegration.ws.ImportHelper.toCreateResponse; -import static org.sonar.server.component.NewComponent.newComponentBuilder; -import static org.sonar.server.newcodeperiod.NewCodeDefinitionResolver.NEW_CODE_PERIOD_TYPE_DESCRIPTION_PROJECT_CREATION; -import static org.sonar.server.newcodeperiod.NewCodeDefinitionResolver.NEW_CODE_PERIOD_VALUE_DESCRIPTION_PROJECT_CREATION; -import static org.sonar.server.newcodeperiod.NewCodeDefinitionResolver.checkNewCodeDefinitionParam; +import static org.sonar.server.common.component.NewComponent.newComponentBuilder; +import static org.sonar.server.common.newcodeperiod.NewCodeDefinitionResolver.NEW_CODE_PERIOD_TYPE_DESCRIPTION_PROJECT_CREATION; +import static org.sonar.server.common.newcodeperiod.NewCodeDefinitionResolver.NEW_CODE_PERIOD_VALUE_DESCRIPTION_PROJECT_CREATION; +import static org.sonar.server.common.newcodeperiod.NewCodeDefinitionResolver.checkNewCodeDefinitionParam; import static org.sonar.server.ws.WsUtils.writeProtobuf; import static org.sonarqube.ws.client.project.ProjectsWsParameters.PARAM_NEW_CODE_DEFINITION_TYPE; import static org.sonarqube.ws.client.project.ProjectsWsParameters.PARAM_NEW_CODE_DEFINITION_VALUE; diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/almintegration/ws/bitbucketserver/ImportBitbucketServerProjectAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/almintegration/ws/bitbucketserver/ImportBitbucketServerProjectAction.java index 9d7e589022e..6fc2d1bcb65 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/almintegration/ws/bitbucketserver/ImportBitbucketServerProjectAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/almintegration/ws/bitbucketserver/ImportBitbucketServerProjectAction.java @@ -40,12 +40,12 @@ import org.sonar.db.component.BranchDto; import org.sonar.db.project.ProjectDto; import org.sonar.server.almintegration.ws.AlmIntegrationsWsAction; import org.sonar.server.almintegration.ws.ImportHelper; -import org.sonar.server.almintegration.ws.ProjectKeyGenerator; +import org.sonar.server.common.almintegration.ProjectKeyGenerator; import org.sonar.server.component.ComponentCreationData; -import org.sonar.server.component.ComponentCreationParameters; -import org.sonar.server.component.ComponentUpdater; -import org.sonar.server.component.NewComponent; -import org.sonar.server.newcodeperiod.NewCodeDefinitionResolver; +import org.sonar.server.common.component.ComponentCreationParameters; +import org.sonar.server.common.component.ComponentUpdater; +import org.sonar.server.common.component.NewComponent; +import org.sonar.server.common.newcodeperiod.NewCodeDefinitionResolver; import org.sonar.server.project.DefaultBranchNameResolver; import org.sonar.server.project.ProjectDefaultVisibility; import org.sonar.server.user.UserSession; @@ -57,10 +57,10 @@ import static org.sonar.db.project.CreationMethod.Category.ALM_IMPORT; import static org.sonar.db.project.CreationMethod.getCreationMethod; import static org.sonar.server.almintegration.ws.ImportHelper.PARAM_ALM_SETTING; import static org.sonar.server.almintegration.ws.ImportHelper.toCreateResponse; -import static org.sonar.server.component.NewComponent.newComponentBuilder; -import static org.sonar.server.newcodeperiod.NewCodeDefinitionResolver.NEW_CODE_PERIOD_TYPE_DESCRIPTION_PROJECT_CREATION; -import static org.sonar.server.newcodeperiod.NewCodeDefinitionResolver.NEW_CODE_PERIOD_VALUE_DESCRIPTION_PROJECT_CREATION; -import static org.sonar.server.newcodeperiod.NewCodeDefinitionResolver.checkNewCodeDefinitionParam; +import static org.sonar.server.common.component.NewComponent.newComponentBuilder; +import static org.sonar.server.common.newcodeperiod.NewCodeDefinitionResolver.NEW_CODE_PERIOD_TYPE_DESCRIPTION_PROJECT_CREATION; +import static org.sonar.server.common.newcodeperiod.NewCodeDefinitionResolver.NEW_CODE_PERIOD_VALUE_DESCRIPTION_PROJECT_CREATION; +import static org.sonar.server.common.newcodeperiod.NewCodeDefinitionResolver.checkNewCodeDefinitionParam; import static org.sonar.server.ws.WsUtils.writeProtobuf; import static org.sonarqube.ws.client.project.ProjectsWsParameters.PARAM_NEW_CODE_DEFINITION_TYPE; import static org.sonarqube.ws.client.project.ProjectsWsParameters.PARAM_NEW_CODE_DEFINITION_VALUE; diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/almintegration/ws/github/ImportGithubProjectAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/almintegration/ws/github/ImportGithubProjectAction.java index 73632870db6..130078e2328 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/almintegration/ws/github/ImportGithubProjectAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/almintegration/ws/github/ImportGithubProjectAction.java @@ -34,13 +34,13 @@ import org.sonar.db.project.CreationMethod; import org.sonar.db.project.ProjectDto; import org.sonar.server.almintegration.ws.AlmIntegrationsWsAction; import org.sonar.server.almintegration.ws.ImportHelper; -import org.sonar.server.almsettings.ws.DevOpsProjectCreator; -import org.sonar.server.almsettings.ws.DevOpsProjectDescriptor; -import org.sonar.server.almsettings.ws.GithubProjectCreatorFactory; +import org.sonar.server.common.almsettings.DevOpsProjectCreator; +import org.sonar.server.common.almsettings.DevOpsProjectDescriptor; +import org.sonar.server.common.almsettings.github.GithubProjectCreatorFactory; import org.sonar.server.component.ComponentCreationData; -import org.sonar.server.component.ComponentUpdater; +import org.sonar.server.common.component.ComponentUpdater; import org.sonar.server.exceptions.BadRequestException; -import org.sonar.server.newcodeperiod.NewCodeDefinitionResolver; +import org.sonar.server.common.newcodeperiod.NewCodeDefinitionResolver; import org.sonar.server.project.DefaultBranchNameResolver; import org.sonar.server.user.UserSession; import org.sonarqube.ws.Projects; @@ -50,9 +50,9 @@ import static org.sonar.db.project.CreationMethod.getCreationMethod; import static org.sonar.db.project.CreationMethod.Category.ALM_IMPORT; import static org.sonar.server.almintegration.ws.ImportHelper.PARAM_ALM_SETTING; import static org.sonar.server.almintegration.ws.ImportHelper.toCreateResponse; -import static org.sonar.server.newcodeperiod.NewCodeDefinitionResolver.NEW_CODE_PERIOD_TYPE_DESCRIPTION_PROJECT_CREATION; -import static org.sonar.server.newcodeperiod.NewCodeDefinitionResolver.NEW_CODE_PERIOD_VALUE_DESCRIPTION_PROJECT_CREATION; -import static org.sonar.server.newcodeperiod.NewCodeDefinitionResolver.checkNewCodeDefinitionParam; +import static org.sonar.server.common.newcodeperiod.NewCodeDefinitionResolver.NEW_CODE_PERIOD_TYPE_DESCRIPTION_PROJECT_CREATION; +import static org.sonar.server.common.newcodeperiod.NewCodeDefinitionResolver.NEW_CODE_PERIOD_VALUE_DESCRIPTION_PROJECT_CREATION; +import static org.sonar.server.common.newcodeperiod.NewCodeDefinitionResolver.checkNewCodeDefinitionParam; import static org.sonar.server.ws.WsUtils.writeProtobuf; import static org.sonarqube.ws.client.project.ProjectsWsParameters.PARAM_NEW_CODE_DEFINITION_TYPE; import static org.sonarqube.ws.client.project.ProjectsWsParameters.PARAM_NEW_CODE_DEFINITION_VALUE; diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/almintegration/ws/gitlab/ImportGitLabProjectAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/almintegration/ws/gitlab/ImportGitLabProjectAction.java index 264596f06f2..dc5e0ca7e0a 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/almintegration/ws/gitlab/ImportGitLabProjectAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/almintegration/ws/gitlab/ImportGitLabProjectAction.java @@ -33,13 +33,13 @@ import org.sonar.db.component.BranchDto; import org.sonar.db.project.ProjectDto; import org.sonar.server.almintegration.ws.AlmIntegrationsWsAction; import org.sonar.server.almintegration.ws.ImportHelper; -import org.sonar.server.almsettings.ws.DevOpsProjectCreator; -import org.sonar.server.almsettings.ws.DevOpsProjectDescriptor; -import org.sonar.server.almsettings.ws.gitlab.GitlabProjectCreatorFactory; +import org.sonar.server.common.almsettings.DevOpsProjectCreator; +import org.sonar.server.common.almsettings.DevOpsProjectDescriptor; +import org.sonar.server.common.almsettings.gitlab.GitlabProjectCreatorFactory; import org.sonar.server.component.ComponentCreationData; -import org.sonar.server.component.ComponentUpdater; +import org.sonar.server.common.component.ComponentUpdater; import org.sonar.server.exceptions.BadRequestException; -import org.sonar.server.newcodeperiod.NewCodeDefinitionResolver; +import org.sonar.server.common.newcodeperiod.NewCodeDefinitionResolver; import org.sonar.server.user.UserSession; import org.sonarqube.ws.Projects.CreateWsResponse; @@ -47,9 +47,9 @@ import static java.util.Objects.requireNonNull; import static org.sonar.db.project.CreationMethod.getCreationMethod; import static org.sonar.db.project.CreationMethod.Category.ALM_IMPORT; import static org.sonar.server.almintegration.ws.ImportHelper.PARAM_ALM_SETTING; -import static org.sonar.server.newcodeperiod.NewCodeDefinitionResolver.NEW_CODE_PERIOD_TYPE_DESCRIPTION_PROJECT_CREATION; -import static org.sonar.server.newcodeperiod.NewCodeDefinitionResolver.NEW_CODE_PERIOD_VALUE_DESCRIPTION_PROJECT_CREATION; -import static org.sonar.server.newcodeperiod.NewCodeDefinitionResolver.checkNewCodeDefinitionParam; +import static org.sonar.server.common.newcodeperiod.NewCodeDefinitionResolver.NEW_CODE_PERIOD_TYPE_DESCRIPTION_PROJECT_CREATION; +import static org.sonar.server.common.newcodeperiod.NewCodeDefinitionResolver.NEW_CODE_PERIOD_VALUE_DESCRIPTION_PROJECT_CREATION; +import static org.sonar.server.common.newcodeperiod.NewCodeDefinitionResolver.checkNewCodeDefinitionParam; import static org.sonar.server.ws.WsUtils.writeProtobuf; import static org.sonarqube.ws.client.project.ProjectsWsParameters.PARAM_NEW_CODE_DEFINITION_TYPE; import static org.sonarqube.ws.client.project.ProjectsWsParameters.PARAM_NEW_CODE_DEFINITION_VALUE; diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/ce/queue/ReportSubmitter.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/ce/queue/ReportSubmitter.java index 84de5ba534d..7a86d12ee74 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/ce/queue/ReportSubmitter.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/ce/queue/ReportSubmitter.java @@ -38,14 +38,14 @@ import org.sonar.db.ce.CeTaskTypes; import org.sonar.db.component.BranchDto; import org.sonar.db.component.ComponentDto; import org.sonar.db.permission.GlobalPermission; -import org.sonar.server.almsettings.ws.DevOpsProjectCreator; -import org.sonar.server.almsettings.ws.DevOpsProjectCreatorFactory; +import org.sonar.server.common.almsettings.DevOpsProjectCreator; +import org.sonar.server.common.almsettings.DevOpsProjectCreatorFactory; import org.sonar.server.component.ComponentCreationData; -import org.sonar.server.component.ComponentUpdater; +import org.sonar.server.common.component.ComponentUpdater; import org.sonar.server.exceptions.BadRequestException; import org.sonar.server.management.ManagedInstanceService; -import org.sonar.server.permission.PermissionTemplateService; -import org.sonar.server.project.ws.ProjectCreator; +import org.sonar.server.common.permission.PermissionTemplateService; +import org.sonar.server.common.project.ProjectCreator; import org.sonar.server.user.UserSession; import static java.lang.String.format; diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/newcodeperiod/ws/SetAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/newcodeperiod/ws/SetAction.java index 60c581f6acc..dc5a067e5ba 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/newcodeperiod/ws/SetAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/newcodeperiod/ws/SetAction.java @@ -42,7 +42,7 @@ import org.sonar.db.newcodeperiod.NewCodePeriodType; import org.sonar.db.project.ProjectDto; import org.sonar.server.component.ComponentFinder; import org.sonar.server.exceptions.NotFoundException; -import org.sonar.server.newcodeperiod.CaycUtils; +import org.sonar.server.common.newcodeperiod.CaycUtils; import org.sonar.server.user.UserSession; import static com.google.common.base.Preconditions.checkArgument; diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/newcodeperiod/ws/UnsetAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/newcodeperiod/ws/UnsetAction.java index 92609739a83..b656e4c2e23 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/newcodeperiod/ws/UnsetAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/newcodeperiod/ws/UnsetAction.java @@ -34,7 +34,7 @@ import org.sonar.db.newcodeperiod.NewCodePeriodDao; import org.sonar.db.project.ProjectDto; import org.sonar.server.component.ComponentFinder; import org.sonar.server.exceptions.NotFoundException; -import org.sonar.server.newcodeperiod.CaycUtils; +import org.sonar.server.common.newcodeperiod.CaycUtils; import org.sonar.server.user.UserSession; import static java.lang.String.format; diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/ws/AddGroupAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/ws/AddGroupAction.java index aef48dd5404..43d07ffe23a 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/ws/AddGroupAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/ws/AddGroupAction.java @@ -29,10 +29,10 @@ import org.sonar.db.DbSession; import org.sonar.db.entity.EntityDto; import org.sonar.db.user.GroupDto; import org.sonar.server.common.management.ManagedInstanceChecker; -import org.sonar.server.permission.GroupPermissionChange; +import org.sonar.server.common.permission.GroupPermissionChange; import org.sonar.server.common.permission.Operation; import org.sonar.server.permission.PermissionService; -import org.sonar.server.permission.PermissionUpdater; +import org.sonar.server.common.permission.PermissionUpdater; import org.sonar.server.user.UserSession; import static org.sonar.server.permission.ws.WsParameters.createGroupNameParameter; diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/ws/AddUserAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/ws/AddUserAction.java index ea06411099d..d2d8203a986 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/ws/AddUserAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/ws/AddUserAction.java @@ -30,8 +30,8 @@ import org.sonar.db.user.UserId; import org.sonar.server.common.management.ManagedInstanceChecker; import org.sonar.server.common.permission.Operation; import org.sonar.server.permission.PermissionService; -import org.sonar.server.permission.PermissionUpdater; -import org.sonar.server.permission.UserPermissionChange; +import org.sonar.server.common.permission.PermissionUpdater; +import org.sonar.server.common.permission.UserPermissionChange; import org.sonar.server.user.UserSession; import static java.util.Collections.singletonList; diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/ws/RemoveGroupAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/ws/RemoveGroupAction.java index 1cf108198bc..80933e06d99 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/ws/RemoveGroupAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/ws/RemoveGroupAction.java @@ -28,11 +28,11 @@ import org.sonar.db.DbSession; import org.sonar.db.entity.EntityDto; import org.sonar.db.user.GroupDto; import org.sonar.server.common.management.ManagedInstanceChecker; -import org.sonar.server.permission.GroupPermissionChange; +import org.sonar.server.common.permission.GroupPermissionChange; import org.sonar.server.permission.GroupUuidOrAnyone; import org.sonar.server.common.permission.Operation; import org.sonar.server.permission.PermissionService; -import org.sonar.server.permission.PermissionUpdater; +import org.sonar.server.common.permission.PermissionUpdater; import org.sonar.server.user.UserSession; import static java.util.Collections.singletonList; diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/ws/RemoveUserAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/ws/RemoveUserAction.java index b902a82d6f2..6ec116a2d3d 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/ws/RemoveUserAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/ws/RemoveUserAction.java @@ -29,8 +29,8 @@ import org.sonar.db.user.UserId; import org.sonar.server.common.management.ManagedInstanceChecker; import org.sonar.server.common.permission.Operation; import org.sonar.server.permission.PermissionService; -import org.sonar.server.permission.PermissionUpdater; -import org.sonar.server.permission.UserPermissionChange; +import org.sonar.server.common.permission.PermissionUpdater; +import org.sonar.server.common.permission.UserPermissionChange; import org.sonar.server.user.UserSession; import static java.util.Collections.singletonList; diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/ws/template/ApplyTemplateAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/ws/template/ApplyTemplateAction.java index 58503cd8ee8..dcd4325dc70 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/ws/template/ApplyTemplateAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/ws/template/ApplyTemplateAction.java @@ -33,7 +33,7 @@ import org.sonar.db.entity.EntityDto; import org.sonar.db.permission.template.PermissionTemplateDto; import org.sonar.server.exceptions.NotFoundException; import org.sonar.server.common.management.ManagedInstanceChecker; -import org.sonar.server.permission.PermissionTemplateService; +import org.sonar.server.common.permission.PermissionTemplateService; import org.sonar.server.permission.ws.PermissionWsSupport; import org.sonar.server.permission.ws.PermissionsWsAction; import org.sonar.server.permission.ws.ProjectWsRef; diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/ws/template/BulkApplyTemplateAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/ws/template/BulkApplyTemplateAction.java index c5757b06995..e5270df26aa 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/ws/template/BulkApplyTemplateAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/ws/template/BulkApplyTemplateAction.java @@ -43,7 +43,7 @@ import org.sonar.db.component.ComponentQuery; import org.sonar.db.entity.EntityDto; import org.sonar.db.permission.template.PermissionTemplateDto; import org.sonar.server.management.ManagedProjectService; -import org.sonar.server.permission.PermissionTemplateService; +import org.sonar.server.common.permission.PermissionTemplateService; import org.sonar.server.permission.ws.PermissionWsSupport; import org.sonar.server.permission.ws.PermissionsWsAction; import org.sonar.server.permission.ws.WsParameters; diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/ws/template/DeleteTemplateAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/ws/template/DeleteTemplateAction.java index 270aeb6268b..d60696baa9c 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/ws/template/DeleteTemplateAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/ws/template/DeleteTemplateAction.java @@ -27,8 +27,8 @@ import org.sonar.api.server.ws.WebService; import org.sonar.db.DbClient; import org.sonar.db.DbSession; import org.sonar.db.permission.template.PermissionTemplateDto; -import org.sonar.server.permission.DefaultTemplatesResolver; -import org.sonar.server.permission.DefaultTemplatesResolver.ResolvedDefaultTemplates; +import org.sonar.server.common.permission.DefaultTemplatesResolver; +import org.sonar.server.common.permission.DefaultTemplatesResolver.ResolvedDefaultTemplates; import org.sonar.server.permission.ws.PermissionWsSupport; import org.sonar.server.permission.ws.PermissionsWsAction; import org.sonar.server.permission.ws.WsParameters; diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/ws/template/SearchTemplatesAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/ws/template/SearchTemplatesAction.java index 4387439169b..e71c075ccfc 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/ws/template/SearchTemplatesAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/ws/template/SearchTemplatesAction.java @@ -36,8 +36,8 @@ import org.sonar.db.DbSession; import org.sonar.db.permission.template.CountByTemplateAndPermissionDto; import org.sonar.db.permission.template.PermissionTemplateCharacteristicDto; import org.sonar.db.permission.template.PermissionTemplateDto; -import org.sonar.server.permission.DefaultTemplatesResolver; -import org.sonar.server.permission.DefaultTemplatesResolver.ResolvedDefaultTemplates; +import org.sonar.server.common.permission.DefaultTemplatesResolver; +import org.sonar.server.common.permission.DefaultTemplatesResolver.ResolvedDefaultTemplates; import org.sonar.server.permission.PermissionService; import org.sonar.server.permission.ws.PermissionsWsAction; import org.sonar.server.user.UserSession; diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/ws/template/SearchTemplatesData.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/ws/template/SearchTemplatesData.java index d5f52297710..733e859ab77 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/ws/template/SearchTemplatesData.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/ws/template/SearchTemplatesData.java @@ -22,7 +22,7 @@ package org.sonar.server.permission.ws.template; import com.google.common.collect.Table; import java.util.List; import org.sonar.db.permission.template.PermissionTemplateDto; -import org.sonar.server.permission.DefaultTemplatesResolver.ResolvedDefaultTemplates; +import org.sonar.server.common.permission.DefaultTemplatesResolver.ResolvedDefaultTemplates; import static com.google.common.base.MoreObjects.firstNonNull; import static com.google.common.base.Preconditions.checkState; diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/project/ws/CreateAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/project/ws/CreateAction.java index 9dde9e80e4c..d76aff13413 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/project/ws/CreateAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/project/ws/CreateAction.java @@ -32,10 +32,10 @@ import org.sonar.db.component.BranchDto; import org.sonar.db.entity.EntityDto; import org.sonar.db.project.ProjectDto; import org.sonar.server.component.ComponentCreationData; -import org.sonar.server.component.ComponentCreationParameters; -import org.sonar.server.component.ComponentUpdater; -import org.sonar.server.component.NewComponent; -import org.sonar.server.newcodeperiod.NewCodeDefinitionResolver; +import org.sonar.server.common.component.ComponentCreationParameters; +import org.sonar.server.common.component.ComponentUpdater; +import org.sonar.server.common.component.NewComponent; +import org.sonar.server.common.newcodeperiod.NewCodeDefinitionResolver; import org.sonar.server.project.DefaultBranchNameResolver; import org.sonar.server.project.ProjectDefaultVisibility; import org.sonar.server.project.Visibility; @@ -50,10 +50,10 @@ import static org.sonar.db.component.ComponentValidator.MAX_COMPONENT_NAME_LENGT import static org.sonar.db.permission.GlobalPermission.PROVISION_PROJECTS; import static org.sonar.db.project.CreationMethod.Category.LOCAL; import static org.sonar.db.project.CreationMethod.getCreationMethod; -import static org.sonar.server.component.NewComponent.newComponentBuilder; -import static org.sonar.server.newcodeperiod.NewCodeDefinitionResolver.NEW_CODE_PERIOD_TYPE_DESCRIPTION_PROJECT_CREATION; -import static org.sonar.server.newcodeperiod.NewCodeDefinitionResolver.NEW_CODE_PERIOD_VALUE_DESCRIPTION_PROJECT_CREATION; -import static org.sonar.server.newcodeperiod.NewCodeDefinitionResolver.checkNewCodeDefinitionParam; +import static org.sonar.server.common.component.NewComponent.newComponentBuilder; +import static org.sonar.server.common.newcodeperiod.NewCodeDefinitionResolver.NEW_CODE_PERIOD_TYPE_DESCRIPTION_PROJECT_CREATION; +import static org.sonar.server.common.newcodeperiod.NewCodeDefinitionResolver.NEW_CODE_PERIOD_VALUE_DESCRIPTION_PROJECT_CREATION; +import static org.sonar.server.common.newcodeperiod.NewCodeDefinitionResolver.checkNewCodeDefinitionParam; 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.project.ProjectsWsParameters.ACTION_CREATE; diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/project/ws/ProjectsWsModule.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/project/ws/ProjectsWsModule.java index 358b9317b5b..70ac999aee8 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/project/ws/ProjectsWsModule.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/project/ws/ProjectsWsModule.java @@ -20,6 +20,7 @@ package org.sonar.server.project.ws; import org.sonar.core.platform.Module; +import org.sonar.server.common.project.ProjectCreator; import org.sonar.server.project.ProjectDefaultVisibility; import org.sonar.server.project.ProjectLifeCycleListenersImpl; diff --git a/server/sonar-webserver-webapi/src/test/java/org/sonar/server/component/NewComponentTest.java b/server/sonar-webserver-webapi/src/test/java/org/sonar/server/component/NewComponentTest.java index dd29147cdf8..4553c0bc973 100644 --- a/server/sonar-webserver-webapi/src/test/java/org/sonar/server/component/NewComponentTest.java +++ b/server/sonar-webserver-webapi/src/test/java/org/sonar/server/component/NewComponentTest.java @@ -20,13 +20,14 @@ package org.sonar.server.component; import org.junit.Test; +import org.sonar.server.common.component.NewComponent; import static com.google.common.base.Strings.repeat; import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.sonar.api.resources.Qualifiers.PROJECT; -import static org.sonar.server.component.NewComponent.newComponentBuilder; +import static org.sonar.server.common.component.NewComponent.newComponentBuilder; public class NewComponentTest { private static final String KEY = "key"; diff --git a/server/sonar-webserver-webapi/src/test/java/org/sonar/server/permission/ws/template/SearchTemplatesDataTest.java b/server/sonar-webserver-webapi/src/test/java/org/sonar/server/permission/ws/template/SearchTemplatesDataTest.java index b17b456e942..621fc056d7d 100644 --- a/server/sonar-webserver-webapi/src/test/java/org/sonar/server/permission/ws/template/SearchTemplatesDataTest.java +++ b/server/sonar-webserver-webapi/src/test/java/org/sonar/server/permission/ws/template/SearchTemplatesDataTest.java @@ -21,7 +21,7 @@ package org.sonar.server.permission.ws.template; import com.google.common.collect.HashBasedTable; import org.junit.Test; -import org.sonar.server.permission.DefaultTemplatesResolverImpl; +import org.sonar.server.common.permission.DefaultTemplatesResolverImpl; import static java.util.Collections.singletonList; import static org.assertj.core.api.Assertions.assertThatThrownBy; diff --git a/server/sonar-webserver/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel4.java b/server/sonar-webserver/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel4.java index bdf8daafc69..a4056d43a92 100644 --- a/server/sonar-webserver/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel4.java +++ b/server/sonar-webserver/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel4.java @@ -63,13 +63,13 @@ import org.sonar.core.platform.SpringComponentContainer; import org.sonar.server.almintegration.ws.AlmIntegrationsWSModule; import org.sonar.server.almintegration.ws.CredentialsEncoderHelper; import org.sonar.server.almintegration.ws.ImportHelper; -import org.sonar.server.almintegration.ws.ProjectKeyGenerator; +import org.sonar.server.common.almintegration.ProjectKeyGenerator; import org.sonar.server.almintegration.ws.github.GithubProvisioningWs; import org.sonar.server.almsettings.MultipleAlmFeature; import org.sonar.server.almsettings.ws.AlmSettingsWsModule; -import org.sonar.server.almsettings.ws.DelegatingDevOpsProjectCreatorFactory; -import org.sonar.server.almsettings.ws.GithubProjectCreatorFactory; -import org.sonar.server.almsettings.ws.gitlab.GitlabProjectCreatorFactory; +import org.sonar.server.common.almsettings.DelegatingDevOpsProjectCreatorFactory; +import org.sonar.server.common.almsettings.github.GithubProjectCreatorFactory; +import org.sonar.server.common.almsettings.gitlab.GitlabProjectCreatorFactory; import org.sonar.server.authentication.AuthenticationModule; import org.sonar.server.authentication.DefaultAdminCredentialsVerifierImpl; import org.sonar.server.authentication.DefaultAdminCredentialsVerifierNotificationHandler; @@ -92,7 +92,7 @@ import org.sonar.server.common.text.MacroInterpreter; import org.sonar.server.component.ComponentCleanerService; import org.sonar.server.component.ComponentFinder; import org.sonar.server.component.ComponentService; -import org.sonar.server.component.ComponentUpdater; +import org.sonar.server.common.component.ComponentUpdater; import org.sonar.server.component.index.ComponentIndex; import org.sonar.server.component.index.ComponentIndexDefinition; import org.sonar.server.component.index.EntityDefinitionIndexer; @@ -159,15 +159,15 @@ import org.sonar.server.monitoring.devops.AzureMetricsTask; import org.sonar.server.monitoring.devops.BitbucketMetricsTask; import org.sonar.server.monitoring.devops.GithubMetricsTask; import org.sonar.server.monitoring.devops.GitlabMetricsTask; -import org.sonar.server.newcodeperiod.NewCodeDefinitionResolver; +import org.sonar.server.common.newcodeperiod.NewCodeDefinitionResolver; import org.sonar.server.newcodeperiod.ws.NewCodePeriodsWsModule; import org.sonar.server.notification.NotificationModule; import org.sonar.server.notification.ws.NotificationWsModule; -import org.sonar.server.permission.DefaultTemplatesResolverImpl; -import org.sonar.server.permission.GroupPermissionChanger; -import org.sonar.server.permission.PermissionTemplateService; -import org.sonar.server.permission.PermissionUpdater; -import org.sonar.server.permission.UserPermissionChanger; +import org.sonar.server.common.permission.DefaultTemplatesResolverImpl; +import org.sonar.server.common.permission.GroupPermissionChanger; +import org.sonar.server.common.permission.PermissionTemplateService; +import org.sonar.server.common.permission.PermissionUpdater; +import org.sonar.server.common.permission.UserPermissionChanger; import org.sonar.server.permission.index.PermissionIndexer; import org.sonar.server.permission.ws.PermissionsWsModule; import org.sonar.server.platform.ClusterVerification; -- 2.39.5