diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2016-09-11 17:55:56 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2016-09-12 14:11:59 +0200 |
commit | 3499984a4c4f3d947b6df953e608cb365722653b (patch) | |
tree | 6ac7fead41a894e7e9106c94583734071e2de762 /sonar-db/src/main/java/org/sonar | |
parent | ebf5bc8d636de531208728977cf60eea8234a3d5 (diff) | |
download | sonarqube-3499984a4c4f3d947b6df953e608cb365722653b.tar.gz sonarqube-3499984a4c4f3d947b6df953e608cb365722653b.zip |
SONAR-7851 drop ActivityDao
Diffstat (limited to 'sonar-db/src/main/java/org/sonar')
7 files changed, 46 insertions, 228 deletions
diff --git a/sonar-db/src/main/java/org/sonar/db/DaoModule.java b/sonar-db/src/main/java/org/sonar/db/DaoModule.java index 630f07632b9..f5b260d894b 100644 --- a/sonar-db/src/main/java/org/sonar/db/DaoModule.java +++ b/sonar-db/src/main/java/org/sonar/db/DaoModule.java @@ -22,7 +22,6 @@ package org.sonar.db; import com.google.common.collect.ImmutableList; import java.util.List; import org.sonar.core.platform.Module; -import org.sonar.db.activity.ActivityDao; import org.sonar.db.ce.CeActivityDao; import org.sonar.db.ce.CeQueueDao; import org.sonar.db.ce.CeScannerContextDao; @@ -76,7 +75,6 @@ import org.sonar.db.user.UserTokenDao; public class DaoModule extends Module { private static final List<Class<? extends Dao>> classes = ImmutableList.<Class<? extends Dao>>builder().add( ActiveDashboardDao.class, - ActivityDao.class, AuthorDao.class, AuthorizationDao.class, CeActivityDao.class, diff --git a/sonar-db/src/main/java/org/sonar/db/DbClient.java b/sonar-db/src/main/java/org/sonar/db/DbClient.java index ceabd8c62ae..fd81cdee798 100644 --- a/sonar-db/src/main/java/org/sonar/db/DbClient.java +++ b/sonar-db/src/main/java/org/sonar/db/DbClient.java @@ -22,7 +22,6 @@ package org.sonar.db; import java.util.IdentityHashMap; import java.util.Map; import javax.annotation.Nullable; -import org.sonar.db.activity.ActivityDao; import org.sonar.db.ce.CeActivityDao; import org.sonar.db.ce.CeQueueDao; import org.sonar.db.ce.CeScannerContextDao; @@ -88,7 +87,6 @@ public class DbClient { private final MeasureDao measureDao; private final MeasureFilterDao measureFilterDao; private final MeasureFilterFavouriteDao measureFilterFavouriteDao; - private final ActivityDao activityDao; private final AuthorizationDao authorizationDao; private final UserDao userDao; private final UserGroupDao userGroupDao; @@ -147,7 +145,6 @@ public class DbClient { measureDao = getDao(map, MeasureDao.class); measureFilterDao = getDao(map, MeasureFilterDao.class); measureFilterFavouriteDao = getDao(map, MeasureFilterFavouriteDao.class); - activityDao = getDao(map, ActivityDao.class); authorizationDao = getDao(map, AuthorizationDao.class); userDao = getDao(map, UserDao.class); userGroupDao = getDao(map, UserGroupDao.class); @@ -260,10 +257,6 @@ public class DbClient { return measureFilterFavouriteDao; } - public ActivityDao activityDao() { - return activityDao; - } - public AuthorizationDao authorizationDao() { return authorizationDao; } diff --git a/sonar-db/src/main/java/org/sonar/db/MyBatis.java b/sonar-db/src/main/java/org/sonar/db/MyBatis.java index ca25a31117a..6fd6e6e7641 100644 --- a/sonar-db/src/main/java/org/sonar/db/MyBatis.java +++ b/sonar-db/src/main/java/org/sonar/db/MyBatis.java @@ -29,8 +29,6 @@ import org.apache.ibatis.session.SqlSession; import org.apache.ibatis.session.SqlSessionFactory; import org.apache.ibatis.session.SqlSessionFactoryBuilder; import org.sonar.api.utils.log.Loggers; -import org.sonar.db.activity.ActivityDto; -import org.sonar.db.activity.ActivityMapper; import org.sonar.db.ce.CeActivityMapper; import org.sonar.db.ce.CeQueueMapper; import org.sonar.db.ce.CeScannerContextMapper; @@ -209,7 +207,6 @@ public class MyBatis { confBuilder.loadAlias("ActiveRule", ActiveRuleDto.class); confBuilder.loadAlias("ActiveRuleParam", ActiveRuleParamDto.class); confBuilder.loadAlias("RequirementMigration", RequirementMigrationDto.class); - confBuilder.loadAlias("Activity", ActivityDto.class); confBuilder.loadAlias("IdUuidPair", IdUuidPair.class); confBuilder.loadAlias("FilePathWithHash", FilePathWithHashDto.class); confBuilder.loadAlias("UuidWithProjectUuid", UuidWithProjectUuidDto.class); @@ -225,24 +222,57 @@ public class MyBatis { confBuilder.loadMapper(ResourceMapper.class); confBuilder.loadMapper("org.sonar.db.permission.PermissionMapper"); - Class<?>[] mappers = {ActivityMapper.class, ActiveDashboardMapper.class, AuthorMapper.class, DashboardMapper.class, + Class<?>[] mappers = { + ActiveDashboardMapper.class, + AuthorMapper.class, + DashboardMapper.class, DuplicationMapper.class, - IssueMapper.class, IssueChangeMapper.class, IssueFilterMapper.class, IssueFilterFavouriteMapper.class, + InternalPropertiesMapper.class, + IssueMapper.class, + IssueChangeMapper.class, + IssueFilterMapper.class, + IssueFilterFavouriteMapper.class, IsAliveMapper.class, - LoadedTemplateMapper.class, MeasureFilterMapper.class, MeasureFilterFavouriteMapper.class, - PermissionTemplateMapper.class, PermissionTemplateCharacteristicMapper.class, - PropertiesMapper.class, InternalPropertiesMapper.class, - PurgeMapper.class, ComponentKeyUpdaterMapper.class, ResourceIndexMapper.class, RoleMapper.class, RuleMapper.class, - SchemaMigrationMapper.class, WidgetMapper.class, WidgetPropertyMapper.class, - UserMapper.class, GroupMapper.class, UserGroupMapper.class, UserTokenMapper.class, + LoadedTemplateMapper.class, + MeasureFilterMapper.class, + MeasureFilterFavouriteMapper.class, + PermissionTemplateMapper.class, + PermissionTemplateCharacteristicMapper.class, + PropertiesMapper.class, + PurgeMapper.class, + ComponentKeyUpdaterMapper.class, + ResourceIndexMapper.class, + RoleMapper.class, RuleMapper.class, + SchemaMigrationMapper.class, + WidgetMapper.class, + WidgetPropertyMapper.class, + UserMapper.class, + GroupMapper.class, + UserGroupMapper.class, + UserTokenMapper.class, FileSourceMapper.class, NotificationQueueMapper.class, - GroupMembershipMapper.class, QualityProfileMapper.class, ActiveRuleMapper.class, QProfileChangeMapper.class, - MeasureMapper.class, MetricMapper.class, CustomMeasureMapper.class, QualityGateMapper.class, QualityGateConditionMapper.class, ComponentMapper.class, SnapshotMapper.class, - ProjectQgateAssociationMapper.class, EventMapper.class, - CeQueueMapper.class, CeActivityMapper.class, CeTaskInputMapper.class, CeScannerContextMapper.class, + GroupMembershipMapper.class, + QualityProfileMapper.class, + ActiveRuleMapper.class, + QProfileChangeMapper.class, + MeasureMapper.class, + MetricMapper.class, + CustomMeasureMapper.class, + QualityGateMapper.class, + QualityGateConditionMapper.class, + ComponentMapper.class, + SnapshotMapper.class, + ProjectQgateAssociationMapper.class, + EventMapper.class, + CeQueueMapper.class, + CeActivityMapper.class, + CeTaskInputMapper.class, + CeScannerContextMapper.class, ComponentLinkMapper.class, - Migration45Mapper.class, Migration50Mapper.class, Migration53Mapper.class + Migration45Mapper.class, + Migration50Mapper.class, + Migration53Mapper.class }; confBuilder.loadMappers(mappers); diff --git a/sonar-db/src/main/java/org/sonar/db/activity/ActivityDao.java b/sonar-db/src/main/java/org/sonar/db/activity/ActivityDao.java deleted file mode 100644 index 7c8a7e27416..00000000000 --- a/sonar-db/src/main/java/org/sonar/db/activity/ActivityDao.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2016 SonarSource SA - * mailto:contact AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.db.activity; - -import java.util.Date; -import org.sonar.api.utils.System2; -import org.sonar.db.AbstractDao; -import org.sonar.db.DbSession; -import org.sonar.db.MyBatis; - -public class ActivityDao extends AbstractDao { - - public ActivityDao(MyBatis mybatis, System2 system) { - super(mybatis, system); - } - - public void insert(DbSession session, ActivityDto dto) { - dto.setCreatedAt(new Date(now())); - session.getMapper(ActivityMapper.class).insert(dto); - } - -} diff --git a/sonar-db/src/main/java/org/sonar/db/activity/ActivityDto.java b/sonar-db/src/main/java/org/sonar/db/activity/ActivityDto.java deleted file mode 100644 index 70b8b7a4c00..00000000000 --- a/sonar-db/src/main/java/org/sonar/db/activity/ActivityDto.java +++ /dev/null @@ -1,114 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2016 SonarSource SA - * mailto:contact AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.db.activity; - -import java.util.Date; -import javax.annotation.Nullable; -import org.apache.commons.lang.builder.ReflectionToStringBuilder; -import org.apache.commons.lang.builder.ToStringStyle; - -public class ActivityDto { - - private String key; - private String profileKey; - private String message; - private String type; - private String action; - private String author; - private String data; - private Date createdAt; - - public ActivityDto setKey(String key) { - this.key = key; - return this; - } - - public String getKey() { - return key; - } - - public String getProfileKey() { - return profileKey; - } - - public ActivityDto setProfileKey(String profileKey) { - this.profileKey = profileKey; - return this; - } - - public Date getCreatedAt() { - return createdAt; - } - - public ActivityDto setCreatedAt(Date createdAt) { - this.createdAt = createdAt; - return this; - } - - public String getType() { - return type; - } - - public ActivityDto setType(String type) { - this.type = type; - return this; - } - - public String getAuthor() { - return author; - } - - public ActivityDto setAuthor(@Nullable String author) { - this.author = author; - return this; - } - - public String getData() { - return data; - } - - public ActivityDto setData(String data) { - this.data = data; - return this; - } - - public String getMessage() { - return message; - } - - public ActivityDto setMessage(@Nullable String message) { - this.message = message; - return this; - } - - public String getAction() { - return action; - } - - public ActivityDto setAction(String action) { - this.action = action; - return this; - } - - @Override - public String toString() { - return ReflectionToStringBuilder.toString(this, ToStringStyle.MULTI_LINE_STYLE); - } -} diff --git a/sonar-db/src/main/java/org/sonar/db/activity/ActivityMapper.java b/sonar-db/src/main/java/org/sonar/db/activity/ActivityMapper.java deleted file mode 100644 index b3e3b4cd2e6..00000000000 --- a/sonar-db/src/main/java/org/sonar/db/activity/ActivityMapper.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2016 SonarSource SA - * mailto:contact AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.db.activity; - -public interface ActivityMapper { - - void insert(ActivityDto dto); - -} diff --git a/sonar-db/src/main/java/org/sonar/db/activity/package-info.java b/sonar-db/src/main/java/org/sonar/db/activity/package-info.java deleted file mode 100644 index c111b234975..00000000000 --- a/sonar-db/src/main/java/org/sonar/db/activity/package-info.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2016 SonarSource SA - * mailto:contact AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -@ParametersAreNonnullByDefault -package org.sonar.db.activity; - -import javax.annotation.ParametersAreNonnullByDefault; - |