You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

PurgeMapper.java 6.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. /*
  2. * SonarQube
  3. * Copyright (C) 2009-2020 SonarSource SA
  4. * mailto:info AT sonarsource DOT com
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 3 of the License, or (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public License
  17. * along with this program; if not, write to the Free Software Foundation,
  18. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  19. */
  20. package org.sonar.db.purge;
  21. import java.util.List;
  22. import java.util.Set;
  23. import javax.annotation.CheckForNull;
  24. import javax.annotation.Nullable;
  25. import org.apache.ibatis.annotations.Param;
  26. public interface PurgeMapper {
  27. List<IdUuidPair> selectAnalysisIdsAndUuids(PurgeSnapshotQuery query);
  28. /**
  29. * Returns the list of modules/subviews and the application/view/project for the specified project_uuid.
  30. */
  31. List<IdUuidPair> selectRootAndModulesOrSubviewsByProjectUuid(@Param("rootUuid") String rootUuid);
  32. Set<String> selectDisabledComponentsWithFileSource(@Param("projectUuid") String projectUuid);
  33. Set<String> selectDisabledComponentsWithUnresolvedIssues(@Param("projectUuid") String projectUuid);
  34. Set<String> selectDisabledComponentsWithLiveMeasures(@Param("projectUuid") String projectUuid);
  35. void deleteAnalyses(@Param("analysisUuids") List<String> analysisUuids);
  36. void deleteAnalysisProperties(@Param("analysisUuids") List<String> analysisUuids);
  37. void deleteAnalysisDuplications(@Param("analysisUuids") List<String> analysisUuids);
  38. void deleteAnalysisEvents(@Param("analysisUuids") List<String> analysisUuids);
  39. void deleteAnalysisEventComponentChanges(@Param("analysisUuids") List<String> analysisUuids);
  40. void deleteAnalysisMeasures(@Param("analysisUuids") List<String> analysisUuids);
  41. void fullDeleteComponentMeasures(@Param("componentUuids") List<String> componentUuids);
  42. /**
  43. * Purge status flag is used to not attempt to remove duplications & historical data of analyses
  44. * for which we already removed them.
  45. */
  46. void updatePurgeStatusToOne(@Param("analysisUuids") List<String> analysisUuid);
  47. void resolveComponentIssuesNotAlreadyResolved(@Param("componentUuids") List<String> componentUuids, @Param("dateAsLong") Long dateAsLong);
  48. void deleteProjectLinksByProjectUuid(@Param("rootUuid") String rootUuid);
  49. void deletePropertiesByComponentIds(@Param("componentIds") List<Long> componentIds);
  50. void deleteComponentsByProjectUuid(@Param("rootUuid") String rootUuid);
  51. void deleteProjectsByProjectUuid(@Param("projectUuid") String projectUuid);
  52. void deleteComponentsByUuids(@Param("componentUuids") List<String> componentUuids);
  53. void deleteGroupRolesByComponentId(@Param("rootId") long rootId);
  54. void deleteUserRolesByComponentId(@Param("rootId") long rootId);
  55. void deleteManualMeasuresByComponentUuids(@Param("componentUuids") List<String> componentUuids);
  56. void deleteEventsByComponentUuid(@Param("componentUuid") String componentUuid);
  57. void deleteEventComponentChangesByComponentUuid(@Param("componentUuid") String componentUuid);
  58. List<PurgeableAnalysisDto> selectPurgeableAnalyses(@Param("componentUuid") String componentUuid);
  59. void deleteIssueChangesByProjectUuid(@Param("projectUuid") String projectUuid);
  60. void deleteIssuesByProjectUuid(@Param("projectUuid") String projectUuid);
  61. List<String> selectOldClosedIssueKeys(@Param("projectUuid") String projectUuid, @Nullable @Param("toDate") Long toDate);
  62. List<String> selectStaleBranchesAndPullRequests(@Param("projectUuid") String projectUuid, @Param("toDate") Long toDate);
  63. @CheckForNull
  64. String selectSpecificAnalysisNewCodePeriod(@Param("projectUuid") String projectUuid);
  65. List<IdUuidPair> selectDisabledComponentsWithoutIssues(@Param("projectUuid") String projectUuid);
  66. void deleteIssuesFromKeys(@Param("keys") List<String> keys);
  67. void deleteIssueChangesFromIssueKeys(@Param("issueKeys") List<String> issueKeys);
  68. void deleteFileSourcesByProjectUuid(String rootProjectUuid);
  69. void deleteFileSourcesByFileUuid(@Param("fileUuids") List<String> fileUuids);
  70. void deleteCeTaskCharacteristicsOfCeActivityByRootUuidOrBefore(@Nullable @Param("rootUuid") String rootUuid,
  71. @Nullable @Param("createdAtBefore") Long createdAtBefore);
  72. void deleteCeTaskInputOfCeActivityByRootUuidOrBefore(@Nullable @Param("rootUuid") String rootUuid,
  73. @Nullable @Param("createdAtBefore") Long createdAtBefore);
  74. void deleteCeScannerContextOfCeActivityByRootUuidOrBefore(@Nullable @Param("rootUuid") String rootUuid,
  75. @Nullable @Param("createdAtBefore") Long createdAtBefore);
  76. void deleteCeTaskMessageOfCeActivityByRootUuidOrBefore(@Nullable @Param("rootUuid") String rootUuid,
  77. @Nullable @Param("createdAtBefore") Long createdAtBefore);
  78. /**
  79. * Delete rows in CE_ACTIVITY of tasks of the specified component and/or created before specified date.
  80. */
  81. void deleteCeActivityByRootUuidOrBefore(@Nullable @Param("rootUuid") String rootUuid,
  82. @Nullable @Param("createdAtBefore") Long createdAtBefore);
  83. void deleteCeScannerContextOfCeQueueByRootUuid(@Param("rootUuid") String rootUuid);
  84. void deleteCeTaskCharacteristicsOfCeQueueByRootUuid(@Param("rootUuid") String rootUuid);
  85. void deleteCeTaskInputOfCeQueueByRootUuid(@Param("rootUuid") String rootUuid);
  86. void deleteCeTaskMessageOfCeQueueByRootUuid(@Param("rootUuid") String rootUuid);
  87. void deleteCeQueueByRootUuid(@Param("rootUuid") String rootUuid);
  88. void deleteWebhooksByProjectUuid(@Param("projectUuid") String projectUuid);
  89. void deleteWebhookDeliveriesByProjectUuid(@Param("projectUuid") String projectUuid);
  90. void deleteProjectMappingsByProjectUuid(@Param("projectUuid") String projectUuid);
  91. void deleteProjectAlmBindingsByProjectUuid(@Param("projectUuid") String projectUuid);
  92. void deleteBranchByUuid(@Param("uuid") String uuid);
  93. void deleteLiveMeasuresByProjectUuid(@Param("projectUuid") String projectUuid);
  94. void deleteLiveMeasuresByComponentUuids(@Param("componentUuids") List<String> componentUuids);
  95. void deleteNewCodePeriodsByRootUuid(String rootUuid);
  96. }