1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
|
/*
* SonarQube
* Copyright (C) 2009-2025 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.sonar.db.purge;
import java.util.List;
import java.util.Set;
import javax.annotation.CheckForNull;
import javax.annotation.Nullable;
import org.apache.ibatis.annotations.Param;
public interface PurgeMapper {
List<String> selectAnalysisUuids(PurgeSnapshotQuery query);
/**
* Returns the list of subviews and the application/view/project for the specified project_uuid.
*/
List<String> selectRootAndSubviewsByProjectUuid(@Param("rootUuid") String rootUuid);
Set<String> selectDisabledComponentsWithFileSource(@Param("branchUuid") String branchUuid);
Set<String> selectDisabledComponentsWithUnresolvedIssues(@Param("branchUuid") String branchUuid);
Set<String> selectDisabledComponentsWithMeasures(@Param("branchUuid") String branchUuid);
void deleteAnalyses(@Param("analysisUuids") List<String> analysisUuids);
void deleteAnalysisProperties(@Param("analysisUuids") List<String> analysisUuids);
void deleteAnalysisDuplications(@Param("analysisUuids") List<String> analysisUuids);
void deleteAnalysisEvents(@Param("analysisUuids") List<String> analysisUuids);
void deleteAnalysisEventComponentChanges(@Param("analysisUuids") List<String> analysisUuids);
void deleteAnalysisMeasures(@Param("analysisUuids") List<String> analysisUuids);
void fullDeleteComponentMeasures(@Param("componentUuids") List<String> componentUuids);
/**
* Purge status flag is used to not attempt to remove duplications & historical data of analyses
* for which we already removed them.
*/
void updatePurgeStatusToOne(@Param("analysisUuids") List<String> analysisUuid);
void resolveComponentIssuesNotAlreadyResolved(@Param("componentUuids") List<String> componentUuids, @Param("dateAsLong") Long dateAsLong);
void deleteProjectLinksByProjectUuid(@Param("rootUuid") String rootUuid);
void deletePropertiesByEntityUuids(@Param("entityUuids") List<String> entityUuids);
void deleteComponentsByBranchUuid(@Param("rootUuid") String rootUuid);
void deleteNonMainBranchComponentsByProjectUuid(@Param("uuid") String uuid);
void deleteProjectsByProjectUuid(@Param("projectUuid") String projectUuid);
void deleteComponentsByUuids(@Param("componentUuids") List<String> componentUuids);
void deleteGroupRolesByEntityUuid(@Param("entityUuid") String entityUuid);
void deleteUserRolesByEntityUuid(@Param("entityUuid") String entityUuid);
void deleteEventsByComponentUuid(@Param("componentUuid") String componentUuid);
void deleteEventComponentChangesByComponentUuid(@Param("componentUuid") String componentUuid);
List<PurgeableAnalysisDto> selectProcessedAnalysisByComponentUuid(@Param("componentUuid") String componentUuid);
void deleteIssuesByProjectUuid(@Param("projectUuid") String projectUuid);
void deleteIssueChangesByProjectUuid(@Param("projectUuid") String projectUuid);
List<String> selectBranchOrphanIssues(@Param("branchUuid") String branchUuid);
void deleteNewCodeReferenceIssuesByProjectUuid(@Param("projectUuid") String projectUuid);
void deleteIssuesImpactsByProjectUuid(@Param("projectUuid") String projectUuid);
List<String> selectOldClosedIssueKeys(@Param("projectUuid") String projectUuid, @Nullable @Param("toDate") Long toDate);
List<String> selectStaleBranchesAndPullRequests(@Param("projectUuid") String projectUuid, @Param("toDate") Long toDate);
@CheckForNull
String selectSpecificAnalysisNewCodePeriod(@Param("projectUuid") String projectUuid);
List<String> selectDisabledComponentsWithoutIssues(@Param("branchUuid") String branchUuid);
void deleteIssuesFromKeys(@Param("keys") List<String> keys);
void deleteIssueChangesFromIssueKeys(@Param("issueKeys") List<String> issueKeys);
void deleteNewCodeReferenceIssuesFromKeys(@Param("issueKeys") List<String> keys);
void deleteIssuesImpactsFromKeys(@Param("issueKeys") List<String> keys);
void deleteFileSourcesByProjectUuid(String rootProjectUuid);
void deleteFileSourcesByFileUuid(@Param("fileUuids") List<String> fileUuids);
void deleteCeTaskCharacteristicsOfCeActivityByRootUuidOrBefore(@Nullable @Param("rootUuid") String rootUuid,
@Nullable @Param("entityUuidToPurge") String entityUuidToPurge, @Nullable @Param("createdAtBefore") Long createdAtBefore);
void deleteCeTaskInputOfCeActivityByRootUuidOrBefore(@Nullable @Param("rootUuid") String rootUuid,
@Nullable @Param("entityUuidToPurge") String entityUuidToPurge, @Nullable @Param("createdAtBefore") Long createdAtBefore);
void deleteCeScannerContextOfCeActivityByRootUuidOrBefore(@Nullable @Param("rootUuid") String rootUuid,
@Nullable @Param("entityUuidToPurge") String entityUuidToPurge, @Nullable @Param("createdAtBefore") Long createdAtBefore);
void deleteCeTaskMessageOfCeActivityByRootUuidOrBefore(@Nullable @Param("rootUuid") String rootUuid,
@Nullable @Param("entityUuidToPurge") String entityUuidToPurge, @Nullable @Param("createdAtBefore") Long createdAtBefore);
/**
* Delete rows in CE_ACTIVITY of tasks of the specified component and/or created before specified date.
*/
void deleteCeActivityByRootUuidOrBefore(@Nullable @Param("rootUuid") String rootUuid,
@Nullable @Param("entityUuidToPurge") String entityUuidToPurge, @Nullable @Param("createdAtBefore") Long createdAtBefore);
void deleteCeScannerContextOfCeQueueByRootUuid(@Param("rootUuid") String rootUuid);
void deleteCeTaskCharacteristicsOfCeQueueByRootUuid(@Param("rootUuid") String rootUuid);
void deleteCeTaskInputOfCeQueueByRootUuid(@Param("rootUuid") String rootUuid);
void deleteCeTaskMessageOfCeQueueByRootUuid(@Param("rootUuid") String rootUuid);
void deleteCeQueueByRootUuid(@Param("rootUuid") String rootUuid);
void deleteWebhooksByProjectUuid(@Param("projectUuid") String projectUuid);
void deleteWebhookDeliveriesByProjectUuid(@Param("projectUuid") String projectUuid);
void deleteAppProjectsByAppUuid(@Param("applicationUuid") String applicationUuid);
void deleteAppProjectsByProjectUuid(@Param("projectUuid") String projectUuid);
void deleteAppBranchProjectBranchesByAppUuid(@Param("applicationUuid") String applicationUuid);
void deleteAppBranchProjectBranchesByProjectUuid(@Param("projectUuid") String projectUuid);
void deleteAppBranchProjectsByAppBranchUuid(@Param("branchUuid") String applicationBranchUuid);
void deleteAppBranchProjectBranchesByProjectBranchUuid(@Param("projectBranchUuid") String projectBranchUuid);
void deletePortfolioProjectsByBranchUuid(@Param("branchUuid") String branchUuid);
void deletePortfolioProjectsByProjectUuid(@Param("projectUuid") String projectUuid);
void deletePortfolioProjectBranchesByBranchUuid(@Param("branchUuid") String branchUuid);
void deleteBranchByUuid(@Param("uuid") String uuid);
void deleteMeasuresByBranchUuid(@Param("branchUuid") String branchUuid);
void deleteMeasuresByComponentUuids(@Param("componentUuids") List<String> componentUuids);
void deleteNewCodePeriodsByProjectUuid(String projectUuid);
void deleteNewCodePeriodsByBranchUuid(String branchUuid);
void deleteProjectAlmSettingsByProjectUuid(@Param("projectUuid") String projectUuid);
void deleteProjectBadgeTokenByProjectUuid(@Param("projectUuid") String rootUuid);
void deleteUserDismissedMessagesByProjectUuid(@Param("projectUuid") String projectUuid);
void deleteScannerAnalysisCacheByBranchUuid(@Param("branchUuid") String branchUuid);
void deleteReportSchedulesByBranchUuid(@Param("branchUuid") String branchUuid);
void deleteReportSubscriptionsByBranchUuid(@Param("branchUuid") String branchUuid);
void deleteReportSchedulesByPortfolioUuids(@Param("portfolioUuids") List<String> portfolioUuids);
void deleteReportSubscriptionsByPortfolioUuids(@Param("portfolioUuids") List<String> portfolioUuids);
void deleteAnticipatedTransitionsByProjectUuidAndCreationDate(@Param("projectUuid") String projectUuid, @Param("createdAtBefore") Long createdAtBefore);
void deleteIssuesFixedByBranchUuid(@Param("branchUuid") String branchUuid);
void deleteScaAnalysesByComponentUuid(@Param("componentUuid") String componentUuid);
void deleteScaDependenciesByComponentUuid(@Param("componentUuid") String componentUuid);
void deleteScaIssuesReleasesByComponentUuid(@Param("componentUuid") String componentUuid);
void deleteScaIssuesReleasesChangesByComponentUuid(@Param("componentUuid") String componentUuid);
void deleteScaReleasesByComponentUuid(@Param("componentUuid") String componentUuid);
void deleteScaLicenseProfileProjectsByProjectUuid(@Param("projectUuid") String projectUuid);
void deleteArchitectureGraphsByBranchUuid(@Param("branchUuid") String branchUuid);
}
|