aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-db-dao/src/main/java/org/sonar/db
diff options
context:
space:
mode:
authorZipeng WU <zipeng.wu@sonarsource.com>2021-06-23 16:53:09 +0200
committersonartech <sonartech@sonarsource.com>2021-07-07 20:03:24 +0000
commit24036f4a57961c5652bfa0508f6544cc66085596 (patch)
treecc93f366a59a1089e0757c48926fe1d4f300d87f /server/sonar-db-dao/src/main/java/org/sonar/db
parent71fa583b7015d05cec603d3829a2616e9e18c2f3 (diff)
downloadsonarqube-24036f4a57961c5652bfa0508f6544cc66085596.tar.gz
sonarqube-24036f4a57961c5652bfa0508f6544cc66085596.zip
SONAR-10762 Drop Custom Measures WS
Diffstat (limited to 'server/sonar-db-dao/src/main/java/org/sonar/db')
-rw-r--r--server/sonar-db-dao/src/main/java/org/sonar/db/DaoModule.java2
-rw-r--r--server/sonar-db-dao/src/main/java/org/sonar/db/DbClient.java7
-rw-r--r--server/sonar-db-dao/src/main/java/org/sonar/db/MyBatis.java4
-rw-r--r--server/sonar-db-dao/src/main/java/org/sonar/db/measure/custom/CustomMeasureDao.java90
-rw-r--r--server/sonar-db-dao/src/main/java/org/sonar/db/measure/custom/CustomMeasureDto.java118
-rw-r--r--server/sonar-db-dao/src/main/java/org/sonar/db/measure/custom/CustomMeasureMapper.java48
-rw-r--r--server/sonar-db-dao/src/main/java/org/sonar/db/measure/custom/package-info.java24
7 files changed, 0 insertions, 293 deletions
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/DaoModule.java b/server/sonar-db-dao/src/main/java/org/sonar/db/DaoModule.java
index fd1b10d8755..529d9778530 100644
--- a/server/sonar-db-dao/src/main/java/org/sonar/db/DaoModule.java
+++ b/server/sonar-db-dao/src/main/java/org/sonar/db/DaoModule.java
@@ -48,7 +48,6 @@ import org.sonar.db.issue.IssueDao;
import org.sonar.db.mapping.ProjectMappingsDao;
import org.sonar.db.measure.LiveMeasureDao;
import org.sonar.db.measure.MeasureDao;
-import org.sonar.db.measure.custom.CustomMeasureDao;
import org.sonar.db.metric.MetricDao;
import org.sonar.db.newcodeperiod.NewCodePeriodDao;
import org.sonar.db.notification.NotificationQueueDao;
@@ -108,7 +107,6 @@ public class DaoModule extends Module {
CeTaskMessageDao.class,
ComponentDao.class,
ComponentKeyUpdaterDao.class,
- CustomMeasureDao.class,
DefaultQProfileDao.class,
DuplicationDao.class,
EsQueueDao.class,
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/DbClient.java b/server/sonar-db-dao/src/main/java/org/sonar/db/DbClient.java
index d856c50465a..8b1235d78af 100644
--- a/server/sonar-db-dao/src/main/java/org/sonar/db/DbClient.java
+++ b/server/sonar-db-dao/src/main/java/org/sonar/db/DbClient.java
@@ -46,7 +46,6 @@ import org.sonar.db.issue.IssueDao;
import org.sonar.db.mapping.ProjectMappingsDao;
import org.sonar.db.measure.LiveMeasureDao;
import org.sonar.db.measure.MeasureDao;
-import org.sonar.db.measure.custom.CustomMeasureDao;
import org.sonar.db.metric.MetricDao;
import org.sonar.db.newcodeperiod.NewCodePeriodDao;
import org.sonar.db.notification.NotificationQueueDao;
@@ -135,7 +134,6 @@ public class DbClient {
private final ProjectQgateAssociationDao projectQgateAssociationDao;
private final DuplicationDao duplicationDao;
private final NotificationQueueDao notificationQueueDao;
- private final CustomMeasureDao customMeasureDao;
private final MetricDao metricDao;
private final GroupDao groupDao;
private final RuleDao ruleDao;
@@ -210,7 +208,6 @@ public class DbClient {
projectQgateAssociationDao = getDao(map, ProjectQgateAssociationDao.class);
duplicationDao = getDao(map, DuplicationDao.class);
notificationQueueDao = getDao(map, NotificationQueueDao.class);
- customMeasureDao = getDao(map, CustomMeasureDao.class);
metricDao = getDao(map, MetricDao.class);
groupDao = getDao(map, GroupDao.class);
ruleDao = getDao(map, RuleDao.class);
@@ -418,10 +415,6 @@ public class DbClient {
return notificationQueueDao;
}
- public CustomMeasureDao customMeasureDao() {
- return customMeasureDao;
- }
-
public MetricDao metricDao() {
return metricDao;
}
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/MyBatis.java b/server/sonar-db-dao/src/main/java/org/sonar/db/MyBatis.java
index 58239037854..e19514ae10a 100644
--- a/server/sonar-db-dao/src/main/java/org/sonar/db/MyBatis.java
+++ b/server/sonar-db-dao/src/main/java/org/sonar/db/MyBatis.java
@@ -78,8 +78,6 @@ import org.sonar.db.mapping.ProjectMappingsMapper;
import org.sonar.db.measure.LiveMeasureMapper;
import org.sonar.db.measure.MeasureDto;
import org.sonar.db.measure.MeasureMapper;
-import org.sonar.db.measure.custom.CustomMeasureDto;
-import org.sonar.db.measure.custom.CustomMeasureMapper;
import org.sonar.db.metric.MetricMapper;
import org.sonar.db.newcodeperiod.NewCodePeriodMapper;
import org.sonar.db.notification.NotificationQueueDto;
@@ -175,7 +173,6 @@ public class MyBatis implements Startable {
confBuilder.loadAlias("Component", ComponentDto.class);
confBuilder.loadAlias("ComponentWithModuleUuid", ComponentWithModuleUuidDto.class);
confBuilder.loadAlias("ComponentWithSnapshot", ComponentDtoWithSnapshotId.class);
- confBuilder.loadAlias("CustomMeasure", CustomMeasureDto.class);
confBuilder.loadAlias("DuplicationUnit", DuplicationUnitDto.class);
confBuilder.loadAlias("Event", EventDto.class);
confBuilder.loadAlias("FilePathWithHash", FilePathWithHashDto.class);
@@ -237,7 +234,6 @@ public class MyBatis implements Startable {
ComponentKeyUpdaterMapper.class,
ComponentMapper.class,
LiveMeasureMapper.class,
- CustomMeasureMapper.class,
DefaultQProfileMapper.class,
DuplicationMapper.class,
EsQueueMapper.class,
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/measure/custom/CustomMeasureDao.java b/server/sonar-db-dao/src/main/java/org/sonar/db/measure/custom/CustomMeasureDao.java
deleted file mode 100644
index b1dff16500d..00000000000
--- a/server/sonar-db-dao/src/main/java/org/sonar/db/measure/custom/CustomMeasureDao.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2021 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.sonar.db.measure.custom;
-
-import java.util.List;
-import java.util.Optional;
-import org.apache.ibatis.session.RowBounds;
-import org.sonar.core.util.UuidFactory;
-import org.sonar.db.Dao;
-import org.sonar.db.DatabaseUtils;
-import org.sonar.db.DbSession;
-
-import static java.util.Optional.ofNullable;
-
-public class CustomMeasureDao implements Dao {
- private final UuidFactory uuidFactory;
-
- public CustomMeasureDao(UuidFactory uuidFactory) {
- this.uuidFactory = uuidFactory;
- }
-
- public void insert(DbSession session, CustomMeasureDto customMeasureDto) {
- customMeasureDto.setUuid(uuidFactory.create());
- mapper(session).insert(customMeasureDto);
- }
-
- public void update(DbSession session, CustomMeasureDto customMeasure) {
- mapper(session).update(customMeasure);
- }
-
- public void delete(DbSession session, String uuid) {
- mapper(session).delete(uuid);
- }
-
- public void deleteByMetricUuids(DbSession session, List<String> metricUuids) {
- DatabaseUtils.executeLargeInputsWithoutOutput(metricUuids, input -> mapper(session).deleteByMetricUuids(metricUuids));
- }
-
- public Optional<CustomMeasureDto> selectByUuid(DbSession session, String uuid) {
- return ofNullable(mapper(session).selectByUuid(uuid));
- }
-
- public List<CustomMeasureDto> selectByMetricUuid(DbSession session, String metricUuid) {
- return mapper(session).selectByMetricUuid(metricUuid);
- }
-
- public int countByComponentIdAndMetricUuid(DbSession session, String componentUuid, String metricUuid) {
- return mapper(session).countByComponentIdAndMetricUuid(componentUuid, metricUuid);
- }
-
- public List<CustomMeasureDto> selectByComponentUuid(DbSession session, String componentUuid, int offset, int limit) {
- return mapper(session).selectByComponentUuid(componentUuid, new RowBounds(offset, limit));
- }
-
- public List<CustomMeasureDto> selectByComponentUuid(DbSession session, String componentUuid) {
- return mapper(session).selectByComponentUuid(componentUuid);
- }
-
- /**
- * Used by Views plugin
- */
- public List<CustomMeasureDto> selectByMetricKeyAndTextValue(DbSession session, String metricKey, String textValue) {
- return mapper(session).selectByMetricKeyAndTextValue(metricKey, textValue);
- }
-
- private static CustomMeasureMapper mapper(DbSession session) {
- return session.getMapper(CustomMeasureMapper.class);
- }
-
- public int countByComponentUuid(DbSession dbSession, String uuid) {
- return mapper(dbSession).countByComponentUuid(uuid);
- }
-}
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/measure/custom/CustomMeasureDto.java b/server/sonar-db-dao/src/main/java/org/sonar/db/measure/custom/CustomMeasureDto.java
deleted file mode 100644
index e01dcdf9616..00000000000
--- a/server/sonar-db-dao/src/main/java/org/sonar/db/measure/custom/CustomMeasureDto.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2021 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.sonar.db.measure.custom;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-
-public class CustomMeasureDto {
- private String uuid = null;
- private String metricUuid = null;
- private String componentUuid = null;
- private double value = 0.0D;
- private String textValue = null;
- private String userUuid = null;
- private String description = null;
- private long createdAt = 0L;
- private long updatedAt = 0L;
-
- public String getUuid() {
- return uuid;
- }
-
- public CustomMeasureDto setUuid(String uuid) {
- this.uuid = uuid;
- return this;
- }
-
- @CheckForNull
- public String getDescription() {
- return description;
- }
-
- public CustomMeasureDto setDescription(@Nullable String description) {
- this.description = description;
- return this;
- }
-
- public String getUserUuid() {
- return userUuid;
- }
-
- public CustomMeasureDto setUserUuid(String userUuid) {
- this.userUuid = userUuid;
- return this;
- }
-
- @CheckForNull
- public String getTextValue() {
- return textValue;
- }
-
- public CustomMeasureDto setTextValue(@Nullable String textValue) {
- this.textValue = textValue;
- return this;
- }
-
- public double getValue() {
- return value;
- }
-
- public CustomMeasureDto setValue(double value) {
- this.value = value;
- return this;
- }
-
- public String getMetricUuid() {
- return metricUuid;
- }
-
- public CustomMeasureDto setMetricUuid(String metricUuid) {
- this.metricUuid = metricUuid;
- return this;
- }
-
- public long getUpdatedAt() {
- return updatedAt;
- }
-
- public CustomMeasureDto setUpdatedAt(long updatedAt) {
- this.updatedAt = updatedAt;
- return this;
- }
-
- public long getCreatedAt() {
- return createdAt;
- }
-
- public CustomMeasureDto setCreatedAt(long createdAt) {
- this.createdAt = createdAt;
- return this;
- }
-
- public String getComponentUuid() {
- return componentUuid;
- }
-
- public CustomMeasureDto setComponentUuid(String componentUuid) {
- this.componentUuid = componentUuid;
- return this;
- }
-}
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/measure/custom/CustomMeasureMapper.java b/server/sonar-db-dao/src/main/java/org/sonar/db/measure/custom/CustomMeasureMapper.java
deleted file mode 100644
index d182072711e..00000000000
--- a/server/sonar-db-dao/src/main/java/org/sonar/db/measure/custom/CustomMeasureMapper.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2021 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.sonar.db.measure.custom;
-
-import java.util.List;
-import org.apache.ibatis.annotations.Param;
-import org.apache.ibatis.session.RowBounds;
-
-public interface CustomMeasureMapper {
- void insert(CustomMeasureDto customMeasure);
-
- void update(CustomMeasureDto customMeasure);
-
- void delete(String uuid);
-
- void deleteByMetricUuids(@Param("metricUuids") List<String> metricUuids);
-
- CustomMeasureDto selectByUuid(String uuid);
-
- List<CustomMeasureDto> selectByMetricUuid(String uuid);
-
- List<CustomMeasureDto> selectByComponentUuid(String s);
-
- List<CustomMeasureDto> selectByComponentUuid(String s, RowBounds rowBounds);
-
- List<CustomMeasureDto> selectByMetricKeyAndTextValue(@Param("metricKey") String metricKey, @Param("textValue") String textValue);
-
- int countByComponentUuid(String componentUuid);
-
- int countByComponentIdAndMetricUuid(@Param("componentUuid") String componentUuid, @Param("metricUuid") String metricUuid);
-}
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/measure/custom/package-info.java b/server/sonar-db-dao/src/main/java/org/sonar/db/measure/custom/package-info.java
deleted file mode 100644
index bd54944af8f..00000000000
--- a/server/sonar-db-dao/src/main/java/org/sonar/db/measure/custom/package-info.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2021 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.db.measure.custom;
-
-import javax.annotation.ParametersAreNonnullByDefault;
-