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.

ActiveRuleMapper.java 3.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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.qualityprofile;
  21. import java.util.Collection;
  22. import java.util.List;
  23. import javax.annotation.CheckForNull;
  24. import javax.annotation.Nullable;
  25. import org.apache.ibatis.annotations.Param;
  26. import org.apache.ibatis.session.ResultHandler;
  27. import org.sonar.api.rule.RuleStatus;
  28. import org.sonar.db.KeyLongValue;
  29. public interface ActiveRuleMapper {
  30. void insert(ActiveRuleDto dto);
  31. void update(ActiveRuleDto dto);
  32. void delete(String activeRuleUuid);
  33. void deleteByRuleProfileUuids(@Param("rulesProfileUuids") Collection<String> rulesProfileUuids);
  34. void deleteByUuids(@Param("uuids") Collection<String> uuids);
  35. @CheckForNull
  36. ActiveRuleDto selectByKey(@Param("ruleProfileUuid") String ruleProfileUuid, @Param("repository") String repository, @Param("rule") String rule);
  37. List<ActiveRuleDto> selectByKeys(@Param("keys") List<ActiveRuleKey> keys);
  38. List<OrgActiveRuleDto> selectByRuleUuid(@Param("organizationUuid") String organizationUuid, @Param("ruleUuid") String ruleUuid);
  39. List<ActiveRuleDto> selectByRuleUuidOfAllOrganizations(String ruleUuid);
  40. List<OrgActiveRuleDto> selectByRuleUuids(@Param("organizationUuid") String organizationUuid, @Param("ruleUuids") List<String> partitionOfRuleUuids);
  41. List<OrgActiveRuleDto> selectByProfileUuid(String uuid);
  42. List<OrgActiveRuleDto> selectByTypeAndProfileUuids(@Param("types") List<Integer> types, @Param("profileUuids") List<String> uuids);
  43. List<ActiveRuleDto> selectByRuleProfileUuid(@Param("ruleProfileUuid") String uuid);
  44. List<ActiveRuleDto> selectByRuleUuidsAndRuleProfileUuids(
  45. @Param("ruleUuids") Collection<String> ruleUuids,
  46. @Param("ruleProfileUuids") Collection<String> ruleProfileUuids);
  47. void insertParameter(ActiveRuleParamDto dto);
  48. void updateParameter(ActiveRuleParamDto dto);
  49. void deleteParameters(String activeRuleUuid);
  50. void deleteParametersByRuleProfileUuids(@Param("rulesProfileUuids") Collection<String> rulesProfileUuids);
  51. void deleteParameter(String activeRuleParamUuid);
  52. void deleteParamsByActiveRuleUuids(@Param("activeRuleUuids") Collection<String> activeRuleUuids);
  53. List<ActiveRuleParamDto> selectParamsByActiveRuleUuid(String activeRuleUuid);
  54. List<ActiveRuleParamDto> selectParamsByActiveRuleUuids(@Param("uuids") List<String> uuids);
  55. List<KeyLongValue> countActiveRulesByQuery(@Param("organizationUuid") String organizationUuid, @Param("profileUuids") List<String> profileUuids,
  56. @Nullable @Param("ruleStatus") RuleStatus ruleStatus, @Param("inheritance") String inheritance);
  57. void scrollAllForIndexing(ResultHandler<IndexedActiveRuleDto> handler);
  58. void scrollByUuidsForIndexing(@Param("uuids") Collection<String> uuids, ResultHandler<IndexedActiveRuleDto> handler);
  59. void scrollByRuleProfileUuidForIndexing(@Param("ruleProfileUuid") String ruleProfileUuid, ResultHandler<IndexedActiveRuleDto> handler);
  60. }