001/*
002 * Sonar, open source software quality management tool.
003 * Copyright (C) 2008-2012 SonarSource
004 * mailto:contact AT sonarsource DOT com
005 *
006 * Sonar is free software; you can redistribute it and/or
007 * modify it under the terms of the GNU Lesser General Public
008 * License as published by the Free Software Foundation; either
009 * version 3 of the License, or (at your option) any later version.
010 *
011 * Sonar is distributed in the hope that it will be useful,
012 * but WITHOUT ANY WARRANTY; without even the implied warranty of
013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
014 * Lesser General Public License for more details.
015 *
016 * You should have received a copy of the GNU Lesser General Public
017 * License along with Sonar; if not, write to the Free Software
018 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02
019 */
020package org.sonar.core.purge;
021
022import org.apache.ibatis.annotations.Param;
023
024import java.util.List;
025
026public interface PurgeMapper {
027
028  List<Long> selectSnapshotIds(PurgeSnapshotQuery query);
029
030  List<Long> selectProjectIdsByRootId(long rootResourceId);
031
032  void deleteSnapshot(long snapshotId);
033
034  void deleteSnapshotDependencies(long snapshotId);
035
036  void deleteSnapshotDuplications(long snapshotId);
037
038  void deleteSnapshotEvents(long snapshotId);
039
040  void deleteSnapshotMeasures(long snapshotId);
041
042  void deleteSnapshotMeasureData(long snapshotId);
043
044  void deleteSnapshotSource(long snapshotId);
045
046  void deleteSnapshotViolations(long snapshotId);
047
048  List<Long> selectMetricIdsWithoutHistoricalData();
049
050  List<Long> selectCharacteristicIdsToPurge();
051
052  void deleteSnapshotWastedMeasures(@Param("sid") long snapshotId, @Param("mids") List<Long> metricIds);
053
054  void deleteSnapshotMeasuresOnCharacteristics(@Param("sid") long snapshotId, @Param("cids") List<Long> characteristicIds);
055
056  void updatePurgeStatusToOne(long snapshotId);
057
058  void disableResource(long resourceId);
059
060  void deleteResourceIndex(long resourceId);
061
062  void deleteEvent(long eventId);
063
064  void setSnapshotIsLastToFalse(long resourceId);
065
066  void deleteResourceLinks(long resourceId);
067
068  void deleteResourceProperties(long resourceId);
069
070  void deleteResource(long resourceId);
071
072  void deleteResourceGroupRoles(long resourceId);
073
074  void deleteResourceUserRoles(long resourceId);
075
076  void deleteResourceManualMeasures(long resourceId);
077
078  void deleteResourceReviews(long resourceId);
079
080  void deleteResourceEvents(long resourceId);
081
082  void deleteResourceActionPlans(long resourceId);
083
084  void deleteAuthors(long developerId);
085
086  void closeResourceReviews(long resourceId);
087
088  List<PurgeableSnapshotDto> selectPurgeableSnapshotsWithEvents(long resourceId);
089
090  List<PurgeableSnapshotDto> selectPurgeableSnapshotsWithoutEvents(long resourceId);
091
092  List<Long> selectResourceIdsByRootId(long rootProjectId);
093}